Widget-Managed Deposits
Handle the signed transaction the widget prepares for the user
In Widget-Managed mode (the default), the widget runs the full deposit UI. The user picks a token and network, enters an amount, and taps "Continue". The widget then hands your app a ready-to-sign TransactionRequest via the onTransactionRequested callback — your app signs and broadcasts it.
Supported Tokens and Networks
Widget-Managed mode supports the following tokens, grouped by network:
| Network | Tokens |
|---|---|
| Ethereum | ETH, USDT, USDC, DAI, EURC, EURR, USDR, USAT, XAUT, SHIB, LINK, UNI, GRT, MKR, COMP, SNX, SUSHI, OMG, CHZ, ENJ, YFI, BAT, MANA |
| Solana | SOL, USDT, USDC, OOB |
| BNB Smart Chain | BNB, USDT, USDC |
| Polygon | USDT, USDC |
The supported set may change over time. For the authoritative list at runtime, use API-Managed Deposits with the List Crypto Currencies API.
Flow
- User selects a token and network from their available balances
- User reviews the amount and presses "Continue"
- The widget calls
onTransactionRequestedwith the transaction data - Your app navigates the user to a transaction confirmation screen
- User reviews and approves the transaction in your app
- Your app signs and broadcasts the transaction to the blockchain
The onTransactionRequested Callback
onTransactionRequested CallbackWhen the widget hands off a transaction, your app should navigate the user to a confirmation screen where they can review and approve it.
import { WidgetSDK, TransactionRequest } from '@oobit/react-native-sdk';
function WidgetScreen() {
const navigation = useNavigation();
const handleTransactionRequested = (transaction: TransactionRequest) => {
// Navigate to your transaction confirmation screen
navigation.navigate('TransactionConfirmation', { transaction });
};
return (
<WidgetSDK
accessToken={accessToken}
userWalletAddress={walletAddress}
onTransactionRequested={handleTransactionRequested}
onClose={() => navigation.goBack()}
/>
);
}import { WidgetSDK, TransactionRequest } from '@oobit/react-web';
function WidgetPage() {
const router = useRouter();
const handleTransactionRequested = (transaction: TransactionRequest) => {
// Navigate to your transaction confirmation screen
router.push({ pathname: '/confirm', query: { transaction } });
};
return (
<WidgetSDK
accessToken={accessToken}
userWalletAddress={walletAddress}
onTransactionRequested={handleTransactionRequested}
onClose={() => router.back()}
/>
);
}TransactionRequest Type
The TransactionRequest is a union type that can be either an EVM or Solana transaction. Use the type field to discriminate between chains.
type TransactionRequest = EvmTransactionRequest | SolanaTransactionRequest;Discriminating by Chain
function handleTransaction(transaction: TransactionRequest) {
switch (transaction.type) {
case 'evm':
// Handle EVM transaction (Ethereum, Polygon, BSC, etc.)
handleEvmTransaction(transaction);
break;
case 'solana':
// Handle Solana transaction
handleSolanaTransaction(transaction);
break;
}
}EVM Transactions
EVM transactions are used for Ethereum-compatible blockchains.
interface EvmTransactionRequest {
type: 'evm';
chainId: number;
transaction: EvmTransactionData;
tokenMetadata: TransactionTokenMetadata;
}
interface EvmTransactionData {
to: string;
data: string;
value: string;
}| Field | Type | Description |
|---|---|---|
type | 'evm' | Identifies this as an EVM transaction |
chainId | number | Network identifier (1 = Ethereum, 137 = Polygon, etc.) |
transaction.to | string | Destination address |
transaction.data | string | Encoded transaction data (hex) |
transaction.value | string | Native token value in wei (hex) |
tokenMetadata | TransactionTokenMetadata | Token info for display |
Solana Transactions
Solana transactions are used for the Solana blockchain.
interface SolanaTransactionRequest {
type: 'solana';
transaction: string;
tokenMetadata: TransactionTokenMetadata;
}| Field | Type | Description |
|---|---|---|
type | 'solana' | Identifies this as a Solana transaction |
transaction | string | Serialized transaction (base64 encoded) |
tokenMetadata | TransactionTokenMetadata | Token info for display |
Token Metadata
Both transaction types include tokenMetadata for displaying transaction details to the user.
interface TransactionTokenMetadata {
symbol: string;
amount: string;
decimals: number;
}| Field | Type | Description |
|---|---|---|
symbol | string | Token symbol (e.g., "USDC", "ETH", "SOL") |
amount | string | Human-readable amount to send |
decimals | number | Token decimal places |
See Also
- Deposit Flow — Overview of both deposit modes
- API-Managed Deposits — The alternative mode
- Testnet Resources — Faucets and testnet token contracts
Updated 3 days ago
