Swaps & Payments
Cross-chain swaps, fiat onramp, direct transfers
Checkout
Cart, order summary, forms, shipping, discounts
Deposits
Chain selection, custom contracts, QR codes
Core Components
<AnySpend>
The primary interface component for token-to-token exchanges, fiat onramps, and cross-chain swaps.
Basic Usage
Props
Display as modal overlay or full page
Initial payment method tab
Target token contract address
Chain ID of destination token
Recipient wallet address
Pre-select the source chain
Load and display an existing order by ID
Hide the transaction history button
Hide the component header
Hide the bottom navigation bar
Called when a token is selected. Call
event.preventDefault() to prevent default token selection behavior.Callback fired on successful transaction
Custom fiat input presets (e.g.,
["10", "25", "50", "100"])Disable URL parameter syncing for swap configuration
Enable direct transfers when source and destination token/chain match (skips the swap backend)
Fixed destination amount in wei. When set, users cannot change the amount.
Pre-fill sender address to show token balances before wallet connection
Opaque metadata passed through to order callbacks (e.g., workflow form data)
URL to redirect to from the “Return to Home” button on the completion screen
Custom label for the recipient display (e.g., “OBSN Telegram Bot”)
Custom label for the return home button
CSS class overrides for specific elements. See Customization.
Render function overrides for replaceable UI elements. See Customization.
Text/message overrides for success, error, and processing states. See Customization.
Color and theme configuration. See Customization.
Usage Examples
- Basic Swap
- Fiat Onramp
- Fixed Amount
- Custom Branding
<AnySpendDeposit>
A streamlined deposit interface supporting chain selection, crypto/fiat payments, and custom contract deposits.
Basic Usage
Props
The wallet address to receive the deposit
Destination token contract address
Destination chain ID
Display mode
Force a payment type. If not set, shows chain selection first.
Pre-select the source token
Pre-select the source chain. If not provided, shows chain selection step.
Load an existing order by ID
Callback when deposit completes successfully
Callback when the close button is clicked
Called on token selection. Call
event.preventDefault() to override default behavior.Callback for opening a custom modal (e.g., for special token handling)
Order type for the deposit
Configuration for depositing to a custom smart contract. Creates a
custom_exact_in order that calls the specified contract.Allow direct transfers when source and destination match
Fixed destination amount in wei
Minimum destination amount required
Prefer using connected EOA wallet
Show chain selection step. Defaults to
true if sourceTokenChainId is not provided.Custom list of supported chains for chain selection
Number of top chains to show in chain selection
Custom title for the chain selection step
Custom description for the chain selection step
Minimum pool size for filtering tokens
Custom fiat input presets
Custom label for the action button
Custom header component
Custom footer content
Redirect URL for the “Return to Home” button
Custom label for recipient display
Custom label for the return button
Pre-fill sender address for token balance display
Metadata passed through to order callbacks
When true, uses
AnySpendCustomExactIn for custom function depositsCSS class overrides. See Customization.
Render function overrides. See Customization.
Text/message overrides. See Customization.
Theme configuration. See Customization.
DepositContractConfig
Use this to configure custom contract deposits:Type Definition
ChainConfig
Type Definition
Usage Examples
- Basic Deposit
- Custom Contract Deposit
- With Chain Selection
<AnySpendCheckout>
A full-featured checkout component with cart display, order summary, custom forms, shipping selection, discount codes, and multi-payment-method support.
Basic Usage
Props
Payment recipient wallet address
Destination token contract address
Destination chain ID
Line items to display in the cart
Display mode
Override the computed total (in wei). Useful when the total differs from the sum of item amounts.
Merchant/organization name displayed in the checkout header
URL for the organization logo
Hex color for theming the checkout (e.g.,
"#6366f1")Custom text for the payment button
Link this checkout to a checkout session for backend tracking
Called on successful payment
Called on payment error
URL to redirect to after payment
Label for the return button
Which payment method to expand initially
Pre-fill sender address for token balance display
Custom footer for the order summary. Pass
null to hide the default footer.Show points earned in the order status summary
Show the order ID in the order status summary
Shipping cost. String = amount in wei. Object = amount with custom label.
Tax amount. String = amount in wei. Object = amount with custom label and optional rate display.
Discount amount (displayed as negative). String = amount in wei. Object = amount with label and optional code.
Additional summary line items (e.g., platform fees, tips, service charges)
JSON schema for collecting customer info. See Checkout Guide.
Custom React form component. See Checkout Guide.
Called when form data changes
Shipping options displayed as a selector. See Checkout Guide.
Show a shipping address form
Called when shipping option changes
Show a discount code input
Async discount code validation function
Called when a discount is applied
CSS class overrides. See Customization.
Render function overrides. See Customization.
Text/message overrides. See Customization.
Theme configuration. See Customization.
CheckoutItem
Type Definition
CheckoutSummaryLine
Type Definition
<AnySpendCheckoutTrigger>
Extends AnySpendCheckout with B3 workflow integration. Automatically triggers a workflow on successful payment.
Basic Usage
Additional Props (beyond AnySpendCheckout)
B3 workflow ID to trigger on successful payment
Organization ID that owns the workflow
Metadata merged into the order for workflow access. The
inputs field is accessible via {{root.result.inputs.*}} in workflows.With Workflow & Metadata
<AnySpendWorkflowTrigger>
A payment component designed specifically for triggering B3 workflows. Requires a fixed payment amount and workflow configuration.
Basic Usage
Props
Payment recipient address
Destination chain ID
Destination token address
Required payment amount in wei
B3 workflow ID to trigger
Organization ID that owns the workflow
Metadata for workflow access.
inputs are accessible via {{root.result.inputs.*}}.Callback when payment succeeds
Callback when the component is closed
Display mode
Custom label for the action button (e.g., “Pay & Activate”)
CSS class overrides
<QRDeposit>
A QR code-based deposit interface that generates a deposit address for users to send funds to.
Basic Usage
Props
The wallet address to receive the deposit
The destination token to receive
The destination chain ID
Display mode
Source token to deposit (defaults to ETH on Base)
Source chain ID (defaults to Base)
Creator address for order tracking
Custom contract execution after deposit
Callback when back button is clicked
Callback when close button is clicked
Callback when the deposit order is created
Callback when deposit is completed
CSS class overrides
Specialized Components
<AnySpendNFTButton>
A streamlined button for NFT purchases with built-in payment handling.
NFT Purchase Button
Props
NFT contract configuration object
Wallet address to receive the NFT
NFTContract Interface
Type Definition
<AnySpendCustom>
Flexible component for custom smart contract interactions, including staking, gaming, and DeFi operations.
Custom Contract Interaction
Props
Order type identifier
Target blockchain network
Token used for payment
Amount in wei
Target smart contract address
Encoded function call data
Token spender address
Custom metadata for tracking
Custom header component
Success callback
<AnySpendNFT>
Enhanced NFT purchase component with marketplace features.
Enhanced NFT Component
<AnySpendStakeB3>
Pre-configured component for B3 token staking.
B3 Staking
<AnySpendBuySpin>
Gaming-specific component for purchasing spin wheel or lottery entries.
Spin Wheel Purchase
<AnySpendTournament>
Tournament entry payment component.
Tournament Entry
<AnySpendBondKit>
BondKit integration for bonding curve token purchases.
BondKit Purchase
Providers
<AnyspendProvider>
Required provider that wraps all AnySpend components. Manages query client, Stripe redirect handling, and feature flags.
Provider Setup
Props
Child components
Optional feature flag overrides
Payment Method Types
Payment Method Enums
HypeDuel