Skip to content

Transaction Specifications

CALLChain edited this page Mar 25, 2019 · 11 revisions

Transaction Specifications

A transaction specification specifies what a transaction should do. Each Transaction Type has its own type of specification.

Issue Set

See Transaction Types for a description.

Name Type Description
total laxAmount The total amount to issue. When issue set is editable, total will be update when user apply bigger total amount. User cannot update smaller total amount.
editable boolean Optional Editable of the issue set, default is non-enitable
nonFungible boolean Optional Unique of the issue set, default is fungible. When issue set is non-fungible, transfer rate not work and is ignore.
transferRate number Optional The fee to charge when users transfer this account’s issuances, as the decimal amount that must be sent to deliver 1 unit. Has precision up to 9 digits beyond the decimal point. Use null to set no fee. Default is 0.

Example

{
  "total": {
      "value": "10000",
      "currency": "USD",
      "issuer": "cDtARCCeAYkXjZDaubC8EX5jHRvg4U3jKR"
  },
  "editable": true,
  "nonFungible": false,
  "transferRate": 1.2
  }
}

Payment

See Transaction Types for a description.

Name Type Description
source object The source of the funds to be sent.
source. address address The address to send from.
source. amount laxAmount An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with source.maxAmount)
source. tag integer Optional An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Call account.
source. maxAmount laxAmount The maximum amount to send. (This field is exclusive with source.amount)
destination object The destination of the funds to be sent.
destination. address address The address to receive at.
destination. amount laxAmount An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount).
destination. tag integer Optional An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Call account.
destination. address address The address to send to.
destination. minAmount laxAmount The minimum amount to be delivered. (This field is exclusive with destination.amount)
allowPartialPayment boolean Optional If true, this payment should proceed even if the whole amount cannot be delivered due to a lack of liquidity or a lack of funds in the source account.
invoiceID string Optional A 256-bit hash that can be used to identify a particular payment.
limitQuality boolean Optional Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of destination.amount:source.maxAmount.
memos memos Optional Array of memos to attach to the transaction.
noDirectCall boolean Optional If true and paths are specified, the sender would like the CALL Ledger to disregard any direct paths from the source account to the destination account. This may be used to take advantage of an arbitrage opportunity or by gateways wishing to issue balances from a hot wallet to a user who has mistakenly set a trustline directly to the hot wallet.
paths string Optional The paths of trustlines and orders to use in executing the payment.
tokenID string Optional A 256-bit hash that can be used to identify a unique non-fungible token payment or issue.
metaInfo string Optional A 256-bit hash that can be used to describe token information of the unique token issuing.

Example

{
  "source": {
    "address": "cKYg3DSSRtdP7fZtgzGHZxh8qpyMgjtBdu",
    "maxAmount": {
      "value": "0.01",
      "currency": "USD",
      "counterparty": "cDtARCCeAYkXjZDaubC8EX5jHRvg4U3jKR"
    }
  },
  "destination": {
    "address": "cemMB2rr6tT5DHJ5NiCYXLWhFjm11ni8M",
    "amount": {
      "value": "0.01",
      "currency": "USD",
      "counterparty": "cDtARCCeAYkXjZDaubC8EX5jHRvg4U3jKR"
    }
  }
}

Trustline

See Transaction Types for a description.

Name Type Description
currency currency The currency this trustline applies to.
counterparty address The address of the account this trustline extends trust to.
limit value The maximum amount that the owner of the trustline can be owed through the trustline.
authorized boolean Optional If true, authorize the counterparty to hold issuances from this account.
frozen boolean Optional If true, the trustline is frozen, which means that funds can only be sent to the owner.
memos memos Optional Array of memos to attach to the transaction.
qualityIn number Optional Incoming balances on this trustline are valued at this ratio.
qualityOut number Optional Outgoing balances on this trustline are valued at this ratio.
callingDisabled boolean Optional If true, payments cannot flow through this trustline.

Example

{
  "currency": "USD",
  "counterparty": "cDtARCCeAYkXjZDaubC8EX5jHRvg4U3jKR",
  "limit": "10000",
  "qualityIn": 0.91,
  "qualityOut": 0.87,
  "callingDisabled": true,
  "frozen": false,
  "memos": [
    {
      "type": "test",
      "format": "plain/text",
      "data": "texted data"
    }
  ]
}

Order

See Transaction Types for a description.

