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
97 stars 36 forks source link

Depay how to support more chains? #90

Closed dingcxx closed 1 year ago

dingcxx commented 1 year ago

Hello, our project is using Depay as the payment component for our application. Currently, the Depay documentation states that it only supports three chains: eth, bsc, polygon. Now, I would like to add support for Tron. Is it possible to do this by ourselves? Or , do you have plans to expand support for more chains?

10xSebastian commented 1 year ago

Hi @dingcxx

We have plans to extend to more chains. We have quite a list of blockchains we want to add this year.

In this regard, we have our own priorities. Currently, TRON is not within our 1-tier priorities.

Nonetheless, you can help add support for new blockchains.

If you look into https://github.com/DePayFi/widgets/blob/main/package.json you will see that there are a lot of underlying libraries that all come together for the payment widgets. Adding a new blockchain always starts with adding them to the lowest level of our stack:

web3-blockchains

web3-mock

web3-client

react-token-image

web3-tokens

web3-wallets

web3-exchanges

web3-assets

web3-payments

Once support for the new blockchain is added to all underlying libraries widgets will be able to support the new blockchain.

If you currently rely on payment tracking via DePay APIs, that's obviously separate work but adding support for a new blockchain to all low-level DePay libraries is always the first step.

dingcxx commented 1 year ago

I understand, it seems like a huge project. There is also one question: since Tron blockchain does not support EVM, does this mean that all payment protocols have to be rewritten?

10xSebastian commented 1 year ago

Yes. adding a non-evm-based blockchain is a lot of work. It's not just adding an rpc url. This is one of the main reasons we at DePay work on harmonizing various blockchains/platforms into a single Web3 Payments interface.

qtdc1229 commented 1 year ago

It is recommended to put all configurable data in a library, otherwise modifying it will be a major project. Wagmi provides the 'references' library to provide extensibility, so that third parties can contribute quickly. This approach may be more suitable for the current situation.

10xSebastian commented 1 year ago

@qtdc1229 and your point is?

Does this not look like a configuration to you?

https://github.com/DePayFi/web3-blockchains/blob/master/src/blockchains/polygon.js