New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Draft for Payment Components #812
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
目前草稿为 api 设计,暂时没有 UI 层的实现 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
==========================================
- Coverage 99.97% 99.96% -0.01%
==========================================
Files 705 707 +2
Lines 21289 21338 +49
Branches 1200 1201 +1
==========================================
+ Hits 21283 21330 +47
- Misses 6 8 +2 ☔ View full report in Codecov by Sentry. |
改造了下维护的钱包信息,增加是否支持快捷扫码支付,和快捷扫码支付的模板字符串,目前想到的是模板字符串去匹配,看看有没有更好的方式方法 |
@@ -2,6 +2,7 @@ export * from './connector'; | |||
export * from './connect-button'; | |||
export * from './connect-modal'; | |||
export * from './address'; | |||
export * from './payment'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
组件名可以再讨论下,Payment 是付款的意思,但是感觉这个组件应该是“收款组件”。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PayPanel
关于 token 简单想法,需要再优化: 逻辑层面,token 和 chain 是两层,不应该混在一起。但是他们之间有桥梁。比如链确定的时候,我们可能就会使用到其主币,即 因此这里就会有两种视角:
结论
类似于 provider 传入不同的钱包,想自定义货币,导出 USDT / USDC 供用户导入,如
|
改造为钱包支持的链; |
* @desc 快捷扫码的参数是否支持 | ||
* @descEn Whether the parameters of fast scan code are supported | ||
*/ | ||
paramsFormat?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为 format callback,payQRCodeFormatter: (params: Record<string, any>) => string
[中文版模板 / Chinese template]
💡 Background and solution
interface Chain
支持token
配置USDT
信息,如果要配置别的token
,可通过如下配置支持Payment
组件参数supportChains
为必填,传入要支持的链;symbol
为不必填,传入则去找该 token 的信息使用,不传入则为主链币信息;toAddress
为必填,传入收款地址;number
目前为不必填,考虑不传入显示为输入数量的输入框?🔗 Related issue link
#415