Deposit
TanX offers various SDKs in different languages to facilitate seamless deposits to its platform. This document outlines the deposit process through the JavaScript (JS) SDK. For additional SDK options, refer to the SDK Reference
Please visit tanX website and create an account using your wallet before proceeding with the below steps.
Deposit Process
1. Install the NPM Package
2. Create an Instance
Deposit Options
Two primary deposit methods are supported:
1. Ethereum Deposit
1.1 Using ETH Private Key and RPC URL
To deposit using an Ethereum private key and RPC URL, follow these steps:
Set up an RPC provider URL pointing to an Ethereum node.
Use the ETH private key corresponding to the sender's Ethereum address.
Specify the network (testnet or mainnet), coin symbol, and amount.
Execute the deposit transaction.
1.2 Using Custom Provider and Signer
Alternatively, you can use a custom provider and signer:
Create a JSON-RPC provider instance.
Generate a signer with the private key and provider.
Execute the deposit transaction.
2. Cross-Chain Deposit
There are two protocols to make a deposit on the Cross-chain: one is EVM (Ethereum-supported chain) and the other is Starknet deposit.
2.1 EVM Cross-Chain Deposit
Supported EVM cross-chain networks - 'POLYGON' | 'OPTIMISM' | 'ARBITRUM' | 'LINEA' | 'SCROLL' | 'MODE'
2.1.1 Using ETH Private Key and RPC URL
To initiate a cross-chain deposit:
Set up an RPC provider URL pointing to an Ethereum node.
Use the ETH private key corresponding to the sender's Ethereum address.
Specify the target network (e.g., 'POLYGON', 'OPTIMISM', etc.), the coin symbol, and the amount to deposit.
Submit the transaction to execute the cross-chain deposit.
2.1.2 Using Custom Provider and Signer
Alternatively, you can use a custom provider and signer:
Create a JSON-RPC provider instance.
Generate a signer with the private key and provider.
Specify the network (testnet or mainnet), coin symbol, and amount.
Execute the deposit transaction.
2.2 Starknet Cross-Chain Deposit
Currently, Starknet deposits are only supported on the tanX mainnet.
2.2.1 Using Starknet Private Key and RPC URL
To initiate a cross-chain deposit:
Set up an RPC provider URL pointing to an Starknet.
Use the Starknet private key corresponding to the sender's starknet address.
Specify the coin symbol, and amount.
Submit the transaction to execute the starknet deposit.
2.2.2 Using Custom Provider and Signer
Alternatively, you can use a custom provider and signer:
Create a JSON-RPC provider instance.
Generate a signer with the private key and provider.
Specify the coin symbol, and amount.
Execute the deposit transaction.
List Deposits
To retrieve the deposit history, you can utilise the following code snippet:
For additional information, please refer to the SDK Reference.
Last updated