npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@infte/web3modal-react

v1.1.22

Published

### Web3Button 组件

Downloads

44

Readme

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