Create Internal Transfer
To create an internal transfer, first obtain the msg hash from the initiate endpoint /initiate/. Next, sign msgHash with your L2 key using the signInternalTxMsgHash
function. Finally, provide the signed message along with other required information to the process transfer API /process/.
Note: You will need to include the JWT Auth token to request headers to access this endpoint. To get the JWT Auth Token, refer the login section of this document.
1. Initiate Internal Transfer
Before creating a new Internal Transfer, you will be required to obtain a msg hash by making use of this endpoint. Please note that this is a Private π route which means it needs to be authorized by the account initiating this request.
Endpoint
Request Headers
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
organization_key | string | Yes | Reach out to tanX (tanx.fi) to get the organization key and API key. |
api_key | string | Yes | Reach out to tanX (support@tanx.fi) to get the organization key and API key. |
client_reference_id | string | No | This is an optional field. If not specified, then itβs generated randomly. You can use this to uniquely identify a transfer at your end. |
currency | string | Yes | The currency of the transfer (e.g., USDC). Currently, we support USDC. |
amount | decimal | Yes | The amount of the transfer |
destination_address | string | Yes | The receiver's eth address. |
Response
2. Sign the msg_hash with the L2 key pair
To sign the msg_hash
obtained from the above endpoint, you need to generate the L2 key pair. Use the Nodejs-sdk to generate the L2 key pair from your Ethereum private key.
2.1 Generating a L2 key pair from an ethereum private key
2.2 Use the L2 key pair to sign the msg_hash
obtained from the initiate endpoint.
3. Process Internal Transfer
Process an internal transfer between two users. Before processing the transfer, you will be required to obtain a signature by using the initiate endpoint and the signing utils. Please note that this is a private π route, which means it needs to be authorized by the account initiating this request.
Endpoint
Request Headers
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
organization_key | string | Yes | Reach out to tanX (support@tanx.fi) to get the organization key and API key. |
api_key | string | Yes | Reach out to tanX (support@tanx.fi) to get the organization key and API key. |
signature | JSON object with βrβ and βsβ keys | Yes | The signature of the transfer (obtained from the above sign endpoint) |
nonce | integer | Yes | The nonce of the transfer (obtained from the above signInternalTxMsgHash function) |
msg_hash | string | Yes | The message hash of the transfer (obtained from the above Initiate endpoint) |
Response
Last updated