Skip to content

Transaction Overview

CALLChain edited this page Mar 24, 2019 · 3 revisions

Transaction Overview

Transaction Types

A transaction type is specified by the strings in the first column in the table below.

Type Description
issueSet A issueSet transaction is used to create one issue set for each asset. Asset without issue set cannot be issued.
payment A payment transaction represents a transfer of value from one account to another. Depending on the path taken, additional exchanges of value may occur atomically to facilitate the payment.
order An order transaction creates a limit order. It defines an intent to exchange currencies, and creates an order in the CALL Ledger's order book if not completely fulfilled when placed. Orders can be partially fulfilled.
orderCancellation An orderCancellation transaction cancels an order in the CALL Ledger's order book.
trustline A trustline transactions creates or modifies a trust line between two accounts.
settings A settings transaction modifies the settings of an account in the CALL Ledger.
escrowCreation An escrowCreation transaction creates an escrow on the ledger, which locks CALL until a cryptographic condition is met or it expires. It is like an escrow service where the CALL Ledger acts as the escrow agent.
escrowCancellation An escrowCancellation transaction unlocks the funds in an escrow and sends them back to the creator of the escrow, but it will only work after the escrow expires.
escrowExecution An escrowExecution transaction unlocks the funds in an escrow and sends them to the destination of the escrow, but it will only work if the cryptographic condition is provided.
checkCreate A checkCreate transaction creates a check on the ledger, which is a deferred payment that can be cashed by its intended destination.
checkCancel A checkCancel transaction cancels an unreedemed Check, removing it from the ledger without sending any money.
checkCash A checkCash transaction redeems a Check to receive up to the amount authorized by the corresponding checkCreate transaction. Only the destination address of a Check can cash it.
paymentChannelCreate A paymentChannelCreate transaction opens a payment channel between two addresses with CALL set aside for asynchronous payments.
paymentChannelFund A paymentChannelFund transaction adds CALL to a payment channel and optionally sets a new expiration for the channel.
paymentChannelClaim A paymentChannelClaim transaction withdraws CALL from a channel and optionally requests to close it.

Transaction Flow

Executing a transaction with CallAPI requires the following four steps:

  1. Prepare - Create an unsigned transaction based on a specification and instructions. There is a method to prepare each type of transaction:
  2. Sign - Cryptographically sign the transaction locally and save the transaction ID. Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the signedTransaction fields returned by sign must be collected and passed to the combine method.
  3. Submit - Submit the transaction to the connected server.
  4. Verify - Verify that the transaction got validated by querying with getTransaction. This is necessary because transactions may fail even if they were successfully submitted.

Transaction Fees

Every transaction must destroy a small amount of CALL as a cost to send the transaction. This is also called a transaction fee. The transaction cost is designed to increase along with the load on the CALL Ledger, making it very expensive to deliberately or inadvertently overload the peer-to-peer network that powers the CALL Ledger.

You can choose the size of the fee you want to pay or let a default be used. You can get an estimate of the fee required to be included in the next ledger closing with the getFee method.

Transaction Instructions

Transaction instructions indicate how to execute a transaction, complementary with the transaction specification.

Name Type Description
fee value Optional An exact fee to pay for the transaction. See Transaction Fees for more information.
maxFee value Optional The maximum fee to pay for the transaction. See Transaction Fees for more information.
maxLedgerVersion integer,null Optional The highest ledger version that the transaction can be included in. If this option and maxLedgerVersionOffset are both omitted, the maxLedgerVersion option will default to 3 greater than the current validated ledger version (equivalent to maxLedgerVersionOffset=3). Use null to not set a maximum ledger version.
maxLedgerVersionOffset integer Optional Offset from current validated ledger version to highest ledger version that the transaction can be included in.
sequence sequence Optional The initiating account's sequence number for this transaction.
signersCount integer Optional Number of signers that will be signing this transaction.

We recommended that you specify a maxLedgerVersion so that you can quickly determine that a failed transaction will never succeeed in the future. It is impossible for a transaction to succeed after the CALL Ledger's consensus-validated ledger version exceeds the transaction's maxLedgerVersion. If you omit maxLedgerVersion, the "prepare*" method automatically supplies a maxLedgerVersion equal to the current ledger plus 3, which it includes in the return value from the "prepare*" method.

Transaction ID

"F4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF"

A transaction ID is a 64-bit hexadecimal string that uniquely identifies the transaction. The transaction ID is derived from the transaction instruction and specifications, using a strong hash function.

You can look up a transaction by ID using the getTransaction method.

Transaction Memos

Every transaction can optionally have an array of memos for user applications. The memos field in each transaction specification is an array of objects with the following structure:

Name Type Description
data string Optional Arbitrary string, conventionally containing the content of the memo.
format string Optional Conventionally containing information on how the memo is encoded, for example as a MIME type. Only characters allowed in URLs are permitted.
type string Optional Conventionally, a unique relation (according to RFC 5988) that defines the format of this memo. Only characters allowed in URLs are permitted.