Skip to content

Basic Types

CALLChain edited this page Mar 26, 2019 · 9 revisions

Address

"cKYg3DSSRtdP7fZtgzGHZxh8qpyMgjtBdu"

Every CALL Ledger account has an address, which is a base58-encoding of a hash of the account's public key. CALL Ledger addresses always start with the lowercase letter c.

Account Sequence Number

Every CALL Ledger account has a sequence number that is used to keep transactions in order. Every transaction must have a sequence number. A transaction can only be executed if it has the next sequence number in order, of the account sending it. This prevents one transaction from executing twice and transactions executing out of order. The sequence number starts at 1 and increments for each transaction that the account makes.

Currency

Currencies are represented as either 3-6 character currency codes or 40-character uppercase hexadecimal strings. We recommend using uppercase ISO 4217 Currency Codes only. The string "CALL" is disallowed on trustlines because it is reserved for the CALL Ledger's native currency. The following characters are permitted: all uppercase and lowercase letters, digits, as well as the symbols ?, !, @, #, $, %, ^, &, *, <, >, (, ), {, }, [, ], and |.

Value

A value is a quantity of a currency represented as a decimal string. Be careful: JavaScript's native number format does not have sufficient precision to represent all values. CALL has different precision from other currencies.

CALL has 6 significant digits past the decimal point. In other words, CALL cannot be divided into positive values smaller than 0.000001 (1e-6). CALL has a maximum value of 100000000000 (1e11).

Non-CALL values have 16 decimal digits of precision, with a maximum value of 9999999999999999e80. The smallest positive non-CALL value is 1e-81.

Amount

Example amount:

{
  "currency": "USD",
  "counterparty": "cKYg3DSSRtdP7fZtgzGHZxh8qpyMgjtBdu",
  "value": "100"
}

Example CALL amount:

{
  "currency": "CALL",
  "value": "2000"
}

An amount is data structure representing a currency, a quantity of that currency, and the counterparty on the trustline that holds the value. For CALL, there is no counterparty.

A lax amount allows the counterparty to be omitted for all currencies. If the counterparty is not specified in an amount within a transaction specification, then any counterparty may be used for that amount.

A lax lax amount allows either or both the counterparty and value to be omitted.

A balance is an amount than can have a negative value.

Name Type Description
currency currency The three-to-six-character code or hexadecimal string used to denote currencies
counterparty address Optional The Call address of the account that owes or is owed the funds (omitted if currency is "CALL")
value value Optional The quantity of the currency, denoted as a string to retain floating point precision

Transfer Rate

The TransferRate field specifies a fee to charge whenever counterparties transfer the currency you issue. TransferRate is represented as an integer, the amount that must be sent for 1 billion units to arrive. For example, a 20% transfer fee is represented as the value 1200000000. The value cannot be less than 1000000000.0 is as a shortcut for 1000000000, meaning no fee.

Asset

Asset is crypto asset on Callchain, and it can be issued by everyone. Each asset contains fans number, freeze amount, issued amount, total amount and asset information. Asset can be include fungible asset and non-fungible asset.

{
    "Fans":"8",
    "Freeze":{
        "currency":"BBB",
        "issuer":"cBofE1BMB78yX4oHXLKc5oXV1BgJNGjh96",
        "value":"0"
    },
    "Issued":{
        "currency":"BBB",
        "issuer":"cBofE1BMB78yX4oHXLKc5oXV1BgJNGjh96",
        "value":"10000"
    },
    "Total":{
        "currency":"BBB",
        "issuer":"cBofE1BMB78yX4oHXLKc5oXV1BgJNGjh96",
        "value":"100000000"
    },
    "Info":"1234567890",
    "TransferRate": "1200000000"
}
Name Type Description
Fans string fans number of currency asset
Freeze object currenct freezed amount of the asset
Issued object issued amount of the asset
Total object total amount of the asset
Info string information the the asset
TransferRate string transfer rate for currency asset

Invoice

Invoice is non-fungible asset represents ownership over digital or physical assets.

{
    "Amount" : {
        "currency" : "KITTY",
        "issuer" : "c9rvpcEEeihCcAVpTPE8gAtmzLsysxrtD9",
        "value" : "1"
     },
     "Invoice" : "01234567890ABC",
     "InvoiceID" : "0000000000000000000000000000000000000000000000000000000000000020"
}
Name Type Description
Amount Amount Amount of invoice, only and should be one
Invoice String invoice meta information
InvoiceID String invoice id, it is unique for issuer

Clone this wiki locally