Skip to content



Transaction module


import Transaction from '@aeternity/aepp-sdk/es/tx/tx'

Transaction([options]) ⇒ Object

Transaction Stamp

This is implementation of Tx relays the creation of transactions to module:@aeternity/aepp-sdk/es/Node. This stamp provide ability to create native transaction's, or transaction's using Node API. As there is no built-in security between Node and client communication, creating transaction using module:@aeternity/aepp-sdk/es/Node API must never be used for production but can be very useful to verify other implementations.

Kind: Exported function
Returns: Object - Transaction instance
rtype: Stamp

Param Type Default Description
[options] Object {} Initializer object
[options.nativeMode] Boolean true options.nativeMode - Use Native build of transaction's
options.url String Node url
options.internalUrl String Node internal url


Transaction({url: ''})

Transaction~getVmVersion(txType, vmAbi) ⇒ object

Validated vm/abi version or get default based on transaction type and NODE version

Kind: inner method of Transaction
Returns: object - Object with vm/abi version ({ vmVersion: number, abiVersion: number, backend: string })

Param Type Description
txType string Type of transaction
vmAbi object Object with vm and abi version fields

Transaction~calculateTtl(ttl, relative) ⇒ number

Compute the absolute ttl by adding the ttl to the current height of the chain

Kind: inner method of Transaction
Returns: number - Absolute Ttl

Param Type Default Description
ttl number
relative boolean true ttl is absolute or relative(default: true(relative))

Transaction~getAccountNonce(accountId, nonce) ⇒ number

Get the next nonce to be used for a transaction for an account

Kind: inner method of Transaction
Returns: number - Next Nonce

Param Type
accountId string
nonce number

Transaction~prepareTxParams(txType, params) ⇒ Object

Calculate fee, get absolute ttl (ttl + height), get account nonce

Kind: inner method of Transaction
Returns: Object - { ttl, nonce, fee } Object with account nonce, absolute ttl and transaction fee

Param Type Description
txType String Type of transaction
params Object Object which contains all tx data