Version: 0.13.7

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:38

Parameters:#

NameType
params{ currencyNetwork: CurrencyNetwork ; provider: TLProvider ; signer: TLSigner }

Returns: Transaction

Methods#

confirm#

confirm(rawTx: RawTxObject): Promise<string>

Defined in src/Transaction.ts:133

Signs and sends the given transaction object.

Parameters:#

NameTypeDescription
rawTxRawTxObjectRaw transaction object.

Returns: Promise<string>


getAppliedDelegationFees#

getAppliedDelegationFees(txHash: string): Promise<TxFeesAmounts[]>

Defined in src/Transaction.ts:152

Get the effective delegation fees via enveloping transaction hash

Parameters:#

NameTypeDescription
txHashstringthe 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:141

Get the status of a sent tx either via txHash or via rawTx for a meta-tx

Parameters:#

NameTypeDescription
txstring | RawTxObjectthe 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:64

Returns transaction fees and the raw transaction object for calling a contract function.

Parameters:#

NameTypeDefault valueDescription
userAddressstring-address of user that calls the contract function
contractAddressstring-address of deployed contract
contractNamestring-name of deployed contract
functionNamestring-name of contract function
argsany[]-arguments of function in same order as in contract
optionsTxOptionsInternal{}-

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:105

Returns transaction fees and raw transaction object for transferring ETH.

Parameters:#

NameTypeDefault valueDescription
senderAddressstring-address of user sending the transfer
receiverAddressstring-address of user receiving the transfer
rawValueBigNumber-transfer amount in wei
optionsTxOptionsInternal{}-

Returns: Promise<TxObjectInternal>

An ethereum transaction object containing and the estimated transaction fees in ETH.