Sign Generic Transaction
API Documentation: Sign Generic Transaction
Overview
This API endpoint allows you to create a transaction (Native or Token) based on wallet and only need to specify the amount, recipient and token id (for Token).
- HTTP Method: POST
- Endpoint:
/api/v1/wallet/sign/transaction
Request Body Parameters
walletId
(required): this will be used to determine which key used to sign. The type is string.assetType
(required): to determine coin or token transaction. Usecoin
for coin transfer, ortoken
for token transfer.to
(required): the destination address that will receive the coin.amount
(required): in the wei/satoshi/lamport/sun format.tokenId
(required): the id of token. The value can be retrieved from Get Assets Endpointpin
: The PIN is necessary if the wallet has a PIN enabled. The PIN need to be in hashed format (SHA-256).
Example Request Body
// For Coin
{
"walletId" : "dacda36f-76a1-459b-b490-b51c4b621039",
"assetType" : "coin",
"amount": 10000,
"to": "0x90127F8C544e55517CC3Cf7D1f9AF582003665A3"
}
// For Token
{
"walletId" : "dacda36f-76a1-459b-b490-b51c4b621039",
"assetType" : "token",
"tokenId" : "usd-coin",
"amount": 10000,
"to": "0x90127F8C544e55517CC3Cf7D1f9AF582003665A3"
}
Request
Request Headers
X-CLIENT-ID
: (required): Client ID which was generated when register in Xellar TSS API Service Dashboard.X-SIGNATURE
: (required): Calculated signature, please refer to Authorization section.X-TIMESTAMP
: (required): Request timestamp in RFC3339 format.
Example Request Syntax
curl -X POST -H "Content-Type: application/json" -H "x-client-id: $YOUR_CLIENT_ID" -H "x-client-secret: $YOUR_CLIENT_SECRET" -d '{
"walletId": "...",
"assetType" : "coin",
"amount": 10000,
"to": "0x90127F8C544e55517CC3Cf7D1f9AF582003665A3"
}' <BASE_URL>/api/v1/wallet/sign/transaction
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 request information.data.requestId
(string): The unique identifier for the request.
Example Response
{
"status": 200,
"message": "Sign transaction is in progress",
"data": {
"requestId": "9c276eb2-e0e1-4789-bd54-42d5e920379f"
}
}