Balance transfer commands
These commands are available in the core and payment network.
base.payment.send - Transfer
sender : String
- EON-ID of the sending account.target : String
- EON-ID of the recipient account.amount : long
- amount transferred.
The command is signed by the account specified in sender
.
Possible errors:
"Invalid value" - The transfer amount was set incorrectly.
"Exceeds balance value" - insufficient funds on the balance.
Example:
Atomic swaps
You can read more about how atomic swaps works here:
base.payment.swap.begin - BeginSwap - Begin swap
sender
- sender.target
- recipient.timestamp
- expiration time.alg
- hashing algorithm. SupportsSHA-512
.hash
- hash in Base64.id
- swap identifier. Calculated by hash (similar to Acc-ID calculation by public key), but with "SWAP-" prefix.amount
- amount transferred.
The command is signed by the account specified in sender
.
Possible errors:
"Hash algorithm not supported" - an unsupported HASH algorithm is set.
"Incorrect swap id" - SWAP-ID is set incorrectly.
"Swap already exist" - swap with this hash is already in use.
"Incorrect timestamp" - swap end time is not set correctly (the time has already expired).
"Unknown target account" - recipient's account is absent.
"Invalid value" - swap ammount is set incorrectly.
"Exceeds balance value" - insufficient funds on the balance.
Example:
base.payment.swap.commit - CommitSwap - Transaction completion
id
- swap identifier.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.
Example:
base.payment.swap.rollback - RollbackSwap - Swap rollback
id
- exchange identifier.sender
- exchange initiator.
The command does not require a signature.
Possible errors:
"Unknown swap" - unknown swap
"Swap is active" - swap is still active.
Example:
base.payment.swap.cancel - CancelSwap - Swaps cancellation by mutual consent
id
- swap identifier.sender
- exchange 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.
Example:
Last updated