XDR (3.8.0)

This repo defines structures used to communicate with Core of TokenD based networks.

Transaction

Transactions are commands that modify the ledger state. If you think of the ledger as a database, then Operations are SQL commands and Trannsactions are SQL transactions.

Transactions allows you to combine several operations (even from different sources) into one atomic command (if one operation fails, whole transaction rollbacks). What is more, it's possible to specify different source account for different operation. This can be used to implement features like over-the-counter exchange (include into transaction two operations: one sending assets from A to B; one sending assets from B to A; such transaction requires signatures from both A and B).

Transaction Envelope

Account Role Requirements

Account Resource Type Action
source TRANSACTION SEND

Signer Role Requirements

Signers rules required on operation level.

TransactionEnvelope
Tx
object

Transaction is a container for a set of operations

  • is executed by an account
  • operations are executed in order as one ACID transaction (either all operations are applied or none are if any returns a failing code)
Signatures
Array of objects

list of signatures used to authorize transaction

Response Schema result
FeeCharged
long
Result
One of multiple values
Ext
TransactionResultExtArmEmptyVersion (object)

Accounts

Defines operations to manage Accounts

Create Account

Allows creating account with specific role and signers. Balances for assets with policy BASE_ASSET will be created for the account automatically.

Account Role Requirements

Account Resource Type Action
source ACCOUNT CREATE

Signer Role Requirements

Resource Type Rule Action
ACCOUNT CREATE
CreateAccountOp

CreateAccountOp is used to create new account

Destination
AccountId

ID of account to be created

Referrer
AccountId

ID of an another account that introduced this account into the system. If account with such ID does not exist or it's Admin Account. Referrer won't be set.

RoleId
uint64

ID of the role that will be attached to an account

SignersData
Array of objects

Array of data about 'destination' account signers to be created

Ext
CreateAccountOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidSignerData
  • InvalidDestination
  • AlreadyExists
  • InvalidWeight
  • NoSuchRole
  • NoSignerData
code
string
Value: "SUCCESS"

Means that destination account has been successfully created with signers specified in signersData

success
object (CreateAccountSuccess)

Result of successful application of CreateAccount operation

Assets

Defines operations to manage Assets

Create Request For Asset Creation

Allows to create or update CREATE_ASSET reviewable request CREATE_ASSET request is used to create asset entry

Account Role Requirements

Account Resource Type Rule Action Condition
source ASSET CREATE allTasks == null
source ASSET CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Rule Action Details
ASSET CREATE Resource includes code and type of asset
ManageAssetOp

ManageAssetOp is used to:

  • create or update CREATE_ASSET request;
  • create or update UPDATE_ASSET request;
  • cancel CREATE_ASSET or UPDATE_ASSET request
  • change asset pre issuer
  • update max issuance of an asset
RequestId
uint64

ID of a reviewable request If requestID == 0, operation creates a new reviewable request; otherwise, it updates the existing one

Request
One of multiple values

data is used to pass one of ManageAssetAction with required params

Ext
ManageAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RequestNotFound
  • InvalidSignature
  • AssetAlreadyExists
  • InvalidMaxIssuanceAmount
  • InvalidCode
  • InvalidPreIssuer
  • InvalidPolicies
  • AssetNotFound
  • RequestAlreadyExists
  • StatsAssetAlreadyExists
  • InitialPreissuedExceedsMaxIssuance
  • InvalidCreatorDetails
  • InvalidTrailingDigitsCount
  • InvalidPreissuedAmountPrecision
  • InvalidMaxIssuanceAmountPrecision
  • AssetCreateTasksNotFound
  • AssetUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully performed

success
object (ManageAssetSuccess)

Is used to pass useful params after the successful operation application

Asset Resources

Describes the asset pairs as a set of properties and policies for two particular assets (i.e. base and quote assets).

AssetEntry
Code
string

Code of the asset

Owner
AccountId

Owner(creator) of the asset

PreissuedAssetSigner
AccountId

Account responsible for preissuance of the asset

Details
string

Arbitrary stringified JSON object that can be used to attach data to asset

MaxIssuanceAmount
uint64

Maximal amount of tokens that can be issued

AvailableForIssueance
uint64

Amount of tokens available for issuance

Issued
uint64

Amount of tokens issued already

PendingIssuance
uint64

Amount of tokens to be issued which is locked. pendingIssuance+issued <= maxIssuanceAmount

Policies
uint32

Policies of the asset

Type
uint64

Used to restrict usage. Used in account rules

TrailingDigitsCount
uint32

Number of decimal places. Must be <= 6

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future use

Code samples

Copy

enum AssetPolicy
{
  //: Defines whether or not asset can be transfered using payments
	TRANSFERABLE = 1,
	//: Defines whether or not asset is considered base
	BASE_ASSET = 2,
	//: [[Deprecated]]
	STATS_QUOTE_ASSET = 4,
	//: Defines whether or not asset can be withdrawed from the system
	WITHDRAWABLE = 8,
	//: Defines whether or not manual review for issuance of asset is required
	ISSUANCE_MANUAL_REVIEW_REQUIRED = 16,
	//: Defines whether or not asset can be base in atomic swap
	CAN_BE_BASE_IN_ATOMIC_SWAP = 32,
	//: Defines whether or not asset can be quote in atomic swap
	CAN_BE_QUOTE_IN_ATOMIC_SWAP = 64
};


struct AssetEntry
{
  //: Code of the asset
  AssetCode code;
  //: Owner(creator) of the asset
	AccountID owner;
	//: Account responsible for preissuance of the asset
	AccountID preissuedAssetSigner;
    //: Arbitrary stringified JSON object that can be used to attach data to asset
	longstring details;
	//: Maximal amount of tokens that can be issued
	uint64 maxIssuanceAmount;
	//: Amount of tokens available for issuance
	uint64 availableForIssueance;
	//: Amount of tokens issued already
	uint64 issued;
	//: Amount of tokens to be issued which is locked. `pendingIssuance+issued <= maxIssuanceAmount`
	uint64 pendingIssuance;
	//: Policies of the asset
  uint32 policies;
  //: Used to restrict usage. Used in account rules
  uint64 type;
  //: Number of decimal places. Must be <= 6
  uint32 trailingDigitsCount;

  //: Reserved for future use
  EmptyExt ext;
};

Create Request To Update Asset

Allows to create or update UPDATE_ASSET reviewable request UPDATE_ASSET request is used to update asset entry

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST UPDATE_ASSET CREATE allTasks == null
source REVIEWABLE_REQUEST UPDATE_ASSET CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Rule Action Details
ASSET UPDATE Resource includes code and type of asset
ManageAssetOp

ManageAssetOp is used to:

  • create or update CREATE_ASSET request;
  • create or update UPDATE_ASSET request;
  • cancel CREATE_ASSET or UPDATE_ASSET request
  • change asset pre issuer
  • update max issuance of an asset
RequestId
uint64

ID of a reviewable request If requestID == 0, operation creates a new reviewable request; otherwise, it updates the existing one

Request
One of multiple values

data is used to pass one of ManageAssetAction with required params

Ext
ManageAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RequestNotFound
  • InvalidSignature
  • AssetAlreadyExists
  • InvalidMaxIssuanceAmount
  • InvalidCode
  • InvalidPreIssuer
  • InvalidPolicies
  • AssetNotFound
  • RequestAlreadyExists
  • StatsAssetAlreadyExists
  • InitialPreissuedExceedsMaxIssuance
  • InvalidCreatorDetails
  • InvalidTrailingDigitsCount
  • InvalidPreissuedAmountPrecision
  • InvalidMaxIssuanceAmountPrecision
  • AssetCreateTasksNotFound
  • AssetUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully performed

success
object (ManageAssetSuccess)

Is used to pass useful params after the successful operation application

Cancel Asset Request

Allows to cancel CREATE_ASSET or UPDATE_ASSET reviewable request

Account Role Requirements

No account rule required because only requestor can remove own request

Signer Role Requirements

Resource Type Rule Action Details
ASSET CANCEL Resource includes code and type of asset
ManageAssetOp

ManageAssetOp is used to:

  • create or update CREATE_ASSET request;
  • create or update UPDATE_ASSET request;
  • cancel CREATE_ASSET or UPDATE_ASSET request
  • change asset pre issuer
  • update max issuance of an asset
RequestId
uint64

ID of a reviewable request If requestID == 0, operation creates a new reviewable request; otherwise, it updates the existing one

Request
One of multiple values

data is used to pass one of ManageAssetAction with required params

Ext
ManageAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RequestNotFound
  • InvalidSignature
  • AssetAlreadyExists
  • InvalidMaxIssuanceAmount
  • InvalidCode
  • InvalidPreIssuer
  • InvalidPolicies
  • AssetNotFound
  • RequestAlreadyExists
  • StatsAssetAlreadyExists
  • InitialPreissuedExceedsMaxIssuance
  • InvalidCreatorDetails
  • InvalidTrailingDigitsCount
  • InvalidPreissuedAmountPrecision
  • InvalidMaxIssuanceAmountPrecision
  • AssetCreateTasksNotFound
  • AssetUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully performed

success
object (ManageAssetSuccess)

Is used to pass useful params after the successful operation application

Change current pre issuer of asset

Allows to change asset pre issuer

Account Role Requirements

No account rule required because only current asset pre issuer can change asset pre issuer

Signer Role Requirements

No signer rule required because only current asset pre issuer can change asset pre issuer

ManageAssetOp

ManageAssetOp is used to:

  • create or update CREATE_ASSET request;
  • create or update UPDATE_ASSET request;
  • cancel CREATE_ASSET or UPDATE_ASSET request
  • change asset pre issuer
  • update max issuance of an asset
RequestId
uint64

ID of a reviewable request If requestID == 0, operation creates a new reviewable request; otherwise, it updates the existing one

Request
One of multiple values

data is used to pass one of ManageAssetAction with required params

Ext
ManageAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RequestNotFound
  • InvalidSignature
  • AssetAlreadyExists
  • InvalidMaxIssuanceAmount
  • InvalidCode
  • InvalidPreIssuer
  • InvalidPolicies
  • AssetNotFound
  • RequestAlreadyExists
  • StatsAssetAlreadyExists
  • InitialPreissuedExceedsMaxIssuance
  • InvalidCreatorDetails
  • InvalidTrailingDigitsCount
  • InvalidPreissuedAmountPrecision
  • InvalidMaxIssuanceAmountPrecision
  • AssetCreateTasksNotFound
  • AssetUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully performed

success
object (ManageAssetSuccess)

Is used to pass useful params after the successful operation application

Remove Asset

Removes asset.

Account Role Requirements

Account Resource Type Action Condition
source ASSET REMOVE source == assetOwner
source ASSET REMOVE_FOR_OTHER source != assetOwner

Signer Role Requirements

Resource Type Rule Action
ASSET REMOVE
ASSET REMOVE_FOR_OTHER
RemoveAssetOp

RemoveAssetOp changes the state of specified asset to removed

Code
string

Defines an asset

Ext
RemoveAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidAssetCode
  • HasPair
  • HasActiveOffers
  • HasActiveSales
  • HasActiveAtomicSwaps
  • HasActiveSwaps
  • CannotRemoveStatsQuoteAsset
  • HasPendingMovements
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (RemoveAssetSuccess)

Result of successful RemoveAssetOp application

Update Max Issuance

Allows to change max issuance of asset

Account Role Requirements

Account Resource Type Rule Action Details
source ASSET UPDATE_MAX_ISSUANCE Only asset owner can update max issuance of asset

Signer Role Requirements

Resource Type Rule Action
ASSET UPDATE_MAX_ISSUANCE
ManageAssetOp

ManageAssetOp is used to:

  • create or update CREATE_ASSET request;
  • create or update UPDATE_ASSET request;
  • cancel CREATE_ASSET or UPDATE_ASSET request
  • change asset pre issuer
  • update max issuance of an asset
RequestId
uint64

ID of a reviewable request If requestID == 0, operation creates a new reviewable request; otherwise, it updates the existing one

Request
One of multiple values

data is used to pass one of ManageAssetAction with required params

Ext
ManageAssetOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RequestNotFound
  • InvalidSignature
  • AssetAlreadyExists
  • InvalidMaxIssuanceAmount
  • InvalidCode
  • InvalidPreIssuer
  • InvalidPolicies
  • AssetNotFound
  • RequestAlreadyExists
  • StatsAssetAlreadyExists
  • InitialPreissuedExceedsMaxIssuance
  • InvalidCreatorDetails
  • InvalidTrailingDigitsCount
  • InvalidPreissuedAmountPrecision
  • InvalidMaxIssuanceAmountPrecision
  • AssetCreateTasksNotFound
  • AssetUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully performed

success
object (ManageAssetSuccess)

Is used to pass useful params after the successful operation application

Payment

Defines access points to get Payments

Create payment request

