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 | object | A standard ActivationMode object. |
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 | object | Optional. Overwrites the address format from coins file, if set. A standard AddressFormat object. |
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 | object | A standard UtxoMergeParams object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses. |
Parameter | Type | Description |
---|---|---|
current_block | integer | Block height of the coin being activated |
bch_addresses_infos | object | A standard AddressInfo object. Note: the structure may vary based on the value of the get_balances parameter. |
slp_addresses_infos | object | A standard AddressInfo 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
}
]
}
}