Transaction
Classes
Typedefs
TransactionMeta : CallRequest
Transaction
Kind: global class
instance
.hash ⇒
string
|undefined
.recover() ⇒
string
.encode([includeSignature]) ⇒
Buffer
.serialize() ⇒
string
static
new Transaction(options)
Create a transaction.
Param | Type | Description |
---|---|---|
options |
| |
[options.from] |
| The sender address. |
[options.nonce] |
| This allows to overwrite your own pending transactions that use the same nonce. |
[options.gasPrice] |
| The price of gas for this transaction in drip. |
[options.gas] |
| The amount of gas to use for the transaction (unused gas is refunded). |
[options.to] |
| The destination address of the message, left undefined for a contract-creation transaction. |
[options.value] |
| The value transferred for the transaction in drip, also the endowment if it’s a contract-creation transaction. |
[options.storageLimit] |
| The storage limit specified by the sender. |
[options.epochHeight] |
| The epoch proposed by the sender. Note that this is NOT the epoch of the block containing this transaction. |
[options.chainId] |
| The chain ID specified by the sender. |
[options.data] |
| Either a ABI byte string containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialisation code. |
[options.r] |
| ECDSA signature r |
[options.s] |
| ECDSA signature s |
[options.v] |
| ECDSA recovery id |
transaction.hash ⇒ string
| undefined
string
| undefined
Getter of transaction hash include signature.
Note: calculate every time.
Kind: instance property of Transaction
Returns: string
| undefined
- If transaction has r,s,v return hex string, else return undefined.
transaction.sign(privateKey, networkId) ⇒ Transaction
Transaction
Sign transaction and set 'r','s','v'.
Kind: instance method of Transaction
Param | Type | Description |
---|---|---|
privateKey |
| Private key hex string. |
networkId |
| fullnode's network id. |
transaction.recover() ⇒ string
string
Recover public key from signed Transaction.
Kind: instance method of Transaction
transaction.encode([includeSignature]) ⇒ Buffer
Buffer
Encode rlp.
Kind: instance method of Transaction
Param | Type | Default | Description |
---|---|---|---|
[includeSignature] |
|
| Whether or not to include the signature. |
transaction.serialize() ⇒ string
string
Get the raw transaction hex string.
Kind: instance method of Transaction
Returns: string
- Hex string
Transaction.decodeRaw(raw) ⇒ Transaction
Transaction
Decode rlp encoded raw transaction hex string
Kind: static method of Transaction
Returns: Transaction
- A Transaction instance
Param | Type | Description |
---|---|---|
raw |
| rlp encoded transaction hex string |
TransactionMeta : CallRequest
CallRequest
Kind: global typedef
Last updated