@imtbl/checkout-sdk 2.4.13 → 2.4.14-alpha.1
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/browser/index.js +205 -165
- package/dist/node/index.cjs +312 -272
- package/dist/node/index.js +314 -274
- package/dist/types/index.d.ts +1 -1
- package/dist/types/riskAssessment/common.d.ts +19 -0
- package/dist/types/riskAssessment/index.d.ts +2 -0
- package/dist/types/riskAssessment/riskAssessment.d.ts +1 -12
- package/dist/types/riskAssessment/riskAssessmentV2.d.ts +9 -0
- package/dist/types/riskAssessment/riskAssessmentV2.test.d.ts +1 -0
- package/package.json +9 -9
package/dist/node/index.js
CHANGED
|
@@ -138,22 +138,22 @@ var fn = /* @__PURE__ */ ((d) => {
|
|
|
138
138
|
d["TRANSFER_FAILED"] = "TRANSFER_FAILED";
|
|
139
139
|
return d;
|
|
140
140
|
})(fn || {});
|
|
141
|
-
var
|
|
141
|
+
var gn = /* @__PURE__ */ ((n) => {
|
|
142
142
|
n["PAYMENT_METHOD_SELECTED"] = "PAYMENT_METHOD_SELECTED";
|
|
143
143
|
n["PAYMENT_TOKEN_SELECTED"] = "PAYMENT_TOKEN_SELECTED";
|
|
144
144
|
n["NETWORK_SWITCH"] = "NETWORK_SWITCH";
|
|
145
145
|
return n;
|
|
146
|
-
})(
|
|
146
|
+
})(gn || {});
|
|
147
147
|
|
|
148
148
|
// src/widgets/definitions/events/addTokens.ts
|
|
149
|
-
var
|
|
149
|
+
var En = /* @__PURE__ */ ((a) => {
|
|
150
150
|
a["CLOSE_WIDGET"] = "close-widget";
|
|
151
151
|
a["LANGUAGE_CHANGED"] = "language-changed";
|
|
152
152
|
a["CONNECT_SUCCESS"] = "connect-success";
|
|
153
153
|
a["SUCCESS"] = "success";
|
|
154
154
|
a["FAILURE"] = "failure";
|
|
155
155
|
return a;
|
|
156
|
-
})(
|
|
156
|
+
})(En || {});
|
|
157
157
|
|
|
158
158
|
// src/widgets/definitions/events/purchase.ts
|
|
159
159
|
var Rn = /* @__PURE__ */ ((o) => {
|
|
@@ -224,12 +224,12 @@ var yn = /* @__PURE__ */ ((t) => {
|
|
|
224
224
|
})(yn || {});
|
|
225
225
|
|
|
226
226
|
// src/sdk.ts
|
|
227
|
-
import { Environment as
|
|
227
|
+
import { Environment as za } from "@imtbl/config";
|
|
228
228
|
|
|
229
229
|
// src/api/http/httpClient.ts
|
|
230
230
|
import wn from "axios";
|
|
231
231
|
var Sn = "pk_imapik-";
|
|
232
|
-
var
|
|
232
|
+
var kn = [
|
|
233
233
|
"https://checkout-api.dev.immutable.com",
|
|
234
234
|
"https://checkout-api.sandbox.immutable.com",
|
|
235
235
|
"https://checkout-api.immutable.com"
|
|
@@ -244,7 +244,7 @@ var le = class {
|
|
|
244
244
|
}
|
|
245
245
|
// eslint-disable-next-line class-methods-use-this
|
|
246
246
|
shouldAddPublishableKey(e) {
|
|
247
|
-
return
|
|
247
|
+
return kn.some((t) => e.startsWith(t));
|
|
248
248
|
}
|
|
249
249
|
setupInterceptors() {
|
|
250
250
|
this.axiosInstance.interceptors.request.use(
|
|
@@ -418,18 +418,18 @@ var Se = {
|
|
|
418
418
|
decimals: G,
|
|
419
419
|
address: _
|
|
420
420
|
};
|
|
421
|
-
var
|
|
421
|
+
var Pn = {
|
|
422
422
|
name: "tIMX",
|
|
423
423
|
symbol: "tIMX",
|
|
424
424
|
decimals: G,
|
|
425
425
|
address: _
|
|
426
426
|
};
|
|
427
|
-
var
|
|
427
|
+
var L = {
|
|
428
428
|
[Z]: "https://api.dev.immutable.com",
|
|
429
429
|
[ee.SANDBOX]: "https://api.sandbox.immutable.com",
|
|
430
430
|
[ee.PRODUCTION]: "https://api.immutable.com"
|
|
431
431
|
};
|
|
432
|
-
var
|
|
432
|
+
var ke = {
|
|
433
433
|
[Z]: "https://checkout-api.dev.immutable.com",
|
|
434
434
|
[ee.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
|
|
435
435
|
[ee.PRODUCTION]: "https://checkout-api.immutable.com"
|
|
@@ -489,7 +489,7 @@ var we = /* @__PURE__ */ new Map([
|
|
|
489
489
|
chainIdHex: `0x${13473 .toString(16)}`,
|
|
490
490
|
chainName: "Immutable zkEVM Testnet",
|
|
491
491
|
rpcUrls: ["https://rpc.testnet.immutable.com"],
|
|
492
|
-
nativeCurrency:
|
|
492
|
+
nativeCurrency: Pn
|
|
493
493
|
}
|
|
494
494
|
]
|
|
495
495
|
]);
|
|
@@ -536,7 +536,7 @@ var te = {
|
|
|
536
536
|
nativeToken: ye.get(1).nativeCurrency
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
|
-
var
|
|
539
|
+
var D = [
|
|
540
540
|
{
|
|
541
541
|
constant: true,
|
|
542
542
|
inputs: [],
|
|
@@ -803,15 +803,15 @@ var ot = {
|
|
|
803
803
|
};
|
|
804
804
|
|
|
805
805
|
// src/env/env.ts
|
|
806
|
-
var vn = "2.4.
|
|
806
|
+
var vn = "2.4.14-alpha.1";
|
|
807
807
|
var pe = () => vn;
|
|
808
808
|
|
|
809
809
|
// src/availability/availability.ts
|
|
810
|
-
var
|
|
810
|
+
var Pe = (r, e) => {
|
|
811
811
|
const t = () => {
|
|
812
|
-
if (r) return
|
|
813
|
-
if (e) return
|
|
814
|
-
return
|
|
812
|
+
if (r) return L[Z];
|
|
813
|
+
if (e) return L[Ft.PRODUCTION];
|
|
814
|
+
return L[Ft.SANDBOX];
|
|
815
815
|
};
|
|
816
816
|
const n = async () => {
|
|
817
817
|
let o;
|
|
@@ -915,16 +915,16 @@ var B = /* @__PURE__ */ ((o) => {
|
|
|
915
915
|
o["ERC1155"] = "ERC1155";
|
|
916
916
|
return o;
|
|
917
917
|
})(B || {});
|
|
918
|
-
var
|
|
918
|
+
var ge = /* @__PURE__ */ ((t) => {
|
|
919
919
|
t["TRANSACTION"] = "TRANSACTION";
|
|
920
920
|
t["GAS"] = "GAS";
|
|
921
921
|
return t;
|
|
922
|
-
})(
|
|
923
|
-
var
|
|
922
|
+
})(ge || {});
|
|
923
|
+
var Ee = /* @__PURE__ */ ((t) => {
|
|
924
924
|
t["NATIVE"] = "NATIVE";
|
|
925
925
|
t["ERC20"] = "ERC20";
|
|
926
926
|
return t;
|
|
927
|
-
})(
|
|
927
|
+
})(Ee || {});
|
|
928
928
|
var st = /* @__PURE__ */ ((n) => {
|
|
929
929
|
n["ROUTES_FOUND"] = "ROUTES_FOUND";
|
|
930
930
|
n["NO_ROUTES_FOUND"] = "NO_ROUTES_FOUND";
|
|
@@ -1305,9 +1305,9 @@ var bn = (r, e) => {
|
|
|
1305
1305
|
return we;
|
|
1306
1306
|
};
|
|
1307
1307
|
var Ln = (r, e) => {
|
|
1308
|
-
if (e) return
|
|
1309
|
-
if (r) return
|
|
1310
|
-
return
|
|
1308
|
+
if (e) return L[Z];
|
|
1309
|
+
if (r) return L[oe.PRODUCTION];
|
|
1310
|
+
return L[oe.SANDBOX];
|
|
1311
1311
|
};
|
|
1312
1312
|
var Dn = (r, e) => {
|
|
1313
1313
|
if (e) return "imtbl-zkevm-devnet";
|
|
@@ -1324,9 +1324,9 @@ var A = (r) => {
|
|
|
1324
1324
|
return 13473;
|
|
1325
1325
|
};
|
|
1326
1326
|
var Fn = (r, e) => {
|
|
1327
|
-
if (e) return
|
|
1328
|
-
if (r) return
|
|
1329
|
-
return
|
|
1327
|
+
if (e) return ke[Z];
|
|
1328
|
+
if (r) return ke[oe.PRODUCTION];
|
|
1329
|
+
return ke[oe.SANDBOX];
|
|
1330
1330
|
};
|
|
1331
1331
|
var Ie = class {
|
|
1332
1332
|
// This is a hidden feature that is only available
|
|
@@ -1436,7 +1436,7 @@ var O = (r) => !r || T(r, _);
|
|
|
1436
1436
|
async function Oe(r, e) {
|
|
1437
1437
|
return await x(
|
|
1438
1438
|
async () => {
|
|
1439
|
-
const t = new Gn(e, JSON.stringify(
|
|
1439
|
+
const t = new Gn(e, JSON.stringify(D), r);
|
|
1440
1440
|
const [n, o, a] = await Promise.all([
|
|
1441
1441
|
t.name(),
|
|
1442
1442
|
t.symbol(),
|
|
@@ -1619,7 +1619,7 @@ async function ft(r, e, t) {
|
|
|
1619
1619
|
async () => {
|
|
1620
1620
|
const n = new Hn(
|
|
1621
1621
|
t,
|
|
1622
|
-
JSON.stringify(
|
|
1622
|
+
JSON.stringify(D),
|
|
1623
1623
|
r
|
|
1624
1624
|
);
|
|
1625
1625
|
return Promise.all([
|
|
@@ -1643,7 +1643,7 @@ async function ft(r, e, t) {
|
|
|
1643
1643
|
);
|
|
1644
1644
|
}
|
|
1645
1645
|
var pt = /* @__PURE__ */ new Map();
|
|
1646
|
-
var
|
|
1646
|
+
var gt = () => pt.clear();
|
|
1647
1647
|
var zn = async (r, e, t, n) => {
|
|
1648
1648
|
const o = n !== void 0;
|
|
1649
1649
|
const a = Object.assign(
|
|
@@ -1659,37 +1659,37 @@ var zn = async (r, e, t, n) => {
|
|
|
1659
1659
|
const i = [];
|
|
1660
1660
|
const c = "ERC-20";
|
|
1661
1661
|
const d = async (m) => {
|
|
1662
|
-
let
|
|
1662
|
+
let g;
|
|
1663
1663
|
try {
|
|
1664
1664
|
do {
|
|
1665
|
-
|
|
1665
|
+
g = await m.getTokensByWalletAddress({
|
|
1666
1666
|
walletAddress: e,
|
|
1667
1667
|
tokenType: c,
|
|
1668
|
-
nextPage:
|
|
1668
|
+
nextPage: g?.next_page_params
|
|
1669
1669
|
});
|
|
1670
|
-
i.push(...
|
|
1671
|
-
} while (
|
|
1672
|
-
} catch (
|
|
1673
|
-
if (
|
|
1670
|
+
i.push(...g.items);
|
|
1671
|
+
} while (g.next_page_params);
|
|
1672
|
+
} catch (E) {
|
|
1673
|
+
if (E?.code !== lt.NotFound) {
|
|
1674
1674
|
throw new p(
|
|
1675
|
-
|
|
1675
|
+
E.message || "InternalServerError | getTokensByWalletAddress",
|
|
1676
1676
|
"GET_INDEXER_BALANCE_ERROR",
|
|
1677
|
-
{ error:
|
|
1677
|
+
{ error: E }
|
|
1678
1678
|
);
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
};
|
|
1682
1682
|
const l = async (m) => {
|
|
1683
1683
|
try {
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
i.push(
|
|
1687
|
-
} catch (
|
|
1688
|
-
if (
|
|
1684
|
+
const g = await m.getNativeTokenByWalletAddress({ walletAddress: e });
|
|
1685
|
+
g.token.address ||= _;
|
|
1686
|
+
i.push(g);
|
|
1687
|
+
} catch (g) {
|
|
1688
|
+
if (g?.code !== lt.NotFound) {
|
|
1689
1689
|
throw new p(
|
|
1690
|
-
|
|
1690
|
+
g.message || "InternalServerError | getNativeTokenByWalletAddress",
|
|
1691
1691
|
"GET_INDEXER_BALANCE_ERROR",
|
|
1692
|
-
{ error:
|
|
1692
|
+
{ error: g }
|
|
1693
1693
|
);
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
@@ -1700,16 +1700,16 @@ var zn = async (r, e, t, n) => {
|
|
|
1700
1700
|
]);
|
|
1701
1701
|
const u = [];
|
|
1702
1702
|
i.forEach((m) => {
|
|
1703
|
-
const
|
|
1704
|
-
if (o && !
|
|
1705
|
-
const
|
|
1703
|
+
const g = a[m.token.address.toLowerCase()];
|
|
1704
|
+
if (o && !g) return;
|
|
1705
|
+
const E = m.token || {};
|
|
1706
1706
|
if (m.value == null) return;
|
|
1707
1707
|
const f = BigInt(m.value);
|
|
1708
|
-
let R = parseInt(
|
|
1708
|
+
let R = parseInt(E.decimals, 10);
|
|
1709
1709
|
if (Number.isNaN(R)) R = G;
|
|
1710
|
-
const I =
|
|
1710
|
+
const I = E.icon_url ?? g.icon;
|
|
1711
1711
|
const C = {
|
|
1712
|
-
...
|
|
1712
|
+
...E,
|
|
1713
1713
|
decimals: R,
|
|
1714
1714
|
icon: I
|
|
1715
1715
|
};
|
|
@@ -1778,7 +1778,7 @@ var q = async (r, e, t, n, o = false) => {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
);
|
|
1780
1780
|
if (o) {
|
|
1781
|
-
|
|
1781
|
+
gt();
|
|
1782
1782
|
}
|
|
1783
1783
|
if (he.isChainSupported(n)) {
|
|
1784
1784
|
const s = t ?? await (await e?.getSigner())?.getAddress();
|
|
@@ -2124,7 +2124,7 @@ async function ar(r, e, t) {
|
|
|
2124
2124
|
|
|
2125
2125
|
// src/gasEstimate/gasPriceInWei.ts
|
|
2126
2126
|
var lo = (r) => !!r.maxFeePerGas && !!r.maxPriorityFeePerGas;
|
|
2127
|
-
var
|
|
2127
|
+
var Et = (r) => {
|
|
2128
2128
|
if (lo(r)) {
|
|
2129
2129
|
const { maxFeePerGas: e, maxPriorityFeePerGas: t } = r;
|
|
2130
2130
|
if (e === null || t === null) return null;
|
|
@@ -2195,7 +2195,7 @@ function Ct() {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
|
|
2197
2197
|
// src/provider/injectedProvidersManager.ts
|
|
2198
|
-
var
|
|
2198
|
+
var F = class r {
|
|
2199
2199
|
static instance;
|
|
2200
2200
|
store;
|
|
2201
2201
|
resetTimeout;
|
|
@@ -2268,7 +2268,7 @@ var mo = (r) => ({
|
|
|
2268
2268
|
});
|
|
2269
2269
|
|
|
2270
2270
|
// src/provider/provider.ts
|
|
2271
|
-
async function
|
|
2271
|
+
async function go() {
|
|
2272
2272
|
const r = await x(
|
|
2273
2273
|
async () => await fo(),
|
|
2274
2274
|
{ type: "METAMASK_PROVIDER_ERROR" }
|
|
@@ -2286,7 +2286,7 @@ async function sr(r, e) {
|
|
|
2286
2286
|
let n;
|
|
2287
2287
|
switch (r) {
|
|
2288
2288
|
case "passport": {
|
|
2289
|
-
n =
|
|
2289
|
+
n = F.getInstance().findProvider({ rdns: Le.rdns });
|
|
2290
2290
|
if (!n) {
|
|
2291
2291
|
if (e) {
|
|
2292
2292
|
t = new b(
|
|
@@ -2305,14 +2305,14 @@ async function sr(r, e) {
|
|
|
2305
2305
|
break;
|
|
2306
2306
|
}
|
|
2307
2307
|
case "metamask": {
|
|
2308
|
-
n =
|
|
2308
|
+
n = F.getInstance().findProvider({ rdns: be.rdns });
|
|
2309
2309
|
if (!n) {
|
|
2310
|
-
t = await
|
|
2310
|
+
t = await go();
|
|
2311
2311
|
}
|
|
2312
2312
|
break;
|
|
2313
2313
|
}
|
|
2314
2314
|
default:
|
|
2315
|
-
n =
|
|
2315
|
+
n = F.getInstance().findProvider({ rdns: r });
|
|
2316
2316
|
if (!n) {
|
|
2317
2317
|
console.error(
|
|
2318
2318
|
"The WalletProviderName that was provided is not supported"
|
|
@@ -2529,7 +2529,7 @@ var Ao = async (r, e, t, n) => {
|
|
|
2529
2529
|
try {
|
|
2530
2530
|
const o = new dr(
|
|
2531
2531
|
t,
|
|
2532
|
-
JSON.stringify(
|
|
2532
|
+
JSON.stringify(D),
|
|
2533
2533
|
r
|
|
2534
2534
|
);
|
|
2535
2535
|
return await o.allowance(e, n);
|
|
@@ -2545,7 +2545,7 @@ var yo = async (r, e, t, n, o) => {
|
|
|
2545
2545
|
try {
|
|
2546
2546
|
const a = new dr(
|
|
2547
2547
|
t,
|
|
2548
|
-
JSON.stringify(
|
|
2548
|
+
JSON.stringify(D),
|
|
2549
2549
|
r
|
|
2550
2550
|
);
|
|
2551
2551
|
const s = await a.approve.populateTransaction(n, o);
|
|
@@ -2566,39 +2566,39 @@ var lr = async (r, e, t) => {
|
|
|
2566
2566
|
const s = /* @__PURE__ */ new Map();
|
|
2567
2567
|
const i = /* @__PURE__ */ new Map();
|
|
2568
2568
|
const c = /* @__PURE__ */ new Map();
|
|
2569
|
-
for (const
|
|
2570
|
-
if (
|
|
2571
|
-
const { tokenAddress:
|
|
2572
|
-
const R = `${
|
|
2573
|
-
a.set(R,
|
|
2569
|
+
for (const g of t) {
|
|
2570
|
+
if (g.type !== "ERC20") continue;
|
|
2571
|
+
const { tokenAddress: E, spenderAddress: f } = g;
|
|
2572
|
+
const R = `${E}${f}`;
|
|
2573
|
+
a.set(R, g);
|
|
2574
2574
|
s.set(
|
|
2575
2575
|
R,
|
|
2576
|
-
Ao(r, e,
|
|
2576
|
+
Ao(r, e, E, f)
|
|
2577
2577
|
);
|
|
2578
2578
|
}
|
|
2579
2579
|
const d = await Promise.all(s.values());
|
|
2580
2580
|
const l = Array.from(s.keys());
|
|
2581
|
-
for (let
|
|
2582
|
-
const
|
|
2583
|
-
if (!
|
|
2584
|
-
if (d[
|
|
2581
|
+
for (let g = 0; g < d.length; g++) {
|
|
2582
|
+
const E = a.get(l[g]);
|
|
2583
|
+
if (!E || E.type !== "ERC20") continue;
|
|
2584
|
+
if (d[g] >= E.amount) {
|
|
2585
2585
|
o.push({
|
|
2586
2586
|
sufficient: true,
|
|
2587
|
-
itemRequirement:
|
|
2587
|
+
itemRequirement: E
|
|
2588
2588
|
});
|
|
2589
2589
|
continue;
|
|
2590
2590
|
}
|
|
2591
2591
|
n = false;
|
|
2592
|
-
const { tokenAddress: f, spenderAddress: R } =
|
|
2592
|
+
const { tokenAddress: f, spenderAddress: R } = E;
|
|
2593
2593
|
const I = `${f}${R}`;
|
|
2594
|
-
const C =
|
|
2594
|
+
const C = E.amount - d[g];
|
|
2595
2595
|
i.set(
|
|
2596
2596
|
I,
|
|
2597
2597
|
{
|
|
2598
2598
|
type: "ERC20",
|
|
2599
2599
|
sufficient: false,
|
|
2600
2600
|
delta: C,
|
|
2601
|
-
itemRequirement:
|
|
2601
|
+
itemRequirement: E,
|
|
2602
2602
|
approvalTransaction: void 0
|
|
2603
2603
|
}
|
|
2604
2604
|
);
|
|
@@ -2615,11 +2615,11 @@ var lr = async (r, e, t) => {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
const u = await Promise.all(c.values());
|
|
2617
2617
|
const m = Array.from(c.keys());
|
|
2618
|
-
u.forEach((
|
|
2619
|
-
const f = i.get(m[
|
|
2618
|
+
u.forEach((g, E) => {
|
|
2619
|
+
const f = i.get(m[E]);
|
|
2620
2620
|
if (!f) return;
|
|
2621
2621
|
if (f.sufficient) return;
|
|
2622
|
-
f.approvalTransaction =
|
|
2622
|
+
f.approvalTransaction = g;
|
|
2623
2623
|
});
|
|
2624
2624
|
return { sufficient: n, allowances: o.concat(Array.from(i.values())) };
|
|
2625
2625
|
};
|
|
@@ -2671,7 +2671,7 @@ var So = async (r, e, t, n, o) => {
|
|
|
2671
2671
|
);
|
|
2672
2672
|
}
|
|
2673
2673
|
};
|
|
2674
|
-
var
|
|
2674
|
+
var ko = async (r, e, t) => {
|
|
2675
2675
|
try {
|
|
2676
2676
|
const n = new It(
|
|
2677
2677
|
e,
|
|
@@ -2709,7 +2709,7 @@ var pr = (r, e) => {
|
|
|
2709
2709
|
);
|
|
2710
2710
|
}
|
|
2711
2711
|
};
|
|
2712
|
-
var
|
|
2712
|
+
var Po = async (r, e, t) => {
|
|
2713
2713
|
const n = /* @__PURE__ */ new Map();
|
|
2714
2714
|
const o = /* @__PURE__ */ new Map();
|
|
2715
2715
|
for (const i of e) {
|
|
@@ -2739,37 +2739,37 @@ var ur = async (r, e, t) => {
|
|
|
2739
2739
|
const s = /* @__PURE__ */ new Map();
|
|
2740
2740
|
const i = /* @__PURE__ */ new Map();
|
|
2741
2741
|
const c = /* @__PURE__ */ new Map();
|
|
2742
|
-
const d = await
|
|
2742
|
+
const d = await Po(
|
|
2743
2743
|
r,
|
|
2744
2744
|
t,
|
|
2745
2745
|
e
|
|
2746
2746
|
);
|
|
2747
|
-
for (const
|
|
2748
|
-
if (
|
|
2749
|
-
const { contractAddress: f, id: R, spenderAddress: I } =
|
|
2747
|
+
for (const E of t) {
|
|
2748
|
+
if (E.type !== "ERC721") continue;
|
|
2749
|
+
const { contractAddress: f, id: R, spenderAddress: I } = E;
|
|
2750
2750
|
const C = `${f}-${I}`;
|
|
2751
2751
|
const y = d.get(C);
|
|
2752
2752
|
if (y) {
|
|
2753
2753
|
o.push({
|
|
2754
2754
|
sufficient: true,
|
|
2755
|
-
itemRequirement:
|
|
2755
|
+
itemRequirement: E
|
|
2756
2756
|
});
|
|
2757
2757
|
continue;
|
|
2758
2758
|
}
|
|
2759
|
-
const
|
|
2759
|
+
const k = `${f}-${R}`;
|
|
2760
2760
|
const N = pr(R, f);
|
|
2761
|
-
a.set(
|
|
2761
|
+
a.set(k, E);
|
|
2762
2762
|
s.set(
|
|
2763
|
-
|
|
2764
|
-
|
|
2763
|
+
k,
|
|
2764
|
+
ko(r, f, N)
|
|
2765
2765
|
);
|
|
2766
2766
|
}
|
|
2767
2767
|
const l = await Promise.all(s.values());
|
|
2768
2768
|
const u = Array.from(s.keys());
|
|
2769
|
-
for (let
|
|
2770
|
-
const f = a.get(u[
|
|
2769
|
+
for (let E = 0; E < l.length; E++) {
|
|
2770
|
+
const f = a.get(u[E]);
|
|
2771
2771
|
if (!f || f.type !== "ERC721") continue;
|
|
2772
|
-
if (l[
|
|
2772
|
+
if (l[E] === f.spenderAddress) {
|
|
2773
2773
|
o.push({
|
|
2774
2774
|
sufficient: true,
|
|
2775
2775
|
itemRequirement: f
|
|
@@ -2779,7 +2779,7 @@ var ur = async (r, e, t) => {
|
|
|
2779
2779
|
n = false;
|
|
2780
2780
|
const { contractAddress: R, id: I, spenderAddress: C } = f;
|
|
2781
2781
|
const y = `${R}-${I}`;
|
|
2782
|
-
const
|
|
2782
|
+
const k = pr(I, R);
|
|
2783
2783
|
i.set(
|
|
2784
2784
|
y,
|
|
2785
2785
|
{
|
|
@@ -2796,17 +2796,17 @@ var ur = async (r, e, t) => {
|
|
|
2796
2796
|
e,
|
|
2797
2797
|
R,
|
|
2798
2798
|
C,
|
|
2799
|
-
|
|
2799
|
+
k
|
|
2800
2800
|
)
|
|
2801
2801
|
);
|
|
2802
2802
|
}
|
|
2803
2803
|
const m = await Promise.all(c.values());
|
|
2804
|
-
const
|
|
2805
|
-
m.forEach((
|
|
2806
|
-
const R = i.get(
|
|
2804
|
+
const g = Array.from(c.keys());
|
|
2805
|
+
m.forEach((E, f) => {
|
|
2806
|
+
const R = i.get(g[f]);
|
|
2807
2807
|
if (!R) return;
|
|
2808
2808
|
if (R.sufficient) return;
|
|
2809
|
-
R.approvalTransaction =
|
|
2809
|
+
R.approvalTransaction = E;
|
|
2810
2810
|
});
|
|
2811
2811
|
return { sufficient: n, allowances: o.concat(Array.from(i.values())) };
|
|
2812
2812
|
};
|
|
@@ -2954,11 +2954,11 @@ var Bo = (r) => {
|
|
|
2954
2954
|
});
|
|
2955
2955
|
return t.concat(Array.from(e.values()));
|
|
2956
2956
|
};
|
|
2957
|
-
var
|
|
2957
|
+
var gr = (r) => Bo(Oo(_o(r)));
|
|
2958
2958
|
|
|
2959
2959
|
// src/smartCheckout/balanceCheck/balanceRequirement.ts
|
|
2960
2960
|
import { Contract as Mo, formatUnits as Fe } from "ethers";
|
|
2961
|
-
var
|
|
2961
|
+
var Er = (r) => r.map((e) => {
|
|
2962
2962
|
switch (e.type) {
|
|
2963
2963
|
case "ERC20":
|
|
2964
2964
|
return {
|
|
@@ -3045,16 +3045,16 @@ var Tr = async (r, e, t) => {
|
|
|
3045
3045
|
try {
|
|
3046
3046
|
const l = new Mo(
|
|
3047
3047
|
o.tokenAddress,
|
|
3048
|
-
JSON.stringify(
|
|
3048
|
+
JSON.stringify(D),
|
|
3049
3049
|
t
|
|
3050
3050
|
);
|
|
3051
|
-
const [u, m,
|
|
3051
|
+
const [u, m, g] = await Promise.all([
|
|
3052
3052
|
l.name(),
|
|
3053
3053
|
l.symbol(),
|
|
3054
3054
|
l.decimals()
|
|
3055
3055
|
]);
|
|
3056
3056
|
s = o.tokenAddress;
|
|
3057
|
-
d =
|
|
3057
|
+
d = g;
|
|
3058
3058
|
i = u;
|
|
3059
3059
|
c = m;
|
|
3060
3060
|
} catch (l) {
|
|
@@ -3142,7 +3142,7 @@ var Ir = (r, e, t) => {
|
|
|
3142
3142
|
var Lo = async (r, e, t, n, o = false) => {
|
|
3143
3143
|
try {
|
|
3144
3144
|
const a = /* @__PURE__ */ new Map();
|
|
3145
|
-
|
|
3145
|
+
Er(n).forEach(
|
|
3146
3146
|
(i) => {
|
|
3147
3147
|
if (!i.address) return;
|
|
3148
3148
|
a.set(i.address.toLocaleLowerCase(), i);
|
|
@@ -3201,7 +3201,7 @@ var Do = async (r, e, t) => {
|
|
|
3201
3201
|
return n;
|
|
3202
3202
|
};
|
|
3203
3203
|
var hr = async (r, e, t, n, o = false) => {
|
|
3204
|
-
const a =
|
|
3204
|
+
const a = gr(n);
|
|
3205
3205
|
const s = [];
|
|
3206
3206
|
const i = [];
|
|
3207
3207
|
a.forEach((m) => {
|
|
@@ -3234,32 +3234,32 @@ var hr = async (r, e, t, n, o = false) => {
|
|
|
3234
3234
|
const l = [];
|
|
3235
3235
|
if (s.length > 0) {
|
|
3236
3236
|
const m = d.shift() ?? [];
|
|
3237
|
-
const
|
|
3237
|
+
const g = new Map(m.map((f) => {
|
|
3238
3238
|
const R = f.type === "NATIVE" ? _ : f.token.address?.toLowerCase();
|
|
3239
3239
|
return [R, f];
|
|
3240
3240
|
}));
|
|
3241
|
-
const
|
|
3241
|
+
const E = await Tr(s, m, e);
|
|
3242
3242
|
s.forEach((f) => {
|
|
3243
3243
|
const R = (f.tokenAddress ?? _).toLowerCase();
|
|
3244
|
-
const I =
|
|
3245
|
-
const C =
|
|
3246
|
-
const y = Ir(f, [...
|
|
3244
|
+
const I = E[R];
|
|
3245
|
+
const C = g.get(R);
|
|
3246
|
+
const y = Ir(f, [...g.values()], I);
|
|
3247
3247
|
l.push(y);
|
|
3248
3248
|
if (!C) {
|
|
3249
3249
|
return;
|
|
3250
3250
|
}
|
|
3251
|
-
const
|
|
3252
|
-
|
|
3251
|
+
const k = C.balance - y.required.balance;
|
|
3252
|
+
g.set(R, {
|
|
3253
3253
|
...C,
|
|
3254
|
-
balance:
|
|
3255
|
-
formattedBalance: bo(
|
|
3254
|
+
balance: k,
|
|
3255
|
+
formattedBalance: bo(k, y.required.token.decimals)
|
|
3256
3256
|
});
|
|
3257
3257
|
});
|
|
3258
3258
|
}
|
|
3259
3259
|
if (i.length > 0) {
|
|
3260
3260
|
const m = d.shift() ?? [];
|
|
3261
|
-
i.forEach((
|
|
3262
|
-
l.push(Rr(
|
|
3261
|
+
i.forEach((g) => {
|
|
3262
|
+
l.push(Rr(g, m));
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
3265
|
const u = l.find((m) => !m.sufficient) === void 0;
|
|
@@ -3308,7 +3308,7 @@ var yr = async (r, e, t) => {
|
|
|
3308
3308
|
n.push(Ar(r, t.transaction));
|
|
3309
3309
|
} else {
|
|
3310
3310
|
const s = await r.getFeeData();
|
|
3311
|
-
const i =
|
|
3311
|
+
const i = Et(s);
|
|
3312
3312
|
if (i !== null) {
|
|
3313
3313
|
const c = i * t.gasToken.limit;
|
|
3314
3314
|
if (c) o += c;
|
|
@@ -3325,7 +3325,7 @@ var yr = async (r, e, t) => {
|
|
|
3325
3325
|
// src/smartCheckout/routing/geoBlocking.ts
|
|
3326
3326
|
var wr = async () => true;
|
|
3327
3327
|
var Sr = async (r) => {
|
|
3328
|
-
const e =
|
|
3328
|
+
const e = Pe(r.isDevelopment, r.isProduction);
|
|
3329
3329
|
try {
|
|
3330
3330
|
return await e.checkDexAvailability();
|
|
3331
3331
|
} catch {
|
|
@@ -3337,7 +3337,7 @@ var Sr = async (r) => {
|
|
|
3337
3337
|
function ht(r) {
|
|
3338
3338
|
return r?.ethereumProvider?.isPassport === true;
|
|
3339
3339
|
}
|
|
3340
|
-
var
|
|
3340
|
+
var kr = async (r, e) => {
|
|
3341
3341
|
const t = {
|
|
3342
3342
|
onRamp: r.isOnRampEnabled,
|
|
3343
3343
|
swap: r.isSwapEnabled,
|
|
@@ -3363,7 +3363,7 @@ var Pr = async (r, e) => {
|
|
|
3363
3363
|
};
|
|
3364
3364
|
|
|
3365
3365
|
// src/smartCheckout/routing/tokenBalances.ts
|
|
3366
|
-
var
|
|
3366
|
+
var Pr = async (r, e, t, n) => {
|
|
3367
3367
|
const o = /* @__PURE__ */ new Map();
|
|
3368
3368
|
const a = /* @__PURE__ */ new Map();
|
|
3369
3369
|
if (e.size === 0) {
|
|
@@ -3459,8 +3459,8 @@ var We = async (r, e, t, n, o) => {
|
|
|
3459
3459
|
);
|
|
3460
3460
|
l.forEach((u, m) => {
|
|
3461
3461
|
if (u.status === "rejected") return;
|
|
3462
|
-
const
|
|
3463
|
-
a.set(
|
|
3462
|
+
const g = d[m];
|
|
3463
|
+
a.set(g, {
|
|
3464
3464
|
quote: u.value.quote,
|
|
3465
3465
|
approval: u.value.approval?.gasFeeEstimate ?? null,
|
|
3466
3466
|
swap: u.value.swap.gasFeeEstimate
|
|
@@ -3692,12 +3692,12 @@ var Ge = async (r, e, t, n, o, a, s) => {
|
|
|
3692
3692
|
c,
|
|
3693
3693
|
a
|
|
3694
3694
|
);
|
|
3695
|
-
const
|
|
3696
|
-
for (const
|
|
3697
|
-
const f = m.get(
|
|
3695
|
+
const g = Array.from(m.keys());
|
|
3696
|
+
for (const E of g) {
|
|
3697
|
+
const f = m.get(E);
|
|
3698
3698
|
if (!f) continue;
|
|
3699
3699
|
const R = u.find(
|
|
3700
|
-
(
|
|
3700
|
+
(k) => T(k.token.address, E)
|
|
3701
3701
|
);
|
|
3702
3702
|
if (!R) continue;
|
|
3703
3703
|
const I = f.quote.amountWithMaxSlippage;
|
|
@@ -3711,13 +3711,13 @@ var Ge = async (r, e, t, n, o, a, s) => {
|
|
|
3711
3711
|
f.quote.fees,
|
|
3712
3712
|
{
|
|
3713
3713
|
amount: I.value,
|
|
3714
|
-
address:
|
|
3714
|
+
address: E
|
|
3715
3715
|
}
|
|
3716
3716
|
)) continue;
|
|
3717
3717
|
if (!Ho(
|
|
3718
3718
|
R.balance,
|
|
3719
3719
|
s,
|
|
3720
|
-
|
|
3720
|
+
E,
|
|
3721
3721
|
I.value,
|
|
3722
3722
|
C,
|
|
3723
3723
|
f.quote.fees
|
|
@@ -3952,50 +3952,50 @@ var Ve = async (r, e, t, n, o) => {
|
|
|
3952
3952
|
if (!u) return void 0;
|
|
3953
3953
|
const { l1address: m } = u;
|
|
3954
3954
|
if (O(m)) {
|
|
3955
|
-
if (!l.find((
|
|
3956
|
-
} else if (!l.find((
|
|
3955
|
+
if (!l.find((k) => O(k.address))) return void 0;
|
|
3956
|
+
} else if (!l.find((k) => T(k.address, m))) {
|
|
3957
3957
|
return void 0;
|
|
3958
3958
|
}
|
|
3959
|
-
const
|
|
3959
|
+
const g = await Or(
|
|
3960
3960
|
r,
|
|
3961
3961
|
e,
|
|
3962
3962
|
a,
|
|
3963
3963
|
s
|
|
3964
3964
|
);
|
|
3965
3965
|
const {
|
|
3966
|
-
sourceChainGas:
|
|
3966
|
+
sourceChainGas: E,
|
|
3967
3967
|
approvalGas: f,
|
|
3968
3968
|
bridgeFee: R,
|
|
3969
3969
|
imtblFee: I,
|
|
3970
3970
|
totalFees: C
|
|
3971
|
-
} =
|
|
3971
|
+
} = g;
|
|
3972
3972
|
if (!Yo(c, C)) return void 0;
|
|
3973
3973
|
if (O(m)) {
|
|
3974
|
-
const
|
|
3975
|
-
if (
|
|
3974
|
+
const k = c.balances.find((N) => O(N.token.address));
|
|
3975
|
+
if (k && k.balance >= n.amount + C) {
|
|
3976
3976
|
const N = Br(
|
|
3977
|
-
|
|
3977
|
+
E,
|
|
3978
3978
|
R,
|
|
3979
3979
|
I,
|
|
3980
3980
|
f,
|
|
3981
3981
|
i
|
|
3982
3982
|
);
|
|
3983
|
-
return Mr(a,
|
|
3983
|
+
return Mr(a, k, n, "NATIVE", N);
|
|
3984
3984
|
}
|
|
3985
3985
|
return void 0;
|
|
3986
3986
|
}
|
|
3987
3987
|
const y = c.balances.find(
|
|
3988
|
-
(
|
|
3988
|
+
(k) => T(k.token.address, m)
|
|
3989
3989
|
);
|
|
3990
3990
|
if (y && y.balance >= n.amount) {
|
|
3991
|
-
const
|
|
3992
|
-
|
|
3991
|
+
const k = Br(
|
|
3992
|
+
E,
|
|
3993
3993
|
R,
|
|
3994
3994
|
I,
|
|
3995
3995
|
f,
|
|
3996
3996
|
i
|
|
3997
3997
|
);
|
|
3998
|
-
return Mr(a, y, n, "ERC20",
|
|
3998
|
+
return Mr(a, y, n, "ERC20", k);
|
|
3999
3999
|
}
|
|
4000
4000
|
return void 0;
|
|
4001
4001
|
};
|
|
@@ -4073,9 +4073,9 @@ var br = (r, e, t, n, o) => {
|
|
|
4073
4073
|
return T(C.token.address, l);
|
|
4074
4074
|
});
|
|
4075
4075
|
if (!m) continue;
|
|
4076
|
-
const
|
|
4077
|
-
const
|
|
4078
|
-
const f =
|
|
4076
|
+
const g = i.quote.amountWithMaxSlippage.value;
|
|
4077
|
+
const E = $o(i, s);
|
|
4078
|
+
const f = g + E;
|
|
4079
4079
|
const R = Xo(
|
|
4080
4080
|
o,
|
|
4081
4081
|
s
|
|
@@ -4168,15 +4168,15 @@ var oa = (r, e, t, n, o) => {
|
|
|
4168
4168
|
let u = BigInt(0);
|
|
4169
4169
|
const m = s.get(l);
|
|
4170
4170
|
if (m) u = m.balance;
|
|
4171
|
-
const
|
|
4172
|
-
const
|
|
4171
|
+
const g = u + d;
|
|
4172
|
+
const E = o.find((f) => T(f.address, l));
|
|
4173
4173
|
s.set(l, {
|
|
4174
|
-
balance:
|
|
4174
|
+
balance: g,
|
|
4175
4175
|
formattedBalance: ta(
|
|
4176
|
-
|
|
4177
|
-
|
|
4176
|
+
g,
|
|
4177
|
+
E.decimals
|
|
4178
4178
|
),
|
|
4179
|
-
token:
|
|
4179
|
+
token: E
|
|
4180
4180
|
});
|
|
4181
4181
|
}
|
|
4182
4182
|
const i = Array.from(s.values());
|
|
@@ -4250,22 +4250,22 @@ var Fr = async (r, e, t, n, o, a, s, i, c) => {
|
|
|
4250
4250
|
u
|
|
4251
4251
|
)) return [];
|
|
4252
4252
|
const m = await Lr(r, i);
|
|
4253
|
-
const
|
|
4253
|
+
const g = na(
|
|
4254
4254
|
u,
|
|
4255
4255
|
s,
|
|
4256
4256
|
i,
|
|
4257
4257
|
m
|
|
4258
4258
|
);
|
|
4259
|
-
if (
|
|
4260
|
-
const
|
|
4259
|
+
if (g.length === 0) return [];
|
|
4260
|
+
const E = await Dr(
|
|
4261
4261
|
r,
|
|
4262
4262
|
o,
|
|
4263
4263
|
u,
|
|
4264
4264
|
n,
|
|
4265
|
-
|
|
4265
|
+
g
|
|
4266
4266
|
);
|
|
4267
4267
|
const f = br(
|
|
4268
|
-
|
|
4268
|
+
E,
|
|
4269
4269
|
d,
|
|
4270
4270
|
l,
|
|
4271
4271
|
m,
|
|
@@ -4275,37 +4275,37 @@ var Fr = async (r, e, t, n, o, a, s, i, c) => {
|
|
|
4275
4275
|
const R = /* @__PURE__ */ new Map();
|
|
4276
4276
|
const I = /* @__PURE__ */ new Map();
|
|
4277
4277
|
const C = [];
|
|
4278
|
-
for (const
|
|
4279
|
-
if (!
|
|
4278
|
+
for (const U of f) {
|
|
4279
|
+
if (!U.l2address) continue;
|
|
4280
4280
|
R.set(
|
|
4281
|
-
|
|
4281
|
+
U.l2address,
|
|
4282
4282
|
Ve(
|
|
4283
4283
|
r,
|
|
4284
4284
|
e,
|
|
4285
4285
|
t,
|
|
4286
|
-
|
|
4286
|
+
U,
|
|
4287
4287
|
a
|
|
4288
4288
|
)
|
|
4289
4289
|
);
|
|
4290
|
-
I.set(
|
|
4291
|
-
amount:
|
|
4292
|
-
formattedAmount:
|
|
4293
|
-
l2address:
|
|
4290
|
+
I.set(U.l2address, {
|
|
4291
|
+
amount: U.amount,
|
|
4292
|
+
formattedAmount: U.formattedAmount,
|
|
4293
|
+
l2address: U.l2address
|
|
4294
4294
|
});
|
|
4295
4295
|
}
|
|
4296
4296
|
const y = await Promise.all(R.values());
|
|
4297
|
-
const
|
|
4297
|
+
const k = Array.from(R.keys());
|
|
4298
4298
|
const N = [];
|
|
4299
|
-
y.forEach((
|
|
4300
|
-
const j =
|
|
4301
|
-
if (
|
|
4299
|
+
y.forEach((U, et) => {
|
|
4300
|
+
const j = k[et];
|
|
4301
|
+
if (U === void 0) return;
|
|
4302
4302
|
N.push(j);
|
|
4303
|
-
const
|
|
4304
|
-
if (!
|
|
4303
|
+
const P = I.get(j);
|
|
4304
|
+
if (!P) return;
|
|
4305
4305
|
C.push({
|
|
4306
|
-
amount:
|
|
4307
|
-
formattedAmount:
|
|
4308
|
-
l2address:
|
|
4306
|
+
amount: P.amount,
|
|
4307
|
+
formattedAmount: P.formattedAmount,
|
|
4308
|
+
l2address: P.l2address
|
|
4309
4309
|
});
|
|
4310
4310
|
});
|
|
4311
4311
|
if (N.length === 0) return [];
|
|
@@ -4436,15 +4436,15 @@ var pa = async (r, e, t, n, o, a, s, i) => {
|
|
|
4436
4436
|
if (!d) return [];
|
|
4437
4437
|
if (d.error !== void 0 || !d.success) return [];
|
|
4438
4438
|
const l = s?.bridge ?? [];
|
|
4439
|
-
const u = l.map((
|
|
4440
|
-
if (
|
|
4441
|
-
return
|
|
4439
|
+
const u = l.map((E) => {
|
|
4440
|
+
if (E.address === void 0) return J;
|
|
4441
|
+
return E.address;
|
|
4442
4442
|
});
|
|
4443
4443
|
const m = s?.swap ?? [];
|
|
4444
4444
|
if (n.type !== "NATIVE" && n.type !== "ERC20") {
|
|
4445
4445
|
return [];
|
|
4446
4446
|
}
|
|
4447
|
-
const
|
|
4447
|
+
const g = await Fr(
|
|
4448
4448
|
r,
|
|
4449
4449
|
e,
|
|
4450
4450
|
t,
|
|
@@ -4455,7 +4455,7 @@ var pa = async (r, e, t, n, o, a, s, i) => {
|
|
|
4455
4455
|
m,
|
|
4456
4456
|
i
|
|
4457
4457
|
);
|
|
4458
|
-
return
|
|
4458
|
+
return g;
|
|
4459
4459
|
};
|
|
4460
4460
|
var ua = async (r, e, t) => {
|
|
4461
4461
|
if (!e.onRamp) return void 0;
|
|
@@ -4505,7 +4505,7 @@ var Ur = async (r, e, t, n, o) => {
|
|
|
4505
4505
|
const s = await S(
|
|
4506
4506
|
r,
|
|
4507
4507
|
"Time to get token balances inside router",
|
|
4508
|
-
|
|
4508
|
+
Pr(
|
|
4509
4509
|
r,
|
|
4510
4510
|
a,
|
|
4511
4511
|
e,
|
|
@@ -4679,22 +4679,22 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
|
|
|
4679
4679
|
c,
|
|
4680
4680
|
d
|
|
4681
4681
|
);
|
|
4682
|
-
const
|
|
4682
|
+
const g = await S(
|
|
4683
4683
|
r,
|
|
4684
4684
|
"Time to calculate token allowances",
|
|
4685
4685
|
Promise.all([l, u, m])
|
|
4686
4686
|
);
|
|
4687
|
-
const
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4687
|
+
const E = cr(
|
|
4688
|
+
g[0],
|
|
4689
|
+
g[1],
|
|
4690
|
+
g[2]
|
|
4691
4691
|
);
|
|
4692
4692
|
let f = null;
|
|
4693
4693
|
if (n) {
|
|
4694
4694
|
f = await S(
|
|
4695
4695
|
r,
|
|
4696
4696
|
"Time to run gas calculator",
|
|
4697
|
-
yr(e,
|
|
4697
|
+
yr(e, E, n)
|
|
4698
4698
|
);
|
|
4699
4699
|
if (f !== null) {
|
|
4700
4700
|
d.push(f);
|
|
@@ -4711,7 +4711,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
|
|
|
4711
4711
|
const y = await S(
|
|
4712
4712
|
r,
|
|
4713
4713
|
"Time to fetch available routing options",
|
|
4714
|
-
|
|
4714
|
+
kr(r, e)
|
|
4715
4715
|
);
|
|
4716
4716
|
if (o?.onRamp === false) y.onRamp = false;
|
|
4717
4717
|
if (o?.swap === false) y.swap = false;
|
|
@@ -4739,7 +4739,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
|
|
|
4739
4739
|
transactionRequirements: C
|
|
4740
4740
|
};
|
|
4741
4741
|
}
|
|
4742
|
-
const
|
|
4742
|
+
const k = await Gr(
|
|
4743
4743
|
r,
|
|
4744
4744
|
c,
|
|
4745
4745
|
I,
|
|
@@ -4755,7 +4755,7 @@ var ce = async (r, e, t, n, o, a, s, i = false) => {
|
|
|
4755
4755
|
transactionRequirements: C,
|
|
4756
4756
|
router: {
|
|
4757
4757
|
availableRoutingOptions: y,
|
|
4758
|
-
routingOutcome:
|
|
4758
|
+
routingOutcome: k
|
|
4759
4759
|
}
|
|
4760
4760
|
};
|
|
4761
4761
|
};
|
|
@@ -4771,15 +4771,15 @@ import { track as wa } from "@imtbl/metrics";
|
|
|
4771
4771
|
function wt(r) {
|
|
4772
4772
|
return r?.ethereumProvider?.isPassport === true;
|
|
4773
4773
|
}
|
|
4774
|
-
function
|
|
4774
|
+
function ga(r) {
|
|
4775
4775
|
return wt(r);
|
|
4776
4776
|
}
|
|
4777
|
-
var
|
|
4777
|
+
var Ea = async (r, e) => {
|
|
4778
4778
|
const t = e;
|
|
4779
4779
|
const { chainId: n } = await r.getNetwork();
|
|
4780
4780
|
if (!Kt(Number(n))) return t;
|
|
4781
4781
|
if (typeof t.gasPrice !== "undefined") return t;
|
|
4782
|
-
if (
|
|
4782
|
+
if (ga(r)) {
|
|
4783
4783
|
t.gasPrice = BigInt(0);
|
|
4784
4784
|
} else {
|
|
4785
4785
|
t.maxFeePerGas = ot.maxFeePerGas;
|
|
@@ -4808,10 +4808,10 @@ var St = (r) => {
|
|
|
4808
4808
|
{ error: r }
|
|
4809
4809
|
);
|
|
4810
4810
|
};
|
|
4811
|
-
var
|
|
4811
|
+
var W = async (r, e) => {
|
|
4812
4812
|
try {
|
|
4813
4813
|
const t = await r.getSigner();
|
|
4814
|
-
const n = await
|
|
4814
|
+
const n = await Ea(r, e);
|
|
4815
4815
|
const o = await t.sendTransaction(n);
|
|
4816
4816
|
return {
|
|
4817
4817
|
transactionResponse: o
|
|
@@ -4826,7 +4826,7 @@ var Ke = async (r, e) => {
|
|
|
4826
4826
|
let t = [];
|
|
4827
4827
|
try {
|
|
4828
4828
|
const n = await Promise.all(
|
|
4829
|
-
e.map((o) =>
|
|
4829
|
+
e.map((o) => W(r, o))
|
|
4830
4830
|
);
|
|
4831
4831
|
t = await Promise.all(n.map((o) => o.transactionResponse.wait()));
|
|
4832
4832
|
} catch (n) {
|
|
@@ -4853,7 +4853,7 @@ var Qe = async (r, e) => {
|
|
|
4853
4853
|
let t = [];
|
|
4854
4854
|
try {
|
|
4855
4855
|
const n = await Promise.all(e.map(
|
|
4856
|
-
(o) =>
|
|
4856
|
+
(o) => W(r, o)
|
|
4857
4857
|
));
|
|
4858
4858
|
t = await Promise.all(n.map((o) => o.transactionResponse.wait()));
|
|
4859
4859
|
} catch (n) {
|
|
@@ -4936,7 +4936,7 @@ var Vr = async (r) => {
|
|
|
4936
4936
|
e = await Promise.all(t);
|
|
4937
4937
|
return e;
|
|
4938
4938
|
};
|
|
4939
|
-
var
|
|
4939
|
+
var Pt = async (r) => {
|
|
4940
4940
|
let e = [];
|
|
4941
4941
|
const t = [];
|
|
4942
4942
|
for (const n of r) {
|
|
@@ -5038,7 +5038,7 @@ var Sa = (r, e, t, n, o = false) => {
|
|
|
5038
5038
|
};
|
|
5039
5039
|
}
|
|
5040
5040
|
};
|
|
5041
|
-
var
|
|
5041
|
+
var ka = (r, e) => {
|
|
5042
5042
|
if (e.length > 0) {
|
|
5043
5043
|
return {
|
|
5044
5044
|
type: "TRANSACTION",
|
|
@@ -5074,26 +5074,26 @@ var Kr = async (r, e, t, n = {
|
|
|
5074
5074
|
"Time to get the address from the provider",
|
|
5075
5075
|
(await e.getSigner()).getAddress()
|
|
5076
5076
|
);
|
|
5077
|
-
|
|
5077
|
+
gt();
|
|
5078
5078
|
q(r, e, l, v(r));
|
|
5079
5079
|
q(r, e, l, A(r));
|
|
5080
|
-
const { id: u, takerFees: m, fillAmount:
|
|
5081
|
-
let
|
|
5080
|
+
const { id: u, takerFees: m, fillAmount: g } = t[0];
|
|
5081
|
+
let E;
|
|
5082
5082
|
try {
|
|
5083
5083
|
o = await S(
|
|
5084
5084
|
r,
|
|
5085
5085
|
"Time to fetch the listing from the orderbook",
|
|
5086
5086
|
c.getListing(u)
|
|
5087
5087
|
);
|
|
5088
|
-
const { seaportContractAddress:
|
|
5089
|
-
|
|
5090
|
-
a =
|
|
5091
|
-
} catch (
|
|
5088
|
+
const { seaportContractAddress: P, chainName: X } = c.config();
|
|
5089
|
+
E = X;
|
|
5090
|
+
a = P;
|
|
5091
|
+
} catch (P) {
|
|
5092
5092
|
throw new p(
|
|
5093
5093
|
"An error occurred while getting the order listing",
|
|
5094
5094
|
"GET_ORDER_LISTING_ERROR",
|
|
5095
5095
|
{
|
|
5096
|
-
error:
|
|
5096
|
+
error: P,
|
|
5097
5097
|
orderId: u
|
|
5098
5098
|
}
|
|
5099
5099
|
);
|
|
@@ -5110,47 +5110,47 @@ var Kr = async (r, e, t, n = {
|
|
|
5110
5110
|
}
|
|
5111
5111
|
const f = o.result.buy[0];
|
|
5112
5112
|
if (f.type === "ERC20") {
|
|
5113
|
-
const
|
|
5113
|
+
const P = await S(
|
|
5114
5114
|
r,
|
|
5115
5115
|
"Time to get decimals of token contract for the buy token",
|
|
5116
|
-
d.getToken({ contractAddress: f.contractAddress, chainName:
|
|
5116
|
+
d.getToken({ contractAddress: f.contractAddress, chainName: E })
|
|
5117
5117
|
);
|
|
5118
|
-
if (
|
|
5118
|
+
if (P.result.decimals) s = P.result.decimals;
|
|
5119
5119
|
}
|
|
5120
5120
|
let R = [];
|
|
5121
5121
|
if (m && m.length > 0) {
|
|
5122
|
-
const
|
|
5123
|
-
R = $e(m, f.amount, s,
|
|
5122
|
+
const P = o.result.sell[0].type === "ERC721" ? BigInt(1) : BigInt(o.result.sell[0].amount);
|
|
5123
|
+
R = $e(m, f.amount, s, P);
|
|
5124
5124
|
}
|
|
5125
5125
|
let I = [];
|
|
5126
5126
|
let C = [];
|
|
5127
5127
|
let y = [];
|
|
5128
|
-
const
|
|
5128
|
+
const k = performance.now();
|
|
5129
5129
|
try {
|
|
5130
|
-
const { actions:
|
|
5130
|
+
const { actions: P } = await S(
|
|
5131
5131
|
r,
|
|
5132
5132
|
"Time to call fulfillOrder from the orderbook",
|
|
5133
|
-
c.fulfillOrder(u, l, R,
|
|
5133
|
+
c.fulfillOrder(u, l, R, g)
|
|
5134
5134
|
);
|
|
5135
|
-
y =
|
|
5135
|
+
y = P;
|
|
5136
5136
|
I = await S(
|
|
5137
5137
|
r,
|
|
5138
5138
|
"Time to construct the unsigned approval transactions",
|
|
5139
|
-
Vr(
|
|
5139
|
+
Vr(P)
|
|
5140
5140
|
);
|
|
5141
|
-
} catch (
|
|
5142
|
-
const X = (performance.now() -
|
|
5141
|
+
} catch (P) {
|
|
5142
|
+
const X = (performance.now() - k) / 1e3;
|
|
5143
5143
|
dt(r, "Time to call fulfillOrder from the orderbook", X);
|
|
5144
|
-
if (
|
|
5144
|
+
if (P.message.includes(ya.EXPIRED)) {
|
|
5145
5145
|
throw new p("Order is expired", "ORDER_EXPIRED_ERROR", { orderId: u });
|
|
5146
5146
|
}
|
|
5147
|
-
if (!
|
|
5147
|
+
if (!P.message.includes("The fulfiller does not have the balances needed to fulfill")) {
|
|
5148
5148
|
throw new p(
|
|
5149
5149
|
"Error occurred while trying to fulfill the order",
|
|
5150
5150
|
"FULFILL_ORDER_LISTING_ERROR",
|
|
5151
5151
|
{
|
|
5152
5152
|
orderId: u,
|
|
5153
|
-
error:
|
|
5153
|
+
error: P
|
|
5154
5154
|
}
|
|
5155
5155
|
);
|
|
5156
5156
|
}
|
|
@@ -5159,7 +5159,7 @@ var Kr = async (r, e, t, n = {
|
|
|
5159
5159
|
C = await S(
|
|
5160
5160
|
r,
|
|
5161
5161
|
"Time to construct the unsigned fulfillment transactions",
|
|
5162
|
-
|
|
5162
|
+
Pt(y)
|
|
5163
5163
|
);
|
|
5164
5164
|
} catch {
|
|
5165
5165
|
}
|
|
@@ -5186,17 +5186,17 @@ var Kr = async (r, e, t, n = {
|
|
|
5186
5186
|
);
|
|
5187
5187
|
}
|
|
5188
5188
|
}
|
|
5189
|
-
$.forEach((
|
|
5190
|
-
if (
|
|
5191
|
-
N += BigInt(
|
|
5189
|
+
$.forEach((P) => {
|
|
5190
|
+
if (P.type !== "ERC721") {
|
|
5191
|
+
N += BigInt(P.amount);
|
|
5192
5192
|
}
|
|
5193
5193
|
});
|
|
5194
|
-
const
|
|
5195
|
-
|
|
5196
|
-
N += BigInt(
|
|
5194
|
+
const U = o.result.fees;
|
|
5195
|
+
U.forEach((P) => {
|
|
5196
|
+
N += BigInt(P.amount);
|
|
5197
5197
|
});
|
|
5198
|
-
if (o.result.sell[0].type === "ERC1155" &&
|
|
5199
|
-
N = N * BigInt(
|
|
5198
|
+
if (o.result.sell[0].type === "ERC1155" && g) {
|
|
5199
|
+
N = N * BigInt(g) / BigInt(o.result.sell[0].amount);
|
|
5200
5200
|
}
|
|
5201
5201
|
const et = [
|
|
5202
5202
|
Sa(z, de, N, a)
|
|
@@ -5208,25 +5208,25 @@ var Kr = async (r, e, t, n = {
|
|
|
5208
5208
|
r,
|
|
5209
5209
|
e,
|
|
5210
5210
|
et,
|
|
5211
|
-
|
|
5211
|
+
ka(
|
|
5212
5212
|
i,
|
|
5213
5213
|
C
|
|
5214
5214
|
)
|
|
5215
5215
|
)
|
|
5216
5216
|
);
|
|
5217
5217
|
if (j.sufficient) {
|
|
5218
|
-
const
|
|
5219
|
-
if (
|
|
5218
|
+
const P = await Ke(e, I);
|
|
5219
|
+
if (P.type === "FAILED") {
|
|
5220
5220
|
return {
|
|
5221
5221
|
status: "FAILED",
|
|
5222
|
-
transactionHash:
|
|
5223
|
-
reason:
|
|
5222
|
+
transactionHash: P.transactionHash,
|
|
5223
|
+
reason: P.reason,
|
|
5224
5224
|
smartCheckoutResult: j
|
|
5225
5225
|
};
|
|
5226
5226
|
}
|
|
5227
5227
|
try {
|
|
5228
5228
|
if (C.length === 0) {
|
|
5229
|
-
C = await
|
|
5229
|
+
C = await Pt(y);
|
|
5230
5230
|
}
|
|
5231
5231
|
} catch (V) {
|
|
5232
5232
|
throw new p(
|
|
@@ -5253,7 +5253,7 @@ var Kr = async (r, e, t, n = {
|
|
|
5253
5253
|
let X;
|
|
5254
5254
|
try {
|
|
5255
5255
|
const V = await Promise.all(C.map(
|
|
5256
|
-
(tt) =>
|
|
5256
|
+
(tt) => W(e, tt)
|
|
5257
5257
|
));
|
|
5258
5258
|
X = V.map((tt) => tt.transactionResponse);
|
|
5259
5259
|
} catch (V) {
|
|
@@ -5328,7 +5328,7 @@ var va = async (r, e, t, n, o) => {
|
|
|
5328
5328
|
let i;
|
|
5329
5329
|
try {
|
|
5330
5330
|
const c = await Promise.all([a].map(
|
|
5331
|
-
(d) =>
|
|
5331
|
+
(d) => W(t, d)
|
|
5332
5332
|
));
|
|
5333
5333
|
i = c.map((d) => d.transactionResponse);
|
|
5334
5334
|
} catch (c) {
|
|
@@ -5415,7 +5415,7 @@ async function Yr(r, e) {
|
|
|
5415
5415
|
e.forEach((a) => {
|
|
5416
5416
|
if (a.type === "ERC20") {
|
|
5417
5417
|
const { tokenAddress: s } = a;
|
|
5418
|
-
t.push(nr(s,
|
|
5418
|
+
t.push(nr(s, D, r).decimals());
|
|
5419
5419
|
}
|
|
5420
5420
|
});
|
|
5421
5421
|
const n = await Promise.all(t);
|
|
@@ -5491,7 +5491,7 @@ var Jr = async (r, e, t) => {
|
|
|
5491
5491
|
if (s.type === "ERC20") {
|
|
5492
5492
|
const f = new Oa(
|
|
5493
5493
|
s.tokenAddress,
|
|
5494
|
-
JSON.stringify(
|
|
5494
|
+
JSON.stringify(D),
|
|
5495
5495
|
e
|
|
5496
5496
|
);
|
|
5497
5497
|
l = await S(
|
|
@@ -5542,7 +5542,7 @@ var Jr = async (r, e, t) => {
|
|
|
5542
5542
|
}
|
|
5543
5543
|
);
|
|
5544
5544
|
}
|
|
5545
|
-
const
|
|
5545
|
+
const g = [];
|
|
5546
5546
|
if (m && i.type === "ERC1155") {
|
|
5547
5547
|
const f = La(
|
|
5548
5548
|
i.id,
|
|
@@ -5550,20 +5550,20 @@ var Jr = async (r, e, t) => {
|
|
|
5550
5550
|
a,
|
|
5551
5551
|
i.amount
|
|
5552
5552
|
);
|
|
5553
|
-
|
|
5553
|
+
g.push(f);
|
|
5554
5554
|
} else {
|
|
5555
5555
|
const f = ba(i.id, i.collectionAddress, a);
|
|
5556
|
-
|
|
5556
|
+
g.push(f);
|
|
5557
5557
|
}
|
|
5558
|
-
let
|
|
5558
|
+
let E;
|
|
5559
5559
|
if (!ht(e)) {
|
|
5560
|
-
|
|
5560
|
+
E = await S(
|
|
5561
5561
|
r,
|
|
5562
5562
|
"Total time running smart checkout",
|
|
5563
5563
|
ce(
|
|
5564
5564
|
r,
|
|
5565
5565
|
e,
|
|
5566
|
-
|
|
5566
|
+
g,
|
|
5567
5567
|
{
|
|
5568
5568
|
type: "GAS",
|
|
5569
5569
|
gasToken: {
|
|
@@ -5574,9 +5574,9 @@ var Jr = async (r, e, t) => {
|
|
|
5574
5574
|
)
|
|
5575
5575
|
);
|
|
5576
5576
|
} else {
|
|
5577
|
-
|
|
5577
|
+
E = { sufficient: true, transactionRequirements: [] };
|
|
5578
5578
|
}
|
|
5579
|
-
if (
|
|
5579
|
+
if (E.sufficient) {
|
|
5580
5580
|
const f = await jr(o.actions);
|
|
5581
5581
|
const R = await Ke(e, f.approvalTransactions);
|
|
5582
5582
|
if (R.type === "FAILED") {
|
|
@@ -5584,7 +5584,7 @@ var Jr = async (r, e, t) => {
|
|
|
5584
5584
|
status: "FAILED",
|
|
5585
5585
|
transactionHash: R.transactionHash,
|
|
5586
5586
|
reason: R.reason,
|
|
5587
|
-
smartCheckoutResult:
|
|
5587
|
+
smartCheckoutResult: E
|
|
5588
5588
|
};
|
|
5589
5589
|
}
|
|
5590
5590
|
const I = Hr(
|
|
@@ -5607,7 +5607,7 @@ var Jr = async (r, e, t) => {
|
|
|
5607
5607
|
I
|
|
5608
5608
|
);
|
|
5609
5609
|
let y = "";
|
|
5610
|
-
const
|
|
5610
|
+
const k = {
|
|
5611
5611
|
orderComponents: C.orderComponents,
|
|
5612
5612
|
orderHash: C.orderHash,
|
|
5613
5613
|
orderSignature: C.signedMessage,
|
|
@@ -5623,10 +5623,10 @@ var Jr = async (r, e, t) => {
|
|
|
5623
5623
|
"CREATE_ORDER_LISTING_ERROR"
|
|
5624
5624
|
);
|
|
5625
5625
|
}
|
|
5626
|
-
|
|
5626
|
+
k.makerFees = z;
|
|
5627
5627
|
}
|
|
5628
5628
|
try {
|
|
5629
|
-
const N = await n.createListing(
|
|
5629
|
+
const N = await n.createListing(k);
|
|
5630
5630
|
y = N.result.id;
|
|
5631
5631
|
} catch (N) {
|
|
5632
5632
|
throw new p(
|
|
@@ -5642,12 +5642,12 @@ var Jr = async (r, e, t) => {
|
|
|
5642
5642
|
return {
|
|
5643
5643
|
status: "SUCCESS",
|
|
5644
5644
|
orderIds: [y],
|
|
5645
|
-
smartCheckoutResult:
|
|
5645
|
+
smartCheckoutResult: E
|
|
5646
5646
|
};
|
|
5647
5647
|
}
|
|
5648
5648
|
return {
|
|
5649
5649
|
status: "INSUFFICIENT_FUNDS",
|
|
5650
|
-
smartCheckoutResult:
|
|
5650
|
+
smartCheckoutResult: E
|
|
5651
5651
|
};
|
|
5652
5652
|
};
|
|
5653
5653
|
|
|
@@ -5715,16 +5715,16 @@ var Xr = async (r, e, t, n, o, a, s, i, c) => {
|
|
|
5715
5715
|
c
|
|
5716
5716
|
);
|
|
5717
5717
|
if (d.approval) {
|
|
5718
|
-
const m = await
|
|
5719
|
-
const
|
|
5720
|
-
if (
|
|
5718
|
+
const m = await W(e, d.approval.transaction);
|
|
5719
|
+
const g = await m.transactionResponse.wait();
|
|
5720
|
+
if (g?.status === 0) {
|
|
5721
5721
|
throw new p(
|
|
5722
5722
|
"Approval transaction failed and was reverted",
|
|
5723
5723
|
"APPROVAL_TRANSACTION_FAILED"
|
|
5724
5724
|
);
|
|
5725
5725
|
}
|
|
5726
5726
|
}
|
|
5727
|
-
const l = await
|
|
5727
|
+
const l = await W(e, d.swap.transaction);
|
|
5728
5728
|
const u = await l.transactionResponse.wait();
|
|
5729
5729
|
if (u?.status === 0) {
|
|
5730
5730
|
throw new p(
|
|
@@ -5770,7 +5770,7 @@ var Nt = async (r, e) => {
|
|
|
5770
5770
|
try {
|
|
5771
5771
|
const o = n?.levels.map((s) => s.toLowerCase()) ?? [];
|
|
5772
5772
|
const a = await Ga.post(
|
|
5773
|
-
`${
|
|
5773
|
+
`${L[e.environment]}/v1/sanctions/check`,
|
|
5774
5774
|
{
|
|
5775
5775
|
addresses: r
|
|
5776
5776
|
}
|
|
@@ -5786,17 +5786,54 @@ var Nt = async (r, e) => {
|
|
|
5786
5786
|
return t;
|
|
5787
5787
|
}
|
|
5788
5788
|
};
|
|
5789
|
+
|
|
5790
|
+
// src/riskAssessment/riskAssessmentV2.ts
|
|
5791
|
+
import qa from "axios";
|
|
5792
|
+
var ja = async (r, e) => {
|
|
5793
|
+
const t = Object.fromEntries(
|
|
5794
|
+
r.map((o) => [o.address.toLowerCase(), { sanctioned: false }])
|
|
5795
|
+
);
|
|
5796
|
+
const n = await e.remote.getConfig("riskAssessment");
|
|
5797
|
+
if (!n?.enabled) {
|
|
5798
|
+
return t;
|
|
5799
|
+
}
|
|
5800
|
+
try {
|
|
5801
|
+
const o = n?.levels.map((i) => i.toLowerCase()) ?? [];
|
|
5802
|
+
const a = r.map((i) => ({
|
|
5803
|
+
address: i.address,
|
|
5804
|
+
token_addr: i.tokenAddr,
|
|
5805
|
+
amount: i.amount.toString()
|
|
5806
|
+
}));
|
|
5807
|
+
const s = await qa.post(
|
|
5808
|
+
`${L[e.environment]}/v2/sanctions/check`,
|
|
5809
|
+
a
|
|
5810
|
+
);
|
|
5811
|
+
for (const i of s.data) {
|
|
5812
|
+
t[i.address.toLowerCase()].sanctioned = o.includes(
|
|
5813
|
+
i.risk.toLowerCase()
|
|
5814
|
+
);
|
|
5815
|
+
}
|
|
5816
|
+
return t;
|
|
5817
|
+
} catch (o) {
|
|
5818
|
+
console.error("Error fetching risk assessment", o);
|
|
5819
|
+
return t;
|
|
5820
|
+
}
|
|
5821
|
+
};
|
|
5822
|
+
|
|
5823
|
+
// src/riskAssessment/common.ts
|
|
5789
5824
|
var _t = (r, e) => {
|
|
5790
5825
|
if (e) {
|
|
5791
5826
|
return r[e.toLowerCase()].sanctioned;
|
|
5792
5827
|
}
|
|
5793
5828
|
return Object.values(r).some((t) => t.sanctioned);
|
|
5794
5829
|
};
|
|
5830
|
+
var Va = (r, e) => r[e.toLowerCase()].sanctioned;
|
|
5831
|
+
var Ha = (r) => Object.values(r).some((e) => e.sanctioned);
|
|
5795
5832
|
|
|
5796
5833
|
// src/sdk.ts
|
|
5797
|
-
var
|
|
5834
|
+
var Ka = {
|
|
5798
5835
|
baseConfig: {
|
|
5799
|
-
environment:
|
|
5836
|
+
environment: za.SANDBOX
|
|
5800
5837
|
},
|
|
5801
5838
|
passport: void 0
|
|
5802
5839
|
};
|
|
@@ -5811,17 +5848,17 @@ var Ot = class {
|
|
|
5811
5848
|
* Constructs a new instance of the CheckoutModule class.
|
|
5812
5849
|
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
5813
5850
|
*/
|
|
5814
|
-
constructor(e =
|
|
5851
|
+
constructor(e = Ka) {
|
|
5815
5852
|
this.httpClient = new le(e);
|
|
5816
5853
|
this.config = new Ie(e, this.httpClient);
|
|
5817
5854
|
this.fiatRampService = new Be(this.config);
|
|
5818
5855
|
this.readOnlyProviders = /* @__PURE__ */ new Map();
|
|
5819
|
-
this.availability =
|
|
5856
|
+
this.availability = Pe(
|
|
5820
5857
|
this.config.isDevelopment,
|
|
5821
5858
|
this.config.isProduction
|
|
5822
5859
|
);
|
|
5823
5860
|
this.passport = e.passport;
|
|
5824
|
-
|
|
5861
|
+
F.getInstance().initialise();
|
|
5825
5862
|
}
|
|
5826
5863
|
/**
|
|
5827
5864
|
* Loads the widgets bundle and initiates the widgets factory.
|
|
@@ -5867,7 +5904,7 @@ var Ot = class {
|
|
|
5867
5904
|
* @returns {readonly EIP6963ProviderDetail[]} A readonly array of injected providers and their metadata.
|
|
5868
5905
|
*/
|
|
5869
5906
|
getInjectedProviders() {
|
|
5870
|
-
return
|
|
5907
|
+
return F.getInstance().getProviders();
|
|
5871
5908
|
}
|
|
5872
5909
|
/**
|
|
5873
5910
|
* Finds an injected provider by its RDNS.
|
|
@@ -5875,7 +5912,7 @@ var Ot = class {
|
|
|
5875
5912
|
* @returns {EIP6963ProviderDetail | undefined} - The found provider and metadata or undefined.
|
|
5876
5913
|
*/
|
|
5877
5914
|
findInjectedProvider(e) {
|
|
5878
|
-
return
|
|
5915
|
+
return F.getInstance().findProvider(e);
|
|
5879
5916
|
}
|
|
5880
5917
|
/**
|
|
5881
5918
|
* Subscribes to changes in the injected providers.
|
|
@@ -5883,14 +5920,14 @@ var Ot = class {
|
|
|
5883
5920
|
* @returns {() => void} - A function to unsubscribe the listener.
|
|
5884
5921
|
*/
|
|
5885
5922
|
onInjectedProvidersChange(e) {
|
|
5886
|
-
return
|
|
5923
|
+
return F.getInstance().subscribe(e);
|
|
5887
5924
|
}
|
|
5888
5925
|
/**
|
|
5889
5926
|
* Clears all registered injected providers and their subscriptions.
|
|
5890
5927
|
* @returns {void} This method doesn't return a value
|
|
5891
5928
|
*/
|
|
5892
5929
|
clearInjectedProviders() {
|
|
5893
|
-
return
|
|
5930
|
+
return F.getInstance().clear();
|
|
5894
5931
|
}
|
|
5895
5932
|
/**
|
|
5896
5933
|
* Checks if a wallet is connected to the specified provider.
|
|
@@ -6074,7 +6111,7 @@ var Ot = class {
|
|
|
6074
6111
|
allowMistmatchedChainId: true
|
|
6075
6112
|
}
|
|
6076
6113
|
);
|
|
6077
|
-
return await
|
|
6114
|
+
return await W(t, e.transaction);
|
|
6078
6115
|
}
|
|
6079
6116
|
/**
|
|
6080
6117
|
* Wraps a WrappedBrowserProvider call to validate the provider and handle errors.
|
|
@@ -6354,7 +6391,7 @@ var Xe = class {
|
|
|
6354
6391
|
}
|
|
6355
6392
|
};
|
|
6356
6393
|
export {
|
|
6357
|
-
|
|
6394
|
+
En as AddTokensEventType,
|
|
6358
6395
|
Xe as BlockExplorerService,
|
|
6359
6396
|
dn as BridgeEventType,
|
|
6360
6397
|
Q as ChainId,
|
|
@@ -6369,15 +6406,15 @@ export {
|
|
|
6369
6406
|
fn as CommerceFailureEventType,
|
|
6370
6407
|
An as CommerceFlowType,
|
|
6371
6408
|
mn as CommerceSuccessEventType,
|
|
6372
|
-
|
|
6409
|
+
gn as CommerceUserActionEventType,
|
|
6373
6410
|
nn as ConnectEventType,
|
|
6374
6411
|
In as ConnectTargetLayer,
|
|
6375
6412
|
qt as ExchangeType,
|
|
6376
6413
|
ve as FeeType,
|
|
6377
6414
|
Re as FundingStepType,
|
|
6378
6415
|
at as GasEstimateType,
|
|
6379
|
-
|
|
6380
|
-
|
|
6416
|
+
Ee as GasTokenType,
|
|
6417
|
+
L as IMMUTABLE_API_BASE_URL,
|
|
6381
6418
|
tn as IMTBLWidgetEvents,
|
|
6382
6419
|
B as ItemType,
|
|
6383
6420
|
ue as NetworkFilterTypes,
|
|
@@ -6391,7 +6428,7 @@ export {
|
|
|
6391
6428
|
hn as SwapDirection,
|
|
6392
6429
|
an as SwapEventType,
|
|
6393
6430
|
ne as TokenFilterTypes,
|
|
6394
|
-
|
|
6431
|
+
ge as TransactionOrGasType,
|
|
6395
6432
|
Cn as TransferEventType,
|
|
6396
6433
|
on as WalletEventType,
|
|
6397
6434
|
Wt as WalletFilterTypes,
|
|
@@ -6401,12 +6438,15 @@ export {
|
|
|
6401
6438
|
Tn as WidgetType,
|
|
6402
6439
|
b as WrappedBrowserProvider,
|
|
6403
6440
|
Nt as fetchRiskAssessment,
|
|
6404
|
-
|
|
6441
|
+
ja as fetchRiskAssessmentV2,
|
|
6442
|
+
Et as getGasPriceInWei,
|
|
6405
6443
|
mo as getMetaMaskProviderDetail,
|
|
6406
6444
|
uo as getPassportProviderDetail,
|
|
6407
6445
|
Ce as getUnderlyingChainId,
|
|
6408
6446
|
_t as isAddressSanctioned,
|
|
6447
|
+
Va as isSingleAddressSanctioned,
|
|
6409
6448
|
be as metaMaskProviderInfo,
|
|
6410
6449
|
Le as passportProviderInfo,
|
|
6450
|
+
Ha as resultHasSanctionedWallets,
|
|
6411
6451
|
M as validateProvider
|
|
6412
6452
|
};
|