Allows to create request to transfer some amount of asset from source balance to destination account/balance. Payment request is a reviewable request. It uses tasks - bitmask, where each bit represents conditions under which request can be approved. Tasks can be set or cleared both manually(by reviewer) and automatically. Tasks bit mask can be provided either from KeyValueEntry by key payment_tasks:<asset_code> (which specify tasks for asset) or by key payment_tasks:* if there are no payment tasks for provided asset. If field allTasks is set, KeyValueEntry won't be used.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
receiver ASSET - RECEIVE_PAYMENT -
source REVIEWABLE_REQUEST CREATE_PAYMENT CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_PAYMENT CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Action Condition
REVIEWABLE_REQUEST CREATE_PAYMENT CREATE allTasks == null
REVIEWABLE_REQUEST CREATE_PAYMENT CREATE_WITH_TASKS allTasks != null
CreatePaymentRequestOp
Request
object

Payment request details

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CreateSale request to be approved, which will be used by key sale_create_tasks: instead of key-value

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • InvalidPayment
  • PaymentTasksNotFound
  • InvalidCreatorDetails
code
string
Value: "SUCCESS"

CreatePaymentRequestOp was successfully applied

success
object (CreatePaymentRequestSuccessResult)

Result of the successful payment request creation

Payment operantion

Allows to transfer some amount of asset from source balance to destination account/balance.

Account Role Requirements

Account Resource Type Action
source ASSET SEND
destination ASSET RECEIVE_PAYMENT

Signer Role Requirements

Resource Type Rule Action
ASSET SEND
PaymentOp

PaymentOp is used to transfer some amount of asset from the source balance to destination account/balance

SourceBalanceId
BalanceId

ID of the source balance of payment

Destination
PaymentOpDestinationArmAccount (object) or PaymentOpDestinationArmBalance (object)

destination defines the type of instance that receives the payment based on given PaymentDestinationType

Amount
uint64

Amount of payment

FeeData
object

feeData defines all data about the payment fee

Subject
string

subject is a user-provided info about the real-life purpose of payment

Reference
string

reference is a string formed by a payment sender. Reference-sender account pair is unique.

Ext
PaymentOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • Malformed
  • Underfunded
  • LineFull
  • DestinationBalanceNotFound
  • BalanceAssetsMismatched
  • SrcBalanceNotFound
  • ReferenceDuplication
  • StatsOverflow
  • LimitsExceeded
  • NotAllowedByAssetPolicy
  • InvalidDestinationFee
  • InsufficientFeeAmount
  • PaymentAmountIsLessThanDestFee
  • DestinationAccountNotFound
  • IncorrectAmountPrecision
  • InvalidSubject
code
string
Value: "SUCCESS"

Payment was successfully completed

paymentResponse
object (PaymentResponse)

PaymentResponse defines the response on the corresponding PaymentOp

Issuance

Defines access points to get Issuance Reviewable Requests

Create issuance request

Allows to create request to emit provided amount of specified asset to destination balance. Issuance request is a reviewable request. It uses tasks - bitmask, where each bit represents conditions under which request can be approved. Tasks can be set or cleared both manually(by reviewer) and automatically. Tasks bit mask can be provided either from KeyValueEntry by key issuance_tasks:<asset_code> (which specify tasks for asset) or by key issuance_tasks:* if there are no issuance tasks for provided asset. If field allTasks is set, KeyValueEntry won't be used.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
receiver ASSET RECEIVE_ISSUANCE - -
source REVIEWABLE_REQUEST CREATE_ISSUANCE CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_ISSUANCE CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Action
REVIEWABLE_REQUEST CREATE_ISSUANCE CREATE
CreateIssuanceRequestOp

CreateIssuanceRequestOp is used to create a reviewable request that, after reviewer's approval, will issue the specified amount of asset to a receiver's balance

Request
object

Issuance request to create

Reference
string

Reference of the request

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for IssuanceRequest to be approved, which will be used by key issuance_tasks: instead of key-value

Ext
CreateIssuanceRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • AssetNotFound
  • InvalidAmount
  • ReferenceDuplication
  • NoCounterparty
  • NotAuthorized
  • ExceedsMaxIssuanceAmount
  • ReceiverFullLine
  • InvalidCreatorDetails
  • FeeExceedsAmount
  • RequiresKyc
  • RequiresVerification
  • IssuanceTasksNotFound
  • SystemTasksNotAllowed
  • InvalidAmountPrecision
code
string
Value: "SUCCESS"

CreateIssuanceRequest operation application was successful

success
object (CreateIssuanceRequestSuccess)

Result of successful application of CreateIssuanceRequest operation

Create Pre Issuance Request

Allows creating CREATE_PRE_ISSUANCE reviewable request. CREATE_PRE_ISSUANCE request is used to increase available for issuance amount of asset.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST CREATE_PRE_ISSUANCE CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_PRE_ISSUANCE CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

No singer rule required because only asset pre issuer can do pre issuance.

CreatePreIssuanceRequestOp

CreatePreIssuanceRequestOp is used to create a reviewable request, which, after admin's approval, will change availableForIssuance amount of asset

Request
object

Body of PreIssuanceRequest to be created

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for PreIssuanceRequest to be approved, which will be used by key preissuance_tasks instead of key-value

Ext
CreatePreIssuanceRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • AssetNotFound
  • ReferenceDuplication
  • NotAuthorizedUpload
  • InvalidSignature
  • ExceededMaxAmount
  • InvalidAmount
  • InvalidReference
  • IncorrectAmountPrecision
  • PreissuanceTasksNotFound
  • InvalidCreatorDetails
code
string
Value: "SUCCESS"

Preissuance request is either successfully created or auto approved if pending tasks of requests is equal to 0

success
object (CreatePreIssuanceRequestResultSuccess)

Withdrawal

Defines access points to get Withdrawal Reviewable Requests

Create withdrawal request

Allows to create request to withdraw assets from system. On request creation, withdrawn amount will be locked on target balance. For withdrawal reviewable request REJECT action is not allowed. On PERMANENT REJECT, withdrawn amount is unlocked. On APPROVE, tasks can be added and removed. If pendingTasks == 0 and action being performed is APPROVE, withdrawn amount is sent to external account. Withdrawn amount is subtracted for issued field of the asset Withdrawal request cannot be autoapproved, i.e. it's not allowed to set empty (zero tasks) in any way, either through KeyValueEntry or on request creation(through allTasks).

Account Role Requirements

Account Resource Type Action
source WITHDRAW CREATE

Signer Role Requirements

Resource Type Reviewable Request Type Action
REVIEWABLE_REQUEST CREATE_WITHDRAW CREATE
CreateWithdrawalRequestOp

CreateWithdrawalRequest operation is used to create a reviewable request, which, after reviewer's approval, will charge the specified amount from balance and send it to external wallet/account

Request
object

Withdrawal request to create

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for WithdrawalRequest to be approved, which will be used by key withdrawal_tasks: instead of key-value

Ext
CreateWithdrawalRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • InvalidAmount
  • InvalidCreatorDetails
  • BalanceNotFound
  • AssetIsNotWithdrawable
  • ConversionPriceIsNotAvailable
  • FeeMismatched
  • ConversionOverflow
  • ConvertedAmountMismatched
  • BalanceLockOverflow
  • Underfunded
  • InvalidUniversalAmount
  • StatsOverflow
  • LimitsExceeded
  • InvalidPreConfirmationDetails
  • LowerBoundNotExceeded
  • WithdrawalTasksNotFound
  • NotAllowedToSetWithdrawalTasks
  • WithdrawalZeroTasksNotAllowed
code
string
Value: "SUCCESS"

CreateWithdrawalRequest operation successfully applied

success
object (CreateWithdrawalSuccess)

Result of the successful withdrawal request creation

Payment

Defines access points to get Payments

Create payment request

Allows to create request to transfer some amount of asset from source balance to destination account/balance. Payment request is a reviewable request. It uses tasks - bitmask, where each bit represents conditions under which request can be approved. Tasks can be set or cleared both manually(by reviewer) and automatically. Tasks bit mask can be provided either from KeyValueEntry by key payment_tasks:<asset_code> (which specify tasks for asset) or by key payment_tasks:* if there are no payment tasks for provided asset. If field allTasks is set, KeyValueEntry won't be used.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
receiver ASSET - RECEIVE_PAYMENT -
source REVIEWABLE_REQUEST CREATE_PAYMENT CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_PAYMENT CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Action Condition
REVIEWABLE_REQUEST CREATE_PAYMENT CREATE allTasks == null
REVIEWABLE_REQUEST CREATE_PAYMENT CREATE_WITH_TASKS allTasks != null
CreatePaymentRequestOp
Request
object

Payment request details

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CreateSale request to be approved, which will be used by key sale_create_tasks: instead of key-value

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • InvalidPayment
  • PaymentTasksNotFound
  • InvalidCreatorDetails
code
string
Value: "SUCCESS"

CreatePaymentRequestOp was successfully applied

success
object (CreatePaymentRequestSuccessResult)

Result of the successful payment request creation

Payment operantion

Allows to transfer some amount of asset from source balance to destination account/balance.

Account Role Requirements

Account Resource Type Action
source ASSET SEND
destination ASSET RECEIVE_PAYMENT

Signer Role Requirements

Resource Type Rule Action
ASSET SEND
PaymentOp

PaymentOp is used to transfer some amount of asset from the source balance to destination account/balance

SourceBalanceId
BalanceId

ID of the source balance of payment

Destination
PaymentOpDestinationArmAccount (object) or PaymentOpDestinationArmBalance (object)

destination defines the type of instance that receives the payment based on given PaymentDestinationType

Amount
uint64

Amount of payment

FeeData
object

feeData defines all data about the payment fee

Subject
string

subject is a user-provided info about the real-life purpose of payment

Reference
string

reference is a string formed by a payment sender. Reference-sender account pair is unique.

Ext
PaymentOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • Malformed
  • Underfunded
  • LineFull
  • DestinationBalanceNotFound
  • BalanceAssetsMismatched
  • SrcBalanceNotFound
  • ReferenceDuplication
  • StatsOverflow
  • LimitsExceeded
  • NotAllowedByAssetPolicy
  • InvalidDestinationFee
  • InsufficientFeeAmount
  • PaymentAmountIsLessThanDestFee
  • DestinationAccountNotFound
  • IncorrectAmountPrecision
  • InvalidSubject
code
string
Value: "SUCCESS"

Payment was successfully completed

paymentResponse
object (PaymentResponse)

PaymentResponse defines the response on the corresponding PaymentOp

Balances

Defines operations to manage Balances

Manage Balance

Allows to create new balance.

Account Role Requirements

Account Resource Type Action Condition
source BALANCE CREATE source accountID is equal to destination accountID
source BALANCE CREATE_FOR_OTHER source accountID differs from destination accountID

Signer Role Requirements

Resource Type Rule Action Condition
BALANCE CREATE_FOR_OTHER source accountID is equal to destination accountID
BALANCE CREATE source accountID differs from destination accountID
ManageBalanceOp

ManageBalanceOp applies an action of the ManageBalanceAction type on the balance of a particular asset (referenced to by its AssetCode) of the destination account (referenced to by its AccountID)

Action
string
Enum: "CREATE" "DELETE_BALANCE" "CREATE_UNIQUE"

Defines a ManageBalanceAction to be performed. DELETE_BALANCE is reserved and not implemented yet.

Destination
AccountId

Defines an account whose balance will be managed

Asset
string

Defines an asset code of the balance to which action will be applied

Ext
ManageBalanceOpExtArmEmptyVersion (object)
Response Schema
One of
  • Success
  • Malformed
  • NotFound
  • DestinationNotFound
  • AssetNotFound
  • InvalidAsset
  • BalanceAlreadyExists
  • VersionIsNotSupportedYet
code
string
Value: "SUCCESS"

Indicates that ManageBalanceOp is successfully applied

success
object (ManageBalanceSuccess)

Fees

Defines operations to manage Fees

Fee entry resources

Describes the fee entry which could be set by SetFeesOp.

FeeEntry

FeeEntry is used in the system configuration to set fees for different assets, operations (according to FeeType), particular account roles, particular accounts, or globally (only if both parameters particular account role and paticular account are not specified).

FeeType
string
Enum: "PAYMENT_FEE" "OFFER_FEE" "WITHDRAWAL_FEE" "ISSUANCE_FEE" "INVEST_FEE" "CAPITAL_DEPLOYMENT_FEE" "OPERATION_FEE" "PAYOUT_FEE" "ATOMIC_SWAP_SALE_FEE" "ATOMIC_SWAP_PURCHASE_FEE" "SWAP_FEE"

Type of a particular fee depending on the operation (e.g., PAYMENT_FEE for payment operation, WITHDRAWAL_FEE for withdrawal operation, etc.)

Asset
string

Code of an asset used in the operation for which the fee will be charged

FixedFee
long

Fixed amount of fee that will be charged for the operation

PercentFee
long

Percent from the operation amount that will be charged for the corresponding operation

AccountId
AccountId

(optional) Account for which a fee is set in the system

AccountRole
uint64

(optional) Account for which a fee is set in the system

Subtype
long

Defines a subtype of a fee if such exists (e.g., OUTGOING or INCOMING for PAYMENT_FEE)

LowerBound
long

Defines the lower bound of operation amount for which this fee is applicable

UpperBound
long

Defines the upper bound of operation amount for which this fee is applicable

Hash
array

Hash of type:<feeType>asset:<asset>subtype:<subtype> (Add accountID:<accountID> or accountRole:<accountRole> if corresponding fields are defined)

Ext
FeeEntryExtArmEmptyVersion (object)

