The Box enables one-click transactions using any token on any chain. Leveraging a set of hooks and embeddable React components, developers can select which action type they would like to perform (discussed further in key concepts), and The Box takes care of the rest. It abstracts bridging and swapping to provide users a seamless transaction experience regardless of where they store their funds, allowing dapps to meet users at their point of liquidity.
The Box is critical infrastructure in realizing the promise of a multi-chain future. App chains and rollups boast user experiences capable of onboarding mainstream audiences, but cannot thrive if each new chain further fractures liquidity. The Box makes crypto payments accessible and user-friendly for everyone by meeting users at their point of liquidity. With just one click to transact, regardless of the dapp or underlying network, The Box is the easiest way to transact onchain.
Developers can implement The Box as:
The Box React component is the fastest way to get up and running. It is a headless component that affords a significant degree of customization. We recommend this component for most developers as you don't have to rebuild components like token & network selectors and loading & error modals.
Many developers will prefer to access The Box's routing directly via our set of hooks. To mitigate duplicitous work and expedite Box installations using hooks, we have published two additional libraries:
@decent.xyz/box-ui: un-styled chain and token selector components
@decent.xyz/box-common: set of types most used in The Box
The four packages above all strictly include routing between supported EVM networks to minimize the size and dependencies of the core package. The Box also supports Solana, demonstrated in the "Get DUST" button on the DeGods Season III page. If you are a Solana developer, please specify that you would like beta access to
box-solana in your API Request.
Transactions through The Box typically take one of six possible forms:
Traditional crypto transactions: the user is connected to the network of the asset with which they are interacting, and the user is paying in a native token.
Example: A collector claims an NFT on Optimism with enough ETH on Optimism to pay for gas.
If a user would like to pay for a transaction on the same chain, but pay with a non-native supported token, The Box will execute a swap on behalf of the collector prior to completing the transaction.
Example: A collector would like to use Lido to stake ETH on Ethereum, but elects to pay with USDC instead. The Box will swap USDC for ETH before executing the transaction.
If a user would like to pay for a transaction using funds on a different chain, The Box will execute a bridge on behalf of the collector prior to completing the transaction.
Example: A collector wants to purchase an NFT on Ethereum. She would like to use ETH on Arbitrum even though the NFT is priced in ETH on Ethereum. The Box will bridge ETH from Arbitrum to Ethereum (example) before executing the mint.
If a user would like to pay for a transaction with a non-native token, on a different source chain, The Box will execute both bridge and swap transactions on behalf of the collector prior to completing the purchase.
Note: The Box automatically fetches the most efficient routes for bridging and swapping. Some transactions require swaps on both the source and destination chains to complete the transaction.
Example: A collector would like to purchase an NFT on Polygon priced in MATIC using ETH on Arbitrum. The Box will bridge ETH from Arbitrum to Polygon, then swap that ETH for MATIC prior to completing the purchase.
The box natively supports swapping as a service, allowing for easily embeddable DEX support into any website.
The box natively supports bridging as a service, allowing users to easily move from any token on any source chain to any destination token on the destination chain.
The Box's smart contracts successfully underwent two audits from Arbitrary Execution in June 2023. The final audit report was delivered July 5, 2023. You can find the second and final audit report here.
Updated 3 months ago