This page provides examples of using the RPC methods in this section.
Setting Up an Account
constmnes='urge clog right example dish drill card maximum mix bachelor section select';constpassword='some phrase';constadded_mnemonic=harmony.wallet.addByMnemonic(mnes,0);awaitharmony.wallet.encryptAccount(added_mnemonic.address, password);
consttxn=harmony.transactions.newTx(txn_object);constsigned=awaitharmony.wallet.signTransaction(txn,harmony.wallet.signer, password);console.log(signed.getRawTransaction());const [Transaction,hash] =awaitsigned.sendTransaction();constconfirmed=awaitTransaction.confirm(hash);console.log('Transaction Receipt',confirmed.receipt);if (confirmed.isConfirmed()) {console.log('transaction did go through');}