reserved for future use

Code samples

Copy
//: `FeeType` represents different types of fees for different operations (e.g. fee charged on withdrawal or on investment)
enum FeeType
{
    PAYMENT_FEE = 0,
    OFFER_FEE = 1,
    WITHDRAWAL_FEE = 2,
    ISSUANCE_FEE = 3,
    INVEST_FEE = 4, // fee to be taken while creating the sale participation
    CAPITAL_DEPLOYMENT_FEE = 5, // fee to be taken when the sale closes
    OPERATION_FEE = 6,
    PAYOUT_FEE = 7,
    ATOMIC_SWAP_SALE_FEE = 8,
    ATOMIC_SWAP_PURCHASE_FEE = 9
};

//: (not used) `EmissionFeeType` is a subtype of `ISSUANCE_FEE`
enum EmissionFeeType
{
    PRIMARY_MARKET = 1,
    SECONDARY_MARKET = 2
};

//: `PaymentFeeType` is a subtype of the Fee used for payments
enum PaymentFeeType
{
    OUTGOING = 1,
    INCOMING = 2
};

//: `FeeEntry` is used in the system configuration to set fees for different assets, operations (according to FeeType), particular account roles, particular accounts,
//: or globally (only if both parameters particular account role and paticular account are not specified).
struct FeeEntry
{
    //: Type of a particular fee depending on the operation (e.g., PAYMENT_FEE for payment operation, WITHDRAWAL_FEE for withdrawal operation, etc.)
    FeeType feeType;
    //: Code of an asset used in the operation for which the fee will be charged
    AssetCode asset;

    //: Fixed amount of fee that will be charged for the operation
    int64 fixedFee;
    //: Percent from the operation amount that will be charged for the corresponding operation
    int64 percentFee;

    //: (optional) Account from which fee would be charged
    AccountID* accountID;
    //: (optional) Account role from which fee would be charged
    uint64*    accountRole;
    //: Defines a `subtype` of a fee if such exists (e.g., `OUTGOING` or `INCOMING` for `PAYMENT_FEE`)
    int64 subtype;

    //: Defines the lower bound of operation amount for which this fee is applicable
    int64 lowerBound;
    //: Defines the upper bound of operation amount for which this fee is applicable
    int64 upperBound;

    //: Hash of `type:<feeType>asset:<asset>subtype:<subtype>`
    //: (Add `accountID:<accountID>` or `accountRole:<accountRole>` if corresponding fields are defined)
    Hash hash;

    //: reserved for future use
    union switch (LedgerVersion v)
    {
    case EMPTY_VERSION:
        void;
    }
    ext;
};

Set Fees

Allows to set or remove relationships between fee entries and particular entities.

Account Role Requirements

Account Resource Type Action
source FEE MANAGE

Signer Role Requirements

Resource Type Rule Action
FEE MANAGE
SetFeesOp

Allows to establish or remove a relationship between a particular fee entry with the different entities

Fee
object

Fee entry to set

IsDelete
boolean

isDelete indicates that a fee should be either set or removed

Ext
SetFeesOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidAmount
  • InvalidFeeType
  • AssetNotFound
  • InvalidAsset
  • Malformed
  • MalformedRange
  • RangeOverlap
  • NotFound
  • SubTypeNotExist
  • InvalidFeeVersion
  • InvalidFeeAsset
  • FeeAssetNotAllowed
  • CrossAssetFeeNotAllowed
  • FeeAssetNotFound
  • AssetPairNotFound
  • InvalidAssetPairPrice
  • InvalidFeeHash
  • InvalidAmountPrecision
  • AccountNotFound
  • RoleNotFound
code
string
Value: "SUCCESS"

SetFeesOp was successfully applied and a fee was successfully set or deleted

success
object (SetFeesResultSuccess)

External Systems

Bind External System Account ID

Allows to bind source account to external system account ID pool. Only binded account can do deposits.

Account Role Requirements

Account Resource Type Action
source EXTERNAL_SYSTEM_ACCOUNT_ID_POOL_ENTRY BIND

Signer Role Requirements

Resource Type Action
EXTERNAL_SYSTEM_ACCOUNT_ID_POOL_ENTRY BIND
BindExternalSystemAccountIdOp

BindExternalSystemAccountIdOp is used to bind a particular account to the external system account which is represented by account ID taken from the pool

ExternalSystemType
integer

Type of external system to bind

Ext
BindExternalSystemAccountIdOpExtArmEmptyVersion (object)

Reserved for the future use

Response Schema
One of
  • Success
  • Malformed
  • NoAvailableId
code
string
Value: "SUCCESS"

Source account has been successfully bound to external system ID taken from the pool

success
object (BindExternalSystemAccountIdSuccess)

BindExternalSystemAccountIdSuccess represents details of successful result of operation application

Manage External System Pool Entry

Allows to create or remove external system account id pool entry External system account id pool entry can be binded to account.

Account Role Requirements

Account Resource Type Action
source EXTERNAL_SYSTEM_ACCOUNT_ID_POOL_ENTRY MANAGE

Signer Role Requirements

Resource Type Action
EXTERNAL_SYSTEM_ACCOUNT_ID_POOL_ENTRY MANAGE
ManageExternalSystemAccountIdPoolEntryOp

ManageExternalSystemAccountIdPoolEntryOp is used to create or remove an external system account ID from the external system ID pool

ActionInput
ManageExternalSystemAccountIdPoolEntryOpActionInputArmCreate (object) or ManageExternalSystemAccountIdPoolEntryOpActionInputArmRemove (object)

actionInput is used to pass one of ManageExternalSystemAccountIdPoolEntryAction with required params

Ext
ManageExternalSystemAccountIdPoolEntryOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • Malformed
  • AlreadyExists
  • NotFound
code
string
Value: "SUCCESS"

Specified action in actionInput of ManageExternalSystemAccountIdPoolEntryOp was performed successfully

success
object (ManageExternalSystemAccountIdPoolEntrySuccess)

Success result of operation application

Atomic Swap

Cancel Atomic Swap Ask Op

Allows to cancel atomic swap bid. If atomic swap bid has non zero locked amount (it means that CREATE_ATOMIC_SWAP_BID request is being processed). It will be marked as canceled and will be removed after all CREATE_ATOMIC_SWAP_BID request will be approved of permament rejected.

Account Role Requirements

No account rule required because only bid owner can perform such operation.

Signer Role Requirements

Resource Type Action
ATOMIC_SWAP_ASK CANCEL
CancelAtomicSwapAskOp

CancelAtomicSwapAskOp is used to cancel existing atomic swap ask

AskId
uint64

id of existing atomic swap ask

Ext
CancelAtomicSwapAskOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • AlreadyCancelled
code
string
Value: "SUCCESS"

Atomic swap ask was successfully removed or marked as canceled

success
object (CancelAtomicSwapAskResultSuccess)

Success result of CancelASwapAskOp application

Create Atomic Swap Ask request

Allows to create CREATE_ATOMIC_SWAP_ASK request, which approving creates atomic swap ask. Other accounts will have possibite to create CREATE_ATOMIC_SWAP_BID request for such ask to buy atomic swap ask base asset for the external system currency

Account Role Requirements

Account Resource Type Action Condition
source ATOMIC_SWAP_ASK CREATE allTasks == null
source ATOMIC_SWAP_ASK CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CREATE_ATOMIC_SWAP_ASK CREATE
CreateAtomicSwapAskRequestOp

CreateAtomicSwapAskRequestOp is used to create CREATE_ATOMIC_SWAP_ASK request

Request
object

Body of request which will be created

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CREATE_ATOMIC_SWAP_BID request to be approved, which will be used instead of key-value by atomic_swap_bid_tasks key

Ext
CreateAtomicSwapAskRequestOpExtArmEmptyVersion (object)

reserved for the future use

Response Schema
One of
  • Success
  • InvalidAmount
  • InvalidPrice
  • InvalidDetails
  • IncorrectPrecision
  • BaseAssetNotFound
  • BaseAssetCannotBeSwapped
  • QuoteAssetNotFound
  • QuoteAssetCannotBeSwapped
  • BaseBalanceNotFound
  • AssetsAreEqual
  • BaseBalanceUnderfunded
  • InvalidQuoteAsset
  • AtomicSwapAskTasksNotFound
code
string
Value: "SUCCESS"

CREATE_ATOMIC_SWAP_BID request has either been successfully created or auto approved

success
object (CreateAtomicSwapAskRequestSuccess)

Success result of CreateASwapAskCreationRequestOp application

Create Atomic Swap Bid request

Allows to create CREATE_ATOMIC_SWAP_BID request, which approving means:

  • external system currency was received by atomic swap ask owner
  • requestor receives amout of atomic swap ask base asset

Account Role Requirements

Account Resource Type Action
source ASSET RECEIVE_ATOMIC_SWAP

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CREATE_ATOMIC_SWAP_BID CREATE
CreateAtomicSwapBidRequestOp

CreateAtomicSwapBidRequestOp is used to create CREATE_ATOMIC_SWAP_BID request

Request
object

Body of request which will be created

Ext
CreateAtomicSwapBidRequestOpExtArmEmptyVersion (object)

reserved for the future use

Response Schema
One of
  • Success
  • InvalidBaseAmount
  • InvalidQuoteAsset
  • AskNotFound
  • QuoteAssetNotFound
  • AskUnderfunded
  • AtomicSwapBidTasksNotFound
  • IncorrectPrecision
  • AskIsCancelled
  • SourceAccountEqualsAskOwner
  • AtomicSwapBidZeroTasksNotAllowed
  • QuoteAmountOverflows
code
string
Value: "SUCCESS"

request was successfully created

success
object (CreateAtomicSwapBidRequestSuccess)

Success request of CreateAtomicSwapBidRequestOp application

Redemption

Create Redemption Request

Allows creating REDEMPTION reviewable request. REDEMPTION request is used to force redeem money from holder.

Account Role Requirements

Account Resource Type Action Condition
source REVIEWABLE_REQUEST CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_WITH_TASKS allTasks != null
destination ASSET RECEIVE_REDEMPTION -

Signer Role Requirements

Resource Type Action
REVIEWABLE_REQUEST CREATE
CreateRedemptionRequestOp

CreateRedemptionRequest operation creates a reviewable request that will transfer the specified amount from current holder's balance to destination balance after the reviewer's approval

Reference
string

Reference of RedemptionRequest

RedemptionRequest
object

Parameters of RedemptionRequest

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for RedemptionRequest to be approved, which will be used by key redemption_tasks instead of key-value

Ext
CreateRedemptionRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • InvalidRedemption
  • RedemptionTasksNotFound
  • InvalidCreatorDetails
  • InvalidAmount
  • InvalidReference
  • SourceBalanceNotExist
  • IncorrectPrecision
  • Underfunded
  • ReferenceDuplication
  • DstAccountNotFound
  • RedemptionZeroTasksNotAllowed
  • RedemptionNonOwnedAssetForbidden
code
string
Value: "SUCCESS"

Operation has been successfully performed

redemptionResponse
object (RedemptionRequestResponse)

Result of successful application of CreateRedemptionRequest operation

Deferred payment

Close deferred payment request

Allow to unlock and send money from existing deferred payment

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CLOSE_DEFERRED_PAYMENT CANCEL
CancelCloseDeferredPaymentRequestOp

CancelCloseDeferredPaymentRequestOp is used to cancel existing deferred payment creation request

RequestId
uint64

id of existing request

Ext
CancelCloseDeferredPaymentRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
RequestId
uint64

id of existing request

Ext
CancelCloseDeferredPaymentRequestOpExtArmEmptyVersion (object)

reserved for future use

Cancel create deferred payment request

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CREATE_DEFERRED_PAYMENT CANCEL
CancelDeferredPaymentCreationRequestOp

CancelDeferredPaymentCreationRequestOp is used to cancel existing deferred payment creation request

RequestId
uint64

id of existing request

Ext
CancelDeferredPaymentCreationRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
RequestId
uint64

id of existing request

Ext
CancelDeferredPaymentCreationRequestOpExtArmEmptyVersion (object)

reserved for future use

Close deferred payment request

Allow to unlock and send money from existing deferred payment

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST CLOSE_DEFERRED_PAYMENT CREATE allTasks == null
source REVIEWABLE_REQUEST CLOSE_DEFERRED_PAYMENT CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CLOSE_DEFERRED_PAYMENT CREATE

Tasks

create_deferred_payment_close_tasks:<asset_code>

CreateCloseDeferredPaymentRequestOp

CreateCloseDeferredPaymentRequestOp is used to create CLOSE_DEFERRED_PAYMENT request

RequestId
uint64
Request
object

Body of request which will be created

AllTasks
uint32
Ext
CreateCloseDeferredPaymentRequestOpExtArmEmptyVersion (object)

reserved for the future use

Response Schema
RequestId
uint64
Request
object

Body of request which will be created

AllTasks
uint32
Ext
CreateCloseDeferredPaymentRequestOpExtArmEmptyVersion (object)

reserved for the future use

Create deferred payment request

Allow to create deferred payment and allow destination to manage this deferred payment

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST CREATE_DEFERRED_PAYMENT CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_DEFERRED_PAYMENT CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CREATE_DEFERRED_PAYMENT CREATE

Tasks