Name Type Description
direction string Equal to "buy" for buy orders and "sell" for sell orders.
quantity amount The amount of currency to buy or sell.
totalPrice amount The total price to be paid for the quantity to be bought or sold.
expirationTime date-time string Optional Time after which the offer is no longer active, as an ISO 8601 date-time.
fillOrKill boolean Optional Treat the offer as a Fill or Kill order. Only attempt to match existing offers in the ledger, and only do so if the entire quantity can be exchanged.
immediateOrCancel boolean Optional Treat the offer as an Immediate or Cancel order. If enabled, the offer will never become a ledger node: it only attempts to match existing offers in the ledger.
memos memos Optional Array of memos to attach to the transaction.
orderToReplace sequence Optional The account sequence number of an order to cancel before the new order is created, effectively replacing the old order.
passive boolean Optional If enabled, the offer will not consume offers that exactly match it, and instead becomes an Offer node in the ledger. It will still consume offers that cross it.

Example

{
  "direction": "buy",
  "quantity": {
    "currency": "USD",
    "counterparty": "cDtARCCeAYkXjZDaubC8EX5jHRvg4U3jKR",
    "value": "10.1"
  },
  "totalPrice": {
    "currency": "CALL",
    "value": "2"
  },
  "passive": true,
  "fillOrKill": true
}

Order Cancellation

See Transaction Types for a description.

Name Type Description
orderSequence sequence The account sequence number of the order to cancel.
memos memos Optional Array of memos to attach to the transaction.

Example

{
  "orderSequence": 23
}

Settings

See Transaction Types for a description.

Name Type Description
defaultCall boolean Optional Enable calling on this account’s trust lines by default. (New in called 0.27.3)
depositAuth boolean Optional Enable Deposit Authorization on this account. If set, transactions cannot send value of any kind to this account unless the sender of those transactions is the account itself. (Requires the DepositAuth amendment)
disableMasterKey boolean Optional Disallows use of the master key to sign transactions for this account.
disallowIncomingCALL boolean Optional Indicates that client applications should not send CALL to this account. Not enforced by called.
domain string Optional The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase.
emailHash string,null Optional Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use null to clear.
enableTransactionIDTracking boolean Optional Track the ID of this account’s most recent transaction.
globalFreeze boolean Optional Freeze all assets issued by this account.
memos memos Optional Array of memos to attach to the transaction.
messageKey string Optional Public key for sending encrypted messages to this account. Conventionally, it should be a secp256k1 key, the same encryption that is used by the rest of Call.
noFreeze boolean Optional Permanently give up the ability to freeze individual trust lines. This flag can never be disabled after being enabled.
passwordSpent boolean Optional Indicates that the account has used its free SetRegularKey transaction.
regularKey address,null Optional The public key of a new keypair, to use as the regular key to this account, as a base-58-encoded string in the same format as an account address. Use null to remove the regular key.
requireAuthorization boolean Optional If set, this account must individually approve other users in order for those users to hold this account’s issuances.
requireDestinationTag boolean Optional Requires incoming payments to specify a destination tag.
signers object Optional Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning.
signers. threshold integer Optional A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value 0.
signers. weights array Optional Weights of signatures for each signer.
signers. weights[] object An association of an address and a weight.
signers.weights[]. address address A Call account address
signers.weights[]. weight integer The weight that the signature of this account counts as towards the threshold.
transferRate number,null Optional The fee to charge when users transfer this account’s issuances, as the decimal amount that must be sent to deliver 1 unit. Has precision up to 9 digits beyond the decimal point. Use null to set no fee.
nickname string Optional The nickname for account. It will be easy to find the address by nickname for user, and nickname is unique in callchain system.
total object Optional, {currency: currency, value: value, issuer: issuer}. Total used to set user's asset issue, each issue is un-modified. When issuing asset, three fields are specified currency, value and issuer.

Example

{
  "domain": "callchain.live",
  "memos": [
    {
      "type": "test",
      "format": "plain/text",
      "data": "texted data"
    }
  ]
}

Escrow Creation

See Transaction Types for a description.

Name Type Description
amount value Amount of CALL for sender to escrow.
destination address Address to receive escrowed CALL.
allowCancelAfter date-time string Optional If present, the escrow may be cancelled after this time.
allowExecuteAfter date-time string Optional If present, the escrow can not be executed before this time.
condition string Optional A hex value representing a PREIMAGE-SHA-256 crypto-condition. If present, fulfillment is required upon execution.
destinationTag integer Optional Destination tag.
memos memos Optional Array of memos to attach to the transaction.
sourceTag integer Optional Source tag.

Example

{
  "destination": "cemMB2rr6tT5DHJ5NiCYXLWhFjm11ni8M",
  "amount": "0.01",
  "allowExecuteAfter": "2014-09-24T21:21:50.000Z",
  "allowCancelAfter":  "2017-01-01T00:00:00.000Z"
}

Escrow Cancellation

