API | Overview |
---|---|
v2/tokens | Get access token |
vip180/v1/uid/mintToken | Mint token to account |
vip180/v1/address/mintToken | Mint token to address |
vip180/v1/setMintable | Toggle mintable status |
user/v5/batchCreateUser | Create account in batches |
vip180/v1/uid/approve | Authorize token transfer by account in batches |
vip180/v1/address/approve | Authorize token transfer by address in batches |
vip180/v1/uid/transfer | Transfer token to account |
vip180/v1/address/transfer | Transfer token to address |
vip180/v1/uid/uid/transferFrom | Authorized transfer: from account to account |
vip180/v1/uid/address/transferFrom | Authorized transfer: from account to address |
vip180/v1/address/uid/transferFrom | Authorized transfer: from address to account |
vip180/v1/address/address/transferFrom | Authorized transfer: from address to address |
vip180/v1/query/uid/uid/allowance | Query authorized transferable quota of account A to account B |
vip180/v1/query/uid/address/allowance | Query authorized transferable quota of account A to address B |
vip180/v1/query/address/uid/allowance | Query authorized transferable quota of address A to account B |
vip180/v1/query/address/address/allowance | Query authorized transferable quota of address A to address B |
vip180/v1/query/uid/balanceOf | Query the token balance of the specified account |
vip180/v1/query/address/balanceOf | Query the token balance of the specified address |
vip180/v1/query/decimals | Query the decimal precision of token |
vip180/v1/query/mintable | Query the mintable status of token |
vip180/v1/query/name | Query token name |
vip180/v1/query/symbol | Query token symbol |
vip180/v1/query/totalSupply | Query total supply of token |
Request URL
- China(Ali):https://developer.vetoolchain.cn/api/
-
Out of China(AWS): https://developer.vetoolchain.com/api/
Request Header
Header | Description | Example |
---|---|---|
content-type | indicates the media type of the resource | application/json;charset=utf-8 |
x-api-token | contains the JWT token to authenticate a user | eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9... |
Result Code
Code | Message |
---|---|
1 | success |
-1 | ERR_SERVER_ERROR |
1000 | ERR_VIP180_INVALID_PARAMETER |
1003 | ERR_PARAM_{0}_IS_INVALID |
1100 | ERR_GET_DEVELOPER_INFO_FAILED |
1101 | ERR_GENERATE_TOKEN_FAILED |
1102 | ERR_VERIFY_SIGNATURE_FAILED |
2100 | ERR_DEVELOPER_INFO_IS_NOT_FOUND |
2119 | ERR_DEVELOPER_TOKEN_IS_EXPIRED |
2120 | ERR_DEVELOPER_PROJECT_IS_NOT_ENABLED |
2121 | ERR_DEVELOPER_TOKEN_IS_NOT_WITHIN_TIME_FRAME |
3019 | ERR_TCC_INSUFFICIENT |
160001 | ERR_VIP180_INVALID_ADDRESS |
160002 | ERR_VIP180_NO_PERMISSION |
160006 | ERR_VIP180_DELEGATE_HAS_NO_PERMISSION |
160007 | ERR_VIP180_OWNER_UID_NOT_EXIST |
160009 | ERR_VIP180_OPERATOR_UID_NOT_EXIST |
160010 | ERR_VIP180_DELEGATE_UID_NOT_EXIST |
160015 | ERR_VIP180_NOT_OPERATOR_UID |
160016 | ERR_VIP180_INVALID_APP_ID |
160017 | ERR_VIP180_UNKNOWN_UID |
160018 | ERR_VIP180_UNKNOWN_CONTRACT_ADDRESS |
160019 | ERR_VIP180_UN_\SUPPORT_API_FOR_THIS_APP_ID |
160020 | ERR_VIP180_NOT_OWNER_UID |
Terms
Status
When you send the request, the requestNo is the request number, orderStatus is the request status. Inside one request, there may be several sub-requests. For example: mint NFT to UID, you can have many [vid, toUID] pairs inside one request, each will have a transaction on blockchain. Here the orderStatus means the whole request status, if any of transactions is FAILED, it will fail. And the transaction status is txStatus, you can check the txStatus for each transaction if orderStatus fails.
Name | Type | Description |
---|---|---|
orderStatus | string | PROCESSING, SUCCESS, FAILED |
txStatus | string | SUCCESS, FAILED |
Account
When the client calls to create account, the escrow account created in ToolChain consists of two parts: UID and wallet address. The address is derived from UID, and they are same.
Name | Type | Description |
---|---|---|
UID | string | account, 32bytes, hex string |
Address | string | address, 20bytes, hex string |
Idempotent
ToolChain's idempotent processing of write requests requires the requester to provide the request number (requestNo) to achieve. The same request number will only be executed once in ToolChain, and repeated requests will be regarded as query operations.
-
Get access token
POST v2/tokens
Get token, for the method of obtaining appid and appkey, please refer to here
Java Sample:
signString :appid=15cf8af3ebeca443d377bd5c2658cae9
&appkey=15cf8af3ebeca443d377bd5c2658cae98a1030dd513184568e89fbbd776bc2cb
&nonce =3806143519628774
×tamp=1552185608
signature : sha256( signString )
public static String sha256( String text )
{
try {
MessageDigest message = MessageDigest.getInstance( "SHA-256" );
byte[] hash = message.digest( text.getBytes( "UTF-8" ) );
return(Hex.encodeHexString( hash ) );
} catch ( Exception e ) {
e.printStackTrace();
}
return(null);
}
public static String signature( TokenRequest request )
{
StringBuffer sign = new StringBuffer();
sign.append( String.format( "appid=%s&", request.getAppid() ) );
sign.append( String.format( "appkey=%s&", appkey ) );
sign.append( String.format( "nonce=%s&", request.getNonce() ) );
sign.append( String.format( "timestamp=%s", request.getTimestamp() ) );
return(sha256( sign.toString().toLowerCase() ) );
}
public static void testGetToken()
{
TokenRequest request = new TokenRequest();
request.setAppid( appid );
request.setNonce( RandomUtils.nextHexString( 8 ) );
request.setTimestamp( String.valueOf( (System.currentTimeMillis() / 1000) ) );
request.setSignature( signature( request ) );
System.out.println( JSONObject.toJSONString( request ) );
}
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
appid | string | Y | appid |
nonce | string | Y | random number (length is 16) |
signature | string | Y | sha256 signature |
timestamp | string | Y | current timestamp, within 5 minutes (UTC time) |
source | string | N | application request source. For the same request source, the valid request is the latest request |
Request Example
{
"appid": "15cf8af3ebeca443d377bd5c2658cae9",
"nonce": "3806143519628774",
"signature": "1c442f56664317d81c32e41010660f54ba1e71223fa6d766ebbe45de3906998b",
"timestamp": "1552185608"
}
Response Example
{
"code": "common.success",
"data": {
"timeToLive": 86400,
"expireTime": 1593257539,
"expire": 86400,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpbklkIjoiNGNhY2IyNzk3NDVjIiwiYXBwSWQiOiJhODJiN2I5MGNmMDE0ZDFhMDk5YzEzOTdmMzA5NzZiYyIsInNvdXJjZSI6ImFhYSIsImV4cCI6MTU5MzI1NzUzOSwiaWF0IjoxNTkzMTcxMTM5fQ.YhXSdmicmbjajIiZqyIPpUPWn1lFrsO6G8-JWK_yXmY"
}
}
Response Parameters
Name | Type | Description |
---|---|---|
token | string | returned token |
expire | integer | token effective time (24 hours), unit: second |
timeTolive | integer | token remaining effective time, unit: second |
expireTime | integer | expiry timestamp |
After getting the token, you can start sending **HTTP GET/POST** requests to call the blockchain service. Each time it is called, please make sure that the value of the x-api-token of the HTTP request is valid.
-
Mint token to account(administrator only)
POST vip180/v1/uid/mintToken
Mint token to account. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
+ list | request list | Y | array |
└ amount | issuance quota, start with '0x', hex string | Y | string |
└ toUID | UID of the target account, start with '0x', 32 bytes | Y | string |
ownerUID | UID of the administrator account, start with '0x', 32 bytes, please refer to here | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"list": [
{
"amount": "0x5",
"toUID": "0x2eaafa13c34298e20c59bbc9b94c78e47b65dc601ac0b9f01efd92d864b62136"
},
{
"amount": "0x25",
"toUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616"
}
],
"ownerUID": "0x56a58db2b21b61a24db53eb902b50d54527f4a19ee7ce4d49f3a6346317852d9",
"requestNo": "20200729-003"
}
Response Sample
{
"data": {
"requestNo": "20200729-003",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x5",
"clauseIndex": 0,
"txID": "0x4d6eac6ea422f89003a0f6713ac47ddfff41e90abcd1153c99277a933dfbc692",
"txStatus": "SUCCESS"
},
{
"amount": "0x25",
"clauseIndex": 1,
"txID": "0x4d6eac6ea422f89003a0f6713ac47ddfff41e90abcd1153c99277a933dfbc692",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | issuance quota, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Mint token to address(administrator only)
POST vip180/v1/address/mintToken
Mint token to address. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
+ list | request list | Y | array |
└ amount | issuance quota, start with '0x', 32 bytes | Y | string |
└ toAddress | target address, start with '0x', 20 bytes | Y | string |
ownerUID | UID of the administrator account, start with '0x', 32 bytes, please refer to here | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"list": [
{
"amount": "0x5",
"toAddress": "0xe5263ca22d6c15353f56eac41ea2dbfb79091f68"
},
{
"amount": "0x25",
"toAddress": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c"
}
],
"ownerUID": "0x56a58db2b21b61a24db53eb902b50d54527f4a19ee7ce4d49f3a6346317852d9",
"requestNo": "20200729-004"
}
Response Sample
{
"data": {
"requestNo": "20200729-004",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x5",
"clauseIndex": 0,
"txID": "0x74dec8cdd53124902a622b30315e7d42815d28c13bafa7dc197e89eed0d71ab9",
"txStatus": "SUCCESS"
},
{
"amount": "0x25",
"clauseIndex": 1,
"txID": "0x74dec8cdd53124902a622b30315e7d42815d28c13bafa7dc197e89eed0d71ab9",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | issuance quota, start with '0x',32 bytes | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Toggle mintable status
POST vip180/v1/setMintable
Set mintable status. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
mintable | if mintable | Y | boolean |
ownerUID | UID of the administrator account, start with '0x', 32 bytes, please refer to here | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"mintable": true,
"requestNo": "202000729-005",
"ownerUID": "0x56a58db2b21b61a24db53eb902b50d54527f4a19ee7ce4d49f3a6346317852d9"
}
Response Sample
{
"data": {
"requestNo": "202000729-005",
"orderStatus": "SUCCESS",
"clauseIndex": 0,
"txID": "0x07ba20d633a9fb115aee1de431390a9597c5249d87d8ea51f77b93cc24fef20f"
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
txID | blockchain transaction ID | string |
txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
-
Create account
POST user/v5/batchCreateUser
create account. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
requestNo | string | Y | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent |
quantity | integer | Y | quantity. It is recommended to create no more than 5 in a single request. |
Request Example
{
"quantity": 5,
"requestNo": "20210701-001"
}
Response Example
{
"data": {
"requestNo": "20210701-001",
"orderStatus": "SUCCESS",
"users": [
{
"address": "0xc6914fa7e1409e0d2e85933331f9f0394163de52",
"uid": "0x57795956418a28ba9a72181fe323fb509f9c6959362ff2e3a13ee0128218e6d6"
},
{
"address": "0xb4ae46837fdd6a41c9fbd2e3d6d1fe4007023b66",
"uid": "0xd5a3e4dce2d7d8438104157ca3b53a1b1a2bd4b44e9bce45bb1d15bdfa7703d5"
},
{
"address": "0xf55ca42b56746f93fc2792484bf9648ce0d2b5ee",
"uid": "0xe78e2e860ef455958517a359dd19e3f4093f41bba7653919bed8c91ceeddf777"
},
{
"address": "0xd4cd05fcceb154ddce38aa28ce5158bd34740ee6",
"uid": "0x56f386ef92baec301bfdf2ccfb5e143725116585f95d55b80eab8d40a94ed25b"
},
{
"address": "0x8c80140ad3b83926af555830a63309b98c25cd47",
"uid": "0x2203b26196f5f41789a9285d50c5838de439ef7e93063465bfc9bbf19554b163"
}
]
},
"code": 1,
"message": "success",
"codeString": "success"
}
Response Parameters
Name | Type | Description |
---|---|---|
requestNo | string | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent |
orderStatus | string | request status(PROCESSING, SUCCESS, FAILED) |
+ users | array | account list |
└ uid | string | UID of account, start with '0x', 32 bytes |
└ address | string | address of UID, start with '0x', 20 bytes |
-
Authorize token transfer by account in batches
POST vip180/v1/uid/approve
Authorize token transfer by account in batches. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
fromUID | UID of current owner, start with '0x', 32 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
+ list | request list | Y | array |
└ amount | authorized quota, start with '0x', hex string | Y | string |
└ delegateUID | the UID of authorized account, start with '0x', 32 bytes | Y | string |
Request Example
{
"fromUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"list": [
{
"amount": "0xC",
"delegateUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b"
}
],
"requestNo": "202000729-010"
}
Response Sample
{
"data": {
"requestNo": "202000729-010",
"list": [
{
"amount": "0xC",
"clauseIndex": 0,
"txID": "0x21e8e5a9bce005ddc6bf65f83fef5715735509f8d44c6c75cab2139e5c46c193",
"txStatus": "SUCCESS"
}
],
"orderStatus": "SUCCESS"
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
+ list | return list, the order is the same as request list | array |
└ amount | authorized quota, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
-
Authorize token transfer by address in batches
POST vip180/v1/address/approve
Authorize token transfer by address in batches. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
fromUID | UID of current owner, start with '0x', 32 bytes | Y | string |
+ list | request list | Y | array |
└ amount | authorized quota, start with '0x', hex string | Y | string |
└ delegateAddress | the address of authorized account, start with '0x', 20 bytes | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | Y | string |
Request Example
{
"fromUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"list": [
{
"amount": "0xB",
"delegateAddress": "0xf3d246834905fed79a0d16844591468205daaad4"
}
],
"requestNo": "202000729-011"
}
Response Sample
{
"data": {
"requestNo": "202000729-011",
"list": [
{
"amount": "0xB",
"clauseIndex": 0,
"txID": "0x1c6deff6d32c1469ebc593fd0b4c6df6401273e3e82d0c123982069407c300c7",
"txStatus": "SUCCESS"
}
],
"orderStatus": "SUCCESS"
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
+ list | return list, the order is the same as request list | array |
└ amount | authorized quota, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
-
Transfer token to account
POST vip180/v1/uid/transfer
Transfer token to account. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
fromUID | UID of current owner account, start with '0x', 32 bytes | Y | string |
+ list | request list | Y | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ toUID | UID of target account, start with '0x', 32 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"fromUID": "0x2eaafa13c34298e20c59bbc9b94c78e47b65dc601ac0b9f01efd92d864b62136",
"list": [
{
"amount": "0x3",
"toUID": "0xbecfc91cfadfac2b4607b958af54cf06428eb6ff705f7574c8c50626cdbb9727"
}
],
"requestNo": "202000729-008"
}
Response Sample
{
"data": {
"requestNo": "202000729-008",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x3",
"clauseIndex": 0,
"txID": "0x9cff7718abd85c4e8293330b13196f63ef326295bbb2d54cf5068eba0d158803",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
-
Transfer token to address
POST vip180/v1/address/transfer
Transfer token to address. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
fromUID | UID of current owner account, start with '0x',32 bytes | Y | string |
+ list | request list | Y | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ toAddress | target address, start with '0x',20 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"fromUID": "0x10186b207e58a6f38e28f4ac88547de6a8e3c467df608c7ffa28697cce79b203",
"list": [
{
"amount": "0x3",
"toAddress": "0xbfcb252203c7cc1a3280c336a5c10510f408fb18"
}
],
"requestNo": "20200331-011"
}
Response Sample
{
"data": {
"requestNo": "20200331-011",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x3",
"clauseIndex": 0,
"txID": "0x7b623e05c2f077e10d9eab9258093fccb8a45c718f185bd6a39d68e1f18429dd",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Authorized transfer: from account to account
POST vip180/v1/uid/uid/transferFrom
Authorized transfer: from account to account. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
delegateUID | UID of authorized account, start with '0x', 32 bytes | Y | string |
+ list | request list | Y | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ fromUID | UID of current owner account, start with '0x', 32 bytes | Y | string |
└ toUID | UID of target account, start with '0x', 32 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"delegateUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b",
"list": [
{
"amount": "0x2",
"fromUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"toUID": "0xf520dfabb12820fc2bb681f1c33f459cce79e4cce3f281044f23dd578ee20f70"
}
],
"requestNo": "202000729-012"
}
Response Sample
{
"data": {
"requestNo": "202000729-012",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x2",
"clauseIndex": 0,
"txID": "0x7c753cc740bac9cc7ab2382790fbdc130e449468d5bebee743c587966ad52eab",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Authorized transfer: from account to address
POST vip180/v1/uid/address/transferFrom
Authorized transfer: from account to address. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
delegateUID | UID of authorized account, start with '0x', 32 bytes | N | string |
+ list | transfer list | N | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ fromUID | UID of current owner account, start with '0x', 32 bytes | Y | string |
└ toAddress | target address, start with '0x' ,20 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"delegateUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b",
"list": [
{
"amount": "0x2",
"fromUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"toAddress": "0xaaaeaa88d60399514a72803d3732fb1caf7a6dee"
}
],
"requestNo": "20200729-013"
}
Response Sample
{
"data": {
"requestNo": "20200729-013",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x2",
"clauseIndex": 0,
"txID": "0x15a4cf6d9a82de6e7a21b705ec387d195cd436f29b09b466dfd08dde0566888b",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Authorized transfer: from address to account
POST vip180/v1/address/uid/transferFrom
Authorized transfer: from address to account. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
delegateUID | UID of authorized account, start with '0x', 32 bytes | Y | string |
+ list | request list | Y | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ fromAddress | address of current owner account, start with '0x', 20 bytes | Y | string |
└ toUID | UID of target account, start with '0x', 32 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"delegateUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b",
"list": [
{
"amount": "0x1",
"fromAddress": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c",
"toUID": "0xf520dfabb12820fc2bb681f1c33f459cce79e4cce3f281044f23dd578ee20f70"
}
],
"requestNo": "20200729-014"
}
Response Sample
{
"data": {
"requestNo": "20200729-014",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x1",
"clauseIndex": 0,
"txID": "0xbb73aed16dcb8d7f39dfeaad8688247f828c591e1408a203ffd289204bfb548c",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Authorized transfer: from address to address
POST vip180/v1/address/address/transferFrom
Authorized transfer: from address to address. Please repeat the request until the orderStatus becomes the final status.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
delegateUID | UID of authorized account, start with '0x', 32 bytes | N | string |
+ list | transfer list | N | array |
└ amount | transferred amount, start with '0x', hex string | Y | string |
└ fromAddress | address of current owner, start with '0x', 20 bytes | Y | string |
└ toAddress | target address,start with '0x',20 bytes | Y | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"delegateUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b",
"list": [
{
"amount": "0x1",
"fromAddress": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c",
"toAddress": "0xaaaeaa88d60399514a72803d3732fb1caf7a6dee"
}
],
"requestNo": "20200729-015"
}
Response Sample
{
"data": {
"requestNo": "20200729-015",
"orderStatus": "SUCCESS",
"list": [
{
"amount": "0x1",
"clauseIndex": 0,
"txID": "0x13763f10d762ce9d9b0afd618cc86d8696513fc3cca9d86f5b88cfc1e267bb2d",
"txStatus": "SUCCESS"
}
]
},
"code": 1,
"message": "SUCCESS"
}
Response Parameters
Name | Description | Type |
---|---|---|
+ list | return list, the order is the same as request list | array |
└ amount | transferred amount, start with '0x', hex string | string |
└ clauseIndex | clause index of the blockchain transaction. For clauses, please refer to blockchain Multi-Task Transaction (MTT) | integer(int32) |
└ txID | blockchain transaction ID | string |
└ txStatus | blockchain transaction status(SUCCESS, FAIL) | string |
orderStatus | request status(PROCESSING, SUCCESS, FAIL) | string |
requestNo | the maximum length is 50, which is generated by the requester to ensure that the request is idempotent | string |
-
Query authorized transferable quota of account A to account B
POST vip180/v1/query/uid/uid/allowance
Query authorized transferable quota of account A to account B.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenOwnerUID | UID of current owner account,start with '0x', 32 bytes | Y | string |
spenderUID | UID of authorized account,start with '0x', 32 bytes | Y | string |
Request Example
{
"tokenOwnerUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"spenderUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b"
}
Response Sample
{
"data": {
"allowed": "0x3"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
allowed | authorized issuance quota, start with '0x', 32 bytes | string |
-
Query authorized transferable quota of account A to address B
POST vip180/v1/query/uid/address/allowance
Query authorized transferable quota of account A to address B.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenOwnerUID | UID of current owner account,start with '0x', 32 bytes | Y | string |
spenderAddress | address of authorized account,start with '0x', 20 bytes | Y | string |
Request Example
{
"tokenOwnerUID": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616",
"spenderAddress": "0xf3d246834905fed79a0d16844591468205daaad4"
}
Response Sample
{
"data": {
"allowed": "0x3"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
allowed | authorized issuance quota, start with '0x',32 bytes | string |
-
Query authorized transferable quota of address A to account B
POST vip180/v1/query/address/uid/allowance
Query authorized transferable quota of address A to account B.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenOwnerAddress | address of current owner account,start with '0x', 20 bytes | Y | string |
spenderUID | UID of authorized account,start with '0x', 32 bytes | Y | string |
Request Example
{
"tokenOwnerAddress": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c",
"spenderUID": "0xe4f02f331a152f17608b21321437c0180058eee819d4a1816cdde9d322b53e9b"
}
Response Sample
{
"data": {
"allowed": "0x3"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
allowed | authorized transferable quota, start with '0x', hex string | string |
-
Query authorized transferable quota of address A to address B
POST vip180/v1/query/address/address/allowance
Query authorized transferable quota of address A to address B.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenOwnerAddress | address of current owner account,start with '0x', 20 bytes | Y | string |
spenderAddress | address of authorized account,start with '0x', 20 bytes | Y | string |
Request Example
{
"tokenOwnerAddress": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c",
"spenderAddress": "0xf3d246834905fed79a0d16844591468205daaad4"
}
Response Sample
{
"data": {
"allowed": "0x3"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
allowed | authorized transferable quota, start with '0x', hex string | string |
-
Query the token balance of the specified account
POST vip180/v1/query/uid/balanceOf
Query the token balance of the specified account.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
uid | queried UID of account,start with '0x', 32 bytes | Y | string |
Request Example
{
"uid": "0x9765bfe63b54d7b62291b6c0085fe7a74fd790c158ea2a160c955294475b5616"
}
Response Sample
{
"data": {
"balance": "0x42"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
balance | balance, start with '0x',hex string | string |
-
Query the token balance of the specified address
POST vip180/v1/query/address/balanceOf
Query the token balance of the specified address.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
address | queried address of account,start with '0x', 20 bytes | Y | string |
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
"address": "0x9e5622f2a8631b5e528e3593d58c57d4a4e5257c"
}
Response Sample
{
"data": {
"balance": "0x42"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
balance | balance, start with '0x', hex string | string |
-
Query the decimal precision of token
POST vip180/v1/query/decimals
Query the number of bits used by token. For example, 6, it means that the number of assets is divided by 1000000 to get its user representation.
Request Parameters
Name | Description | Required | Type |
---|---|---|---|
tokenContractAddress | address of the smart contract can be omitted if there is only one FT token. | N | string |
Request Example
{
}
Response Sample
{
"data": {
"decimals": "0x12"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
decimals | number of bits, start with '0x', hex string | string |
-
Query the mintable status of token
POST vip180/v1/query/mintable
query the mintable status of token.
Request Parameters
Name | Description | Required | Type |
---|
Request Example
{
}
Response Sample
{
"data": {
"mintable": true
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
mintable | mint status | boolean |
-
Query token name
POST vip180/v1/query/name
Query token name.
Request Parameters
Name | Description | Required | Type |
---|
Request Example
{
}
Response Sample
{
"data": {
"name": "toolchainvip180test"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
name | token name | string |
-
Query token symbol
POST vip180/v1/query/symbol
Query token symbol.
Request Parameters
Name | Description | Required | Type |
---|
Request Example
{
}
Response Sample
{
"data": {
"symbol": "vet"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
symbol | token symbol | string |
-
Query total supply of token
POST vip180/v1/query/totalSupply
Query total supply of token.
Request Parameters
Name | Description | Required | Type |
---|
Request Example
{
}
Response Sample
{
"data": {
"totalSupply": "0x9184F72A480"
},
"code": 1,
"message": "success"
}
Response Parameters
Name | Description | Type |
---|---|---|
totalSupply | total issuance quota, starting from '0x', hex string | string |
Appendix
Q: How to get the appid and appkey of the project
A: Log in to the system with an administrator account, click Developer Center -> Server Application, and copy APPID and APPIKEY. Each account can support up to 10 pairs of appid and appkey
Q: How to get the UID of the administrator account
A: Log in to the system with an administrator account, click Console -> Business Contract , Owner UID is what you want to get.
Comments
0 comments
Please sign in to leave a comment.