enable_bch_with_tokens
The AtomicDEX-API supports Bitcoin Cash SLP tokens. Using this method, you can enable BCH/tBCH along with multiple SLP tokens in a single command.
Parameter | Type | Description |
---|---|---|
ticker | string | Ticker of the platform protocol coin. Options: BCH or tBCH |
bchd_urls | array of strings | A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at https://bchd.fountainhead.cash/. |
mode | string | Utxo RPC mode. Options: { "rpc":"Native" } if running a native blockchain node, or "rpc":"Electrum" to use electrum RPCs. If using electrum, a list of electrum servers is required under rpc_data.servers |
tx_history | boolean | If true , spawns a background loop to store the local cache of address(es) transactions. Defaults to false . |
slp_tokens_requests | array of objects | A list of standard TokensRequest objects. |
address_format.format | string | Optional. Overwrites the address format from coins file, if set. Options: {"format":"standard"} for legacy/standard address format, {"format":"cashaddress"} for cash address format |
address_format.network | string | Optional. Overwrites the address network from coins file, if set. Options: {"network":"bitcoincash"} for mainnet, {"network":"bchreg"} for regtest, or {"network":"bchtest"} for testnet |
allow_slp_unsafe_conf | boolean | Optional, defaults to false . If true , allows bchd_urls to be empty. Warning: it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning. |
get_balances | boolean | Optional, defaults to true . If false , coin and token balances will not be returned in the response, and the response will be returned more quickly. |
required_confirmations | integer | Optional, defaults to value in the coins file, or 3 if not set. Confirmations to wait for steps in swap. |
requires_notarization | boolean | Optional, defaults to true . Has no effect on BCH. |
tx_history | boolean | Optional, defaults to true . If true the AtomicDEX API will preload transaction history as a background process. Must be set to true to use the my_tx_history method |
utxo_merge_params | boolean | Optional. If defined, will spawn a background loop that checks the number of UTXOs every check_every seconds and merges max_merge_at_once utxos into a single utxo if the total exceeds merge_at . Recommended for addresses with high trading activity or mining which can increase the number of UTXOs in the address, leading to delays in RPC response (or in extreme cases, connection timing out). |
Parameter | Type | Description |
---|---|---|
current_block | integer | Block height of the coin being activated |
bch_addresses_infos | object | A standard addressInfos object. Note: the structure may vary based on the value of the get_balances parameter. |
slp_addresses_infos | object | A standard addressInfos object. Note: the structure may vary based on the value of the get_balances parameter. |
POST
enable_bch_with_tokens{
"userpass": "testpsw",
"method": "enable_bch_with_tokens",
"mmrpc": "2.0",
"params": {
"ticker": "BCH",
"allow_slp_unsafe_conf": false,
"bchd_urls": [
"https://bchd.imaginary.cash:8335/"
],
"mode": {
"rpc": "Electrum",
"rpc_data": {
"servers": [
{
"url": "electrum1.cipig.net:10055"
},
{
"url": "electrum3.cipig.net:20055",
"protocol": "SSL"
}
]
}
},
"tx_history": true,
"slp_tokens_requests": [
{
"ticker": "ASLP-SLP",
"required_confirmations": 4
}
],
"required_confirmations": 5,
"requires_notarization": false,
"address_format": {
"format": "cashaddress",
"network": "bitcoincash"
},
"utxo_merge_params": {
"merge_at": 50,
"check_every": 10,
"max_merge_at_once": 25
}
}
}
POST
enable_bch_with_tokens{
"userpass": "testpsw",
"method": "enable_bch_with_tokens",
"mmrpc": "2.0",
"params": {
"ticker": "BCH",
"allow_slp_unsafe_conf": false,
"bchd_urls": [
"https://bchd.imaginary.cash:8335/"
],
"mode": {
"rpc": "Electrum",
"rpc_data": {
"servers": [
{
"url": "electrum1.cipig.net:10055"
},
{
"url": "electrum3.cipig.net:20055",
"protocol": "SSL"
}
]
}
},
"tx_history": true,
"get_balances": false,
"slp_tokens_requests": [
{
"ticker": "ASLP-SLP",
"required_confirmations": 4
}
]
}
}