Version: 0.17.1

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

NameType
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:#

NameTypeDescription
rawTxRawTxObjectRaw 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:#

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

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

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

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.