Skip to content

Commit

Permalink
v3.3.0
Browse files Browse the repository at this point in the history
adjust module settings to ensure hyperion 3.3.10 compatibility
  • Loading branch information
igorls committed Apr 14, 2024
1 parent a0c230e commit 222a3ed
Show file tree
Hide file tree
Showing 15 changed files with 3,047 additions and 60 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tools
CMakeLists.txt
tsconfig.json
*.tgz
abieos
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Node.js native binding for [abieos](https://github.com/EOSIO/abieos), with some
Made with ♥ by [EOS Rio](https://eosrio.io/)

----
**Only Linux is supported for now, import will be null on others**
**Only Linux is supported for now**

- Typescript typings included
- Prebuilt binary included (Clang 9.0.0 required to build)
- Prebuilt binary included (Clang 18 required to build)

### Install

Expand All @@ -39,12 +39,20 @@ Check the [/examples](https://github.com/eosrio/node-abieos/tree/master/examples

### Building

env setup instructions soon
Make sure you have Clang installed on your system:
We recommend using Clang 18 to build the `abieos` C++ library.

```bash
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
```

Clone and Build
```shell script
git clone https://github.com/eosrio/node-abieos.git
cd node-abieos
# linux
npm install
npm run build:linux
# windows
npm run build:win
npm run build:tsc
```
Binary file removed dist/abieos.node
Binary file not shown.
Binary file removed eosrio-node-abieos-3.1.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/basic.js → examples/basic.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Abieos} from "../lib/abieos.js";
import {readFileSync} from "node:fs";
import {typeTests} from "./tests.js";
import {typeTests} from "./tests.mjs";

const ABIs = [
{code: 'eosio', path: './ABIs/eosio.json'},
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/abieos.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="node" />
declare let abieos: any | null;
declare const abieos: any;
export declare class Abieos {
private static instance;
static native: typeof abieos;
Expand Down
2 changes: 1 addition & 1 deletion lib/abieos.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions lib/abieos.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
let modulePath = "../dist/abieos.node";
let abieos = null;
if (process.platform === 'linux') {
abieos = require(modulePath);
}
else if (process.platform === 'win32') {
// throw new Error(`${process.platform} is not supported by node-abieos`);
abieos = null;
}
export class Abieos {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Abieos = void 0;
const abieos = require("./abieos.node");
class Abieos {
constructor() {
Abieos.native = abieos;
}
Expand Down Expand Up @@ -98,3 +91,4 @@ export class Abieos {
return Abieos.native.delete_contract(contractName);
}
}
exports.Abieos = Abieos;
Binary file added lib/abieos.node
Binary file not shown.
15 changes: 2 additions & 13 deletions lib/abieos.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import {createRequire} from 'module';

const require = createRequire(import.meta.url);

let modulePath = "../dist/abieos.node";
let abieos: any | null = null;
if (process.platform === 'linux') {
abieos = require(modulePath);
} else if (process.platform === 'win32') {
// throw new Error(`${process.platform} is not supported by node-abieos`);
abieos = null;
}
const abieos = require("./abieos.node");

export class Abieos {
private static instance: Abieos;
Expand Down Expand Up @@ -103,4 +92,4 @@ export class Abieos {
public deleteContract(contractName: string): boolean {
return Abieos.native.delete_contract(contractName) as boolean;
}
}
}

0 comments on commit 222a3ed

Please sign in to comment.