React Environment Properties
Developers can implement various environmental settings that determine how the withdrawal process functions.
🧩 Props Reference
| Property | Required | Description |
|---|---|---|
wallet | ✅ | Solana wallet adapter instance |
blockchain | ✅ | Blockchain type – set to "solana" |
merchantId | ✅ | Merchant identifier (source of funds). Contact Approvely to obtain yours. |
connection | ✅ | Solana connection object |
env | ❌ | Environment ("prod" by default, use "staging" or "sandbox" for testing) |
onSuccess | ❌ | Callback function that fires when the withdrawal is successful |
lockAmount | ❌ | Set to true to disable user input of withdrawal amount |
amount | ❌/✅ | Required only if lockAmount=true – fixed amount to withdraw |
tokens | ❌ | Array of tokens to show in the UI (filters selectable token options) |
lockDefaultToken | ❌ | Set to true to lock the default token selection (e.g., force USDC only) |
email | ❌ | Pre-fill the user's email in the UI |
bankAccountLinkRedirect | ❌ | Custom redirect URL for bank account linking |
supportsVersionedTransactions | ❌ | Enable support for versioned Solana transactions |
additionalWallets | ❌ | Add additional wallets tied to the user (see below) |
⚙️ Usage Example
import { useWallet } from '@solana/wallet-adapter-react';
import { useConnection } from '@solana/wallet-adapter-react';
const wallet = useWallet();
const connection = useConnection();
<CoinflowWithdraw
wallet={wallet}
merchantId='<YOUR_MERCHANT_ID>'
env='prod' // or 'staging' or 'sandbox'
connection={connection}
/>;➕ Additional Wallets
If you need to associate more than one wallet with the user:
const additionalWallets = [
{
wallet: '1111111111111111111111111111111111111111111',
blockchain: 'solana'
}
];
<CoinflowWithdraw
...
additionalWallets={additionalWallets}
/>;Updated 4 months ago