{"id":35797850,"url":"https://github.com/tronweb3/tronwallet-adapter","last_synced_at":"2026-01-26T11:04:19.001Z","repository":{"id":248493578,"uuid":"827742088","full_name":"tronweb3/tronwallet-adapter","owner":"tronweb3","description":"Modular TypeScript wallet adapters and components for TRON and EVM applications.","archived":false,"fork":false,"pushed_at":"2026-01-14T09:31:29.000Z","size":4152,"stargazers_count":60,"open_issues_count":20,"forks_count":39,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-14T13:41:08.308Z","etag":null,"topics":["blockchain","dapp","ethereum","javascript","react","tron","typescript","vue","wallets","web3"],"latest_commit_sha":null,"homepage":"https://walletadapter.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tronweb3.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-12T09:23:24.000Z","updated_at":"2026-01-10T11:35:33.000Z","dependencies_parsed_at":"2024-11-01T03:20:46.874Z","dependency_job_id":"2cf8e6ad-8b82-41b3-9479-6b6fa2382d9e","html_url":"https://github.com/tronweb3/tronwallet-adapter","commit_stats":null,"previous_names":["web3-geek/tronwallet-adapter","tronweb3/tronwallet-adapter"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/tronweb3/tronwallet-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronweb3%2Ftronwallet-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronweb3%2Ftronwallet-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronweb3%2Ftronwallet-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronweb3%2Ftronwallet-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tronweb3","download_url":"https://codeload.github.com/tronweb3/tronwallet-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronweb3%2Ftronwallet-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","ethereum","javascript","react","tron","typescript","vue","wallets","web3"],"created_at":"2026-01-07T10:15:29.024Z","updated_at":"2026-01-17T06:27:15.848Z","avatar_url":"https://github.com/tronweb3.png","language":"TypeScript","readme":"# tronwallet-adapter\n\nThis repository contains wallet adapters and components for Tron DApps. With out-of-box components and unified methods, developers can easily interact with multiple wallets, `select/connect/disconnect` wallets and `sign` a message or transaction.\n\n## Wallet Integrations\n\n### Supported Tron Wallets\n\n| Wallet Name                                         | platform          | version                        |\n| --------------------------------------------------- | ----------------- | ------------------------------ |\n| [TronLink](https://www.tronlink.org/)               | Android           | \u003e=4.17.1                       |\n|                                                     | iOS               | \u003e=4.17.0                       |\n|                                                     | Browser Extension | \u003e=4.5.0                        |\n| [BitGet](https://web3.bitget.com/en)                | Android           | \u003e=9.14.1                       |\n|                                                     | iOS               | \u003e=9.14.0                       |\n|                                                     | Browser Extension | \u003e=2.16.21                      |\n| [OkxWallet](https://okx.com/)                       | Android           | \u003e=6.132.1                      |\n|                                                     | iOS               | \u003e=6.134.0                      |\n|                                                     | Browser Extension | \u003e=3.71.0                       |\n| [TokenPocket](https://www.tokenpocket.pro/)         | Android           | \u003e=2.8.4                        |\n|                                                     | iOS               | \u003e=2.10.0                       |\n|                                                     | Browser Extension | \u003e=2.4.0                        |\n| [imToken](https://token.im/)                        | Android           | \u003e=2.17.1.8031                  |\n|                                                     | iOS               | \u003e=2.17.1.8031                  |\n|                                                     | Browser Extension | Not Support                    |\n| [GateWallet](https://www.gate.io/web3)              | Android           | \u003e=7.18.5                       |\n|                                                     | iOS               | \u003e=7.18.0                       |\n|                                                     | Browser Extension | \u003e=2.68.0                       |\n| [FoxWallet](https://foxwallet.com/)                 | Android           | \u003e=5.3.1                        |\n|                                                     | iOS               | \u003e=5.5.10                       |\n|                                                     | Browser Extension | Not Support                    |\n| [Bybit](https://bybit.com/web3)                     | Android           | \u003e=5.2.5                        |\n|                                                     | iOS               | \u003e=5.2.5                        |\n|                                                     | Browser Extension | \u003e=4.1.3                        |\n| [Ledger](https://www.ledger.com/)                   | -                 | All versions                   |\n| [WalletConnect](https://walletconnect.org)          | -                 | v2.0                           |\n| [Trust](https://trustwallet.com)                    | Android           | Not Support                    |\n|                                                     | IOS               | Not Support                    |\n|                                                     | Browser Extension | 2.48.0 \u003cbr\u003e 2.49.0 \u003cbr\u003e 2.50.1 |\n| [Guarda](https://guarda.com/)                       | Android           | Not Support                    |\n|                                                     | IOS               | Not Support                    |\n|                                                     | Browser Extension | \u003e=1.2.2                        |\n| [Tomo](https://tomo.inc/)                           | Android           | \u003e=4.2.4                        |\n|                                                     | iOS               | \u003e=4.2.4                        |\n|                                                     | Browser Extension | Not Support                    |\n| [Binance](https://www.binance.com/en/binancewallet) | Android           | \u003e=3.2.4                        |\n|                                                     | iOS               | \u003e=3.2.3                        |\n|                                                     | Browser Extension | Not Support                    |\n| [MetaMask](https://metamask.io/)                    | Android           | Not Support                    |\n|                                                     | iOS               | Not Support                    |\n|                                                     | Browser Extension | \u003e=13.14.0                      |\n\n### Supported EVM Wallets\n\n| Wallet Name                                         | platform          | version     |\n| --------------------------------------------------- | ----------------- | ----------- |\n| [MetaMask](https://metamask.io/)                    | Android           | \u003e=7.61.5    |\n|                                                     | iOS               | \u003e=7.61.5    |\n|                                                     | Browser Extension | \u003e=13.13.1   |\n| [TronLink](https://www.tronlink.org/)               | Android           | Not Support |\n|                                                     | iOS               | Not Support |\n|                                                     | Browser Extension | \u003e=4.6.3     |\n| [Binance](https://www.binance.com/en/binancewallet) | Android           | \u003e=3.7.4     |\n|                                                     | iOS               | \u003e=3.7.4     |\n|                                                     | Browser Extension | \u003e=1.5.1     |\n\n\u003e **Note**: In case wallet developers intend to release breaking changes, you can [open an issue here](https://github.com/tronweb3/tronwallet-adapter/issues/new) to inform us, thus enabling us to update the new protocols accordingly.\n\n### Add support for new wallet\n\nFollow these steps to support new wallets:\n\n1. List your wallet to [Tron Wallet](https://tron.network/wallet) .\n2. Open an issue in this repository or fork the repository and implement the according adapter.\n\n### Wallet Integration Standards\n\nWallets are encouraged to implement the following TRON interface standards to ensure compatibility with the TronWallet Adapter and the broader TRON dApp ecosystem:\n\n-   [TIP-1193](https://github.com/tronprotocol/tips/blob/master/tip-1193.md) – Defines a standard TRON provider interface for dApps to communicate with wallets.\n\nBy following these standards, wallets can be seamlessly integrated into modern TRON dApps using unified APIs and adapters.\n\n### Tron Wallets Features Report\n\nPlease refer to [this document](https://walletadapter.org/docs/guide/wallet-reference.html) to see the features of Tron wallets.\n\n## Introduction\n\n### Adapters\n\nWallet adapters help you to access to TRON wallets with consistent API.\n\nThere are many wallets supporting TRON network such as TronLink, Ledger and so on . **Different wallets** and **different versions** of one wallet may have different interface to use. The aim of **Adapters** relavant packages is to shield these differences and offer consistent interface for DApp developers. DApps don't need to change their code frequently if they have accessed to the tron wallet adapters code.\n\nFor example if you want to connect to different wallets, you have to use different methods:\n\n```js\n// TronLink\nwindow.tronLink.request({ method: 'tron_requestAccounts' });\n\n// Ledger\nconst transport = await TransportWebHID.create();\nconst app = new Trx(transport);\n\n// WalletConnect\nconst wallet = new WalletConnectWallet({\n    network: this._config.network,\n    options: this._config.options,\n});\n```\n\nWith adapter, you can use consistent APIs for different wallets:\n\n```js\n// TronLink\nconst tronlinkAdapter = new TronLinkAdapter();\nawait tronlinkAdapter.connect();\nawait tronlinkAdapter.signMessage(message);\n\n// Ledger\nconst ledgerAdapter = new LedgerAdapter();\nawait ledgerAdapter.connect();\nawait ledgerAdapter.signMessage(message);\n\n// WalletConnect\nconst walletconnectAdapter = new WalletConnectAdapter();\nawait walletconnectAdapter.connect();\nawait walletconnectAdapter.signMessage(message);\n```\n\n### Hooks and UI components for **React**\n\nThere are two libraries for React developers: `@tronweb3/tronwallet-adapter-react-hooks` and `@tronweb3/tronwallet-adapter-react-ui`.\n\nReact hook is a hook to manage the global state of wallet, such as current selected wallet and the connect state, address, and so on. It also provides some methods to interact with wallet.\n\nWhen your dapp supports multiple wallets, with the help of `useWallet()` hook you can easily:\n\n-   select which wallet to use\n-   connect to the selected wallet\n-   disconnect to the selected wallet\n-   call `signMessage` or `signTransaction` of the selected wallet\n\nExamples:\n\n```jsx\nfunction Comp() {\n    const { wallet, address, connected, select, connect, disconnect, signMessage, signTransaction } = useWallet();\n    return (\n        \u003cdiv\u003e\n            \u003cbutton onClick={() =\u003e select('TronLink')}\u003eSelect Wallet\u003c/button\u003e\n            \u003cbutton onClick={connect}\u003eConnect\u003c/button\u003e\n            \u003cbutton onClick={disconnect}\u003eDisconnect\u003c/button\u003e\n            \u003cbutton onClick={() =\u003e signMessage('Hello World')}\u003eSign Message\u003c/button\u003e\n        \u003c/div\u003e\n    );\n}\n```\n\n`useWallet()` only contains logic to manage wallet state. Besides, we provide a set of out-of-box components to help you interact with wallets:\n\n-   `WalletSelectButton`: Shows a wallet dialog to select a wallet\n-   `WalletConnectButton`: Connects to the selected wallet\n-   `WalletDisconnectButton`: Disconnects from the selected wallet\n-   `WalletActionButton`: A button with multiple actions include `select/connect/disconnect`\n\nHere is the demo image:\n\n![example](./demo.png)\n\n### Hooks and UI components for **Vue**\n\nThere are two libraries for Vue developers: `@tronweb3/tronwallet-adapter-vue-hooks` and `@tronweb3/tronwallet-adapter-vue-ui`.\nVue hook is a hook to manage the global state of wallet, such as current selected wallet and the connect state, address, and so on. It also provides some methods to interact with wallet.\n\nWhen your dapp supports multiple wallets, with the help of `useWallet()` hook you can easily:\n\n-   select which wallet to use\n-   connect to the selected wallet\n-   disconnect to the selected wallet\n-   call `signMessage` or `signTransaction` of the selected wallet\n\nExamples:\n\n```html\n\u003ctemplate\u003e\n\u003cdiv\u003e\n    \u003cbutton onClick={() =\u003e select('TronLink')}\u003eSelect Wallet\u003c/button\u003e\n    \u003cbutton onClick={connect}\u003eConnect\u003c/button\u003e\n    \u003cbutton onClick={disconnect}\u003eDisconnect\u003c/button\u003e\n    \u003cbutton onClick={() =\u003e signMessage('Hello World')}\u003eSign Message\u003c/button\u003e\n\u003c/div\u003e\n\u003c/template\u003e\n\u003cscript setup\u003e\n    const { wallet, address, connected, select, connect, disconnect, signMessage, signTransaction } = useWallet();\n\u003c/script\u003e\n```\n\n`useWallet()` only contains logic to manage wallet state. Besides, we provide a set of out-of-box components to help you interact with wallets:\n\n-   `WalletSelectButton`: Shows a wallet dialog to select a wallet\n-   `WalletConnectButton`: Connects to the selected wallet\n-   `WalletDisconnectButton`: Disconnects from the selected wallet\n-   `WalletActionButton`: A button with multiple actions include `select/connect/disconnect`\n\n## Documentation\n\n-   [For Tron Apps](./App.md)\n\nFor more details, please refer to the [API Documentation](https://walletadapter.org/docs/api-reference/adapter.html).\n\n## TronWallet Adapter Packages\n\nThis library is organized into several packages with few dependencies.\n\nTo add it to your app, you'll need abstract adapter package, some adapters for wallets, and UI components.\n\n```bash\ntronwallet-adapter\n├─docs # documents\n├─packages\n|   ├─adapters\n|   |   ├─abstract-adapter # abstract class for the specified adapter\n|   |   ├─adapters # export all adapters\n|   |   ├─tronlink # adapter for tronlink\n|   |   ├─ledger # adapter for ledger\n|   |   ├─walletconnect # adapter for walletconnect\n|   |   ├─tokenpocket # adapter for TokenPocket\n|   |   ├─bitkeep # adapter for Bitget Wallet\n|   |   ├─okxwallet # adapter for Okx Wallet\n|   |   ├─imtoken # adapter for imToken Wallet\n|   |   ├─gatewallet # adapter for gate.io Wallet\n|   |   ├─foxwallet # adapter for FoxWallet\n|   |   ├─guarda # adapter for Guarda Wallet\n|   |   ├─bybit # adapter for Bybit Wallet\n|   |   ├─trust # adapter for Trust Wallet\n|   |   ├─tomowallet # adapter for Tomo Wallet\n|   |   ├─metamask-tron # adapter for MetaMask Wallet\n|   |   ├─binance # adapter for Binance Wallet\n|   |   ├─evm # adapters for EVM compatible Wallet\n|   |   |   ├─abstract-adapter\n|   |   |   ├─binance\n|   |   |   ├─metamask\n|   |   |   ├─tronlink\n|   ├─react\n|   |   ├─react-hooks # react hooks to manage wallet state\n|   |   ├─react-ui # react ui components to select/connect wallets\n|   ├─vue\n|   |   ├─vue-hooks # vue hooks to manage wallet state\n|   |   ├─vue-ui # vue ui components to select/connect wallets\n├─demos\n|   ├─react-ui\n|   |   ├─vite-app # demo for vitejs\n|   |   ├─next-app # demo for nextjs\n|   ├─vue-ui\n|   |   ├─vite-app # demo for vitejs\n|   ├─dev-demo # demo for development\n|   ├─cdn-demo # demo for cdn usage of adapters\n```\n\n### TronWallet Adapters\n\nThese packages provide adapters for each wallet.\nYou can use the `@tronweb3/tronwallet-adapters` package, or add the individual wallet packages you want.\n\n| package                                                                                                                  | description                                                      |\n| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |\n| [`@tronweb3/tronwallet-adapters`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapters)                           | Includes all the wallets (with tree shaking)                     |\n| [`@tronweb3/tronwallet-adapter-tronlink`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink)           | Adapter for TronLink extention and TronLink app(iOS and Android) |\n| [`@tronweb3/tronwallet-adapter-ledger`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-ledger)               | Adapter for Ledger                                               |\n| [`@tronweb3/tronwallet-adapter-walletconnect`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-walletconnect) | Adapter for Walletconnect                                        |\n| [`@tronweb3/tronwallet-adapter-tokenpocket`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tokenpocket)     | Adapter for TokenPocket                                          |\n| [`@tronweb3/tronwallet-adapter-bitkeep`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bitkeep)             | Adapter for BitKeep extension and BitKeep App(iOS and Android)   |\n| [`@tronweb3/tronwallet-adapter-okxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-okxwallet)         | Adapter for Okx Wallet extension and App(Android)                |\n| [`@tronweb3/tronwallet-adapter-imtoken`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-imtoken)             | Adapter for imToken Wallet App(iOS and Android)                  |\n| [`@tronweb3/tronwallet-adapter-gatewallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-gatewallet)       | Adapter for gate.io Wallet App(iOS and Android) and Extension    |\n| [`@tronweb3/tronwallet-adapter-foxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-foxwallet)         | Adapter for FoxWallet App(iOS and Android)                       |\n| [`@tronweb3/tronwallet-adapter-bybit`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bybit)                 | Adapter for Bybit Wallet App(iOS and Android) and Extension      |\n| [`@tronweb3/tronwallet-adapter-trust`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-trust)                 | Adapter for TrustWallet Extension                                |\n| [`@tronweb3/tronwallet-adapter-tomowallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tomowallet)       | Adapter for Tomo Wallet App(iOS and Android)                     |\n| [`@tronweb3/tronwallet-adapter-binance`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-binance)             | Adapter for Binance Wallet App(iOS and Android)                  |\n| [`@tronweb3/tronwallet-adapter-guarda`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-guarda)               | Adapter for Guarda Wallet Extension                              |\n| [`@tronweb3/tronwallet-adapter-metamask-tron`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-metamask-tron)               | Adapter for MetaMask Wallet                              |\n\n### EvmWallet Adapters\n\n| package                                                                                                                | description                            |\n| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |\n| [`@tronweb3/tronwallet-adapter-binance-evm`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-binance-evm)   | Adapter for Binance extention and app  |\n| [`@tronweb3/tronwallet-adapter-metamask-evm`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-metamask-evm) | Adapter for MetaMask extention and app |\n| [`@tronweb3/tronwallet-adapter-tronlink-evm`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink-evm) | Adapter for TronLink extention         |\n\n### React Components\n\nThese packages includes hooks and UI components in React.\n\n| package                                                                                                              | description                         |\n| -------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |\n| [`@tronweb3/tronwallet-adapter-react-hooks`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-hooks) | Provides a `useWallet()` react hook |\n| [`@tronweb3/tronwallet-adapter-react-ui`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-ui)       | UI frameworks for react             |\n\n### Vue Components\n\nThese packages includes hooks and UI components in Vue.\n\n| package                                                                                                          | description                       |\n| ---------------------------------------------------------------------------------------------------------------- | --------------------------------- |\n| [`@tronweb3/tronwallet-adapter-vue-hooks`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-vue-hooks) | Provides a `useWallet()` vue hook |\n| [`@tronweb3/tronwallet-adapter-vue-ui`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-vue-ui)       | UI frameworks for vue             |\n\n## Packages Examples\n\n### @tronweb3/tronwallet-adapters\n\nThis package contains all wallet adapters for Tron including:\n\n-   [TronLink](https://www.tronlink.org/)\n-   [Ledger](https://www.ledger.com/)\n-   [WalletConnect](https://walletconnect.org)\n-   [TokenPocket](https://tokenpocket.pro/)\n-   [Bitget](https://bitkeep.com)\n-   [OKX Wallet](https://okx.com)\n-   [imToken Wallet](https://token.im/)\n-   [Gate Wallet](https://www.gate.io/web3)\n-   [Fox Wallet](https://foxwallet.com/)\n-   [Bybit Wallet](https://www.bybit.com/web3)\n-   [Trust](https://trustwallet.com)\n-   [Tomo](https://tomo.inc/)\n-   [Binance Wallet](https://www.binance.com/en/binancewallet)\n-   [Guarda Wallet](https://guarda.com)\n-   [MetaMask](https://metamask.io)\n\nCode example：\n\n```jsx\nimport { TronLinkAdapter } from '@tronweb3/tronwallet-adapters';\n\nfunction App() {\n    const adapter = useMemo(() =\u003e new TronLinkAdapter(), []);\n    const onConnect = useCallback(() =\u003e {}, []);\n    const onDisconnect = useCallback(() =\u003e {}, []);\n    const onStateChanged = useCallback(() =\u003e {}, []);\n    useEffect(() =\u003e {\n        adapter.on('connect', onConnect);\n        adapter.on('disconnect', onDisconnect);\n        adapter.on('stateChanged', onStateChanged);\n        return () =\u003e {\n            adapter.removeAllListeners();\n        };\n    });\n\n    const connect = useCallback(() =\u003e adapter.connect(), []);\n    const disconnect = useCallback(() =\u003e adapter.connect(), []);\n\n    return \u003cdiv\u003e\u003c/div\u003e;\n}\n```\n\n### @tronweb3/tronwallet-adapter-react-hooks\n\nThis package contains react hooks to easily `select/connect/disconnect` wallets and manage the wallet state.\n\nCode example：\n\n```jsx\nimport { WalletProvider, useWallet } from '@tronweb3/tronwallet-adapter-react-hooks';\n\nfunction App() {\n    const onError = useCallback((e) =\u003e {\n        // handle error here\n    }, []);\n    return (\n        \u003cWalletProvider onError={onError}\u003e\n            \u003cContent\u003e\u003c/Content\u003e\n        \u003c/WalletProvider\u003e\n    );\n}\nfunction Content() {\n    const { address, wallet, connected, select, connect, disconnect } = useWallet();\n    return (\n        \u003cdiv\u003e\n            \u003cp\u003eCurrent Address: {address}\u003c/p\u003e\n            \u003cp\u003eConnection Status: {wallet.state}\u003c/p\u003e\n            \u003cbutton onClick={() =\u003e select('WalletAdapterName to be selected')}\u003eSelect Wallet\u003c/button\u003e\n            \u003cbutton onClick={connect}\u003eConnect\u003c/button\u003e\n            \u003cbutton onClick={disconnect}\u003eDisconnect\u003c/button\u003e\n        \u003c/div\u003e\n    );\n}\n```\n\n### @tronweb3/tronwallet-adapter-react-ui\n\nThis package contains a set of out-of-the-box components to make it easy to `select/connect/disconnect` wallets.\n\nCode example：\n\n```jsx\nimport { WalletProvider } from '@tronweb3/tronwallet-adapter-react-hooks';\nimport { WalletModalProvider, WalletActionButton } from '@tronweb3/tronwallet-adapter-react-ui';\nfunction App() {\n    const onError = useCallback((e) =\u003e {\n        // handle error here\n    }, []);\n    return (\n        \u003cWalletProvider onError={onError}\u003e\n            \u003cWalletModalProvider\u003e\n                \u003cWalletActionButton\u003e\u003c/WalletActionButton\u003e\n            \u003c/WalletModalProvider\u003e\n        \u003c/WalletProvider\u003e\n    );\n}\n```\n\n\u003ch3 id=\"vue-demos\"\u003e@tronweb3/tronwallet-adapter-vue-hooks\u003c/h3\u003e\n\nThis package contains vue hooks to easily `select/connect/disconnect` wallets and manage the wallet state.\n\nCode example：\n\n```html\n\u003cscript setup\u003e\n    import { defineComponent, h } from 'vue';\n    import { WalletProvider, useWallet } from '@tronweb3/tronwallet-adapter-vue-hooks';\n    import { TronLinkAdapter } from '@tronweb3/tronwallet-adapters';\n    const tronLink = new TronLinkAdapter();\n\n    const adapters = [tronLink];\n\n    function onConnect(address) {\n        console.log('[wallet hooks] onConnect: ', address);\n    }\n    function onDisconnect() {\n        console.log('[wallet hooks] onDisconnect');\n    }\n\n    const VueComponent = defineComponent({\n        setup() {\n            // Here you can use `useWallet` API\n            const { wallet, connect, signMessage, signTransaction } = useWallet();\n            return () =\u003e\n                h('div', [\n                    h('div', { style: 'color: #222;' }, `Current Adapter: ${(wallet \u0026\u0026 wallet.adapter.name) || ''}`),\n                ]);\n        },\n    });\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n    \u003cWalletProvider :adapters=\"adapters\" @connect=\"onConnect\" @disconnect=\"onDisconnect\"\u003e\n        \u003cVueComponent /\u003e\n    \u003c/WalletProvider\u003e\n\u003c/template\u003e\n```\n\n### @tronweb3/tronwallet-adapter-vue-ui\n\nThis package contains a set of out-of-the-box components to make it easy to `select/connect/disconnect` wallets.\n\nCode example：\n\n```html\n\u003ctemplate\u003e\n    \u003cWalletProvider @error=\"onError\"\u003e\n        \u003cWalletModalProvider\u003e\n            \u003cWalletActionButton\u003e\u003c/WalletActionButton\u003e\n            \u003cProfile\u003e\u003c/Profile\u003e\n        \u003c/WalletModalProvider\u003e\n    \u003c/WalletProvider\u003e\n\u003c/template\u003e\n\u003cscript setup\u003e\n    import { h, defineComponent } from 'vue';\n    import { useWallet, WalletProvider } from '@tronweb3/tronwallet-adapter-vue-hooks';\n    import { WalletModalProvider, WalletActionButton } from '@tronweb3/tronwallet-adapter-vue-ui';\n    // This is necessary to keep style normal.\n    import '@tronweb3/tronwallet-adapter-vue-ui/style.css';\n    import { WalletDisconnectedError, WalletError, WalletNotFoundError } from '@tronweb3/tronwallet-abstract-adapter';\n\n    function onError(e: WalletError) {\n        if (e instanceof WalletNotFoundError) {\n            console.error(e.message);\n        } else if (e instanceof WalletDisconnectedError) {\n            console.error(e.message);\n        } else console.error(e.message);\n    }\n\n    const ConnectComponent = defineComponent({\n        setup() {\n            return () =\u003e h(WalletActionButton);\n        },\n    });\n\n    const Profile = defineComponent({\n        setup() {\n            const { wallet } = useWallet();\n            return () =\u003e h('div', `Current adapter: ${wallet?.adapter.name}`);\n        },\n    });\n\u003c/script\u003e\n```\n\n## Quick Start\n\nClone this repo and run the following commands:\n\n```bash\npnpm install\npnpm build\npnpm example\n```\n\n\u003e As the repo uses `pnpm` to manage workspace, please install `Nodejs` and `pnpm` first.\n\u003e The following is required:\n\u003e\n\u003e -   Nodejs = 20.18.0\n\u003e -   pnpm = 9.6.0\n\n## Which package should developers use ?\n\nIt's recommended to use `@tronweb3/tronwallet-adapter-react-hooks` or `@tronweb3/tronwallet-adapter-react-ui` for developing easily. There are also out-of-box libraries for Vue: `@tronweb3/tronwallet-adapter-vue-hooks` and `@tronweb3/tronwallet-adapter-vue-ui`.\n\nIf you don't want to customize your UI components and just want to accomplish functions rapidly, you can use components of `@tronweb3/tronwallet-adapter-react-ui` such as `WalletActionButton`. Its out-of-the-box components will help you `select/connect` the wallet and manage the wallet state.\n\nIf you want to have different appearance by developing components, you can use `@tronweb3/tronwallet-adapter-react-hooks` and call the `useWallet()` hook to `select/connect` the wallet.\n\n`@tronweb3/tronwallet-adapters` and `@tronweb3/tronwallet-adapter-xxx` packages include adapters for specified wallets. If you need only one adapter and want to custom your logic and style, you can choose this package.\n\n## Contributing\n\nWelcome to contribute your idea!\n\n1. Fork the repo and clone to your device.\n    ```bash\n    git clone https://github.com/tronweb3/tronwallet-adapter.git\n    ```\n2. Install Nodejs@20.18.0 and pnpm@9.6.0\n3. Install dependencies\n    ```bash\n    pnpm install\n    ```\n4. You can run `pnpm watch` to rebuild the code when changes.\n5. Commit the changes you've made and open a PR to this repository.\n\n### Release\n\n1. first update package version:\n\n```shell\npnpm update-version\n```\n\n2. release the packages\n\n```\npnpm release\n```\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronweb3%2Ftronwallet-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftronweb3%2Ftronwallet-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronweb3%2Ftronwallet-adapter/lists"}