RESTful API
1 Account
Get New Wallet
URI: /v1/wallet/new,GET
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request result |
wallet | Object | Wallet |
address | String | Wallet address of BVC-Chain |
secret | String | Private key |
Note: The newly acquired wallet is inactive. Activation method: Use Payment interface to transfer 30 BVC from activated account to the new one.
Example:
{
"wallet": {
"address": "bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz",
"secret": "snAV3*************aTpZ"
},
"success": true
}
Get Account Balance
URI: /v1/accounts/balances/{:address},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Request parameters:
Parameters | Type | Description |
---|---|---|
currency | String | Token name |
counterparty | String | Issuer address |
marker | String | Next page parameter |
limit | String | Shows items per page, returns all when the value is "all" |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
ledger | Integer | Block height |
balances | Array | Balances, array of objects |
value | String | Number |
currency | String | Sign of token |
counterparty | String | Issuer, empty when the Token is BVC |
Example:
GET /v1/accounts/balances/bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR
{
"ledger": 748013,
"account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"ownerCount": 0,
"balances": [
{
"currency": "BVC",
"counterparty": "",
"value": "99249.85"
}
],
"success": true
}
2 Account Settings
Get Account Information
URI: /v1/accounts/settings/{:address},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
settings | Object | Settings |
account | String | Address of BVC-Chain |
default_spread | String | Is able to circulate? The default is false, set to true if is issuer |
Example:
GET /v1/accounts/settings/bNy3Qt1bY8E7wQyHMLfw2HMWZxzqSpVKZ7
{
"settings": {
"account": "bNy3Qt1bY8E7wQyHMLfw2HMWZxzqSpVKZ7",
"flags": 0,
"default_spread": false
},
"success": true
}
Submit Account Setting
URI: /v1/accounts/settings/{:address},POST
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Submit parameters:
Parameters | Type | Description |
---|---|---|
secret | String | Private key |
settings | Object | Settings |
default_spread | String | Is able to circulate? The default is false, set to true if is issuer |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
hash | String | Hash of transaction |
ledger | String | Block height |
state | String | State |
settings | Object | Setting information |
account | String | Address of BVC-Chain |
default_spread | String | Is able to circulate? The default is false, set to true if is issuer |
Example:
POST /v1/accounts/settings/bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz
{
"secret": "snAV3F*************aTpZ",
"settings": {
"default_spread":true
}
}
{
"settings": {
"default_spread": false
},
"hash": "113085DCB6783C8E8C6689F2F4C07CC8DC5BA8461F9E3E99C4984FBB0DE3C115",
"ledger": "748028",
"state": "pending",
"success": true
}
3 Payment
Get Payment History
URI: /v1/accounts/payments/{:address},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Request parameters:
Parameters | Type | Description |
---|---|---|
source_account | String | BVC-Chain address of Payer, optional |
destination_account | String | BVC-Chain address of Payee, optional |
direction | String | Type of transaction,optional value;Incoming: Paid;Outgoing:Pay, optional |
start_ledger | Integer | Starting block height, optional |
end_ledger | Integer | End block height, optional |
per_page | Integer | Page quantity, optional |
page | Integer | Page number, optional |
Result information:
Parameters | Type | Description | |
---|---|---|---|
success | Boolean | Request results | |
payments | Array | Payment history, information in the same transaction record |
Example:
GET /v1/accounts/payments/bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR?per_page=2&page=1
{
"payments": [
{
"hash": "A9CAC1E0432F808DCDF5BEF7CA0207D1325FE05D5401772AF8723FD28F8C1DC6",
"ledger": "741584",
"result": "tesSUCCESS",
"source_account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"destination_account": "bh7p3NAVhBj4KXB16XJijaMrA7juAQpDRW",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
},
"direction": "outgoing",
"timestamp": "2019-04-08T06:39:40.000Z",
"date": 1554705580,
"fee": "0.01"
},
{
"hash": "45C1799C9C6527A64353DA080FA2A5F672E4A89C071BE6F3A972B61F0AB0F7A9",
"ledger": "267938",
"result": "tesSUCCESS",
"source_account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"destination_account": "bUGQrkKenRHe2NBXrACnzCbQ9K36AVQtFm",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
},
"direction": "outgoing",
"timestamp": "2019-02-11T06:36:50.000Z",
"date": 1549867010,
"fee": "0.01"
}
],
"success": true
}
Get Payment Details
URI: /v1/accounts/payments/{:address}/{:hash},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
hash | String | Hash of transaction |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
hash | String | Hash of transaction |
ledger | String | Block height |
state | String | State(validated : completed;pending: transacting) |
source_account | String | Payer’s BVC-Chain address |
destination_account | String | BVC-Chain address of Payee, optional |
direction | String | Type of transaction |
amount | Object | Transaction amount |
timestamp | String | Transaction time(UTC) |
date | Integer | Transaction time(s) |
fee | String | Fee |
memos | Array | Payment memo;Array of objects |
memo_type | String | Memo type(hex) |
memo_data | String | Content of memo(hex) |
Example:
{
"hash": "A9CAC1E0432F808DCDF5BEF7CA0207D1325FE05D5401772AF8723FD28F8C1DC6",
"ledger": "741584",
"state": "validated",
"source_account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"destination_account": "bh7p3NAVhBj4KXB16XJijaMrA7juAQpDRW",
"destination_tag": "",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
},
"currency": "BVC",
"issuer": "",
"direction": "outgoing",
"timestamp": "2019-04-08T06:39:40.000Z",
"date": 1554705580,
"fee": "0.01",
"success": true
}
Submit Payment
URI: /v1/accounts/payments/{:source_address}?submit=true,POST
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Payer’s BVC-Chain address |
Submit parameters:
Parameters | Type | Description |
---|---|---|
secret | String | Payer’s private key of wallet |
payment | Object | Payment object |
source_account | String | Payer’s BVC-Chain address |
destination_account | String | BVC-Chain address of Payee, optional |
destination_tag | String(Integer) | Transfer flag (optional) |
amount | Object | Transaction amount |
value | String | Number |
currency | String | Token name |
issuer | String | Issuer address, empty when currency is BVC |
memos | Array | Payment memo;Array of object;Option |
memo_type | String(English plus number) | Memo type |
memo_data | String | Content of memo |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
hash | String | Hash of transaction |
status_url | String | View address of transaction status |
Example:
POST /v1/accounts/payments/bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz?submit=true
{
"secret": "snAV3*************aTpZ",
"payment": {
"source_account": "bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz",
"destination_account": "bnaPXDrk5yCFB3vvTapXxGrofkZSZHwXqQ",
"amount":{
"value": "5.01",
"currency": "BVC",
"issuer": ""
},
"memos": [
{
"memo_type": "memos",
"memo_data": "memos"
}
]
}
}
{
"hash": "12C323E8DEAF789B790E4837438E5E59E95CA888979B4BE1311CA4BEDAF7C05E",
"status_url": "https://rest.bvcadt.com/v1/accounts/payments/bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz/12C323E8DEAF789B790E4837438E5E59E95CA888979B4BE1311CA4BEDAF7C05E",
"success": true
}
4 Trustline
Get Trustlines
URI: /v1/accounts/trustlines/{:address},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request result |
trustlines | Object | Trustline information |
account | String | Address of BVC-Chain |
currency | String | Token name |
counterparty | String | Counterparty |
limit | String | Limit the maximum number of holds |
reciprocated_limit | String | Limit the maximum number of holds from the couterpart |
Example:
GET /v1/accounts/trustlines/bNy3Qt1bY8E7wQyHMLfw2HMWZxzqSpVKZ7
{
"trustlines": [
{
"counterparty": "b9JGrM26e5hkweEBGPwfVfiyyXzpmmuG33",
"currency": "CADT",
"limit": "100000000",
"account_trustline_frozen": false,
"reciprocated_limit": "0",
"counterparty_trustline_frozen": false,
"account_allows_bvcadting": false,
"counterparty_allows_bvcadting": true
}
],
"success": true
}
Submit Trustline
URI: /v1/accounts/trustlines/{:address},POST
Path parameter
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Submit parameters:
Parameters | Type | Description |
---|---|---|
secret | String | Private key |
trustline | Object | Trustline information |
currency | String | Token name |
counterparty | String | Counterparty |
limit | String | Limit the maximum number of holds (set to 0 to cancel trustline, the precondition is that the balance is 0) |
account_allows_BVCChaining | Boolean | set to false to cancel trustline, the precondition is that the balance is 0 |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
hash | String | Hash of transaction |
ledger | String | Block height |
state | String | Transaction status |
trustline | Object | Trustline information |
currency | String | Token name |
counterparty | String | Counterparty |
limit | String | Limit the maximum number of holds |
Example:
POST /v1/accounts/trustlines/bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz
{
"secret": "snAV3*************aTpZ",
"trustline": {
"limit": "100000000",
"currency": "CADT",
"counterparty": "b9JGrM26e5hkweEBGPwfVfiyyXzpmmuG33"
}
}
{
"trustline": {
"account": "bwHBPQC5soESb75Pj2SdSEuqQBTacqr1yz",
"limit": "100000000",
"currency": "CADT",
"counterparty": "b9JGrM26e5hkweEBGPwfVfiyyXzpmmuG33",
"account_allows_BVCChaining": true,
"account_trustline_frozen": false
},
"hash": "D8E82E7303B5E8F0B1312F7C2BCB9159A265DE8AD9D773081169224EDD28B1F3",
"ledger": "355976",
"state": "pending",
"success": true
}
5 Transaction History
Get Transaction History
URI: /v1/accounts/transactions/{:address},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
address | String | Address of BVC-Chain |
Request parameters:
Parameters | Type | Description |
---|---|---|
type | String | payment,offercreate,offercancel,trustset,Multiple can be provided separated by "," |
start_ledger | Integer | Starting block height, optional |
end_ledger | Integer | End block height, optional |
per_page | Integer | Page quantity, optional |
page | Integer | Page number, optional |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
transactions | Array | Transaction object array |
hash | String | Hash of transaction |
ledger | String | Block height |
state | String | Status |
account | String | Initiate Address |
date | Integer | Transaction time(s) |
time | String | Transaction time(UTC) |
type | String | Type |
fee | String | Fee |
result | String | Result |
price | String | Price(type=offercreate) |
pair | String | Transaction pair(type=offercreate) |
seq | Integer | Order number(type=offercreate) |
destination_tag | Integer | Transaction Flags |
counterparty | String | Address of the other party (type=payment) |
amount | Object | Amount object |
currency | String | Sign of token |
value | String | Number |
counterparty | String | Issuer, empty when the Token is BVC |
effects | Array | Effect |
effect | String | Effect type |
seq | Integer | Order Sequence |
price | String | Price |
pair | String | Transaction pair |
amount | Object | Amount object |
memos | Array | Payment memo;Array of object |
Example:
{
"transactions": [
{
"hash": "A9CAC1E0432F808DCDF5BEF7CA0207D1325FE05D5401772AF8723FD28F8C1DC6",
"account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"state": "validated",
"type": "outgoing",
"date": 1554705580,
"time": "2019-04-08T06:39:40.000Z",
"fee": "0.01",
"ledger": "741584",
"sequence": 15,
"validated": true,
"result": "tesSUCCESS",
"effects": [],
"destination": "bh7p3NAVhBj4KXB16XJijaMrA7juAQpDRW",
"counterparty": "bh7p3NAVhBj4KXB16XJijaMrA7juAQpDRW",
"direction": "outgoing",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
}
},
{
"hash": "45C1799C9C6527A64353DA080FA2A5F672E4A89C071BE6F3A972B61F0AB0F7A9",
"account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"state": "validated",
"type": "outgoing",
"date": 1549867010,
"time": "2019-02-11T06:36:50.000Z",
"fee": "0.01",
"ledger": "267938",
"sequence": 14,
"validated": true,
"result": "tesSUCCESS",
"effects": [],
"destination": "bUGQrkKenRHe2NBXrACnzCbQ9K36AVQtFm",
"counterparty": "bUGQrkKenRHe2NBXrACnzCbQ9K36AVQtFm",
"direction": "outgoing",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
}
}
],
"success": true
}
Get Transaction Details
URI: /v1/transactions/{:hash},GET
Path parameters:
Parameters | Type | Description |
---|---|---|
hash | String | Hash of transaction |
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
transaction | Object | Transaction information |
hash | String | Hash of transaction |
ledger | String | Block height |
state | String | Status |
account | String | Initiate address |
date | Integer | Transaction time(s) |
time | String | Transaction time(UTC) |
type | String | Type |
fee | String | Fee |
result | String | Result |
price | String | Price(type=offercreate) |
pair | String | Transaction pair(type=offercreate) |
seq | Integer | Order Sequence(type=offercreate) |
destination_tag | Integer | Transaction flags |
counterparty | String | Address of the counterparty(type=payment) |
amount | Object | Amount object |
currency | String | Sign of token |
value | String | Number |
counterparty | String | Issuer, empty when the Token is BVC |
effects | Array | Effect |
effect | String | Effect type |
seq | Integer | Order Sequence |
price | String | Price |
pair | String | Transaction pair |
amount | Object | Amount object |
memos | Array | Payment memo |
Example:
GET /v1/transactions/A9CAC1E0432F808DCDF5BEF7CA0207D1325FE05D5401772AF8723FD28F8C1DC6
{
"transaction": {
"hash": "A9CAC1E0432F808DCDF5BEF7CA0207D1325FE05D5401772AF8723FD28F8C1DC6",
"account": "bUeNhKs8Dmsve9m9qKh7JrbBiPhK1ZPGpR",
"state": "validated",
"type": "Payment",
"date": 1554705580,
"time": "2019-04-08T06:39:40.000Z",
"fee": "0.01",
"ledger": "741584",
"sequence": 15,
"validated": true,
"result": "tesSUCCESS",
"effects": [],
"destination": "bh7p3NAVhBj4KXB16XJijaMrA7juAQpDRW",
"amount": {
"currency": "BVC",
"value": "50",
"issuer": ""
}
},
"success": true
}
6 Server Information
Get Default Transaction Fee
URI: /v1/transaction-fee,GET
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
fee | String | Current default transaction fee |
Example:
{
"fee": "0.01",
"success": true
}
Get Server Information
URI: /v1/server,GET
Result information:
Parameters | Type | Description |
---|---|---|
success | Boolean | Request results |
BVCChaind_server_status | Object | Current status of BVC-Chain server |
complete_ledgers | String | Completed block |
server_state | String | Server status |
reserve_base | Double | Least BVC quantity for activation |
reserve_inc | Double | Trust one currency frozen amount of BVC |
Example:
{
"bvcadtd_server_status": {
"complete_ledgers": "1-747919",
"server_state": "proposing",
"reserve_base": 30,
"reserve_inc": 5
},
"success": true
}