Passive Deposit/Withdrawal Service
The Passive Deposit/Withdrawal Service enables seamless asset movement between supported blockchain networks and NEAR Intents. It provides a lightweight mechanism for moving tokens in and out of the protocol. This service only moves funds to/from the treasury on behalf of the user.
There is an SDK for integrating the Passive Deposits/Withdrawals Service: Bridge SDK on GitHub. This SDK is under active development and may introduce breaking changes.
How to use
Get supported assets. The service only works with a specific list of tokens that are available for transfer to NEAR Intents. The list of supported tokens and networks can be obtained using this request.
Get deposit address. Once you have verified that your token is supported by the service, you can use the request to obtain a deposit address. After receiving the address, transfer the tokens to it, and they will soon be available in NEAR Intents.
Get recent deposit. The API service allows you to get the status of the most recent deposits. Simply send a request to retrieve this information.
Get withdrawal status. The service supports token withdrawals from NEAR Intents to the supported network. To do this, call the 'withdrawal' contract method or use the frontend. The status of the withdrawal can be obtained upon request.
JSON-RPC Endpoint
POST: https://bridge.chaindefuser.com/rpc
Requests
1. Get supported assets
Returns a list of tokens that are supported by the service in each network.
Response
[].tokens.defuse_asset_identifier— unique id of trading asset[].tokens.near_token_id— unique id of the token in the NEAR blockchain[].tokens.decimals— trading asset precision. should be used for amount setup during intent creation[].tokens.asset_name— trading asset name[].tokens.min_deposit_amount— minimum amount of tokens to trigger transfer process[].tokens.min_withdrawal_amount— minimum amount of tokens to initiate a withdrawal[].tokens.withdrawal_fee— the fee charged for withdrawing the specified token
2. Get deposit address
Returns the address for depositing supported tokens or native currency.
Parameters
account_id- user account in NEAR Intentschain- network type and chain id. E.g.eth:42161for Arbitrum orbtc:mainnetfor Bitcoin
3. Get recent deposits
Returns information on recent deposits
Response
[].tx_hash- transaction hash [EVM networks only][].chain- network type and chain id[].defuse_asset_identifier- token identifier[].decimals- token decimals[].amount- asset amount[].account_id- user account NEAR Intents[].address- deposit address[].status- deposit status
4. Get withdrawal status
Returns withdrawal status.
Parameters
withdrawal_hash- hash of the transaction on NEAR whereft_burnevent happened on the token contract
Response
status- withdrawal status (COMPLETED,PENDING,FAILED,NOT_FOUND,AWAITING,REJECTED,RETURNING,RETURNED)data.tx_hash- burn transaction hash on NEARdata.transfer_tx_hash- transfer transaction hash on destination chaindata.chain- network type and chain iddata.defuse_asset_identifier- token identifierdata.decimals- token decimalsdata.amount- asset amountdata.account_id- user accountdata.address- withdrawal address
5. Notify about deposit transaction hash
Optional method that notifies service about your deposit.
Parameters
deposit_address- address which you received from service api previously and where you transferred tokenstx_hash- hash of your deposit transaction
6. Estimated withdrawal fees
Convenience method that estimates the fees for transactions.
Parameters
chain- The blockchain network in format {network}:{chainId}token- The token identifier for which to estimate withdrawal feesaddress- Recipient address
Last updated
