@credenza3/partner-sdk 1.1.0-rc.1 → 1.1.0-rc.3
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.d.ts → index.d.mts} +1 -3
- package/package.json +3 -4
- package/dist/index.cjs +0 -1118
- package/dist/index.cjs.map +0 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Socket } from "socket.io-client";
|
|
2
2
|
|
|
3
|
-
//#region \0rolldown/runtime.js
|
|
4
|
-
//#endregion
|
|
5
3
|
//#region src/lib/credentials/credentials.types.d.ts
|
|
6
4
|
type TCredentials = {
|
|
7
5
|
clientId: string;
|
|
@@ -291,4 +289,4 @@ declare function useEnv(sdkEnv: TSdkEnv): void;
|
|
|
291
289
|
declare function useDebug(enableDebug: boolean): void;
|
|
292
290
|
//#endregion
|
|
293
291
|
export { SDK_ENV, index_d_exports as accounts, index_d_exports$1 as api, index_d_exports$2 as evm, index_d_exports$3 as sui, useAuth, useDebug, useEnv };
|
|
294
|
-
//# sourceMappingURL=index.d.
|
|
292
|
+
//# sourceMappingURL=index.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credenza3/partner-sdk",
|
|
3
|
-
"version": "1.1.0-rc.
|
|
3
|
+
"version": "1.1.0-rc.3",
|
|
4
4
|
"description": "Credenza partner sdk",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.
|
|
7
|
-
"
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.mts",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
11
10
|
"url": "https://github.com/credenza-web3/credenza-partner-sdk.git"
|
package/dist/index.cjs
DELETED
|
@@ -1,1118 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __exportAll = (all, no_symbols) => {
|
|
5
|
-
let target = {};
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: true
|
|
9
|
-
});
|
|
10
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
-
return target;
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
let buffer = require("buffer");
|
|
15
|
-
let socket_io_client = require("socket.io-client");
|
|
16
|
-
//#region src/lib/credentials/credentials.ts
|
|
17
|
-
let credentials = null;
|
|
18
|
-
function setCredentials(credentialsInput) {
|
|
19
|
-
if (!credentialsInput.clientId) throw new Error("\"clientId\" is required");
|
|
20
|
-
if (!credentialsInput.clientSecret) throw new Error("\"clientSecret\" is required");
|
|
21
|
-
credentials = credentialsInput;
|
|
22
|
-
}
|
|
23
|
-
function getCredentials() {
|
|
24
|
-
if (!(credentials === null || credentials === void 0 ? void 0 : credentials.clientId) || !(credentials === null || credentials === void 0 ? void 0 : credentials.clientSecret)) throw new Error("Credentials are not set");
|
|
25
|
-
return credentials;
|
|
26
|
-
}
|
|
27
|
-
function getBasicToken() {
|
|
28
|
-
const { clientId, clientSecret } = getCredentials();
|
|
29
|
-
const basicCredentials = `${clientId}:${clientSecret}`;
|
|
30
|
-
return `Basic ${buffer.Buffer.from(basicCredentials).toString("base64")}`;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/lib/sdk-env/sdk-env.constants.ts
|
|
34
|
-
const SDK_ENV = {
|
|
35
|
-
PROD: "prod",
|
|
36
|
-
STAGING: "staging",
|
|
37
|
-
LOCAL: "local"
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/lib/sdk-env/sdk-env.ts
|
|
41
|
-
let sdkEnv = SDK_ENV.PROD;
|
|
42
|
-
function getSdkEnv() {
|
|
43
|
-
return sdkEnv;
|
|
44
|
-
}
|
|
45
|
-
function setSdkEnv(sdkEnvironment) {
|
|
46
|
-
sdkEnv = sdkEnvironment;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/lib/logging/logging.ts
|
|
50
|
-
let debugEnabled = false;
|
|
51
|
-
function log(methodName, ...args) {
|
|
52
|
-
if (!debugEnabled) return;
|
|
53
|
-
console.log(`[CREDENZA_PARTNER_SDK#${methodName}]:`, ...args);
|
|
54
|
-
}
|
|
55
|
-
function enableSdkDebug(enableDebug) {
|
|
56
|
-
debugEnabled = enableDebug;
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/accounts/accounts.ts
|
|
60
|
-
function getOAuthApiUrl() {
|
|
61
|
-
switch (getSdkEnv()) {
|
|
62
|
-
case SDK_ENV.PROD: return "https://accounts.credenza3.com";
|
|
63
|
-
case SDK_ENV.STAGING: return "https://accounts.staging.credenza3.com";
|
|
64
|
-
case SDK_ENV.LOCAL: return "http://localhost:8081";
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/lib/obj/obj.ts
|
|
69
|
-
function toCamelCase(obj) {
|
|
70
|
-
if (Array.isArray(obj)) return obj.map(toCamelCase);
|
|
71
|
-
else if (obj !== null && typeof obj === "object") return Object.keys(obj).reduce((acc, key) => {
|
|
72
|
-
const camelKey = key.replace(/^_id$/, "id").replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
73
|
-
acc[camelKey] = toCamelCase(obj[key]);
|
|
74
|
-
return acc;
|
|
75
|
-
}, {});
|
|
76
|
-
return obj;
|
|
77
|
-
}
|
|
78
|
-
function toSnakeCase(obj) {
|
|
79
|
-
if (Array.isArray(obj)) return obj.map(toSnakeCase);
|
|
80
|
-
else if (obj !== null && typeof obj === "object") return Object.keys(obj).reduce((acc, key) => {
|
|
81
|
-
const snakeKey = key.replace(/([A-Z])/g, (_, letter) => `_${letter.toLowerCase()}`);
|
|
82
|
-
acc[snakeKey] = toSnakeCase(obj[key]);
|
|
83
|
-
return acc;
|
|
84
|
-
}, {});
|
|
85
|
-
return obj;
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/asyncToGenerator.js
|
|
89
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
90
|
-
try {
|
|
91
|
-
var i = n[a](c), u = i.value;
|
|
92
|
-
} catch (n) {
|
|
93
|
-
e(n);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
97
|
-
}
|
|
98
|
-
function _asyncToGenerator(n) {
|
|
99
|
-
return function() {
|
|
100
|
-
var t = this, e = arguments;
|
|
101
|
-
return new Promise(function(r, o) {
|
|
102
|
-
var a = n.apply(t, e);
|
|
103
|
-
function _next(n) {
|
|
104
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
105
|
-
}
|
|
106
|
-
function _throw(n) {
|
|
107
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
108
|
-
}
|
|
109
|
-
_next(void 0);
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/accounts/user/user.ts
|
|
115
|
-
function getAccountInfo(_x) {
|
|
116
|
-
return _getAccountInfo.apply(this, arguments);
|
|
117
|
-
}
|
|
118
|
-
function _getAccountInfo() {
|
|
119
|
-
_getAccountInfo = _asyncToGenerator(function* (sub) {
|
|
120
|
-
const response = yield fetch(`${getOAuthApiUrl()}/accounts/${sub}`, { headers: {
|
|
121
|
-
Authorization: getBasicToken(),
|
|
122
|
-
"Content-Type": "application/json"
|
|
123
|
-
} });
|
|
124
|
-
const json = yield response.json();
|
|
125
|
-
log(getAccountInfo.name, json);
|
|
126
|
-
if (!response.ok) throw new Error(json.message);
|
|
127
|
-
return toCamelCase(json);
|
|
128
|
-
});
|
|
129
|
-
return _getAccountInfo.apply(this, arguments);
|
|
130
|
-
}
|
|
131
|
-
function getAccountInfoByContact(_x2) {
|
|
132
|
-
return _getAccountInfoByContact.apply(this, arguments);
|
|
133
|
-
}
|
|
134
|
-
function _getAccountInfoByContact() {
|
|
135
|
-
_getAccountInfoByContact = _asyncToGenerator(function* (args) {
|
|
136
|
-
const url = new URL(`${getOAuthApiUrl()}/accounts/info`);
|
|
137
|
-
if (args.email) url.searchParams.set("email", args.email);
|
|
138
|
-
if (args.phone) url.searchParams.set("phone", args.phone);
|
|
139
|
-
const response = yield fetch(url.toString(), { headers: {
|
|
140
|
-
Authorization: getBasicToken(),
|
|
141
|
-
"Content-Type": "application/json"
|
|
142
|
-
} });
|
|
143
|
-
const json = yield response.json();
|
|
144
|
-
log(getAccountInfoByContact.name, json);
|
|
145
|
-
if (!response.ok) throw new Error(json.message);
|
|
146
|
-
return toCamelCase(json);
|
|
147
|
-
});
|
|
148
|
-
return _getAccountInfoByContact.apply(this, arguments);
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/accounts/user/index.ts
|
|
152
|
-
var user_exports = /* @__PURE__ */ __exportAll({
|
|
153
|
-
getAccountInfo: () => getAccountInfo,
|
|
154
|
-
getAccountInfoByContact: () => getAccountInfoByContact
|
|
155
|
-
});
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/accounts/client/client.ts
|
|
158
|
-
function getCurrentClientInfo() {
|
|
159
|
-
return _getCurrentClientInfo.apply(this, arguments);
|
|
160
|
-
}
|
|
161
|
-
function _getCurrentClientInfo() {
|
|
162
|
-
_getCurrentClientInfo = _asyncToGenerator(function* () {
|
|
163
|
-
var _json$logo_uri;
|
|
164
|
-
const response = yield fetch(`${getOAuthApiUrl()}/clients/current`, { headers: {
|
|
165
|
-
Authorization: getBasicToken(),
|
|
166
|
-
"Content-Type": "application/json"
|
|
167
|
-
} });
|
|
168
|
-
const json = yield response.json();
|
|
169
|
-
log(getCurrentClientInfo.name, json);
|
|
170
|
-
if (!response.ok) throw new Error(json.message);
|
|
171
|
-
return {
|
|
172
|
-
id: json._id,
|
|
173
|
-
name: json.name,
|
|
174
|
-
callbackUris: json.callback_uris,
|
|
175
|
-
confidential: json.confidential,
|
|
176
|
-
ownerId: json.owner_id,
|
|
177
|
-
accessTokenTTLMinutes: json.access_token_ttl_minutes,
|
|
178
|
-
availableLoginTypes: json.available_login_types,
|
|
179
|
-
admins: json.admins,
|
|
180
|
-
apiPermissions: json.api_permissions,
|
|
181
|
-
logoUri: (_json$logo_uri = json.logo_uri) !== null && _json$logo_uri !== void 0 ? _json$logo_uri : null
|
|
182
|
-
};
|
|
183
|
-
});
|
|
184
|
-
return _getCurrentClientInfo.apply(this, arguments);
|
|
185
|
-
}
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/accounts/client/jwt-auth/jwt-auth.ts
|
|
188
|
-
function addJwtValidator(_x) {
|
|
189
|
-
return _addJwtValidator.apply(this, arguments);
|
|
190
|
-
}
|
|
191
|
-
function _addJwtValidator() {
|
|
192
|
-
_addJwtValidator = _asyncToGenerator(function* (params) {
|
|
193
|
-
const response = yield fetch(`${getOAuthApiUrl()}/clients/jwt-auth`, {
|
|
194
|
-
method: "POST",
|
|
195
|
-
headers: {
|
|
196
|
-
Authorization: getBasicToken(),
|
|
197
|
-
"Content-Type": "application/json"
|
|
198
|
-
},
|
|
199
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
200
|
-
});
|
|
201
|
-
const json = yield response.json();
|
|
202
|
-
log(addJwtValidator.name, json);
|
|
203
|
-
if (!response.ok) throw new Error(json.message);
|
|
204
|
-
return toCamelCase(json);
|
|
205
|
-
});
|
|
206
|
-
return _addJwtValidator.apply(this, arguments);
|
|
207
|
-
}
|
|
208
|
-
function updateJwtValidator(_x2, _x3) {
|
|
209
|
-
return _updateJwtValidator.apply(this, arguments);
|
|
210
|
-
}
|
|
211
|
-
function _updateJwtValidator() {
|
|
212
|
-
_updateJwtValidator = _asyncToGenerator(function* (id, params) {
|
|
213
|
-
const response = yield fetch(`${getOAuthApiUrl()}/clients/jwt-auth/${id}`, {
|
|
214
|
-
method: "PATCH",
|
|
215
|
-
headers: {
|
|
216
|
-
Authorization: getBasicToken(),
|
|
217
|
-
"Content-Type": "application/json"
|
|
218
|
-
},
|
|
219
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
220
|
-
});
|
|
221
|
-
const json = yield response.json();
|
|
222
|
-
log(updateJwtValidator.name, json);
|
|
223
|
-
if (!response.ok) throw new Error(json.message);
|
|
224
|
-
return toCamelCase(json);
|
|
225
|
-
});
|
|
226
|
-
return _updateJwtValidator.apply(this, arguments);
|
|
227
|
-
}
|
|
228
|
-
function removeJwtValidator(_x4) {
|
|
229
|
-
return _removeJwtValidator.apply(this, arguments);
|
|
230
|
-
}
|
|
231
|
-
function _removeJwtValidator() {
|
|
232
|
-
_removeJwtValidator = _asyncToGenerator(function* (id) {
|
|
233
|
-
const response = yield fetch(`${getOAuthApiUrl()}/clients/jwt-auth/${id}`, {
|
|
234
|
-
method: "DELETE",
|
|
235
|
-
headers: {
|
|
236
|
-
Authorization: getBasicToken(),
|
|
237
|
-
"Content-Type": "application/json"
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
const json = yield response.json();
|
|
241
|
-
log(removeJwtValidator.name, json);
|
|
242
|
-
if (!response.ok) throw new Error(json.message);
|
|
243
|
-
return json;
|
|
244
|
-
});
|
|
245
|
-
return _removeJwtValidator.apply(this, arguments);
|
|
246
|
-
}
|
|
247
|
-
function getJwtValidators() {
|
|
248
|
-
return _getJwtValidators.apply(this, arguments);
|
|
249
|
-
}
|
|
250
|
-
function _getJwtValidators() {
|
|
251
|
-
_getJwtValidators = _asyncToGenerator(function* () {
|
|
252
|
-
const response = yield fetch(`${getOAuthApiUrl()}/clients/jwt-auth`, { headers: {
|
|
253
|
-
Authorization: getBasicToken(),
|
|
254
|
-
"Content-Type": "application/json"
|
|
255
|
-
} });
|
|
256
|
-
const json = yield response.json();
|
|
257
|
-
log(getJwtValidators.name, json);
|
|
258
|
-
if (!response.ok) throw new Error(json.message);
|
|
259
|
-
return toCamelCase(json);
|
|
260
|
-
});
|
|
261
|
-
return _getJwtValidators.apply(this, arguments);
|
|
262
|
-
}
|
|
263
|
-
//#endregion
|
|
264
|
-
//#region src/accounts/client/jwt-auth/index.ts
|
|
265
|
-
var jwt_auth_exports = /* @__PURE__ */ __exportAll({
|
|
266
|
-
addJwtValidator: () => addJwtValidator,
|
|
267
|
-
getJwtValidators: () => getJwtValidators,
|
|
268
|
-
removeJwtValidator: () => removeJwtValidator,
|
|
269
|
-
updateJwtValidator: () => updateJwtValidator
|
|
270
|
-
});
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region src/accounts/client/index.ts
|
|
273
|
-
var client_exports = /* @__PURE__ */ __exportAll({
|
|
274
|
-
getCurrentClientInfo: () => getCurrentClientInfo,
|
|
275
|
-
jwtAuth: () => jwt_auth_exports
|
|
276
|
-
});
|
|
277
|
-
//#endregion
|
|
278
|
-
//#region src/accounts/oauth/oauth.ts
|
|
279
|
-
function exchangeCodeForToken(_x) {
|
|
280
|
-
return _exchangeCodeForToken.apply(this, arguments);
|
|
281
|
-
}
|
|
282
|
-
function _exchangeCodeForToken() {
|
|
283
|
-
_exchangeCodeForToken = _asyncToGenerator(function* (params) {
|
|
284
|
-
const response = yield fetch(`${getOAuthApiUrl()}/oauth2/token`, {
|
|
285
|
-
method: "POST",
|
|
286
|
-
headers: {
|
|
287
|
-
Authorization: getBasicToken(),
|
|
288
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
289
|
-
},
|
|
290
|
-
body: new URLSearchParams({
|
|
291
|
-
grant_type: "authorization_code",
|
|
292
|
-
code: params.code,
|
|
293
|
-
code_verifier: params.codeVerifier,
|
|
294
|
-
redirect_uri: params.redirectUri || "none"
|
|
295
|
-
})
|
|
296
|
-
});
|
|
297
|
-
const json = yield response.json();
|
|
298
|
-
log(exchangeCodeForToken.name, json);
|
|
299
|
-
if (!response.ok) throw new Error(json.message);
|
|
300
|
-
return toCamelCase(json);
|
|
301
|
-
});
|
|
302
|
-
return _exchangeCodeForToken.apply(this, arguments);
|
|
303
|
-
}
|
|
304
|
-
function refreshToken(_x2) {
|
|
305
|
-
return _refreshToken.apply(this, arguments);
|
|
306
|
-
}
|
|
307
|
-
function _refreshToken() {
|
|
308
|
-
_refreshToken = _asyncToGenerator(function* (refreshTokenValue) {
|
|
309
|
-
const response = yield fetch(`${getOAuthApiUrl()}/oauth2/token`, {
|
|
310
|
-
method: "POST",
|
|
311
|
-
headers: {
|
|
312
|
-
Authorization: getBasicToken(),
|
|
313
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
314
|
-
},
|
|
315
|
-
body: new URLSearchParams({
|
|
316
|
-
grant_type: "refresh_token",
|
|
317
|
-
refresh_token: refreshTokenValue
|
|
318
|
-
})
|
|
319
|
-
});
|
|
320
|
-
const json = yield response.json();
|
|
321
|
-
log(refreshToken.name, json);
|
|
322
|
-
if (!response.ok) throw new Error(json.message);
|
|
323
|
-
return toCamelCase(json);
|
|
324
|
-
});
|
|
325
|
-
return _refreshToken.apply(this, arguments);
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
|
-
//#region src/accounts/oauth/index.ts
|
|
329
|
-
var oauth_exports = /* @__PURE__ */ __exportAll({
|
|
330
|
-
exchangeCodeForToken: () => exchangeCodeForToken,
|
|
331
|
-
refreshToken: () => refreshToken
|
|
332
|
-
});
|
|
333
|
-
//#endregion
|
|
334
|
-
//#region src/accounts/index.ts
|
|
335
|
-
var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
336
|
-
client: () => client_exports,
|
|
337
|
-
getOAuthApiUrl: () => getOAuthApiUrl,
|
|
338
|
-
oauth: () => oauth_exports,
|
|
339
|
-
user: () => user_exports
|
|
340
|
-
});
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region src/lib/ws/ws.ts
|
|
343
|
-
const socketPromises = /* @__PURE__ */ new Map();
|
|
344
|
-
function disconnectWs(_x) {
|
|
345
|
-
return _disconnectWs.apply(this, arguments);
|
|
346
|
-
}
|
|
347
|
-
function _disconnectWs() {
|
|
348
|
-
_disconnectWs = _asyncToGenerator(function* (url) {
|
|
349
|
-
const socketUrls = url ? [url] : Array.from(socketPromises.keys());
|
|
350
|
-
for (const url of socketUrls) {
|
|
351
|
-
if (!socketPromises.has(url)) continue;
|
|
352
|
-
const { socket } = yield socketPromises.get(url);
|
|
353
|
-
socket === null || socket === void 0 || socket.disconnect();
|
|
354
|
-
socketPromises.delete(url);
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
return _disconnectWs.apply(this, arguments);
|
|
358
|
-
}
|
|
359
|
-
function connectToWs(_x2) {
|
|
360
|
-
return _connectToWs.apply(this, arguments);
|
|
361
|
-
}
|
|
362
|
-
function _connectToWs() {
|
|
363
|
-
_connectToWs = _asyncToGenerator(function* (url) {
|
|
364
|
-
const credentials = getCredentials();
|
|
365
|
-
if (!socketPromises.has(url)) {
|
|
366
|
-
const promise = new Promise((resolve, reject) => {
|
|
367
|
-
const socket = (0, socket_io_client.io)(url, { auth: {
|
|
368
|
-
client_id: credentials.clientId,
|
|
369
|
-
client_secret: credentials.clientSecret
|
|
370
|
-
} });
|
|
371
|
-
socket.once("connect_error", (err) => reject(err));
|
|
372
|
-
socket.once("connect", () => resolve({
|
|
373
|
-
socket,
|
|
374
|
-
auth: credentials
|
|
375
|
-
}));
|
|
376
|
-
setTimeout(() => reject(/* @__PURE__ */ new Error("Cannot connect to websocket server")), 5e3);
|
|
377
|
-
});
|
|
378
|
-
socketPromises.set(url, promise);
|
|
379
|
-
}
|
|
380
|
-
const { socket, auth } = yield socketPromises.get(url);
|
|
381
|
-
if (!(socket === null || socket === void 0 ? void 0 : socket.connected) || auth.clientId !== credentials.clientId || auth.clientSecret !== credentials.clientSecret) {
|
|
382
|
-
yield disconnectWs(url);
|
|
383
|
-
return connectToWs(url);
|
|
384
|
-
}
|
|
385
|
-
return socket;
|
|
386
|
-
});
|
|
387
|
-
return _connectToWs.apply(this, arguments);
|
|
388
|
-
}
|
|
389
|
-
//#endregion
|
|
390
|
-
//#region src/api/api.ts
|
|
391
|
-
let socket$1;
|
|
392
|
-
function getGeneralApiUrl() {
|
|
393
|
-
switch (getSdkEnv()) {
|
|
394
|
-
case SDK_ENV.PROD: return "https://api.credenza3.com";
|
|
395
|
-
case SDK_ENV.STAGING: return "https://api.staging.credenza3.com";
|
|
396
|
-
case SDK_ENV.LOCAL: return "http://localhost:8084";
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
function getGeneralWsUrl() {
|
|
400
|
-
switch (getSdkEnv()) {
|
|
401
|
-
case SDK_ENV.PROD: return "wss://general-prod-prod.up.railway.app";
|
|
402
|
-
case SDK_ENV.STAGING: return "wss://general-staging-staging.up.railway.app";
|
|
403
|
-
case SDK_ENV.LOCAL: return "ws://localhost:8084";
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function getWsConnection$1() {
|
|
407
|
-
return _getWsConnection$1.apply(this, arguments);
|
|
408
|
-
}
|
|
409
|
-
function _getWsConnection$1() {
|
|
410
|
-
_getWsConnection$1 = _asyncToGenerator(function* () {
|
|
411
|
-
if (!(socket$1 === null || socket$1 === void 0 ? void 0 : socket$1.connected)) socket$1 = yield connectToWs(getGeneralWsUrl());
|
|
412
|
-
return socket$1;
|
|
413
|
-
});
|
|
414
|
-
return _getWsConnection$1.apply(this, arguments);
|
|
415
|
-
}
|
|
416
|
-
//#endregion
|
|
417
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
|
|
418
|
-
function _typeof(o) {
|
|
419
|
-
"@babel/helpers - typeof";
|
|
420
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
421
|
-
return typeof o;
|
|
422
|
-
} : function(o) {
|
|
423
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
424
|
-
}, _typeof(o);
|
|
425
|
-
}
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
428
|
-
function toPrimitive(t, r) {
|
|
429
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
430
|
-
var e = t[Symbol.toPrimitive];
|
|
431
|
-
if (void 0 !== e) {
|
|
432
|
-
var i = e.call(t, r || "default");
|
|
433
|
-
if ("object" != _typeof(i)) return i;
|
|
434
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
435
|
-
}
|
|
436
|
-
return ("string" === r ? String : Number)(t);
|
|
437
|
-
}
|
|
438
|
-
//#endregion
|
|
439
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
440
|
-
function toPropertyKey(t) {
|
|
441
|
-
var i = toPrimitive(t, "string");
|
|
442
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
443
|
-
}
|
|
444
|
-
//#endregion
|
|
445
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
446
|
-
function _defineProperty(e, r, t) {
|
|
447
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
448
|
-
value: t,
|
|
449
|
-
enumerable: !0,
|
|
450
|
-
configurable: !0,
|
|
451
|
-
writable: !0
|
|
452
|
-
}) : e[r] = t, e;
|
|
453
|
-
}
|
|
454
|
-
//#endregion
|
|
455
|
-
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/objectSpread2.js
|
|
456
|
-
function ownKeys(e, r) {
|
|
457
|
-
var t = Object.keys(e);
|
|
458
|
-
if (Object.getOwnPropertySymbols) {
|
|
459
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
460
|
-
r && (o = o.filter(function(r) {
|
|
461
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
462
|
-
})), t.push.apply(t, o);
|
|
463
|
-
}
|
|
464
|
-
return t;
|
|
465
|
-
}
|
|
466
|
-
function _objectSpread2(e) {
|
|
467
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
468
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
469
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
470
|
-
_defineProperty(e, r, t[r]);
|
|
471
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
472
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
return e;
|
|
476
|
-
}
|
|
477
|
-
//#endregion
|
|
478
|
-
//#region src/api/nfc-id/nfc-id.ts
|
|
479
|
-
function addNfcId(_x) {
|
|
480
|
-
return _addNfcId.apply(this, arguments);
|
|
481
|
-
}
|
|
482
|
-
function _addNfcId() {
|
|
483
|
-
_addNfcId = _asyncToGenerator(function* (params) {
|
|
484
|
-
var _json$text;
|
|
485
|
-
const response = yield fetch(`${getGeneralApiUrl()}/nfc-id`, {
|
|
486
|
-
method: "POST",
|
|
487
|
-
headers: {
|
|
488
|
-
Authorization: getBasicToken(),
|
|
489
|
-
"Content-Type": "application/json"
|
|
490
|
-
},
|
|
491
|
-
body: JSON.stringify(_objectSpread2({
|
|
492
|
-
serial_number: params.serialNumber,
|
|
493
|
-
sub: params.sub
|
|
494
|
-
}, params.text ? { text: params.text } : {}))
|
|
495
|
-
});
|
|
496
|
-
const json = yield response.json();
|
|
497
|
-
log(addNfcId.name, json);
|
|
498
|
-
if (!response.ok) throw new Error(json.message);
|
|
499
|
-
return {
|
|
500
|
-
sub: json.sub,
|
|
501
|
-
serialNumber: json.serial_number,
|
|
502
|
-
text: (_json$text = json.text) !== null && _json$text !== void 0 ? _json$text : null
|
|
503
|
-
};
|
|
504
|
-
});
|
|
505
|
-
return _addNfcId.apply(this, arguments);
|
|
506
|
-
}
|
|
507
|
-
function updateNfcId(_x2, _x3) {
|
|
508
|
-
return _updateNfcId.apply(this, arguments);
|
|
509
|
-
}
|
|
510
|
-
function _updateNfcId() {
|
|
511
|
-
_updateNfcId = _asyncToGenerator(function* (serialNumber, params) {
|
|
512
|
-
const json = yield (yield fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, {
|
|
513
|
-
method: "PATCH",
|
|
514
|
-
headers: {
|
|
515
|
-
Authorization: getBasicToken(),
|
|
516
|
-
"Content-Type": "application/json"
|
|
517
|
-
},
|
|
518
|
-
body: JSON.stringify(_objectSpread2(_objectSpread2({}, params.text ? { text: params.text } : {}), params.sub ? { sub: params.sub } : {}))
|
|
519
|
-
})).json();
|
|
520
|
-
log(updateNfcId.name, json);
|
|
521
|
-
return json;
|
|
522
|
-
});
|
|
523
|
-
return _updateNfcId.apply(this, arguments);
|
|
524
|
-
}
|
|
525
|
-
function removeNfcId(_x4) {
|
|
526
|
-
return _removeNfcId.apply(this, arguments);
|
|
527
|
-
}
|
|
528
|
-
function _removeNfcId() {
|
|
529
|
-
_removeNfcId = _asyncToGenerator(function* (serialNumber) {
|
|
530
|
-
const json = yield (yield fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, {
|
|
531
|
-
method: "DELETE",
|
|
532
|
-
headers: {
|
|
533
|
-
Authorization: getBasicToken(),
|
|
534
|
-
"Content-Type": "application/json"
|
|
535
|
-
}
|
|
536
|
-
})).json();
|
|
537
|
-
log(removeNfcId.name, json);
|
|
538
|
-
return json;
|
|
539
|
-
});
|
|
540
|
-
return _removeNfcId.apply(this, arguments);
|
|
541
|
-
}
|
|
542
|
-
function getNfcId(_x5) {
|
|
543
|
-
return _getNfcId.apply(this, arguments);
|
|
544
|
-
}
|
|
545
|
-
function _getNfcId() {
|
|
546
|
-
_getNfcId = _asyncToGenerator(function* (serialNumber) {
|
|
547
|
-
var _json$text2;
|
|
548
|
-
const json = yield (yield fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, { headers: {
|
|
549
|
-
Authorization: getBasicToken(),
|
|
550
|
-
"Content-Type": "application/json"
|
|
551
|
-
} })).json();
|
|
552
|
-
log(getNfcId.name, json);
|
|
553
|
-
return {
|
|
554
|
-
sub: json.sub,
|
|
555
|
-
text: (_json$text2 = json.text) !== null && _json$text2 !== void 0 ? _json$text2 : null
|
|
556
|
-
};
|
|
557
|
-
});
|
|
558
|
-
return _getNfcId.apply(this, arguments);
|
|
559
|
-
}
|
|
560
|
-
//#endregion
|
|
561
|
-
//#region src/api/nfc-id/index.ts
|
|
562
|
-
var nfc_id_exports = /* @__PURE__ */ __exportAll({
|
|
563
|
-
addNfcId: () => addNfcId,
|
|
564
|
-
getNfcId: () => getNfcId,
|
|
565
|
-
removeNfcId: () => removeNfcId,
|
|
566
|
-
updateNfcId: () => updateNfcId
|
|
567
|
-
});
|
|
568
|
-
//#endregion
|
|
569
|
-
//#region src/api/passport-id/passport-id.ts
|
|
570
|
-
function requestPassportIdSignature(_x, _x2) {
|
|
571
|
-
return _requestPassportIdSignature.apply(this, arguments);
|
|
572
|
-
}
|
|
573
|
-
function _requestPassportIdSignature() {
|
|
574
|
-
_requestPassportIdSignature = _asyncToGenerator(function* (sub, message) {
|
|
575
|
-
if (!sub) throw new Error("\"Sub is required\"");
|
|
576
|
-
if (!message) throw new Error("\"Message is required\"");
|
|
577
|
-
const socket = yield getWsConnection$1();
|
|
578
|
-
return new Promise((resolve, reject) => {
|
|
579
|
-
socket.once(`passport_id/signed/${sub}`, (data) => {
|
|
580
|
-
log(requestPassportIdSignature.name, "Received", data);
|
|
581
|
-
resolve(data.payload);
|
|
582
|
-
});
|
|
583
|
-
socket.emit("passport_id/request_signature", { payload: {
|
|
584
|
-
sub,
|
|
585
|
-
message
|
|
586
|
-
} }, (data) => {
|
|
587
|
-
if (!data.payload.ok) reject(/* @__PURE__ */ new Error("Failed to sign message"));
|
|
588
|
-
if (data.error) reject(new Error(data.error.message));
|
|
589
|
-
log(requestPassportIdSignature.name, "Requested", data);
|
|
590
|
-
});
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
return _requestPassportIdSignature.apply(this, arguments);
|
|
594
|
-
}
|
|
595
|
-
//#endregion
|
|
596
|
-
//#region src/api/passport-id/index.ts
|
|
597
|
-
var passport_id_exports = /* @__PURE__ */ __exportAll({ requestPassportIdSignature: () => requestPassportIdSignature });
|
|
598
|
-
//#endregion
|
|
599
|
-
//#region src/api/promo/rules/rules.ts
|
|
600
|
-
function addPromoRule(_x) {
|
|
601
|
-
return _addPromoRule.apply(this, arguments);
|
|
602
|
-
}
|
|
603
|
-
function _addPromoRule() {
|
|
604
|
-
_addPromoRule = _asyncToGenerator(function* (params) {
|
|
605
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/rules`, {
|
|
606
|
-
method: "POST",
|
|
607
|
-
headers: {
|
|
608
|
-
Authorization: getBasicToken(),
|
|
609
|
-
"Content-Type": "application/json"
|
|
610
|
-
},
|
|
611
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
612
|
-
});
|
|
613
|
-
const json = yield response.json();
|
|
614
|
-
log(addPromoRule.name, json);
|
|
615
|
-
if (!response.ok) throw new Error(json.message);
|
|
616
|
-
return toCamelCase(json);
|
|
617
|
-
});
|
|
618
|
-
return _addPromoRule.apply(this, arguments);
|
|
619
|
-
}
|
|
620
|
-
function updatePromoRule(_x2, _x3) {
|
|
621
|
-
return _updatePromoRule.apply(this, arguments);
|
|
622
|
-
}
|
|
623
|
-
function _updatePromoRule() {
|
|
624
|
-
_updatePromoRule = _asyncToGenerator(function* (id, params) {
|
|
625
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/rules/${id}`, {
|
|
626
|
-
method: "PATCH",
|
|
627
|
-
headers: {
|
|
628
|
-
Authorization: getBasicToken(),
|
|
629
|
-
"Content-Type": "application/json"
|
|
630
|
-
},
|
|
631
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
632
|
-
});
|
|
633
|
-
const json = yield response.json();
|
|
634
|
-
log(updatePromoRule.name, json);
|
|
635
|
-
if (!response.ok) throw new Error(json.message);
|
|
636
|
-
return toCamelCase(json);
|
|
637
|
-
});
|
|
638
|
-
return _updatePromoRule.apply(this, arguments);
|
|
639
|
-
}
|
|
640
|
-
function removePromoRule(_x4) {
|
|
641
|
-
return _removePromoRule.apply(this, arguments);
|
|
642
|
-
}
|
|
643
|
-
function _removePromoRule() {
|
|
644
|
-
_removePromoRule = _asyncToGenerator(function* (id) {
|
|
645
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/rules/${id}`, {
|
|
646
|
-
method: "DELETE",
|
|
647
|
-
headers: {
|
|
648
|
-
Authorization: getBasicToken(),
|
|
649
|
-
"Content-Type": "application/json"
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
const json = yield response.json();
|
|
653
|
-
log(removePromoRule.name, json);
|
|
654
|
-
if (!response.ok) throw new Error(json.message);
|
|
655
|
-
return response.ok;
|
|
656
|
-
});
|
|
657
|
-
return _removePromoRule.apply(this, arguments);
|
|
658
|
-
}
|
|
659
|
-
function getPromoRules() {
|
|
660
|
-
return _getPromoRules.apply(this, arguments);
|
|
661
|
-
}
|
|
662
|
-
function _getPromoRules() {
|
|
663
|
-
_getPromoRules = _asyncToGenerator(function* () {
|
|
664
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/rules`, { headers: {
|
|
665
|
-
Authorization: getBasicToken(),
|
|
666
|
-
"Content-Type": "application/json"
|
|
667
|
-
} });
|
|
668
|
-
const json = yield response.json();
|
|
669
|
-
log(getPromoRules.name, json);
|
|
670
|
-
if (!response.ok) throw new Error(json.message);
|
|
671
|
-
return toCamelCase(json);
|
|
672
|
-
});
|
|
673
|
-
return _getPromoRules.apply(this, arguments);
|
|
674
|
-
}
|
|
675
|
-
//#endregion
|
|
676
|
-
//#region src/api/promo/rules/index.ts
|
|
677
|
-
var rules_exports = /* @__PURE__ */ __exportAll({
|
|
678
|
-
addPromoRule: () => addPromoRule,
|
|
679
|
-
getPromoRules: () => getPromoRules,
|
|
680
|
-
removePromoRule: () => removePromoRule,
|
|
681
|
-
updatePromoRule: () => updatePromoRule
|
|
682
|
-
});
|
|
683
|
-
//#endregion
|
|
684
|
-
//#region src/api/promo/offers/offers.ts
|
|
685
|
-
function addPromoOffer(_x) {
|
|
686
|
-
return _addPromoOffer.apply(this, arguments);
|
|
687
|
-
}
|
|
688
|
-
function _addPromoOffer() {
|
|
689
|
-
_addPromoOffer = _asyncToGenerator(function* (params) {
|
|
690
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/offers`, {
|
|
691
|
-
method: "POST",
|
|
692
|
-
headers: {
|
|
693
|
-
Authorization: getBasicToken(),
|
|
694
|
-
"Content-Type": "application/json"
|
|
695
|
-
},
|
|
696
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
697
|
-
});
|
|
698
|
-
const json = yield response.json();
|
|
699
|
-
log(addPromoOffer.name, json);
|
|
700
|
-
if (!response.ok) throw new Error(json.message);
|
|
701
|
-
return toCamelCase(json);
|
|
702
|
-
});
|
|
703
|
-
return _addPromoOffer.apply(this, arguments);
|
|
704
|
-
}
|
|
705
|
-
function updatePromoOffer(_x2, _x3) {
|
|
706
|
-
return _updatePromoOffer.apply(this, arguments);
|
|
707
|
-
}
|
|
708
|
-
function _updatePromoOffer() {
|
|
709
|
-
_updatePromoOffer = _asyncToGenerator(function* (id, params) {
|
|
710
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/offers/${id}`, {
|
|
711
|
-
method: "PATCH",
|
|
712
|
-
headers: {
|
|
713
|
-
Authorization: getBasicToken(),
|
|
714
|
-
"Content-Type": "application/json"
|
|
715
|
-
},
|
|
716
|
-
body: JSON.stringify(toSnakeCase(params))
|
|
717
|
-
});
|
|
718
|
-
const json = yield response.json();
|
|
719
|
-
log(updatePromoOffer.name, json);
|
|
720
|
-
if (!response.ok) throw new Error(json.message);
|
|
721
|
-
return toCamelCase(json);
|
|
722
|
-
});
|
|
723
|
-
return _updatePromoOffer.apply(this, arguments);
|
|
724
|
-
}
|
|
725
|
-
function removePromoOffer(_x4) {
|
|
726
|
-
return _removePromoOffer.apply(this, arguments);
|
|
727
|
-
}
|
|
728
|
-
function _removePromoOffer() {
|
|
729
|
-
_removePromoOffer = _asyncToGenerator(function* (id) {
|
|
730
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/offers/${id}`, {
|
|
731
|
-
method: "DELETE",
|
|
732
|
-
headers: {
|
|
733
|
-
Authorization: getBasicToken(),
|
|
734
|
-
"Content-Type": "application/json"
|
|
735
|
-
}
|
|
736
|
-
});
|
|
737
|
-
const json = yield response.json();
|
|
738
|
-
log(removePromoOffer.name, json);
|
|
739
|
-
if (!response.ok) throw new Error(json.message);
|
|
740
|
-
return response.ok;
|
|
741
|
-
});
|
|
742
|
-
return _removePromoOffer.apply(this, arguments);
|
|
743
|
-
}
|
|
744
|
-
function getPromoOffers() {
|
|
745
|
-
return _getPromoOffers.apply(this, arguments);
|
|
746
|
-
}
|
|
747
|
-
function _getPromoOffers() {
|
|
748
|
-
_getPromoOffers = _asyncToGenerator(function* () {
|
|
749
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/offers`, { headers: {
|
|
750
|
-
Authorization: getBasicToken(),
|
|
751
|
-
"Content-Type": "application/json"
|
|
752
|
-
} });
|
|
753
|
-
const json = yield response.json();
|
|
754
|
-
log(getPromoOffers.name, json);
|
|
755
|
-
if (!response.ok) throw new Error(json.message);
|
|
756
|
-
return toCamelCase(json);
|
|
757
|
-
});
|
|
758
|
-
return _getPromoOffers.apply(this, arguments);
|
|
759
|
-
}
|
|
760
|
-
function checkPromoOffer(_x5, _x6) {
|
|
761
|
-
return _checkPromoOffer.apply(this, arguments);
|
|
762
|
-
}
|
|
763
|
-
function _checkPromoOffer() {
|
|
764
|
-
_checkPromoOffer = _asyncToGenerator(function* (id, sub) {
|
|
765
|
-
const response = yield fetch(`${getGeneralApiUrl()}/promo/offers/${id}/check?sub=${sub}`, { headers: {
|
|
766
|
-
Authorization: getBasicToken(),
|
|
767
|
-
"Content-Type": "application/json"
|
|
768
|
-
} });
|
|
769
|
-
const json = yield response.json();
|
|
770
|
-
log(checkPromoOffer.name, json);
|
|
771
|
-
if (!response.ok) throw new Error(json.message);
|
|
772
|
-
return json;
|
|
773
|
-
});
|
|
774
|
-
return _checkPromoOffer.apply(this, arguments);
|
|
775
|
-
}
|
|
776
|
-
function getPromoOfferRss(_x7) {
|
|
777
|
-
return _getPromoOfferRss.apply(this, arguments);
|
|
778
|
-
}
|
|
779
|
-
function _getPromoOfferRss() {
|
|
780
|
-
_getPromoOfferRss = _asyncToGenerator(function* (params) {
|
|
781
|
-
const url = new URL(`${getGeneralApiUrl()}/promo/offers/rss`);
|
|
782
|
-
if (params === null || params === void 0 ? void 0 : params.suiAddress) url.searchParams.append("sui_address", params.suiAddress);
|
|
783
|
-
else if (params === null || params === void 0 ? void 0 : params.evmAddress) {
|
|
784
|
-
url.searchParams.append("evm_address", params.evmAddress);
|
|
785
|
-
throw new Error("Currently not supported for EVM");
|
|
786
|
-
}
|
|
787
|
-
const response = yield fetch(url.toString(), { headers: {
|
|
788
|
-
Authorization: getBasicToken(),
|
|
789
|
-
"Content-Type": "application/json"
|
|
790
|
-
} });
|
|
791
|
-
const json = yield response.json();
|
|
792
|
-
log(getPromoOfferRss.name, json);
|
|
793
|
-
if (!response.ok) throw new Error(json.message);
|
|
794
|
-
return toCamelCase(json);
|
|
795
|
-
});
|
|
796
|
-
return _getPromoOfferRss.apply(this, arguments);
|
|
797
|
-
}
|
|
798
|
-
//#endregion
|
|
799
|
-
//#region src/api/promo/offers/index.ts
|
|
800
|
-
var offers_exports = /* @__PURE__ */ __exportAll({
|
|
801
|
-
addPromoOffer: () => addPromoOffer,
|
|
802
|
-
checkPromoOffer: () => checkPromoOffer,
|
|
803
|
-
getPromoOfferRss: () => getPromoOfferRss,
|
|
804
|
-
getPromoOffers: () => getPromoOffers,
|
|
805
|
-
removePromoOffer: () => removePromoOffer,
|
|
806
|
-
updatePromoOffer: () => updatePromoOffer
|
|
807
|
-
});
|
|
808
|
-
//#endregion
|
|
809
|
-
//#region src/api/promo/index.ts
|
|
810
|
-
var promo_exports = /* @__PURE__ */ __exportAll({
|
|
811
|
-
offers: () => offers_exports,
|
|
812
|
-
rules: () => rules_exports
|
|
813
|
-
});
|
|
814
|
-
//#endregion
|
|
815
|
-
//#region src/api/file/file.ts
|
|
816
|
-
function uploadFile(_x) {
|
|
817
|
-
return _uploadFile.apply(this, arguments);
|
|
818
|
-
}
|
|
819
|
-
function _uploadFile() {
|
|
820
|
-
_uploadFile = _asyncToGenerator(function* (file) {
|
|
821
|
-
const formData = new FormData();
|
|
822
|
-
formData.append("file", file, file.name);
|
|
823
|
-
const response = yield fetch(`${getGeneralApiUrl()}/files/upload`, {
|
|
824
|
-
method: "POST",
|
|
825
|
-
headers: {
|
|
826
|
-
Authorization: getBasicToken(),
|
|
827
|
-
Accept: "*/*"
|
|
828
|
-
},
|
|
829
|
-
body: formData
|
|
830
|
-
});
|
|
831
|
-
const json = yield response.json();
|
|
832
|
-
log(uploadFile.name, json);
|
|
833
|
-
if (!response.ok) throw new Error(json.message);
|
|
834
|
-
return json;
|
|
835
|
-
});
|
|
836
|
-
return _uploadFile.apply(this, arguments);
|
|
837
|
-
}
|
|
838
|
-
//#endregion
|
|
839
|
-
//#region src/api/file/index.ts
|
|
840
|
-
var file_exports = /* @__PURE__ */ __exportAll({ uploadFile: () => uploadFile });
|
|
841
|
-
//#endregion
|
|
842
|
-
//#region src/api/index.ts
|
|
843
|
-
var api_exports = /* @__PURE__ */ __exportAll({
|
|
844
|
-
file: () => file_exports,
|
|
845
|
-
getGeneralApiUrl: () => getGeneralApiUrl,
|
|
846
|
-
getGeneralWsUrl: () => getGeneralWsUrl,
|
|
847
|
-
getWsConnection: () => getWsConnection$1,
|
|
848
|
-
nfcId: () => nfc_id_exports,
|
|
849
|
-
passportId: () => passport_id_exports,
|
|
850
|
-
promo: () => promo_exports
|
|
851
|
-
});
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region src/evm/evm.ts
|
|
854
|
-
let socket;
|
|
855
|
-
function getEvmApiUrl() {
|
|
856
|
-
switch (getSdkEnv()) {
|
|
857
|
-
case SDK_ENV.PROD: return "https://evm.credenza3.com";
|
|
858
|
-
case SDK_ENV.STAGING: return "https://evm.staging.credenza3.com";
|
|
859
|
-
case SDK_ENV.LOCAL: return "http://localhost:8082";
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
function getEvmWsUrl() {
|
|
863
|
-
switch (getSdkEnv()) {
|
|
864
|
-
case SDK_ENV.PROD: return "wss://evm-prod-prod.up.railway.app";
|
|
865
|
-
case SDK_ENV.STAGING: return "wss://evm-staging-staging.up.railway.app";
|
|
866
|
-
case SDK_ENV.LOCAL: return "ws://localhost:8082";
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
function getWsConnection() {
|
|
870
|
-
return _getWsConnection.apply(this, arguments);
|
|
871
|
-
}
|
|
872
|
-
function _getWsConnection() {
|
|
873
|
-
_getWsConnection = _asyncToGenerator(function* () {
|
|
874
|
-
if (!(socket === null || socket === void 0 ? void 0 : socket.connected)) socket = yield connectToWs(getEvmWsUrl());
|
|
875
|
-
return socket;
|
|
876
|
-
});
|
|
877
|
-
return _getWsConnection.apply(this, arguments);
|
|
878
|
-
}
|
|
879
|
-
//#endregion
|
|
880
|
-
//#region src/evm/account/account.ts
|
|
881
|
-
function getEvmAddress(_x) {
|
|
882
|
-
return _getEvmAddress.apply(this, arguments);
|
|
883
|
-
}
|
|
884
|
-
function _getEvmAddress() {
|
|
885
|
-
_getEvmAddress = _asyncToGenerator(function* (sub) {
|
|
886
|
-
const response = yield fetch(`${getEvmApiUrl()}/accounts/${sub}/address`, { headers: {
|
|
887
|
-
Authorization: getBasicToken(),
|
|
888
|
-
"Content-Type": "application/json"
|
|
889
|
-
} });
|
|
890
|
-
const json = yield response.json();
|
|
891
|
-
log(getEvmAddress.name, json);
|
|
892
|
-
if (!response.ok) throw new Error(json.message);
|
|
893
|
-
return json;
|
|
894
|
-
});
|
|
895
|
-
return _getEvmAddress.apply(this, arguments);
|
|
896
|
-
}
|
|
897
|
-
//#endregion
|
|
898
|
-
//#region src/evm/account/index.ts
|
|
899
|
-
var account_exports$2 = /* @__PURE__ */ __exportAll({ getEvmAddress: () => getEvmAddress });
|
|
900
|
-
//#endregion
|
|
901
|
-
//#region src/evm/contract/contract.ts
|
|
902
|
-
function getAvailableEvmContracts() {
|
|
903
|
-
return _getAvailableEvmContracts.apply(this, arguments);
|
|
904
|
-
}
|
|
905
|
-
function _getAvailableEvmContracts() {
|
|
906
|
-
_getAvailableEvmContracts = _asyncToGenerator(function* () {
|
|
907
|
-
const response = yield fetch(`${getEvmApiUrl()}/contracts/available`, { headers: {
|
|
908
|
-
Authorization: getBasicToken(),
|
|
909
|
-
"Content-Type": "application/json"
|
|
910
|
-
} });
|
|
911
|
-
const json = yield response.json();
|
|
912
|
-
log(getAvailableEvmContracts.name, json);
|
|
913
|
-
if (!response.ok) throw new Error(json.message);
|
|
914
|
-
return json;
|
|
915
|
-
});
|
|
916
|
-
return _getAvailableEvmContracts.apply(this, arguments);
|
|
917
|
-
}
|
|
918
|
-
function findEvmContracts() {
|
|
919
|
-
return _findEvmContracts.apply(this, arguments);
|
|
920
|
-
}
|
|
921
|
-
function _findEvmContracts() {
|
|
922
|
-
_findEvmContracts = _asyncToGenerator(function* (params = {}) {
|
|
923
|
-
const url = new URL(`${getEvmApiUrl()}/contracts`);
|
|
924
|
-
for (const [key, val] of Object.entries(params)) url.searchParams.append(key, String(val));
|
|
925
|
-
const response = yield fetch(url.toString(), { headers: {
|
|
926
|
-
Authorization: getBasicToken(),
|
|
927
|
-
"Content-Type": "application/json"
|
|
928
|
-
} });
|
|
929
|
-
const json = yield response.json();
|
|
930
|
-
log(findEvmContracts.name, json);
|
|
931
|
-
if (!response.ok) throw new Error(json.message);
|
|
932
|
-
return json.map((contract) => {
|
|
933
|
-
return {
|
|
934
|
-
id: contract._id,
|
|
935
|
-
type: contract.type,
|
|
936
|
-
name: contract.name,
|
|
937
|
-
chainId: contract.chain_id,
|
|
938
|
-
address: contract.address,
|
|
939
|
-
txHash: contract.tx_hash,
|
|
940
|
-
clientId: contract.client_id
|
|
941
|
-
};
|
|
942
|
-
});
|
|
943
|
-
});
|
|
944
|
-
return _findEvmContracts.apply(this, arguments);
|
|
945
|
-
}
|
|
946
|
-
function deployEvmContract(_x, _x2, _x3) {
|
|
947
|
-
return _deployEvmContract.apply(this, arguments);
|
|
948
|
-
}
|
|
949
|
-
function _deployEvmContract() {
|
|
950
|
-
_deployEvmContract = _asyncToGenerator(function* (name, chainId, ownerAddresses) {
|
|
951
|
-
if (!name) throw new Error("\"name is required\"");
|
|
952
|
-
if (!chainId) throw new Error("\"chainId\" is required");
|
|
953
|
-
if ((ownerAddresses === null || ownerAddresses === void 0 ? void 0 : ownerAddresses.length) === 0) throw new Error("\"ownerAddresses\" can not be empty");
|
|
954
|
-
const socket = yield getWsConnection();
|
|
955
|
-
return new Promise((resolve, reject) => {
|
|
956
|
-
socket.emit("contracts/deploy", { payload: {
|
|
957
|
-
name,
|
|
958
|
-
chain_id: chainId,
|
|
959
|
-
owner_addresses: ownerAddresses
|
|
960
|
-
} }, (data) => {
|
|
961
|
-
if (data.error) return reject(new Error(data.error.message));
|
|
962
|
-
log(deployEvmContract.name, `${name} contract deployed`, data);
|
|
963
|
-
resolve({
|
|
964
|
-
id: data.payload.contract._id,
|
|
965
|
-
type: data.payload.contract.type,
|
|
966
|
-
name: data.payload.contract.name,
|
|
967
|
-
chainId,
|
|
968
|
-
address: data.payload.contract.address,
|
|
969
|
-
tx: {
|
|
970
|
-
deployment: data.payload.tx.deployment,
|
|
971
|
-
trustedForwarder: data.payload.tx.trusted_forwarder,
|
|
972
|
-
addOwner: data.payload.tx.add_owner
|
|
973
|
-
}
|
|
974
|
-
});
|
|
975
|
-
});
|
|
976
|
-
});
|
|
977
|
-
});
|
|
978
|
-
return _deployEvmContract.apply(this, arguments);
|
|
979
|
-
}
|
|
980
|
-
function sendEvmMetaTransaction(_x4, _x5) {
|
|
981
|
-
return _sendEvmMetaTransaction.apply(this, arguments);
|
|
982
|
-
}
|
|
983
|
-
function _sendEvmMetaTransaction() {
|
|
984
|
-
_sendEvmMetaTransaction = _asyncToGenerator(function* (unsignedSerializedMetaTx, accountAddress) {
|
|
985
|
-
const socket = yield getWsConnection();
|
|
986
|
-
return new Promise((resolve, reject) => {
|
|
987
|
-
socket.emit("contracts/forward_transaction/client", { payload: {
|
|
988
|
-
account_address: accountAddress,
|
|
989
|
-
unsigned_serialized_meta_tx: unsignedSerializedMetaTx
|
|
990
|
-
} }, (data) => {
|
|
991
|
-
if (data.error) return reject(new Error(data.error.message));
|
|
992
|
-
log(sendEvmMetaTransaction.name, `meta tx sent`, data);
|
|
993
|
-
resolve(data.payload);
|
|
994
|
-
});
|
|
995
|
-
});
|
|
996
|
-
});
|
|
997
|
-
return _sendEvmMetaTransaction.apply(this, arguments);
|
|
998
|
-
}
|
|
999
|
-
//#endregion
|
|
1000
|
-
//#region src/evm/contract/index.ts
|
|
1001
|
-
var contract_exports = /* @__PURE__ */ __exportAll({
|
|
1002
|
-
deployEvmContract: () => deployEvmContract,
|
|
1003
|
-
findEvmContracts: () => findEvmContracts,
|
|
1004
|
-
getAvailableEvmContracts: () => getAvailableEvmContracts,
|
|
1005
|
-
sendEvmMetaTransaction: () => sendEvmMetaTransaction
|
|
1006
|
-
});
|
|
1007
|
-
//#endregion
|
|
1008
|
-
//#region src/evm/index.ts
|
|
1009
|
-
var evm_exports = /* @__PURE__ */ __exportAll({
|
|
1010
|
-
account: () => account_exports$2,
|
|
1011
|
-
contract: () => contract_exports,
|
|
1012
|
-
getEvmApiUrl: () => getEvmApiUrl,
|
|
1013
|
-
getEvmWsUrl: () => getEvmWsUrl,
|
|
1014
|
-
getWsConnection: () => getWsConnection
|
|
1015
|
-
});
|
|
1016
|
-
//#endregion
|
|
1017
|
-
//#region src/sui/sui.ts
|
|
1018
|
-
function getSuiApiUrl() {
|
|
1019
|
-
switch (getSdkEnv()) {
|
|
1020
|
-
case SDK_ENV.PROD: return "https://sui.credenza3.com";
|
|
1021
|
-
case SDK_ENV.STAGING: return "https://sui.staging.credenza3.com";
|
|
1022
|
-
case SDK_ENV.LOCAL: return "http://localhost:8083";
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
//#endregion
|
|
1026
|
-
//#region src/sui/account/account.ts
|
|
1027
|
-
function getSuiAddress(_x) {
|
|
1028
|
-
return _getSuiAddress.apply(this, arguments);
|
|
1029
|
-
}
|
|
1030
|
-
function _getSuiAddress() {
|
|
1031
|
-
_getSuiAddress = _asyncToGenerator(function* (sub) {
|
|
1032
|
-
const response = yield fetch(`${getSuiApiUrl()}/accounts/${sub}/address`, { headers: {
|
|
1033
|
-
Authorization: getBasicToken(),
|
|
1034
|
-
"Content-Type": "application/json"
|
|
1035
|
-
} });
|
|
1036
|
-
const json = yield response.json();
|
|
1037
|
-
log(getSuiAddress.name, json);
|
|
1038
|
-
if (!response.ok) throw new Error(json.message);
|
|
1039
|
-
return json;
|
|
1040
|
-
});
|
|
1041
|
-
return _getSuiAddress.apply(this, arguments);
|
|
1042
|
-
}
|
|
1043
|
-
//#endregion
|
|
1044
|
-
//#region src/sui/account/index.ts
|
|
1045
|
-
var account_exports$1 = /* @__PURE__ */ __exportAll({ getSuiAddress: () => getSuiAddress });
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region src/sui/zk/account/account.ts
|
|
1048
|
-
function getSuiZkAddress(_x) {
|
|
1049
|
-
return _getSuiZkAddress.apply(this, arguments);
|
|
1050
|
-
}
|
|
1051
|
-
function _getSuiZkAddress() {
|
|
1052
|
-
_getSuiZkAddress = _asyncToGenerator(function* (sub) {
|
|
1053
|
-
const response = yield fetch(`${getSuiApiUrl()}/accounts/zk/${sub}/address`, { headers: {
|
|
1054
|
-
Authorization: getBasicToken(),
|
|
1055
|
-
"Content-Type": "application/json"
|
|
1056
|
-
} });
|
|
1057
|
-
const json = yield response.json();
|
|
1058
|
-
log(getSuiZkAddress.name, json);
|
|
1059
|
-
if (!response.ok) throw new Error(json.message);
|
|
1060
|
-
return json;
|
|
1061
|
-
});
|
|
1062
|
-
return _getSuiZkAddress.apply(this, arguments);
|
|
1063
|
-
}
|
|
1064
|
-
//#endregion
|
|
1065
|
-
//#region src/sui/zk/account/index.ts
|
|
1066
|
-
var account_exports = /* @__PURE__ */ __exportAll({ getSuiZkAddress: () => getSuiZkAddress });
|
|
1067
|
-
//#endregion
|
|
1068
|
-
//#region src/sui/zk/index.ts
|
|
1069
|
-
var zk_exports = /* @__PURE__ */ __exportAll({ account: () => account_exports });
|
|
1070
|
-
//#endregion
|
|
1071
|
-
//#region src/sui/index.ts
|
|
1072
|
-
var sui_exports = /* @__PURE__ */ __exportAll({
|
|
1073
|
-
account: () => account_exports$1,
|
|
1074
|
-
getSuiApiUrl: () => getSuiApiUrl,
|
|
1075
|
-
zk: () => zk_exports
|
|
1076
|
-
});
|
|
1077
|
-
//#endregion
|
|
1078
|
-
//#region src/credenza-partner-sdk.ts
|
|
1079
|
-
function useAuth(credentials) {
|
|
1080
|
-
setCredentials(credentials);
|
|
1081
|
-
}
|
|
1082
|
-
function useEnv(sdkEnv) {
|
|
1083
|
-
setSdkEnv(sdkEnv);
|
|
1084
|
-
}
|
|
1085
|
-
function useDebug(enableDebug) {
|
|
1086
|
-
enableSdkDebug(enableDebug);
|
|
1087
|
-
}
|
|
1088
|
-
//#endregion
|
|
1089
|
-
exports.SDK_ENV = SDK_ENV;
|
|
1090
|
-
Object.defineProperty(exports, "accounts", {
|
|
1091
|
-
enumerable: true,
|
|
1092
|
-
get: function() {
|
|
1093
|
-
return accounts_exports;
|
|
1094
|
-
}
|
|
1095
|
-
});
|
|
1096
|
-
Object.defineProperty(exports, "api", {
|
|
1097
|
-
enumerable: true,
|
|
1098
|
-
get: function() {
|
|
1099
|
-
return api_exports;
|
|
1100
|
-
}
|
|
1101
|
-
});
|
|
1102
|
-
Object.defineProperty(exports, "evm", {
|
|
1103
|
-
enumerable: true,
|
|
1104
|
-
get: function() {
|
|
1105
|
-
return evm_exports;
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
Object.defineProperty(exports, "sui", {
|
|
1109
|
-
enumerable: true,
|
|
1110
|
-
get: function() {
|
|
1111
|
-
return sui_exports;
|
|
1112
|
-
}
|
|
1113
|
-
});
|
|
1114
|
-
exports.useAuth = useAuth;
|
|
1115
|
-
exports.useDebug = useDebug;
|
|
1116
|
-
exports.useEnv = useEnv;
|
|
1117
|
-
|
|
1118
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Buffer","socket","getWsConnection","getWsConnection"],"sources":["../src/lib/credentials/credentials.ts","../src/lib/sdk-env/sdk-env.constants.ts","../src/lib/sdk-env/sdk-env.ts","../src/lib/logging/logging.ts","../src/accounts/accounts.ts","../src/lib/obj/obj.ts","../src/accounts/user/user.ts","../src/accounts/user/index.ts","../src/accounts/client/client.ts","../src/accounts/client/jwt-auth/jwt-auth.ts","../src/accounts/client/jwt-auth/index.ts","../src/accounts/client/index.ts","../src/accounts/oauth/oauth.ts","../src/accounts/oauth/index.ts","../src/accounts/index.ts","../src/lib/ws/ws.ts","../src/api/api.ts","../src/api/nfc-id/nfc-id.ts","../src/api/nfc-id/index.ts","../src/api/passport-id/passport-id.ts","../src/api/passport-id/index.ts","../src/api/promo/rules/rules.ts","../src/api/promo/rules/index.ts","../src/api/promo/offers/offers.ts","../src/api/promo/offers/index.ts","../src/api/promo/index.ts","../src/api/file/file.ts","../src/api/file/index.ts","../src/api/index.ts","../src/evm/evm.ts","../src/evm/account/account.ts","../src/evm/account/index.ts","../src/evm/contract/contract.ts","../src/evm/contract/index.ts","../src/evm/index.ts","../src/sui/sui.ts","../src/sui/account/account.ts","../src/sui/account/index.ts","../src/sui/zk/account/account.ts","../src/sui/zk/account/index.ts","../src/sui/zk/index.ts","../src/sui/index.ts","../src/credenza-partner-sdk.ts"],"sourcesContent":["import { Buffer } from 'buffer'\n\nimport { TCredentials } from './credentials.types'\n\nlet credentials: TCredentials | null = null\n\nexport function setCredentials(credentialsInput: TCredentials): void {\n if (!credentialsInput.clientId) throw new Error('\"clientId\" is required')\n if (!credentialsInput.clientSecret) throw new Error('\"clientSecret\" is required')\n credentials = credentialsInput\n}\n\nexport function getCredentials(): TCredentials {\n if (!credentials?.clientId || !credentials?.clientSecret) throw new Error('Credentials are not set')\n return credentials\n}\n\nexport function getBasicToken(): string {\n const { clientId, clientSecret } = getCredentials()\n const basicCredentials = `${clientId}:${clientSecret}`\n return `Basic ${Buffer.from(basicCredentials).toString('base64')}`\n}\n","export const SDK_ENV = {\n PROD: 'prod',\n STAGING: 'staging',\n LOCAL: 'local',\n} as const\n","import { SDK_ENV } from './sdk-env.constants'\nimport { TSdkEnv } from './sdk-env.types'\n\nlet sdkEnv: TSdkEnv = SDK_ENV.PROD\nexport function getSdkEnv(): TSdkEnv {\n return sdkEnv\n}\n\nexport function setSdkEnv(sdkEnvironment: TSdkEnv): void {\n sdkEnv = sdkEnvironment\n}\n","let debugEnabled = false\n\nexport function log(methodName: string, ...args: unknown[]) {\n if (!debugEnabled) return\n console.log(`[CREDENZA_PARTNER_SDK#${methodName}]:`, ...args)\n}\n\nexport function enableSdkDebug(enableDebug: boolean) {\n debugEnabled = enableDebug\n}\n","import { getSdkEnv, SDK_ENV } from '@/lib/sdk-env'\n\nexport function getOAuthApiUrl() {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'https://accounts.credenza3.com'\n case SDK_ENV.STAGING:\n return 'https://accounts.staging.credenza3.com'\n case SDK_ENV.LOCAL:\n return 'http://localhost:8081'\n }\n}\n","export function toCamelCase(obj: unknown): unknown {\n if (Array.isArray(obj)) {\n return obj.map(toCamelCase)\n } else if (obj !== null && typeof obj === 'object') {\n return Object.keys(obj).reduce(\n (acc, key) => {\n const camelKey = key.replace(/^_id$/, 'id').replace(/_([a-z])/g, (_, letter) => letter.toUpperCase())\n acc[camelKey] = toCamelCase((obj as Record<string, unknown>)[key])\n return acc\n },\n {} as Record<string, unknown>,\n )\n }\n return obj\n}\n\nexport function toSnakeCase(obj: unknown): unknown {\n if (Array.isArray(obj)) {\n return obj.map(toSnakeCase)\n } else if (obj !== null && typeof obj === 'object') {\n return Object.keys(obj).reduce(\n (acc, key) => {\n const snakeKey = key.replace(/([A-Z])/g, (_, letter) => `_${letter.toLowerCase()}`)\n acc[snakeKey] = toSnakeCase((obj as Record<string, unknown>)[key])\n return acc\n },\n {} as Record<string, unknown>,\n )\n }\n return obj\n}\n","import { getBasicToken } from '@/lib/credentials'\nimport { getOAuthApiUrl } from '@/accounts'\nimport { log } from '@/lib/logging'\nimport { toCamelCase } from '@/lib/obj'\n\nimport type { TOAuthAccountInfo, TGetAccountInfoByContactParams } from './user.types'\n\nexport async function getAccountInfo(sub: string): Promise<TOAuthAccountInfo> {\n const response = await fetch(`${getOAuthApiUrl()}/accounts/${sub}`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getAccountInfo.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOAuthAccountInfo\n}\n\nexport async function getAccountInfoByContact(args: TGetAccountInfoByContactParams): Promise<TOAuthAccountInfo> {\n const url = new URL(`${getOAuthApiUrl()}/accounts/info`)\n if (args.email) url.searchParams.set('email', args.email)\n if (args.phone) url.searchParams.set('phone', args.phone)\n const response = await fetch(url.toString(), {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getAccountInfoByContact.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOAuthAccountInfo\n}\n","export * from './user'\n","import { getBasicToken } from '@/lib/credentials'\nimport { getOAuthApiUrl } from '@/accounts'\nimport { log } from '@/lib/logging'\n\nexport async function getCurrentClientInfo(): Promise<{\n id: string\n name: string\n callbackUris: string[]\n confidential: boolean\n ownerId: string\n accessTokenTTLMinutes: number\n availableLoginTypes: string[]\n admins: string[]\n apiPermissions: string[]\n logoUri?: string\n}> {\n const response = await fetch(`${getOAuthApiUrl()}/clients/current`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getCurrentClientInfo.name, json)\n if (!response.ok) throw new Error(json.message)\n return {\n id: json._id,\n name: json.name,\n callbackUris: json.callback_uris,\n confidential: json.confidential,\n ownerId: json.owner_id,\n accessTokenTTLMinutes: json.access_token_ttl_minutes,\n availableLoginTypes: json.available_login_types,\n admins: json.admins,\n apiPermissions: json.api_permissions,\n logoUri: json.logo_uri ?? null,\n }\n}\n","import { log } from '@/lib/logging'\nimport { getOAuthApiUrl } from '@/accounts'\nimport { getBasicToken } from '@/lib/credentials'\nimport { toCamelCase, toSnakeCase } from '@/lib/obj'\nimport type { TJwtAuthValidator, TJwtAuthValidatorParams, TJwtAuthUpdateValidatorParams } from './jwt-auth.types'\n\nexport async function addJwtValidator(params: TJwtAuthValidatorParams): Promise<TJwtAuthValidator> {\n const response = await fetch(`${getOAuthApiUrl()}/clients/jwt-auth`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(addJwtValidator.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TJwtAuthValidator\n}\n\nexport async function updateJwtValidator(\n id: string,\n params: TJwtAuthUpdateValidatorParams,\n): Promise<TJwtAuthValidator> {\n const response = await fetch(`${getOAuthApiUrl()}/clients/jwt-auth/${id}`, {\n method: 'PATCH',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(updateJwtValidator.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TJwtAuthValidator\n}\n\nexport async function removeJwtValidator(id: string): Promise<boolean> {\n const response = await fetch(`${getOAuthApiUrl()}/clients/jwt-auth/${id}`, {\n method: 'DELETE',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(removeJwtValidator.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n\nexport async function getJwtValidators(): Promise<TJwtAuthValidator[]> {\n const response = await fetch(`${getOAuthApiUrl()}/clients/jwt-auth`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getJwtValidators.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TJwtAuthValidator[]\n}\n","export * from './jwt-auth'\n","export * from './client'\nexport * as jwtAuth from './jwt-auth'\n","import { getBasicToken } from '@/lib/credentials'\nimport { getOAuthApiUrl } from '@/accounts'\nimport { log } from '@/lib/logging'\nimport { toCamelCase } from '@/lib/obj'\n\nimport type { TTokenResponse, TExchangeTokenParams } from './oauth.types'\n\nexport async function exchangeCodeForToken(params: TExchangeTokenParams): Promise<TTokenResponse> {\n const response = await fetch(`${getOAuthApiUrl()}/oauth2/token`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: new URLSearchParams({\n grant_type: 'authorization_code',\n code: params.code,\n code_verifier: params.codeVerifier,\n redirect_uri: params.redirectUri || 'none',\n }),\n })\n const json = await response.json()\n log(exchangeCodeForToken.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TTokenResponse\n}\n\nexport async function refreshToken(refreshTokenValue: string): Promise<TTokenResponse> {\n const response = await fetch(`${getOAuthApiUrl()}/oauth2/token`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: refreshTokenValue,\n }),\n })\n const json = await response.json()\n log(refreshToken.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TTokenResponse\n}\n","export * from './oauth'\n","export * from './accounts'\nexport * as user from './user'\nexport * as client from './client'\nexport * as oauth from './oauth'\n","import { getCredentials, TCredentials } from '@/lib/credentials'\nimport { io, Socket } from 'socket.io-client'\n\nconst socketPromises = new Map<string, Promise<{ socket: Socket; auth: TCredentials }>>()\n\nexport async function disconnectWs(url?: string) {\n const socketUrls = url ? [url] : Array.from(socketPromises.keys())\n for (const url of socketUrls) {\n if (!socketPromises.has(url)) continue\n const { socket } = await socketPromises.get(url)!\n socket?.disconnect()\n socketPromises.delete(url)\n }\n}\nexport async function connectToWs(url: string): Promise<Socket> {\n const credentials = getCredentials()\n\n if (!socketPromises.has(url)) {\n const promise = new Promise<{ socket: Socket; auth: TCredentials }>((resolve, reject) => {\n const socket = io(url, {\n auth: {\n client_id: credentials.clientId,\n client_secret: credentials.clientSecret,\n },\n })\n socket.once('connect_error', (err) => reject(err))\n socket.once('connect', () => resolve({ socket, auth: credentials }))\n setTimeout(() => reject(new Error('Cannot connect to websocket server')), 5000)\n })\n socketPromises.set(url, promise)\n }\n\n const { socket, auth } = await socketPromises.get(url)!\n if (!socket?.connected || auth.clientId !== credentials.clientId || auth.clientSecret !== credentials.clientSecret) {\n await disconnectWs(url)\n return connectToWs(url)\n }\n\n return socket\n}\n","import { getSdkEnv, SDK_ENV } from '@/lib/sdk-env'\nimport { Socket } from 'socket.io-client'\nimport { connectToWs } from '@/lib/ws'\n\nlet socket: Socket\n\nexport function getGeneralApiUrl(): string {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'https://api.credenza3.com'\n case SDK_ENV.STAGING:\n return 'https://api.staging.credenza3.com'\n case SDK_ENV.LOCAL:\n return 'http://localhost:8084'\n }\n}\n\nexport function getGeneralWsUrl(): string {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'wss://general-prod-prod.up.railway.app'\n case SDK_ENV.STAGING:\n return 'wss://general-staging-staging.up.railway.app'\n case SDK_ENV.LOCAL:\n return 'ws://localhost:8084'\n }\n}\nexport async function getWsConnection(): Promise<Socket> {\n if (!socket?.connected) {\n socket = await connectToWs(getGeneralWsUrl())\n }\n return socket\n}\n","import { log } from '@/lib/logging'\nimport { getGeneralApiUrl } from '@/api'\nimport { getBasicToken } from '@/lib/credentials'\nimport { TNfcId, TUpdateNfcId } from './nfc-id.types'\n\nexport async function addNfcId(params: TNfcId): Promise<TNfcId> {\n const response = await fetch(`${getGeneralApiUrl()}/nfc-id`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n serial_number: params.serialNumber,\n sub: params.sub,\n ...(params.text ? { text: params.text } : {}),\n }),\n })\n const json = await response.json()\n log(addNfcId.name, json)\n if (!response.ok) throw new Error(json.message)\n return {\n sub: json.sub,\n serialNumber: json.serial_number,\n text: json.text ?? null,\n }\n}\n\nexport async function updateNfcId(serialNumber: string, params: TUpdateNfcId): Promise<boolean> {\n const response = await fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, {\n method: 'PATCH',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n ...(params.text ? { text: params.text } : {}),\n ...(params.sub ? { sub: params.sub } : {}),\n }),\n })\n const json = await response.json()\n log(updateNfcId.name, json)\n return json\n}\n\nexport async function removeNfcId(serialNumber: string): Promise<boolean> {\n const response = await fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, {\n method: 'DELETE',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(removeNfcId.name, json)\n return json\n}\n\nexport async function getNfcId(serialNumber: string): Promise<Omit<TNfcId, 'serialNumber'>> {\n const response = await fetch(`${getGeneralApiUrl()}/nfc-id/${serialNumber}`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getNfcId.name, json)\n return { sub: json.sub, text: json.text ?? null }\n}\n","export * from './nfc-id'\nexport * from './nfc-id.types'\n","import { getWsConnection } from '@/api'\nimport { log } from '@/lib/logging'\n\nimport type { TPassportIdSignedData, TPassportIdRequestData } from './passport-id.types'\n\nexport async function requestPassportIdSignature(sub: string, message: string): Promise<{ signature: string }> {\n if (!sub) throw new Error('\"Sub is required\"')\n if (!message) throw new Error('\"Message is required\"')\n\n const socket = await getWsConnection()\n return new Promise((resolve, reject) => {\n socket.once(`passport_id/signed/${sub}`, (data: TPassportIdSignedData) => {\n log(requestPassportIdSignature.name, 'Received', data)\n resolve(data.payload)\n })\n socket.emit(\n 'passport_id/request_signature',\n {\n payload: { sub, message },\n },\n (data: TPassportIdRequestData) => {\n if (!data.payload.ok) {\n reject(new Error('Failed to sign message'))\n }\n if (data.error) {\n reject(new Error(data.error.message))\n }\n log(requestPassportIdSignature.name, 'Requested', data)\n },\n )\n })\n}\n","export * from './passport-id'\n","import { log } from '@/lib/logging'\nimport { getGeneralApiUrl } from '@/api'\nimport { getBasicToken } from '@/lib/credentials'\nimport { TCreateRuleParams, TUpdateRuleParams, TRule } from './rules.types'\nimport { toCamelCase, toSnakeCase } from '@/lib/obj'\n\nexport async function addPromoRule(params: TCreateRuleParams): Promise<TRule> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/rules`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(addPromoRule.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TRule\n}\n\nexport async function updatePromoRule(id: string, params: TUpdateRuleParams): Promise<TRule> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/rules/${id}`, {\n method: 'PATCH',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(updatePromoRule.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TRule\n}\n\nexport async function removePromoRule(id: string): Promise<boolean> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/rules/${id}`, {\n method: 'DELETE',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(removePromoRule.name, json)\n if (!response.ok) throw new Error(json.message)\n return response.ok\n}\n\nexport async function getPromoRules(): Promise<TRule[]> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/rules`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getPromoRules.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TRule[]\n}\n","export * from './rules'\n","import { log } from '@/lib/logging'\nimport { getGeneralApiUrl } from '@/api'\nimport { getBasicToken } from '@/lib/credentials'\nimport { TCreateOfferParams, TUpdateOfferParams, TOffer, TOfferRss } from './offers.types'\nimport { toCamelCase, toSnakeCase } from '@/lib/obj'\n\nexport async function addPromoOffer(params: TCreateOfferParams): Promise<TOffer> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/offers`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(addPromoOffer.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOffer\n}\n\nexport async function updatePromoOffer(id: string, params: TUpdateOfferParams): Promise<TOffer> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/offers/${id}`, {\n method: 'PATCH',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(toSnakeCase(params)),\n })\n const json = await response.json()\n log(updatePromoOffer.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOffer\n}\n\nexport async function removePromoOffer(id: string): Promise<boolean> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/offers/${id}`, {\n method: 'DELETE',\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(removePromoOffer.name, json)\n if (!response.ok) throw new Error(json.message)\n return response.ok\n}\n\nexport async function getPromoOffers(): Promise<TOffer[]> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/offers`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getPromoOffers.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOffer[]\n}\n\nexport async function checkPromoOffer(id: string, sub: string): Promise<boolean> {\n const response = await fetch(`${getGeneralApiUrl()}/promo/offers/${id}/check?sub=${sub}`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(checkPromoOffer.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n\nexport async function getPromoOfferRss(params: { suiAddress?: string; evmAddress?: string }): Promise<TOfferRss[]> {\n const url = new URL(`${getGeneralApiUrl()}/promo/offers/rss`)\n if (params?.suiAddress) {\n url.searchParams.append('sui_address', params.suiAddress)\n } else if (params?.evmAddress) {\n url.searchParams.append('evm_address', params.evmAddress)\n throw new Error('Currently not supported for EVM') // Remove when implemented\n }\n\n const response = await fetch(url.toString(), {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getPromoOfferRss.name, json)\n if (!response.ok) throw new Error(json.message)\n return toCamelCase(json) as TOfferRss[]\n}\n","export * from './offers'\n","export * as rules from './rules'\nexport * as offers from './offers'\n","import { getGeneralApiUrl } from '@/api'\nimport { getBasicToken } from '@/lib/credentials'\nimport { log } from '@/lib/logging'\n\nexport async function uploadFile(file: File): Promise<{\n location: string\n bucket: string\n key: string\n}> {\n const formData = new FormData()\n formData.append('file', file, file.name)\n const response = await fetch(`${getGeneralApiUrl()}/files/upload`, {\n method: 'POST',\n headers: {\n Authorization: getBasicToken(),\n Accept: '*/*',\n },\n body: formData,\n })\n const json = await response.json()\n log(uploadFile.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n","export * from './file'\n","export * from './api'\nexport * as nfcId from './nfc-id'\nexport * as passportId from './passport-id'\nexport * as promo from './promo'\nexport * as file from './file'\n","import { getSdkEnv, SDK_ENV } from '@/lib/sdk-env'\nimport { Socket } from 'socket.io-client'\nimport { connectToWs } from '@/lib/ws'\n\nlet socket: Socket\n\nexport function getEvmApiUrl() {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'https://evm.credenza3.com'\n case SDK_ENV.STAGING:\n return 'https://evm.staging.credenza3.com'\n case SDK_ENV.LOCAL:\n return 'http://localhost:8082'\n }\n}\n\nexport function getEvmWsUrl(): string {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'wss://evm-prod-prod.up.railway.app'\n case SDK_ENV.STAGING:\n return 'wss://evm-staging-staging.up.railway.app'\n case SDK_ENV.LOCAL:\n return 'ws://localhost:8082'\n }\n}\nexport async function getWsConnection(): Promise<Socket> {\n if (!socket?.connected) {\n socket = await connectToWs(getEvmWsUrl())\n }\n return socket\n}\n","import { getBasicToken } from '@/lib/credentials'\nimport { getEvmApiUrl } from '@/evm'\nimport { log } from '@/lib/logging'\n\nexport async function getEvmAddress(sub: string): Promise<{ address: string }> {\n const response = await fetch(`${getEvmApiUrl()}/accounts/${sub}/address`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getEvmAddress.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n","export * from './account'\n","import { getBasicToken } from '@/lib/credentials'\nimport { getEvmApiUrl } from '@/evm'\nimport { log } from '@/lib/logging'\nimport { getWsConnection } from '@/evm'\n\nimport type { TEvmContractRecord, TDeployEvmContractData, TSendMetaTxData } from './contract.types'\n\nexport async function getAvailableEvmContracts(): Promise<string[]> {\n const response = await fetch(`${getEvmApiUrl()}/contracts/available`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getAvailableEvmContracts.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n\nexport async function findEvmContracts(\n params: { name?: string; type?: string; chain_id?: number } = {},\n): Promise<string[]> {\n const url = new URL(`${getEvmApiUrl()}/contracts`)\n for (const [key, val] of Object.entries(params)) {\n url.searchParams.append(key, String(val))\n }\n const response = await fetch(url.toString(), {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(findEvmContracts.name, json)\n if (!response.ok) throw new Error(json.message)\n return json.map((contract: TEvmContractRecord) => {\n return {\n id: contract._id,\n type: contract.type,\n name: contract.name,\n chainId: contract.chain_id,\n address: contract.address,\n txHash: contract.tx_hash,\n clientId: contract.client_id,\n }\n })\n}\n\nexport async function deployEvmContract(name: string, chainId: number, ownerAddresses: string[]) {\n if (!name) throw new Error('\"name is required\"')\n if (!chainId) throw new Error('\"chainId\" is required')\n if (ownerAddresses?.length === 0) throw new Error('\"ownerAddresses\" can not be empty')\n\n const socket = await getWsConnection()\n return new Promise((resolve, reject) => {\n socket.emit(\n 'contracts/deploy',\n {\n payload: { name, chain_id: chainId, owner_addresses: ownerAddresses },\n },\n (data: TDeployEvmContractData) => {\n if (data.error) {\n return reject(new Error(data.error.message))\n }\n log(deployEvmContract.name, `${name} contract deployed`, data)\n resolve({\n id: data.payload.contract._id,\n type: data.payload.contract.type,\n name: data.payload.contract.name,\n chainId,\n address: data.payload.contract.address,\n tx: {\n deployment: data.payload.tx.deployment,\n trustedForwarder: data.payload.tx.trusted_forwarder,\n addOwner: data.payload.tx.add_owner,\n },\n })\n },\n )\n })\n}\n\nexport async function sendEvmMetaTransaction(unsignedSerializedMetaTx: string, accountAddress: string) {\n const socket = await getWsConnection()\n return new Promise((resolve, reject) => {\n socket.emit(\n 'contracts/forward_transaction/client',\n {\n payload: {\n account_address: accountAddress,\n unsigned_serialized_meta_tx: unsignedSerializedMetaTx,\n },\n },\n (data: TSendMetaTxData) => {\n if (data.error) {\n return reject(new Error(data.error.message))\n }\n log(sendEvmMetaTransaction.name, `meta tx sent`, data)\n resolve(data.payload)\n },\n )\n })\n}\n","export * from './contract'\n","export * from './evm'\nexport * as account from './account'\nexport * as contract from './contract'\n","import { getSdkEnv, SDK_ENV } from '@/lib/sdk-env'\n\nexport function getSuiApiUrl() {\n switch (getSdkEnv()) {\n case SDK_ENV.PROD:\n return 'https://sui.credenza3.com'\n case SDK_ENV.STAGING:\n return 'https://sui.staging.credenza3.com'\n case SDK_ENV.LOCAL:\n return 'http://localhost:8083'\n }\n}\n","import { getBasicToken } from '@/lib/credentials'\nimport { getSuiApiUrl } from '@/sui'\nimport { log } from '@/lib/logging'\n\nexport async function getSuiAddress(sub: string): Promise<{ address: string }> {\n const response = await fetch(`${getSuiApiUrl()}/accounts/${sub}/address`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getSuiAddress.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n","export * from './account'\n","import { getBasicToken } from '@/lib/credentials'\nimport { getSuiApiUrl } from '@/sui'\nimport { log } from '@/lib/logging'\n\nexport async function getSuiZkAddress(sub: string): Promise<{ address: string }> {\n const response = await fetch(`${getSuiApiUrl()}/accounts/zk/${sub}/address`, {\n headers: {\n Authorization: getBasicToken(),\n 'Content-Type': 'application/json',\n },\n })\n const json = await response.json()\n log(getSuiZkAddress.name, json)\n if (!response.ok) throw new Error(json.message)\n return json\n}\n","export * from './account'\n","export * as account from './account'\n","export * from './sui'\nexport * as account from './account'\nexport * as zk from './zk'\n","import { setCredentials, TCredentials } from './lib/credentials'\nimport { setSdkEnv, TSdkEnv, SDK_ENV } from './lib/sdk-env'\nimport { enableSdkDebug } from './lib/logging'\n\nexport function useAuth(credentials: TCredentials): void {\n setCredentials(credentials)\n}\n\nexport function useEnv(sdkEnv: TSdkEnv): void {\n setSdkEnv(sdkEnv)\n}\n\nexport function useDebug(enableDebug: boolean) {\n enableSdkDebug(enableDebug)\n}\n\nexport * as accounts from './accounts'\nexport * as api from './api'\nexport * as evm from './evm'\nexport * as sui from './sui'\nexport { SDK_ENV }\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAI,cAAmC;AAEvC,SAAgB,eAAe,kBAAsC;CACnE,IAAI,CAAC,iBAAiB,UAAU,MAAM,IAAI,MAAM,0BAAwB;CACxE,IAAI,CAAC,iBAAiB,cAAc,MAAM,IAAI,MAAM,8BAA4B;CAChF,cAAc;AAChB;AAEA,SAAgB,iBAA+B;CAC7C,IAAI,EAAA,gBAAA,QAAA,gBAAA,KAAA,IAAA,KAAA,IAAC,YAAa,aAAY,EAAA,gBAAA,QAAA,gBAAA,KAAA,IAAA,KAAA,IAAC,YAAa,eAAc,MAAM,IAAI,MAAM,yBAAyB;CACnG,OAAO;AACT;AAEA,SAAgB,gBAAwB;CACtC,MAAM,EAAE,UAAU,iBAAiB,eAAe;CAClD,MAAM,mBAAmB,GAAG,SAAS,GAAG;CACxC,OAAO,SAASA,OAAAA,OAAO,KAAK,gBAAgB,CAAC,CAAC,SAAS,QAAQ;AACjE;;;ACrBA,MAAa,UAAU;CACrB,MAAM;CACN,SAAS;CACT,OAAO;AACT;;;ACDA,IAAI,SAAkB,QAAQ;AAC9B,SAAgB,YAAqB;CACnC,OAAO;AACT;AAEA,SAAgB,UAAU,gBAA+B;CACvD,SAAS;AACX;;;ACVA,IAAI,eAAe;AAEnB,SAAgB,IAAI,YAAoB,GAAG,MAAiB;CAC1D,IAAI,CAAC,cAAc;CACnB,QAAQ,IAAI,yBAAyB,WAAW,KAAK,GAAG,IAAI;AAC9D;AAEA,SAAgB,eAAe,aAAsB;CACnD,eAAe;AACjB;;;ACPA,SAAgB,iBAAiB;CAC/B,QAAQ,UAAU,GAAlB;EACE,KA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