UPDATE: The Syscoin Core RPCs used in the example below, and other SPT-oriented RPCs, have been deprecated and removed as of Syscoin Core 4.4.
Now syscoinjs-lib and syscointx-js are used to create/manage digital assets, auxfees, and notaries on the UTXO chain.
Examples are available at https://github.com/syscoin/syscoinjs-lib-examples.
For a complete list of these deprecated RPCs, review the Syscoin Core 4.4 release notes.
Syscoin 4.2 introduced changes to the process of using tokens.
Obtain the correct Asset GUID.
An asset has several noteworthy properties. The most important is
asset_guid which is the unique identifier of the token. For example, the asset_guid of the official testnet SYSX token is 1965866356. Anyone can create a token and name it "SYSX" but there will only be one SYSX with
asset_guid of 1965866356. We can inspect the asset information using
assetinfo. We will be using this asset as an example for the rest of the guide.
assetallocationbalance to check an asset balance. This function allows you to see the balance of an asset across your entire wallet by default or for specific addresses.
To check the asset balance of the wallet, use:
To check the asset balance of specific addresses, use:
assetallocationbalance <assetGUID> "[\"<address>\",\"<address>\"]"
The process commonly thought of as "sending" is called asset allocation. A quantity of a token can be allocated to one or more addresses. The Syscoin token platform uses the UTXO model like Bitcoin. This means asset allocations are inputs of an asset sent to an address which can then output them to another address. Most asset owners and exchanges work with asset allocations rather than the asset specification itself.
assetallocationsend to allocate a quantity of a token to a single recipient address. This command will sign and broadcast the transaction to the network and return the transaction ID.
Asset inputs are selected automatically when using
assetallocationsendwith the Syscoin QT wallet. If you want direct control over asset input selection you can use tools such as the syscoinjs-lib SDK or the syscoin-tx binary to build your transaction.
assetallocationsend <assetGUID> <receivingAddress> <assetAmount> <sysAmount> <replaceable (boolean)>
false in order to use Z-DAG.
Allocate an asset to a single address:
assetallocationsendmany to allocate quantities of tokens to multiple addresses all within a single transaction. This command allows you to separately specify the asset and the quantity to be allocated to each individual recipient address, as well as the amount of SYS to send them for gas to be used in the future. This command will sign and broadcast the transaction to the network and return the transaction ID.
*The maximum number of recipients in a single asset transaction is 250.
false in order to use Z-DAG.
Allocate one or more assets to multiple addresses: