Colored coins
These transactions are available in the payment blockchain.
color.coin.new - Registration of a new colored coin
sender : String
- EON-ID of the account.decimal : long
- the number of digits in the fractional part (from 0 to 10).
Possible errors:
"Account has been already associated with the colored coin" - colored coin has already been issued.
"The 'decimalPoint' field value is out of range" - accuracy is set incorrectly.
The command is signed by the account specified in sender
.
color.payment.send - Sending the colored coin
sender : String
- EON-ID of the sender.target : String
- EON-ID of the recipient.amount : long
- amount transferred.color : String
- coin type.
The command is signed by the account specified in sender
.
Possible errors:
"Insufficient number of colored coins on the balance" - insufficient funds on the balance.
"The number has reached the limit" - too many colored coins on the balance.
"The 'amount' field value is out of range" - swap amount was set incorrectly.
Example:
Atomic swap of colored coins
You can read more about how atomic swaps works here:
color.payment.swap.begin - BeginSwap - Begin swap
sender
- sender.target
- recipient.timestamp
- expiration time.alg
- hashing algorithm. SupportsSHA-512
.hash
- hash in Base64.id
- exchange identifier. Calculated by hash (similar to Acc-ID calculation by public key), but with "SWAP-" prefix.amount
- amount transferred.color
- coin type.
The command is signed by the account specified in sender
.
Possible errors:
"Hash algorithm not supported" - unsupported HASH algorithm is set.
"Incorrect swap id" - SWAP-ID is set incorrectly.
"Swap already exist" - swap with such a hash is already in use.
"Incorrect timestamp" - The exchange end time is not set correctly (the time has already expired)
"Unknown target account" - there is no recipient's account.
"Insufficient number of colored coins on the balance" - insufficient amount of funds on the balance.
"The 'amount' field value is out of range" - swap amount was set incorrectly.
Example:
color.payment.swap.commit - CommitSwap - Completing the swap
id
- swap identifier.secret
- secret phrase.sender
- swap initiator.target
- recipient.
The command does not require a signature.
Possible errors:
"Unknown swap" - unknown swap.
"Swap is over" - swap is already over.
"Wrong secret" - wrong secret.
"Unsupported hash algorithm" - unsupported HASH algorithm.
"The number has reached the limit" - too many colored coins on the balance.
Example:
color.payment.swap.rollback - RollbackSwap - Swap rollback
id
- swap identifier.sender
- secret phrase.
The command does not require a signature.
Possible errors:
"Unknown swap" - unknown swap.
"Swap is active" - swap is active
"The number has reached the limit" - too many colored coins on the balance.
Example:
color.payment.swap.cancel - CancelSwap - Swap cancellation by mutual concent
id
- swap identifier.sender
- swap initiator.target
- recipient.
The command is signed by the accounts specified in sender
and target
.
Possible errors:
"Unknown swap" - unknown swap.
"Incorrect target" - swap recipient is set incorrectly.
"The number has reached the limit" - too many colored coins on the balance.
Example:
Colored coin management
color.coin.mode.auto.set - Transferring colored coin into auto-emission.
sender : String
- EON-ID of the account.
The command is signed by the account specified in sender
.
Possible errors:
"The colored coin has not been associated with the account" - colored coins not issued.
"EmitMode has already set" - auto-emission mode is already enabled.
Example:
color.coin.mode.fixed.set - Transferring colored coin into a fixed emission.
sender : String
- EON-ID of the account.value : long
- total emission size.
The command is signed by the account specified in sender
.
Possible errors:
"Invalid value" - emission is set incorrectly.
"The colored coin has not been associated with the account" - colored coins not issued.
"Value has already set" - desired emission is already set.
"An insufficient number of colored coins is on the balance" - not enough colored coins on the balance to reduce the emission by a given amount.
"The number has reached the limit" - too many colored coins on the balance.
Example:
color.coin.del - Deleting a colored coin
sender : String
- EON-ID of the account.
The command is signed by the account specified in sender
.
Possible errors:
"The colored coin has not been associated with the account" - colored coins not issued.
"The entire amount of funds must be on the balance" - not all issued colored coins returned to the original account.
Example:
Last updated