Wallet API
Verify address & construct transaction

Verify address & construct transaction#

The client uses the SDK to first verify the legitimacy of the address and then construct the transaction.

//Verify address
let valid = await wallet.validAddress({
     address: newAddress.address
});
console.log("verify address isValid:", valid.isValid);

// Sign a transaction
let signParams = {
     privateKey: derivePrivateKey,
     data: {
         to: newAddress.address,
         value: new BigNumber(0),
         nonce: 5,
         gasPrice: new BigNumber(100 * 1000000000),
         gasLimit: new BigNumber(21000),
         chainId: 42
     }
};

let signedTx = await wallet.signTransaction(signParams);
console.log("signed tx:", signedTx);