UniportButton
A button that opens Uniport’s deposit modal. Render it anywhere in a React tree. It brings its own modal and styles.
Usage
1import { UniportButton } from "uniport-sdk";23export function DepositAction() {4 return (5 <UniportButton6 appId="app_..."7 recipient="0x..."8 destinationToken="optimismUSDC"9 label="Deposit"10 />11 );12}
Props
Only recipient and destinationToken are required, plus appId on a deployed site.
If a required prop is missing or wrong, the button renders disabled, the browser console says what to change, and onError is called once. Nothing throws, so your page keeps working. See Errors.
| Prop | Type | Default | Description |
|---|---|---|---|
| appId | string | Default — | Your App ID from the dashboard. Needed on a deployed site; optional on localhost. |
| recipient required | string | Default — | Your address on the destination chain. Funds settle here. |
| destinationToken required | string | Default — | What your app receives, as {chain}{SYMBOL}. See destination tokens. |
| label | string | Default "Pay with Crypto" | The button text. |
| amount | string | Default — | The exact amount to receive, in destination token units. The payer sends the quoted input, rounded up by at most 0.01%. Omit it to let the payer choose. |
| refundAddress | string | Default — | Prefills the payer’s refund address on their source chain. Not used when amount is set. |
| theme | "light" | "dark" | Default "light" | Theme for the button and modal. |
| variant | "default" | "compact" | "outline" | Default "default" | Button style. |
| disabled | boolean | Default false | Disables the button. |
| className | string | Default — | Class name for your own styles. |
| onSuccess | (result) => void | Default — | Called when the payment completes, with { txHash, amount, depositAddress, depositMemo, correlationId }. |
| onError | (error: UniportError) => void | Default — | Called when something goes wrong, with a UniportError. See the Errors page. |
| onOpenChange | (open) => void | Default — | Called when the modal opens or closes. |
Fixed amounts
With amount, the modal asks for exactly that much of your destination token. The payer’s quote is rounded up to a shorter number, by at most 0.01%.
Without it, the payer enters how much they send and your app receives the quoted output.
Refund address
If a payment can’t complete, funds go back to the payer’s refund address on the chain they paid from. The payer enters it in the modal, or you prefill it with refundAddress. With a fixed amount there’s no refund address: refunds go to Uniport’s NEAR Intents account. See Refunds.
EVM chains only: a blank refund address defaults to Uniport’s address, uniport.eth. On Solana, Sui, Bitcoin and other non-EVM chains the payer has to enter one.
Destination tokens
Pass any of these as destinationToken. Stablecoins are the common choice.
| Chain | destinationToken | Symbol | |
|---|---|---|---|
Optimism | optimismUSDC | USDC | |
Base | baseUSDC | USDC | |
Arbitrum | arbitrumUSDC | USDC | |
Ethereum | ethereumUSDC | USDC | |
Solana | solanaUSDC | USDC | |
Sui | suiUSDC | USDC | |
Polygon | polygonUSDC | USDC | |
Avalanche | avalancheUSDC | USDC | |
BNB Chain | bscUSDC | USDC | |
NEAR | nearUSDC | USDC | |
Stellar | stellarUSDC | USDC | Memo + trustline |
Tron | tronUSDT | USDT |
Optimism
Base
Arbitrum
Ethereum
Solana
Sui
Polygon
Avalanche
BNB Chain
NEAR
Stellar
Tron