Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.13 KB

README.md

File metadata and controls

54 lines (38 loc) · 1.13 KB

Axentrojs

Axentro wallet and transactions using js/typescript

Create a wallet

import {StandardWallet, Network} from 'axentrojs';

const wallet = StandardWallet.create(Network.mainnet);
console.log(wallet.address());

Import/export a wallet from wif

import {StandardWallet} from 'axentrojs';

const wallet = StandardWallet.importFromWif("...");
console.log(wallet.address());
console.log(wallet.exportToWif());

Sign a transaction

import {StandardWallet} from 'axentrojs';

const wallet = StandardWallet.importFromWif("...");
wallet.signTransaction({...}, 0);
wallet.address();

Create a hd wallet

import {HdWallet, Network} from 'axentrojs';

const wallet = HdWallet.create(Network.mainnet);
wallet.signTransaction({...}, 0);
wallet.address();

Send token

import {StandardWallet, AxentroNode} from 'axentrojs';

const node = new AxentroNode('https://testnet.axentro.io/api/v1');
const wallet = StandardWallet.importFromWif("...");
// send 1 AXNT to address
const tx = wallet.createAndSignTransaction(100000000, "address");
await node.broadcastTransaction(tx);