|
1 |
| - |
2 | 1 | # @bitte-ai/wallet
|
3 | 2 |
|
4 |
| - |
5 | 3 | This is the [Bitte Wallet](https://wallet.bitte.ai) SDK package.
|
6 |
| -You can check a quick example of Simple Login using Next.js 14 and @bitte-ai/react |
7 | 4 |
|
8 |
| -check our [React integration](https://docs.mintbase.xyz/dev/mintbase-sdk-ref/react#mintbasewalletcontextprovider) |
| 5 | +check our [React integration](https://github.com/BitteProtocol/react/blob/main/README.md) |
9 | 6 |
|
10 |
| -Example: |
11 |
| -You can check a [quick example of Simple Login](https://github.com/Mintbase/examples/tree/main/starter) using Next.js 14 and @mintbase-js/react |
12 | 7 |
|
| 8 | +<p align="center"> |
13 | 9 |
|
14 |
| -<p align="center"> |
15 |
| -<img src='https://img.shields.io/npm/dw/@mintbase-js/wallet' /> |
16 |
| -<img src='https://img.shields.io/bundlephobia/min/@mintbase-js/wallet'> |
17 |
| -</p> |
18 |
| - |
19 |
| -## Video tutorial |
20 |
| - |
21 |
| -https://github.com/Mintbase/mintbase-js/assets/8454267/7301c178-3a34-497c-a2e7-1616d8f8b6a2 |
22 |
| - |
| 10 | +<img src='https://img.shields.io/npm/dw/@bitte-ai/wallet' /> |
23 | 11 |
|
| 12 | +<img src='https://img.shields.io/bundlephobia/min/@bitte-ai/wallet'> |
24 | 13 |
|
| 14 | +</p> |
25 | 15 |
|
26 | 16 |
|
27 | 17 | ## Installation and Usage
|
28 | 18 |
|
29 |
| - |
30 |
| - |
31 |
| -The easiest way to use this package is to install it from the NPM registry, this package requires `near-api-js` v1.0.0 or above: |
32 |
| - |
| 19 | +The easiest way to use this package is to install it from the NPM registry, |
33 | 20 |
|
34 | 21 |
|
35 | 22 | ```bash
|
36 |
| - |
37 | 23 | # Using Yarn
|
38 |
| - |
39 |
| -yarn add near-api-js |
40 |
| - |
| 24 | +yarn add @bitte-ai/wallet |
41 | 25 |
|
42 | 26 | # Using NPM.
|
43 |
| - |
44 |
| -npm install near-api-js |
45 |
| - |
46 |
| - |
| 27 | +npm install @bitte-ai/wallet |
47 | 28 |
|
48 | 29 | # Using PNPM.
|
49 |
| - |
50 |
| - |
51 |
| -pnpm install near-api-js |
52 |
| - |
53 |
| - |
54 |
| - |
| 30 | +pnpm install @bitte-ai/wallet |
55 | 31 | ```
|
56 | 32 |
|
57 | 33 |
|
58 |
| - |
59 |
| -```bash |
60 |
| - |
61 |
| -# Using Yarn |
62 |
| - |
63 |
| -yarn add @bitte-ai/wallet |
64 |
| - |
65 |
| - |
66 |
| - |
67 |
| -# Using NPM. |
68 |
| - |
69 |
| -npm install @bitte-ai/wallet |
70 |
| - |
71 |
| - |
72 |
| - |
73 |
| -# Using PNPM. |
74 |
| - |
75 |
| -pnpm install @bitte-ai/wallet |
76 |
| - |
77 |
| - |
78 |
| - |
79 |
| -``` |
80 |
| - |
81 |
| - |
82 |
| - |
83 | 34 | Then use it in your dApp:
|
84 | 35 |
|
| 36 | +```ts |
85 | 37 |
|
| 38 | +import { setupWalletSelector } from "@near-wallet-selector/core"; |
86 | 39 |
|
| 40 | +import { setupBitteWallet } from "@bitte-ai/wallet"; |
87 | 41 |
|
88 |
| -{% code title="setup.ts" overflow="wrap" lineNumbers="true" %} |
89 |
| - |
90 |
| - |
91 |
| - |
92 |
| - |
93 |
| -```ts |
94 |
| -import { setupWalletSelector } from "@near-wallet-selector/core"; |
95 |
| -import { setupBitteWallet } from " @bitte-ai/wallet"; |
96 |
| - |
97 |
| -const wallet = setupBitteWallet({ |
98 |
| - networkId: 'mainnet', |
99 |
| - walletUrl: 'https://wallet.bitte.ai', |
100 |
| - callbackUrl: 'https://www.mywebsite.com', |
101 |
| - deprecated: false, |
| 42 | +const wallet = setupBitteWallet({ |
| 43 | + network: 'mainnet', |
102 | 44 | });
|
103 | 45 |
|
104 | 46 | const selector = await setupWalletSelector({
|
105 |
| - network: "mainnet", |
106 |
| - modules: [wallet], |
| 47 | + network: "mainnet", |
| 48 | + modules: [wallet], |
107 | 49 | });
|
108 |
| -``` |
109 |
| - |
110 |
| -{% endcode %} |
111 |
| - |
112 | 50 |
|
| 51 | +``` |
113 | 52 |
|
114 | 53 |
|
115 | 54 | ## setupBitteWallet
|
116 | 55 |
|
| 56 | + - `network:` Near Networks |
117 | 57 |
|
| 58 | +- `walletUrl:` valid wallet urls |
118 | 59 |
|
119 |
| -- `networkId:` Near Networks |
120 |
| -- `walletUrl:` valid wallet urls |
121 |
| -- `successUrl:` If you dont have a single callback entrypoint to handle failure/success you can set successUrl. |
122 |
| -- `failureUrl:` If you dont have a single callback entrypoint to handle failure/success you can set failureUrl. |
123 |
| -- `callbackUrl:` when you have a single entrypoint to deal with transaction results. |
124 |
| -- `contractId`: the ContractId that your dapp will be using aka (receiverId) |
125 | 60 |
|
126 | 61 | ## Troubleshooting
|
127 | 62 |
|
128 | 63 | **Client-side only:**
|
| 64 | + |
129 | 65 | The wallet runs only on client-side.
|
130 | 66 |
|
131 | 67 | Any other questions or issues you can contact support on our [Telegram Channel](https://telegram.me/mintdev).
|
132 | 68 |
|
| 69 | + |
133 | 70 | ## License
|
134 | 71 |
|
135 |
| -This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). |
| 72 | +This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). |
0 commit comments