Axentro wallet and transactions using js/typescript
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 ( ) ) ;
import { StandardWallet } from 'axentrojs' ;
const wallet = StandardWallet . importFromWif ( "..." ) ;
wallet . signTransaction ( { ...} , 0 ) ;
wallet . address ( ) ;
import { HdWallet , Network } from 'axentrojs' ;
const wallet = HdWallet . create ( Network . mainnet ) ;
wallet . signTransaction ( { ...} , 0 ) ;
wallet . address ( ) ;
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 ) ;