React Environment Properties
Developers can implement various environmental settings that determine how the withdrawal process functions.
Properties
| Property | Required | Description |
|---|---|---|
| wallet | Y | Set the Solana wallet adapter |
| blockchain | Y | The blockchain for the withdrawal (solana) |
| merchantId | Y | The merchant identifier - the source of the withdraw (Contact Coinflow support for this) |
| connection | Y | The Solana connection |
| env | N | The environment - defaults to prod, for testing set it to staging |
| onSuccess | N | Specify a function to run when the withdrawal process succeeds |
| lockAmount | N | By default, the user is allowed to select the amount to withdraw, setting to true disables the input |
| amount | N/Y | The amount of the withdrawal - only required if lockAmount=true |
| tokens | N | Define the list of available tokens - the UI will only show items from this list |
| lockDefaultToken | N | Defaults to false but when true, the UI will not allow the token to be changed from the default (for example, USDC) |
| N | Set the default email to use in email entry fields | |
| bankAccountLinkRedirect | N | The URL to use for bank account setup instead of the default |
| supportsVersionedTransactions | N | Instruct the system that you support versioned transactions |
| additionalWallets | N | Define additional wallets beyond the active wallet to associate with the user (see usage pattern below) |
Usage
Base
import {useWallet} from '@solana/wallet-adapter-react'; const wallet = useWallet(); const connection = useConnection(); <CoinflowWithdraw wallet={wallet} merchantId='<YOUR MERCHANT ID>' env='prod|sandbox|staging' connection={connection} />;
Additional Wallets
const additionalWallets = [ { wallet: '1111111111111111111111111111111111111111111', blockchain: 'solana' } ]

