@imtbl/checkout-sdk 2.4.10-alpha.4 → 2.4.11-alpha.0
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 +85 -83
- package/dist/node/index.cjs +167 -165
- package/dist/node/index.js +171 -169
- package/dist/types/widgets/definitions/events/commerce.d.ts +15 -4
- package/package.json +9 -9
package/dist/browser/index.js
CHANGED
|
@@ -113,28 +113,30 @@ var go = /* @__PURE__ */ ((s) => {
|
|
|
113
113
|
s["USER_ACTION"] = "USER_ACTION";
|
|
114
114
|
return s;
|
|
115
115
|
})(go || {});
|
|
116
|
-
var fo = /* @__PURE__ */ ((
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
var fo = /* @__PURE__ */ ((u) => {
|
|
117
|
+
u["SWAP_SUCCESS"] = "SWAP_SUCCESS";
|
|
118
|
+
u["ONRAMP_SUCCESS"] = "ONRAMP_SUCCESS";
|
|
119
|
+
u["CONNECT_SUCCESS"] = "CONNECT_SUCCESS";
|
|
120
|
+
u["SALE_SUCCESS"] = "SALE_SUCCESS";
|
|
121
|
+
u["SALE_TRANSACTION_SUCCESS"] = "SALE_TRANSACTION_SUCCESS";
|
|
122
|
+
u["BRIDGE_SUCCESS"] = "BRIDGE_SUCCESS";
|
|
123
|
+
u["BRIDGE_CLAIM_WITHDRAWAL_SUCCESS"] = "BRIDGE_CLAIM_WITHDRAWAL_SUCCESS";
|
|
124
|
+
u["ADD_TOKENS_SUCCESS"] = "ADD_TOKENS_SUCCESS";
|
|
125
|
+
u["ADD_TOKENS_CONNECT_SUCCESS"] = "ADD_TOKENS_CONNECT_SUCCESS";
|
|
126
|
+
u["TRANSFER_SUCCESS"] = "TRANSFER_SUCCESS";
|
|
127
|
+
return u;
|
|
127
128
|
})(fo || {});
|
|
128
|
-
var Eo = /* @__PURE__ */ ((
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
var Eo = /* @__PURE__ */ ((p) => {
|
|
130
|
+
p["BRIDGE_FAILED"] = "BRIDGE_FAILED";
|
|
131
|
+
p["BRIDGE_CLAIM_WITHDRAWAL_FAILED"] = "BRIDGE_CLAIM_WITHDRAWAL_FAILED";
|
|
132
|
+
p["SWAP_FAILED"] = "SWAP_FAILED";
|
|
133
|
+
p["SWAP_REJECTED"] = "SWAP_REJECTED";
|
|
134
|
+
p["CONNECT_FAILED"] = "CONNECT_FAILED";
|
|
135
|
+
p["SALE_FAILED"] = "SALE_FAILED";
|
|
136
|
+
p["ONRAMP_FAILED"] = "ONRAMP_FAILED";
|
|
137
|
+
p["ADD_TOKENS_FAILED"] = "ADD_TOKENS_FAILED";
|
|
138
|
+
p["TRANSFER_FAILED"] = "TRANSFER_FAILED";
|
|
139
|
+
return p;
|
|
138
140
|
})(Eo || {});
|
|
139
141
|
var Ro = /* @__PURE__ */ ((o) => {
|
|
140
142
|
o["PAYMENT_METHOD_SELECTED"] = "PAYMENT_METHOD_SELECTED";
|
|
@@ -299,7 +301,7 @@ var ue = class {
|
|
|
299
301
|
|
|
300
302
|
// src/availability/availability.ts
|
|
301
303
|
import { Environment as Ut } from "@imtbl/config";
|
|
302
|
-
import
|
|
304
|
+
import xo from "axios";
|
|
303
305
|
|
|
304
306
|
// src/errors/checkoutError.ts
|
|
305
307
|
var S = /* @__PURE__ */ ((A) => {
|
|
@@ -409,18 +411,18 @@ var we = /* @__PURE__ */ ((a) => {
|
|
|
409
411
|
var J = "development";
|
|
410
412
|
var j = 18;
|
|
411
413
|
var Mt = 6;
|
|
412
|
-
var
|
|
414
|
+
var O = "native";
|
|
413
415
|
var ke = {
|
|
414
416
|
name: "IMX",
|
|
415
417
|
symbol: "IMX",
|
|
416
418
|
decimals: j,
|
|
417
|
-
address:
|
|
419
|
+
address: O
|
|
418
420
|
};
|
|
419
421
|
var No = {
|
|
420
422
|
name: "tIMX",
|
|
421
423
|
symbol: "tIMX",
|
|
422
424
|
decimals: j,
|
|
423
|
-
address:
|
|
425
|
+
address: O
|
|
424
426
|
};
|
|
425
427
|
var q = {
|
|
426
428
|
[J]: "https://api.dev.immutable.com",
|
|
@@ -801,7 +803,7 @@ var it = {
|
|
|
801
803
|
};
|
|
802
804
|
|
|
803
805
|
// src/env/env.ts
|
|
804
|
-
var _o = "2.4.
|
|
806
|
+
var _o = "2.4.11-alpha.0";
|
|
805
807
|
var me = () => _o;
|
|
806
808
|
|
|
807
809
|
// src/availability/availability.ts
|
|
@@ -814,7 +816,7 @@ var Ne = (r, e) => {
|
|
|
814
816
|
const o = async () => {
|
|
815
817
|
let n;
|
|
816
818
|
try {
|
|
817
|
-
n = await
|
|
819
|
+
n = await xo.post(`${t()}/v1/availability/checkout/swap`);
|
|
818
820
|
} catch (a) {
|
|
819
821
|
n = a.response;
|
|
820
822
|
if (n.status === 403) return false;
|
|
@@ -865,7 +867,7 @@ var Gt = /* @__PURE__ */ ((e) => {
|
|
|
865
867
|
|
|
866
868
|
// src/types/provider.ts
|
|
867
869
|
import {
|
|
868
|
-
BrowserProvider as
|
|
870
|
+
BrowserProvider as Oo
|
|
869
871
|
} from "ethers";
|
|
870
872
|
var fe = /* @__PURE__ */ ((o) => {
|
|
871
873
|
o["PASSPORT"] = "passport";
|
|
@@ -883,7 +885,7 @@ var jt = {
|
|
|
883
885
|
allowMistmatchedChainId: false,
|
|
884
886
|
allowUnsupportedProvider: false
|
|
885
887
|
};
|
|
886
|
-
var D = class extends
|
|
888
|
+
var D = class extends Oo {
|
|
887
889
|
ethereumProvider;
|
|
888
890
|
// eslint-disable-next-line max-len
|
|
889
891
|
constructor(e, t, o) {
|
|
@@ -1116,7 +1118,7 @@ import { Contract as jo } from "ethers";
|
|
|
1116
1118
|
import { Environment as ie } from "@imtbl/config";
|
|
1117
1119
|
|
|
1118
1120
|
// src/config/remoteConfigFetcher.ts
|
|
1119
|
-
var
|
|
1121
|
+
var xe = class {
|
|
1120
1122
|
httpClient;
|
|
1121
1123
|
endpoint;
|
|
1122
1124
|
configCache;
|
|
@@ -1169,7 +1171,7 @@ var Oe = class {
|
|
|
1169
1171
|
|
|
1170
1172
|
// src/config/tokensFetcher.ts
|
|
1171
1173
|
var Lo = "0x0000000000000000000000000000000000000eee";
|
|
1172
|
-
var
|
|
1174
|
+
var Oe = class {
|
|
1173
1175
|
httpClient;
|
|
1174
1176
|
remoteConfig;
|
|
1175
1177
|
baseUrl;
|
|
@@ -1358,10 +1360,10 @@ var ye = class {
|
|
|
1358
1360
|
this.publishableKey = e.publishableKey ?? "<no-publishable-key>";
|
|
1359
1361
|
this.networkMap = e.overrides?.networkMap ?? Do(this.isProduction, this.isDevelopment);
|
|
1360
1362
|
const o = e.overrides?.remoteConfigEndpoint ?? Uo(this.isProduction, this.isDevelopment);
|
|
1361
|
-
this.remote = new
|
|
1363
|
+
this.remote = new xe(t, {
|
|
1362
1364
|
remoteConfigEndpoint: o
|
|
1363
1365
|
});
|
|
1364
|
-
this.tokens = new
|
|
1366
|
+
this.tokens = new Oe(t, this.remote, {
|
|
1365
1367
|
baseUrl: e.overrides?.baseUrl ?? Wo(this.isProduction, this.isDevelopment),
|
|
1366
1368
|
chainSlug: e.overrides?.chainSlug ?? Fo(this.isProduction, this.isDevelopment)
|
|
1367
1369
|
});
|
|
@@ -1430,7 +1432,7 @@ var z = async (r, {
|
|
|
1430
1432
|
tokens: n.filter((p) => !o.map((u) => u.address).includes(p.address || ""))
|
|
1431
1433
|
};
|
|
1432
1434
|
};
|
|
1433
|
-
var B = (r) => !r || h(r,
|
|
1435
|
+
var B = (r) => !r || h(r, O);
|
|
1434
1436
|
async function Be(r, e) {
|
|
1435
1437
|
return await L(
|
|
1436
1438
|
async () => {
|
|
@@ -1646,7 +1648,7 @@ var Qo = async (r, e, t, o) => {
|
|
|
1646
1648
|
const n = o !== void 0;
|
|
1647
1649
|
const a = Object.assign(
|
|
1648
1650
|
{},
|
|
1649
|
-
...(o ?? []).map((f) => ({ [f.address?.toLowerCase() ||
|
|
1651
|
+
...(o ?? []).map((f) => ({ [f.address?.toLowerCase() || O]: f }))
|
|
1650
1652
|
);
|
|
1651
1653
|
let i = mt.get(t);
|
|
1652
1654
|
if (!i) {
|
|
@@ -1680,7 +1682,7 @@ var Qo = async (r, e, t, o) => {
|
|
|
1680
1682
|
const u = async (f) => {
|
|
1681
1683
|
try {
|
|
1682
1684
|
const R = await f.getNativeTokenByWalletAddress({ walletAddress: e });
|
|
1683
|
-
R.token.address ||=
|
|
1685
|
+
R.token.address ||= O;
|
|
1684
1686
|
s.push(R);
|
|
1685
1687
|
} catch (R) {
|
|
1686
1688
|
if (R?.code !== ut.NotFound) {
|
|
@@ -1719,7 +1721,7 @@ var Qo = async (r, e, t, o) => {
|
|
|
1719
1721
|
var Zo = async (r, e, t, o) => {
|
|
1720
1722
|
const n = [];
|
|
1721
1723
|
o.forEach((i) => {
|
|
1722
|
-
if (!i.address || h(i.address,
|
|
1724
|
+
if (!i.address || h(i.address, O)) {
|
|
1723
1725
|
n.push(
|
|
1724
1726
|
ft(r, e, t)
|
|
1725
1727
|
);
|
|
@@ -1733,8 +1735,8 @@ var Zo = async (r, e, t, o) => {
|
|
|
1733
1735
|
return a.reduce((i, s) => {
|
|
1734
1736
|
if (s.status !== "fulfilled" || s.value.balance === 0n) return i;
|
|
1735
1737
|
const { value: c } = s;
|
|
1736
|
-
if (!c.token.address || h(c.token.address,
|
|
1737
|
-
c.token.address =
|
|
1738
|
+
if (!c.token.address || h(c.token.address, O)) {
|
|
1739
|
+
c.token.address = O;
|
|
1738
1740
|
}
|
|
1739
1741
|
i.balances.push(c);
|
|
1740
1742
|
return i;
|
|
@@ -1945,7 +1947,7 @@ async function or(r, e, t, o) {
|
|
|
1945
1947
|
gasMultiplier: "auto",
|
|
1946
1948
|
sourceChainId: e.toString(),
|
|
1947
1949
|
destinationChainId: t.toString(),
|
|
1948
|
-
token:
|
|
1950
|
+
token: O.toUpperCase(),
|
|
1949
1951
|
amount: BigInt(0)
|
|
1950
1952
|
});
|
|
1951
1953
|
}
|
|
@@ -2755,11 +2757,11 @@ var gr = async (r, e, t) => {
|
|
|
2755
2757
|
continue;
|
|
2756
2758
|
}
|
|
2757
2759
|
const v = `${E}-${T}`;
|
|
2758
|
-
const
|
|
2760
|
+
const x = mr(T, E);
|
|
2759
2761
|
a.set(v, C);
|
|
2760
2762
|
i.set(
|
|
2761
2763
|
v,
|
|
2762
|
-
vn(r, E,
|
|
2764
|
+
vn(r, E, x)
|
|
2763
2765
|
);
|
|
2764
2766
|
}
|
|
2765
2767
|
const u = await Promise.all(i.values());
|
|
@@ -2832,7 +2834,7 @@ var _n = async (r, e, t, o) => {
|
|
|
2832
2834
|
);
|
|
2833
2835
|
}
|
|
2834
2836
|
};
|
|
2835
|
-
var
|
|
2837
|
+
var xn = async (r, e, t, o) => {
|
|
2836
2838
|
try {
|
|
2837
2839
|
const n = new fr(
|
|
2838
2840
|
t,
|
|
@@ -2873,7 +2875,7 @@ var Er = async (r, e, t) => {
|
|
|
2873
2875
|
itemRequirement: a
|
|
2874
2876
|
};
|
|
2875
2877
|
}
|
|
2876
|
-
const s = await
|
|
2878
|
+
const s = await xn(
|
|
2877
2879
|
r,
|
|
2878
2880
|
e,
|
|
2879
2881
|
a.contractAddress,
|
|
@@ -2897,7 +2899,7 @@ var Er = async (r, e, t) => {
|
|
|
2897
2899
|
import { Contract as Ln, formatUnits as Dn } from "ethers";
|
|
2898
2900
|
|
|
2899
2901
|
// src/smartCheckout/aggregators/balanceAggregator.ts
|
|
2900
|
-
var
|
|
2902
|
+
var On = (r) => {
|
|
2901
2903
|
const e = /* @__PURE__ */ new Map();
|
|
2902
2904
|
const t = [];
|
|
2903
2905
|
r.forEach((o) => {
|
|
@@ -2952,7 +2954,7 @@ var Mn = (r) => {
|
|
|
2952
2954
|
});
|
|
2953
2955
|
return t.concat(Array.from(e.values()));
|
|
2954
2956
|
};
|
|
2955
|
-
var Rr = (r) => Mn(Bn(
|
|
2957
|
+
var Rr = (r) => Mn(Bn(On(r)));
|
|
2956
2958
|
|
|
2957
2959
|
// src/smartCheckout/balanceCheck/balanceRequirement.ts
|
|
2958
2960
|
import { Contract as bn, formatUnits as Ue } from "ethers";
|
|
@@ -2964,7 +2966,7 @@ var Cr = (r) => r.map((e) => {
|
|
|
2964
2966
|
};
|
|
2965
2967
|
case "NATIVE":
|
|
2966
2968
|
return {
|
|
2967
|
-
address:
|
|
2969
|
+
address: O
|
|
2968
2970
|
};
|
|
2969
2971
|
case "ERC721":
|
|
2970
2972
|
default:
|
|
@@ -3027,7 +3029,7 @@ var hr = async (r, e, t) => {
|
|
|
3027
3029
|
const o = {};
|
|
3028
3030
|
for (const n of r) {
|
|
3029
3031
|
if (n.type === "NATIVE") {
|
|
3030
|
-
o[
|
|
3032
|
+
o[O] = ke;
|
|
3031
3033
|
continue;
|
|
3032
3034
|
}
|
|
3033
3035
|
const a = Ir(n, e);
|
|
@@ -3148,7 +3150,7 @@ var Wn = async (r, e, t, o, n = false) => {
|
|
|
3148
3150
|
);
|
|
3149
3151
|
const { balances: i } = await V(r, e, t, w(r), n);
|
|
3150
3152
|
return i.filter(
|
|
3151
|
-
(s) => a.get((s.token.address ||
|
|
3153
|
+
(s) => a.get((s.token.address || O).toLocaleLowerCase())
|
|
3152
3154
|
);
|
|
3153
3155
|
} catch (a) {
|
|
3154
3156
|
throw new m(
|
|
@@ -3233,12 +3235,12 @@ var Ar = async (r, e, t, o, n = false) => {
|
|
|
3233
3235
|
if (i.length > 0) {
|
|
3234
3236
|
const f = p.shift() ?? [];
|
|
3235
3237
|
const R = new Map(f.map((E) => {
|
|
3236
|
-
const T = E.type === "NATIVE" ?
|
|
3238
|
+
const T = E.type === "NATIVE" ? O : E.token.address?.toLowerCase();
|
|
3237
3239
|
return [T, E];
|
|
3238
3240
|
}));
|
|
3239
3241
|
const C = await hr(i, f, e);
|
|
3240
3242
|
i.forEach((E) => {
|
|
3241
|
-
const T = (E.tokenAddress ??
|
|
3243
|
+
const T = (E.tokenAddress ?? O).toLowerCase();
|
|
3242
3244
|
const y = C[T];
|
|
3243
3245
|
const I = R.get(T);
|
|
3244
3246
|
const P = yr(E, [...R.values()], y);
|
|
@@ -3771,7 +3773,7 @@ var Qn = async (r, e, t) => {
|
|
|
3771
3773
|
}
|
|
3772
3774
|
return [];
|
|
3773
3775
|
};
|
|
3774
|
-
var
|
|
3776
|
+
var xr = async (r, e, t) => {
|
|
3775
3777
|
const o = {};
|
|
3776
3778
|
o.swap = await Qn(r, e, t);
|
|
3777
3779
|
o.bridge = await Pt(r, e, t);
|
|
@@ -3786,7 +3788,7 @@ import { formatUnits as oa } from "ethers";
|
|
|
3786
3788
|
import { formatUnits as Ke } from "ethers";
|
|
3787
3789
|
|
|
3788
3790
|
// src/smartCheckout/routing/bridge/getEthBalance.ts
|
|
3789
|
-
var
|
|
3791
|
+
var Or = (r) => {
|
|
3790
3792
|
for (const e of r.balances) {
|
|
3791
3793
|
if (B(e.token.address)) {
|
|
3792
3794
|
return e.balance;
|
|
@@ -3844,7 +3846,7 @@ var Ve = async (r, e) => {
|
|
|
3844
3846
|
if (B(e)) {
|
|
3845
3847
|
return {
|
|
3846
3848
|
l1address: await Jn(_(r), r),
|
|
3847
|
-
l2address:
|
|
3849
|
+
l2address: O
|
|
3848
3850
|
};
|
|
3849
3851
|
}
|
|
3850
3852
|
const t = Yn(w(r));
|
|
@@ -3869,7 +3871,7 @@ var Ve = async (r, e) => {
|
|
|
3869
3871
|
|
|
3870
3872
|
// src/smartCheckout/routing/bridge/bridgeRoute.ts
|
|
3871
3873
|
var $n = (r, e) => {
|
|
3872
|
-
const t =
|
|
3874
|
+
const t = Or(r);
|
|
3873
3875
|
return t >= e;
|
|
3874
3876
|
};
|
|
3875
3877
|
var Mr = (r, e, t, o, n) => {
|
|
@@ -3969,16 +3971,16 @@ var He = async (r, e, t, o, n) => {
|
|
|
3969
3971
|
} = R;
|
|
3970
3972
|
if (!$n(c, I)) return void 0;
|
|
3971
3973
|
if (B(f)) {
|
|
3972
|
-
const v = c.balances.find((
|
|
3974
|
+
const v = c.balances.find((x) => B(x.token.address));
|
|
3973
3975
|
if (v && v.balance >= o.amount + I) {
|
|
3974
|
-
const
|
|
3976
|
+
const x = Mr(
|
|
3975
3977
|
C,
|
|
3976
3978
|
T,
|
|
3977
3979
|
y,
|
|
3978
3980
|
E,
|
|
3979
3981
|
s
|
|
3980
3982
|
);
|
|
3981
|
-
return br(a, v, o, "NATIVE",
|
|
3983
|
+
return br(a, v, o, "NATIVE", x);
|
|
3982
3984
|
}
|
|
3983
3985
|
return void 0;
|
|
3984
3986
|
}
|
|
@@ -4293,11 +4295,11 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4293
4295
|
}
|
|
4294
4296
|
const P = await Promise.all(T.values());
|
|
4295
4297
|
const v = Array.from(T.keys());
|
|
4296
|
-
const
|
|
4298
|
+
const x = [];
|
|
4297
4299
|
P.forEach((G, rt) => {
|
|
4298
4300
|
const K = v[rt];
|
|
4299
4301
|
if (G === void 0) return;
|
|
4300
|
-
|
|
4302
|
+
x.push(K);
|
|
4301
4303
|
const N = y.get(K);
|
|
4302
4304
|
if (!N) return;
|
|
4303
4305
|
I.push({
|
|
@@ -4306,7 +4308,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4306
4308
|
l2address: N.l2address
|
|
4307
4309
|
});
|
|
4308
4310
|
});
|
|
4309
|
-
if (
|
|
4311
|
+
if (x.length === 0) return [];
|
|
4310
4312
|
if (I.length === 0) return [];
|
|
4311
4313
|
const Q = ia(
|
|
4312
4314
|
r,
|
|
@@ -4321,7 +4323,7 @@ var Ur = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4321
4323
|
n,
|
|
4322
4324
|
o,
|
|
4323
4325
|
Q,
|
|
4324
|
-
|
|
4326
|
+
x,
|
|
4325
4327
|
c
|
|
4326
4328
|
);
|
|
4327
4329
|
if (!pe) return [];
|
|
@@ -4513,7 +4515,7 @@ var qr = async (r, e, t, o, n) => {
|
|
|
4513
4515
|
const s = await k(
|
|
4514
4516
|
r,
|
|
4515
4517
|
"Time to get routing allowlist",
|
|
4516
|
-
|
|
4518
|
+
xr(r, i, o)
|
|
4517
4519
|
);
|
|
4518
4520
|
const c = la(t);
|
|
4519
4521
|
const p = [];
|
|
@@ -5161,7 +5163,7 @@ var Zr = async (r, e, t, o = {
|
|
|
5161
5163
|
);
|
|
5162
5164
|
} catch {
|
|
5163
5165
|
}
|
|
5164
|
-
let
|
|
5166
|
+
let x = BigInt("0");
|
|
5165
5167
|
let Q = "NATIVE";
|
|
5166
5168
|
let pe = "";
|
|
5167
5169
|
const ee = n.result.buy;
|
|
@@ -5186,18 +5188,18 @@ var Zr = async (r, e, t, o = {
|
|
|
5186
5188
|
}
|
|
5187
5189
|
ee.forEach((N) => {
|
|
5188
5190
|
if (N.type !== "ERC721") {
|
|
5189
|
-
|
|
5191
|
+
x += BigInt(N.amount);
|
|
5190
5192
|
}
|
|
5191
5193
|
});
|
|
5192
5194
|
const G = n.result.fees;
|
|
5193
5195
|
G.forEach((N) => {
|
|
5194
|
-
|
|
5196
|
+
x += BigInt(N.amount);
|
|
5195
5197
|
});
|
|
5196
5198
|
if (n.result.sell[0].type === "ERC1155" && R) {
|
|
5197
|
-
|
|
5199
|
+
x = x * BigInt(R) / BigInt(n.result.sell[0].amount);
|
|
5198
5200
|
}
|
|
5199
5201
|
const rt = [
|
|
5200
|
-
ka(Q, pe,
|
|
5202
|
+
ka(Q, pe, x, a)
|
|
5201
5203
|
];
|
|
5202
5204
|
const K = await k(
|
|
5203
5205
|
r,
|
|
@@ -5343,7 +5345,7 @@ var _a = async (r, e, t, o, n) => {
|
|
|
5343
5345
|
transactions: s
|
|
5344
5346
|
};
|
|
5345
5347
|
};
|
|
5346
|
-
var
|
|
5348
|
+
var xa = async (r, e, t) => {
|
|
5347
5349
|
try {
|
|
5348
5350
|
const o = await e.getSigner();
|
|
5349
5351
|
const n = await o.getAddress();
|
|
@@ -5395,7 +5397,7 @@ var Yr = async (r, e, t, o = {
|
|
|
5395
5397
|
}) => {
|
|
5396
5398
|
const n = ce(r);
|
|
5397
5399
|
if (o.useGaslessCancel) {
|
|
5398
|
-
return await
|
|
5400
|
+
return await xa(n, e, t);
|
|
5399
5401
|
}
|
|
5400
5402
|
return await _a(
|
|
5401
5403
|
r,
|
|
@@ -5612,9 +5614,9 @@ var Xr = async (r, e, t) => {
|
|
|
5612
5614
|
makerFees: []
|
|
5613
5615
|
};
|
|
5614
5616
|
if (c !== void 0) {
|
|
5615
|
-
let
|
|
5616
|
-
if (f && s.type === "ERC1155")
|
|
5617
|
-
const Q = et(c, g.amount, u,
|
|
5617
|
+
let x = BigInt(1);
|
|
5618
|
+
if (f && s.type === "ERC1155") x = BigInt(s.amount);
|
|
5619
|
+
const Q = et(c, g.amount, u, x);
|
|
5618
5620
|
if (Q.length !== c.length) {
|
|
5619
5621
|
throw new m(
|
|
5620
5622
|
"One of the fees is too small, must be greater than 0.000001",
|
|
@@ -5624,14 +5626,14 @@ var Xr = async (r, e, t) => {
|
|
|
5624
5626
|
v.makerFees = Q;
|
|
5625
5627
|
}
|
|
5626
5628
|
try {
|
|
5627
|
-
const
|
|
5628
|
-
P =
|
|
5629
|
-
} catch (
|
|
5629
|
+
const x = await o.createListing(v);
|
|
5630
|
+
P = x.result.id;
|
|
5631
|
+
} catch (x) {
|
|
5630
5632
|
throw new m(
|
|
5631
5633
|
"An error occurred while creating the listing",
|
|
5632
5634
|
"CREATE_ORDER_LISTING_ERROR",
|
|
5633
5635
|
{
|
|
5634
|
-
error:
|
|
5636
|
+
error: x,
|
|
5635
5637
|
collectionId: s.id,
|
|
5636
5638
|
collectionAddress: s.collectionAddress
|
|
5637
5639
|
}
|
|
@@ -5757,7 +5759,7 @@ async function ro(r) {
|
|
|
5757
5759
|
|
|
5758
5760
|
// src/riskAssessment/riskAssessment.ts
|
|
5759
5761
|
import ja from "axios";
|
|
5760
|
-
var
|
|
5762
|
+
var xt = async (r, e) => {
|
|
5761
5763
|
const t = Object.fromEntries(
|
|
5762
5764
|
r.map((n) => [n.toLowerCase(), { sanctioned: false }])
|
|
5763
5765
|
);
|
|
@@ -5784,7 +5786,7 @@ var Ot = async (r, e) => {
|
|
|
5784
5786
|
return t;
|
|
5785
5787
|
}
|
|
5786
5788
|
};
|
|
5787
|
-
var
|
|
5789
|
+
var Ot = (r, e) => {
|
|
5788
5790
|
if (e) {
|
|
5789
5791
|
return r[e.toLowerCase()].sanctioned;
|
|
5790
5792
|
}
|
|
@@ -5912,7 +5914,7 @@ var Bt = class {
|
|
|
5912
5914
|
* @returns {Promise<AssessmentResult>} - A promise that resolves to the risk assessment result.
|
|
5913
5915
|
*/
|
|
5914
5916
|
async getRiskAssessment(e) {
|
|
5915
|
-
return await
|
|
5917
|
+
return await xt(e, this.config);
|
|
5916
5918
|
}
|
|
5917
5919
|
/**
|
|
5918
5920
|
* Helper method that checks if given risk assessment results contain sanctioned addresses.
|
|
@@ -5921,7 +5923,7 @@ var Bt = class {
|
|
|
5921
5923
|
* @returns {boolean} - Result of the check.
|
|
5922
5924
|
*/
|
|
5923
5925
|
checkIsAddressSanctioned(e, t) {
|
|
5924
|
-
return
|
|
5926
|
+
return Ot(e, t);
|
|
5925
5927
|
}
|
|
5926
5928
|
/**
|
|
5927
5929
|
* Connects to a blockchain network using the specified provider.
|
|
@@ -6398,12 +6400,12 @@ export {
|
|
|
6398
6400
|
Po as WidgetTheme,
|
|
6399
6401
|
ho as WidgetType,
|
|
6400
6402
|
D as WrappedBrowserProvider,
|
|
6401
|
-
|
|
6403
|
+
xt as fetchRiskAssessment,
|
|
6402
6404
|
Ct as getGasPriceInWei,
|
|
6403
6405
|
fn as getMetaMaskProviderDetail,
|
|
6404
6406
|
gn as getPassportProviderDetail,
|
|
6405
6407
|
Ie as getUnderlyingChainId,
|
|
6406
|
-
|
|
6408
|
+
Ot as isAddressSanctioned,
|
|
6407
6409
|
De as metaMaskProviderInfo,
|
|
6408
6410
|
We as passportProviderInfo,
|
|
6409
6411
|
b as validateProvider
|