create_deferred_payment_creation_tasks:<asset_code>

CreateDeferredPaymentCreationRequestOp

CreateDeferredPaymentCreationRequestOp is used to create CREATE_DEFERRED_PAYMENT request

RequestId
uint64
Request
object

Body of request which will be created

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CREATE_ATOMIC_SWAP_BID request to be approved, which will be used instead of key-value by create_deferred_payment_creation_request_tasks key

Ext
CreateDeferredPaymentCreationRequestOpExtArmEmptyVersion (object)

reserved for the future use

Response Schema
One of
  • Success
  • SourceBalanceNotFound
  • DestinationAccountNotFound
  • IncorrectPrecision
  • Underfunded
  • TasksNotFound
  • InvalidCreatorDetails
  • InvalidAmount
  • RequestNotFound
code
string
Value: "SUCCESS"

CREATE_DEFERRED_PAYMENT request has either been successfully created or auto approved

success
object (CreateDeferredPaymentCreationRequestSuccess)

Success result of CreateASwapAskCreationRequestOp application

Liquidity Pool

Provide liquidity to the pool

Allows to provide liquidity to the pool or create a new liquidity pool with provided assets amounts

Account Role Requirements

Account Resource Type Action
source LIQUIDITY_POOL LP_ADD_LIQUIDITY

Signer Role Requirements

Resource Type Action
LIQUIDITY_POOL LP_ADD_LIQUIDITY
LpAddLiquidityOp
FirstAssetBalanceId
BalanceId

Balance for first asset of the pair

SecondAssetBalanceId
BalanceId

Balance for second asset of the pair

FirstAssetDesiredAmount
uint64

Desired amount of first asset to be provided

SecondAssetDesiredAmount
uint64

Desired amount of second asset to be provided

FirstAssetMinAmount
uint64

Minimal amount of first asset to be provided

SecondAssetMinAmount
uint64

Minimal amount of second asset to be provided

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • SameAssets
  • Underfunded
  • BalanceOverflow
  • NotAllowedByAssetPolicy
  • SrcBalanceNotFound
  • InvalidDesiredAmount
  • InvalidMinAmount
  • IncorrectAmountPrecision
  • InsufficientFirstAssetAmount
  • InsufficientSecondAssetAmount
  • MinAmountBiggerThanDesired
  • InsufficientLiquidityProvided
  • SameBalances
code
string
Value: "SUCCESS"

LP add liquidity was successful

success
object (LpAddLiquiditySuccess)

Liquidity pool

Describes the liquidity pool state

LiquidityPoolEntry
Id
uint64

Unique sequential identifier of the liquidity pool

LiquidityPoolAccount
AccountId

Account that holds balances of the liquidity pool

LpTokenAssetCode
string

Asset code of the LP token

FirstAssetBalance
BalanceId

Balance of first asset

SecondAssetBalance
BalanceId

Balance of second asset

LpTokensTotalCap
uint64

Total amount of all LP tokens

FirstReserve
uint64

Amount of first asset stored in liquidity pool

SecondReserve
uint64

Amount of second asset stored in liquidity pool

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future usage

Code samples

Copy

struct LiquidityPoolEntry
{
  //: Unique sequential identifier of the liquidity pool
  uint64 id;

  //: Account that holds balances of the liquidity pool
  AccountID liquidityPoolAccount;

  //: Asset code of the LP token
  AssetCode lpTokenAssetCode;

  //: Balance of first asset
  BalanceID firstAssetBalance;
  //: Balance of second asset
  BalanceID secondAssetBalance;

  //: Total amount of all LP tokens
  uint64 lpTokensTotalCap;

  //: Amount of first asset stored in liquidity pool
  uint64 firstReserve;
  //: Amount of second asset stored in liquidity pool
  uint64 secondReserve;

  //: Reserved for future usage
  EmptyExt ext;
};

Swap assets

Allows to swap assets using a liquidity pool mechanism

Account Role Requirements

Account Resource Type Action
source LIQUIDITY_POOL LP_SWAP

Signer Role Requirements

Resource Type Action
LIQUIDITY_POOL LP_SWAP
LpSwapOp
FromBalance
BalanceId

Balance of the provided asset

ToBalance
BalanceId

Balance of the desired asset

LpSwapRequest
LpSwapOpLpSwapRequestArmExactOutTokensForInTokens (object) or LpSwapOpLpSwapRequestArmExactInTokensForOutTokens (object)
FeeData
object

Fee data for the swap

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • SameBalances
  • Underfunded
  • BalanceAssetsMatched
  • FromBalanceNotFound
  • ToBalanceNotFound
  • NotAllowedByAssetPolicy
  • InvalidDestinationFee
  • InsufficientFeeAmount
  • AmountIsLessThanDestFee
  • IncorrectAmountPrecision
  • InsufficientInputAmount
  • InsufficientOutputAmount
  • SameAssets
  • LiquidityPoolNotFound
  • InsufficientLiquidity
  • ExcessiveInputAmount
  • BalanceOverflow
code
string
Value: "SUCCESS"

LP swap was successful

success
object (LpSwapSuccess)

Remove liquidity from the pool

Allows to remove liquidity from the pool

Account Role Requirements

Account Resource Type Action
source LIQUIDITY_POOL LP_REMOVE_LIQUIDITY

Signer Role Requirements

Resource Type Action
LIQUIDITY_POOL LP_REMOVE_LIQUIDITY
LpRemoveLiquidityOp
LpTokenBalance
BalanceId

Balance of an LP token

LpTokensAmount
uint64

Amount of the LP tokens to be exchanged for assets pair

FirstAssetMinAmount
uint64

Minimal amount of first asset to be received

SecondAssetMinAmount
uint64

Minimal amount of second asset to be received

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • LpTokenBalanceNotFound
  • Underfunded
  • BalanceOverflow
  • LpNotFound
  • InvalidLpTokensAmount
  • InsufficientFirstAmount
  • InsufficientSecondAmount
  • IncorrectAmountPrecision
code
string
Value: "SUCCESS"

LP remove liquidity was successful

success
object (LpRemoveLiquiditySuccess)

Signers

Defines operations to manage Signers

Manage Signer

Allows managing signer for source account.

Account Role Requirements

Account Resource Type Action
source SIGNER MANAGE

Signer Role Requirements

Resource Type Action
SIGNER MANAGE
ManageSignerOp

ManageSignerOp is used to create, update or remove a signer

Data
One of multiple values

data is used to pass one of ManageSignerAction with required params

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • InvalidDetails
  • AlreadyExists
  • NoSuchRole
  • InvalidWeight
  • NotFound
  • NumberOfAdminsExceedsLicense
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Signer Roles

Signer Role - entry that consists of Signer Rules and can be attached to signer.

Manage Signer Role

Allows to create, update or remove signer roles.

Account Role Requirements

Account Resource Type Action
source SIGNER_ROLE MANAGE

Signer Role Requirements

Resource Type Action
SIGNER_ROLE MANAGE
ManageSignerRoleOp

ManageSignerRoleOp is used to create, update or remove a signer role

Data
One of multiple values

data is used to pass one of ManageSignerRoleAction with required params

Ext
ManageSignerRoleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • RuleIdDuplication
  • DefaultRuleIdDuplication
  • NoSuchRule
  • TooManyRuleIds
  • NotFound
  • RoleIsUsed
  • InvalidDetails
code
string
Value: "SUCCESS"

Means that the specified action in data of ManageSignerRoleOp was successfully executed

success
object (ManageSignerRoleResultSuccess)

Signer Rules

Signer Rule - entry that defines if action can be performed for resource.

TokenD uses strict policy for rules matching. List of requirements to the roles of participants is formed based on operation (transaction) details. If one of the requirements is not fulfilled, operation is rejected. Requirement is specified for signer and consits of resource and action to be performed. Requirement is fulfilled if signer's role contains matching rule with forbids=false. If one of the matching rules has forbids=true - operation is rejected. If role does not contain any matching rules - operation is rejected.

Manage Signer Rule

Allows to create, update or remove signer rules.

Account Role Requirements

Account Resource Type Action
source SIGNER_RULE MANAGE

Signer Role Requirements

Resource Type Action
SIGNER_RULE MANAGE
ManageSignerRuleOp

ManageSignerRuleOp is used to create, update or remove signer rule

Data
One of multiple values

data is used to pass one of ManageSignerRuleAction with required params

Ext
ManageSignerRuleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • RuleIsUsed
  • NotFound
  • InvalidDetails
  • InvalidAction
code
string
Value: "SUCCESS"

Specified action in data of ManageSignerRuleOp was successfully executed

success
object (ManageSignerRuleResultSuccess)

Signer Rules Resources

Describes the resources on which the signer can perform an action.

SignerRuleResource

Describes properties of some entries that can be used to restrict the usage of entries

One of
  • ReviewableRequest
  • Asset
  • Any
  • OfferEntry
  • Sale
  • AtomicSwapAsk
  • SignerRule
  • SignerRole
  • Signer
  • KeyValue
  • Poll
  • Vote
  • InitiateKycRecovery
  • AccountSpecificRule
  • Swap
  • Data
  • Custom
  • LiquidityPool
  • Account
  • Fee
  • Balance
  • PaymentRequest
  • ReferenceEntry
  • Statistics
  • Trust
  • AccountLimits
  • AssetPair
  • ExternalSystemAccountId
  • AccountKyc
  • ExternalSystemAccountIdPoolEntry
  • LimitsV2
  • StatisticsV2
  • PendingStatistics
  • Contract
  • AccountRole
  • AccountRule
  • Transaction
  • Stamp
  • License
  • DeferredPayment
type
string
Value: "REVIEWABLE_REQUEST"
reviewableRequest
object (SignerRuleResourceReviewableRequest)

Code samples

Copy
//: Describes properties of some entries that can be used to restrict the use of entries
union SignerRuleResource switch (LedgerEntryType type)
{
case REVIEWABLE_REQUEST:
    //: Describes properties which are equal to managed reviewable request entry fields
    struct
    {
        //: Describes properties of some reviewable request types that
        //: can be used to restrict the using of reviewable requests
        ReviewableRequestResource details;

        //: Bit mask of tasks which is allowed to add to reviewable request pending tasks
        uint64 tasksToAdd;
        //: Bit mask of tasks which is allowed to remove from reviewable request pending tasks
        uint64 tasksToRemove;
        //: Bit mask of tasks which is allowed to use as reviewable request pending tasks
        uint64 allTasks;

        EmptyExt ext;
    } reviewableRequest;
case ASSET:
    //: Describes properties which are equal to managed asset entry fields
    struct
    {
        AssetCode assetCode;
        uint64 assetType;

        EmptyExt ext;
    } asset;
case ANY:
    void;
case OFFER_ENTRY:
    //: Describes properties which are equal to managed offer entry fields and their properties
    struct
    {
        //: type of base asset
        uint64 baseAssetType;
        //: type of quote asset
        uint64 quoteAssetType;

        //: code of base asset
        AssetCode baseAssetCode;
        //: code of quote asset
        AssetCode quoteAssetCode;

        bool isBuy;

        EmptyExt ext;
    } offer;
case SALE:
    //: Describes properties which are equal to managed offer entry fields
    struct
    {
        uint64 saleID;
        uint64 saleType;

        EmptyExt ext;
    } sale;
case ATOMIC_SWAP_BID:
    struct
    {
        uint64 assetType;
        AssetCode assetCode;

        EmptyExt ext;
    } atomicSwapBid;
case SIGNER_RULE:
    //: Describes properties which are equal to managed signer rule entry fields
    struct
    {
        //: True means that resource will be triggered if default rule is managed
        //: or changing of `isDefault` property for signer rule
        bool isDefault;

        EmptyExt ext;
    } signerRule;
case SIGNER_ROLE:
    //: Describes properties which are equal to managed signer role entry fields
    struct
    {
        //: For signer role creating resource will be triggered if `roleID` equals `0`
        uint64 roleID;

        EmptyExt ext;
    } signerRole;
case SIGNER:
    //: Describes properties which are equal to managed signer entry fields
    struct
    {
        uint64 roleID;

        EmptyExt ext;
    } signer;
case KEY_VALUE:
    //: Describes properties which are equal to managed key value entry fields
    struct
    {
        //: prefix of key
        longstring keyPrefix;

        //: reserved for future extension
        EmptyExt ext;
    } keyValue;
default:
    //: reserved for future extension
    EmptyExt ext;
};

Account Roles

Account Role - entry that consists of Account Rules and can be attached to account.

Manage Account Role

Allows to create, update or remove account roles.

Account Role Requirements

Account Resource Type Action
source ACCOUNT_ROLE MANAGE

Signer Role Requirements

Resource Type Action
ACCOUNT_ROLE MANAGE
ManageAccountRoleOp

ManageAccountRoleOp is used to create, update or remove account role

Data
One of multiple values

data is used to pass one of ManageAccountRoleAction with required params

Ext
ManageAccountRoleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • RuleIdDuplication
  • NoSuchRule
  • NotFound
  • RoleIsUsed
  • InvalidDetails
code
string
Value: "SUCCESS"

This means that the specified action in data of ManageAccountRoleOp was successfully performed

success
object (ManageAccountRoleResultSuccess)

Account Rules

Account Rule defines if action can be performed for resource.

