1.1.22 • Published 7 months ago

@infte/web3modal-react v1.1.22

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

web3ReactModal 说明文档

Web3Button 组件

  • 负责链接钱包与切换卡包
  • 参数: type?: 'connect' | 'change'; 链接/切换

Web3Modal

整个插件实例

参数

  1. ethereumClient
    • locale?: 'en-us' | 'zh-cn' | 'zh-hk' | string; // 默认语言
    • chainsList?: { // 支持的链列表
      • name: string;
      • chainId: number;
      • networkId: number;
      • contracts: any;
      • explorers: any[];
      • location_id: number;
      • rpc: string[];
      • nativeCurrency: Token;
    • }[]; // 支持的链
    • network_id?: number | string | null; // 默认链接的链
    • wallet_type?: WalletType = 'MetaMask' | 'BitKeep' | string;; // 指定钱包类-型,- 默认链接。不指定需要手动选择
  2. openHashStorage 开启校验哈希本地缓存
  3. children
  • 其他配置:
  • 默认自动链接 autoConnect,同时修传入默认连接的 network_id 与 wallet_type 参数,打开 app 就会自动链接钱包

    • 默认false不进行连接

useWeb3Storage

web3 本地存储实例

useWeb3Provider

web3 Provider 实例

useAppHashState

交易哈希本地缓存实例

hooks

  1. useEthScanPath
  • 回调:{
    • link = (hash: string, type: ethScanPathType): string
    • blank = (hash: string, type: ethScanPathType)
    • details_blank = (url: string, hash: string, type: ethScanPathType)
  • }
  • eth 浏览器地址 hooks
  1. useSingleResult
  • 类型:(contract: Contract | null | undefined,methodName: string,inputs?: MethodArg[])
  • 合约单个调用返回
  1. useHashMessage
  • 回调:{
    • HashMessage = (hash: string,success_fn?: () => any,successText: string = successText_msg)
    • implementResult = async (props:
      • {
      • singleContract: any;
      • params?: any[];
      • successText?: string;
      • success_fn?: () => void;
      • error_fn?: (err: any) => void;
    • }
  • )
  • loading:boolean
  • setLoading(bool:boolean)
  • }
  1. getSigner
  • 类型:getSigner(library: any, account: string): any
  • 返回一个新的 Signer 对象,它在发送交易时不执行额外的检查。 有关详细信息,请参阅 getUncheckedSigner。
  1. getProviderOrSigner
  • 类型:getProviderOrSigner(library: any, account?: string): any
  • 处理 Provider/Signer
  1. getContract
  • 类型: getContract(address: string, // 合约地址 ABI: any,library: any,account?: string): Contract
  • 创建合约

hooks/useAccountOperation

  1. useAccountOperation
  • 回调 {
    • transfer = async (address: string, num: number, fn?: () => any),
    • getSigner,
    • loading,
  • }

hooks/userContract

1.1.19

7 months ago

1.1.22

7 months ago

1.1.21

7 months ago

1.1.20

7 months ago

1.1.18

11 months ago

1.1.17

11 months ago

1.1.9

12 months ago

1.1.8

12 months ago

1.1.12

12 months ago

1.1.11

12 months ago

1.1.10

12 months ago

1.1.15

12 months ago

1.1.14

12 months ago

1.1.13

12 months ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.1

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.73

1 year ago

1.0.77

1 year ago

1.0.76

1 year ago

1.0.75

1 year ago

1.0.74

1 year ago

1.0.79

1 year ago

1.0.78

1 year ago

1.1.0

1 year ago

1.0.100

1 year ago

1.0.80

1 year ago

1.0.84

1 year ago

1.0.83

1 year ago

1.0.82

1 year ago

1.0.81

1 year ago

1.0.88

1 year ago

1.0.87

1 year ago

1.0.86

1 year ago

1.0.85

1 year ago

1.0.89

1 year ago

1.0.91

1 year ago

1.0.90

1 year ago

1.0.95

1 year ago

1.0.94

1 year ago

1.0.93

1 year ago

1.0.92

1 year ago

1.0.99

1 year ago

1.0.98

1 year ago

1.0.97

1 year ago

1.0.96

1 year ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.67

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.49

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.59

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago