After a successful deposit, tokens are assigned to your account in the Verifier contract. You retain full ownership and control, and can withdraw at any time.Documentation Index
Fetch the complete documentation index at: https://docs.near-intents.org/llms.txt
Use this file to discover all available pages before exploring further.
Withdrawal methods
There are two ways to withdraw tokens:- Direct function call on the Verifier contract
- Signed intent submitted via
execute_intents
When using direct function calls, the token ID is used without a prefix (e.g.,
wrap.near).When using signed intents, the token ID is prefixed (e.g., nep141:wrap.near).Withdrawing fungible tokens (NEP-141)
The Verifier contract exposes ft_withdraw for direct withdrawals and FtWithdraw for intent-based withdrawals.Via direct function call
Replace<token-contract> with the token’s contract address and adjust the amount for the token’s decimal precision.
- NEAR CLI
- NEAR API JS
| Parameter | Description |
|---|---|
token | The token contract to withdraw (e.g., wrap.near for wNEAR). No prefix for direct calls. |
receiver_id | The NEAR account that will receive the withdrawn tokens. |
amount | The amount in the token’s smallest unit. Each token has different decimals (e.g., wNEAR has 24, USDC has 6). |
--deposit | 1 yoctoNEAR, required for the withdrawal call. |
--gas | 100 TGas to cover the cross-contract call. |
Via signed intent
Submit a signed FtWithdraw intent throughexecute_intents. Withdraw intents (ft_withdraw, nft_withdraw, mt_withdraw) use unprefixed token IDs (e.g., usdc.near). Token prefixes like nep141: are only used in transfer and token_diff intents.
Real transaction examples
View these withdrawal and intent transactions on NEAR mainnet:Withdrawal functions by token type
| Token Type | Direct Function | Intent |
|---|---|---|
| NEP-141 (Fungible) | ft_withdraw | FtWithdraw |
| NEP-171 (NFT) | nft_withdraw | NftWithdraw |
| NEP-245 (Multi Token) | mt_withdraw | MtWithdraw |
| Native NEAR | N/A | NativeWithdraw |
Withdrawing non-fungible tokens (NEP-171)
To withdraw NFTs from the Verifier contract, use nft_withdraw for direct calls or NftWithdraw for intent-based withdrawals, following the same patterns as fungible token withdrawals above.Refunds on failed withdrawals
A refund restores your balance when a withdrawal fails on the target smart contract. The behavior depends on themsg parameter in your withdrawal request.
How msg affects refunds
The withdraw function has a msg parameter from the NEP-141 standard:
msg Value | Transfer Method | Refund on Failure? |
|---|---|---|
Not specified or null | ft_transfer | ✅ |
Any string value (including "") | ft_transfer_call | ❌ |
This same logic applies to Multi Token and NFT transfers with their corresponding functions:
nft_transfer, nft_transfer_call, mt_transfer, and mt_transfer_call.Why refunds don’t always work
Due to the asynchronous and sharded nature of the NEAR blockchain, refunds can only be processed whenft_transfer is used (i.e., when msg is not specified or is null).
The refund issue occurs when an asynchronous call to another smart contract (e.g., a USDC contract) fails. If an error happens within the Verifier contract itself, your balance won’t change.
Summary
| Withdrawal Request | msg Parameter | Refund Possible? |
|---|---|---|
FtWithdraw intent or ft_withdraw call | No (or null) | ✅ |
FtWithdraw intent or ft_withdraw call | Yes, as string | ❌ |
MtWithdraw intent or mt_withdraw call | No (or null) | ✅ |
MtWithdraw intent or mt_withdraw call | Yes, as string | ❌ |
NftWithdraw intent or nft_withdraw call | No (or null) | ✅ |
NftWithdraw intent or nft_withdraw call | Yes, as string | ❌ |