Account
Send transaction
// If you want send transaction signed by your own private key, it's need add to wallet before you send transaction
const privateKey = '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef'; // use your own private key
const account = conflux.wallet.addPrivateKey(privateKey);
await conflux.cfx.sendTransaction({
from: account.address,
to: 'cfxtest:xxxx',
value: 100
});Random create
// create through wallet
const account = conflux.wallet.addRandom();
// create though PrivateKeyAccount
const { PrivateKeyAccount } = require('js-conflux-sdk');
const networkId = 1;
const randomSeed = '0xfffff'; // any random buffer
const account = PrivateKeyAccount.random(randomSeed, networkId);Import keystore file
Export to keystore file
Sign message
HD Wallet
Last updated
Was this helpful?