Class: Transaction
"Transaction".Transaction
The Transaction class contains functions that are needed for Ethereum transactions.
#
Hierarchy- Transaction
#
Constructors#
constructor+ new Transaction(params
: { currencyNetwork: CurrencyNetwork ; provider: TLProvider ; signer: TLSigner }): Transaction
Defined in src/Transaction.ts:43
#
Parameters:Name | Type |
---|---|
params | { currencyNetwork: CurrencyNetwork ; provider: TLProvider ; signer: TLSigner } |
Returns: Transaction
#
Methods#
confirmâ–¸ confirm(rawTx
: RawTxObject): Promise<string>
Defined in src/Transaction.ts:136
Signs and sends the given transaction object.
#
Parameters:Name | Type | Description |
---|---|---|
rawTx | RawTxObject | Raw transaction object. |
Returns: Promise<string>
#
getAppliedDelegationFeesâ–¸ getAppliedDelegationFees(txHash
: string): Promise<TxFeesAmounts[]>
Defined in src/Transaction.ts:155
Get the effective delegation fees via enveloping transaction hash
#
Parameters:Name | Type | Description |
---|---|---|
txHash | string | the hash of the transaction in which fees were paid |
Returns: Promise<TxFeesAmounts[]>
a list of the delegation fees applied within the transaction paid by loaded user
#
getTxStatusâ–¸ getTxStatus(tx
: string | RawTxObject): Promise<TransactionStatusObject>
Defined in src/Transaction.ts:144
Get the status of a sent tx either via txHash or via rawTx for a meta-tx
#
Parameters:Name | Type | Description |
---|---|---|
tx | string | RawTxObject | the hash of the transaction / meta-tx or raw transaction object from which a meta-tx was built. |
Returns: Promise<TransactionStatusObject>
#
prepareContractTransactionâ–¸ prepareContractTransaction(userAddress
: string, contractAddress
: string, contractName
: string, functionName
: string, args
: any[], options?
: TxOptionsInternal): Promise<TxObjectInternal>
Defined in src/Transaction.ts:69
Returns transaction fees and the raw transaction object for calling a contract function.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
userAddress | string | - | address of user that calls the contract function |
contractAddress | string | - | address of deployed contract |
contractName | string | - | name of deployed contract |
functionName | string | - | name of contract function |
args | any[] | - | arguments of function in same order as in contract |
options | TxOptionsInternal | {} | - |
Returns: Promise<TxObjectInternal>
An ethereum transaction object and the estimated transaction fees in ETH.
#
prepareValueTransactionâ–¸ prepareValueTransaction(senderAddress
: string, receiverAddress
: string, rawValue
: BigNumber, options?
: TxOptionsInternal): Promise<TxObjectInternal>
Defined in src/Transaction.ts:108
Returns transaction fees and raw transaction object for transferring ETH.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
senderAddress | string | - | address of user sending the transfer |
receiverAddress | string | - | address of user receiving the transfer |
rawValue | BigNumber | - | transfer amount in wei |
options | TxOptionsInternal | {} | - |
Returns: Promise<TxObjectInternal>
An ethereum transaction object containing and the estimated transaction fees in ETH.