DotSwap Nexus Integration
English
English
  • Intro
  • Quickstart Guide
  • General
    • API Access
  • Global
    • Get All Tickers
    • Get Exchange Rate
    • Get Token List
    • Data Queries
  • Swap
    • Runes
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • BRC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Pre-Swap Request
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • ARC20
      • Get Swappable Tokens
      • Get Token Exchange Rate
      • Get Unsigned Swap PSBT
      • Send Signed Swap PSBT
    • CAT20
  • Liquidity Management
    • Runes
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • BRC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Pre Liquidity
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
    • ARC20
      • Get Available Tokens
      • Get Token Exchange Rate
      • Get Unsigned Liquidity PSBT
      • Send Signed Liquidity PSBT
  • Remove Liquidity
    • Removing Liquidity
  • CAT20
    • Split
Powered by GitBook
On this page
  1. CAT20

Split

PreviousRemoving Liquidity

Last updated 3 months ago

API Base

Test URL:

Main URL:

You can split the CAT20 assets of a specified address into different addresses through the following interface.

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
    }
  ]

Regarding cat_20_output_to_split, you need to query the corresponding CAT20 UTXO of the corresponding address, find the UTXO you want to split, and then concatenate it with the txId and outputIndex of the corresponding UTXO Query address reference (please replace tokenIdOrTokenAddr and ownerAddrOrPkh)

Split Official CAT20

  • When you first call the deposit endpoint /create_deposit_cat20_psbtv2, you can set the parameter not_split:true.

  • If the deposit is succesful, /create_deposit_cat20_order_by_psbt will return receiver_addr and txid.

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
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/get_split_cat20_psbts' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://localhost:60002' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://localhost:60002/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw '{"tick":"dog:b1071ae617c66050d518587f67564885ca1a618b387a15f84001e3fa244ef3d6_0","is_ofc_token":true,"user_addr":"bc1psx048lgxx9qlgnw2yjn6vw7ndz07f5rdlfxraqpxkr84tqa7670sagd4k8","user_pubkey":"03c22e2f276e66c24e515b24a0c6bcf53852b046b31bbaf98d3f3075c005729691","cat_20_output_to_split":"3c92ae8ce3fd6377ac9316a28ded9ca5daef835dd3cf2613b8047c1ee9bbf530:1","token_addr":"bc1plsm7wgedgkguhk5xyllhyml2zstu0z7zs353hq7h6jlvu5puf4sqhc2l5t","fee_rate":9,"is_average_split":true,"split_num":5}'