TokenD uses strict policy for rules matching. List of requirements to the roles of participants is formed based on operation (transaction) details. If one of the requirements is not fulfilled, operation is rejected. Requirement is specified for account and consits of resource and action to be performed. Requirement is fulfilled if account's role contains matching rule with forbids=false. If one of the matching rules has forbids=true - operation is rejected. If role does not contain any matching rules - operation is rejected.

Account Rules Resources

Describes the resources on which the account can perform an action.

AccountRuleResource

Describes properties of some entries that can be used to restrict the usage of entries

One of
  • Asset
  • ReviewableRequest
  • Any
  • OfferEntry
  • Sale
  • AtomicSwapAsk
  • KeyValue
  • Poll
  • Vote
  • InitiateKycRecovery
  • AccountSpecificRule
  • Swap
  • Data
  • Custom
  • LiquidityPool
  • Account
  • Signer
  • Fee
  • Balance
  • PaymentRequest
  • ReferenceEntry
  • Statistics
  • Trust
  • AccountLimits
  • AssetPair
  • ExternalSystemAccountId
  • AccountKyc
  • ExternalSystemAccountIdPoolEntry
  • LimitsV2
  • StatisticsV2
  • PendingStatistics
  • Contract
  • AccountRole
  • AccountRule
  • Transaction
  • SignerRule
  • SignerRole
  • Stamp
  • License
  • DeferredPayment
type
string
Value: "ASSET"
asset
object (AccountRuleResourceAsset)

Code samples

Copy
//: Describes properties of some entries that can be used to restrict the use of entries
union AccountRuleResource switch (LedgerEntryType type)
{
case ASSET:
    //: Describes properties which are equal to managed asset entry fields
    struct
    {
        AssetCode assetCode;
        uint64 assetType;

        EmptyExt ext;
    } asset;
case REVIEWABLE_REQUEST:
    //: Describes properties which are equal to managed reviewable request entry fields
    struct
    {
        //: Describes properties of some reviewable request types that
        //: can be used to restrict the using of reviewable requests
        ReviewableRequestResource details;

        //: reserved for future extension
        EmptyExt ext;
    } reviewableRequest;
case ANY:
    void;
case OFFER_ENTRY:
    //: Describes properties which are equal to managed offer entry fields and their properties
    struct
    {
        //: type of base asset
        uint64 baseAssetType;
        //: type of quote asset
        uint64 quoteAssetType;

        //: code of base asset
        AssetCode baseAssetCode;
        //: code of quote asset
        AssetCode quoteAssetCode;

        bool isBuy;

        //: reserved for future extension
        EmptyExt ext;
    } offer;
case SALE:
    //: Describes properties which are equal to managed offer entry fields
    struct
    {
        uint64 saleID;
        uint64 saleType;

        //: reserved for future extension
        EmptyExt ext;
    } sale;
case ATOMIC_SWAP_BID:
    struct
    {
        uint64 assetType;
        AssetCode assetCode;

        EmptyExt ext;
    } atomicSwapBid;
case KEY_VALUE:
    struct
    {
        //: prefix of key
        longstring keyPrefix;

        //: reserved for future extension
        EmptyExt ext;
    } keyValue;
default:
    //: reserved for future extension
    EmptyExt ext;
};

//: Describes properties of some reviewable request types that
//: can be used to restrict the using of reviewable requests
union ReviewableRequestResource switch (ReviewableRequestType requestType)
{
case CREATE_SALE:
    //: is used to restrict using of reviewable request with create_sale type
    struct
    {
        //: type of sale
        uint64 type;

        //: reserved for future extension
        EmptyExt ext;
    } createSale;
case CREATE_ISSUANCE:
    //: is used to restrict using of reviewable request with create_issuance type
    struct
    {
        //: code of asset
        AssetCode assetCode;
        //: type of asset
        uint64 assetType;

        //: reserved for future extension
        EmptyExt ext;
    } createIssuance;
case CREATE_WITHDRAW:
    //: is used to restrict using of reviewable request with create_withdraw type
    struct
    {
        //: code of asset
        AssetCode assetCode;
        //: type of asset
        uint64 assetType;

        //: reserved for future extension
        EmptyExt ext;
    } createWithdraw;
default:
    //: reserved for future extension
    EmptyExt ext;
};

Manage Account Rule

Allows to create, update or remove account rules.

Account Role Requirements

Account Resource Type Action
source ACCOUNT_RULE MANAGE

Signer Role Requirements

Resource Type Action
ACCOUNT_RULE MANAGE
ManageAccountRuleOp

ManageAccountRuleOp is used to create, update or remove account rule

Data
One of multiple values

data is used to pass one of ManageAccountRuleAction with required params

Ext
ManageAccountRuleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • RuleIsUsed
  • NotFound
  • InvalidDetails
  • InvalidAction
code
string
Value: "SUCCESS"

Means that specified action in data of ManageAccountRuleOp was successfully performed

success
object (ManageAccountRuleResultSuccess)

Account Specific Rules

Account Specific Rules are similar in functionality to Account Rules - they define permissions to interact with various TokenD entities on account level. The main difference between Account Specific Rules and Account Rules is that with Account Specific Rules it's possible to define permissions for particular account without need to create separate role for this account. What is more, Account Specific Rules are managed by both Admins and entry owners. Main use case for this feature is white/black lists for particular entity. In current version it's only possible to manage white/black lists for sales.

Create Account Specific Rule

Allows to create account specific rules. Only rules for sales now supported.

Account Role Requirements

No account rule required because only entry owner or admin can create specific rules

Signer Role Requirements

Resource Type Action
ACCOUNT_SPECIFIC_RULE CREATE
ManageAccountSpecificRuleOp

ManageAccountSpecificRuleOp is used to create or remove account specific rule

Data
ManageAccountSpecificRuleOpDataArmCreate (object) or ManageAccountSpecificRuleOpDataArmRemove (object)

data is used to pass one of ManageAccountSpecificRuleAction with required params

Ext
ManageAccountSpecificRuleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • NotFound
  • SaleNotFound
  • NotAuthorized
  • AlreadyExists
  • ReversedAlreadyExists
  • EntryTypeNotSupported
  • AccountNotFound
  • SpecificRuleNotSupported
  • RemovingGlobalRuleForbidden
code
string
Value: "SUCCESS"

Means that specified action in data of ManageAccountSpecificRuleOp was successfully performed

success
object (ManageAccountSpecificRuleResultSuccess)

Remove Account Specific Rule

Allows to remove account specific rules.

Account Role Requirements

No account rule required because only entry owner or admin can remove specific rules

Signer Role Requirements

Resource Type Action
ACCOUNT_SPECIFIC_RULE REMOVE
ManageAccountSpecificRuleOp

ManageAccountSpecificRuleOp is used to create or remove account specific rule

Data
ManageAccountSpecificRuleOpDataArmCreate (object) or ManageAccountSpecificRuleOpDataArmRemove (object)

data is used to pass one of ManageAccountSpecificRuleAction with required params

Ext
ManageAccountSpecificRuleOpExtArmEmptyVersion (object)

reserved for future use

Response Schema application/vnd.api+json
One of
  • Success
  • NotFound
  • SaleNotFound
  • NotAuthorized
  • AlreadyExists
  • ReversedAlreadyExists
  • EntryTypeNotSupported
  • AccountNotFound
  • SpecificRuleNotSupported
  • RemovingGlobalRuleForbidden
code
string
Value: "SUCCESS"

Means that specified action in data of ManageAccountSpecificRuleOp was successfully performed

success
object (ManageAccountSpecificRuleResultSuccess)

KYC

Defines access points to Change Role Reviewable Requests

Cancel change role request

Allows to cancel change role reviewable request

Account Role Requirements

Only reviewable request creator can cancel request

Signer Role Requirements

Resource Type Reviewable Request Type Action
REVIEWABLE_REQUEST CHANGE_ROLE CANCEL
CancelChangeRoleRequestOp

CancelChangeRoleRequestOp is used to cancel reviwable request for changing role. If successful, request with the corresponding ID will be deleted

RequestId
uint64

ID of the ChangeRoleRequest request to be canceled

Ext
CancelChangeRoleRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • RequestIdInvalid
  • RequestNotFound
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (CancelChangeRoleSuccess)

Result of successful CancelChangeRoleRequestOp application

Create Change Role Request

Allows creating CHANGE_ROLE reviewable request. CHANGE_ROLE request is used to change role of account.

Account Role Requirements

Account Resource Type Action Condition
source REVIEWABLE_REQUEST CREATE allTasks == null && destAccountID == source
source REVIEWABLE_REQUEST CREATE_WITH_TASKS allTasks != null || destAccountID != source

Signer Role Requirements

Resource Type Action
REVIEWABLE_REQUEST CREATE
CreateChangeRoleRequestOp

CreateChangeRoleRequestOp is used to create reviewable requests that, with admin's approval, will change the role of destinationAccount from current role to accountRoleToSet

RequestId
uint64

Set zero to create new request, set non zero to update existing request

DestinationAccount
AccountId

AccountID of an account whose role will be changed

AccountRoleToSet
uint64

ID of account role that will be attached to destinationAccount

CreatorDetails
string

Arbitrary stringified json object that can be used to attach data to be reviewed by an admin

AllTasks
uint32

Bit mask that will be used instead of the value from key-value entry by change_role_tasks:<currentRoleID>:<accountRoleToSet> key

Ext
CreateChangeRoleRequestOpExtArmEmptyVersion (object)
Response Schema
One of
  • Success
  • AccToUpdateDoesNotExist
  • RequestAlreadyExists
  • RequestDoesNotExist
  • NotAllowedToUpdateRequest
  • InvalidChangeRoleRequestData
  • InvalidCreatorDetails
  • ChangeRoleTasksNotFound
  • AccountRoleToSetDoesNotExist
code
string
Value: "SUCCESS"

Change role request has either been successfully created or auto approved

success
object (CreateChangeRoleRequestResultSuccess)

Create KYC Recovery Request

Allows creating KYC_RECOVERY reviewable request. KYC_RECOVERY request is used to finish account recovery, i.e. add new signers for the account. KYC_RECOVERY can be created by either admin, or some account. On request creation requestor is being set to targetAccount. It can be updated by targetAccount (providing additional kyc data) and is being reviewed by admin.

Account Role Requirements

Account Resource Type Action Condition
source REVIEWABLE_REQUEST CREATE allTasks == null && targetAccount == source
source REVIEWABLE_REQUEST CREATE_WITH_TASKS allTasks != null || targetAccount == source
source REVIEWABLE_REQUEST CREATE_FOR_OTHER allTasks == null && targetAccount != source
source REVIEWABLE_REQUEST CREATE_FOR_OTHER_WITH_TASKS allTasks != null || targetAccount != source

Signer Role Requirements

Resource Type Action
REVIEWABLE_REQUEST CREATE
CreateKycRecoveryRequestOp

CreateKYCRecoveryRequestOp to create KYC recovery request and set new signers for account

RequestId
uint64

ID of a reviewable request. If set 0, request is created, else - request is updated

TargetAccount
AccountId

Account for which signers will be set

SignersData
Array of objects

New signers to set

CreatorDetails
string

Arbitrary stringified json object that can be used to attach data to be reviewed by an admin

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for KYC recovery request to be approved, which will be used by key create_kyc_recovery_tasks instead of key-value

Ext
CreateKycRecoveryRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidCreatorDetails
  • KycRecoveryTasksNotFound
  • NoSignerData
  • SignerDuplication
  • InvalidWeight
  • InvalidDetails
  • RequestAlreadyExists
  • TargetAccountNotFound
  • RecoveryNotAllowed
  • NotAllowedToUpdateRequest
  • RequestNotFound
  • InvalidUpdateData
  • NotAllowedToSetTasksOnUpdate
code
string
Value: "SUCCESS"

KYC Recovery request was successfully created

success
object (CreateKycRecoveryRequestResultSuccess)

Initiate KYC recovery

Allows to initiate KYC recovery process. KYC recovery is the process of changing all of the account signers. InitiateKYCRecovery deletes all existing signers of account and creates the new one with publicKey provided in operation with role got by key kyc_recovery_signer_role.

Account Role Requirements

Account Resource Type Rule Action Details
source INITIATE_KYC_RECOVERY CREATE Resource includes id of the account role

Signer Role Requirements

Resource Type Action Details
INITIATE_KYC_RECOVERY CREATE Resource includes id of the account role
InitiateKycRecoveryOp

InitiateKYCRecoveryOp is used to start KYC recovery process

Account
AccountId

Address of account to be recovered

Signer
PublicKeyArmKeyTypeEd25519 (object)

New signer to set

Ext
InitiateKycRecoveryOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • RecoveryNotAllowed
  • RecoverySignerRoleNotFound
code
string
Value: "SUCCESS"

Means that KYC recovery was successfully initiated

success
object (InitiateKycRecoveryResultSuccess)

AMLAlert

Defines access points to AMLAlert Reviewable Requests

Create anti money laundering alert request

Anti money laundering alert request locks provided amount on target balance until further investigation. On AMLAlertRequest approve locked amount is being voided. Aml alert request is a reviewable request. It uses tasks - bitmask, where each bit represents conditions under which request can be approved. Tasks can be set or cleared both manually(by reviewer) and automatically. Tasks bit mask can be provided either from KeyValueEntry by key aml_alert_create (which specify tasks for aml alert request) or field allTasks, then KeyValueEntry won't be used.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST CREATE_AML_ALERT CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_AML_ALERT CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Action
REVIEWABLE_REQUEST CREATE_AML_ALERT CREATE
CreateAmlAlertRequestOp

CreateAMLAlertRequest operation creates a reviewable request that will void the specified amount from target balance after the reviewer's approval

Reference
string

Reference of AMLAlertRequest

AmlAlertRequest
object

Parameters of AMLAlertRequest

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for AMLAlertRequest to be approved, which will be used by key aml_alert_tasks: instead of key-value

Ext
CreateAmlAlertRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • OldBalanceNotExist
  • OldInvalidCreatorDetails
  • OldUnderfunded
  • OldReferenceDuplication
  • OldInvalidAmount
  • OldIncorrectPrecision
  • AmlAlertTasksNotFound
  • BalanceNotExist
  • InvalidCreatorDetails
  • Underfunded
  • ReferenceDuplication
  • InvalidAmount
  • IncorrectPrecision
code
string
Value: "SUCCESS"

Operation has been successfully performed

success
object (CreateAmlAlertRequestSuccess)

Result of successful application of CreateAMLAlertRequest operation

Limits

Manage LimitsUpdateRequest

Allows either to create new UpdateLimits reviewable request or update existing one

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST UPDATE_LIMITS CREATE allTasks == null
source REVIEWABLE_REQUEST UPDATE_LIMITS CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Rule Action
REVIEWABLE_REQUEST CREATE
CreateManageLimitsRequestOp

CreateManageLimitsRequestOp is used to create a reviewable request which, after approval, will update the limits set in the system

ManageLimitsRequest
object

Body of the UpdateLimits reviewable request to be created

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for ManageLimits request to be approved, which will be used instead of value from the key-value pair by key limits_update_tasks

RequestId
uint64

ID of the LimitsUpdateRequest If requestID == 0, operation creates a new limits entry; otherwise, it updates the existing one

Ext
CreateManageLimitsRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • ManageLimitsRequestReferenceDuplication
  • ManageLimitsRequestNotFound
  • InvalidCreatorDetails
  • LimitsUpdateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
  • LimitsUpdateZeroTasksNotAllowed
code
string
Value: "SUCCESS"

Operation was successfully applied and ManageLimitsRequest was successfully created

success
object (CreateManageLimitsRequestResultSuccess)

Manage Limits Operation

Allows to create or remove the existing limits entries.

Account Role Requirements

Account Resource Type Action
source LIMITS_V2 MANAGE

Signer Role Requirements

Resource Type Rule Action
LIMITS_V2 MANAGE
ManageLimitsOp

ManageLimitsOp is used to update limits set in the system

Details
ManageLimitsOpDetailsArmCreate (object) or ManageLimitsOpDetailsArmRemove (object)

details defines all details of an operation based on given ManageLimitsAction

Ext
ManageLimitsOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • AccountNotFound
  • NotFound
  • RoleNotFound
  • CannotCreateForAccIdAndAccType
  • InvalidLimits
  • AssetNotFound
code
string
Value: "SUCCESS"

ManageLimitsOp was successfully applied

success
object (ManageLimitsResultSuccess)

Asset Pairs

Asset Pair Resources

Describes the asset pairs as a set of properties and policies for two particular assets (i.e. base and quote assets).

AssetPairEntry

AssetPairEntry is used in system to group different assets into pairs and set particular policies and properties for them

Base
string

Code of base asset of the asset pair

Quote
string

Code of quote asset of the asset pair

CurrentPrice
long

defines an asset pair price as quote asset divided by base asset (i.e., amount of quote asset per 1 base asset)

PhysicalPrice
long

Price of the asset pair assigned on creation. Can only be updated by application the ManageAssetPair operation with action UPDATE_PRICE

PhysicalPriceCorrection
long

Price of the asset pair assigned on creation. Can only be updated by application the ManageAssetPair operation with action UPDATE_PRICE

MaxPriceStep
long

Max price step in percent. User is allowed to set offer only if both of price < (1 - maxPriceStep) * currentPrice and price > (1 + maxPriceStep) * currentPrice are true

Policies
integer

Bitmask of asset policies set by creator or corrected by ManageAssetPair operations

Ext
AssetPairEntryExtArmEmptyVersion (object)

Code samples

Copy
//: Policies that could be applied to AssetPair entry and define applicable operations for AssetPair
enum AssetPairPolicy
{
    //: If not set pair can not be traded on secondary market
    TRADEABLE_SECONDARY_MARKET = 1,
    //: If set, then prices for new offers must be greater then physical price with correction
    PHYSICAL_PRICE_RESTRICTION = 2,
    //: if set, then price for new offers must be in interval of (1 ± maxPriceStep)*currentPrice
    CURRENT_PRICE_RESTRICTION = 4
};

//: `AssetPairEntry` is used in system to group different assets into pairs and set particular policies and properties for them
struct AssetPairEntry
{
    //: Code of base asset of the asset pair
    AssetCode base;
    //: Code of quote asset of the asset pair
    AssetCode quote;

    //: defines an asset pair price as quote asset divided by base asset (i.e., amount of quote asset per 1 base asset)
    int64 currentPrice;
    //: Price of the asset pair assigned on creation. Can only be updated by application
    //: the `ManageAssetPair` operation with action `UPDATE_PRICE`
    int64 physicalPrice;

    //: Price of the asset pair assigned on creation. Can only be updated by application
    //: the `ManageAssetPair` operation with action `UPDATE_PRICE`
    int64 physicalPriceCorrection;

    //: Max price step in percent. User is allowed to set offer only if both of
    //: `price < (1 - maxPriceStep) * currentPrice` and `price > (1 + maxPriceStep) * currentPrice` are `true`
    int64 maxPriceStep;

    //: Bitmask of asset policies set by creator or corrected by `ManageAssetPair` operations
    int32 policies;

    // reserved for future use
    union switch (LedgerVersion v)
    {
      case EMPTY_VERSION:
        void;
    }
    ext;
};

Manage Asset Pair

Allows to create new asset pairs or update either policies or prices of the existing asset pairs.

Account Role Requirements

Account Resource Type Action
source ASSET_PAIR MANAGE

Signer Role Requirements

Resource Type Rule Action
ASSET_PAIR MANAGE
ManageAssetPairOp

ManageAssetPairOp either creates new asset pairs or updates prices or policies of existing asset pairs

Action
string
Enum: "CREATE" "UPDATE_PRICE" "UPDATE_POLICIES"

Defines a ManageBalanceAction that will be performed on an asset pair

Base
string

Defines a base asset of an asset pair

Quote
string

Defines a base asset of an asset pair

PhysicalPrice
long

New physical price of the asset pair which would be set after successful ManageAssetPairOp application

PhysicalPriceCorrection
long

New correction of the asset pair physical price in percents

MaxPriceStep
long

New maximal price step of asset pair

Policies
integer

Bitmask of asset policies set by the creator or corrected by manage asset operations

Ext
ManageAssetPairOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • AlreadyExists
  • Malformed
  • InvalidAsset
  • InvalidAction
  • InvalidPolicies
  • AssetNotFound
  • SameAsset
code
string
Value: "SUCCESS"

Indicates that ManageAssetPairOp has been successfully applied

success
object (ManageAssetPairSuccess)

ManageAssetPairSuccess represents a successful result of ManageAssetPairOp

Remove Asset Pair

Removes asset pairs.

Account Role Requirements

Account Resource Type Action
source ASSET_PAIR REMOVE

Signer Role Requirements

Resource Type Rule Action
ASSET_PAIR REMOVE
RemoveAssetPairOp

RemoveAssetPairOp removes specified asset pair

Base
string

Defines a base asset of an asset pair

Quote
string

Defines a base asset of an asset pair

Ext
RemoveAssetPairOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • HasActiveOffers
  • HasActiveSales
  • InvalidAssetCode
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (RemoveAssetPairSuccess)

Result of successful RemoveAssetPairOp application

Order Books

Create manage offer request

Allows to create request to make offer in some asset pair or participate in sale. ManageOffer request is a reviewable request. It uses tasks - bitmask, where each bit represents conditions under which request can be approved. Tasks can be set or cleared both manually(by reviewer) and automatically. Tasks bit mask can be provided from KeyValueEntry. If field allTasks is set, KeyValueEntry won't be used.

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
receiver ASSET - RECEIVE_PAYMENT -
source REVIEWABLE_REQUEST MANAGE_OFFER CREATE allTasks == null
source REVIEWABLE_REQUEST MANAGE_OFFER CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Action Condition
REVIEWABLE_REQUEST MANAGE_OFFER CREATE allTasks == null
REVIEWABLE_REQUEST MANAGE_OFFER CREATE_WITH_TASKS allTasks != null

