Pre-Requisites
To enable this feature, you will need to provide your own Coinbase Developer Platform (CDP) API keys. You can find instructions on how to do this here. Head over to Reown Dashboard and navigate to the “Fund from Exchange” section to configure your API keys.
Quickstart
This feature will start working as soon as your team is on the allowed-list. Please contact sales@reown.com to get started. After enabling it, Deposit with Exchange is accessible through the Account Screen by clicking on the “Fund wallet” button, and the modal below will be shown:
Stand-alone feature
If desired, Deposit with Exchange can be used as a stand-alone feature with the following helpers:- Get available payment assets based on the network:
- Configure the feature (if desired):
preselectedRecipient: (optional) if provided, will be used as recipient address instead of the connected wallet (if any)
showNetworkIcon: (optional) hides or shows the chain icon on the screen
preselectedAsset: (optional) if provided, will fix the feature on the provided asset and disable the Asset Selector
- Open the modal on Deposit Screen:
Headless (no UI) version usage
Instance creation
Create aReownAppKit instance and initialize it (as with any other AppKit usage).
Initialize the SDK
After creating the instance, initialize it.Supported Assets
Currently the feature works with a set of supported assets. You can use the following function to filter them according to your needs.Get Supported Exchanges
Whether you previously selected a supportedasset or not, the next step is to get all the supported exchanges. If asset is provided, the response will include only the exchanges supporting that particular asset.
GetExchangesParams also accepts includeOnly and exclude parameters to filter the getExchanges response. Example:
GetExchangesResult contains a list of exchanges (List<Exchange>) and the total number of them.
Payment URL
After the user selects the Exchange to fund their wallet from, it’s time to get the payment (funding) redirect URL with params:- Selected
Exchange⇒ id - Selected
ExchangeAsset - Amount to fund
- Your wallet address in CAIP-10
sessionId (relevant later to check the status of the transaction/funding) and the payment URL.
At this point, your dApp will launch this URL on the user’s device, and the Exchange App will be launched if installed; otherwise, their default browser will open to log into the exchange and fund.
Status Check
Once the user completes the transaction on the Exchange side, they should return to your dApp and wait for the confirmation status.The recommended approach here is that, right after the user launches the payment URL, your dApp starts to query the confirmation status in a loop with a 5-second delay between each request, until either CONFIRMED or FAILED is received (or your own timeout logic is triggered).
status are: UNKNOWN, IN_PROGRESS, CONFIRMED, FAILED
- UNKNOWN: Transaction has not been submitted yet
- IN_PROGRESS: Transaction submitted, checking confirmation
- CONFIRMED: Transaction confirmed, payment successful,
txHashwill be provided along with this status - FAILED: Transaction failed
