| Chain | Address |
|---|---|
| Solana | cardWArqhdV5jeRXXjUti7cHAa4mj41Nj3Apc6RPZH2 |
| World Chain | 0x6B0D105999491a48d5793FB6Cb54f5cE079E0da9 |
Setting Up A Noncustodial Card
Step 1: Provision a card account
In the request to the endpoint to provision a card account, specify the wallet and currency to use. For thecrypto_account type, specify standard to indicate that Bridge should pull from the non-custodial wallet.
Note that a wallet can only be tied to one card account. Bridge does not allow issuing multiple cards that spend from the same wallet.
- Solana
- EVM
crypto_account address. Here is a sample transaction doing so.
For safety reasons, we recommend provisioning the card account before setting up the delegate approval, so that Bridge ties this address to the customer before any approvals are submitted onchain.
Step 2: Token Approval
For both SPL (Solana-based) and ERC-20 (EVM-based) tokens, end users will need to approve the cards smart contract to pull funds from their wallet.- Solana
- EVM
For this example, we’ll be using Solana’s Javascript SDK to set up an approval to the Bridge card program’s associated Program-Derived Address.We’ve provided a consolidated version of this delegate approval logic in a GitHub Gist, but this section will explain each step in detail.The result will be a delegate approval that resembles this transaction.
Step 2a: Setup connection and transaction
First, we set up a new transaction to contain our instructions. We also ensure that the account has a non-zero amount of SOL so that we can submit transactions onchain.Step 2b: Setup ATA if necessary
If necessary, first set up the associated token account for your wallet to hold a balance in the token you want to spend. This section checks for the existence of the associated token account, and adds an instruction into the transaction to create the ATA if it doesn’t already exist.Step 2c: Set up program delegate approval
Next, we’ll add an instruction to the transaction to approve Bridge’s card program to spend from the specified ATA.Note that theMERCHANT_ID to use when computing the delegate is specific to your developer. You will be assigned a specific MERCHANT_ID value by Bridge.