Create Deposit Addresses

Create deposit addresses on certain wallet. Once addresses are created, the CYBAVO SOFA system will callback when transactions are detected on these addresses.

Request

POST /v1/sofa/wallets/{WALLET_ID}/addresses

Post Body

Field Type Note Description
count int required, max 1000 Specify address count
memos array required (creating BNB, XLM, XRP or EOS wallet) Specify memos for BNB, XLM, XRP or EOS deposit wallet. Refer to Memo Requirement
labels array optional Specify the labels of the generated addresses or memos

Response Body

Field Type Description
addresses array Array of just created deposit addresses
txids array Array of transaction IDs used to deploy collection contract
address_indexes array Array of address index*

Error Code

HTTP Code Error Code Error Message Description
403 - Forbidden. Invalid wallet ID - No wallet ID found
403 - Forbidden. Header not found - Missing X-API-CODE, X-CHECKSUM header or query param t
403 - Forbidden. Invalid timestamp - The timestamp t is not in the valid time range
403 - Forbidden. Invalid checksum - The request is considered a replay request
403 - Forbidden. Invalid API code - X-API-CODE header contains invalid API code
403 - Invalid API code for wallet {WALLET_ID} - The API code mismatched
403 - Forbidden. Checksum unmatch - X-CHECKSUM header contains wrong checksum
403 - Forbidden. Call too frequently ({THROTTLING_COUNT} calls/minute) - Send requests too frequently
403 112 Invalid parameter - The count and the count of memos mismatched
403 385 API Secret not valid - Invalid API code permissions
403 706 Exceed max allow wallet limitation, Upgrade your SKU to get more wallets - Reached the limit of the total number of deposit addresses
400 421 Mapped(Token) wallet not allow to create deposit addresses, please create the deposit wallet in parent wallet, the address will be synced to mapped wallet automatically - Only the parent wallet can create deposit addresses
400 500 insufficient fund - Insufficient balance to deploy collection contract
400 703 Operation failed Error message returned by JSON parser Malformatted post body
400 818 Destination Tag must be integer - Wrong XRP destination tag format
400 945 The max length of BNB memo is 256 chars - Reached the limit of the length of BNB memo
400 946 The max length of EOS memo is 128 chars - Reached the limit of the length of EOS memo
400 947 The max length of XRP destination tag is 20 chars - Reached the limit of the length of XRP destination tag
400 948 The max length of XLM memo is 20 chars - Reached the limit of the length of XLM memo
404 304 Wallet ID invalid - The wallet is not allowed to perform this request

Sample Request

API

/v1/sofa/wallets/107950/addresses

Post Body

For BNB, XLM, XRP or EOS wallet:

{
  "count": 2,
  "memos": [
    "10001",
    "10002"
  ],
  "labels": [
  	"note-for-001",
  	"note-for-002"
  ]
}

For wallet excepts BNB, XLM, XRP and EOS:

{
  "count": 2,
   "labels": [
  	"note-for-address-1",
  	"note-for-address-2"
  ]
}

Response Body

For BNB, XLM, XRP or EOS wallet:

{
  "addresses": [
    "10001",
    "10002"
  ]
}

For wallet excepts BNB, XLM, XRP and EOS:

{
  "addresses": [
    "0x2E7248BBCD61Ad7C33EA183A85B1856bc02C40b6",
    "0x4EB990D527c96c64eC5Bfb0D1e304840052d4975",
    "0x86434604FF857702fbE11cBFf5aC7689Af19c4Ed"
  ]
}

For the ETH wallet that uses contract collection:

{
  "txids": [
    "0xe6dfe0d283690f636df5ea4b9df25552e6b576b88887bfb5837016cdd696e754",
    "0xdb18fd33c9a6809bfc341a1c0b2c092be5a360f394c85367f9cf316579281ab4",
    "0x18075ff1693026f93722f8b2cc0e29bf148ded5bce4dc173c8118951eceabe60",
    "0x7c6acb506ef033c09f781cc5ad6b2d0a216346758d7f955e720d6bc7a52731a5",
    "0x7da19f8c0d82cde16636da3307a6bef46eb9f398af3eb2362d230ce300509d63"
  ]
}

For the delegated wallet:

  "address_indexes": [
    1,
    2,
    3,
    4,
    5
  ],
  "addresses": [
    "0xB02B189b423f58E1c035f02786eA5BC6E7762718",
    "0xace596bfd34E86d15F28b1743B99B26FAFcCC9F5",
    "0x22505d4E113aE8b7A7ACdAECABfD9601E0c41ca8",
    "0x219028837aB831077D2F12EC134cE3C59266EDfd",
    "0x4C2216980B2883234C0C71ef272a195344f206BE"
  ]

Use Query Deployed Contract Deposit Addresses API to query deployed contract addresses.

Sample cURL Command

For BNB, XLM, XRP or EOS wallet:

curl -X POST -H "Content-Type: application/json" -d '{"count":2,"memos":["001","002"]}' \
http://localhost:8889/v1/mock/wallets/{WALLET_ID}/addresses

For wallet excepts BNB, XLM, XRP and EOS:

curl -X POST -H "Content-Type: application/json" -d '{"count":2}' \
http://localhost:8889/v1/mock/wallets/{WALLET_ID}/addresses