-
Notifications
You must be signed in to change notification settings - Fork 149
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: add siwe #1214
base: main
Are you sure you want to change the base?
feat: add siwe #1214
Conversation
🦋 Changeset detectedLatest commit: cae22ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
开发者还是需要指定一下签名的时机,因此在这里提供了 hooks 来调用签名方法 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1214 +/- ##
=======================================
Coverage 99.99% 99.99%
=======================================
Files 858 858
Lines 14726 14799 +73
Branches 1589 1610 +21
=======================================
+ Hits 14725 14798 +73
Misses 1 1 ☔ View full report in Codecov by Sentry. |
@yutingzhao1991 愚指导有个问题,我在 AntDesignWeb3ConfigProvider 下面使用了 wagmi 的 signMessageAsync 来对消息进行签名,但是这个 hooks 需要在 WagmiProvider 下才可以使用。但是我们的 test 里面的用例并没有在外层包 WagmiProvider,这导致 test 过不去 |
AntDesignWeb3ConfigProvider 里面不要直接依赖 wagmi,本质上来讲你依赖的接口都是 AntDesignWeb3ConfigProvider 的 props,都可以自动去定义 mock 的。 |
有代码冲突了 |
) : ( | ||
<> | ||
{`${intl.getMessage(intl.messages.sign)}: `} | ||
{buttonText} |
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.
签名的情况下感觉不要直接用 buttonText,看了下 buttonText 可能会是金额,这样就很奇怪,用户可能会认为是对金额签名。直接用 Sign: 0x1234....2313
,这样吧,直接是 Sign 加上地址,不要用 buttonText。
@@ -18,6 +24,8 @@ export type ConnectButtonProps = ButtonProps & | |||
prefixCls?: string; | |||
locale?: Locale['ConnectButton']; | |||
avatar?: AvatarProps; | |||
sign?: SignConfig; | |||
signBtnTextRender?: (account?: Account, content?: React.ReactNode) => React.ReactNode; |
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.
signTextRender?:(signText: ReactNode): ReactNode
改为这样吧,和 antd 的大部分组件的 render 都是类似的,把默认的内容放到第一个参数给出来就行。
[中文版模板 / Chinese template]
添加 SIWE 的配置,目前只是一个最小可用的状态,需要 review 一下使用的方式是否可行。
需要在 provider 中配置对应的方法,并且在代码中需要指定调用的时机
💡 Background and solution
🔗 Related issue link
close #1107