|
1 |
| -# `@tronweb3/tronwallet-adapter-okxwallet` |
| 1 | +# `@tronweb3/tronwallet-adapter-bybit` |
2 | 2 |
|
3 |
| -This package provides an adapter to enable TRON DApps to connect to the [Okx Wallet extension](https://www.okx.com/download) and [Okx Wallet App](https://www.okx.com/download). |
| 3 | +This package provides an adapter to enable TRON DApps to connect to the [Bybit Wallet extension](https://chromewebstore.google.com/detail/bybit-wallet/pdliaogehgdbhbnmkklieghmmjkpigpa) and [Bybit Wallet App](https://www.bybit.com/en/web3/home). |
4 | 4 |
|
5 | 5 | ## Demo
|
6 | 6 |
|
7 | 7 | ```typescript
|
8 |
| -import { OkxWalletAdapter } from '@tronweb3/tronwallet-adapter-okxwallet'; |
| 8 | +import { BybitWalletAdapter } from '@tronweb3/tronwallet-adapter-bybit'; |
9 | 9 |
|
10 |
| -const adapter = new OkxWalletAdapter(); |
11 |
| -// connect to TokenPocket |
| 10 | +const adapter = new BybitWalletAdapter(); |
| 11 | +// connect to Bybit |
12 | 12 | await adapter.connect();
|
13 | 13 |
|
14 | 14 | // then you can get address
|
15 | 15 | console.log(adapter.address);
|
16 | 16 |
|
17 | 17 | // create a send TRX transaction
|
18 |
| -const unSignedTransaction = await window.okxwallet.tronLink.tronWeb.transactionBuilder.sendTrx( |
| 18 | +const unSignedTransaction = await window.bybitWallet.tronLink.tronWeb.transactionBuilder.sendTrx( |
19 | 19 | targetAddress,
|
20 | 20 | 100,
|
21 | 21 | adapter.address
|
22 | 22 | );
|
23 | 23 | // using adapter to sign the transaction
|
24 | 24 | const signedTransaction = await adapter.signTransaction(unSignedTransaction);
|
25 | 25 | // broadcast the transaction
|
26 |
| -await window.okxwallet.tronLink.tronWeb.trx.sendRawTransaction(signedTransaction); |
| 26 | +await window.bybitWallet.tronLink.tronWeb.trx.sendRawTransaction(signedTransaction); |
27 | 27 | ```
|
28 | 28 |
|
29 | 29 | ## Documentation
|
30 | 30 |
|
31 | 31 | ### API
|
32 | 32 |
|
33 |
| -- `Constructor(config: OkxWalletAdapterConfig)` |
| 33 | +- `Constructor(config: BybitWalletAdapterConfig)` |
34 | 34 |
|
35 | 35 | ```typescript
|
36 |
| -interface OkxWalletAdapterConfig { |
| 36 | +interface BybitWalletAdapterConfig { |
37 | 37 | /**
|
38 | 38 | * Set if open Wallet's website when wallet is not installed.
|
39 | 39 | * Default is true.
|
@@ -76,10 +76,11 @@ interface OkxWalletAdapterConfig {
|
76 | 76 |
|
77 | 77 | ### Caveats
|
78 | 78 |
|
79 |
| -- OkxWallet App and Extension doesn't implement `signMessage()`, `multiSign()` and `switchChain()`. |
80 |
| -- OkxWallet Extension only support these: `accountsChanged`,`connect`,`disconnect`. |
81 |
| -- OkxWallet App does not support any events. |
82 |
| -- Deeplink only works for OKX App **version 6.1.38 or later** on Android. |
83 |
| -- **OKX Wallet App on IOS does not support TRON currently**. |
| 79 | +- Bybit Wallet App and Extension doesn't implement `multiSign()` and `switchChain()`. |
| 80 | +- Bybit Wallet Extension only support these: `accountsChanged`,`connect`,`disconnect`. |
| 81 | +- Bybit Wallet App does not support any events. |
| 82 | +- Currently deeplink can only open the app but not dapp browser. |
| 83 | +- Keyless Wallet doesn't support Dapp connection. |
| 84 | +- Currently deeplink can not open App Store when app is not installed. |
84 | 85 |
|
85 | 86 | For more information about tronwallet adapters, please refer to [`@tronweb3/tronwallet-adapters`](https://github.com/web3-geek/tronwallet-adapter/tree/main/packages/adapters/adapters)
|
0 commit comments