tek-wallet 0.0.753 → 0.0.755

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # TekWallet Documentation
2
2
 
3
- ## Cấu hình
3
+ ## 📋 Mục lục
4
+
5
+ - [Cấu hình](#cấu-hình)
6
+ - [Components](#components)
7
+ - [States](#states)
8
+ - [Methods](#methods)
9
+ - [Hướng dẫn sử dụng](#hướng-dẫn-sử-dụng)
10
+ - [Lưu ý](#lưu-ý)
11
+
12
+ ---
13
+
14
+ ## ⚙️ Cấu hình
4
15
 
5
16
  ### 1. Provider Setup
6
17
 
@@ -17,10 +28,6 @@ import { TekWalletProvider } from "tek-wallet";
17
28
  >
18
29
  <YourApp />
19
30
  </TekWalletProvider>;
20
-
21
- <TekWalletProvider isSSO accessToken={accessToken}>
22
- <YourApp />
23
- </TekWalletProvider>;
24
31
  ```
25
32
 
26
33
  ### 2. Environment Variables
@@ -36,7 +43,9 @@ NEXT_PUBLIC_TEK_WALLET_SERVER_URL=your_server_url
36
43
  NEXT_PUBLIC_TEK_WALLET_ABLY_API_KEY=your_ably_api_key
37
44
  ```
38
45
 
39
- ## Components
46
+ ---
47
+
48
+ ## 🧩 Components
40
49
 
41
50
  ### RequiredConnect
42
51
 
@@ -52,39 +61,73 @@ const { tokens } = useWallet();
52
61
  </RequiredConnect>;
53
62
  ```
54
63
 
55
- ### LockToken
64
+ ### Các Components Chính
56
65
 
57
- Component cho phép người dùng khóa token trong ví.
66
+ | Component | tả |
67
+ | --------------------- | ----------------------------------------- |
68
+ | **LockToken** | Cho phép người dùng khóa token trong ví |
69
+ | **SwapToken** | Hỗ trợ chức năng hoán đổi token |
70
+ | **UpdateLockedToken** | Cho phép cập nhật thông tin token đã khóa |
71
+ | **ReceiveFunction** | Xử lý chức năng nhận token |
72
+ | **AssetView** | Hiển thị tài sản trong ví |
73
+ | **WithdrawFunction** | Xử lý chức năng rút token |
58
74
 
59
- ### SwapToken
75
+ ### Components Xác nhận (Confirm)
60
76
 
61
- Component hỗ trợ chức năng hoán đổi token.
77
+ | Component | tả |
78
+ | ----------------------- | ---------------------------------------------------------------- |
79
+ | **ConfirmSwapToken** | Xử lý chức năng swap token bản đơn giản (khả năng custom cao) |
80
+ | **ConfirmSendExternal** | Xử lý chức năng rút token bản đơn giản (khả năng custom cao) |
81
+ | **ConfirmSendInternal** | Xử lý chức năng chuyển nội bộ bản đơn giản (khả năng custom cao) |
62
82
 
63
- ### UpdateLockedToken
83
+ ### Components View Đầy đủ
64
84
 
65
- Component cho phép cập nhật thông tin token đã khóa.
85
+ | Component | tả |
86
+ | -------------------- | ---------------------------------------------------------------------- |
87
+ | **SwapView** | Xử lý chức năng swap token bản đầy đủ, có validate, input amount... |
88
+ | **SendExternalView** | Xử lý chức năng rút token bản đầy đủ, có validate, input amount... |
89
+ | **SendInternalView** | Xử lý chức năng chuyển nội bộ bản đầy đủ, có validate, input amount... |
90
+ | **AssetView** | Quản lí asset người dùng |
66
91
 
67
- ### ReceiveFunction
92
+ ### TekWalletView
68
93
 
69
- Component xử chức năng nhận token.
94
+ Component như một app wallet mini (có router nội bộ)
70
95
 
71
- ### AssetView
96
+ **Sử dụng cơ bản:**
72
97
 
73
- Component hiển thị tài sản trong ví.
98
+ ```jsx
99
+ // page: "tek-wallet/[[...pathname]]/page.tsx"
100
+ "use client";
74
101
 
75
- ### WithdrawFunction
102
+ import { TekWalletView } from "tek-wallet";
76
103
 
77
- Component xử lý chức năng rút token.
104
+ function WalletPage() {
105
+ return <TekWalletView />;
106
+ }
78
107
 
79
- ### ConfirmSendExternal
108
+ export default WalletPage;
109
+ ```
80
110
 
81
- Component xử lý chức năng rút token bản đơn giản (khả năng custom cao).
111
+ **Với basePath:**
82
112
 
83
- ### ConfirmSendInternal
113
+ Nếu phía trước có path: `<path>/tek-wallet/[[...pathname]]/page.tsx` thì thêm basePath vào options:
84
114
 
85
- Component xử lý chức năng chuyển nội bộ bản đơn giản (khả năng custom cao).
115
+ ```jsx
116
+ <TekWalletProvider
117
+ isSSO
118
+ accessToken={accessToken}
119
+ options={{
120
+ useDefaultToastMessage: true,
121
+ basePath: <path>
122
+ }}
123
+ >
124
+ {props.children}
125
+ </TekWalletProvider>
126
+ ```
127
+
128
+ ---
86
129
 
87
- ## States
130
+ ## 📊 States
88
131
 
89
132
  ### Wallet States
90
133
 
@@ -116,7 +159,9 @@ Component xử lý chức năng chuyển nội bộ bản đơn giản (khả n
116
159
  | `fromTokens` | `Token[]` | Danh sách tokens có thể swap |
117
160
  | `transaction` | `Transaction` | Dữ liệu event realtime mới nhất (swap token, send token...) |
118
161
 
119
- ## Methods
162
+ ---
163
+
164
+ ## 🔧 Methods
120
165
 
121
166
  ### Wallet Management
122
167
 
@@ -148,18 +193,24 @@ Component xử lý chức năng chuyển nội bộ bản đơn giản (khả n
148
193
  | -------------------- | ---------------------- |
149
194
  | `pushNotification()` | Hiển thị toast message |
150
195
 
151
- ## Hướng dẫn sử dụng
196
+ ---
197
+
198
+ ## 🚀 Hướng dẫn sử dụng
152
199
 
153
200
  Để bắt đầu sử dụng TekWallet, hãy đảm bảo:
154
201
 
155
- 1. Đã cài đặt đầy đủ các dependencies cần thiết
156
- 2. Đã cấu hình đúng các biến môi trường
157
- 3. Đã wrap ứng dụng trong TekWalletProvider
158
- 4. Đã import các components cần thiết từ package
202
+ 1. Đã cài đặt đầy đủ các dependencies cần thiết
203
+ 2. Đã cấu hình đúng các biến môi trường
204
+ 3. Đã wrap ứng dụng trong TekWalletProvider
205
+ 4. Đã import các components cần thiết từ package
206
+
207
+ ---
208
+
209
+ ## ⚠️ Lưu ý
159
210
 
160
- ## Lưu ý
211
+ - 🔒 Đảm bảo luôn sử dụng `RequiredConnect` cho các hành động yêu cầu ví phải được kết nối
212
+ - 🔧 Các biến môi trường phải được cấu hình đúng để đảm bảo ứng dụng hoạt động chính xác
161
213
 
162
- - Đảm bảo luôn sử dụng RequiredConnect cho các hành động yêu cầu ví phải được kết nối
163
- - Các biến môi trường phải được cấu hình đúng để đảm bảo ứng dụng hoạt động chính xác
214
+ ---
164
215
 
165
216
  # tek-wallet
@@ -1,2 +1,2 @@
1
1
  export * from "./routes";
2
- export * from "./";
2
+ export * from "./index";
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./routes"), exports);
18
- __exportStar(require("./"), exports);
18
+ __exportStar(require("./index"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.753",
3
+ "version": "0.0.755",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",