See Transaction Types for a description.

Name Type Description
owner address The address of the owner of the escrow to cancel.
escrowSequence sequence The account sequence number of the Escrow Creation transaction for the escrow to cancel.
memos memos Optional Array of memos to attach to the transaction.

Example

{
  "owner": "cemMB2rr6tT5DHJ5NiCYXLWhFjm11ni8M",
  "escrowSequence": 1234
}

Escrow Execution

See Transaction Types for a description.

Name Type Description
owner address The address of the owner of the escrow to execute.
escrowSequence sequence The account sequence number of the Escrow Creation transaction for the escrow to execute.
condition string Optional A hex value representing a PREIMAGE-SHA-256 crypto-condition. This must match the original condition from the escrow creation transaction.
fulfillment string Optional A hex value representing the PREIMAGE-SHA-256 crypto-condition fulfillment for condition.
memos memos Optional Array of memos to attach to the transaction.

Example

{
  "owner": "cKYg3DSSRtdP7fZtgzGHZxh8qpyMgjtBdu",
  "escrowSequence": 1234,
  "condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100",
  "fulfillment": "A0028000"
}

Check Create

See Transaction Types for a description.

Name Type Description
destination address Address of the account that can cash the check.
sendMax laxAmount Amount of source currency the check is allowed to debit the sender, including transfer fees on non-CALL currencies.
destinationTag integer Optional Destination tag that identifies the reason for the check, or a hosted recipient to pay.
expiration date-time string Optional Time after which the check is no longer valid.
invoiceID string Optional 256-bit hash, as a 64-character hexadecimal string, representing a specific reason or identifier for this check.

Example

{
  "destination": "cemMB2rr6tT5DHJ5NiCYXLWhFjm11ni8M",
  "sendMax": {
    "currency": "CALL",
    "value": "1"
  }
}

Check Cancel

See Transaction Types for a description.

Name Type Description
checkID string The ID of the Check ledger object to cancel, as a 64-character hexadecimal string.

Example

{
  "checkID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"
}

Check Cash

See Transaction Types for a description.

Name Type Description
checkID string The ID of the Check ledger object to cash, as a 64-character hexadecimal string.
amount laxAmount Optional Redeem the Check for exactly this amount, if possible. The currency must match that of the sendMax of the corresponding CheckCreate transaction. You must provide either this field or deliverMin.
deliverMin laxAmount Optional Redeem the Check for at least this amount and for as much as possible. The currency must match that of the sendMax of the corresponding CheckCreate transaction. You must provide either this field or amount.

Example

{
  "amount": {
    "currency": "CALL",
    "value": "1"
  },
  "checkID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334"
}

Payment Channel Create

See Transaction Types for a description.

Name Type Description
amount value Amount of CALL for sender to set aside in this channel.
destination address Address to receive CALL claims against this channel.
settleDelay number Amount of seconds the source address must wait before closing the channel if it has unclaimed CALL.
publicKey string Public key of the key pair the source may use to sign claims against this channel.
cancelAfter date-time string Optional Time when this channel expires. This expiration cannot be changed after creating the channel.
destinationTag integer Optional Destination tag.
sourceTag integer Optional Source tag.

Example

{
  "amount": "1",
  "destination": "cemMB2rr6tT5DHJ5NiCYXLWhFjm11ni8M",
  "settleDelay": 86400,
  "publicKey": "32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A"
}

Payment Channel Fund

See [Transaction Types](https://github.com/callchain/call-lib/wiki/transaction-overview #transaction-types) for a description.

Name Type Description
amount value Amount of CALL to fund the channel with.
channel string 256-bit hexadecimal channel identifier.
expiration date-time string Optional New expiration for this channel. (This does not change the cancelAfter expiration, if the channel has one.) Cannot move the expiration sooner than settleDelay seconds from time of the request.

Example

{
  "channel": "C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198",
  "amount": "1"
}

Payment Channel Claim

See Transaction Types for a description.

Name Type Description
channel string 256-bit hexadecimal channel identifier.
amount value Optional Amount of CALL authorized by this signature.
balance value Optional Total CALL balance delivered by this channel after claim is processed.
close boolean Optional Request to close the channel. If the channel has no CALL remaining or the destination address requests it, closes the channel immediately (returning unclaimed CALL to the source address). Otherwise, sets the channel to expire after settleDelay seconds have passed.
publicKey string Optional Public key of the channel. (For verifying the signature.)
renew boolean Optional Clear the channel's expiration time.
signature string Optional Signed claim authorizing withdrawal of CALL from the channel. (Required except from the channel's source address.)

Example

{
  "channel": "C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198"
}
Clone this wiki locally