Syscoin Core Developer Portal

Welcome to the Syscoin Core developer portal. You'll find comprehensive guides and documentation to help you start working with Syscoin as quickly as possible, as well as support if you get stuck.

Get Started

Using Syscoin 4.1.2 Tokens

Introduction to Syscoin Assets

There has been some significant changes to Syscoin Assets in Syscoin 4.1.2. Please take a look below.

Before Trading an Asset on Syscoin Platform

  1. Obtain the correct asset GUID.
    An asset has several properties to take note of. The most important one is the GUID of the asset.
    GUID is the unique ID of the asset. For example, the SYSX's official GUID is "1045909988". This is unique. Anyone can create asset named SYSX", but there will only be one "SYSX" with GUID of "1045909988". We can inspect the asset information with "assetinfo". We will be using this asset as an example for the rest of the guide.
$ syscoin-cli assetinfo 1045909988
  "asset_guid": 1045909988,
  "symbol": "SYSX",
  "txid": "bae2d8c36c6b8975fe888516ab9523c33c688dcb2210a759008a5cfcbe9b7e2f",
  "public_value": "{\"description\":\"Official SYSX SPT\"}",
  "address": "sys1qw8k5920xgy746mcs95c6p0tpyqwas27z8af9qe",
  "contract": "0x3a0d746b3ea1d8ccdf19ad915913bd68391133ca",
  "balance": 0.00000000,
  "total_supply": 888000000.00000000,
  "max_supply": 888000000.00000000,
  "update_flags": 31,
  "precision": 8

Querying Syscoin Assets

To see the balance of an asset of an alias or an address, use assetallocationinfo. This function allows you to see the balance of the asset of ANY alias or ANY address. When you send an asset it becomes an asset allocation. As an exchange you will likely be working with asset allocations and not assets themselves. An asset is only update-able by the asset owner while asset allocations are portions of that asset given to an address which can then transfer to another alias.

$ syscoin-cli help assetallocationinfo
assetallocationinfo asset_guid "address"

Show stored values of a single asset allocation.

1. asset_guid    (numeric, required) The guid of the asset
2. address       (string, required) The address of the owner

    "asset_allocation":   (string) The unique key for this allocation
    "asset_guid":         (string) The guid of the asset
    "symbol":             (string) The asset symbol
    "address":            (string) The address of the owner of this allocation
    "balance":            (numeric) The current balance
    "balance_zdag":       (numeric) The zdag balance
    "locked_outpoint":    (string) The locked UTXO if applicable for this allocation

> syscoin-cli assetallocationinfo "assetguid" "address"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "assetallocationinfo", "params": ["assetguid", "address"] }' -H 'content-type: text/plain;'

The following listing functions can be used to query the asset allocation database

listassetallocations ( count from {"asset_guid":n,"addresses":["address",...]} )
listassetindex ( page ) [asset_guid,"address",...]
listassetindexallocations address
listassetindexassets address
listassets ( count from {"txid":"str","asset_guid":n,"addresses":["address",...]} )

Sending Syscoin Assets

Syscoin assets can be allocated to another address. The process is called "asset allocation", but in layman's term, it's just the transfer of an amount of asset from an address to another address.
RPC command "assetallocationsend" can be called to send an amount of an asset. Similar to other Syscoin services, the user will have to signrawtransaction the hex, then syscoinsendrawtransaction to broadcast it to the network.

$ syscoin-cli help assetallocationsend
assetallocationsend asset_guid "address_sender" "address_receiver" amount

Send an asset allocation you own to another address.

1. asset_guid          (numeric, required) The asset guid
2. address_sender      (string, required) The address to send the allocation from
3. address_receiver    (string, required) The address to send the allocation to
4. amount              (numeric or string, required) The quantity of asset to send

  "hex": "hexstring"       (string) the unsigned transaction hexstring.

> syscoin-cli assetallocationsend "assetguid" "addressfrom" "address" "amount"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "assetallocationsend", "params": ["assetguid", "addressfrom", "address", "amount"] }' -H 'content-type: text/plain;'

Updated about a month ago

Using Syscoin 4.1.2 Tokens

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.