This repo defines structures used to communicate with Core
of TokenD based networks.
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).
Account | Resource Type | Action |
---|---|---|
source | TRANSACTION |
SEND |
Signers rules required on operation level.
Tx | object Transaction is a container for a set of operations
|
Signatures | Array of objects list of signatures used to authorize transaction |
FeeCharged | long |
Result | One of multiple values |
Ext | TransactionResultExtArmEmptyVersion (object) |
Allows creating account with specific role and signers.
Balances for assets with policy BASE_ASSET
will be created for the account automatically.
Account | Resource Type | Action |
---|---|---|
source | ACCOUNT |
CREATE |
Resource Type | Rule Action |
---|---|
ACCOUNT |
CREATE |
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 |
code | string Value: "SUCCESS" Means that |
success | object (CreateAccountSuccess) Result of successful application of |
Allows to create or update CREATE_ASSET
reviewable request
CREATE_ASSET
request is used to create asset entry
Account | Resource Type | Rule Action | Condition |
---|---|---|---|
source | ASSET |
CREATE |
allTasks == null |
source | ASSET |
CREATE_WITH_TASKS |
allTasks != null |
Resource Type | Rule Action | Details |
---|---|---|
ASSET |
CREATE |
Resource includes code and type of asset |
ManageAssetOp is used to:
CREATE_ASSET
request;UPDATE_ASSET
request;CREATE_ASSET
or UPDATE_ASSET
requestRequestId | uint64 ID of a reviewable request
If |
Request | One of multiple values data is used to pass one of |
Ext | ManageAssetOpExtArmEmptyVersion (object) reserved for future use |
code | string Value: "SUCCESS" Specified action in |
success | object (ManageAssetSuccess) Is used to pass useful params after the successful operation application |
Describes the asset pairs as a set of properties and policies for two particular assets (i.e. base and quote assets).
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. |
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 |
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; };
Allows to create or update UPDATE_ASSET
reviewable request
UPDATE_ASSET
request is used to update asset entry
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 |
Resource Type | Rule Action | Details |
---|---|---|
ASSET |
UPDATE |
Resource includes code and type of asset |
ManageAssetOp is used to:
CREATE_ASSET
request;UPDATE_ASSET
request;CREATE_ASSET
or UPDATE_ASSET
requestRequestId | uint64 ID of a reviewable request
If |
Request | One of multiple values data is used to pass one of |
Ext | ManageAssetOpExtArmEmptyVersion (object) reserved for future use |
code | string Value: "SUCCESS" Specified action in |
success | object (ManageAssetSuccess) Is used to pass useful params after the successful operation application |
Allows to cancel CREATE_ASSET
or UPDATE_ASSET
reviewable request
No account rule required because only requestor can remove own request
Resource Type | Rule Action | Details |
---|---|---|
ASSET |
CANCEL |
Resource includes code and type of asset |
ManageAssetOp is used to:
CREATE_ASSET
request;UPDATE_ASSET
request;CREATE_ASSET
or UPDATE_ASSET
requestRequestId | uint64 ID of a reviewable request
If |
Request | One of multiple values data is used to pass one of |
Ext | ManageAssetOpExtArmEmptyVersion (object) reserved for future use |
code | string Value: "SUCCESS" Specified action in |
success | object (ManageAssetSuccess) Is used to pass useful params after the successful operation application |
Allows to change asset pre issuer
No account rule required because only current asset pre issuer can change asset pre issuer
No signer rule required because only current asset pre issuer can change asset pre issuer
ManageAssetOp is used to:
CREATE_ASSET
request;UPDATE_ASSET
request;CREATE_ASSET
or UPDATE_ASSET
requestRequestId | uint64 ID of a reviewable request
If |
Request | One of multiple values data is used to pass one of |
Ext | ManageAssetOpExtArmEmptyVersion (object) reserved for future use |
code | string Value: "SUCCESS" Specified action in |
success | object (ManageAssetSuccess) Is used to pass useful params after the successful operation application |
Removes asset.
Account | Resource Type | Action | Condition |
---|---|---|---|
source | ASSET |
REMOVE |
source == assetOwner |
source | ASSET |
REMOVE_FOR_OTHER |
source != assetOwner |
Resource Type | Rule Action |
---|---|
ASSET |
REMOVE |
ASSET |
REMOVE_FOR_OTHER |
RemoveAssetOp
changes the state of specified asset to removed
Code | string Defines an asset |
Ext | RemoveAssetOpExtArmEmptyVersion (object) reserved for future use |
code | string Value: "SUCCESS" Operation is successfully applied |
success | object (RemoveAssetSuccess) Result of successful |
Allows to change max issuance of asset
Account | Resource Type | Rule Action | Details |
---|---|---|---|
source | ASSET |
UPDATE_MAX_ISSUANCE |
Only asset owner can update max issuance of asset |
Resource Type | Rule Action |
---|---|
ASSET |
UPDATE_MAX_ISSUANCE |
ManageAssetOp is used to:
CREATE_ASSET
request;UPDATE_ASSET
request;CREATE_ASSET
or UPDATE_ASSET
requestRequestId | uint64 ID of a reviewable request
If |
Request | One of multiple values data is used to pass one of |
Ext | ManageAssetOpExtArmEmptyVersion (object) reserved for future use |