Skip to content

Commit a129b76

Browse files
authored
Merge pull request #52 from tronweb3/release/v1.2.9
Release/v1.2.9
2 parents 9316a7c + a1fb414 commit a129b76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3142
-9352
lines changed

README.md

Lines changed: 77 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,51 @@ This repository contains wallet adapters and components for Tron DApps. With out
66

77
### Supported
88

9-
| Wallet Name | platform | version |
10-
| ------------- | ---------- | ----- |
11-
| [TronLink](https://www.tronlink.org/)| Android | >= 1.0.0 |
12-
| | IOS | >= 1.0.0 |
13-
| |Browser Extension | >= 1.0.0|
14-
| [BitGet](https://web3.bitget.com/en) | Android | >= 4.0.0 |
15-
| | IOS | >= 4.0.0 |
16-
| |Browser Extension | >= 1.0.0 |
17-
| [OkxWallet](https://okx.com/) | Android | >= 6.0.0 |
18-
| | IOS | >= 6.0.0 |
19-
| |Browser Extension | >= 3.0.0 |
20-
| [TokenPocket](https://www.tokenpocket.pro/) | Android | >= 1.1.2 |
21-
| | IOS | >= 3.1.3 |
22-
| |Browser Extension | >= 2.0.3 |
23-
| [imToken](https://token.im/) | Android | >= 2.5.0 |
24-
| | IOS | >= 2.5.0 |
25-
| |Browser Extension | Not Support |
26-
| [gate.io](https://www.gate.io/web3) | Android | >= 6.30.10 |
27-
| | IOS | >= 6.20.1 |
28-
| |Browser Extension | >= 2.35.2 |
29-
| [FoxWallet](https://foxwallet.com/) | Android | >= 5.3.1 |
30-
| | IOS | >= 5.3.1 |
31-
| |Browser Extension | Not Support |
32-
| [Bybit](https://bybit.com/web3) | Android | >= 4.51.1 |
33-
| | IOS | >= 4.51.1 |
34-
| |Browser Extension | >= 3.16.3 |
35-
| [Ledger](https://www.ledger.com/) | - | All versions |
36-
| [WalletConnect](https://walletconnect.org) | - | >= v2.0 |
9+
| Wallet Name | platform | version |
10+
| ------------------------------------------- | ----------------- | ------------ |
11+
| [TronLink](https://www.tronlink.org/) | Android | >= 1.0.0 |
12+
| | IOS | >= 1.0.0 |
13+
| | Browser Extension | >= 1.0.0 |
14+
| [BitGet](https://web3.bitget.com/en) | Android | >= 4.0.0 |
15+
| | IOS | >= 4.0.0 |
16+
| | Browser Extension | >= 1.0.0 |
17+
| [OkxWallet](https://okx.com/) | Android | >= 6.0.0 |
18+
| | IOS | >= 6.0.0 |
19+
| | Browser Extension | >= 3.0.0 |
20+
| [TokenPocket](https://www.tokenpocket.pro/) | Android | >= 1.1.2 |
21+
| | IOS | >= 3.1.3 |
22+
| | Browser Extension | >= 2.0.3 |
23+
| [imToken](https://token.im/) | Android | >= 2.5.0 |
24+
| | IOS | >= 2.5.0 |
25+
| | Browser Extension | Not Support |
26+
| [GateWallet](https://www.gate.io/web3) | Android | >= 6.30.10 |
27+
| | IOS | >= 6.20.1 |
28+
| | Browser Extension | >= 2.35.2 |
29+
| [FoxWallet](https://foxwallet.com/) | Android | >= 5.3.1 |
30+
| | IOS | >= 5.3.1 |
31+
| | Browser Extension | Not Support |
32+
| [Bybit](https://bybit.com/web3) | Android | >= 4.51.1 |
33+
| | IOS | >= 4.51.1 |
34+
| | Browser Extension | >= 3.16.3 |
35+
| [Ledger](https://www.ledger.com/) | - | All versions |
36+
| [WalletConnect](https://walletconnect.org) | - | >= v2.0 |
37+
| [Trust](https://trustwallet.com) | Android | Not Support |
38+
| | IOS | Not Support |
39+
| | Browser Extension | >= 1.0.0 |
3740

3841
> **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.
3942
4043
### Add support for new wallet
44+
4145
Follow these steps to support new wallets:
46+
4247
1. List your wallet to [Tron Wallet](https://tron.network/wallet) .
4348
2. Open an issue in this repository or fork the repository and implement the according adapter.
4449

4550
### Tron Wallets Features Report
51+
4652
Please refer to [this document](https://github.com/tronweb3/tronwallet-adapter-docs/blob/main/wallet-feature.md) to see the features of Tron wallets.
53+
4754
## Introduction
4855

4956
### Adapters
@@ -192,6 +199,7 @@ tronwallet-adapter
192199
| | ├─gatewallet # adapter for gate.io Wallet
193200
| | ├─foxwallet # adapter for FoxWallet
194201
| | ├─bybit # adapter for Bybit Wallet
202+
| | ├─trust # adapter for Trust Wallet
195203
| ├─react
196204
| | ├─react-hooks # react hooks to manage wallet state
197205
| | ├─react-ui # react ui components to select/connect wallets
@@ -214,45 +222,56 @@ tronwallet-adapter
214222
These packages provide adapters for each wallet.
215223
You can use the `@tronweb3/tronwallet-adapters` package, or add the individual wallet packages you want.
216224

217-
| package | description | npm |
218-
| ------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
219-
| adapters | Includes all the wallets (with tree shaking) | [`@tronweb3/tronwallet-adapters`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapters) |
220-
| [tronlink](https://www.tronlink.org/) | Adapter for TronLink extention and TronLink app(IOS and Android) | [`@tronweb3/tronwallet-adapter-tronlink`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink) |
221-
| [ledger](https://www.ledger.com/) | Adapter for Ledger | [`@tronweb3/tronwallet-adapter-ledger`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-ledger) |
222-
| [walletconnect](https://walletconnect.com/) | Adapter for Walletconnect | [`@tronweb3/tronwallet-adapter-walletconnect`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-walletconnect) |
223-
| [tokenpocket](https://tokenpocket.pro/) | Adapter for TokenPocket App(IOS and Android) | [`@tronweb3/tronwallet-adapter-tokenpocket`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tokenpocket) |
224-
| [bitkeep](https://bitkeep.com/) | Adapter for BitKeep extension and BitKeep App(IOS and Android) | [`@tronweb3/tronwallet-adapter-bitkeep`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bitkeep) |
225-
| [okxwallet](https://www.okx.com/) | Adapter for Okx Wallet extension and App(Android) | [`@tronweb3/tronwallet-adapter-okxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-okxwallet) |
226-
| [imtoken](https://token.im/) | Adapter for imToken Wallet App(IOS and Android) | [`@tronweb3/tronwallet-adapter-imtoken`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-imtoken) |
227-
| [gatewallet](https://www.gate.io/web3) | Adapter for gate.io Wallet App(IOS and Android) and Extension | [`@tronweb3/tronwallet-adapter-gatewallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-gatewallet) |
228-
| [foxwallet](https://foxwallet.com/) | Adapter for Fox Wallet App(IOS and Android) | [`@tronweb3/tronwallet-adapter-foxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-foxwallet) |
229-
| [bybit](https://www.bybit.com/en/web3/home) | Adapter for Bybit Wallet App(IOS and Android) and Extension | [`@tronweb3/tronwallet-adapter-bybit`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bybit) |
225+
| package | description |
226+
| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
227+
| [`@tronweb3/tronwallet-adapters`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapters) | Includes all the wallets (with tree shaking) |
228+
| [`@tronweb3/tronwallet-adapter-tronlink`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink) | Adapter for TronLink extention and TronLink app(IOS and Android) |
229+
| [`@tronweb3/tronwallet-adapter-ledger`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-ledger) | Adapter for Ledger |
230+
| [`@tronweb3/tronwallet-adapter-walletconnect`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-walletconnect) | Adapter for Walletconnect |
231+
| [`@tronweb3/tronwallet-adapter-tokenpocket`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tokenpocket) | Adapter for TokenPocket App(IOS and Android) |
232+
| [`@tronweb3/tronwallet-adapter-bitkeep`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bitkeep) | Adapter for BitKeep extension and BitKeep App(IOS and Android) |
233+
| [`@tronweb3/tronwallet-adapter-okxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-okxwallet) | Adapter for Okx Wallet extension and App(Android) |
234+
| [`@tronweb3/tronwallet-adapter-imtoken`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-imtoken) | Adapter for imToken Wallet App(IOS and Android) |
235+
| [`@tronweb3/tronwallet-adapter-gatewallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-gatewallet) | Adapter for gate.io Wallet App(IOS and Android) and Extension |
236+
| [`@tronweb3/tronwallet-adapter-foxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-foxwallet) | Adapter for FoxWallet App(IOS and Android) |
237+
| [`@tronweb3/tronwallet-adapter-bybit`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bybit) | Adapter for Bybit Wallet App(IOS and Android) and Extension |
238+
| [`@tronweb3/tronwallet-adapter-trust`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-trust) | Adapter for TrustWallet Extension |
230239

231240
### React Components
232241

233-
These packages provide components for react hooks context and custom react UI.
242+
These packages includes hooks and UI components in React.
243+
244+
| package | description |
245+
| -------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
246+
| [`@tronweb3/tronwallet-adapter-react-hooks`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-hooks) | Provides a `useWallet()` react hook |
247+
| [`@tronweb3/tronwallet-adapter-react-ui`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-ui) | UI frameworks for react |
248+
249+
### Vue Components
250+
251+
These packages includes hooks and UI components in Vue.
234252

235-
| package | description | npm |
236-
| ----------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
237-
| react-hooks | provides a `useWallet()` react hook | [`@tronweb3/tronwallet-adapter-react-hooks`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-hooks) |
238-
| react-ui | UI frameworks for react app | [`@tronweb3/tronwallet-adapter-react-ui`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-react-ui) |
253+
| package | description |
254+
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------- |
255+
| [`@tronweb3/tronwallet-adapter-vue-hooks`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-vue-hooks) | Provides a `useWallet()` vue hook |
256+
| [`@tronweb3/tronwallet-adapter-vue-ui`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-vue-ui) | UI frameworks for vue |
239257

240258
## Packages Examples
241259

242260
### @tronweb3/tronwallet-adapters
243261

244262
This package contains all wallet adapters for Tron including:
245263

246-
- [TronLink](https://www.tronlink.org/).
247-
- [Ledger](https://www.ledger.com/).
248-
- [WalletConnect](https://walletconnect.org).
249-
- [TokenPocket](https://tokenpocket.pro/).
250-
- [BitKeep](https://bitkeep.com).
251-
- [Okx Wallet](https://okx.com).
252-
- [imToken Wallet](https://token.im/).
253-
- [gate.io Wallet](https://www.gate.io/web3)
254-
- [Fox Wallet](https://foxwallet.com/)
264+
- [TronLink](https://www.tronlink.org/)
265+
- [Ledger](https://www.ledger.com/)
266+
- [WalletConnect](https://walletconnect.org)
267+
- [TokenPocket](https://tokenpocket.pro/)
268+
- [Bitget](https://bitkeep.com)
269+
- [OKX Wallet](https://okx.com)
270+
- [imToken Wallet](https://token.im/)
271+
- [Gate Wallet](https://www.gate.io/web3)
272+
- [Fox Wallet](https://foxwallet.com/)
255273
- [Bybit Wallet](https://www.bybit.com/web3)
274+
- [Trust](https://trustwallet.com)
256275

257276
Code example:
258277

@@ -436,8 +455,8 @@ pnpm example
436455
> As the repo uses `pnpm` to manage workspace, please install `Nodejs` and `pnpm` first.
437456
> The following is required:
438457
>
439-
> - Nodejs >= 18
440-
> - pnpm >= 9
458+
> - Nodejs = 18.20.2
459+
> - pnpm = 9.6.0
441460
442461
## Which package should developers use ?
443462
@@ -457,7 +476,7 @@ Welcome to contribute your idea!
457476
```bash
458477
git clone https://github.com/tronweb3/tronwallet-adapter.git
459478
```
460-
2. Install Nodejs@18.x and pnpm@9.x
479+
2. Install Nodejs@18.20.2 and pnpm@9.6.0
461480
3. Install dependencies
462481
```bash
463482
pnpm install

demos/cdn-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
"devDependencies": {
2525
"serve": "^14.2.4"
2626
}
27-
}
27+
}

demos/dev-demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@tronweb3/tronwallet-adapter-react-ui": "latest",
3131
"@tronweb3/tronwallet-adapter-tokenpocket": "latest",
3232
"@tronweb3/tronwallet-adapter-tronlink-evm": "latest",
33+
"@tronweb3/tronwallet-adapter-trust": "latest",
3334
"@tronweb3/tronwallet-adapters": "latest",
3435
"events": "^3.3.0",
3536
"ganache": "^7.9.0",

demos/dev-demo/src/AdapterBasicTest.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
TronLinkAdapter,
1414
WalletConnectAdapter,
1515
FoxWalletAdapter,
16-
BybitWalletAdapter
16+
BybitWalletAdapter,
17+
TrustAdapter
1718
} from '@tronweb3/tronwallet-adapters';
1819
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
1920
import { tronWeb } from './tronweb';
@@ -33,6 +34,7 @@ export const AdapterBasicTest = memo(function AdapterBasicTest() {
3334
new BybitWalletAdapter(),
3435
new LedgerAdapter(),
3536
new WalletConnectAdapter(walletconnectConfig),
37+
new TrustAdapter(),
3638
],
3739
[]
3840
);

demos/dev-demo/src/AdapterBasicUsage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ const ConnectButton = styled(Button)({
8181
const AdapterBasicUsage: React.FC = () => {
8282
const { connectionState, connect, disconnect } = useWallet();
8383

84-
84+
8585
return (
8686
<Container>
87-
<Title>Adapter Basic Usage</Title>
87+
<Title>Adapter Basic Use Case</Title>
8888
<MainContent>
8989
<BasicInfoWrap>
9090
<AdapterSelect />
9191
<ConnectionState />
9292
<ConnectButton onClick={connectionState.connected ? disconnect : connect} disabled={connectionState.connecting}>
93-
{connectionState.connected ? <LinkOffIcon /> : <LinkIcon /> }
93+
{connectionState.connected ? <LinkOffIcon /> : <LinkIcon />}
9494
<span style={{ marginLeft: '10px' }}>{connectionState.connected ? 'Disconnect' : 'Connect'}</span>
9595
</ConnectButton>
9696
</BasicInfoWrap>
97-
<SignUsage/>
97+
<SignUsage />
9898
<SwitchChain />
9999
</MainContent>
100100
</Container>

demos/dev-demo/src/components/SignUsage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CHAIN_ID, TRONSCAN_URL } from "../config";
88
import { tronWeb } from "../tronweb";
99
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
1010

11-
export const UsageBox = styled(Box)(({ background } : { background: string }) => ({
11+
export const UsageBox = styled(Box)(({ background }: { background: string }) => ({
1212
width: '280px',
1313
borderRadius: 10,
1414
background,
@@ -123,12 +123,12 @@ export default function SignUsage() {
123123
const InformAlertContent = useMemo(() => {
124124
if (title === 'Transfer') {
125125
return <InformAlertText>
126-
{ success ? <>Success! You can confirm your transaction on <Link href={`${TRONSCAN_URL[connectionState.chainId] || TRONSCAN_URL[CHAIN_ID.Nile]}#/address/${connectionState.address}`} target="_blank" rel="noreferrer">TronScan</Link></> : 'Transfer failed'}
126+
{success ? <>Success! You can confirm your transaction on <Link href={`${TRONSCAN_URL[connectionState.chainId] || TRONSCAN_URL[CHAIN_ID.Nile]}#/address/${connectionState.address}`} target="_blank" rel="noreferrer">TronScan</Link></> : 'Transfer failed'}
127127
</InformAlertText>
128128
}
129129
if (title === 'Sign Message') {
130130
return <InformAlertText>
131-
{ success
131+
{success
132132
? <>Success! The signature is <i>{signature.slice(0, 6)}...{signature.slice(-6)}</i></> : 'Failed to sign the message'}
133133
</InformAlertText>
134134
}

0 commit comments

Comments
 (0)