// Inherit the parameters of the previous interface
export interface SaveSplitCat20PsbtsBody extends GetSplitCat20PsbtsBody {
  psbts: string[];
}
export interface SaveSplitCat20PsbtsRes {
  tx_id: string;
}
{
  "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
    }
  ],
  "order_id": "",
  "psbts": [
    "cHNidP8BAN8CAAAAAW42i3ZHxnggGQix2qGq0QCVR98cmvoVNLxMbzPUBnJ6AwAAAAD/////BDpmAAAAAAAAIlEg8cMnykWA1Bp0K8OUWUPbHzp+SgQIqOlGQZgTu3uiRNIkcAAAAAAAACJRIPHDJ8pFgNQadCvDlFlD2x86fkoECKjpRkGYE7t7okTS8GQAAAAAAAAiUSDxwyfKRYDUGnQrw5RZQ9sfOn5KBAio6UZBmBO7e6JE0hhIAAAAAAAAIlEgNz59oqlhjCWSvFug6GaqBjCay2GnqDP1EP4NmVaRuqsAAAAAAAEBK9mLAQAAAAAAIlEgNz59oqlhjCWSvFug6GaqBjCay2GnqDP1EP4NmVaRuqsBAwQBAAAAARNBrdAMj8AHGH76p3kp379osjZjhI4myNs6mcVRJOeCJgsMk7yKmZQx/enI5MAEsTm2ljWnT6xdajN2i68FvcyQHwEBFyDTrHRSkgscxGU1Ft1PQ4Gi3wqMCqxuNEbmM6c+pj7ugQAAAAAA",
    "cHNidP8BAKwCAAAAAUV4KF9qW9jpts4tPyGS0dmlR0h8+Qz+8Hu6reMArHenAAAAAAD/////AwAAAAAAAAAAGmoYY2F0AZ+Zmft96aoXbolo7Pw2FV21AHtkSgEAAAAAAAAiUSBS9ewkaBUSiJ92WjMTt0ag6SsB3z9OSEBCNpBqH/Ri/kheAAAAAAAAIlEg8cMnykWA1Bp0K8OUWUPbHzp+SgQIqOlGQZgTu3uiRNIAAAAAAAEBKzpmAAAAAAAAIlEg8cMnykWA1Bp0K8OUWUPbHzp+SgQIqOlGQZgTu3uiRNIBCEIBQLp039gq0GzSfhmnOxTJ/Olq+CahVb1dh9WD/Oj+MS0okK7Q4f530iE/UWf12dnCjmvAMjF+yrOfDT1g8BJePqQAAAAA",
    "cHNidP8BAP3+AAIAAAADH2oQObXCEh9Xt1jGfS0YKZ5PLnbMwac3liTbGfhvgAgCAAAAAP////9mPGfKEUTuGJnqnGPraZWC3jjq7U/TopCXuE6bEH4k/QEAAAAA/////2Y8Z8oRRO4YmeqcY+tplYLeOOrtT9OikJe4TpsQfiT9AgAAAAD/////AwAAAAAAAAAAGmoYY2F0AUbowsVb0zIpCtDz3MIBs38VxRfaSgEAAAAAAAAiUSBDEE+mqJWOtyeQgcd/ztVttJrXEBda+i9ohqCbgG4jmkoBAAAAAAAAIlEgQxBPpqiVjrcnkIHHf87VbbSa1xAXWvovaIagm4BuI5oKAAAAAAEBK0oBAAAAAAAAIlEgQxBPpqiVjrcnkIHHf87VbbSa1xAXWvovaIagm4BuI5pBFDc+faKpYYwlkrxboOhmqgYwmsthp6gz9RD+DZlWkbqrdVjd6OouyBa44MKMc7bVjfoVRav7u7i6ftyGud6ukcVAN5QqjFxFp/kZbV8poAFq+U5GcNS7Ptbm4pjQD9DzLGNE69K8T8OWiEayZlclItjv2HSuHkquaUsqKdVkFPFmCgABAStKAQAAAAAAACJRIFL17CRoFRKIn3ZaMxO3RqDpKwHfP05IQEI2kGof9GL+AAEBK0heAAAAAAAAIlEg8cMnykWA1Bp0K8OUWUPbHzp+SgQIqOlGQZgTu3uiRNIAAAAA"
  ]
}
curl 'https://test-api-proxy.ddpurse.com/brc20swap/save_split_cat20_psbts' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: en' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Origin: http://localhost:60002' \
  -H 'Pragma: no-cache' \
  -H 'Referer: http://localhost:60002/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --data-raw '{"tick":"dog:b1071ae617c66050d518587f67564885ca1a618b387a15f84001e3fa244ef3d6_0","is_ofc_token":true,"user_addr":"bc1psx048lgxx9qlgnw2yjn6vw7ndz07f5rdlfxraqpxkr84tqa7670sagd4k8","user_pubkey":"03c22e2f276e66c24e515b24a0c6bcf53852b046b31bbaf98d3f3075c005729691","cat_20_output_to_split":"3c92ae8ce3fd6377ac9316a28ded9ca5daef835dd3cf2613b8047c1ee9bbf530:1","token_addr":"bc1plsm7wgedgkguhk5xyllhyml2zstu0z7zs353hq7h6jlvu5puf4sqhc2l5t","fee_rate":9,"is_average_split":true,"split_num":5,"order_id":"","psbts":["cHNidP8BAIkCAAAAARJTZeYyavrM5m1L5sK4rahTDlRR7G1Kgao/c+LUK3IJAwAAAAD/////AqFuAAAAAAAAIlEg8cMnykWA1Bp0K8OUWUPbHzp+SgQIqOlGQZgTu3uiRNJj2WECAAAAACJRIIGfU/0GMUH0Tcokp6Y702if5NBt+kw+gCawz1WDvtefAAAAAAABAStxTWICAAAAACJRIIGfU/0GMUH0Tcokp6Y702if5NBt+kw+gCawz1WDvtefAQMEAQAAAAETQcJ21qTEi6F1QoNEClyyVKH5Npik3n8dvgC9hV1/CjNdXZ4mKhuwEP53G6IHYdcSuCVzgOD1ilAa9/OeA5vIjSYBARcgwi4vJ25mwk5RWySgxrz1OFKwRrMbuvmNPzB1wAVylpEAAAA=","cHNidP8BAKwCAAAAAf5gw44vaKscEIOdEQ1JrGCKx4HfkYbuvXa7LnCZ3s24AAAAAAD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ints to split your deposited CAT20 tokens (aka "official CAT20", since they are in DotSwap's liquidity pool.)

Testnet URL
Mainnet URL
https://test-api-proxy.ddpurse.com
https://api-btc.tiertop.io
CAT20 deposit endpoint
  • POSTGet Split CAT20 PSBT
  • Split Users' CAT20
  • Split Official CAT20
  • POSTSend Split CAT20 PSBT

Get Split CAT20 PSBT

post
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
tickstringRequired

tickName + colon + tokenId

is_ofc_tokenbooleanRequired

Whether it's an official token (individuals should default to false, otherwise contact the official for whitelisting)

is_average_splitbooleanRequired

Whether to split evenly to the original address

split_numintegerRequired

Split Amount

user_addrstringRequired

Current User Address

user_pubkeystringRequired

Current User Public Key

cat_20_output_to_splitstringRequired

txid + colon + vout

token_addrstringRequired

Required if selecting an official token

fee_rateintegerRequired
Responses
200
Success
application/json
x-200:Success
Success
application/json
post
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
}

Send Split CAT20 PSBT

post
Header parameters
AuthorizationstringOptional

token

User-IdstringOptional
Body
psbtsstring[]Required
Other parameters are the same as those for get_psbt endpoint.stringRequired
Responses
200
Success
application/json
x-200:Success
Success
application/json
post
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"
  }
}