@stableflow/core 0.0.0-experimental-5a8afd7389-20260703

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.mjs ADDED
@@ -0,0 +1,1956 @@
1
+ import axios from 'axios';
2
+ import FormData from 'form-data';
3
+ import { Buffer } from 'buffer';
4
+
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
+ };
8
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
9
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
10
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
11
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
12
+
13
+ // src/core/ApiError.ts
14
+ var ApiError = class extends Error {
15
+ constructor(request2, response, message) {
16
+ super(message);
17
+ this.name = "ApiError";
18
+ this.url = response.url;
19
+ this.status = response.status;
20
+ this.statusText = response.statusText;
21
+ this.body = response.body;
22
+ this.request = request2;
23
+ }
24
+ };
25
+
26
+ // src/core/CancelablePromise.ts
27
+ var CancelError = class extends Error {
28
+ constructor(message) {
29
+ super(message);
30
+ this.name = "CancelError";
31
+ }
32
+ get isCancelled() {
33
+ return true;
34
+ }
35
+ };
36
+ var _isResolved, _isRejected, _isCancelled, _cancelHandlers, _promise, _resolve, _reject;
37
+ var CancelablePromise = class {
38
+ constructor(executor) {
39
+ __privateAdd(this, _isResolved);
40
+ __privateAdd(this, _isRejected);
41
+ __privateAdd(this, _isCancelled);
42
+ __privateAdd(this, _cancelHandlers);
43
+ __privateAdd(this, _promise);
44
+ __privateAdd(this, _resolve);
45
+ __privateAdd(this, _reject);
46
+ __privateSet(this, _isResolved, false);
47
+ __privateSet(this, _isRejected, false);
48
+ __privateSet(this, _isCancelled, false);
49
+ __privateSet(this, _cancelHandlers, []);
50
+ __privateSet(this, _promise, new Promise((resolve2, reject) => {
51
+ __privateSet(this, _resolve, resolve2);
52
+ __privateSet(this, _reject, reject);
53
+ const onResolve = (value) => {
54
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
55
+ return;
56
+ }
57
+ __privateSet(this, _isResolved, true);
58
+ if (__privateGet(this, _resolve)) __privateGet(this, _resolve).call(this, value);
59
+ };
60
+ const onReject = (reason) => {
61
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
62
+ return;
63
+ }
64
+ __privateSet(this, _isRejected, true);
65
+ if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, reason);
66
+ };
67
+ const onCancel = (cancelHandler) => {
68
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
69
+ return;
70
+ }
71
+ __privateGet(this, _cancelHandlers).push(cancelHandler);
72
+ };
73
+ Object.defineProperty(onCancel, "isResolved", {
74
+ get: () => __privateGet(this, _isResolved)
75
+ });
76
+ Object.defineProperty(onCancel, "isRejected", {
77
+ get: () => __privateGet(this, _isRejected)
78
+ });
79
+ Object.defineProperty(onCancel, "isCancelled", {
80
+ get: () => __privateGet(this, _isCancelled)
81
+ });
82
+ return executor(onResolve, onReject, onCancel);
83
+ }));
84
+ }
85
+ get [Symbol.toStringTag]() {
86
+ return "Cancellable Promise";
87
+ }
88
+ then(onFulfilled, onRejected) {
89
+ return __privateGet(this, _promise).then(onFulfilled, onRejected);
90
+ }
91
+ catch(onRejected) {
92
+ return __privateGet(this, _promise).catch(onRejected);
93
+ }
94
+ finally(onFinally) {
95
+ return __privateGet(this, _promise).finally(onFinally);
96
+ }
97
+ cancel() {
98
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
99
+ return;
100
+ }
101
+ __privateSet(this, _isCancelled, true);
102
+ if (__privateGet(this, _cancelHandlers).length) {
103
+ try {
104
+ for (const cancelHandler of __privateGet(this, _cancelHandlers)) {
105
+ cancelHandler();
106
+ }
107
+ } catch (error) {
108
+ console.warn("Cancellation threw an error", error);
109
+ return;
110
+ }
111
+ }
112
+ __privateGet(this, _cancelHandlers).length = 0;
113
+ if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, new CancelError("Request aborted"));
114
+ }
115
+ get isCancelled() {
116
+ return __privateGet(this, _isCancelled);
117
+ }
118
+ };
119
+ _isResolved = new WeakMap();
120
+ _isRejected = new WeakMap();
121
+ _isCancelled = new WeakMap();
122
+ _cancelHandlers = new WeakMap();
123
+ _promise = new WeakMap();
124
+ _resolve = new WeakMap();
125
+ _reject = new WeakMap();
126
+
127
+ // src/core/OpenAPI.ts
128
+ var OpenAPI = {
129
+ BASE: "https://api.stableflow.ai",
130
+ VERSION: "1.0.0",
131
+ WITH_CREDENTIALS: false,
132
+ CREDENTIALS: "include",
133
+ TOKEN: void 0,
134
+ NEARINTENTS_TOKEN: void 0,
135
+ USERNAME: void 0,
136
+ PASSWORD: void 0,
137
+ HEADERS: void 0,
138
+ ENCODE_PATH: void 0,
139
+ DEBUG: false
140
+ };
141
+
142
+ // src/utils/log.ts
143
+ var logStyles = {
144
+ "red-50": "background:oklch(97.1% 0.013 17.38);color:#000;",
145
+ "red-100": "background:oklch(93.6% 0.032 17.717);color:#000;",
146
+ "red-200": "background:oklch(88.5% 0.062 18.334);color:#000;",
147
+ "red-300": "background:oklch(80.8% 0.114 19.571);color:#000;",
148
+ "red-400": "background:oklch(70.4% 0.191 22.216);color:#fff;",
149
+ "red-500": "background:oklch(63.7% 0.237 25.331);color:#fff;",
150
+ "red-600": "background:oklch(57.7% 0.245 27.325);color:#fff;",
151
+ "red-700": "background:oklch(50.5% 0.213 27.518);color:#fff;",
152
+ "red-800": "background:oklch(44.4% 0.177 26.899);color:#fff;",
153
+ "red-900": "background:oklch(39.6% 0.141 25.723);color:#fff;",
154
+ "red-950": "background:oklch(25.8% 0.092 26.042);color:#fff;",
155
+ "yellow-50": "background:oklch(98.73% 0.0262 102.21);color:#000;",
156
+ "yellow-100": "background:oklch(97.29% 0.0693 103.19);color:#000;",
157
+ "yellow-200": "background:oklch(94.51% 0.1243 101.54);color:#000;",
158
+ "yellow-300": "background:oklch(90.52% 0.1657 98.11);color:#000;",
159
+ "yellow-400": "background:oklch(86.06% 0.1731 91.94);color:#fff;",
160
+ "yellow-500": "background:oklch(79.52% 0.1617 86.05);color:#fff;",
161
+ "yellow-600": "background:oklch(68.06% 0.1423 75.83);color:#fff;",
162
+ "yellow-700": "background:oklch(55.38% 0.1207 66.44);color:#fff;",
163
+ "yellow-800": "background:oklch(47.62% 0.1034 61.91);color:#fff;",
164
+ "yellow-900": "background:oklch(42.1% 0.0897 57.71);color:#fff;",
165
+ "yellow-950": "background:oklch(28.57% 0.0639 53.81);color:#fff;",
166
+ "green-50": "background:oklch(98.19% 0.0181 155.83);color:#000;",
167
+ "green-100": "background:oklch(96.24% 0.0434 156.74);color:#000;",
168
+ "green-200": "background:oklch(92.5% 0.0806 155.99);color:#000;",
169
+ "green-300": "background:oklch(87.12% 0.1363 154.45);color:#000;",
170
+ "green-400": "background:oklch(80.03% 0.1821 151.71);color:#fff;",
171
+ "green-500": "background:oklch(72.27% 0.192 149.58);color:#fff;",
172
+ "green-600": "background:oklch(62.71% 0.1699 149.21);color:#fff;",
173
+ "green-700": "background:oklch(52.73% 0.1371 150.07);color:#fff;",
174
+ "green-800": "background:oklch(44.79% 0.1083 151.33);color:#fff;",
175
+ "green-900": "background:oklch(39.25% 0.0896 152.54);color:#fff;",
176
+ "green-950": "background:oklch(26.64% 0.0628 152.93);color:#fff;",
177
+ "blue-50": "background:oklch(97.05% 0.0142 254.6);color:#000;",
178
+ "blue-100": "background:oklch(93.19% 0.0316 255.59);color:#000;",
179
+ "blue-200": "background:oklch(88.23% 0.0571 254.13);color:#000;",
180
+ "blue-300": "background:oklch(80.91% 0.0956 251.81);color:#000;",
181
+ "blue-400": "background:oklch(71.37% 0.1434 254.62);color:#fff;",
182
+ "blue-500": "background:oklch(62.31% 0.188 259.81);color:#fff;",
183
+ "blue-600": "background:oklch(54.61% 0.2152 262.88);color:#fff;",
184
+ "blue-700": "background:oklch(48.82% 0.2172 264.38);color:#fff;",
185
+ "blue-800": "background:oklch(42.44% 0.1809 265.64);color:#fff;",
186
+ "blue-900": "background:oklch(37.91% 0.1378 265.52);color:#fff;",
187
+ "blue-950": "background:oklch(28.23% 0.0874 267.94);color:#fff;",
188
+ "sky-50": "background:oklch(97.71% 0.0125 236.62);color:#000;",
189
+ "sky-100": "background:oklch(95.14% 0.025 236.82);color:#000;",
190
+ "sky-200": "background:oklch(90.14% 0.0555 230.9);color:#000;",
191
+ "sky-300": "background:oklch(82.76% 0.1013 230.32);color:#000;",
192
+ "sky-400": "background:oklch(75.35% 0.139 232.66);color:#fff;",
193
+ "sky-500": "background:oklch(68.47% 0.1479 237.32);color:#fff;",
194
+ "sky-600": "background:oklch(58.76% 0.1389 241.97);color:#fff;",
195
+ "sky-700": "background:oklch(50% 0.1193 242.75);color:#fff;",
196
+ "sky-800": "background:oklch(44.34% 0.1 240.79);color:#fff;",
197
+ "sky-900": "background:oklch(39.12% 0.0845 240.88);color:#fff;",
198
+ "sky-950": "background:oklch(29.35% 0.0632 243.16);color:#fff;",
199
+ "teal-50": "background:oklch(98.36% 0.0142 180.72);color:#000;",
200
+ "teal-100": "background:oklch(95.27% 0.0498 180.8);color:#000;",
201
+ "teal-200": "background:oklch(91% 0.0927 180.43);color:#000;",
202
+ "teal-300": "background:oklch(85.49% 0.1251 181.07);color:#000;",
203
+ "teal-400": "background:oklch(78.45% 0.1325 181.91);color:#fff;",
204
+ "teal-500": "background:oklch(70.38% 0.123 182.5);color:#fff;",
205
+ "teal-600": "background:oklch(60.02% 0.1038 184.7);color:#fff;",
206
+ "teal-700": "background:oklch(51.09% 0.0861 186.39);color:#fff;",
207
+ "teal-800": "background:oklch(43.7% 0.0705 188.22);color:#fff;",
208
+ "teal-900": "background:oklch(38.61% 0.059 188.42);color:#fff;",
209
+ "teal-950": "background:oklch(27.73% 0.0447 192.52);color:#fff;",
210
+ "purple-50": "background:oklch(97.68% 0.0142 308.3);color:#000;",
211
+ "purple-100": "background:oklch(94.64% 0.0327 307.17);color:#000;",
212
+ "purple-200": "background:oklch(90.24% 0.0604 306.7);color:#000;",
213
+ "purple-300": "background:oklch(82.68% 0.1082 306.38);color:#000;",
214
+ "purple-400": "background:oklch(72.17% 0.1767 305.5);color:#fff;",
215
+ "purple-500": "background:oklch(62.68% 0.2325 303.9);color:#fff;",
216
+ "purple-600": "background:oklch(55.75% 0.2525 302.32);color:#fff;",
217
+ "purple-700": "background:oklch(49.55% 0.2369 301.92);color:#fff;",
218
+ "purple-800": "background:oklch(43.83% 0.1983 303.72);color:#fff;",
219
+ "purple-900": "background:oklch(38.07% 0.1661 304.99);color:#fff;",
220
+ "purple-950": "background:oklch(29.05% 0.1432 302.72);color:#fff;",
221
+ "pink-50": "background:oklch(97.14% 0.0141 343.2);color:#000;",
222
+ "pink-100": "background:oklch(94.82% 0.0276 342.26);color:#000;",
223
+ "pink-200": "background:oklch(89.94% 0.0589 343.23);color:#000;",
224
+ "pink-300": "background:oklch(82.28% 0.1095 346.02);color:#000;",
225
+ "pink-400": "background:oklch(72.53% 0.1752 349.76);color:#fff;",
226
+ "pink-500": "background:oklch(65.59% 0.2118 354.31);color:#fff;",
227
+ "pink-600": "background:oklch(59.16% 0.218 354.58);color:#fff;",
228
+ "pink-700": "background:oklch(52.46% 0.199 353.96);color:#fff;",
229
+ "pink-800": "background:oklch(45.87% 0.1697 353.82);color:#fff;",
230
+ "pink-900": "background:oklch(40.78% 0.1442 352.43);color:#fff;",
231
+ "pink-950": "background:oklch(28.45% 0.1048 353.91);color:#fff;",
232
+ "rose-50": "background:oklch(96.94% 0.0151 12.42);color:#000;",
233
+ "rose-100": "background:oklch(94.14% 0.0297 12.58);color:#000;",
234
+ "rose-200": "background:oklch(89.24% 0.0559 10);color:#000;",
235
+ "rose-300": "background:oklch(80.97% 0.1061 11.64);color:#000;",
236
+ "rose-400": "background:oklch(71.92% 0.169 13.43);color:#fff;",
237
+ "rose-500": "background:oklch(64.5% 0.2154 16.44);color:#fff;",
238
+ "rose-600": "background:oklch(58.58% 0.222 17.58);color:#fff;",
239
+ "rose-700": "background:oklch(51.43% 0.1978 16.93);color:#fff;",
240
+ "rose-800": "background:oklch(45.46% 0.1713 13.7);color:#fff;",
241
+ "rose-900": "background:oklch(41.03% 0.1502 10.27);color:#fff;",
242
+ "rose-950": "background:oklch(27.08% 0.1009 12.09);color:#fff;",
243
+ "gray-50": "background:oklch(98.46% 0.0017 247.84);color:#000;",
244
+ "gray-100": "background:oklch(96.7% 0.0029 264.54);color:#000;",
245
+ "gray-200": "background:oklch(92.76% 0.0058 264.53);color:#000;",
246
+ "gray-300": "background:oklch(87.17% 0.0093 258.34);color:#000;",
247
+ "gray-400": "background:oklch(71.37% 0.0192 261.32);color:#fff;",
248
+ "gray-500": "background:oklch(55.1% 0.0234 264.36);color:#fff;",
249
+ "gray-600": "background:oklch(44.55% 0.0234 264.36);color:#fff;",
250
+ "gray-700": "background:oklch(37.29% 0.0306 259.73);color:#fff;",
251
+ "gray-800": "background:oklch(27.81% 0.0296 256.85);color:#fff;",
252
+ "gray-900": "background:oklch(21.01% 0.0318 264.66);color:#fff;",
253
+ "gray-950": "background:oklch(12.96% 0.0274 261.69);color:#fff;",
254
+ "indigo-50": "background:oklch(96.2% 0.018 272.314);color:#000;",
255
+ "indigo-100": "background:oklch(93% 0.034 272.788);color:#000;",
256
+ "indigo-200": "background:oklch(87% 0.065 274.039);color:#000;",
257
+ "indigo-300": "background:oklch(78.5% 0.115 274.713);color:#000;",
258
+ "indigo-400": "background:oklch(67.3% 0.182 276.935);color:#fff;",
259
+ "indigo-500": "background:oklch(58.5% 0.233 277.117);color:#fff;",
260
+ "indigo-600": "background:oklch(51.1% 0.262 276.966);color:#fff;",
261
+ "indigo-700": "background:oklch(45.7% 0.24 277.023);color:#fff;",
262
+ "indigo-800": "background:oklch(39.8% 0.195 277.366);color:#fff;",
263
+ "indigo-900": "background:oklch(35.9% 0.144 278.697);color:#fff;",
264
+ "indigo-950": "background:oklch(25.7% 0.09 281.288);color:#fff;",
265
+ "fuchsia-50": "background:oklch(97.7% 0.017 320.058);color:#000;",
266
+ "fuchsia-100": "background:oklch(95.2% 0.037 318.852);color:#000;",
267
+ "fuchsia-200": "background:oklch(90.3% 0.076 319.62);color:#000;",
268
+ "fuchsia-300": "background:oklch(83.3% 0.145 321.434);color:#000;",
269
+ "fuchsia-400": "background:oklch(74% 0.238 322.16);color:#fff;",
270
+ "fuchsia-500": "background:oklch(66.7% 0.295 322.15);color:#fff;",
271
+ "fuchsia-600": "background:oklch(59.1% 0.293 322.896);color:#fff;",
272
+ "fuchsia-700": "background:oklch(51.8% 0.253 323.949);color:#fff;",
273
+ "fuchsia-800": "background:oklch(45.2% 0.211 324.591);color:#fff;",
274
+ "fuchsia-900": "background:oklch(40.1% 0.17 325.612);color:#fff;",
275
+ "fuchsia-950": "background:oklch(29.3% 0.136 325.661);color:#fff;",
276
+ "stone-50": "background:oklch(98.5% 0.001 106.423);color:#000;",
277
+ "stone-100": "background:oklch(97% 0.001 106.424);color:#000;",
278
+ "stone-200": "background:oklch(92.3% 0.003 48.717);color:#000;",
279
+ "stone-300": "background:oklch(86.9% 0.005 56.366);color:#000;",
280
+ "stone-400": "background:oklch(70.9% 0.01 56.259);color:#fff;",
281
+ "stone-500": "background:oklch(55.3% 0.013 58.071);color:#fff;",
282
+ "stone-600": "background:oklch(44.4% 0.011 73.639);color:#fff;",
283
+ "stone-700": "background:oklch(37.4% 0.01 67.558);color:#fff;",
284
+ "stone-800": "background:oklch(26.8% 0.007 34.298);color:#fff;",
285
+ "stone-900": "background:oklch(21.6% 0.006 56.043);color:#fff;",
286
+ "stone-950": "background:oklch(14.7% 0.004 49.25);color:#fff;",
287
+ "lime-50": "background:oklch(98.6% 0.031 120.757);color:#000;",
288
+ "lime-100": "background:oklch(96.7% 0.067 122.328);color:#000;",
289
+ "lime-200": "background:oklch(93.8% 0.127 124.321);color:#000;",
290
+ "lime-300": "background:oklch(89.7% 0.196 126.665);color:#000;",
291
+ "lime-400": "background:oklch(84.1% 0.238 128.85);color:#fff;",
292
+ "lime-500": "background:oklch(76.8% 0.233 130.85);color:#fff;",
293
+ "lime-600": "background:oklch(64.8% 0.2 131.684);color:#fff;",
294
+ "lime-700": "background:oklch(53.2% 0.157 131.589);color:#fff;",
295
+ "lime-800": "background:oklch(45.3% 0.124 130.933);color:#fff;",
296
+ "lime-900": "background:oklch(40.5% 0.101 131.063);color:#fff;",
297
+ "lime-950": "background:oklch(27.4% 0.072 132.109);color:#fff;"
298
+ };
299
+ var csl = (isDebug, type, style, str, ...args) => {
300
+ if (!isDebug) {
301
+ return;
302
+ }
303
+ const _style = logStyles[style] || logStyles["blue-400"];
304
+ console.log(`%c[StableFlowAiSDK]${type ? ".[" + type + "]" : ""} ${str}`, _style, ...args);
305
+ };
306
+ var Csl = class {
307
+ constructor(isDebug) {
308
+ this.log = (type, style, str, ...args) => {
309
+ csl(this.isDebug, type, style, str, ...args);
310
+ };
311
+ this.info = (type, str, ...args) => {
312
+ csl(this.isDebug, type, "blue-400", str, ...args);
313
+ };
314
+ this.error = (type, str, ...args) => {
315
+ csl(this.isDebug, type, "red-400", str, ...args);
316
+ };
317
+ this.success = (type, str, ...args) => {
318
+ csl(this.isDebug, type, "green-400", str, ...args);
319
+ };
320
+ this.simple = (str, ...args) => {
321
+ csl(this.isDebug, "", "blue-400", str, ...args);
322
+ };
323
+ this.isDebug = isDebug;
324
+ }
325
+ };
326
+ var isDefined = (value) => {
327
+ return value !== void 0 && value !== null;
328
+ };
329
+ var isString = (value) => {
330
+ return typeof value === "string";
331
+ };
332
+ var isStringWithValue = (value) => {
333
+ return isString(value) && value !== "";
334
+ };
335
+ var isBlob = (value) => {
336
+ return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
337
+ };
338
+ var isFormData = (value) => {
339
+ return value instanceof FormData;
340
+ };
341
+ var isSuccess = (status) => {
342
+ return status >= 200 && status < 300;
343
+ };
344
+ var base64 = (str) => {
345
+ try {
346
+ return btoa(str);
347
+ } catch (err) {
348
+ return Buffer.from(str).toString("base64");
349
+ }
350
+ };
351
+ var getQueryString = (params) => {
352
+ const qs = [];
353
+ const append = (key, value) => {
354
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
355
+ };
356
+ const process = (key, value) => {
357
+ if (isDefined(value)) {
358
+ if (Array.isArray(value)) {
359
+ value.forEach((v) => {
360
+ process(key, v);
361
+ });
362
+ } else if (typeof value === "object") {
363
+ Object.entries(value).forEach(([k, v]) => {
364
+ process(`${key}[${k}]`, v);
365
+ });
366
+ } else {
367
+ append(key, value);
368
+ }
369
+ }
370
+ };
371
+ Object.entries(params).forEach(([key, value]) => {
372
+ process(key, value);
373
+ });
374
+ if (qs.length > 0) {
375
+ return `?${qs.join("&")}`;
376
+ }
377
+ return "";
378
+ };
379
+ var getUrl = (config, options) => {
380
+ const encoder = config.ENCODE_PATH || encodeURI;
381
+ const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
382
+ if (options.path?.hasOwnProperty(group)) {
383
+ return encoder(String(options.path[group]));
384
+ }
385
+ return substring;
386
+ });
387
+ const url = `${config.BASE}${path}`;
388
+ if (options.query) {
389
+ return `${url}${getQueryString(options.query)}`;
390
+ }
391
+ return url;
392
+ };
393
+ var getFormData = (options) => {
394
+ if (options.formData) {
395
+ const formData = new FormData();
396
+ const process = (key, value) => {
397
+ if (isString(value) || isBlob(value)) {
398
+ formData.append(key, value);
399
+ } else {
400
+ formData.append(key, JSON.stringify(value));
401
+ }
402
+ };
403
+ Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
404
+ if (Array.isArray(value)) {
405
+ value.forEach((v) => process(key, v));
406
+ } else {
407
+ process(key, value);
408
+ }
409
+ });
410
+ return formData;
411
+ }
412
+ return void 0;
413
+ };
414
+ var resolve = async (options, resolver) => {
415
+ if (typeof resolver === "function") {
416
+ return resolver(options);
417
+ }
418
+ return resolver;
419
+ };
420
+ var getHeaders = async (config, options, formData) => {
421
+ const [token, username, password, additionalHeaders, nearintentsToken] = await Promise.all([
422
+ resolve(options, config.TOKEN),
423
+ resolve(options, config.USERNAME),
424
+ resolve(options, config.PASSWORD),
425
+ resolve(options, config.HEADERS),
426
+ resolve(options, config.NEARINTENTS_TOKEN)
427
+ ]);
428
+ const formHeaders = typeof formData?.getHeaders === "function" && formData?.getHeaders() || {};
429
+ const headers = Object.entries({
430
+ Accept: "application/json",
431
+ ...additionalHeaders,
432
+ ...options.headers,
433
+ ...formHeaders
434
+ }).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
435
+ ...headers2,
436
+ [key]: String(value)
437
+ }), {});
438
+ if (isStringWithValue(token)) {
439
+ headers["Authorization"] = `Bearer ${token}`;
440
+ }
441
+ if (isStringWithValue(nearintentsToken)) {
442
+ headers["nearintent-api-key"] = nearintentsToken;
443
+ }
444
+ if (isStringWithValue(username) && isStringWithValue(password)) {
445
+ const credentials = base64(`${username}:${password}`);
446
+ headers["Authorization"] = `Basic ${credentials}`;
447
+ }
448
+ if (options.body !== void 0) {
449
+ if (options.mediaType) {
450
+ headers["Content-Type"] = options.mediaType;
451
+ } else if (isBlob(options.body)) {
452
+ headers["Content-Type"] = options.body.type || "application/octet-stream";
453
+ } else if (isString(options.body)) {
454
+ headers["Content-Type"] = "text/plain";
455
+ } else if (!isFormData(options.body)) {
456
+ headers["Content-Type"] = "application/json";
457
+ }
458
+ }
459
+ return headers;
460
+ };
461
+ var getRequestBody = (options) => {
462
+ if (options.body) {
463
+ return options.body;
464
+ }
465
+ return void 0;
466
+ };
467
+ var sendRequest = async (config, options, url, body, formData, headers, onCancel, axiosClient) => {
468
+ const source = axios.CancelToken.source();
469
+ const requestConfig = {
470
+ url,
471
+ headers,
472
+ data: body ?? formData,
473
+ method: options.method,
474
+ withCredentials: config.WITH_CREDENTIALS,
475
+ withXSRFToken: config.CREDENTIALS === "include" ? config.WITH_CREDENTIALS : false,
476
+ cancelToken: source.token,
477
+ timeout: options.timeout
478
+ };
479
+ onCancel(() => source.cancel("The user aborted a request."));
480
+ try {
481
+ return await axiosClient.request(requestConfig);
482
+ } catch (error) {
483
+ const axiosError = error;
484
+ if (axiosError.response) {
485
+ return axiosError.response;
486
+ }
487
+ throw error;
488
+ }
489
+ };
490
+ var getResponseHeader = (response, responseHeader) => {
491
+ if (responseHeader) {
492
+ const content = response.headers[responseHeader];
493
+ if (isString(content)) {
494
+ return content;
495
+ }
496
+ }
497
+ return void 0;
498
+ };
499
+ var getResponseBody = (response) => {
500
+ if (response.status !== 204) {
501
+ return response.data;
502
+ }
503
+ return void 0;
504
+ };
505
+ var catchErrorCodes = (options, result) => {
506
+ const errors = {
507
+ 401: "Unauthorized",
508
+ ...options.errors
509
+ };
510
+ const error = errors[result.status];
511
+ if (error) {
512
+ throw new ApiError(options, result, error);
513
+ }
514
+ if (!result.ok) {
515
+ const errorStatus = result.status ?? "unknown";
516
+ const errorStatusText = result.statusText ?? "unknown";
517
+ const errorBody = (() => {
518
+ try {
519
+ return JSON.stringify(result.body, null, 2);
520
+ } catch (e) {
521
+ return void 0;
522
+ }
523
+ })();
524
+ throw new ApiError(
525
+ options,
526
+ result,
527
+ `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
528
+ );
529
+ }
530
+ };
531
+ var request = (config, options, axiosClient = axios) => {
532
+ const csl2 = new Csl(config.DEBUG);
533
+ return new CancelablePromise(async (resolve2, reject, onCancel) => {
534
+ try {
535
+ const url = getUrl(config, options);
536
+ const formData = getFormData(options);
537
+ const body = getRequestBody(options);
538
+ const headers = await getHeaders(config, options, formData);
539
+ csl2.simple("\n\u{1F535} ========== API Request ==========");
540
+ csl2.simple("Method:", options.method);
541
+ csl2.simple("URL:", url);
542
+ csl2.simple("Headers:", JSON.stringify(headers, null, 2));
543
+ if (body) {
544
+ csl2.simple("Body:", JSON.stringify(body, null, 2));
545
+ }
546
+ if (formData) {
547
+ csl2.simple("FormData:", formData);
548
+ }
549
+ csl2.simple("====================================\n");
550
+ if (!onCancel.isCancelled) {
551
+ const response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient);
552
+ const responseBody = getResponseBody(response);
553
+ const responseHeader = getResponseHeader(response, options.responseHeader);
554
+ const result = {
555
+ url,
556
+ ok: isSuccess(response.status),
557
+ status: response.status,
558
+ statusText: response.statusText,
559
+ body: responseHeader ?? responseBody
560
+ };
561
+ catchErrorCodes(options, result);
562
+ csl2.simple("\n\u{1F7E2} ========== API Response ==========");
563
+ csl2.simple("Status:", response.status, response.statusText);
564
+ csl2.simple("Response Headers:", JSON.stringify(response.headers, null, 2));
565
+ csl2.simple("Response Body:", JSON.stringify(responseBody, null, 2));
566
+ csl2.simple("=====================================\n");
567
+ resolve2(result.body);
568
+ }
569
+ } catch (error) {
570
+ csl2.simple("\n\u{1F534} ========== API Error ==========");
571
+ csl2.simple("Error:", error);
572
+ if (error instanceof ApiError) {
573
+ csl2.simple("Status:", error.status);
574
+ csl2.simple("Status Text:", error.statusText);
575
+ csl2.simple("URL:", error.url);
576
+ csl2.simple("Body:", JSON.stringify(error.body, null, 2));
577
+ }
578
+ csl2.simple("==================================\n");
579
+ reject(error);
580
+ }
581
+ });
582
+ };
583
+
584
+ // src/core/Fetch.ts
585
+ var REQUEST_ERRORS = {
586
+ 401: `Unauthorized - JWT token is invalid`
587
+ };
588
+ var getRequest = (url, query) => {
589
+ return request(OpenAPI, {
590
+ method: "GET",
591
+ timeout: 3e4,
592
+ url,
593
+ query,
594
+ headers: {
595
+ "Content-Type": "application/json"
596
+ },
597
+ errors: REQUEST_ERRORS
598
+ });
599
+ };
600
+ var postRequest = (url, data) => {
601
+ return request(OpenAPI, {
602
+ method: "POST",
603
+ timeout: 3e4,
604
+ url,
605
+ body: data,
606
+ mediaType: "application/json",
607
+ errors: REQUEST_ERRORS
608
+ });
609
+ };
610
+
611
+ // src/core/Send.ts
612
+ var SendType = /* @__PURE__ */ ((SendType2) => {
613
+ SendType2["SEND"] = "SEND";
614
+ SendType2["TRANSFER"] = "TRANSFER";
615
+ return SendType2;
616
+ })(SendType || {});
617
+
618
+ // src/core/Service.ts
619
+ var Service = {
620
+ OneClick: "oneclick",
621
+ Usdt0: "usdt0",
622
+ CCTP: "cctp",
623
+ FraxZero: "fraxzero",
624
+ FraxZeroOneClick: "fraxzero-oneclick",
625
+ OneClickFraxZero: "oneclick-fraxzero",
626
+ Usdt0OneClick: "usdt0-oneclick",
627
+ OneClickUsdt0: "oneclick-usdt0",
628
+ Native: "native"
629
+ };
630
+ var ServiceBackend = {
631
+ [Service.OneClick]: "nearintents",
632
+ [Service.Usdt0]: "layerzero",
633
+ [Service.CCTP]: "cctp",
634
+ [Service.FraxZero]: "fraxzero",
635
+ [Service.FraxZeroOneClick]: "fraxzerointent",
636
+ [Service.OneClickFraxZero]: "intentfraxzero",
637
+ [Service.Usdt0OneClick]: "zerointent",
638
+ [Service.OneClickUsdt0]: "intentzero",
639
+ [Service.Native]: "native"
640
+ };
641
+ ({
642
+ [0 /* OneClick */]: { service: Service.OneClick },
643
+ [1 /* Usdt0 */]: { service: Service.Usdt0 },
644
+ [2 /* CCTP */]: { service: Service.CCTP },
645
+ [6 /* FraxZero */]: { service: Service.FraxZero },
646
+ [7 /* FraxZeroOneClick */]: { service: Service.FraxZeroOneClick },
647
+ [8 /* OneClickFraxZero */]: { service: Service.OneClickFraxZero },
648
+ [3 /* Usdt0OneClick */]: { service: Service.Usdt0OneClick },
649
+ [4 /* OneClickUsdt0 */]: { service: Service.OneClickUsdt0 },
650
+ [5 /* Native */]: { service: Service.Native }
651
+ });
652
+
653
+ // src/models/ServiceStatus.ts
654
+ var OneClickStatus = /* @__PURE__ */ ((OneClickStatus2) => {
655
+ OneClickStatus2["KNOWN_DEPOSIT_TX"] = "KNOWN_DEPOSIT_TX";
656
+ OneClickStatus2["PENDING_DEPOSIT"] = "PENDING_DEPOSIT";
657
+ OneClickStatus2["INCOMPLETE_DEPOSIT"] = "INCOMPLETE_DEPOSIT";
658
+ OneClickStatus2["PROCESSING"] = "PROCESSING";
659
+ OneClickStatus2["SUCCESS"] = "SUCCESS";
660
+ OneClickStatus2["REFUNDED"] = "REFUNDED";
661
+ OneClickStatus2["FAILED"] = "FAILED";
662
+ return OneClickStatus2;
663
+ })(OneClickStatus || {});
664
+ var LayerZeroStatus = /* @__PURE__ */ ((LayerZeroStatus2) => {
665
+ LayerZeroStatus2["DELIVERED"] = "DELIVERED";
666
+ LayerZeroStatus2["INFLIGHT"] = "INFLIGHT";
667
+ LayerZeroStatus2["PAYLOAD_STORED"] = "PAYLOAD_STORED";
668
+ LayerZeroStatus2["FAILED"] = "FAILED";
669
+ LayerZeroStatus2["BLOCKED"] = "BLOCKED";
670
+ LayerZeroStatus2["CONFIRMING"] = "CONFIRMING";
671
+ LayerZeroStatus2["APPLICATION_BURNED"] = "APPLICATION_BURNED";
672
+ LayerZeroStatus2["APPLICATION_SKIPPED"] = "APPLICATION_SKIPPED";
673
+ LayerZeroStatus2["UNRESOLVABLE_COMMAND"] = "UNRESOLVABLE_COMMAND";
674
+ LayerZeroStatus2["MALFORMED_COMMAND"] = "MALFORMED_COMMAND";
675
+ return LayerZeroStatus2;
676
+ })(LayerZeroStatus || {});
677
+ var StableflowStatus = /* @__PURE__ */ ((StableflowStatus2) => {
678
+ StableflowStatus2[StableflowStatus2["PENDING"] = 0] = "PENDING";
679
+ StableflowStatus2[StableflowStatus2["SUCCESS"] = 1] = "SUCCESS";
680
+ StableflowStatus2[StableflowStatus2["FAILED"] = 2] = "FAILED";
681
+ StableflowStatus2[StableflowStatus2["CONFIRMING"] = 3] = "CONFIRMING";
682
+ StableflowStatus2[StableflowStatus2["CONTINUE"] = 4] = "CONTINUE";
683
+ StableflowStatus2[StableflowStatus2["LAYERZERO_SUBMITTED"] = 5] = "LAYERZERO_SUBMITTED";
684
+ return StableflowStatus2;
685
+ })(StableflowStatus || {});
686
+
687
+ // src/models/QuoteRequest.ts
688
+ var QuoteRequest;
689
+ ((QuoteRequest2) => {
690
+ ((depositMode2) => {
691
+ depositMode2["SIMPLE"] = "SIMPLE";
692
+ depositMode2["MEMO"] = "MEMO";
693
+ })(QuoteRequest2.depositMode || (QuoteRequest2.depositMode = {}));
694
+ ((swapType2) => {
695
+ swapType2["EXACT_INPUT"] = "EXACT_INPUT";
696
+ swapType2["EXACT_OUTPUT"] = "EXACT_OUTPUT";
697
+ swapType2["FLEX_INPUT"] = "FLEX_INPUT";
698
+ })(QuoteRequest2.swapType || (QuoteRequest2.swapType = {}));
699
+ ((depositType2) => {
700
+ depositType2["ORIGIN_CHAIN"] = "ORIGIN_CHAIN";
701
+ depositType2["INTENTS"] = "INTENTS";
702
+ })(QuoteRequest2.depositType || (QuoteRequest2.depositType = {}));
703
+ ((refundType2) => {
704
+ refundType2["ORIGIN_CHAIN"] = "ORIGIN_CHAIN";
705
+ refundType2["INTENTS"] = "INTENTS";
706
+ })(QuoteRequest2.refundType || (QuoteRequest2.refundType = {}));
707
+ ((recipientType2) => {
708
+ recipientType2["DESTINATION_CHAIN"] = "DESTINATION_CHAIN";
709
+ recipientType2["INTENTS"] = "INTENTS";
710
+ })(QuoteRequest2.recipientType || (QuoteRequest2.recipientType = {}));
711
+ })(QuoteRequest || (QuoteRequest = {}));
712
+
713
+ // src/models/TokenResponse.ts
714
+ var TokenResponse;
715
+ ((TokenResponse2) => {
716
+ ((blockchain2) => {
717
+ blockchain2["NEAR"] = "near";
718
+ blockchain2["ETH"] = "eth";
719
+ blockchain2["BASE"] = "base";
720
+ blockchain2["ARB"] = "arb";
721
+ blockchain2["BTC"] = "btc";
722
+ blockchain2["SOL"] = "sol";
723
+ blockchain2["TON"] = "ton";
724
+ blockchain2["DOGE"] = "doge";
725
+ blockchain2["XRP"] = "xrp";
726
+ blockchain2["ZEC"] = "zec";
727
+ blockchain2["GNOSIS"] = "gnosis";
728
+ blockchain2["BERA"] = "bera";
729
+ blockchain2["BSC"] = "bsc";
730
+ blockchain2["POL"] = "pol";
731
+ blockchain2["TRON"] = "tron";
732
+ blockchain2["SUI"] = "sui";
733
+ blockchain2["OP"] = "op";
734
+ blockchain2["AVAX"] = "avax";
735
+ blockchain2["CARDANO"] = "cardano";
736
+ })(TokenResponse2.blockchain || (TokenResponse2.blockchain = {}));
737
+ })(TokenResponse || (TokenResponse = {}));
738
+
739
+ // src/models/Status.ts
740
+ var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => {
741
+ TransactionStatus2["Pending"] = "pending";
742
+ TransactionStatus2["Success"] = "success";
743
+ TransactionStatus2["Failed"] = "failed";
744
+ return TransactionStatus2;
745
+ })(TransactionStatus || {});
746
+
747
+ // src/services/SFA.ts
748
+ var submitOneclickDepositTx = (requestBody) => {
749
+ return postRequest("/v0/deposit/submit", requestBody);
750
+ };
751
+ var SFA = class {
752
+ /**
753
+ * Get supported tokens
754
+ * Retrieves a list of tokens currently supported by the StableFlow AI API for asset swaps.
755
+ */
756
+ static getTokens() {
757
+ return getRequest("/v0/tokens");
758
+ }
759
+ /**
760
+ * Request a swap quote
761
+ * Generates a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.
762
+ */
763
+ static getQuote(requestBody) {
764
+ return postRequest("/v0/quote", {
765
+ ...requestBody,
766
+ referral: "stableflow"
767
+ });
768
+ }
769
+ /**
770
+ * Check swap execution status
771
+ * Retrieves the current status of a swap using the unique deposit address from the quote.
772
+ */
773
+ static getExecutionStatus(depositAddress, depositMemo) {
774
+ return getRequest("/v0/status", {
775
+ "depositAddress": depositAddress,
776
+ "depositMemo": depositMemo
777
+ });
778
+ }
779
+ };
780
+ /**
781
+ * Submit deposit transaction hash (OneClick)
782
+ * Optionally notifies the service that a deposit has been sent to the specified address.
783
+ */
784
+ SFA.submitDepositTx = submitOneclickDepositTx;
785
+
786
+ // src/wallets/config/rpcs.ts
787
+ var NetworkRpcUrlsMap = {
788
+ "eth": ["https://0xrpc.io/eth"],
789
+ "arb": ["https://arb1.arbitrum.io/rpc"],
790
+ "bsc": ["https://56.rpc.thirdweb.com"],
791
+ "avax": ["https://api.avax.network/ext/bc/C/rpc"],
792
+ "base": ["https://mainnet.base.org"],
793
+ "pol": ["https://polygon-rpc.com"],
794
+ "gnosis": ["https://rpc.gnosischain.com"],
795
+ "op": ["https://mainnet.optimism.io"],
796
+ "bera": ["https://rpc.berachain.com"],
797
+ "tron": ["https://api.trongrid.io"],
798
+ "aptos": ["https://api.mainnet.aptoslabs.com/v1"],
799
+ "sol": ["https://solana-rpc.publicnode.com"],
800
+ "near": ["https://nearinner.deltarpc.com"],
801
+ "xlayer": ["https://rpc.xlayer.tech"],
802
+ "plasma": ["https://rpc.plasma.to"],
803
+ "mantle": ["https://rpc.mantle.xyz", "https://mantle-rpc.publicnode.com"],
804
+ "megaeth": ["https://mainnet.megaeth.com/rpc"],
805
+ "ink": ["https://rpc-gel.inkonchain.com", "https://rpc-qnd.inkonchain.com"],
806
+ "stable": ["https://rpc.stable.xyz"],
807
+ "celo": ["https://forno.celo.org"],
808
+ "sei": ["https://sei-evm-rpc.publicnode.com"],
809
+ "flare": ["https://flare-api.flare.network/ext/C/rpc"],
810
+ "frax": ["https://rpc.frax.com"],
811
+ "ton": ["https://toncenter.com/api/v2/jsonRPC"],
812
+ "sui": ["https://fullnode.mainnet.sui.io:443"],
813
+ "katana": ["https://rpc.katana.network", "https://katana.drpc.org"]
814
+ };
815
+ var getRpcUrls = (blockchain) => {
816
+ return NetworkRpcUrlsMap[blockchain] || [];
817
+ };
818
+ var getChainRpcUrl = (blockchain) => {
819
+ return {
820
+ rpcUrls: NetworkRpcUrlsMap[blockchain],
821
+ rpcUrl: NetworkRpcUrlsMap[blockchain][0]
822
+ };
823
+ };
824
+ var setRpcUrls = (urls) => {
825
+ for (const blockchain in urls) {
826
+ const prev = NetworkRpcUrlsMap[blockchain] ?? [];
827
+ const next = urls[blockchain];
828
+ for (let i = next.length - 1; i >= 0; i--) {
829
+ const rpc = next[i];
830
+ if (prev.some((_rpc) => _rpc.toLowerCase() === rpc.toLowerCase())) {
831
+ continue;
832
+ }
833
+ prev.unshift(rpc);
834
+ }
835
+ }
836
+ return NetworkRpcUrlsMap;
837
+ };
838
+
839
+ // src/wallets/config/chains.ts
840
+ var chainTypes = {
841
+ near: {
842
+ value: "near"},
843
+ sol: {
844
+ value: "sol"},
845
+ evm: {
846
+ value: "evm"},
847
+ tron: {
848
+ value: "tron"},
849
+ aptos: {
850
+ value: "aptos"},
851
+ ton: {
852
+ value: "ton"},
853
+ sui: {
854
+ value: "sui"}
855
+ };
856
+ var getStableflowChainLogo = (name) => {
857
+ return `/chains/${name}.png`;
858
+ };
859
+ var chains = {
860
+ near: {
861
+ chainName: "Near",
862
+ blockchain: "near",
863
+ chainIcon: getStableflowChainLogo("near"),
864
+ chainIconGray: getStableflowChainLogo("near-gray"),
865
+ chainType: chainTypes.near.value,
866
+ blockExplorerUrl: "https://nearblocks.io/txns",
867
+ blockExplorerUrls: ["https://nearblocks.io"],
868
+ primaryColor: "#76EA9E",
869
+ nativeToken: {
870
+ symbol: "NEAR",
871
+ decimals: 24
872
+ },
873
+ ...getChainRpcUrl("near")
874
+ },
875
+ sol: {
876
+ chainName: "Solana",
877
+ blockchain: "sol",
878
+ chainIcon: getStableflowChainLogo("solana"),
879
+ chainIconGray: getStableflowChainLogo("solana-gray"),
880
+ chainType: chainTypes.sol.value,
881
+ blockExplorerUrl: "https://solscan.io/tx",
882
+ blockExplorerUrls: ["https://solscan.io"],
883
+ primaryColor: "#B93EF0",
884
+ nativeToken: {
885
+ symbol: "SOL",
886
+ decimals: 9
887
+ },
888
+ ...getChainRpcUrl("sol")
889
+ },
890
+ eth: {
891
+ chainName: "Ethereum",
892
+ blockchain: "eth",
893
+ chainIcon: getStableflowChainLogo("Ethereum"),
894
+ chainIconGray: getStableflowChainLogo("Ethereum-gray"),
895
+ chainType: chainTypes.evm.value,
896
+ chainId: 1,
897
+ blockExplorerUrl: "https://etherscan.io/tx",
898
+ blockExplorerUrls: ["https://etherscan.io"],
899
+ primaryColor: "#7083ee",
900
+ nativeToken: {
901
+ symbol: "ETH",
902
+ decimals: 18
903
+ },
904
+ ...getChainRpcUrl("eth")
905
+ },
906
+ arb: {
907
+ chainName: "Arbitrum",
908
+ blockchain: "arb",
909
+ chainIcon: getStableflowChainLogo("Arbitrum"),
910
+ chainIconGray: getStableflowChainLogo("Arbitrum-gray"),
911
+ chainType: chainTypes.evm.value,
912
+ chainId: 42161,
913
+ blockExplorerUrl: "https://arbiscan.io/tx",
914
+ blockExplorerUrls: ["https://arbiscan.io"],
915
+ primaryColor: "#4763A7",
916
+ nativeToken: {
917
+ symbol: "ETH",
918
+ decimals: 18
919
+ },
920
+ ...getChainRpcUrl("arb")
921
+ },
922
+ bsc: {
923
+ chainName: "BNB Chain",
924
+ blockchain: "bsc",
925
+ chainIcon: getStableflowChainLogo("bsc"),
926
+ chainIconGray: getStableflowChainLogo("bsc-gray"),
927
+ chainType: chainTypes.evm.value,
928
+ chainId: 56,
929
+ blockExplorerUrl: "https://bscscan.com/tx",
930
+ blockExplorerUrls: ["https://bscscan.com"],
931
+ primaryColor: "#F1C144",
932
+ nativeToken: {
933
+ symbol: "BNB",
934
+ decimals: 18
935
+ },
936
+ ...getChainRpcUrl("bsc")
937
+ },
938
+ avax: {
939
+ chainName: "Avalanche",
940
+ blockchain: "avax",
941
+ chainIcon: getStableflowChainLogo("Avalanche"),
942
+ chainIconGray: getStableflowChainLogo("Avalanche-gray"),
943
+ chainType: chainTypes.evm.value,
944
+ chainId: 43114,
945
+ blockExplorerUrl: "https://snowtrace.io/tx",
946
+ blockExplorerUrls: ["https://snowtrace.io"],
947
+ primaryColor: "#9D2620",
948
+ nativeToken: {
949
+ symbol: "AVAX",
950
+ decimals: 18
951
+ },
952
+ ...getChainRpcUrl("avax")
953
+ },
954
+ base: {
955
+ chainName: "Base",
956
+ blockchain: "base",
957
+ chainIcon: getStableflowChainLogo("Base"),
958
+ chainIconGray: getStableflowChainLogo("Base-gray"),
959
+ chainType: chainTypes.evm.value,
960
+ chainId: 8453,
961
+ blockExplorerUrl: "https://basescan.org/tx",
962
+ blockExplorerUrls: ["https://basescan.org"],
963
+ primaryColor: "#3137F6",
964
+ nativeToken: {
965
+ symbol: "ETH",
966
+ decimals: 18
967
+ },
968
+ ...getChainRpcUrl("base")
969
+ },
970
+ pol: {
971
+ chainName: "Polygon",
972
+ blockchain: "pol",
973
+ chainIcon: getStableflowChainLogo("Polygon"),
974
+ chainIconGray: getStableflowChainLogo("Polygon-gray"),
975
+ chainType: chainTypes.evm.value,
976
+ chainId: 137,
977
+ blockExplorerUrl: "https://polygonscan.com/tx",
978
+ blockExplorerUrls: ["https://polygonscan.com"],
979
+ primaryColor: "#5A2AD1",
980
+ nativeToken: {
981
+ symbol: "POL",
982
+ decimals: 18
983
+ },
984
+ ...getChainRpcUrl("pol")
985
+ },
986
+ gnosis: {
987
+ ...getChainRpcUrl("gnosis")
988
+ },
989
+ op: {
990
+ chainName: "Optimism",
991
+ blockchain: "op",
992
+ chainIcon: getStableflowChainLogo("Optimism"),
993
+ chainIconGray: getStableflowChainLogo("Optimism-gray"),
994
+ chainType: chainTypes.evm.value,
995
+ chainId: 10,
996
+ blockExplorerUrl: "https://optimistic.etherscan.io/tx",
997
+ blockExplorerUrls: ["https://optimistic.etherscan.io"],
998
+ primaryColor: "#B5271D",
999
+ nativeToken: {
1000
+ symbol: "ETH",
1001
+ decimals: 18
1002
+ },
1003
+ ...getChainRpcUrl("op")
1004
+ },
1005
+ tron: {
1006
+ chainName: "Tron",
1007
+ blockchain: "tron",
1008
+ chainIcon: getStableflowChainLogo("Tron"),
1009
+ chainIconGray: getStableflowChainLogo("Tron-gray"),
1010
+ chainType: chainTypes.tron.value,
1011
+ blockExplorerUrl: "https://tronscan.org/#/transaction",
1012
+ blockExplorerUrls: ["https://tronscan.org"],
1013
+ primaryColor: "#BC3221",
1014
+ nativeToken: {
1015
+ symbol: "TRX",
1016
+ decimals: 6
1017
+ },
1018
+ ...getChainRpcUrl("tron")
1019
+ },
1020
+ aptos: {
1021
+ chainName: "Aptos",
1022
+ blockchain: "aptos",
1023
+ chainIcon: getStableflowChainLogo("Aptos"),
1024
+ chainIconGray: getStableflowChainLogo("Aptos-gray"),
1025
+ chainType: chainTypes.aptos.value,
1026
+ blockExplorerUrl: "https://aptoscan.com/transaction",
1027
+ blockExplorerUrls: ["https://aptoscan.com"],
1028
+ primaryColor: "#000000",
1029
+ nativeToken: {
1030
+ symbol: "APT",
1031
+ decimals: 8
1032
+ },
1033
+ ...getChainRpcUrl("aptos")
1034
+ },
1035
+ bera: {
1036
+ chainName: "Berachain",
1037
+ blockchain: "bera",
1038
+ chainIcon: getStableflowChainLogo("Berachain"),
1039
+ chainIconGray: getStableflowChainLogo("Berachain-gray"),
1040
+ chainType: chainTypes.evm.value,
1041
+ chainId: 80094,
1042
+ blockExplorerUrl: "https://berascan.com/tx/",
1043
+ blockExplorerUrls: ["https://berascan.com"],
1044
+ primaryColor: "#F37325",
1045
+ nativeToken: {
1046
+ symbol: "BERA",
1047
+ decimals: 18
1048
+ },
1049
+ ...getChainRpcUrl("bera")
1050
+ },
1051
+ xlayer: {
1052
+ chainName: "X Layer",
1053
+ blockchain: "xlayer",
1054
+ chainIcon: getStableflowChainLogo("xlayer"),
1055
+ chainIconGray: getStableflowChainLogo("xlayer-gray"),
1056
+ chainType: chainTypes.evm.value,
1057
+ chainId: 196,
1058
+ blockExplorerUrl: "https://www.oklink.com/xlayer/tx/",
1059
+ blockExplorerUrls: ["https://www.oklink.com"],
1060
+ primaryColor: "#000000",
1061
+ nativeToken: {
1062
+ symbol: "OKB",
1063
+ decimals: 18
1064
+ },
1065
+ ...getChainRpcUrl("xlayer")
1066
+ },
1067
+ plasma: {
1068
+ chainName: "Plasma",
1069
+ blockchain: "plasma",
1070
+ chainIcon: getStableflowChainLogo("Plasma"),
1071
+ chainIconGray: getStableflowChainLogo("Plasma-gray"),
1072
+ chainType: chainTypes.evm.value,
1073
+ chainId: 9745,
1074
+ blockExplorerUrl: "https://plasmascan.to/tx/",
1075
+ blockExplorerUrls: ["https://plasmascan.to"],
1076
+ primaryColor: "#162F29",
1077
+ nativeToken: {
1078
+ symbol: "XPL",
1079
+ decimals: 18
1080
+ },
1081
+ ...getChainRpcUrl("plasma")
1082
+ },
1083
+ ton: {
1084
+ chainName: "Ton",
1085
+ blockchain: "ton",
1086
+ chainIcon: getStableflowChainLogo("Ton"),
1087
+ chainIconGray: getStableflowChainLogo("Ton-gray"),
1088
+ chainType: chainTypes.ton.value,
1089
+ blockExplorerUrl: "https://tonviewer.com/transaction/",
1090
+ blockExplorerUrls: ["https://tonviewer.com"],
1091
+ primaryColor: "#0098EA",
1092
+ nativeToken: {
1093
+ symbol: "TON",
1094
+ decimals: 9
1095
+ },
1096
+ ...getChainRpcUrl("ton")
1097
+ },
1098
+ mantle: {
1099
+ chainName: "Mantle",
1100
+ blockchain: "mantle",
1101
+ chainIcon: getStableflowChainLogo("Mantle"),
1102
+ chainIconGray: getStableflowChainLogo("Mantle-gray"),
1103
+ chainType: chainTypes.evm.value,
1104
+ chainId: 5e3,
1105
+ blockExplorerUrl: "https://mantlescan.xyz/tx/",
1106
+ blockExplorerUrls: ["https://mantlescan.xyz"],
1107
+ primaryColor: "#162F29",
1108
+ nativeToken: {
1109
+ symbol: "MNT",
1110
+ decimals: 18
1111
+ },
1112
+ ...getChainRpcUrl("mantle")
1113
+ },
1114
+ megaeth: {
1115
+ chainName: "MegaETH",
1116
+ blockchain: "megaeth",
1117
+ chainIcon: getStableflowChainLogo("MegaETH"),
1118
+ chainIconGray: getStableflowChainLogo("MegaETH-gray"),
1119
+ chainType: chainTypes.evm.value,
1120
+ chainId: 4326,
1121
+ blockExplorerUrl: "https://mega.etherscan.io/tx/",
1122
+ blockExplorerUrls: ["https://mega.etherscan.io"],
1123
+ primaryColor: "#19191A",
1124
+ nativeToken: {
1125
+ symbol: "ETH",
1126
+ decimals: 18
1127
+ },
1128
+ ...getChainRpcUrl("megaeth")
1129
+ },
1130
+ ink: {
1131
+ chainName: "Ink",
1132
+ blockchain: "ink",
1133
+ chainIcon: getStableflowChainLogo("Ink"),
1134
+ chainIconGray: getStableflowChainLogo("Ink-gray"),
1135
+ chainType: chainTypes.evm.value,
1136
+ chainId: 57073,
1137
+ blockExplorerUrl: "https://explorer.inkonchain.com/tx/",
1138
+ blockExplorerUrls: ["https://explorer.inkonchain.com"],
1139
+ primaryColor: "#7132F5",
1140
+ nativeToken: {
1141
+ symbol: "ETH",
1142
+ decimals: 18
1143
+ },
1144
+ ...getChainRpcUrl("ink")
1145
+ },
1146
+ stable: {
1147
+ chainName: "Stable",
1148
+ blockchain: "stable",
1149
+ chainIcon: getStableflowChainLogo("Stable"),
1150
+ chainIconGray: getStableflowChainLogo("Stable-gray"),
1151
+ chainType: chainTypes.evm.value,
1152
+ chainId: 988,
1153
+ blockExplorerUrl: "https://uniscan.xyz/tx/",
1154
+ blockExplorerUrls: ["https://uniscan.xyz"],
1155
+ primaryColor: "#01241D",
1156
+ nativeToken: {
1157
+ symbol: "USDT0",
1158
+ decimals: 18
1159
+ },
1160
+ ...getChainRpcUrl("stable")
1161
+ },
1162
+ celo: {
1163
+ chainName: "Celo",
1164
+ blockchain: "celo",
1165
+ chainIcon: getStableflowChainLogo("Celo"),
1166
+ chainIconGray: getStableflowChainLogo("Celo-gray"),
1167
+ chainType: chainTypes.evm.value,
1168
+ chainId: 42220,
1169
+ blockExplorerUrl: "https://celoscan.io/tx/",
1170
+ blockExplorerUrls: ["https://celoscan.io"],
1171
+ primaryColor: "#FCFF52",
1172
+ nativeToken: {
1173
+ symbol: "CELO",
1174
+ decimals: 18
1175
+ },
1176
+ ...getChainRpcUrl("celo")
1177
+ },
1178
+ sei: {
1179
+ chainName: "Sei",
1180
+ blockchain: "sei",
1181
+ chainIcon: getStableflowChainLogo("Sei"),
1182
+ chainIconGray: getStableflowChainLogo("Sei-gray"),
1183
+ chainType: chainTypes.evm.value,
1184
+ chainId: 1329,
1185
+ blockExplorerUrl: "https://seitrace.com/tx/",
1186
+ blockExplorerUrls: ["https://seitrace.com"],
1187
+ primaryColor: "#991717",
1188
+ nativeToken: {
1189
+ symbol: "SEI",
1190
+ decimals: 18
1191
+ },
1192
+ ...getChainRpcUrl("sei")
1193
+ },
1194
+ flare: {
1195
+ chainName: "Flare",
1196
+ blockchain: "flare",
1197
+ chainIcon: getStableflowChainLogo("Flare"),
1198
+ chainIconGray: getStableflowChainLogo("Flare-gray"),
1199
+ chainType: chainTypes.evm.value,
1200
+ chainId: 14,
1201
+ blockExplorerUrl: "https://flare-explorer.flare.network/tx/",
1202
+ blockExplorerUrls: ["https://flare-explorer.flare.network"],
1203
+ primaryColor: "#E62058",
1204
+ nativeToken: {
1205
+ symbol: "FLR",
1206
+ decimals: 18
1207
+ },
1208
+ ...getChainRpcUrl("flare")
1209
+ },
1210
+ frax: {
1211
+ chainName: "Fraxtal",
1212
+ blockchain: "frax",
1213
+ chainIcon: getStableflowChainLogo("Frax"),
1214
+ chainIconGray: getStableflowChainLogo("Frax-gray"),
1215
+ chainType: chainTypes.evm.value,
1216
+ chainId: 252,
1217
+ blockExplorerUrl: "https://fraxscan.com/tx/",
1218
+ blockExplorerUrls: ["https://fraxscan.com"],
1219
+ primaryColor: "#000",
1220
+ nativeToken: {
1221
+ symbol: "FRAX",
1222
+ decimals: 18
1223
+ },
1224
+ ...getChainRpcUrl("frax")
1225
+ },
1226
+ sui: {
1227
+ chainName: "Sui",
1228
+ blockchain: "sui",
1229
+ chainIcon: getStableflowChainLogo("Sui"),
1230
+ chainIconGray: getStableflowChainLogo("Sui-gray"),
1231
+ chainType: chainTypes.sui.value,
1232
+ blockExplorerUrl: "https://suiscan.xyz/mainnet/tx",
1233
+ blockExplorerUrls: ["https://suiscan.xyz/mainnet"],
1234
+ primaryColor: "#298DFF",
1235
+ nativeToken: {
1236
+ symbol: "SUI",
1237
+ decimals: 9
1238
+ },
1239
+ ...getChainRpcUrl("sui")
1240
+ },
1241
+ katana: {
1242
+ chainName: "Katana",
1243
+ blockchain: "katana",
1244
+ chainIcon: getStableflowChainLogo("Katana"),
1245
+ chainIconGray: getStableflowChainLogo("Katana-gray"),
1246
+ chainType: chainTypes.evm.value,
1247
+ chainId: 747474,
1248
+ blockExplorerUrl: "https://katanascan.com/tx",
1249
+ blockExplorerUrls: ["https://katanascan.com"],
1250
+ primaryColor: "#F6FF0D",
1251
+ nativeToken: {
1252
+ symbol: "ETH",
1253
+ decimals: 18
1254
+ },
1255
+ ...getChainRpcUrl("katana")
1256
+ }
1257
+ };
1258
+ var chains_default = chains;
1259
+
1260
+ // src/wallets/config/usdt.ts
1261
+ var usdt = {
1262
+ symbol: "USDT",
1263
+ decimals: 6,
1264
+ icon: "/usdt.png",
1265
+ name: "Tether USD"
1266
+ };
1267
+ var usdtChains = {
1268
+ eth: {
1269
+ ...usdt,
1270
+ assetId: "nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near",
1271
+ contractAddress: "0xdac17f958d2ee523a2206206994597c13d831ec7",
1272
+ ...chains_default.eth,
1273
+ services: [Service.OneClick, Service.Usdt0, Service.Native]
1274
+ },
1275
+ bsc: {
1276
+ ...usdt,
1277
+ assetId: "nep245:v2_1.omni.hot.tg:56_2CMMyVTGZkeyNZTSvS5sarzfir6g",
1278
+ contractAddress: "0x55d398326f99059ff775485246999027b3197955",
1279
+ ...chains_default.bsc,
1280
+ decimals: 18,
1281
+ services: [Service.OneClick, Service.Native]
1282
+ },
1283
+ op: {
1284
+ ...usdt,
1285
+ assetId: "nep245:v2_1.omni.hot.tg:10_359RPSJVdTxwTJT9TyGssr2rFoWo",
1286
+ contractAddress: "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
1287
+ ...chains_default.op,
1288
+ services: [Service.OneClick]
1289
+ },
1290
+ avax: {
1291
+ ...usdt,
1292
+ assetId: "nep245:v2_1.omni.hot.tg:43114_372BeH7ENZieCaabwkbWkBiTTgXp",
1293
+ contractAddress: "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",
1294
+ ...chains_default.avax,
1295
+ services: [Service.OneClick]
1296
+ },
1297
+ // disabled gnosis temporarily, 22/Oct/2025
1298
+ // gnosis: {
1299
+ // ...usdt,
1300
+ // assetId: "nep141:gnosis-0x4ecaba5870353805a9f068101a40e0f32ed605c6.omft.near",
1301
+ // contractAddress: "0x4ecaba5870353805a9f068101a40e0f32ed605c6",
1302
+ // ...chains.gnosis,
1303
+ // services: [Service.OneClick],
1304
+ // },
1305
+ near: {
1306
+ ...usdt,
1307
+ assetId: "nep141:usdt.tether-token.near",
1308
+ contractAddress: "usdt.tether-token.near",
1309
+ ...chains_default.near,
1310
+ services: [Service.OneClick]
1311
+ },
1312
+ sol: {
1313
+ ...usdt,
1314
+ assetId: "nep141:sol-c800a4bd850783ccb82c2b2c7e84175443606352.omft.near",
1315
+ contractAddress: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
1316
+ ...chains_default.sol,
1317
+ services: [Service.OneClick, Service.Usdt0]
1318
+ },
1319
+ tron: {
1320
+ ...usdt,
1321
+ assetId: "nep141:tron-d28a265909efecdcee7c5028585214ea0b96f015.omft.near",
1322
+ contractAddress: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
1323
+ ...chains_default.tron,
1324
+ services: [Service.OneClick, Service.Usdt0]
1325
+ },
1326
+ aptos: {
1327
+ ...usdt,
1328
+ assetId: "nep141:aptos-88cb7619440a914fe6400149a12b443c3ac21d59.omft.near",
1329
+ contractAddress: "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b",
1330
+ ...chains_default.aptos,
1331
+ services: [Service.OneClick]
1332
+ },
1333
+ ton: {
1334
+ ...usdt,
1335
+ assetId: "nep245:v2_1.omni.hot.tg:1117_3tsdfyziyc7EJbP2aULWSKU4toBaAcN4FdTgfm5W1mC4ouR",
1336
+ contractAddress: "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
1337
+ ...chains_default.ton,
1338
+ services: [Service.OneClick, Service.Usdt0]
1339
+ }
1340
+ };
1341
+ ({
1342
+ ...usdtChains.sol,
1343
+ chains: [usdtChains.sol]
1344
+ });
1345
+ ({
1346
+ ...usdtChains.near,
1347
+ chains: [usdtChains.near]
1348
+ });
1349
+ ({
1350
+ chains: Object.values(usdtChains).filter((chain) => chain.chainType === "evm")
1351
+ });
1352
+ ({
1353
+ ...usdtChains.tron,
1354
+ chains: [usdtChains.tron]
1355
+ });
1356
+ ({
1357
+ ...usdtChains.aptos,
1358
+ chains: [usdtChains.aptos]
1359
+ });
1360
+ ({
1361
+ ...usdtChains.ton,
1362
+ chains: [usdtChains.ton]
1363
+ });
1364
+
1365
+ // src/wallets/config/usdt0.ts
1366
+ var usdt0 = {
1367
+ symbol: "USD\u20AE0",
1368
+ decimals: 6,
1369
+ icon: "/usdt0.png",
1370
+ name: "USD\u20AE0"
1371
+ };
1372
+ var usdt0Chains = {
1373
+ // eth: {
1374
+ // ...usdt0,
1375
+ // symbol: "USDT",
1376
+ // icon: "/usdt.png",
1377
+ // assetId: "nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near",
1378
+ // contractAddress: "0xdac17f958d2ee523a2206206994597c13d831ec7",
1379
+ // ...chains.eth,
1380
+ // services: [Service.OneClick, Service.Usdt0, Service.Native],
1381
+ // },
1382
+ arb: {
1383
+ ...usdt0,
1384
+ assetId: "nep141:arb-0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9.omft.near",
1385
+ contractAddress: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
1386
+ ...chains_default.arb,
1387
+ services: [Service.OneClick, Service.Usdt0, Service.Native]
1388
+ },
1389
+ pol: {
1390
+ ...usdt0,
1391
+ assetId: "nep245:v2_1.omni.hot.tg:137_3hpYoaLtt8MP1Z2GH1U473DMRKgr",
1392
+ contractAddress: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
1393
+ ...chains_default.pol,
1394
+ services: [Service.OneClick, Service.Usdt0]
1395
+ },
1396
+ op: {
1397
+ ...usdt0,
1398
+ assetId: "",
1399
+ contractAddress: "0x01bFF41798a0BcF287b996046Ca68b395DbC1071",
1400
+ ...chains_default.op,
1401
+ services: [Service.Usdt0]
1402
+ },
1403
+ bera: {
1404
+ ...usdt0,
1405
+ assetId: "nep141:bera-0x779ded0c9e1022225f8e0630b35a9b54be713736.omft.near",
1406
+ contractAddress: "0x779Ded0c9e1022225f8E0630b35a9b54bE713736",
1407
+ ...chains_default.bera,
1408
+ services: [Service.OneClick, Service.Usdt0]
1409
+ },
1410
+ xlayer: {
1411
+ ...usdt0,
1412
+ assetId: "nep245:v2_1.omni.hot.tg:196_2fezDCvVYRsG8wrK6deJ2VRPiAS1",
1413
+ contractAddress: "0x779ded0c9e1022225f8e0630b35a9b54be713736",
1414
+ ...chains_default.xlayer,
1415
+ services: [Service.OneClick, Service.Usdt0]
1416
+ },
1417
+ plasma: {
1418
+ ...usdt0,
1419
+ assetId: "nep141:plasma-0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb.omft.near",
1420
+ contractAddress: "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
1421
+ ...chains_default.plasma,
1422
+ services: [Service.OneClick, Service.Usdt0]
1423
+ },
1424
+ mantle: {
1425
+ ...usdt0,
1426
+ assetId: "",
1427
+ contractAddress: "0x779Ded0c9e1022225f8E0630b35a9b54bE713736",
1428
+ ...chains_default.mantle,
1429
+ services: [Service.Usdt0]
1430
+ },
1431
+ megaeth: {
1432
+ ...usdt0,
1433
+ assetId: "",
1434
+ contractAddress: "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
1435
+ ...chains_default.megaeth,
1436
+ services: [Service.Usdt0]
1437
+ },
1438
+ ink: {
1439
+ ...usdt0,
1440
+ assetId: "",
1441
+ contractAddress: "0x0200C29006150606B650577BBE7B6248F58470c1",
1442
+ ...chains_default.ink,
1443
+ services: [Service.Usdt0]
1444
+ },
1445
+ stable: {
1446
+ ...usdt0,
1447
+ assetId: "",
1448
+ contractAddress: "0x779Ded0c9e1022225f8E0630b35a9b54bE713736",
1449
+ ...chains_default.stable,
1450
+ services: [Service.Usdt0]
1451
+ },
1452
+ celo: {
1453
+ ...usdt0,
1454
+ assetId: "",
1455
+ contractAddress: "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
1456
+ ...chains_default.celo,
1457
+ services: [Service.Usdt0]
1458
+ },
1459
+ sei: {
1460
+ ...usdt0,
1461
+ assetId: "",
1462
+ contractAddress: "0x9151434b16b9763660705744891fA906F660EcC5",
1463
+ ...chains_default.sei,
1464
+ services: [Service.Usdt0]
1465
+ },
1466
+ flare: {
1467
+ ...usdt0,
1468
+ assetId: "",
1469
+ contractAddress: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
1470
+ ...chains_default.flare,
1471
+ services: [Service.Usdt0]
1472
+ }
1473
+ };
1474
+ ({
1475
+ chains: Object.values(usdt0Chains).filter((chain) => chain.chainType === "evm")
1476
+ });
1477
+
1478
+ // src/wallets/config/usdc.ts
1479
+ var usdc = {
1480
+ symbol: "USDC",
1481
+ decimals: 6,
1482
+ icon: "/usdc.png",
1483
+ name: "USD Coin"
1484
+ };
1485
+ var usdcChains = {
1486
+ eth: {
1487
+ ...usdc,
1488
+ assetId: "nep141:eth-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.omft.near",
1489
+ contractAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
1490
+ ...chains_default.eth,
1491
+ services: [Service.OneClick, Service.CCTP, Service.Native]
1492
+ },
1493
+ arb: {
1494
+ ...usdc,
1495
+ assetId: "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
1496
+ contractAddress: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
1497
+ ...chains_default.arb,
1498
+ services: [Service.OneClick, Service.CCTP, Service.Native]
1499
+ },
1500
+ base: {
1501
+ ...usdc,
1502
+ assetId: "nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near",
1503
+ contractAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
1504
+ ...chains_default.base,
1505
+ services: [Service.OneClick, Service.CCTP, Service.Native]
1506
+ },
1507
+ // gnosis: {
1508
+ // ...usdc,
1509
+ // assetId:
1510
+ // "nep141:gnosis-0x2a22f9c3b484c3629090feed35f17ff8f88f76f0.omft.near",
1511
+ // contractAddress: "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0",
1512
+ // ...chains.gnosis,
1513
+ // services: [Service.OneClick],
1514
+ // },
1515
+ pol: {
1516
+ ...usdc,
1517
+ assetId: "nep245:v2_1.omni.hot.tg:137_qiStmoQJDQPTebaPjgx5VBxZv6L",
1518
+ contractAddress: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
1519
+ ...chains_default.pol,
1520
+ services: [Service.OneClick, Service.CCTP]
1521
+ },
1522
+ bsc: {
1523
+ ...usdc,
1524
+ assetId: "nep245:v2_1.omni.hot.tg:56_2w93GqMcEmQFDru84j3HZZWt557r",
1525
+ contractAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
1526
+ ...chains_default.bsc,
1527
+ decimals: 18,
1528
+ services: [Service.OneClick, Service.Native]
1529
+ },
1530
+ op: {
1531
+ ...usdc,
1532
+ assetId: "nep245:v2_1.omni.hot.tg:10_A2ewyUyDp6qsue1jqZsGypkCxRJ",
1533
+ contractAddress: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
1534
+ ...chains_default.op,
1535
+ services: [Service.OneClick, Service.CCTP]
1536
+ },
1537
+ avax: {
1538
+ ...usdc,
1539
+ assetId: "nep245:v2_1.omni.hot.tg:43114_3atVJH3r5c4GqiSYmg9fECvjc47o",
1540
+ contractAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
1541
+ ...chains_default.avax,
1542
+ services: [Service.OneClick, Service.CCTP]
1543
+ },
1544
+ near: {
1545
+ ...usdc,
1546
+ assetId: "nep141:17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",
1547
+ contractAddress: "17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",
1548
+ ...chains_default.near,
1549
+ services: [Service.OneClick]
1550
+ },
1551
+ sol: {
1552
+ ...usdc,
1553
+ assetId: "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
1554
+ contractAddress: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1555
+ ...chains_default.sol,
1556
+ services: [Service.OneClick, Service.CCTP]
1557
+ },
1558
+ xlayer: {
1559
+ ...usdc,
1560
+ assetId: "nep245:v2_1.omni.hot.tg:196_2dK9kLNR7Ekq7su8FxNGiUW3djTw",
1561
+ contractAddress: "0x74b7f16337b8972027f6196a17a631ac6de26d22",
1562
+ ...chains_default.xlayer,
1563
+ services: [Service.OneClick]
1564
+ },
1565
+ aptos: {
1566
+ ...usdc,
1567
+ assetId: "nep141:aptos-34ee497f210c5a511e8d5b53bc56d75b63612bb5.omft.near",
1568
+ contractAddress: "0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b",
1569
+ ...chains_default.aptos,
1570
+ services: [Service.OneClick]
1571
+ },
1572
+ sui: {
1573
+ ...usdc,
1574
+ assetId: "nep141:sui-c1b81ecaf27933252d31a963bc5e9458f13c18ce.omft.near",
1575
+ contractAddress: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
1576
+ ...chains_default.sui,
1577
+ services: [Service.OneClick]
1578
+ }
1579
+ };
1580
+ ({
1581
+ ...usdcChains.sol,
1582
+ chains: [usdcChains.sol]
1583
+ });
1584
+ ({
1585
+ ...usdcChains.near,
1586
+ chains: [usdcChains.near]
1587
+ });
1588
+ ({
1589
+ ...usdcChains.aptos,
1590
+ chains: [usdcChains.aptos]
1591
+ });
1592
+ ({
1593
+ chains: Object.values(usdcChains).filter((chain) => chain.chainType === "evm")
1594
+ });
1595
+ ({
1596
+ ...usdcChains.sui,
1597
+ chains: [usdcChains.sui]
1598
+ });
1599
+
1600
+ // src/wallets/config/frxusd.ts
1601
+ var frxusd = {
1602
+ symbol: "frxUSD",
1603
+ decimals: 18,
1604
+ icon: "/frxusd.png",
1605
+ name: "Frax USD"
1606
+ };
1607
+ var frxusdChains = {
1608
+ frax: {
1609
+ ...frxusd,
1610
+ assetId: "",
1611
+ contractAddress: "0xFc00000000000000000000000000000000000001",
1612
+ ...chains_default.frax,
1613
+ services: [Service.FraxZero]
1614
+ },
1615
+ eth: {
1616
+ ...frxusd,
1617
+ assetId: "",
1618
+ contractAddress: "0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29",
1619
+ ...chains_default.eth,
1620
+ services: [Service.FraxZero]
1621
+ },
1622
+ arb: {
1623
+ ...frxusd,
1624
+ assetId: "",
1625
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1626
+ ...chains_default.arb,
1627
+ services: [Service.FraxZero]
1628
+ },
1629
+ avax: {
1630
+ ...frxusd,
1631
+ assetId: "",
1632
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1633
+ ...chains_default.avax,
1634
+ services: [Service.FraxZero]
1635
+ },
1636
+ // base: {
1637
+ // ...frxusd,
1638
+ // assetId: "",
1639
+ // contractAddress: "0xe5020A6d073a794B6E7f05678707dE47986Fb0b6",
1640
+ // ...chains.base,
1641
+ // services: [Service.FraxZero],
1642
+ // },
1643
+ bera: {
1644
+ ...frxusd,
1645
+ assetId: "",
1646
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1647
+ ...chains_default.bera,
1648
+ services: [Service.FraxZero]
1649
+ },
1650
+ bsc: {
1651
+ ...frxusd,
1652
+ assetId: "",
1653
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1654
+ ...chains_default.bsc,
1655
+ services: [Service.FraxZero]
1656
+ },
1657
+ op: {
1658
+ ...frxusd,
1659
+ assetId: "",
1660
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1661
+ ...chains_default.op,
1662
+ services: [Service.FraxZero]
1663
+ },
1664
+ pol: {
1665
+ ...frxusd,
1666
+ assetId: "",
1667
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1668
+ ...chains_default.pol,
1669
+ services: [Service.FraxZero]
1670
+ },
1671
+ xlayer: {
1672
+ ...frxusd,
1673
+ assetId: "",
1674
+ contractAddress: "0x80eede496655fb9047dd39d9f418d5483ed600df",
1675
+ ...chains_default.xlayer,
1676
+ services: [Service.FraxZero]
1677
+ },
1678
+ sol: {
1679
+ ...frxusd,
1680
+ assetId: "",
1681
+ contractAddress: "GzX1ireZDU865FiMaKrdVB1H6AE8LAqWYCg6chrMrfBw",
1682
+ decimals: 9,
1683
+ ...chains_default.sol,
1684
+ services: [Service.FraxZero]
1685
+ },
1686
+ katana: {
1687
+ ...frxusd,
1688
+ assetId: "",
1689
+ contractAddress: "0x80Eede496655FB9047dd39d9f418d5483ED600df",
1690
+ ...chains_default.katana,
1691
+ services: [Service.FraxZero]
1692
+ }
1693
+ };
1694
+ ({
1695
+ ...frxusdChains.sol,
1696
+ chains: [frxusdChains.sol]
1697
+ });
1698
+ ({
1699
+ chains: Object.values(frxusdChains).filter((chain) => chain.chainType === "evm")
1700
+ });
1701
+
1702
+ // src/wallets/config/tokens.ts
1703
+ var tokens = [
1704
+ ...Object.values(usdtChains),
1705
+ ...Object.values(usdcChains),
1706
+ ...Object.values(usdt0Chains),
1707
+ ...Object.values(frxusdChains)
1708
+ ];
1709
+ var usdtTokens = [...Object.values(usdtChains), ...Object.values(usdt0Chains)];
1710
+ var usdcTokens = Object.values(usdcChains);
1711
+ var frxusdTokens = Object.values(frxusdChains);
1712
+
1713
+ // src/wallets/config/addresses.ts
1714
+ var DefaultAddresses = {
1715
+ near: "stableflow.near",
1716
+ sol: "2bRTgL16xgu6VkSRY7TJcLRuT93T1pLtaYeChhyhfFcX",
1717
+ evm: "0x10b06e6A12E86f8C2b55B5073fA3dB39b120C7F5",
1718
+ tron: "TSKMAaJLnWAUa6cKtTTm5oathCQPPaJZtF",
1719
+ aptos: "0x93493b07d031c4f18ad1e874575761be7e47d4cea5c81d538600e8ec72d6ab1c",
1720
+ ton: "UQBv1hzUIB5liMe1cqxUAvfO2tWMnN6wDyXP4DFSptAbePVK",
1721
+ sui: "0xeae6dbc896a8a6994c093bf8ea47116063f0b016f1fdc61bff95ba9dfb36c4d2"
1722
+ };
1723
+
1724
+ // src/wallets/config/erc20.ts
1725
+ var erc20_default = [
1726
+ {
1727
+ inputs: [
1728
+ { internalType: "address", name: "owner", type: "address" },
1729
+ { internalType: "address", name: "spender", type: "address" }
1730
+ ],
1731
+ name: "allowance",
1732
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1733
+ stateMutability: "view",
1734
+ type: "function"
1735
+ },
1736
+ {
1737
+ inputs: [
1738
+ { internalType: "address", name: "spender", type: "address" },
1739
+ { internalType: "uint256", name: "value", type: "uint256" }
1740
+ ],
1741
+ name: "approve",
1742
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1743
+ stateMutability: "nonpayable",
1744
+ type: "function"
1745
+ },
1746
+ {
1747
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
1748
+ name: "balanceOf",
1749
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1750
+ stateMutability: "view",
1751
+ type: "function"
1752
+ },
1753
+ {
1754
+ inputs: [
1755
+ { internalType: "address", name: "to", type: "address" },
1756
+ { internalType: "uint256", name: "value", type: "uint256" }
1757
+ ],
1758
+ name: "transfer",
1759
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1760
+ stateMutability: "nonpayable",
1761
+ type: "function"
1762
+ },
1763
+ {
1764
+ inputs: [],
1765
+ name: "decimals",
1766
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1767
+ stateMutability: "view",
1768
+ type: "function"
1769
+ },
1770
+ {
1771
+ inputs: [],
1772
+ name: "name",
1773
+ outputs: [{ internalType: "string", name: "", type: "string" }],
1774
+ stateMutability: "view",
1775
+ type: "function"
1776
+ },
1777
+ {
1778
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
1779
+ name: "nonces",
1780
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1781
+ stateMutability: "view",
1782
+ type: "function"
1783
+ },
1784
+ {
1785
+ inputs: [
1786
+ { internalType: "address", name: "owner_", type: "address" },
1787
+ { internalType: "address", name: "spender", type: "address" },
1788
+ { internalType: "uint256", name: "value", type: "uint256" },
1789
+ { internalType: "uint256", name: "deadline", type: "uint256" },
1790
+ { internalType: "uint8", name: "v", type: "uint8" },
1791
+ { internalType: "bytes32", name: "r", type: "bytes32" },
1792
+ { internalType: "bytes32", name: "s", type: "bytes32" }
1793
+ ],
1794
+ name: "permit",
1795
+ outputs: [],
1796
+ stateMutability: "nonpayable",
1797
+ type: "function"
1798
+ }
1799
+ ];
1800
+
1801
+ // src/utils/price.ts
1802
+ function getPrice(prices, symbol) {
1803
+ let price = "1";
1804
+ if (prices[symbol]) {
1805
+ price = prices[symbol];
1806
+ if (price !== "0") {
1807
+ return price;
1808
+ }
1809
+ }
1810
+ if (prices[symbol.toLowerCase()]) {
1811
+ price = prices[symbol.toLowerCase()];
1812
+ if (price !== "0") {
1813
+ return price;
1814
+ }
1815
+ }
1816
+ if (prices[symbol.toUpperCase()]) {
1817
+ price = prices[symbol.toUpperCase()];
1818
+ if (price !== "0") {
1819
+ return price;
1820
+ }
1821
+ }
1822
+ return "1";
1823
+ }
1824
+
1825
+ // src/utils/number.ts
1826
+ var numberRemoveEndZero = (value) => {
1827
+ return value.replace("-", "").replace(/\.?0+$/, "");
1828
+ };
1829
+
1830
+ // src/utils/exec-time.ts
1831
+ var ExecTime = class {
1832
+ constructor(options) {
1833
+ this.startTimestamp = 0;
1834
+ this.currentTimestamp = 0;
1835
+ this.performanceThreshold = 1e3;
1836
+ const { type, logStyle, isPerformance, isDebug } = options;
1837
+ this.type = type;
1838
+ this.logStyle = logStyle ?? "stone-500";
1839
+ this.isPerformance = isPerformance ?? false;
1840
+ this.isDebug = isDebug;
1841
+ this.csl = new Csl(isDebug);
1842
+ if (!isDebug) return;
1843
+ this.startTimestamp = performance.now();
1844
+ this.currentTimestamp = this.startTimestamp;
1845
+ }
1846
+ breakpoint() {
1847
+ if (!this.isDebug) return;
1848
+ this.currentTimestamp = performance.now();
1849
+ }
1850
+ log(subType, str, ...params) {
1851
+ const duration = performance.now() - this.currentTimestamp;
1852
+ if (this.isPerformance) {
1853
+ if (duration <= this.performanceThreshold) {
1854
+ return;
1855
+ }
1856
+ }
1857
+ this.csl.log(this.type, this.logStyle, `<${subType}>cost: %c%sms%c${str ? ", " + str : ""}`, "color:red;font-weight:bold;", duration.toFixed(0), "color:black;font-weight:normal;", ...params);
1858
+ }
1859
+ logTotal(subType, str, ...params) {
1860
+ const duration = performance.now() - this.startTimestamp;
1861
+ this.csl.log(this.type, this.logStyle, `<${subType}>total cost: %c%sms%c${str ? ", " + str : ""}`, "color:red;font-weight:bold;", duration.toFixed(0), "color:black;font-weight:normal;", ...params);
1862
+ }
1863
+ };
1864
+
1865
+ // src/utils/service.ts
1866
+ var getRouteStatus = (service, disabledServices) => {
1867
+ const result = { disabled: false };
1868
+ if (!disabledServices || disabledServices.length === 0) {
1869
+ return result;
1870
+ }
1871
+ const IS_PAUSE_ONECLICK = disabledServices.includes(Service.OneClick);
1872
+ const IS_PAUSE_USDT0 = disabledServices.includes(Service.Usdt0);
1873
+ const IS_PAUSE_CCTP = disabledServices.includes(Service.CCTP);
1874
+ const IS_PAUSE_FRAXZERO = disabledServices.includes(Service.FraxZero);
1875
+ const IS_PAUSE_NATIVE = disabledServices.includes(Service.Native);
1876
+ const IS_PAUSE_USDT0_ONECLICK = disabledServices.includes(Service.OneClickUsdt0);
1877
+ const IS_PAUSE_ONECLICK_USDT0 = disabledServices.includes(Service.OneClickUsdt0);
1878
+ const IS_PAUSE_FRAXZERO_ONECLICK = disabledServices.includes(Service.FraxZeroOneClick);
1879
+ const IS_PAUSE_ONECLICK_FRAXZERO = disabledServices.includes(Service.OneClickFraxZero);
1880
+ const IS_PAUSE_ALL = IS_PAUSE_ONECLICK && IS_PAUSE_USDT0 && IS_PAUSE_CCTP && IS_PAUSE_FRAXZERO && IS_PAUSE_NATIVE;
1881
+ if (IS_PAUSE_ALL) {
1882
+ result.disabled = true;
1883
+ return result;
1884
+ }
1885
+ if (service === Service.CCTP) {
1886
+ if (IS_PAUSE_CCTP) {
1887
+ result.disabled = true;
1888
+ return result;
1889
+ }
1890
+ }
1891
+ if (service === Service.FraxZero) {
1892
+ if (IS_PAUSE_FRAXZERO) {
1893
+ result.disabled = true;
1894
+ return result;
1895
+ }
1896
+ }
1897
+ if ([Service.FraxZeroOneClick, Service.OneClickFraxZero].includes(service)) {
1898
+ if (IS_PAUSE_ONECLICK || IS_PAUSE_FRAXZERO) {
1899
+ result.disabled = true;
1900
+ return result;
1901
+ }
1902
+ }
1903
+ if (service === Service.Native) {
1904
+ if (IS_PAUSE_NATIVE) {
1905
+ result.disabled = true;
1906
+ return result;
1907
+ }
1908
+ }
1909
+ if (service === Service.OneClick) {
1910
+ if (IS_PAUSE_ONECLICK) {
1911
+ result.disabled = true;
1912
+ return result;
1913
+ }
1914
+ }
1915
+ if (service === Service.Usdt0) {
1916
+ if (IS_PAUSE_USDT0) {
1917
+ result.disabled = true;
1918
+ return result;
1919
+ }
1920
+ }
1921
+ if ([Service.Usdt0OneClick, Service.OneClickUsdt0].includes(service)) {
1922
+ if (IS_PAUSE_ONECLICK || IS_PAUSE_USDT0) {
1923
+ result.disabled = true;
1924
+ return result;
1925
+ }
1926
+ }
1927
+ if (service === Service.Usdt0OneClick) {
1928
+ if (IS_PAUSE_USDT0_ONECLICK) {
1929
+ result.disabled = true;
1930
+ return result;
1931
+ }
1932
+ }
1933
+ if (service === Service.OneClickUsdt0) {
1934
+ if (IS_PAUSE_ONECLICK_USDT0) {
1935
+ result.disabled = true;
1936
+ return result;
1937
+ }
1938
+ }
1939
+ if (service === Service.FraxZeroOneClick) {
1940
+ if (IS_PAUSE_FRAXZERO_ONECLICK) {
1941
+ result.disabled = true;
1942
+ return result;
1943
+ }
1944
+ }
1945
+ if (service === Service.OneClickFraxZero) {
1946
+ if (IS_PAUSE_ONECLICK_FRAXZERO) {
1947
+ result.disabled = true;
1948
+ return result;
1949
+ }
1950
+ }
1951
+ return result;
1952
+ };
1953
+
1954
+ export { ApiError, CancelError, CancelablePromise, Csl, DefaultAddresses, ExecTime, LayerZeroStatus, NetworkRpcUrlsMap, OneClickStatus, OpenAPI, QuoteRequest, SFA, SendType, Service, ServiceBackend, StableflowStatus, TokenResponse, TransactionStatus, erc20_default as erc20Abi, frxusdChains, frxusdTokens, getChainRpcUrl, getPrice, getRequest, getRouteStatus, getRpcUrls, numberRemoveEndZero, postRequest, request, setRpcUrls, tokens, usdcChains, usdcTokens, usdt0Chains, usdtChains, usdtTokens };
1955
+ //# sourceMappingURL=index.mjs.map
1956
+ //# sourceMappingURL=index.mjs.map