@talken/talkenkit 2.3.4 → 2.3.6
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/dist/index.js +21 -27
- package/dist/wallets/walletConnectors/abcWallet/abcApi.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWallet.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/index.js +6 -6
- package/dist/wallets/walletConnectors/chunk-2J66VMY5.js +152 -0
- package/dist/wallets/walletConnectors/chunk-2J6LHJAF.js +228 -0
- package/dist/wallets/walletConnectors/chunk-2W6UBYKX.js +66 -0
- package/dist/wallets/walletConnectors/chunk-2ZPGPZCP.js +228 -0
- package/dist/wallets/walletConnectors/chunk-3DPCIDW6.js +1730 -0
- package/dist/wallets/walletConnectors/chunk-3IVTKZ7V.js +87 -0
- package/dist/wallets/walletConnectors/chunk-47TQ23J4.js +63 -0
- package/dist/wallets/walletConnectors/chunk-4HKJ53H3.js +1742 -0
- package/dist/wallets/walletConnectors/chunk-4T3UOJYR.js +76 -0
- package/dist/wallets/walletConnectors/chunk-53IBFGVW.js +102 -0
- package/dist/wallets/walletConnectors/chunk-5EARL7FN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-5NM2LK2G.js +95 -0
- package/dist/wallets/walletConnectors/chunk-66SCJ77O.js +63 -0
- package/dist/wallets/walletConnectors/chunk-6JKWIEGA.js +228 -0
- package/dist/wallets/walletConnectors/chunk-7L33BY4P.js +44 -0
- package/dist/wallets/walletConnectors/chunk-7SXCH5TL.js +1752 -0
- package/dist/wallets/walletConnectors/chunk-7UZBDZZZ.js +599 -0
- package/dist/wallets/walletConnectors/chunk-AKLKCDXT.js +186 -0
- package/dist/wallets/walletConnectors/chunk-ATQWOE4J.js +110 -0
- package/dist/wallets/walletConnectors/chunk-B6DM7J4N.js +71 -0
- package/dist/wallets/walletConnectors/chunk-BHMMHU7Y.js +228 -0
- package/dist/wallets/walletConnectors/chunk-BJYSWRV6.js +93 -0
- package/dist/wallets/walletConnectors/chunk-BRM4ZVXZ.js +44 -0
- package/dist/wallets/walletConnectors/chunk-BUDWZAL7.js +44 -0
- package/dist/wallets/walletConnectors/chunk-C7S72VGD.js +93 -0
- package/dist/wallets/walletConnectors/chunk-CSWWNAYR.js +44 -0
- package/dist/wallets/walletConnectors/chunk-CULIWWLV.js +101 -0
- package/dist/wallets/walletConnectors/chunk-D7U5WEH2.js +96 -0
- package/dist/wallets/walletConnectors/chunk-E4N7SPPU.js +39 -0
- package/dist/wallets/walletConnectors/chunk-ENU7XLF5.js +44 -0
- package/dist/wallets/walletConnectors/chunk-ESRU5KCF.js +151 -0
- package/dist/wallets/walletConnectors/chunk-FBI7UGNO.js +95 -0
- package/dist/wallets/walletConnectors/chunk-FF7ZIXKD.js +39 -0
- package/dist/wallets/walletConnectors/chunk-FJCL2YPU.js +1737 -0
- package/dist/wallets/walletConnectors/chunk-FSU3WBH3.js +63 -0
- package/dist/wallets/walletConnectors/chunk-G2IHR6PW.js +63 -0
- package/dist/wallets/walletConnectors/chunk-GILMNC3J.js +96 -0
- package/dist/wallets/walletConnectors/chunk-HDYBRMYW.js +194 -0
- package/dist/wallets/walletConnectors/chunk-HIZCIW5L.js +228 -0
- package/dist/wallets/walletConnectors/chunk-JBVBQUCS.js +73 -0
- package/dist/wallets/walletConnectors/chunk-JCMXNOQ5.js +63 -0
- package/dist/wallets/walletConnectors/chunk-JWO4ZQLK.js +98 -0
- package/dist/wallets/walletConnectors/chunk-K6GEK4JB.js +66 -0
- package/dist/wallets/walletConnectors/chunk-K6UZPSBG.js +94 -0
- package/dist/wallets/walletConnectors/chunk-KIQDE4N6.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KM55XFBI.js +65 -0
- package/dist/wallets/walletConnectors/chunk-KOT7JYJR.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KRAIITU7.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KZOSE2PI.js +228 -0
- package/dist/wallets/walletConnectors/chunk-L7I5I4CZ.js +44 -0
- package/dist/wallets/walletConnectors/chunk-LNZJLKFB.js +39 -0
- package/dist/wallets/walletConnectors/chunk-LTBQU2GW.js +63 -0
- package/dist/wallets/walletConnectors/chunk-LV765WZL.js +1748 -0
- package/dist/wallets/walletConnectors/chunk-MSI2BPP5.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-MX2IY5CD.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NLX2EV7O.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NVAZ3B3V.js +228 -0
- package/dist/wallets/walletConnectors/chunk-OEB7MRS5.js +39 -0
- package/dist/wallets/walletConnectors/chunk-OEWU3ZMN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-P2E4LSYH.js +1678 -0
- package/dist/wallets/walletConnectors/chunk-P2MTINFI.js +280 -0
- package/dist/wallets/walletConnectors/chunk-PNMSIVVT.js +44 -0
- package/dist/wallets/walletConnectors/chunk-PZNYT2HC.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-QZRNNI3E.js +39 -0
- package/dist/wallets/walletConnectors/chunk-R4UYVU5X.js +1721 -0
- package/dist/wallets/walletConnectors/chunk-R6JCHV55.js +39 -0
- package/dist/wallets/walletConnectors/chunk-RLBGBBIO.js +309 -0
- package/dist/wallets/walletConnectors/chunk-RSZS2RMC.js +44 -0
- package/dist/wallets/walletConnectors/chunk-S2PY4MDO.js +108 -0
- package/dist/wallets/walletConnectors/chunk-SCOX5RF4.js +91 -0
- package/dist/wallets/walletConnectors/chunk-TUUNSVKZ.js +345 -0
- package/dist/wallets/walletConnectors/chunk-U2CUEL35.js +240 -0
- package/dist/wallets/walletConnectors/chunk-V6NRLREB.js +44 -0
- package/dist/wallets/walletConnectors/chunk-V7E5KRXJ.js +103 -0
- package/dist/wallets/walletConnectors/chunk-VCBVYFLJ.js +63 -0
- package/dist/wallets/walletConnectors/chunk-VM7AEC7H.js +39 -0
- package/dist/wallets/walletConnectors/chunk-VPNKJ7PB.js +1674 -0
- package/dist/wallets/walletConnectors/chunk-W2VDZD74.js +478 -0
- package/dist/wallets/walletConnectors/chunk-WAO3KL5U.js +285 -0
- package/dist/wallets/walletConnectors/chunk-WPHTIILX.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WR7HSVMH.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSCJY2QD.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSLFMQIG.js +98 -0
- package/dist/wallets/walletConnectors/chunk-X3JQB5QL.js +44 -0
- package/dist/wallets/walletConnectors/chunk-X4CDP7L7.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XETOVXYM.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XYPR4BAF.js +436 -0
- package/dist/wallets/walletConnectors/chunk-YZBFKVTX.js +1675 -0
- package/dist/wallets/walletConnectors/chunk-Z2E65XSS.js +96 -0
- package/dist/wallets/walletConnectors/chunk-Z2ZRPTPX.js +1726 -0
- package/dist/wallets/walletConnectors/index.js +13 -13
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createAbcSolanaConnector
|
|
4
|
+
} from "./chunk-AEQOPQL6.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcSolanaProvider
|
|
7
|
+
} from "./chunk-MY5YIDOB.js";
|
|
8
|
+
import {
|
|
9
|
+
createAbcWaasClient
|
|
10
|
+
} from "./chunk-YZBFKVTX.js";
|
|
11
|
+
|
|
12
|
+
// src/wallets/walletConnectors/abcWallet/abcSolanaWallet.ts
|
|
13
|
+
var abcSolanaWallet = (options) => ({
|
|
14
|
+
id: "abc-solana",
|
|
15
|
+
name: "ABC Solana Wallet",
|
|
16
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
17
|
+
iconBackground: "#fff",
|
|
18
|
+
// Embedded wallet - no download URLs needed
|
|
19
|
+
installed: void 0,
|
|
20
|
+
createConnector: () => {
|
|
21
|
+
console.log("[abcSolanaWallet] Creating Solana connector with options:", {
|
|
22
|
+
hasConfig: !!options.config,
|
|
23
|
+
waasUrl: options.config.waasUrl,
|
|
24
|
+
environment: options.config.environment
|
|
25
|
+
});
|
|
26
|
+
const client = createAbcWaasClient(options.config);
|
|
27
|
+
const provider = createAbcSolanaProvider(client);
|
|
28
|
+
const connector = createAbcSolanaConnector({
|
|
29
|
+
client,
|
|
30
|
+
provider
|
|
31
|
+
});
|
|
32
|
+
console.log("[abcSolanaWallet] Solana connector created successfully");
|
|
33
|
+
return connector;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
abcSolanaWallet
|
|
39
|
+
};
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
BaseApiClient
|
|
4
|
+
} from "./chunk-WAO3KL5U.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcError
|
|
7
|
+
} from "./chunk-W2VDZD74.js";
|
|
8
|
+
import {
|
|
9
|
+
ABC_AUDIENCE,
|
|
10
|
+
ABC_ENDPOINTS
|
|
11
|
+
} from "./chunk-VETRBBA2.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/abcWallet/api/AuthApi.ts
|
|
14
|
+
var AuthApi = class extends BaseApiClient {
|
|
15
|
+
/**
|
|
16
|
+
* Login with email and password
|
|
17
|
+
*/
|
|
18
|
+
async loginWithEmail(email, password) {
|
|
19
|
+
const response = await this.request(
|
|
20
|
+
ABC_ENDPOINTS.SNS_LOGIN,
|
|
21
|
+
{
|
|
22
|
+
method: "POST",
|
|
23
|
+
body: {
|
|
24
|
+
email,
|
|
25
|
+
token: password,
|
|
26
|
+
service: "email",
|
|
27
|
+
audience: ABC_AUDIENCE
|
|
28
|
+
},
|
|
29
|
+
skipAuth: true
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
if (response.status === "success" && response.data) {
|
|
33
|
+
this.saveTokens(
|
|
34
|
+
response.data.accessToken,
|
|
35
|
+
response.data.refreshToken,
|
|
36
|
+
response.data.expiresIn
|
|
37
|
+
);
|
|
38
|
+
return response.data;
|
|
39
|
+
}
|
|
40
|
+
throw createAbcError(
|
|
41
|
+
"INVALID_CREDENTIALS" /* INVALID_CREDENTIALS */,
|
|
42
|
+
"Email login failed",
|
|
43
|
+
response
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Login with email and OTP (for PIN recovery)
|
|
48
|
+
*/
|
|
49
|
+
async loginWithOtp(email, otpCode) {
|
|
50
|
+
const response = await this.request(
|
|
51
|
+
ABC_ENDPOINTS.SNS_LOGIN,
|
|
52
|
+
{
|
|
53
|
+
method: "POST",
|
|
54
|
+
body: {
|
|
55
|
+
email,
|
|
56
|
+
token: otpCode,
|
|
57
|
+
service: "email",
|
|
58
|
+
audience: ABC_AUDIENCE
|
|
59
|
+
},
|
|
60
|
+
skipAuth: true
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
if (response.status === "success" && response.data) {
|
|
64
|
+
this.saveTokens(
|
|
65
|
+
response.data.accessToken,
|
|
66
|
+
response.data.refreshToken,
|
|
67
|
+
response.data.expiresIn
|
|
68
|
+
);
|
|
69
|
+
return response.data;
|
|
70
|
+
}
|
|
71
|
+
throw createAbcError(
|
|
72
|
+
"INVALID_CREDENTIALS" /* INVALID_CREDENTIALS */,
|
|
73
|
+
"OTP login failed",
|
|
74
|
+
response
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Login with social provider
|
|
79
|
+
*/
|
|
80
|
+
async loginWithSocial(provider, token, email) {
|
|
81
|
+
const response = await this.request(
|
|
82
|
+
ABC_ENDPOINTS.SNS_LOGIN,
|
|
83
|
+
{
|
|
84
|
+
method: "POST",
|
|
85
|
+
body: {
|
|
86
|
+
token,
|
|
87
|
+
service: provider,
|
|
88
|
+
audience: ABC_AUDIENCE,
|
|
89
|
+
email
|
|
90
|
+
},
|
|
91
|
+
skipAuth: true
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
if (response.status === "success" && response.data) {
|
|
95
|
+
this.saveTokens(
|
|
96
|
+
response.data.accessToken,
|
|
97
|
+
response.data.refreshToken,
|
|
98
|
+
response.data.expiresIn
|
|
99
|
+
);
|
|
100
|
+
return response.data;
|
|
101
|
+
}
|
|
102
|
+
throw createAbcError(
|
|
103
|
+
"INVALID_CREDENTIALS" /* INVALID_CREDENTIALS */,
|
|
104
|
+
"Social login failed",
|
|
105
|
+
response
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Request OTP code for email
|
|
110
|
+
*/
|
|
111
|
+
async requestOtpCode(email) {
|
|
112
|
+
const response = await this.request(
|
|
113
|
+
ABC_ENDPOINTS.SEND_OTP,
|
|
114
|
+
{
|
|
115
|
+
method: "POST",
|
|
116
|
+
body: { email },
|
|
117
|
+
skipAuth: true
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
if (response.status === "success" && response.data) {
|
|
121
|
+
return response.data;
|
|
122
|
+
}
|
|
123
|
+
throw createAbcError(
|
|
124
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
125
|
+
"Failed to request OTP",
|
|
126
|
+
response
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Verify OTP code
|
|
131
|
+
*/
|
|
132
|
+
async verifyOtpCode(email, code) {
|
|
133
|
+
const response = await this.request(ABC_ENDPOINTS.VERIFY_OTP, {
|
|
134
|
+
method: "POST",
|
|
135
|
+
body: { email, code },
|
|
136
|
+
skipAuth: true
|
|
137
|
+
});
|
|
138
|
+
return response.status === "success";
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Check if email already exists
|
|
142
|
+
*/
|
|
143
|
+
async emailCheck(_email) {
|
|
144
|
+
const _talkenApiUrl = process.env.NEXT_PUBLIC_API_SERVER || "https://dev.walletapi.talken.io";
|
|
145
|
+
const url = `${_talkenApiUrl}/abc/emailCheck?email=${encodeURIComponent(_email)}`;
|
|
146
|
+
try {
|
|
147
|
+
const response = await fetch(url, {
|
|
148
|
+
method: "GET",
|
|
149
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
150
|
+
});
|
|
151
|
+
const text = await response.text();
|
|
152
|
+
const data = text ? JSON.parse(text) : { status: "success" };
|
|
153
|
+
if (!response.ok) {
|
|
154
|
+
throw createAbcError(
|
|
155
|
+
"NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
156
|
+
"Email check failed",
|
|
157
|
+
data
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return data;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
throw createAbcError(
|
|
163
|
+
"NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
164
|
+
"Email check failed",
|
|
165
|
+
error
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Send OTP code to email for signup
|
|
171
|
+
*/
|
|
172
|
+
async sendOtpCode(_email) {
|
|
173
|
+
const endpoint = "/member/mail-service/${encodeURIComponent(email)}/sendcode";
|
|
174
|
+
const response = await this.request(endpoint, {
|
|
175
|
+
method: "GET",
|
|
176
|
+
skipAuth: true
|
|
177
|
+
});
|
|
178
|
+
if (response.status === "success") {
|
|
179
|
+
return response;
|
|
180
|
+
}
|
|
181
|
+
throw createAbcError(
|
|
182
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
183
|
+
"Failed to send OTP code",
|
|
184
|
+
response
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Verify OTP code for signup
|
|
189
|
+
*/
|
|
190
|
+
async verifyOtpCodeSignup(email, code) {
|
|
191
|
+
const endpoint = "/member/mail-service/${encodeURIComponent(email)}/verifycode";
|
|
192
|
+
const requestBody = {
|
|
193
|
+
email,
|
|
194
|
+
code,
|
|
195
|
+
serviceid: ABC_AUDIENCE
|
|
196
|
+
};
|
|
197
|
+
const response = await this.request(endpoint, {
|
|
198
|
+
method: "POST",
|
|
199
|
+
body: requestBody,
|
|
200
|
+
skipAuth: true
|
|
201
|
+
});
|
|
202
|
+
const isSuccess = response.status === "success" || response.status === 200 || response.message === "success";
|
|
203
|
+
if (isSuccess) {
|
|
204
|
+
return response;
|
|
205
|
+
}
|
|
206
|
+
throw createAbcError(
|
|
207
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
208
|
+
"Invalid or expired OTP code",
|
|
209
|
+
response
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Register new user
|
|
214
|
+
*/
|
|
215
|
+
async registerUser(params) {
|
|
216
|
+
const _talkenApiUrl = process.env.NEXT_PUBLIC_API_SERVER || "https://dev.walletapi.talken.io";
|
|
217
|
+
const url = "${talkenApiUrl}/abc/adduser";
|
|
218
|
+
try {
|
|
219
|
+
const response = await fetch(url, {
|
|
220
|
+
method: "POST",
|
|
221
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
222
|
+
credentials: "include",
|
|
223
|
+
body: new URLSearchParams(params).toString()
|
|
224
|
+
});
|
|
225
|
+
const text = await response.text();
|
|
226
|
+
const data = text ? JSON.parse(text) : { status: "success" };
|
|
227
|
+
if (!response.ok) {
|
|
228
|
+
throw createAbcError(
|
|
229
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
230
|
+
"User registration failed",
|
|
231
|
+
data
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
return data;
|
|
235
|
+
} catch (error) {
|
|
236
|
+
throw createAbcError(
|
|
237
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
238
|
+
"User registration failed",
|
|
239
|
+
error
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Register new SNS user (email-based registration with OTP)
|
|
245
|
+
*/
|
|
246
|
+
async registerSnsUser(params) {
|
|
247
|
+
const _talkenApiUrl = process.env.NEXT_PUBLIC_API_SERVER || "https://dev.walletapi.talken.io";
|
|
248
|
+
const url = "${talkenApiUrl}/abc/snsAdduser";
|
|
249
|
+
try {
|
|
250
|
+
const response = await fetch(url, {
|
|
251
|
+
method: "POST",
|
|
252
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
253
|
+
credentials: "include",
|
|
254
|
+
body: new URLSearchParams(params).toString()
|
|
255
|
+
});
|
|
256
|
+
const text = await response.text();
|
|
257
|
+
const data = text ? JSON.parse(text) : { status: "success" };
|
|
258
|
+
if (!response.ok) {
|
|
259
|
+
throw createAbcError(
|
|
260
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
261
|
+
"SNS user registration failed",
|
|
262
|
+
data
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
return data;
|
|
266
|
+
} catch (error) {
|
|
267
|
+
throw createAbcError(
|
|
268
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
269
|
+
"SNS user registration failed",
|
|
270
|
+
error
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Reset/Set password for existing user
|
|
276
|
+
*/
|
|
277
|
+
async resetPassword(params) {
|
|
278
|
+
const _talkenApiUrl = process.env.NEXT_PUBLIC_API_SERVER || "https://dev.walletapi.talken.io";
|
|
279
|
+
const url = "${talkenApiUrl}/abc/initpassword";
|
|
280
|
+
try {
|
|
281
|
+
const response = await fetch(url, {
|
|
282
|
+
method: "POST",
|
|
283
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
284
|
+
credentials: "include",
|
|
285
|
+
body: new URLSearchParams(params).toString()
|
|
286
|
+
});
|
|
287
|
+
const text = await response.text();
|
|
288
|
+
const data = text ? JSON.parse(text) : { status: "success" };
|
|
289
|
+
if (!response.ok) {
|
|
290
|
+
throw createAbcError(
|
|
291
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
292
|
+
"Password reset failed",
|
|
293
|
+
data
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
return data;
|
|
297
|
+
} catch (error) {
|
|
298
|
+
throw createAbcError(
|
|
299
|
+
"UNKNOWN_ERROR" /* UNKNOWN_ERROR */,
|
|
300
|
+
"Password reset failed",
|
|
301
|
+
error
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export {
|
|
308
|
+
AuthApi
|
|
309
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
abcConnector
|
|
4
|
+
} from "./chunk-BHMMHU7Y.js";
|
|
5
|
+
import {
|
|
6
|
+
ABC_WALLET_METADATA
|
|
7
|
+
} from "./chunk-VETRBBA2.js";
|
|
8
|
+
|
|
9
|
+
// src/wallets/walletConnectors/abcWallet/abcWallet.ts
|
|
10
|
+
var abcWallet = (specificOptions) => ({ projectId }) => {
|
|
11
|
+
const waasUrl = specificOptions?.waasUrl || process.env.NEXT_PUBLIC_ABC_WAAS_URL || process.env.VITE_ABC_WAAS_URL;
|
|
12
|
+
if (!waasUrl) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
'ABC WaaS URL is required. Please provide it via:\n1. abcWallet({ waasUrl: "..." }) options, or\n2. NEXT_PUBLIC_ABC_WAAS_URL environment variable, or\n3. VITE_ABC_WAAS_URL environment variable'
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const config = {
|
|
18
|
+
waasUrl,
|
|
19
|
+
apiKey: specificOptions?.apiKey,
|
|
20
|
+
plain: specificOptions?.plain || "",
|
|
21
|
+
// Deprecated - not used (secure.ts uses random generation)
|
|
22
|
+
environment: specificOptions?.environment || "development",
|
|
23
|
+
projectId
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
id: ABC_WALLET_METADATA.id,
|
|
27
|
+
name: ABC_WALLET_METADATA.name,
|
|
28
|
+
rdns: ABC_WALLET_METADATA.rdns,
|
|
29
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
30
|
+
iconBackground: ABC_WALLET_METADATA.iconBackground,
|
|
31
|
+
// Embedded wallet - no installation required
|
|
32
|
+
installed: void 0,
|
|
33
|
+
// No download URLs for embedded wallet
|
|
34
|
+
downloadUrls: void 0,
|
|
35
|
+
// Create connector - wrapper function required by Wallet type
|
|
36
|
+
createConnector: (_walletDetails) => abcConnector({ config }),
|
|
37
|
+
// Embedded wallet always available
|
|
38
|
+
hidden: () => false
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
abcWallet
|
|
44
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isMobile
|
|
4
|
+
} from "./chunk-RETKWSKD.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-MBBGZGXF.js";
|
|
9
|
+
import {
|
|
10
|
+
getWalletConnectConnector
|
|
11
|
+
} from "./chunk-PODFK4OS.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/trustWallet/trustWallet.ts
|
|
14
|
+
var trustWallet = ({
|
|
15
|
+
projectId,
|
|
16
|
+
walletConnectParameters
|
|
17
|
+
}) => {
|
|
18
|
+
const isTrustWalletInjected = isMobile() ? hasInjectedProvider({ flag: "isTrust" }) : hasInjectedProvider({ flag: "isTrustWallet" });
|
|
19
|
+
const shouldUseWalletConnect = !isTrustWalletInjected;
|
|
20
|
+
const getUriMobile = (uri) => {
|
|
21
|
+
return `trust://wc?uri=${encodeURIComponent(uri)}`;
|
|
22
|
+
};
|
|
23
|
+
const getUriQR = (uri) => {
|
|
24
|
+
return uri;
|
|
25
|
+
};
|
|
26
|
+
const mobileConnector = {
|
|
27
|
+
getUri: shouldUseWalletConnect ? getUriMobile : void 0
|
|
28
|
+
};
|
|
29
|
+
let qrConnector = void 0;
|
|
30
|
+
if (shouldUseWalletConnect) {
|
|
31
|
+
qrConnector = {
|
|
32
|
+
getUri: getUriQR,
|
|
33
|
+
instructions: {
|
|
34
|
+
learnMoreUrl: "https://trustwallet.com/",
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
description: "wallet_connectors.trust.qr_code.step1.description",
|
|
38
|
+
step: "install",
|
|
39
|
+
title: "wallet_connectors.trust.qr_code.step1.title"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: "wallet_connectors.trust.qr_code.step2.description",
|
|
43
|
+
step: "create",
|
|
44
|
+
title: "wallet_connectors.trust.qr_code.step2.title"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "wallet_connectors.trust.qr_code.step3.description",
|
|
48
|
+
step: "scan",
|
|
49
|
+
title: "wallet_connectors.trust.qr_code.step3.title"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const extensionConnector = {
|
|
56
|
+
instructions: {
|
|
57
|
+
learnMoreUrl: "https://trustwallet.com/browser-extension",
|
|
58
|
+
steps: [
|
|
59
|
+
{
|
|
60
|
+
description: "wallet_connectors.trust.extension.step1.description",
|
|
61
|
+
step: "install",
|
|
62
|
+
title: "wallet_connectors.trust.extension.step1.title"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
description: "wallet_connectors.trust.extension.step2.description",
|
|
66
|
+
step: "create",
|
|
67
|
+
title: "wallet_connectors.trust.extension.step2.title"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.trust.extension.step3.description",
|
|
71
|
+
step: "refresh",
|
|
72
|
+
title: "wallet_connectors.trust.extension.step3.title"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
id: "trust",
|
|
79
|
+
name: "Trust Wallet",
|
|
80
|
+
rdns: "com.trustwallet.app",
|
|
81
|
+
iconUrl: async () => (await import("./trustWallet-E2GVGE4U.js")).default,
|
|
82
|
+
// Note that we never resolve `installed` to `false` because the
|
|
83
|
+
// Trust Wallet provider falls back to other connection methods if
|
|
84
|
+
// the injected connector isn't available
|
|
85
|
+
installed: isTrustWalletInjected || void 0,
|
|
86
|
+
iconAccent: "#3375BB",
|
|
87
|
+
iconBackground: "#fff",
|
|
88
|
+
downloadUrls: {
|
|
89
|
+
android: "https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",
|
|
90
|
+
ios: "https://apps.apple.com/us/app/trust-crypto-bitcoin-wallet/id1288339409",
|
|
91
|
+
mobile: "https://trustwallet.com/download",
|
|
92
|
+
qrCode: "https://trustwallet.com/download",
|
|
93
|
+
chrome: "https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",
|
|
94
|
+
browserExtension: "https://trustwallet.com/browser-extension"
|
|
95
|
+
},
|
|
96
|
+
mobile: mobileConnector,
|
|
97
|
+
qrCode: qrConnector,
|
|
98
|
+
extension: extensionConnector,
|
|
99
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
100
|
+
projectId,
|
|
101
|
+
walletConnectParameters
|
|
102
|
+
}) : isMobile() ? getInjectedConnector({ flag: "isTrust" }) : getInjectedConnector({ flag: "isTrustWallet" })
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
trustWallet
|
|
108
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-MBBGZGXF.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-PODFK4OS.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/zealWallet/zealWallet.ts
|
|
11
|
+
var zealWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isZealWalletInjected = hasInjectedProvider({ flag: "isZeal" });
|
|
16
|
+
const shouldUseWalletConnect = !isZealWalletInjected;
|
|
17
|
+
return {
|
|
18
|
+
id: "zeal",
|
|
19
|
+
name: "Zeal",
|
|
20
|
+
rdns: "app.zeal",
|
|
21
|
+
iconUrl: async () => (await import("./zealWallet-URNQ2AWF.js")).default,
|
|
22
|
+
iconBackground: "#fff0",
|
|
23
|
+
iconAccent: "#00FFFF",
|
|
24
|
+
downloadUrls: {
|
|
25
|
+
browserExtension: "https://zeal.app",
|
|
26
|
+
chrome: "https://chromewebstore.google.com/detail/zeal-wallet/heamnjbnflcikcggoiplibfommfbkjpj",
|
|
27
|
+
android: "https://play.google.com/store/apps/details?id=app.zeal.wallet",
|
|
28
|
+
ios: "https://testflight.apple.com/join/MP72Ytw8",
|
|
29
|
+
mobile: "https://zeal.app",
|
|
30
|
+
qrCode: "https://zeal.app"
|
|
31
|
+
},
|
|
32
|
+
mobile: {
|
|
33
|
+
getUri: shouldUseWalletConnect ? (uri) => {
|
|
34
|
+
return `zeal://wc?uri=${encodeURIComponent(uri)}`;
|
|
35
|
+
} : void 0
|
|
36
|
+
},
|
|
37
|
+
qrCode: shouldUseWalletConnect ? {
|
|
38
|
+
getUri: (uri) => uri,
|
|
39
|
+
instructions: {
|
|
40
|
+
learnMoreUrl: "https://zeal.app",
|
|
41
|
+
steps: [
|
|
42
|
+
{
|
|
43
|
+
description: "wallet_connectors.zeal.qr_code.step1.description",
|
|
44
|
+
step: "install",
|
|
45
|
+
title: "wallet_connectors.zeal.qr_code.step1.title"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.zeal.qr_code.step2.description",
|
|
49
|
+
step: "create",
|
|
50
|
+
title: "wallet_connectors.zeal.qr_code.step2.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.zeal.qr_code.step3.description",
|
|
54
|
+
step: "scan",
|
|
55
|
+
title: "wallet_connectors.zeal.qr_code.step3.title"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
} : void 0,
|
|
60
|
+
extension: {
|
|
61
|
+
instructions: {
|
|
62
|
+
learnMoreUrl: "https://zeal.app",
|
|
63
|
+
steps: [
|
|
64
|
+
{
|
|
65
|
+
description: "wallet_connectors.zeal.extension.step1.description",
|
|
66
|
+
step: "install",
|
|
67
|
+
title: "wallet_connectors.zeal.extension.step1.title"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.zeal.extension.step2.description",
|
|
71
|
+
step: "create",
|
|
72
|
+
title: "wallet_connectors.zeal.extension.step2.title"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "wallet_connectors.zeal.extension.step3.description",
|
|
76
|
+
step: "refresh",
|
|
77
|
+
title: "wallet_connectors.zeal.extension.step3.title"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
83
|
+
projectId,
|
|
84
|
+
walletConnectParameters
|
|
85
|
+
}) : getInjectedConnector({ flag: "isZeal" })
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
zealWallet
|
|
91
|
+
};
|