Split
API Base
Test URL: https://test-api-proxy.ddpurse.com
Main URL: https://api-btc.tiertop.io
You can split the CAT20 assets of a specified address into different addresses through the following interface.
token
tickName + colon + tokenId
Whether it's an official token (individuals should default to false, otherwise contact the official for whitelisting)
Whether to split evenly to the original address
Split Amount
Current User Address
Current User Public Key
txid + colon + vout
Required if selecting an official token
POST /brc20swap/get_split_cat20_psbts HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 220
{
"tick": "text",
"is_ofc_token": true,
"is_average_split": true,
"split_num": 1,
"toinfos": [
{
"to_addr": "text",
"to_amt": 1
}
],
"user_addr": "text",
"user_pubkey": "text",
"cat_20_output_to_split": "text",
"token_addr": "text",
"fee_rate": 1
}
{
"code": 1,
"msg": "text",
"data": null
}
Split Users' CAT20
{
"tick": "dog:b1071ae617c66050d518587f67564885ca1a618b387a15f84001e3fa244ef3d6_0",
"is_ofc_token": false,
"user_addr": "bc1pxul8mg4fvx....cxej453h24smw03s0",
"user_pubkey": "02d3ac7452920b1cc4....0a8c0aac6e3446e633a73ea63eee81",
"cat_20_output_to_split": "08806ff819db249637a7c1cc762e4f9e29182d7dc658b7571f12c2b539106a1f:2",
"token_addr": "bc1pxul8mg4fvx....cxej453h24smw03s0",
"fee_rate": 9,
"toinfos": [
{
"to_addr": "bc1pxrvq4n9ud.....587lf3xszyyczr",
"to_amt": 5
},
{
"to_addr": "bc1pxrvq4n9ud.....587lf3xszyyczr",
"to_amt": 5
},
{
"to_addr": "bc1pxrvq4n9ud.....587lf3xszyyczr",
"to_amt": 5
},
{
"to_addr": "bc1pxrvq4n9ud.....587lf3xszyyczr",
"to_amt": 5
},
{
"to_addr": "bc1pxrvq4n9ud.....587lf3xszyyczr",
"to_amt": 5
}
]
Split Official CAT20
If you're using DotSwap's CAT20 deposit endpoint, you can use these 2 endpoints to split your deposited CAT20 tokens (aka "official CAT20", since they are in DotSwap's liquidity pool.)
When you first call the deposit endpoint
/create_deposit_cat20_psbtv2
, you can set the parameternot_split:true
.If the deposit is succesful,
/create_deposit_cat20_order_by_psbt
will returnreceiver_addr
andtxid
.

Then, you can use the following parameters to call the split endpoint POST
/brc20swap/get_split_cat20_psbts
.
{
// These two parameters should be set to true by default
"is_ofc_token": true,
"is_average_split": true,
// This is the wallet you used for the deposit
"user_addr": "bc1psx048lgxx9qlgnw2yjn6vw7ndz07f5rdlfxraqpxkr84tqa7670sagd4k8",
"user_pubkey": "03c22e2f276e66c24e515b24a0c6bcf53852b046b31bbaf98d3f3075c005729691",
// The token to be split (keep the same as the token name you deposited)
"tick": "dog:b1071ae617c66050d518587f67564885ca1a618b387a15f84001e3fa244ef3d6_0",
// This is the txid + :1 returned by the deposit interface (:1 is fixed)
"cat_20_output_to_split": "3c92ae8ce3fd6377ac9316a28ded9ca5daef835dd3cf2613b8047c1ee9bbf530:1",
// This is the receiver_addr returned by the deposit interface
"token_addr": "bc1plsm7wgedgkguhk5xyllhyml2zstu0z7zs353hq7h6jlvu5puf4sqhc2l5t",
// The number should be greater than 4
"split_num": 5,
"fee_rate": 9
}
token
POST /brc20swap/save_split_cat20_psbts HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"psbts": [
"text"
],
"Other parameters are the same as those for get_psbt endpoint.": "text"
}
{
"code": 1,
"msg": "text",
"data": {
"tx_id": "text"
}
}
// Inherit the parameters of the previous interface
export interface SaveSplitCat20PsbtsBody extends GetSplitCat20PsbtsBody {
psbts: string[];
}
Last updated
Was this helpful?