@pixelgeniusid/vexjs
v23.0.1
Published
JavaScript API to interact with the Vexanium blockchain (adapted from Mandel-EOSJS)
Readme
@pixelgeniusid/vexjs
⚠ This is a modified fork of mandel-eosjs
Adapted by pixelGeniusid for the Vexanium blockchain.
Installation
NPM
@pixelgeniusid/vexjs is an adaptation of mandel-eosjs to work seamlessly with Vexanium nodes and features.
npm install @pixelgeniusid/vexjsNodeJS Dependency
npm install @pixelgeniusid/vexjsUsing with Typescript
If you're using Node (not a browser), make sure the dom lib is referenced in your tsconfig.json:
{
"compilerOptions": {
"lib": [..., "dom"]
}
}Browser Distribution
Clone this repository locally, then run:
npm run build-webThe browser distribution will be located in dist-web and can be directly copied into your project repository.
The dist-web folder contains minified bundles ready for production, along with source-mapped versions for debugging.
Getting Started
Example usage of @pixelgeniusid/vexjs:
npm init es6
npm install @pixelgeniusid/vexjs
node node_testnode_test.js
import { Api, JsonRpc, RpcError } from '@pixelgeniusid/vexjs';
import fetch from 'node-fetch'
const rpc = new JsonRpc('https://testnet.vexanium.com', { fetch });
const api = new Api({ rpc, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });
const info = await rpc.get_info();
console.log(info);Import
ES Modules
import { Api, JsonRpc, RpcError } from '@pixelgeniusid/vexjs';
import { JsSignatureProvider } from '@pixelgeniusid/vexjs/dist/vexjs-jssig'; // dev onlyCommonJS
const { Api, JsonRpc, RpcError } = require('@pixelgeniusid/vexjs');
const fetch = require('node-fetch');Basic Usage
Signature Provider
const defaultPrivateKey = "YOUR_PRIVATE_KEY";
const signatureProvider = new JsSignatureProvider([defaultPrivateKey]);JSON-RPC
const rpc = new JsonRpc('https://testnet.vexanium.com', { fetch });API
const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });Sending a transaction
(async () => {
const result = await api.transact({
actions: [{
account: 'vex.token',
name: 'transfer',
authorization: [{
actor: 'youraccount',
permission: 'active',
}],
data: {
from: 'youraccount',
to: 'targetaccount',
quantity: '1.0000 VEX',
memo: 'Test transfer',
},
}]
}, {
blocksBehind: 3,
expireSeconds: 30
});
console.dir(result);
})();License
This project is released under the MIT License.
See LICENSE for details.
Original work:
- mandel-eosjs — © 2021-2022 EOS Network Foundation
- eosjs — © 2017-2019 block.one
Modifications for Vexanium blockchain:
- © 2025 pixelGeniusid
