π Purchase with non-stable tokens
Accepting payments in non-USDC tokens
One of the many benefits of Coinflow is it gives merchants the flexibility to denominate the prices of goods/services in other cryptocurrencies, and then have user funds settle directly in your smart contract for those other currencies.
Accepting non-stable tokens is the same process as accepting USDC, except that the Coinflow Contract will swap USDC for the other token on a decentralized exchange of the chain you are on.
See more technical details broken down by each chain:
Configuration
To configure your integration to accept non-stable tokens depends on which of the integrations you are using - pre-built UI or APIs. In both of these cases token
parameter is the token address/mint address of the token on its respective blockchain. For example:
Solana
Token Name | Mint Address |
---|---|
Wrapped Sol (wSOL) | So11111111111111111111111111111111111111112 |
Helium Network Token (HNT) | hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux |
Ethereum
Token Name | Token Contract Address |
---|---|
Wrapped Ether (wETH) | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 |
Wrapped Bitcoin (wBTC) | 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 |
Polygon
Token Name | Token Contract Address |
---|---|
Wrapped Matic (wMATIC) | 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270 |
Wrapped Ether (wETH) | 0x7ceb23fd6bc0add59e62ac25578270cff1b9f619 |
All
amount
fields are in major units of the token. For example, if you want to charge the user 0.01 ETH, you would pass "0.01" in theamount
field.
Pre-built UI
Pass the token/mint address in as the token
property, and the amount as the amount
field of the <CoinflowPurchase>
component. For example:
<CoinflowPurchase
blockchain={'polygon'}
token={'0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270'}
amount={'1.5'}
/>
APIs
Pass the token
and amount
field as the subtotal into the following API endpoints:
Updated 5 months ago