The Universal Deposit SDK (@particle-network/universal-deposit) lets your app accept deposits from any chain. It gives your users deposit addresses for every chain supported by Universal Accounts, with funds automatically detected and bridged to your configured destination chain in USDC .
Learn More About Universal Accounts Universal Deposit leverages Universal Accounts. Learn what they are and how they work.
Universal Deposit uses USDC as the bridged asset. All deposits are automatically converted to USDC and sent to your configured destination chain.
Due to the architecture of Universal Deposit, it is not compatible with Particle Connectkit or Authkit .
Try Live Demo
You can try the Universal Deposit SDK in action by visiting the Universal Deposit Demo .
Try Live Demo Try the Universal Deposit SDK in action.
The Universal Deposit SDK provides a modal UI that allows users to deposit funds from any chain to your configured destination chain.
Installation
npm install @particle-network/universal-deposit
Quick Start
1. Setup — Wrap your app with DepositProvider
import { DepositProvider , CHAIN } from '@particle-network/universal-deposit/react' ;
function App () {
return (
< YourAuthProvider >
< DepositProvider config = { {
destination: { chainId: CHAIN . POLYGON },
autoSweep: true ,
minValueUSD: 1 ,
} } >
< YourApp />
</ DepositProvider >
</ YourAuthProvider >
);
}
2. Modal — Open a deposit dialog
import { useDeposit , DepositModal } from '@particle-network/universal-deposit/react' ;
function Page () {
const { address } = useYourWallet ();
const [ open , setOpen ] = useState ( false );
const { isReady } = useDeposit ({ ownerAddress: address });
return (
<>
< button onClick = { () => setOpen ( true ) } disabled = { ! isReady } >
Deposit
</ button >
< DepositModal isOpen = { open } onClose = { () => setOpen ( false ) } />
</>
);
}
The user address above is only used as reference for the deposit account generation, the SDK is fully wallet-agnostic.
import { useDeposit , DepositWidget } from '@particle-network/universal-deposit/react' ;
function Page () {
const { address } = useYourWallet ();
const { isReady } = useDeposit ({ ownerAddress: address });
if ( ! isReady ) return < Loading /> ;
return < DepositWidget fullWidth /> ;
}
4. Headless — Build your own UI
import { useDeposit , getChainName } from '@particle-network/universal-deposit/react' ;
function Page () {
const { address } = useYourWallet ();
const {
isReady , depositAddresses , pendingDeposits ,
recentActivity , status , sweep , currentDestination ,
} = useDeposit ({ ownerAddress: address });
if ( ! isReady ) return < Loading /> ;
return (
< div >
< p > EVM: { depositAddresses ?. evm } </ p >
< p > Solana: { depositAddresses ?. solana } </ p >
< p > Status: { status } </ p >
< p > Destination: { getChainName ( currentDestination ?. chainId ) } </ p >
{ pendingDeposits . map ( d => (
< div key = { d . id } >
{ d . token } — $ { d . amountUSD . toFixed ( 2 ) }
< button onClick = { () => sweep ( d . id ) } > Sweep </ button >
</ div >
)) }
</ div >
);
}
Next Steps