DePayFi / widgets

💸 Payments directly into your wallet. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion and state-of-the-art widgets.
https://depay.com
MIT License
96 stars 36 forks source link

shows wrong tokens #56

Closed 7flash closed 2 years ago

7flash commented 2 years ago

added this auto generated form.. expected to see ETH, Matic and BSC..

<div
        class="DePayButton"
        label="Purchase Tiles"
        widget="Payment"
        configuration='{"integration":"d5f13d63-be3d-42cd-838a-c346fb6eaded","accept":[{"blockchain": "ethereum","amount": 0.001,"token": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","receiver": "0x61d22b8c6aa896007c021f4cc23fe34951531028"},{"blockchain": "polygon","amount": 2,"token": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270","receiver": "0x61d22b8c6aa896007c021f4cc23fe34951531028"},{"blockchain": "bsc","amount": 5,"token": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","receiver": "0x61d22b8c6aa896007c021f4cc23fe34951531028"}]}'
      ></div>

but instead see these tokens..

image

My wallet connected 0x61D22b8C6Aa896007c021F4cC23fE34951531028

10xSebastian commented 2 years ago

@7flash you configure which tokens you accept, you will only receive:

The user sees ALL available assets that they have in their wallet to perform the payment. It seems that it is DAI in your case so DePay would convert DAI to WrappedMatic on polygon and send you the wrapped matic on polygon if you would perform this payment. All this happens in 1 transaction using decentralized exchanges (quickswap in this case).

Let me know if that clarifies things.

10xSebastian commented 2 years ago

btw. if you want to accept native MATIC and native BNB you can use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for all 3 chains as 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE represents the native currency on the respective chain.

e.g.

[
  { blockchain: 'ethereum', token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' },
  { blockchain: 'bsc', token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' },
  { blockchain: 'polygon', token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' }
]

accepts ETH (on Ethereum), BNB (on BSC) and MATIC (on Polygon)

10xSebastian commented 2 years ago

btw. it would show you ETH, wrapped matic and wrapped BNB if you would have them in your wallet (and an sufficient amount of each).