If `allTasks' field is not set, tasks for request will be taken from one of the following key values.

Key Condition Description
create_offer_tasks:<base>:<quote> offerID == 0 && orderBookID == 0 Used to set tasks on offer creation
remove_offer_tasks:<base>:<quote> offerID != 0 && orderBookID == 0 && amount == 0 Used to set tasks on offer removal
create_sale_participation_tasks:<base>:<quote> offerID == 0 && orderBookID != 0 Used to set tasks on sale participation creation
remove_sale_participation_tasks:<base>:<quote> offerID != 0 && orderBookID != 0 && amount == 0 Used to set tasks on sale participation removal

<base> - order book base asset code. Usage of * to match any asset code is allowed.

<quote> - order book quote asset code. Usage of * to match any asset code is allowed.

CreateManageOfferRequestOp
Request
object

ManageOfferRequest details

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CreateSale request to be approved, which will be used by key sale_create_tasks: instead of key-value

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • InvalidOffer
  • ManageOfferTasksNotFound
  • InvalidCreatorDetails
code
string
Value: "SUCCESS"

CreateManageOfferRequestOp was successfully applied

success
object (CreateManagerOfferRequestSuccessResult)

Create offer

Allows to create offer with provided parameters

Account Role Requirements

Account Resource Type Action
source OFFER_ENTRY CREATE

Signer Role Requirements

Resource Type Action
OFFER_ENTRY CREATE
ManageOfferOp

ManageOfferOp is used to create or delete offer

BaseBalance
BalanceId

Balance for base asset of an offer creator

QuoteBalance
BalanceId

Balance for quote asset of an offer creator

IsBuy
boolean

Direction of an offer (to buy or to sell)

Amount
long

Amount in base asset to buy or sell (to delete an offer, set 0)

Price
long

Price of base asset in the ratio of quote asset

Fee
long

Fee in quote asset to pay

OfferId
uint64

ID of an offer to be managed. 0 to create a new offer, otherwise to edit an existing offer

OrderBookId
uint64

ID of an orderBook to put an offer in and to find a match in

Ext
ManageOfferOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • PhysicalPriceRestriction
  • CurrentPriceRestriction
  • Malformed
  • PairNotTraded
  • BalanceNotFound
  • Underfunded
  • CrossSelf
  • OfferOverflow
  • AssetPairNotTradable
  • NotFound
  • InvalidPercentFee
  • InsufficientPrice
  • OrderBookDoesNotExists
  • SaleIsNotStartedYet
  • SaleAlreadyEnded
  • OrderViolatesHardCap
  • CantParticipateOwnSale
  • AssetMismatched
  • PriceDoesNotMatch
  • PriceIsInvalid
  • UpdateIsNotAllowed
  • InvalidAmount
  • SaleIsNotActive
  • RequiresKyc
  • SourceUnderfunded
  • SourceBalanceLockOverflow
  • RequiresVerification
  • IncorrectAmountPrecision
  • SpecificRuleForbids
  • PendingIssuanceLessThenAmount
code
string
Value: "SUCCESS"

ManageOfferOp was successfully applied

success
object (ManageOfferSuccessResult)

Contains details of successful operation application

Remove offer

Allows to remove offer by ID, providing amount = 0

Account Role Requirements

Only offer owner can remove existing offer

Signer Role Requirements

Resource Type Action
OFFER_ENTRY REMOVE
ManageOfferOp

ManageOfferOp is used to create or delete offer

BaseBalance
BalanceId

Balance for base asset of an offer creator

QuoteBalance
BalanceId

Balance for quote asset of an offer creator

IsBuy
boolean

Direction of an offer (to buy or to sell)

Amount
long

Amount in base asset to buy or sell (to delete an offer, set 0)

Price
long

Price of base asset in the ratio of quote asset

Fee
long

Fee in quote asset to pay

OfferId
uint64

ID of an offer to be managed. 0 to create a new offer, otherwise to edit an existing offer

OrderBookId
uint64

ID of an orderBook to put an offer in and to find a match in

Ext
ManageOfferOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • PhysicalPriceRestriction
  • CurrentPriceRestriction
  • Malformed
  • PairNotTraded
  • BalanceNotFound
  • Underfunded
  • CrossSelf
  • OfferOverflow
  • AssetPairNotTradable
  • NotFound
  • InvalidPercentFee
  • InsufficientPrice
  • OrderBookDoesNotExists
  • SaleIsNotStartedYet
  • SaleAlreadyEnded
  • OrderViolatesHardCap
  • CantParticipateOwnSale
  • AssetMismatched
  • PriceDoesNotMatch
  • PriceIsInvalid
  • UpdateIsNotAllowed
  • InvalidAmount
  • SaleIsNotActive
  • RequiresKyc
  • SourceUnderfunded
  • SourceBalanceLockOverflow
  • RequiresVerification
  • IncorrectAmountPrecision
  • SpecificRuleForbids
  • PendingIssuanceLessThenAmount
code
string
Value: "SUCCESS"

ManageOfferOp was successfully applied

success
object (ManageOfferSuccessResult)

Contains details of successful operation application

Sale

Defines access points to get operations related to sales

Cancel sale creation request

Allows to cancel creation of the sale

Account Role Requirements

Only sale creator can cancel request

Signer Role Requirements

Resource Type Reviewable Request Type Action
REVIEWABLE_REQUEST CREATE_SALE CANCEL
CancelSaleCreationRequestOp

CancelSaleCreationRequest operation is used to cancel sale creation request. If successful, request with the corresponding ID will be deleted SaleCreationRequest with provided ID

RequestId
uint64

ID of the SaleCreation request to be canceled

Ext
CancelSaleCreationRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • RequestIdInvalid
  • RequestNotFound
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (CancelSaleCreationSuccess)

Result of successful CancelSaleCreationRequestOp application

Check sale state

Allows to check sale state. If sale reached hard cap or end time has come and reached soft cap, it will be closed and exchange between sale owner and participants will be performed.

Account Role Requirements

Account Resource Type Action
source SALE CHECK

Signer Role Requirements

Resource Type Action
SALE CHECK
CheckSaleStateOp

CheckSaleState operation is used to perform check on sale state - whether the sale was successful or not

SaleId
uint64

ID of the sale to check

Ext
CheckSaleStateOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • NotReady
code
string
Value: "SUCCESS"

CheckSaleState operation was successfully applied

success
object (CheckSaleStateSuccess)

Result of the successful application of CheckSaleState operation

Create sale creation request

Allows to create reviewable request which on approval will create sale for base asset. Quote assets are assets in which investments can be made. Base asset is an asset being sold.

Sale types

There are 4 types of sale:

  • Basic: For basic sale price of base asset is locked for every quote asset. Amount of tokens distributed between participants depends on amount of contribution and price of base asset in terms of quote asset in which contribution was made.
  • Crowdfunding: prices are not set. If sale was successful (soft cap was reached), all tokens (max amount to be sold) are distributed between participants according to their contributions.
  • Fixed price: price is locked only in default quote asset. Amount of tokens distributed between participants depends only on capitalization on sale close.
  • Immediate: price is locked only in default quote asset. Participants receive tokens being sold on sale immediatelly after making offer. Sale is considered successful even if soft cap was not reached.

    Account Role Requirements

    Account Resource Type Reviewable Request Type Action Condition
    source REVIEWABLE_REQUEST CREATE_SALE CREATE allTasks == null
    source REVIEWABLE_REQUEST CREATE_SALE CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type ReviewableRequestType Action
REVIEWABLE_REQUEST CREATE_SALE CREATE
CreateSaleCreationRequestOp

CreateSaleCreationRequest operation creates SaleCreationRequest or updates the rejected request

RequestId
uint64

ID of the SaleCreationRequest. If set to 0, a new request is created

Request
object

SaleCreationRequest details

AllTasks
uint32

(optional) Bit mask whose flags must be cleared in order for CreateSale request to be approved, which will be used by key sale_create_tasks: instead of key-value

Ext
CreateSaleCreationRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • AutoReviewFailed
  • RequestNotFound
  • BaseAssetOrAssetRequestNotFound
  • QuoteAssetNotFound
  • StartEndInvalid
  • InvalidEnd
  • InvalidPrice
  • InvalidCap
  • InsufficientMaxIssuance
  • InvalidAssetPair
  • RequestOrSaleAlreadyExists
  • InsufficientPreissued
  • InvalidCreatorDetails
  • VersionIsNotSupportedYet
  • SaleCreateTasksNotFound
  • NotAllowedToSetTasksOnUpdate
  • ExceededMaxRulesSize
  • GlobalSpecificRuleDuplication
  • AccountSpecificRuleDuplication
  • GlobalSpecificRuleRequired
  • AccountNotFound
code
string
Value: "SUCCESS"

CreateSaleCreationRequest operation was successfully applied

success
object (CreateSaleCreationSuccess)

Result of the successful application of CreateSaleCreationRequest operation

Create UpdateSaleDetailsRequest

Allows to create reviewable request which after approval will update sale details

Account Role Requirements

Account Resource Type Reviewable Request Type Action Condition
source REVIEWABLE_REQUEST UPDATE_SALE_DETAILS CREATE allTasks == null
source REVIEWABLE_REQUEST UPDATE_SALE_DETAILS CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Action
SALE MANAGE
ManageSaleOp

ManageSaleOp is used to cancel a sale, or create a reviewable request which, after approval, will update sale details.

SaleId
uint64

ID of the sale to manage

Data
One of multiple values

data is used to pass ManageSaleAction along with required parameters

Ext
ManageSaleOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • SaleNotFound
  • InvalidCreatorDetails
  • UpdateDetailsRequestAlreadyExists
  • UpdateDetailsRequestNotFound
  • NotAllowedToSetTasksOnUpdate
  • SaleUpdateDetailsTasksNotFound
  • InvalidUpdateTimeData
  • InvalidStartTime
  • InvalidEndTime
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (ManageSaleResultSuccess)

Result of ManageSale operation successful application

Cancel active sale

Allows to cancel sale

Account Role Requirements

Only sale owner or admin are able to manage sale

Signer Role Requirements

Resource Type Action
SALE MANAGE
ManageSaleOp

ManageSaleOp is used to cancel a sale, or create a reviewable request which, after approval, will update sale details.

SaleId
uint64

ID of the sale to manage

Data
One of multiple values

data is used to pass ManageSaleAction along with required parameters

Ext
ManageSaleOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • SaleNotFound
  • InvalidCreatorDetails
  • UpdateDetailsRequestAlreadyExists
  • UpdateDetailsRequestNotFound
  • NotAllowedToSetTasksOnUpdate
  • SaleUpdateDetailsTasksNotFound
  • InvalidUpdateTimeData
  • InvalidStartTime
  • InvalidEndTime
code
string
Value: "SUCCESS"

Operation is successfully applied

success
object (ManageSaleResultSuccess)

Result of ManageSale operation successful application

KeyValue

Key Value System Keys

Reserved keys (or key prefixes) which are used for system configuration. Instead of certain value * can be allowed and means than any parameter is appropriate.

Key value for reviewable request:

  • change_role_tasks:<currentAccountRoleID>:<accountRoleToSet> (* is allowed)
  • issuance_tasks:<assetCode> (* is allowed)
  • withdrawal_tasks:<assetCode> (* is allowed)
  • preissuance_tasks:<assetCode> (* is allowed)
  • asset_create_tasks
  • asset_update_tasks
  • sale_create_tasks:<assetCode> (* is allowed)
  • sale_update_tasks:<saleID> (* is allowed)
  • aml_alert_create
  • limits_update_tasks
  • atomic_swap_ask_tasks
  • atomic_swap_bid_tasks:<quote_asset> (* is allowed)
  • create_poll_tasks:<permissionType> (* is allowed)

Deposits:

  • ext_sys_exp_period:<externalSytemType> (* is NOT allowed)

Withdraw:

  • withdraw_lower_bound:<assetCode> (* is allowed)

Code samples

Copy
char const *changeRoleTasks = "change_role_tasks";
char const *externalSystemPrefix = "ext_sys_exp_period";
char const *issuanceTasksPrefix = "issuance_tasks";
char const *withdrawalTasksPrefix = "withdrawal_tasks";
char const *preIssuanceTasksPrefix = "preissuance_tasks";
char const *assetCreateTasks = "asset_create_tasks";
char const *assetUpdateTasks = "asset_update_tasks";
char const *saleUpdateDetailsTasksPrefix = "sale_update_tasks";
char const *saleCreateTasksPrefix = "sale_create_tasks";
char const *amlAlertCreateTasks = "aml_alert_create";
char const *limitsUpdateTasks = "limits_update_tasks";
char const *atomicSwapTasksPrefix = "atomic_swap_bid_tasks";
char const *atomicSwapAskTasks = "atomic_swap_ask_tasks";
char const *withdrawLowerBoundPrefix = "withdraw_lower_bound";
char const *maxSaleRulesNumbersKey = "max_sale_rules_number";
char const *createPollTasks = "create_poll_tasks";
char const *createKycRecoveryTasks = "create_kyc_recovery_tasks";
char const *kycRecoveryEnabled = "kyc_recovery_enabled";
char const *kycRecoverySignerRole = "kyc_recovery_signer_role";

Manage KeyValue

Operation allows to update key-value entry on successful application

Account Role Requirements

Account Resource Type Action
source KEY_VALUE MANAGE

Signer Role Requirements

Resource Type Rule Action
KEY_VALUE MANAGE
ManageKeyValueOp

ManageKeyValueOp is used to create the manage key-value operation which, if applied successfully, will update the key-value entry present in the system

Key
string

key is the key for KeyValueEntry

Action
ManageKeyValueOpActionArmPut (object) or ManageKeyValueOpActionArmRemove (object)

action defines an action applied to the KeyValue based on given ManageKVAction

  • Action PUT stores new value for a particular key
  • Action REMOVE removes the value by a particular key
Ext
ManageKeyValueOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • AccountNotFound
  • NotFound
  • RoleNotFound
  • CannotCreateForAccIdAndAccType
  • InvalidLimits
  • AssetNotFound
code
string
Value: "SUCCESS"

ManageLimitsOp was successfully applied

success
object (ManageLimitsResultSuccess)

Requests

Review Request

Allows to review pending reviewable requests. Operation performs specified action - APPROVE, REJECT or PERMANENT_REJECT on request. It also sets or removes tasks - bit flags. For request to be fulfilled, all tasks should be cleared, i.e. field pendingTasks of request that is being reviewed should be zero.

Account Role Requirements

There are no account role requirements. Only Reviewer can review request

Signer Role Requirements

Resource Type Action Details
REVIEWABLE_REQUEST REVIEW Reviewable request resource has subtype which should correspond to type of the request being reviewed
ReviewRequestOp

Review Request operation

RequestId
uint64

ID of a request that is being reviewed

RequestHash
array

Hash of a request that is being reviewed

RequestDetails
One of multiple values

requestDetails is used to pass request type along with details specific to it.

Action
string
Enum: "APPROVE" "REJECT" "PERMANENT_REJECT"

Review action defines an action performed on the pending ReviewableRequest

Reason
string

Contains reject reason

ReviewDetails
object

Details of the ReviewRequest operation

Ext
ReviewRequestOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • ManageOfferFailed
  • PaymentFailed
  • InvalidReason
  • InvalidAction
  • HashMismatched
  • NotFound
  • TypeMismatched
  • RejectNotAllowed
  • InvalidExternalDetails
  • RequestorIsBlocked
  • PermanentRejectNotAllowed
  • RemovingNotSetTasks
  • AssetAlreadyExists
  • AssetDoesNotExists
  • MaxIssuanceAmountExceeded
  • InsufficientAvailableForIssuanceAmount
  • FullLine
  • SystemTasksNotAllowed
  • IncorrectPrecision
  • BaseAssetDoesNotExists
  • HardCapWillExceedMaxIssuance
  • InsufficientPreissuedForHardCap
  • BaseAssetNotFound
  • AssetPairNotFound
  • QuoteAssetNotFound
  • NonZeroTasksToRemoveNotAllowed
  • AccountRoleToSetDoesNotExist
  • SaleNotFound
  • AmountMismatched
  • DestinationBalanceMismatched
  • NotAllowedAccountDestination
  • RequiredSourcePayForDestination
  • SourceBalanceMismatched
  • ContractNotFound
  • InvoiceReceiverBalanceLockAmountOverflow
  • InvoiceAlreadyApproved
  • PaymentV2Malformed
  • Underfunded
  • LineFull
  • DestinationBalanceNotFound
  • BalanceAssetsMismatched
  • SrcBalanceNotFound
  • ReferenceDuplication
  • StatsOverflow
  • LimitsExceeded
  • NotAllowedByAssetPolicy
  • InvalidDestinationFee
  • InvalidDestinationFeeAsset
  • FeeAssetMismatched
  • InsufficientFeeAmount
  • BalanceToChargeFeeFromNotFound
  • PaymentAmountIsLessThanDestFee
  • DestinationAccountNotFound
  • CannotCreateForAccIdAndAccType
  • InvalidLimits
  • AccountNotFound
  • RoleNotFound
  • ContractDetailsTooLong
  • BaseAssetCannotBeSwapped
  • QuoteAssetCannotBeSwapped
  • AtomicSwapBidOwnerFullLine
  • InvalidSignerData
  • DataNotFound
code
string
Value: "SUCCESS"

Codes considered as "success" for an operation Operation is applied successfully

success
object (ExtendedResult)

Extended result of a Review Request operation containing details specific to certain request types

Licensing

License

License is used to increase allowed number of admins and set new due date. Auxilary signatures are used to validate license authenticity.

Account Role Requirements

Account Resource Type Action
source LICENSE CREATE

Signer Role Requirements

Resource Type Action
LICENSE CREATE
LicenseOp

License operation is used to increase the allowed number of admins and due date

AdminCount
uint64

Allowed number of admins to set in the system

DueDate
uint64

Expiration date of the license

LedgerHash
array

Hash of a stamped ledger

PrevLicenseHash
array

Hash of the previous license

Signatures
Array of objects

Signatures are used to prove authenticity of license that is being submitted.

Ext
LicenseOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
  • InvalidStamp
  • InvalidDueDate
  • InvalidSignature
  • ExtraSignatures
code
string
Value: "SUCCESS"

License submit was successful, provided adminCount and dueDate were set in the system

success
object (LicenseSuccess)

LicenseSuccess is a result of successful LicenseOp application

Stamp

Allows to save current license hash and currenct ledger hash for use in LicenseOp application

Account Role Requirements

Account Resource Type Action
source STAMP CREATE

Signer Role Requirements

Resource Type Action
STAMP CREATE
StampOp

StampOp is used to save current ledger hash and current license hash

Ext
StampOpExtArmEmptyVersion (object)

Reserved for future use

Response Schema
One of
  • Success
code
string
Value: "SUCCESS"

Stamp was successful

success
object (StampSuccess)

StampSuccess is used to pass saved ledger hash and license hash

WIP

CloseSwap operation

Allows to lock some amount of asset on source balance with ability to send it to destination account/balance if destination knows secret.

Swap can be closed if:

  • Lock time not reached, receiver is the source of close swap, correct secret provided
  • Lock time reached, sender is the source of close swap, secret not provided
  • Lock time reached, master is the source of close swap, secret not provided

Account Role Requirements

Account Resource Type Action
swapSource SWAP EXCHANGE
swapDest SWAP EXCHANGE

Signer Role Requirements

Resource Type Rule Action
SWAP EXCHANGE
CloseSwapOp
SwapId
uint64

ID of the swap to close

Secret
array

(optional) Secret of the swap. Must be provided in order for destination of the swap to receive funds

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • SwapExpired
  • InvalidSecret
  • LineFull
  • NotAuthorized
code
string
Value: "SUCCESS"

CloseSwap was successful

success
object (CloseSwapSuccess)

CloseSwapSuccess is used to pass saved ledger hash and license hash

OpenSwap operation

Allows to lock some amount of asset on source balance with ability to send it to destination account/balance if destination knows secret.

Account Role Requirements

Account Resource Type Action
source SWAP EXCHANGE
destination SWAP EXCHANGE

Signer Role Requirements

Resource Type Rule Action
SWAP EXCHANGE
OpenSwapOp
SourceBalance
BalanceId

Source balance of the swap

Amount
uint64

Amount to send in swap

Destination
OpenSwapOpDestinationArmAccount (object) or OpenSwapOpDestinationArmBalance (object)

destination defines the type of instance that receives amount based on given PaymentDestinationType

FeeData
object

Fee data for the swap

Details
string

Arbitrary stringified json object provided by swap source

SecretHash
array

Hash of the secret

LockTime
long

Time till which swapped funds can be received by destination if valid secret is provided

Ext
EmptyExtArmEmptyVersion (object)

reserved for future extension

Response Schema
One of
  • Success
  • Malformed
  • Underfunded
  • BalanceAssetsMismatched
  • SrcBalanceNotFound
  • NotAllowedByAssetPolicy
  • InvalidDestinationFee
  • InsufficientFeeAmount
  • AmountIsLessThanDestFee
  • IncorrectAmountPrecision
  • InvalidDetails
  • InvalidLockTime
  • InvalidAmount
code
string
Value: "SUCCESS"

OpenSwap was successful

success
object (OpenSwapSuccess)

OpenSwapSuccess is used to pass saved ledger hash and license hash

Polls

Defines access points to operations related to polls

Cancel Request For Poll Cretion

Allows to cancel (remove) CREATE_POLL reviewable request

Account Role Requirements

Only CREATE_POLL request creator can cancel request

Signer Role Requirements

Resource Type Reviewable Request Type Rule Action
REVIEWABLE_REQUEST CREATE_POLL CANCEL
ManageCreatePollRequestOp

ManageCreatePollRequestOp is used to create or remove a CREATE_POLL request

Data
ManageCreatePollRequestOpDataArmCreate (object) or ManageCreatePollRequestOpDataArmCancel (object)

data is used to pass one of ManageCreatePollRequestAction with required params

Ext
ManageCreatePollRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidCreatorDetails
  • NotFound
  • InvalidDates
  • InvalidEndTime
  • ResultProviderNotFound
  • CreatePollTasksNotFound
  • InvalidNumberOfChoices
code
string
Value: "SUCCESS"

CREATE_POLL request has either been successfully created or auto approved

success
object (ManageCreatePollRequestSuccessResult)

Success result of operation application

Cancel Poll

Allows to cancel poll. Only admin or poll owner can cancel poll.

Account Role Requirements

Account Resource Type Rule Action
source POLL CANCEL

Signer Role Requirements

Resource Type Rule Action
POLL CANCEL
ManagePollOp

ManagePollOp is used to close, update end time or cancel the poll

PollId
uint64

ID of poll to manage

Data
One of multiple values

data is used to pass one of ManagePollAction with required params

Ext
ManagePollOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • PollNotReady
  • NotAuthorizedToClosePoll
  • InvalidEndTime
  • NotAuthorized
code
string
Value: "SUCCESS"

Specified action in data of ManagePollOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Close Poll

Allows to submit poll result. Only resultProvider can sumbit poll result

Account Role Requirements

Account Resource Type Rule Action
source POLL CLOSE

Signer Role Requirements

Resource Type Rule Action
POLL CLOSE
ManagePollOp

ManagePollOp is used to close, update end time or cancel the poll

PollId
uint64

ID of poll to manage

Data
One of multiple values

data is used to pass one of ManagePollAction with required params

Ext
ManagePollOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • PollNotReady
  • NotAuthorizedToClosePoll
  • InvalidEndTime
  • NotAuthorized
code
string
Value: "SUCCESS"

Specified action in data of ManagePollOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Create Request For Poll Creation

Allows to create CREATE_POLL reviewable request. CREATE_POLL request is used to create poll entry

Account Role Requirements

Account Resource Type Reviewable Request Type Rule Action Condition
source REVIEWABLE_REQUEST CREATE_POLL CREATE allTasks == null
source REVIEWABLE_REQUEST CREATE_POLL CREATE_WITH_TASKS allTasks != null

Signer Role Requirements

Resource Type Reviewable Request Type Rule Action Details
REVIEWABLE_REQUEST CREATE_POLL CREATE Resource includes permission type of poll
ManageCreatePollRequestOp

ManageCreatePollRequestOp is used to create or remove a CREATE_POLL request

Data
ManageCreatePollRequestOpDataArmCreate (object) or ManageCreatePollRequestOpDataArmCancel (object)

data is used to pass one of ManageCreatePollRequestAction with required params

Ext
ManageCreatePollRequestOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • InvalidCreatorDetails
  • NotFound
  • InvalidDates
  • InvalidEndTime
  • ResultProviderNotFound
  • CreatePollTasksNotFound
  • InvalidNumberOfChoices
code
string
Value: "SUCCESS"

CREATE_POLL request has either been successfully created or auto approved

success
object (ManageCreatePollRequestSuccessResult)

Success result of operation application

Update Poll end time

Allows update poll end time. Only admin or poll owner can update poll end time.

Account Role Requirements

Account Resource Type Rule Action
source POLL UPDATE_END_TIME

Signer Role Requirements

Resource Type Rule Action
POLL UPDATE_END_TIME
ManagePollOp

ManagePollOp is used to close, update end time or cancel the poll

PollId
uint64

ID of poll to manage

Data
One of multiple values

data is used to pass one of ManagePollAction with required params

Ext
ManagePollOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • NotFound
  • PollNotReady
  • NotAuthorizedToClosePoll
  • InvalidEndTime
  • NotAuthorized
code
string
Value: "SUCCESS"

Specified action in data of ManagePollOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Votes

Defines access points to operations related to votes

Create Vote

Allows to create (send) vote

Account Role Requirements

Account Resource Type Rule Action
source VOTE CREATE

Signer Role Requirements

Account Resource Type Rule Action Condition
source VOTE CREATE Always
resultProvider VOTE CREATE_FOR_OTHER voteConfirmationRequired == true
ManageVoteOp

ManageVoteOp is used to create (send) or remove (cancel) vote

Data
ManageVoteOpDataArmCreate (object) or ManageVoteOpDataArmRemove (object)

data is used to pass ManageVoteAction with needed params

Ext
ManageVoteOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • VoteNotFound
  • PollNotFound
  • VoteExists
  • PollTypeMismatched
  • PollNotStarted
  • PollEnded
code
string
Value: "SUCCESS"

Specified action in data of ManageVoteOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Remove Vote

Allows to remove (cancel) own vote

Account Role Requirements

Account Resource Type Rule Action
source VOTE REMOVE

Signer Role Requirements

Account Resource Type Rule Action
source VOTE REMOVE
ManageVoteOp

ManageVoteOp is used to create (send) or remove (cancel) vote

Data
ManageVoteOpDataArmCreate (object) or ManageVoteOpDataArmRemove (object)

data is used to pass ManageVoteAction with needed params

Ext
ManageVoteOpExtArmEmptyVersion (object)

reserved for future use

Response Schema
One of
  • Success
  • VoteNotFound
  • PollNotFound
  • VoteExists
  • PollTypeMismatched
  • PollNotStarted
  • PollEnded
code
string
Value: "SUCCESS"

Specified action in data of ManageVoteOp was successfully executed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Data

Create data

Allows to create data

Account Role Requirements

Account Resource Type Rule Action Details
source DATA CREATE Resource contains data type

Signer Role Requirements

Account Resource Type Rule Action Condition Details
source DATA CREATE Always Resource contains data type
CreateDataOp
Type
uint64

Numeric type, used for access control

Value
string

Value to store

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future extension

Response Schema
One of
  • Success
  • InvalidData
code
string
Value: "SUCCESS"

Data entry was successfully created

success
object (CreateDataSuccess)

Data Resources

Describes the data pairs as a set of properties and policies for two particular datas (i.e. base and quote datas).

DataEntry
Id
uint64

ID of the data entry

Type
uint64

Numeric type, used for access control

Value
string

Value stored

Owner
AccountId

Creator of the entry

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future extension

Code samples

Copy
struct DataEntry
{
  //: ID of the data entry
  uint64 id;
  //: Numeric type, used for access control
  uint64 type;
  //: Value stored
  longstring value;

  //: Owner of the entry
  AccountID owner;
  //: Reserved for future extension
  EmptyExt ext;
};

Remove data

Allows to remove data

Account Role Requirements

Account Resource Type Rule Action Condition Details
source DATA REMOVE source accountID is equal to data owner Resource contains data type
source DATA REMOVE_FOR_OTHER source accountID is not equal to data owner Resource contains data type

Signer Role Requirements

Account Resource Type Rule Action Condition Details
source DATA REMOVE source accountID is equal to data owner Resource contains data type
source DATA REMOVE_FOR_OTHER source accountID is not equal to data owner Resource contains data type
RemoveDataOp
DataId
uint64

ID of the data to remove

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future extension

Response Schema
One of
  • Success
  • NotFound
  • NotAuthorized
code
string
Value: "SUCCESS"

Data successfully removed

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Update data

Allows to update data

Account Role Requirements

Account Resource Type Rule Action Condition Details
source DATA UPDATE source accountID is equal to data owner Resource contains data type
source DATA UPDATE_FOR_OTHER source accountID is not equal to data owner Resource contains data type

Signer Role Requirements

Account Resource Type Rule Action Condition Details
source DATA UPDATE source accountID is equal to data owner Resource contains data type
source DATA UPDATE_FOR_OTHER source accountID is not equal to data owner Resource contains data type
UpdateDataOp
DataId
uint64

ID of the data entry to update

Value
string

New value to set

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future extension

Response Schema
One of
  • Success
  • InvalidData
  • NotFound
  • NotAuthorized
code
string
Value: "SUCCESS"

Data was successfully updated

ext
EmptyExtArmEmptyVersion (object) (EmptyExt)

Update an owner of data

Allows to update an owner of data

Account Role Requirements

Account Resource Type Rule Action Condition Details
source DATA TRANSFER_OWNERSHIP source accountID is equal to data owner Resource contains data type

Signer Role Requirements

Account Resource Type Rule Action Condition Details
source DATA TRANSFER_OWNERSHIP source accountID is equal to data owner Resource contains data type
UpdateDataOwnerOp
DataId
uint64

ID of the data entry to update an owner

NewOwner
AccountId

A new owner of the entry

Ext
EmptyExtArmEmptyVersion (object)

Reserved for future extension

Response Schema
One of
  • Success
  • NotFound
  • NotAuthorized
  • UserNotFound
  • OldAndNewUsersAreSame
code
string
Value: "SUCCESS"

An owner of the data was successfully updated

success
object (UpdateDataOwnerSuccess)

Result of successful application of UpdateDataOwner operation