All Account methods

All methods that can be called by an account instance.

MethodParametersReturnDescription

getBalance

()

number

Gets that account instance's balance

getNonce

()

number

Gets that account instance's nonce

getAddress

()

string

Gets that account instance's address

sync

()

Promise<void>

Syncs that account instance's balance and nonce with the provided node.

getInfo

()

Promise<IAccountInfo>

Returns that address' info from the provided node.

buildTransaction

(contracts: IContractRequest[], txData?: string[], options?: ITxOptionsRequest)

Promise<ITransaction>

Builds a simplified transaction into a transaction ready to be signed.

signMessage

(message: string)

Promise<string>

Uses the account instance private key to sign any message.

signTransaction

(tx: ITransaction)

Promise<ITransaction>

Uses the account instance private key to sign a transaction.

quickSend

(contracts: IContractRequest[], txData?: string[], options?: ITxOptionsRequest)

Promise<IBroadcastResponse>

Simplifies the build/sign/broadcast flow into a single method.

downloadAsPem

(path?: string)

Promise<void>

Saves the .pem file for that account instance private key and address.

broadcastTransactions

(txs: string[] | ITransaction[])

Promise<IBroadcastResponse>

Broadcasts an array of transactions to the provided node.

validateSignature

(message: string, signature: string)

Promise<boolean>

Checks if a signature is compatible with a given address and message.

Last updated