Skip to content

Commit

Permalink
docs: update siwe and sign docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tingzhao.ytz committed Dec 26, 2024
1 parent 422e8fe commit f0c2184
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/web3/src/connect-modal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The connection wallet popup, used with [ConnectButton](../connect-button/index.m
| actionRef | Used to control the component | `MutableRefObject<ConnectModalActionType>` | - | - |
| defaultSelectedWallet | Default selected wallet | `Wallet` | - | - |
| locale | Multilingual settings | `Locale["ConnectModal"]` | - | - |
| connecting | Whether it is connecting | `boolean` | - | - |
| connecting | Whether it is connecting | `boolean` \| `{ status: 'connecting \| 'signing'}` | - | - |
| emptyProps | Empty state props | [EmptyProps](https://ant.design/components/empty#api) | `{image: Empty.PRESENTED_IMAGE_SIMPLE, description: "No wallet available"}` | `1.18.0` |

Other modal properties see: [ModalProps](https://ant.design/components/modal#API)
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/connect-modal/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_mutawc/afts/img/A*dmHOSI_kdd0AAA
| actionRef | 用于控制组件 | `MutableRefObject<ConnectModalActionType>` | - | - |
| defaultSelectedWallet | 默认选中的钱包 | `Wallet` | - | - |
| locale | 多语言设置 | `Locale["ConnectModal"]` | - | - |
| connecting | 是否正在连接 | `boolean` | - | - |
| connecting | 是否正在连接 | `boolean` \| `{ status: 'connecting \| 'signing'}` | - | - |
| emptyProps | 空状态属性 | `EmptyProps` | `{image: Empty.PRESENTED_IMAGE_SIMPLE, description: "未发现任何钱包"}` | `1.18.0` |

其他弹框属性详见: [ModalProps](https://ant.design/components/modal-cn#api)
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/ethereum/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ When the `showQrModal` configuration is not `false`, the built-in [web3modal](ht
| reconnectOnMount | Whether or not to reconnect previously connected [connectors](https://wagmi.sh/react/api/createConfig#connectors) on mount. | `boolean` \| `undefined` | `true` | - |
| walletConnect | WalletConnect configuration | `false` \| [WalletConnectOptions](#walletconnectoptions) | - | `2.8.0` |
| transports | [Transport](https://wagmi.sh/core/api/createConfig#transports) configuration | `Transport` | - | `2.8.0` |
| siwe | [SIWEConfig](#siweconfig) | CreateSiweMessageParameters | - | - |
| siwe | [SIWEConfig](#siweconfig) | CreateSiweMessageParameters | - | `2.10.0` |

### WalletFactory

Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/ethereum/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ SIWE 是指 Sign-In with Ethereum,你的网站可以通过签名来验证用
| reconnectOnMount | 是否在组件挂载时重新连接之前已连接的[连接器](https://wagmi.sh/react/api/createConfig#connectors) | `boolean` \| `undefined` | `true` | - |
| walletConnect | walletConnect 的配置 | `false` \| [WalletConnectOptions](#walletconnectoptions) | - | `2.8.0` |
| transports | [Transport](https://wagmi.sh/core/api/createConfig#transports) 网关配置 | `Record<number, Transport>;` | - | `2.8.0` |
| siwe | [SIWEConfig](#siweconfig) | CreateSiweMessageParameters | - | - |
| siwe | [SIWEConfig](#siweconfig) | CreateSiweMessageParameters | - | `2.10.0` |

### EIP6963Config

Expand Down
10 changes: 9 additions & 1 deletion packages/web3/src/types/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,19 @@ This is an enum type that contains the IDs of some commonly used chains. Its val
| trait_type | The type of the attribute representing the characteristic type of the NFT. | `string` | - | - |
| value | The value of the attribute representing the characteristic of the NFT. | `string` | - | - |

## ConnectOptions
### ConnectOptions

| Property | Description | Type | Default | Version |
| ----------- | --------------- | ------------------------- | ------- | ------- |
| connectType | Connection type | `'extension' \| 'qrCode'` | - | - |

## SignConfig

| Property | Description | Type | Default | Version |
| -------- | ----------- | ------------------------------------- | ------- | ------- |
| signIn | Sign In | `(address: string) => Promise<void>;` | - | - |
| signOut | Sign Out | `() => Promise<void>;` | - | - |

## UniversalWeb3ProviderInterface

| Property | Description | Type | Default | Version |
Expand All @@ -104,6 +111,7 @@ This is an enum type that contains the IDs of some commonly used chains. Its val
| disconnect | Disconnect from the chain | `() => Promise<void>` | - | - |
| switchChain | Switch to another chain | `(chainId: ChainIds) => Promise<void>` | - | - |
| getNFTMetadata | Get the metadata of the NFT | `(contractAddress: string, tokenId?: string) => Promise<NFTMetadata>` | - | - |
| sign | Sign-in configuration | [SignConfig](#signconfig) | - | `1.20.0` |

## Token

Expand Down
8 changes: 8 additions & 0 deletions packages/web3/src/types/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ coverDark: https://mdn.alipayobjects.com/huamei_mutawc/afts/img/A*n4F2RK3AVTsAAA
| ----------- | -------- | ------------------------- | ------ | ---- |
| connectType | 连接类型 | `'extension' \| 'qrCode'` | - | - |

## SignConfig

| 属性 | 描述 | 类型 | 默认值 | 版本 |
| ------- | -------- | ------------------------------------- | ------ | ---- |
| signIn | 签名登录 | `(address: string) => Promise<void>;` | - | - |
| signOut | 签名登出 | `() => Promise<void>;` | - | - |

## UniversalWeb3ProviderInterface

| 属性 | 描述 | 类型 | 默认值 | 版本 |
Expand All @@ -105,6 +112,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_mutawc/afts/img/A*n4F2RK3AVTsAAA
| disconnect | 断开钱包连接 | `() => Promise<void>` | - | - |
| switchChain | 切换链 | `(chain: Chain) => Promise<void>` | - | - |
| getNFTMetadata | 获取 NFT 的元数据 | `(params: { address: string; tokenId?: bigint \| number }) => Promise<NFTMetadata>` | - | - |
| sign | 签名登录相关配置 | `SignConfig` | - | `1.20.0` |

## Token

Expand Down
3 changes: 3 additions & 0 deletions packages/web3/src/web3-config-provider/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ Provide global configuration and states for components.
| disconnect | Disconnect from the chain | `() => Promise<void>` | - | |
| switchChain | Switch to another chain | `(chain: Chain) => Promise<void>` | - | |
| getNFTMetadata | Get the metadata of the NFT | `(params: { address: string; tokenId: bigint }) => Promise<NFTMetadata>;` | - | |
| sign | Sign-in configuration | [SignConfig](/components/types#signconfig) | - | `1.20.0` |

`Web3ConfigProvider` API inherits from [UniversalWeb3ProviderInterface](/components/types#universalweb3providerinterface), providing chain-related interaction interfaces for UI components.
3 changes: 3 additions & 0 deletions packages/web3/src/web3-config-provider/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ coverDark: https://mdn.alipayobjects.com/huamei_mutawc/afts/img/A*DuEdT5NT9nwAAA
| disconnect | 断开连接 | `() => Promise<void>` | - | |
| switchChain | 切换链 | `(chain: Chain) => Promise<void>` | - | |
| getNFTMetadata | 获取 NFT 元数据 | `(params: { address: string; tokenId: bigint }) => Promise<NFTMetadata>;` | - | |
| sign | 签名登录配置 | [SignConfig](/components/types-cn#signconfig) | - | `1.20.0` |

`Web3ConfigProvider` 的 API 继承了 [UniversalWeb3ProviderInterface](/components/types-cn#universalweb3providerinterface),为 UI 组件提供链相关交互接口。

0 comments on commit f0c2184

Please sign in to comment.