ethers.js/docs/api/utils/transactions/README.md
2020-02-02 00:53:22 -05:00

2.9 KiB

Documentation: html

Transactions

Types

UnsignedTransaction

An unsigned transaction represents a transaction that has not been signed.

unsignedTransaction . to => string< Address >

unsignedTransaction . nonce => number

unsignedTransaction . gasLimit => BigNumber

unsignedTransaction . gasPrice => BigNumber

unsignedTransaction . data => BytesLike

unsignedTransaction . value => BigNumber

unsignedTransaction . chainId => number

Transaction

A generic object to represent a transaction.

unsignedTransaction . hash => string< DataHexstring< 32 > >

unsignedTransaction . to => string< Address >

unsignedTransaction . from => string< Address >

unsignedTransaction . nonce => number

unsignedTransaction . gasLimit => BigNumber

unsignedTransaction . gasPrice => BigNumber

unsignedTransaction . data => BytesLike

unsignedTransaction . value => BigNumber

unsignedTransaction . chainId => number

unsignedTransaction . r => BytesLike

unsignedTransaction . s => BytesLike

unsignedTransaction . v => number

Functions

ethers . utils . computeAddress ( publicOrPrivateKey ) => string< Address >

Compute the address of publicOrPrivateKey. If a public key is provided, it may be either compressed or uncompressed.

ethers . utils . parse ( aBytesLike ) => Transaction

Parses the transaction properties from a serialized transactions.

ethers . utils . recoverAddress ( digest , aSignatureLike ) => string< Address >

Computes the address that signed digest to get aSignatureLike using the ecrecover algorithm.

ethers . utils . serialize ( transaction [ , signature ] ) => string< DataHexstring >

Computes the serialized *transaction/, optionally signed with *signature//. If signature is not presented, the unsigned serialized transaction is returned, which can be used to compute the hash necessary to sign.

This function uses EIP-155 if a chainId is provided, otherwise legacy serialization is used. It is highly recommended to always specify a chainId.


Content Hash: 51f4a8594ba122a2c43d7b2cffdb2bf461f3212cea828e715a76c76ef8dd1ae1