Transfer ERC-1155
API Documentation: Transfer ERC-1155
Overview
This API endpoint allows users to transfer ERC-1155 tokens from their wallet to another wallet on the specified blockchain network. Users can perform single or batch transfers of tokens using this endpoint.
- HTTP Method: POST
- Endpoint:
/api/<VERSION>/wallet/transfer-erc1155
Request Body Parameters
to
(required): Recipient wallet address.amount
(required): Token amount of the ERC-1155 token user want to send (input array of amount for batch transfer, input single amount for single transfer).tokenId
(required): Token id of the ERC-1155 token user want to send (input array of tokenId for batch transfer, input single tokenId for single transfer).tokenAddress
(required): Address of the ERC-1155 token user want to send.network
(required if chainId empty): The network used for transactions. You can see Networks Reference to get the network code.chainId
(required if network empty): The chain ID of the network used for transactions.nonce
(optional): The number used once to prevent duplicate transactions (this will be calculated automatically if not provided).gasPrice
(optional): Gas price in Wei (this will be calculated automatically if not provided).gasLimit
(optional): Gas limit for single transaction, transaction will be reverted if actual gas consumption is higher than gas limit (this will be calculated automatically if not provided).maxFeePerGas
(optional): Maximum fee per gas provided (this will be calculated automatically if not provided).maxPriorityFeePerGas
(optional): Maximum priority fee per gas you are willing to pay, this only used in EIP1559 support blockchain
Example Request Body
{
"to": "0xBfE64B4b628E0998A03e2522B051Cf1B4661c964",
"amount": [2, 4],
"tokenId": [2, 5],
"tokenAddress": "0xeAAab07e113eE423FA1C01ac8dFCac2F6099A5C4",
"network": "ethereum",
"chainId": "1"
}
Request
Request Headers
Authorization
(required): JWT token which was generated when user login and do not have an MPC wallet.x-client-secret
(required): Client secret which was generated when register in Xellar Embedded Wallet API Service Dashboard.
Example Request Syntax
curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -H "Authorization: Bearer $YOUR_ACCESS_TOKEN" -d '{
"to": "0xBfE64B4b628E0998A03e2522B051Cf1B4661c964",
"amount": [2,4],
"tokenId": [2,5],
"tokenAddress": "0xeAAab07e113eE423FA1C01ac8dFCac2F6099A5C4",
"network": "ethereum",
"chainId": "1"
}' <BASE_URL>/api/<VERSION>/wallet/transfer-erc1155
Response
The response will include a JSON object with the following properties:
status
(number): The HTTP status code of the response (e.g., 200 for success).message
(string): A message providing additional information about the operation.data
(object): An object containing the transaction receipt data.
Example Response
{
"status": 200,
"message": "Transfer Batch ERC1155 token is processing",
"data": {
"txReceipt": {
"_type": "TransactionReceipt",
"accessList": null,
"blockNumber": null,
"blockHash": null,
"chainId": "97",
"data": "0x2eb2c2d6000000000000000000000000b11858be587cab3d78c6ee6d1a66ed57819eb7130000000000000000000000009e79cdf3aba47f66451f175277b6fd732eb1a4c000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000",
"from": "0xB11858bE587cab3D78c6Ee6D1a66Ed57819Eb713",
"gasLimit": "88719",
"gasPrice": "10000000000",
"hash": "0xd0d370a1dc61b965eb1d74d0e7c5d7f75f6af785240dade8dafb8c73f37b492c",
"maxFeePerGas": null,
"maxPriorityFeePerGas": null,
"nonce": 3,
"signature": {
"_type": "signature",
"networkV": "229",
"r": "0x6275bcd431487444996f2abfc333e6c284a22d7749ac7a4b7ddd8fa916ccdb0a",
"s": "0x26c03c22a7a31da392c1b2114e19193978bb057c6d737515a9dc4f668d12117b",
"v": 27
},
"to": "0xeAAab07e113eE423FA1C01ac8dFCac2F6099A5C4",
"type": 0,
"value": "0"
}
}
}