Embedded Wallets
How to
Wallet Operation
Send Coin

Send Coin

API Documentation: Send Coin

Overview

This API endpoint allows you to send coin (native currency) from a blockchain network

  • HTTP Method: POST
  • Endpoint: /api/<VERSION>/wallet/send-coin

Request Body Parameters

  • to (required): Recipient wallet address.
  • amount (required): Amount to send in ether units or 10^18.
  • 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": "0.015",
    "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": "0.015",
    "network": "ethereum",
    "chainId": "1"
}' <BASE_URL>/api/<VERSION>/wallet/send-coin

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": "Send Coin is processing",
    "data": {
        "txReceipt": {
            "_type": "TransactionReceipt",
            "accessList": null,
            "blockNumber": null,
            "blockHash": null,
            "chainId": "1",
            "data": "0x",
            "from": "0xBfE64B4b628E0998A03e2522B051Cf1B4661c964",
            "gasLimit": "21000",
            "gasPrice": "10000000000",
            "hash": "0x4ec81ca3d6a112bdf991a220ed84a3458f061f1f818273c93546ea91a4e1d675",
            "maxFeePerGas": null,
            "maxPriorityFeePerGas": null,
            "nonce": 0,
            "signature": {
                "_type": "signature",
                "network": "230",
                "r": "0xa68e03c27544801a8b6b80fb78be4f9cc2c9aeeeb189e3ae177a0a1155647dee",
                "s": "0x097e8fd0d6922c0766c14279289d0076fdcff8d29f893ce7b78b82e499341cb7",
                "v": 28
            },
            "to": "0x9B9ef330B204bf33316FAf24E3Ed4FfCf57F02C3",
            "type": 0,
            "value": "15000000000000000"
        }
    }
}