{"id":13400772,"url":"https://github.com/terra-money/wallet-provider","last_synced_at":"2025-05-15T07:17:29.063Z","repository":{"id":39600494,"uuid":"377728492","full_name":"terra-money/wallet-provider","owner":"terra-money","description":"Library to make React dApps easier using Terra Station Extension or Terra Station Mobile.","archived":false,"fork":false,"pushed_at":"2023-08-29T15:19:03.000Z","size":6970,"stargazers_count":89,"open_issues_count":31,"forks_count":69,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-14T01:18:38.841Z","etag":null,"topics":["blockchain","dapp","react","terrajs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@terra-money/wallet-provider","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terra-money.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-06-17T06:30:44.000Z","updated_at":"2025-02-02T02:19:54.000Z","dependencies_parsed_at":"2024-01-18T11:12:39.891Z","dependency_job_id":"0b2fe9fc-bb8c-4254-9bdd-ccb9743842d1","html_url":"https://github.com/terra-money/wallet-provider","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fwallet-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fwallet-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fwallet-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fwallet-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terra-money","download_url":"https://codeload.github.com/terra-money/wallet-provider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254257894,"owners_count":22040553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","dapp","react","terrajs"],"created_at":"2024-07-30T19:00:55.317Z","updated_at":"2025-05-15T07:17:29.035Z","avatar_url":"https://github.com/terra-money.png","language":"TypeScript","funding_links":[],"categories":["Development Tools"],"sub_categories":["SDKs"],"readme":"# Terra Wallet Provider\n\nLibrary to make React dApps easier using Station Extension or Station Mobile.\n\n# Quick Start\n\nUse templates to get your projects started quickly\n\n### Code Sandbox\n\nIf you want to test features quickly, you can simply run them on CodeSandbox without having to download Templates.\n\n- [Wallet Provider + Create-React-App](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/create-react-app)\n- [Wallet Provider + Create-React-App-17](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/create-react-app-17)\n\nThe following templates do not support Wallet-Provider 4 at the moment.\n\n- [Wallet Provider + Next.js](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/next)\n- [Wallet Provider + Vite.js](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/vite)\n- [Wallet Controller + Lit](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/lit)\n- [Wallet Controller + Vue.js](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/vue)\n- [Wallet Controller + Svelte](https://githubbox.com/terra-money/wallet-provider/tree/main/templates/svelte)\n\nAnd if you need to start your project from local computer, use the templates below. 👇\n\n### Create React App\n\n```sh\nnpx terra-templates get wallet-provider:create-react-app your-app-name\ncd your-app-name\nyarn install\nyarn start\n```\n\n\u003chttps://github.com/terra-money/wallet-provider/tree/main/templates/create-react-app\u003e\n\n### Create React App (React 17)\n\n```sh\nnpx terra-templates get wallet-provider:create-react-app-17 your-app-name\ncd your-app-name\nyarn install\nyarn start\n```\n\n\u003chttps://github.com/terra-money/wallet-provider/tree/main/templates/create-react-app\u003e\n\n### Next.js\n\n```sh\nnpx terra-templates get wallet-provider:next your-app-name\ncd your-app-name\nyarn install\nyarn run dev\n```\n\n\u003chttps://github.com/terra-money/wallet-provider/tree/main/templates/next\u003e\n\n### Other templates\n\n- [Wallet Provider + Vite.js](https://github.com/terra-money/wallet-provider/tree/main/templates/vite)\n- [Wallet Controller + Lit](https://github.com/terra-money/wallet-provider/tree/main/templates/lit)\n- [Wallet Controller + Vue.js](https://github.com/terra-money/wallet-provider/tree/main/templates/vue)\n- [Wallet Controller + Svelte](https://github.com/terra-money/wallet-provider/tree/main/templates/svelte)\n\n### Community templates (experimental)\n\nYou can find more templates in \u003chttps://templates.terra.money\u003e. (This is the beginning stage, so it may not be enough yet)\n\nIf you make a different type of template, you can register [here](https://github.com/terra-money/templates).\n\n# Basic Usage\n\nFirst, please add `\u003cmeta name=\"terra-wallet\" /\u003e` on your html page.\n\nSince then, browser extensions (e.g. Station chrome extension) will not attempt to connect in a Web app where this `\u003cmeta name=\"terra-wallet\"\u003e` tag is not found.\n\n```html\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta name=\"terra-wallet\" /\u003e\n  \u003c/head\u003e\n\u003c/html\u003e\n```\n\nIf you have used `react-router-dom`'s `\u003cBrowserRouter\u003e`, `useLocation()`, you can easily understand it.\n\n```jsx\nimport {\n  NetworkInfo,\n  WalletProvider,\n  WalletStatus,\n  getChainOptions,\n} from '@terra-money/wallet-provider';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\n// getChainOptions(): Promise\u003c{ defaultNetwork, walletConnectChainIds }\u003e\ngetChainOptions().then((chainOptions) =\u003e {\n  ReactDOM.render(\n    \u003cWalletProvider {...chainOptions}\u003e\n      \u003cYOUR_APP /\u003e\n    \u003c/WalletProvider\u003e,\n    document.getElementById('root'),\n  );\n});\n```\n\nFirst, you need to wrap your React App with the `\u003cWalletProvider\u003e` component.\n\n```jsx\nimport { useWallet } from '@terra-money/wallet-provider';\nimport React from 'react';\n\nfunction Component() {\n  const { status, network, wallets } = useWallet();\n\n  return (\n    \u003cdiv\u003e\n      \u003csection\u003e\n        \u003cpre\u003e\n          {JSON.stringify(\n            {\n              status,\n              network,\n              wallets,\n            },\n            null,\n            2,\n          )}\n        \u003c/pre\u003e\n      \u003c/section\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\nAfterwards, you can use React Hooks such as `useWallet()`, `useConnectedWallet()` and `useLCDClient()` anywhere in your app.\n\n# API\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ccode\u003e\u0026lt;WalletProvider\u0026gt;\u003c/code\u003e\u003c/summary\u003e\n\n```jsx\nimport {\n  WalletProvider,\n  NetworkInfo,\n  ReadonlyWalletSession,\n} from '@terra-money/wallet-provider';\n\n// network information\nconst mainnet: NetworkInfo = {\n  'phoenix-1': {\n    baseAsset: 'uluna',\n    chainID: 'phoenix-1',\n    coinType: '330',\n    explorer: {\n      address: 'https://terrasco.pe/mainnet/address/{}',\n      block: 'https://terrasco.pe/mainnet/block/{}',\n      tx: 'https://terrasco.pe/mainnet/tx/{}',\n      validator: 'https://terrasco.pe/mainnet/validator/{}',\n    },\n    gasAdjustment: 1.75,\n    gasPrices: {\n      uluna: 0.015,\n    },\n    icon: 'https://station-assets.terra.money/img/chains/Terra.svg',\n    lcd: 'https://phoenix-lcd.terra.dev',\n    name: 'Terra',\n    prefix: 'terra',\n  },\n};\n\nconst testnet: NetworkInfo = {\n  'pisco-1': {\n    baseAsset: 'uluna',\n    chainID: 'pisco-1',\n    coinType: '330',\n    explorer: {\n      address: 'https://terrasco.pe/testnet/address/{}',\n      block: 'https://terrasco.pe/testnet/block/{}',\n      tx: 'https://terrasco.pe/testnet/tx/{}',\n      validator: 'https://terrasco.pe/testnet/validator/{}',\n    },\n    gasAdjustment: 3.5,\n    gasPrices: {\n      uluna: 0.015,\n    },\n    icon: 'https://station-assets.terra.money/img/chains/Terra.svg',\n    lcd: 'https://pisco-lcd.terra.dev',\n    name: 'Terra',\n    prefix: 'terra',\n  },\n};\n\n// ⚠️ If there is no special reason, use `getChainOptions()` instead of `walletConnectChainIds` above.\n\n// Optional\n// If you need to modify the modal, such as changing the design, you can put it in,\n// and if you don't put the value in, there is a default modal.\nasync function createReadonlyWalletSession(): Promise\u003cReadonlyWalletSession\u003e {\n  const terraAddress = prompt('YOUR TERRA ADDRESS');\n  return {\n    network: mainnet,\n    terraAddress,\n  };\n}\n\n// Optional\n// WalletConnect Client option.\nconst connectorOpts: IWalletConnectOptions | undefined = undefined;\nconst pushServerOpts: IPushServerOptions | undefined = undefined;\n\n// Optional\n// Time to wait for the Chrome Extension window.isTerraExtensionAvailable.\n// If not entered, wait for default 1000 * 3 miliseconds.\n// If you reduce excessively, Session recovery of Chrome Extension may fail.\nconst waitingChromeExtensionInstallCheck: number | undefined = undefined;\n\nReactDOM.render(\n  \u003cWalletProvider\n    defaultNetwork={mainnet}\n    walletConnectChainIds={walletConnectChainIds}\n    createReadonlyWalletSession={createReadonlyWalletSession}\n    connectorOpts={connectorOpts}\n    pushServerOpts={pushServerOpts}\n    waitingChromeExtensionInstallCheck={waitingChromeExtensionInstallCheck}\n  \u003e\n    \u003cYOUR_APP /\u003e\n  \u003c/WalletProvider\u003e,\n  document.getElementById('root'),\n);\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ccode\u003euseWallet()\u003c/code\u003e\u003c/summary\u003e\n\nThis is a React Hook that can receive all the information. (Other hooks are functions for the convenience of Wrapping\nthis `useWallet()`)\n\n\u003c!-- source packages/src/@terra-money/use-wallet/useWallet.ts --pick \"Wallet\" --\u003e\n\n[packages/src/@terra-money/use-wallet/useWallet.ts](packages/src/@terra-money/use-wallet/useWallet.ts)\n\n````ts\nexport interface Wallet {\n  /**\n   * current client status\n   *\n   * this will be one of WalletStatus.INITIALIZING | WalletStatus.WALLET_NOT_CONNECTED | WalletStatus.WALLET_CONNECTED\n   *\n   * INITIALIZING = checking that the session and the chrome extension installation. (show the loading to users)\n   * WALLET_NOT_CONNECTED = there is no connected wallet (show the connect and install options to users)\n   * WALLET_CONNECTED = there is aconnected wallet (show the wallet info and disconnect button to users)\n   *\n   * @see Wallet#refetchStates\n   * @see WalletController#status\n   */\n  status: WalletStatus;\n  /**\n   * current selected network\n   *\n   * - if status is INITIALIZING or WALLET_NOT_CONNECTED = this will be the defaultNetwork\n   * - if status is WALLET_CONNECTED = this depends on the connected environment\n   *\n   * @see WalletProviderProps#defaultNetwork\n   * @see WalletController#network\n   */\n  network: NetworkInfo;\n  /**\n   * available connect types on the browser\n   *\n   * @see Wallet#connect\n   * @see WalletController#availableConnectTypes\n   */\n  availableConnectTypes: ConnectType[];\n  /**\n   * available connections includes identifier, name, icon\n   *\n   * @example\n   * ```\n   * const { availableConnections, connect } = useWallet()\n   *\n   * return (\n   *  \u003cdiv\u003e\n   *    {\n   *      availableConnections.map(({type, identifier, name, icon}) =\u003e (\n   *        \u003cbutotn key={`${type}:${identifier}`} onClick={() =\u003e connect(type, identifier)}\u003e\n   *          \u003cimg src={icon} /\u003e {name}\n   *        \u003c/button\u003e\n   *      ))\n   *    }\n   *  \u003c/div\u003e\n   * )\n   * ```\n   */\n  availableConnections: Connection[];\n  /**\n   * current connected connection\n   */\n  connection: Connection | undefined;\n  /**\n   * connect to wallet\n   *\n   * @example\n   * ```\n   * const { status, availableConnectTypes, connect } = useWallet()\n   *\n   * return status === WalletStatus.WALLET_NOT_CONNECTED \u0026\u0026\n   *        availableConnectTypes.includs(ConnectType.EXTENSION) \u0026\u0026\n   *  \u003cbutton onClick={() =\u003e connect(ConnectType.EXTENSION)}\u003e\n   *    Connct Chrome Extension\n   *  \u003c/button\u003e\n   * ```\n   *\n   * @see Wallet#availableConnectTypes\n   * @see WalletController#connect\n   */\n  connect: (type?: ConnectType, identifier?: string) =\u003e void;\n  /**\n   * manual connect to read only session\n   *\n   * @see Wallet#connectReadonly\n   */\n  connectReadonly: (terraAddress: string, network: NetworkInfo) =\u003e void;\n  /**\n   * available install types on the browser\n   *\n   * in this time, this only contains [ConnectType.EXTENSION]\n   *\n   * @see Wallet#install\n   * @see WalletController#availableInstallTypes\n   */\n  availableInstallTypes: ConnectType[];\n  /**\n   * available installations includes identifier, name, icon, url\n   *\n   * @example\n   * ```\n   * const { availableInstallations } = useWallet()\n   *\n   * return (\n   *  \u003cdiv\u003e\n   *    {\n   *      availableInstallations.map(({type, identifier, name, icon, url}) =\u003e (\n   *        \u003ca key={`${type}:${identifier}`} href={url}\u003e\n   *          \u003cimg src={icon} /\u003e {name}\n   *        \u003c/a\u003e\n   *      ))\n   *    }\n   *  \u003c/div\u003e\n   * )\n   * ```\n   *\n   * @see Wallet#install\n   * @see WalletController#availableInstallations\n   */\n  availableInstallations: Installation[];\n  /**\n   * @deprecated Please use availableInstallations\n   *\n   * install for the connect type\n   *\n   * @example\n   * ```\n   * const { status, availableInstallTypes } = useWallet()\n   *\n   * return status === WalletStatus.WALLET_NOT_CONNECTED \u0026\u0026\n   *        availableInstallTypes.includes(ConnectType.EXTENSION) \u0026\u0026\n   *  \u003cbutton onClick={() =\u003e install(ConnectType.EXTENSION)}\u003e\n   *    Install Extension\n   *  \u003c/button\u003e\n   * ```\n   *\n   * @see Wallet#availableInstallTypes\n   * @see WalletController#install\n   */\n  install: (type: ConnectType) =\u003e void;\n  /**\n   * connected wallets\n   *\n   * this will be like\n   * `[{ connectType: ConnectType.WALLETCONNECT, terraAddress: 'XXXXXXXXX' }]`\n   *\n   * in this time, you can get only one wallet. `wallets[0]`\n   *\n   * @see WalletController#wallets\n   */\n  wallets: WalletInfo[];\n  /**\n   * disconnect\n   *\n   * @example\n   * ```\n   * const { status, disconnect } = useWallet()\n   *\n   * return status === WalletStatus.WALLET_CONNECTED \u0026\u0026\n   *  \u003cbutton onClick={() =\u003e disconnect()}\u003e\n   *    Disconnect\n   *  \u003c/button\u003e\n   * ```\n   */\n  disconnect: () =\u003e void;\n  /**\n   * reload the connected wallet states\n   *\n   * in this time, this only work on the ConnectType.EXTENSION\n   *\n   * @see WalletController#refetchStates\n   */\n  refetchStates: () =\u003e void;\n  /**\n   * @deprecated please use refetchStates(). this function will remove on next major update\n   */\n  recheckStatus: () =\u003e void;\n  /**\n   * support features of this connection\n   *\n   * @example\n   * ```\n   * const { supportFeatures } = useWallet()\n   *\n   * return (\n   *  \u003cdiv\u003e\n   *    {\n   *      supportFeatures.has('post') \u0026\u0026\n   *      \u003cbutton onClick={post}\u003epost\u003c/button\u003e\n   *    }\n   *    {\n   *      supportFeatures.has('cw20-token') \u0026\u0026\n   *      \u003cbutton onClick={addCW20Token}\u003eadd cw20 token\u003c/button\u003e\n   *    }\n   *  \u003c/div\u003e\n   * )\n   * ```\n   *\n   * This type is same as `import type { TerraWebExtensionFeatures } from '@terra-money/web-extension-interface'`\n   */\n  supportFeatures: Set\u003c\n    'post' | 'sign' | 'sign-bytes' | 'cw20-token' | 'network'\n  \u003e;\n  /**\n   * post transaction\n   *\n   * @example\n   * ```\n   * const { post } = useWallet()\n   *\n   * const callback = useCallback(async () =\u003e {\n   *   try {\n   *    const result: TxResult = await post({...ExtensionOptions})\n   *    // DO SOMETHING...\n   *   } catch (error) {\n   *     if (error instanceof UserDenied) {\n   *       // DO SOMETHING...\n   *     } else {\n   *       // DO SOMETHING...\n   *     }\n   *   }\n   * }, [])\n   * ```\n   *\n   * @param { ExtensionOptions } tx transaction data\n   * @param terraAddress - does not work at this time. for the future extension\n   *\n   * @return { Promise\u003cTxResult\u003e }\n   *\n   * @throws { UserDenied } user denied the tx\n   * @throws { CreateTxFailed } did not create txhash (error dose not broadcasted)\n   * @throws { TxFailed } created txhash (error broadcated)\n   * @throws { Timeout } user does not act anything in specific time\n   * @throws { TxUnspecifiedError } unknown error\n   *\n   * @see WalletController#post\n   */\n  post: (tx: ExtensionOptions, terraAddress?: string) =\u003e Promise\u003cTxResult\u003e;\n  /**\n   * sign transaction\n   *\n   * @example\n   * ```\n   * const { sign } = useWallet()\n   *\n   * const callback = useCallback(async () =\u003e {\n   *   try {\n   *    const result: SignResult = await sign({...ExtensionOptions})\n   *\n   *    // Broadcast SignResult\n   *    const tx = result.result\n   *\n   *    const lcd = new LCDClient({\n   *      chainID: connectedWallet.network.chainID,\n   *      URL: connectedWallet.network.lcd,\n   *    })\n   *\n   *    const txResult = await lcd.tx.broadcastSync(tx)\n   *\n   *    // DO SOMETHING...\n   *   } catch (error) {\n   *     if (error instanceof UserDenied) {\n   *       // DO SOMETHING...\n   *     } else {\n   *       // DO SOMETHING...\n   *     }\n   *   }\n   * }, [])\n   * ```\n   *\n   * @param { ExtensionOptions } tx transaction data\n   * @param terraAddress - does not work at this time. for the future extension\n   *\n   * @return { Promise\u003cSignResult\u003e }\n   *\n   * @throws { UserDenied } user denied the tx\n   * @throws { CreateTxFailed } did not create txhash (error dose not broadcasted)\n   * @throws { TxFailed } created txhash (error broadcated)\n   * @throws { Timeout } user does not act anything in specific time\n   * @throws { TxUnspecifiedError } unknown error\n   *\n   * @see WalletController#sign\n   */\n  sign: (tx: ExtensionOptions, terraAddress?: string) =\u003e Promise\u003cSignResult\u003e;\n  /**\n   * sign any bytes\n   *\n   * @example\n   * ```\n   * const { signBytes } = useWallet()\n   *\n   * const BYTES = Buffer.from('hello world')\n   *\n   * const callback = useCallback(async () =\u003e {\n   *   try {\n   *     const { result }: SignBytesResult = await signBytes(BYTES)\n   *\n   *     console.log(result.recid)\n   *     console.log(result.signature)\n   *     console.log(result.public_key)\n   *\n   *     const verified: boolean = verifyBytes(BYTES, result)\n   *   } catch (error) {\n   *     if (error instanceof UserDenied) {\n   *       // DO SOMETHING...\n   *     } else {\n   *       // DO SOMETHING...\n   *     }\n   *   }\n   * }, [])\n   * ```\n   *\n   * @param bytes\n   */\n  signBytes: (bytes: Buffer, terraAddress?: string) =\u003e Promise\u003cSignBytesResult\u003e;\n  /**\n   * check if tokens are added on the extension\n   *\n   * @param chainID\n   * @param tokenAddrs cw20 token addresses\n   *\n   * @return token exists\n   *\n   * @see WalletController#hasCW20Tokens\n   */\n  hasCW20Tokens: (\n    chainID: string,\n    ...tokenAddrs: string[]\n  ) =\u003e Promise\u003c{\n    [tokenAddr: string]: boolean;\n  }\u003e;\n  /**\n   * request add token addresses to browser extension\n   *\n   * @param chainID\n   * @param tokenAddrs cw20 token addresses\n   *\n   * @return token exists\n   *\n   * @see WalletController#addCW20Tokens\n   */\n  addCW20Tokens: (\n    chainID: string,\n    ...tokenAddrs: string[]\n  ) =\u003e Promise\u003c{\n    [tokenAddr: string]: boolean;\n  }\u003e;\n  /**\n   * check if network is added on the extension\n   *\n   * @param network\n   *\n   * @return network exists\n   *\n   * @see WalletController#hasNetwork\n   */\n  hasNetwork: (network: Omit\u003cNetworkInfo, 'name'\u003e) =\u003e Promise\u003cboolean\u003e;\n  /**\n   * request add network to browser extension\n   *\n   * @param network\n   *\n   * @return network exists\n   *\n   * @see WalletController#addNetwork\n   */\n  addNetwork: (network: NetworkInfo) =\u003e Promise\u003cboolean\u003e;\n  /**\n   * Some mobile wallet emulates the behavior of chrome extension.\n   * It confirms that the current connection environment is such a wallet.\n   * (If you are running connect() by checking availableConnectType, you do not need to use this API.)\n   *\n   * @see WalletController#isChromeExtensionCompatibleBrowser\n   */\n  isChromeExtensionCompatibleBrowser: () =\u003e boolean;\n}\n````\n\n\u003c!-- /source --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ccode\u003euseConnectedWallet()\u003c/code\u003e\u003c/summary\u003e\n\n```jsx\nimport { useConnectedWallet } from '@terra-money/wallet-provider'\n\nfunction Component() {\n  const connectedWallet = useConnectedWallet()\n\n  const postTx = useCallback(async () =\u003e {\n    if (!connectedWallet) return\n\n    console.log('wallet addresses are', Object.values(connectedWallet.addresses))\n    console.log('network is', connectedWallet.network)\n    console.log('connectType is', connectedWallet.connectType)\n\n    const result = await connectedWallet.post({...})\n  }, [])\n\n  return (\n    \u003cbutton disabled={!connectedWallet || !connectedWallet.availablePost} onClick={() =\u003e postTx}\u003e\n      Post Tx\n    \u003c/button\u003e\n  )\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ccode\u003euseLCDClient()\u003c/code\u003e\u003c/summary\u003e\n\n```jsx\nimport { useLCDClient } from '@terra-money/wallet-provider';\n\nfunction Component() {\n  const lcd = useLCDClient();\n\n  const [result, setResult] = useState('');\n\n  useEffect(() =\u003e {\n    lcd.treasury.taxRate().then((taxRate) =\u003e {\n      setResult(taxRate.toString());\n    });\n  }, []);\n\n  return \u003cdiv\u003eResult: {result}\u003c/div\u003e;\n}\n```\n\n\u003c/details\u003e\n\n# Links\n\n- [Releases (Changelog)](https://github.com/terra-money/wallet-provider/releases)\n\n# Trouble-shooting guide\n\nwallet-provider contains the original source codes in sourcemaps.\n\n\u003cimg src=\"https://raw.githubusercontent.com/terra-money/wallet-provider/main/readme-assets/trouble-shooting-guide.png\" width=\"700\" style=\"max-width: 100%\" alt=\"Trouble-Shooting Guide\" /\u003e\n\nYou can check `src/@terra-money/wallet-provider/` in the Chrome Devtools / Sources Tab, and you can also use breakpoints\nhere for debug.\n\n(It may not be visible depending on your development settings such as Webpack.)\n\n# For Chrome Extension compatible wallet developers\n\n\u003cdetails\u003e\n\n\u003csummary\u003e\u003ccode\u003eChrome Extension compatible wallet development guide\u003c/code\u003e\u003c/summary\u003e\n\n### 1. Create dApp for test\n\nThere is the `dangerously__chromeExtensionCompatibleBrowserCheck` option to allow you to create a test environment for\nwallet development.\n\nBy declaring the `dangerously__chromeExtensionCompatibleBrowserCheck`, you can make your wallet recognized as the chrome\nextension.\n\n```jsx\n\u003cWalletProvider\n  dangerously__chromeExtensionCompatibleBrowserCheck={(userAgent) =\u003e\n    /YourWallet/.test(userAgent)\n  }\n\u003e\n  ...\n\u003c/WalletProvider\u003e\n```\n\n### 2. Register your wallet as default allow\n\nIf your wallet has been developed,\n\nPlease send me your wallet App link (Testlight version is OK)\n\nAnd send me Pull Request by modifying `DEFAULT_CHROME_EXTENSION_COMPATIBLE_BROWSER_CHECK` in\nthe `packages/src/@terra-money/wallet-provider/env.ts` file. (or just make an issue is OK)\n\n```diff\nexport const DEFAULT_CHROME_EXTENSION_COMPATIBLE_BROWSER_CHECK = (userAgent: string) =\u003e {\n-  return /MathWallet\\//.test(userAgent);\n+  return /MathWallet\\//.test(userAgent) || /YourWallet/.test(userAgent);\n}\n```\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterra-money%2Fwallet-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterra-money%2Fwallet-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterra-money%2Fwallet-provider/lists"}