Skip to content

Commit ffab985

Browse files
authored
Merge pull request #65 from tronweb3/release/v1.2.11
Release/v1.2.11
2 parents 1aa8e07 + a411d48 commit ffab985

File tree

21 files changed

+722
-231
lines changed

21 files changed

+722
-231
lines changed

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body:
2828
description: Describe platforms supported by the wallet.
2929
options:
3030
- label: Android
31-
- label: IOS
31+
- label: iOS
3232
- label: Chrome Extension
3333
validations:
3434
required: true
@@ -44,7 +44,7 @@ body:
4444
- type: dropdown
4545
id: role
4646
attributes:
47-
label: "Are you developer of the wallet or a web3 user ?"
47+
label: "Are you a developer of the wallet or a web3 user ?"
4848
description: If you are a developer, please [contact the TRON team](mailto:application@tron.network) for wallet listing and boost its visibility.
4949
options:
5050
- Developer

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,39 @@ This repository contains wallet adapters and components for Tron DApps. With out
99
| Wallet Name | platform | version |
1010
| ------------------------------------------- | ----------------- | ------------ |
1111
| [TronLink](https://www.tronlink.org/) | Android | >= 1.0.0 |
12-
| | IOS | >= 1.0.0 |
12+
| | iOS | >= 1.0.0 |
1313
| | Browser Extension | >= 1.0.0 |
1414
| [BitGet](https://web3.bitget.com/en) | Android | >= 4.0.0 |
15-
| | IOS | >= 4.0.0 |
15+
| | iOS | >= 4.0.0 |
1616
| | Browser Extension | >= 1.0.0 |
1717
| [OkxWallet](https://okx.com/) | Android | >= 6.0.0 |
18-
| | IOS | >= 6.0.0 |
18+
| | iOS | >= 6.0.0 |
1919
| | Browser Extension | >= 3.0.0 |
2020
| [TokenPocket](https://www.tokenpocket.pro/) | Android | >= 1.1.2 |
21-
| | IOS | >= 3.1.3 |
21+
| | iOS | >= 3.1.3 |
2222
| | Browser Extension | >= 2.0.3 |
2323
| [imToken](https://token.im/) | Android | >= 2.5.0 |
24-
| | IOS | >= 2.5.0 |
24+
| | iOS | >= 2.5.0 |
2525
| | Browser Extension | Not Support |
2626
| [GateWallet](https://www.gate.io/web3) | Android | >= 6.30.10 |
27-
| | IOS | >= 6.20.1 |
27+
| | iOS | >= 6.20.1 |
2828
| | Browser Extension | >= 2.35.2 |
2929
| [FoxWallet](https://foxwallet.com/) | Android | >= 5.3.1 |
30-
| | IOS | >= 5.3.1 |
30+
| | iOS | >= 5.3.1 |
3131
| | Browser Extension | Not Support |
3232
| [Bybit](https://bybit.com/web3) | Android | >= 4.51.1 |
33-
| | IOS | >= 4.51.1 |
33+
| | iOS | >= 4.51.1 |
3434
| | Browser Extension | >= 3.16.3 |
3535
| [Ledger](https://www.ledger.com/) | - | All versions |
3636
| [WalletConnect](https://walletconnect.org) | - | >= v2.0 |
3737
| [Trust](https://trustwallet.com) | Android | Not Support |
38-
| | IOS | Not Support |
38+
| | iOS | Not Support |
3939
| | Browser Extension | >= 1.0.0 |
4040
| [Tomo](https://tomo.inc/) | Android | 4.2.0 |
41-
| | IOS | 4.2.0 |
41+
| | iOS | 4.2.0 |
42+
| | Browser Extension | Not Support |
43+
| [Binance](https://www.binance.com/en/binancewallet) | Android | 2.102.5 |
44+
| | iOS | 3.0.1 |
4245
| | Browser Extension | Not Support |
4346

4447
> **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.
@@ -204,6 +207,7 @@ tronwallet-adapter
204207
| | ├─bybit # adapter for Bybit Wallet
205208
| | ├─trust # adapter for Trust Wallet
206209
| | ├─tomowallet # adapter for Tomo Wallet
210+
| | ├─binance # adapter for Binance Wallet
207211
| ├─react
208212
| | ├─react-hooks # react hooks to manage wallet state
209213
| | ├─react-ui # react ui components to select/connect wallets
@@ -212,7 +216,6 @@ tronwallet-adapter
212216
| | ├─vue-ui # vue ui components to select/connect wallets
213217
├─demos
214218
| ├─react-ui
215-
| | ├─create-react-app # demo created by create-react-app
216219
| | ├─vite-app # demo for vitejs
217220
| | ├─next-app # demo for nextjs
218221
| ├─vue-ui
@@ -229,18 +232,19 @@ You can use the `@tronweb3/tronwallet-adapters` package, or add the individual w
229232
| package | description |
230233
| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
231234
| [`@tronweb3/tronwallet-adapters`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapters) | Includes all the wallets (with tree shaking) |
232-
| [`@tronweb3/tronwallet-adapter-tronlink`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink) | Adapter for TronLink extention and TronLink app(IOS and Android) |
235+
| [`@tronweb3/tronwallet-adapter-tronlink`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tronlink) | Adapter for TronLink extention and TronLink app(iOS and Android) |
233236
| [`@tronweb3/tronwallet-adapter-ledger`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-ledger) | Adapter for Ledger |
234237
| [`@tronweb3/tronwallet-adapter-walletconnect`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-walletconnect) | Adapter for Walletconnect |
235-
| [`@tronweb3/tronwallet-adapter-tokenpocket`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tokenpocket) | Adapter for TokenPocket App(IOS and Android) |
236-
| [`@tronweb3/tronwallet-adapter-bitkeep`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bitkeep) | Adapter for BitKeep extension and BitKeep App(IOS and Android) |
238+
| [`@tronweb3/tronwallet-adapter-tokenpocket`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tokenpocket) | Adapter for TokenPocket App(iOS and Android) |
239+
| [`@tronweb3/tronwallet-adapter-bitkeep`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bitkeep) | Adapter for BitKeep extension and BitKeep App(iOS and Android) |
237240
| [`@tronweb3/tronwallet-adapter-okxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-okxwallet) | Adapter for Okx Wallet extension and App(Android) |
238-
| [`@tronweb3/tronwallet-adapter-imtoken`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-imtoken) | Adapter for imToken Wallet App(IOS and Android) |
239-
| [`@tronweb3/tronwallet-adapter-gatewallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-gatewallet) | Adapter for gate.io Wallet App(IOS and Android) and Extension |
240-
| [`@tronweb3/tronwallet-adapter-foxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-foxwallet) | Adapter for FoxWallet App(IOS and Android) |
241-
| [`@tronweb3/tronwallet-adapter-bybit`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bybit) | Adapter for Bybit Wallet App(IOS and Android) and Extension |
241+
| [`@tronweb3/tronwallet-adapter-imtoken`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-imtoken) | Adapter for imToken Wallet App(iOS and Android) |
242+
| [`@tronweb3/tronwallet-adapter-gatewallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-gatewallet) | Adapter for gate.io Wallet App(iOS and Android) and Extension |
243+
| [`@tronweb3/tronwallet-adapter-foxwallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-foxwallet) | Adapter for FoxWallet App(iOS and Android) |
244+
| [`@tronweb3/tronwallet-adapter-bybit`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-bybit) | Adapter for Bybit Wallet App(iOS and Android) and Extension |
242245
| [`@tronweb3/tronwallet-adapter-trust`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-trust) | Adapter for TrustWallet Extension |
243-
| [`@tronweb3/tronwallet-adapter-tomowallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tomowallet) | Adapter for Tomo Wallet App(IOS and Android) |
246+
| [`@tronweb3/tronwallet-adapter-tomowallet`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-tomowallet) | Adapter for Tomo Wallet App(iOS and Android) |
247+
| [`@tronweb3/tronwallet-adapter-binance`](https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-binance) | Adapter for Binance Wallet App(iOS and Android) |
244248

245249
### React Components
246250

@@ -278,6 +282,7 @@ This package contains all wallet adapters for Tron including:
278282
- [Bybit Wallet](https://www.bybit.com/web3)
279283
- [Trust](https://trustwallet.com)
280284
- [Tomo](https://tomo.inc/)
285+
- [Binance Wallet](https://www.binance.com/en/binancewallet)
281286

282287
Code example:
283288

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
TomoWalletAdapterName,
1717
TomoWalletAdapter,
1818
TronLinkAdapterName,
19-
TrustAdapter
19+
TrustAdapter,
20+
BinanceWalletAdapter
2021
} from '@tronweb3/tronwallet-adapters';
2122
import { walletconnectConfig } from '../config';
2223
import type { Adapter, AdapterName } from "@tronweb3/tronwallet-abstract-adapter";
@@ -65,6 +66,7 @@ export default function WalletProvider({ children }: PropsWithChildren) {
6566
new ImTokenAdapter(),
6667
new FoxWalletAdapter(),
6768
new BybitWalletAdapter(),
69+
new BinanceWalletAdapter(),
6870
new LedgerAdapter(),
6971
new WalletConnectAdapter(walletconnectConfig),
7072
];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tronwallet-adapter",
33
"description": "wallet adapters for TRON blockchain",
4-
"version": "1.2.10",
4+
"version": "1.2.11",
55
"main": "index.js",
66
"sideEffects": false,
77
"private": true,

packages/adapters/adapters/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ As `@tronweb3/tronwallet-adapters` exports adapter of each wallet , you can use
2121
| [`@tronweb3/tronwallet-adapter-bybit`](https://npmjs.com/package/@tronweb3/tronwallet-adapter-bybit) | adapter for [Bybit Wallet](https://www.bybit.com/en/web3/home) | [View](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/bybit) |
2222
| [`@tronweb3/tronwallet-adapter-trust`](https://npmjs.com/package/@tronweb3/tronwallet-adapter-trust) | adapter for [Trust Wallet Extension](https://trustwallet.com) | [View](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/trust) |
2323
| [`@tronweb3/tronwallet-adapter-tomowallet`](https://npmjs.com/package/@tronweb3/tronwallet-adapter-tomowallet) | adapter for [Tomo Wallet App](https://tomo.inc/) | [View](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/tomowallet) |
24+
| [`@tronweb3/tronwallet-adapter-binance`](https://npmjs.com/package/@tronweb3/tronwallet-adapter-binance) | adapter for [Binance Wallet App](https://www.binance.com/en/binancewallet) | [View](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/binance) |
2425

2526
## Usage
2627

@@ -346,3 +347,4 @@ Other adapters `Constructor` config api can be found in their source code `READM
346347
- [BybitWalletAdapter](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/bybit)
347348
- [TrustAdapter](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/trust)
348349
- [TomoWalletAdapter](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/tomowallet)
350+
- [BinanceWalletAdapter](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/binance)

packages/adapters/adapters/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronweb3/tronwallet-adapters",
3-
"version": "1.2.10",
3+
"version": "1.2.11",
44
"description": "Wallet adapters to help developers interact with Tron wallets using consistent API.",
55
"keywords": [
66
"TRON",
@@ -53,7 +53,8 @@
5353
"@tronweb3/tronwallet-adapter-foxwallet": "workspace:^",
5454
"@tronweb3/tronwallet-adapter-bybit": "workspace:^",
5555
"@tronweb3/tronwallet-adapter-tomowallet": "workspace:^",
56-
"@tronweb3/tronwallet-adapter-trust": "workspace:^"
56+
"@tronweb3/tronwallet-adapter-trust": "workspace:^",
57+
"@tronweb3/tronwallet-adapter-binance": "workspace:^"
5758
},
5859
"devDependencies": {
5960
"@vitest/browser": "^2.0.4",

packages/adapters/adapters/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ export * from '@tronweb3/tronwallet-adapter-foxwallet';
1010
export * from '@tronweb3/tronwallet-adapter-bybit';
1111
export * from '@tronweb3/tronwallet-adapter-tomowallet';
1212
export * from '@tronweb3/tronwallet-adapter-trust';
13+
export * from '@tronweb3/tronwallet-adapter-binance';

packages/adapters/adapters/tsconfig.all.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
{
3838
"path": "../tomowallet/tsconfig.all.json"
3939
},
40+
{
41+
"path": "../binance/tsconfig.all.json"
42+
},
4043
{
4144
"path": "./tsconfig.cjs.json"
4245
},

packages/adapters/binance/LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2022-Present, tronweb3
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.

packages/adapters/binance/README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# `@tronweb3/tronwallet-adapter-binance`
2+
3+
This package provides an adapter to enable TRON DApps to connect to the [Binance Wallet](https://www.binance.com/en/binancewallet).
4+
5+
## Demo
6+
7+
```typescript
8+
import { BinanceWalletAdapter } from '@tronweb3/tronwallet-adapter-binance';
9+
10+
const adapter = new BinanceWalletAdapter();
11+
// connect to BinanceWallet
12+
await adapter.connect();
13+
14+
// then you can get address
15+
console.log(adapter.address);
16+
17+
const tronWeb = new TronWeb({
18+
fullHost: 'https://api.trongrid.io',
19+
});
20+
21+
// create a send TRX transaction
22+
const unSignedTransaction = await tronWeb.transactionBuilder.sendTrx(
23+
targetAddress,
24+
100,
25+
adapter.address
26+
);
27+
// using adapter to sign the transaction
28+
const signedTransaction = await adapter.signTransaction(unSignedTransaction);
29+
// broadcast the transaction
30+
await tronWeb.trx.sendRawTransaction(signedTransaction);
31+
```
32+
33+
## Documentation
34+
35+
### API
36+
37+
- `Constructor(config: BinanceWalletAdapterConfig)`
38+
39+
```typescript
40+
interface BinanceWalletAdapterConfig {
41+
/**
42+
* Set if open Wallet's website when wallet is not installed.
43+
* Default is true.
44+
*/
45+
openUrlWhenWalletNotFound?: boolean;
46+
/**
47+
* Timeout in millisecond for checking if TokenPocket wallet is supported.
48+
* Default is 2 * 1000ms
49+
*/
50+
checkTimeout?: number;
51+
/**
52+
* Set if open TokenPocket app using DeepLink on mobile device.
53+
* Default is true.
54+
*/
55+
openAppWithDeeplink?: boolean;
56+
}
57+
```
58+
59+
- `network()` method is supported to get current network information. The type of returned value is `Network` as follows:
60+
61+
```typescript
62+
export enum NetworkType {
63+
Mainnet = 'Mainnet',
64+
Shasta = 'Shasta',
65+
Nile = 'Nile',
66+
/**
67+
* When use custom node
68+
*/
69+
Unknown = 'Unknown',
70+
}
71+
72+
export type Network = {
73+
networkType: NetworkType;
74+
chainId: string;
75+
fullNode: string;
76+
solidityNode: string;
77+
eventServer: string;
78+
};
79+
```
80+
81+
### Caveats
82+
83+
- Binance Wallet doesn't implement `multiSign()` and `switchChain()`.
84+
- Binance Wallet App does not support any events.
85+
86+
For more information about tronwallet adapters, please refer to [`@tronweb3/tronwallet-adapters`](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/adapters)

0 commit comments

Comments
 (0)