@imtbl/checkout-sdk 2.13.1-alpha.0 → 2.13.1-alpha.2
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
CHANGED
|
@@ -411,18 +411,18 @@ var we = /* @__PURE__ */ ((a) => {
|
|
|
411
411
|
var $ = "development";
|
|
412
412
|
var j = 18;
|
|
413
413
|
var Mt = 6;
|
|
414
|
-
var
|
|
414
|
+
var O = "native";
|
|
415
415
|
var ke = {
|
|
416
416
|
name: "IMX",
|
|
417
417
|
symbol: "IMX",
|
|
418
418
|
decimals: j,
|
|
419
|
-
address:
|
|
419
|
+
address: O
|
|
420
420
|
};
|
|
421
421
|
var vo = {
|
|
422
422
|
name: "tIMX",
|
|
423
423
|
symbol: "tIMX",
|
|
424
424
|
decimals: j,
|
|
425
|
-
address:
|
|
425
|
+
address: O
|
|
426
426
|
};
|
|
427
427
|
var q = {
|
|
428
428
|
[$]: "https://api.dev.immutable.com",
|
|
@@ -437,7 +437,7 @@ var ve = {
|
|
|
437
437
|
var bt = true;
|
|
438
438
|
var Lt = true;
|
|
439
439
|
var Dt = true;
|
|
440
|
-
var
|
|
440
|
+
var Oc = {
|
|
441
441
|
[oe.SANDBOX]: "https://global-stg.transak.com",
|
|
442
442
|
[oe.PRODUCTION]: "https://global.transak.com/"
|
|
443
443
|
};
|
|
@@ -803,7 +803,7 @@ var it = {
|
|
|
803
803
|
};
|
|
804
804
|
|
|
805
805
|
// src/env/env.ts
|
|
806
|
-
var No = "2.13.1-alpha.
|
|
806
|
+
var No = "2.13.1-alpha.2";
|
|
807
807
|
var me = () => No;
|
|
808
808
|
|
|
809
809
|
// src/availability/availability.ts
|
|
@@ -867,7 +867,7 @@ var Ut = /* @__PURE__ */ ((e) => {
|
|
|
867
867
|
|
|
868
868
|
// src/types/provider.ts
|
|
869
869
|
import {
|
|
870
|
-
BrowserProvider as
|
|
870
|
+
BrowserProvider as xo
|
|
871
871
|
} from "ethers";
|
|
872
872
|
var fe = /* @__PURE__ */ ((o) => {
|
|
873
873
|
o["PASSPORT"] = "passport";
|
|
@@ -885,7 +885,7 @@ var qt = {
|
|
|
885
885
|
allowMistmatchedChainId: false,
|
|
886
886
|
allowUnsupportedProvider: false
|
|
887
887
|
};
|
|
888
|
-
var D = class extends
|
|
888
|
+
var D = class extends xo {
|
|
889
889
|
ethereumProvider;
|
|
890
890
|
// eslint-disable-next-line max-len
|
|
891
891
|
constructor(e, t, o) {
|
|
@@ -952,7 +952,7 @@ var jt = /* @__PURE__ */ ((e) => {
|
|
|
952
952
|
})(jt || {});
|
|
953
953
|
|
|
954
954
|
// src/provider/getUnderlyingProvider.ts
|
|
955
|
-
async function
|
|
955
|
+
async function Oo(r) {
|
|
956
956
|
if (!r.send) {
|
|
957
957
|
throw new m(
|
|
958
958
|
"Parsed provider is not a valid WrappedBrowserProvider",
|
|
@@ -970,7 +970,7 @@ async function Ie(r) {
|
|
|
970
970
|
if (e.chainId && typeof e.chainId === "bigint") {
|
|
971
971
|
return e.chainId;
|
|
972
972
|
}
|
|
973
|
-
return
|
|
973
|
+
return Oo(r);
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
// src/network/network.ts
|
|
@@ -1118,7 +1118,7 @@ import { Contract as qo } from "ethers";
|
|
|
1118
1118
|
import { Environment as se } from "@imtbl/config";
|
|
1119
1119
|
|
|
1120
1120
|
// src/config/remoteConfigFetcher.ts
|
|
1121
|
-
var
|
|
1121
|
+
var xe = class {
|
|
1122
1122
|
httpClient;
|
|
1123
1123
|
endpoint;
|
|
1124
1124
|
configCache;
|
|
@@ -1171,7 +1171,7 @@ var Oe = class {
|
|
|
1171
1171
|
|
|
1172
1172
|
// src/config/tokensFetcher.ts
|
|
1173
1173
|
var bo = "0x0000000000000000000000000000000000000eee";
|
|
1174
|
-
var
|
|
1174
|
+
var Oe = class {
|
|
1175
1175
|
httpClient;
|
|
1176
1176
|
remoteConfig;
|
|
1177
1177
|
baseUrl;
|
|
@@ -1360,10 +1360,10 @@ var ye = class {
|
|
|
1360
1360
|
this.publishableKey = e.publishableKey ?? "<no-publishable-key>";
|
|
1361
1361
|
this.networkMap = e.overrides?.networkMap ?? Lo(this.isProduction, this.isDevelopment);
|
|
1362
1362
|
const o = e.overrides?.remoteConfigEndpoint ?? Fo(this.isProduction, this.isDevelopment);
|
|
1363
|
-
this.remote = new
|
|
1363
|
+
this.remote = new xe(t, {
|
|
1364
1364
|
remoteConfigEndpoint: o
|
|
1365
1365
|
});
|
|
1366
|
-
this.tokens = new
|
|
1366
|
+
this.tokens = new Oe(t, this.remote, {
|
|
1367
1367
|
baseUrl: e.overrides?.baseUrl ?? Do(this.isProduction, this.isDevelopment),
|
|
1368
1368
|
chainSlug: e.overrides?.chainSlug ?? Wo(this.isProduction, this.isDevelopment)
|
|
1369
1369
|
});
|
|
@@ -1432,7 +1432,7 @@ var z = async (r, {
|
|
|
1432
1432
|
tokens: n.filter((p) => !o.map((u) => u.address).includes(p.address || ""))
|
|
1433
1433
|
};
|
|
1434
1434
|
};
|
|
1435
|
-
var B = (r) => !r || h(r,
|
|
1435
|
+
var B = (r) => !r || h(r, O);
|
|
1436
1436
|
async function Be(r, e) {
|
|
1437
1437
|
return await L(
|
|
1438
1438
|
async () => {
|
|
@@ -1648,7 +1648,7 @@ var zo = async (r, e, t, o) => {
|
|
|
1648
1648
|
const n = o !== void 0;
|
|
1649
1649
|
const a = Object.assign(
|
|
1650
1650
|
{},
|
|
1651
|
-
...(o ?? []).map((f) => ({ [f.address?.toLowerCase() ||
|
|
1651
|
+
...(o ?? []).map((f) => ({ [f.address?.toLowerCase() || O]: f }))
|
|
1652
1652
|
);
|
|
1653
1653
|
let i = mt.get(t);
|
|
1654
1654
|
if (!i) {
|
|
@@ -1682,7 +1682,7 @@ var zo = async (r, e, t, o) => {
|
|
|
1682
1682
|
const u = async (f) => {
|
|
1683
1683
|
try {
|
|
1684
1684
|
const R = await f.getNativeTokenByWalletAddress({ walletAddress: e });
|
|
1685
|
-
R.token.address ||=
|
|
1685
|
+
R.token.address ||= O;
|
|
1686
1686
|
s.push(R);
|
|
1687
1687
|
} catch (R) {
|
|
1688
1688
|
if (R?.code !== ut.NotFound) {
|
|
@@ -1721,7 +1721,7 @@ var zo = async (r, e, t, o) => {
|
|
|
1721
1721
|
var Qo = async (r, e, t, o) => {
|
|
1722
1722
|
const n = [];
|
|
1723
1723
|
o.forEach((i) => {
|
|
1724
|
-
if (!i.address || h(i.address,
|
|
1724
|
+
if (!i.address || h(i.address, O)) {
|
|
1725
1725
|
n.push(
|
|
1726
1726
|
ft(r, e, t)
|
|
1727
1727
|
);
|
|
@@ -1735,8 +1735,8 @@ var Qo = async (r, e, t, o) => {
|
|
|
1735
1735
|
return a.reduce((i, s) => {
|
|
1736
1736
|
if (s.status !== "fulfilled" || s.value.balance === 0n) return i;
|
|
1737
1737
|
const { value: c } = s;
|
|
1738
|
-
if (!c.token.address || h(c.token.address,
|
|
1739
|
-
c.token.address =
|
|
1738
|
+
if (!c.token.address || h(c.token.address, O)) {
|
|
1739
|
+
c.token.address = O;
|
|
1740
1740
|
}
|
|
1741
1741
|
i.balances.push(c);
|
|
1742
1742
|
return i;
|
|
@@ -1951,7 +1951,7 @@ async function rr(r, e, t, o) {
|
|
|
1951
1951
|
gasMultiplier: "auto",
|
|
1952
1952
|
sourceChainId: e.toString(),
|
|
1953
1953
|
destinationChainId: t.toString(),
|
|
1954
|
-
token:
|
|
1954
|
+
token: O.toUpperCase(),
|
|
1955
1955
|
amount: BigInt(0)
|
|
1956
1956
|
});
|
|
1957
1957
|
}
|
|
@@ -2761,11 +2761,11 @@ var mr = async (r, e, t) => {
|
|
|
2761
2761
|
continue;
|
|
2762
2762
|
}
|
|
2763
2763
|
const v = `${E}-${T}`;
|
|
2764
|
-
const
|
|
2764
|
+
const x = ur(T, E);
|
|
2765
2765
|
a.set(v, C);
|
|
2766
2766
|
i.set(
|
|
2767
2767
|
v,
|
|
2768
|
-
kn(r, E,
|
|
2768
|
+
kn(r, E, x)
|
|
2769
2769
|
);
|
|
2770
2770
|
}
|
|
2771
2771
|
const u = await Promise.all(i.values());
|
|
@@ -2903,7 +2903,7 @@ var fr = async (r, e, t) => {
|
|
|
2903
2903
|
import { Contract as bn, formatUnits as Ln } from "ethers";
|
|
2904
2904
|
|
|
2905
2905
|
// src/smartCheckout/aggregators/balanceAggregator.ts
|
|
2906
|
-
var
|
|
2906
|
+
var xn = (r) => {
|
|
2907
2907
|
const e = /* @__PURE__ */ new Map();
|
|
2908
2908
|
const t = [];
|
|
2909
2909
|
r.forEach((o) => {
|
|
@@ -2922,7 +2922,7 @@ var On = (r) => {
|
|
|
2922
2922
|
});
|
|
2923
2923
|
return t.concat(Array.from(e.values()));
|
|
2924
2924
|
};
|
|
2925
|
-
var
|
|
2925
|
+
var On = (r) => {
|
|
2926
2926
|
const e = /* @__PURE__ */ new Map();
|
|
2927
2927
|
const t = [];
|
|
2928
2928
|
r.forEach((o) => {
|
|
@@ -2958,7 +2958,7 @@ var Bn = (r) => {
|
|
|
2958
2958
|
});
|
|
2959
2959
|
return t.concat(Array.from(e.values()));
|
|
2960
2960
|
};
|
|
2961
|
-
var Er = (r) => Bn(xn(
|
|
2961
|
+
var Er = (r) => Bn(On(xn(r)));
|
|
2962
2962
|
|
|
2963
2963
|
// src/smartCheckout/balanceCheck/balanceRequirement.ts
|
|
2964
2964
|
import { Contract as Mn, formatUnits as Ue } from "ethers";
|
|
@@ -2970,7 +2970,7 @@ var Rr = (r) => r.map((e) => {
|
|
|
2970
2970
|
};
|
|
2971
2971
|
case "NATIVE":
|
|
2972
2972
|
return {
|
|
2973
|
-
address:
|
|
2973
|
+
address: O
|
|
2974
2974
|
};
|
|
2975
2975
|
case "ERC721":
|
|
2976
2976
|
default:
|
|
@@ -3033,7 +3033,7 @@ var Ir = async (r, e, t) => {
|
|
|
3033
3033
|
const o = {};
|
|
3034
3034
|
for (const n of r) {
|
|
3035
3035
|
if (n.type === "NATIVE") {
|
|
3036
|
-
o[
|
|
3036
|
+
o[O] = ke;
|
|
3037
3037
|
continue;
|
|
3038
3038
|
}
|
|
3039
3039
|
const a = Tr(n, e);
|
|
@@ -3154,7 +3154,7 @@ var Dn = async (r, e, t, o, n = false) => {
|
|
|
3154
3154
|
);
|
|
3155
3155
|
const { balances: i } = await V(r, e, t, w(r), n);
|
|
3156
3156
|
return i.filter(
|
|
3157
|
-
(s) => a.get((s.token.address ||
|
|
3157
|
+
(s) => a.get((s.token.address || O).toLocaleLowerCase())
|
|
3158
3158
|
);
|
|
3159
3159
|
} catch (a) {
|
|
3160
3160
|
throw new m(
|
|
@@ -3239,12 +3239,12 @@ var yr = async (r, e, t, o, n = false) => {
|
|
|
3239
3239
|
if (i.length > 0) {
|
|
3240
3240
|
const f = p.shift() ?? [];
|
|
3241
3241
|
const R = new Map(f.map((E) => {
|
|
3242
|
-
const T = E.type === "NATIVE" ?
|
|
3242
|
+
const T = E.type === "NATIVE" ? O : E.token.address?.toLowerCase();
|
|
3243
3243
|
return [T, E];
|
|
3244
3244
|
}));
|
|
3245
3245
|
const C = await Ir(i, f, e);
|
|
3246
3246
|
i.forEach((E) => {
|
|
3247
|
-
const T = (E.tokenAddress ??
|
|
3247
|
+
const T = (E.tokenAddress ?? O).toLowerCase();
|
|
3248
3248
|
const y = C[T];
|
|
3249
3249
|
const I = R.get(T);
|
|
3250
3250
|
const P = hr(E, [...R.values()], y);
|
|
@@ -3792,7 +3792,7 @@ import { formatUnits as ra } from "ethers";
|
|
|
3792
3792
|
import { formatUnits as Ke } from "ethers";
|
|
3793
3793
|
|
|
3794
3794
|
// src/smartCheckout/routing/bridge/getEthBalance.ts
|
|
3795
|
-
var
|
|
3795
|
+
var xr = (r) => {
|
|
3796
3796
|
for (const e of r.balances) {
|
|
3797
3797
|
if (B(e.token.address)) {
|
|
3798
3798
|
return e.balance;
|
|
@@ -3803,7 +3803,7 @@ var Or = (r) => {
|
|
|
3803
3803
|
|
|
3804
3804
|
// src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
|
|
3805
3805
|
import { BridgeFeeActions as Qn } from "@imtbl/bridge-sdk";
|
|
3806
|
-
var
|
|
3806
|
+
var Or = async (r, e, t, o) => {
|
|
3807
3807
|
const n = be(
|
|
3808
3808
|
t,
|
|
3809
3809
|
o,
|
|
@@ -3850,7 +3850,7 @@ var Ve = async (r, e) => {
|
|
|
3850
3850
|
if (B(e)) {
|
|
3851
3851
|
return {
|
|
3852
3852
|
l1address: await Yn(_(r), r),
|
|
3853
|
-
l2address:
|
|
3853
|
+
l2address: O
|
|
3854
3854
|
};
|
|
3855
3855
|
}
|
|
3856
3856
|
const t = Zn(w(r));
|
|
@@ -3875,7 +3875,7 @@ var Ve = async (r, e) => {
|
|
|
3875
3875
|
|
|
3876
3876
|
// src/smartCheckout/routing/bridge/bridgeRoute.ts
|
|
3877
3877
|
var Jn = (r, e) => {
|
|
3878
|
-
const t =
|
|
3878
|
+
const t = xr(r);
|
|
3879
3879
|
return t >= e;
|
|
3880
3880
|
};
|
|
3881
3881
|
var Br = (r, e, t, o, n) => {
|
|
@@ -3960,7 +3960,7 @@ var He = async (r, e, t, o, n) => {
|
|
|
3960
3960
|
} else if (!u.find((v) => h(v.address, f))) {
|
|
3961
3961
|
return void 0;
|
|
3962
3962
|
}
|
|
3963
|
-
const R = await
|
|
3963
|
+
const R = await Or(
|
|
3964
3964
|
r,
|
|
3965
3965
|
e,
|
|
3966
3966
|
a,
|
|
@@ -3975,16 +3975,16 @@ var He = async (r, e, t, o, n) => {
|
|
|
3975
3975
|
} = R;
|
|
3976
3976
|
if (!Jn(c, I)) return void 0;
|
|
3977
3977
|
if (B(f)) {
|
|
3978
|
-
const v = c.balances.find((
|
|
3978
|
+
const v = c.balances.find((x) => B(x.token.address));
|
|
3979
3979
|
if (v && v.balance >= o.amount + I) {
|
|
3980
|
-
const
|
|
3980
|
+
const x = Br(
|
|
3981
3981
|
C,
|
|
3982
3982
|
T,
|
|
3983
3983
|
y,
|
|
3984
3984
|
E,
|
|
3985
3985
|
s
|
|
3986
3986
|
);
|
|
3987
|
-
return Mr(a, v, o, "NATIVE",
|
|
3987
|
+
return Mr(a, v, o, "NATIVE", x);
|
|
3988
3988
|
}
|
|
3989
3989
|
return void 0;
|
|
3990
3990
|
}
|
|
@@ -4299,11 +4299,11 @@ var Fr = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4299
4299
|
}
|
|
4300
4300
|
const P = await Promise.all(T.values());
|
|
4301
4301
|
const v = Array.from(T.keys());
|
|
4302
|
-
const
|
|
4302
|
+
const x = [];
|
|
4303
4303
|
P.forEach((G, rt) => {
|
|
4304
4304
|
const K = v[rt];
|
|
4305
4305
|
if (G === void 0) return;
|
|
4306
|
-
|
|
4306
|
+
x.push(K);
|
|
4307
4307
|
const N = y.get(K);
|
|
4308
4308
|
if (!N) return;
|
|
4309
4309
|
I.push({
|
|
@@ -4312,7 +4312,7 @@ var Fr = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4312
4312
|
l2address: N.l2address
|
|
4313
4313
|
});
|
|
4314
4314
|
});
|
|
4315
|
-
if (
|
|
4315
|
+
if (x.length === 0) return [];
|
|
4316
4316
|
if (I.length === 0) return [];
|
|
4317
4317
|
const Q = aa(
|
|
4318
4318
|
r,
|
|
@@ -4327,7 +4327,7 @@ var Fr = async (r, e, t, o, n, a, i, s, c) => {
|
|
|
4327
4327
|
n,
|
|
4328
4328
|
o,
|
|
4329
4329
|
Q,
|
|
4330
|
-
|
|
4330
|
+
x,
|
|
4331
4331
|
c
|
|
4332
4332
|
);
|
|
4333
4333
|
if (!ue) return [];
|
|
@@ -5167,7 +5167,7 @@ var Qr = async (r, e, t, o = {
|
|
|
5167
5167
|
);
|
|
5168
5168
|
} catch {
|
|
5169
5169
|
}
|
|
5170
|
-
let
|
|
5170
|
+
let x = BigInt("0");
|
|
5171
5171
|
let Q = "NATIVE";
|
|
5172
5172
|
let ue = "";
|
|
5173
5173
|
const te = n.result.buy;
|
|
@@ -5192,18 +5192,18 @@ var Qr = async (r, e, t, o = {
|
|
|
5192
5192
|
}
|
|
5193
5193
|
te.forEach((N) => {
|
|
5194
5194
|
if (N.type !== "ERC721") {
|
|
5195
|
-
|
|
5195
|
+
x += BigInt(N.amount);
|
|
5196
5196
|
}
|
|
5197
5197
|
});
|
|
5198
5198
|
const G = n.result.fees;
|
|
5199
5199
|
G.forEach((N) => {
|
|
5200
|
-
|
|
5200
|
+
x += BigInt(N.amount);
|
|
5201
5201
|
});
|
|
5202
5202
|
if (n.result.sell[0].type === "ERC1155" && R) {
|
|
5203
|
-
|
|
5203
|
+
x = x * BigInt(R) / BigInt(n.result.sell[0].amount);
|
|
5204
5204
|
}
|
|
5205
5205
|
const rt = [
|
|
5206
|
-
Sa(Q, ue,
|
|
5206
|
+
Sa(Q, ue, x, a)
|
|
5207
5207
|
];
|
|
5208
5208
|
const K = await k(
|
|
5209
5209
|
r,
|
|
@@ -5442,7 +5442,7 @@ async function Jr(r, e) {
|
|
|
5442
5442
|
}
|
|
5443
5443
|
|
|
5444
5444
|
// src/smartCheckout/sell/sell.ts
|
|
5445
|
-
import { Contract as
|
|
5445
|
+
import { Contract as Oa, parseUnits as Ba } from "ethers";
|
|
5446
5446
|
import {
|
|
5447
5447
|
constants as Ma
|
|
5448
5448
|
} from "@imtbl/orderbook";
|
|
@@ -5493,7 +5493,7 @@ var $r = async (r, e, t) => {
|
|
|
5493
5493
|
} = t[0];
|
|
5494
5494
|
let u = 18;
|
|
5495
5495
|
if (i.type === "ERC20") {
|
|
5496
|
-
const E = new
|
|
5496
|
+
const E = new Oa(
|
|
5497
5497
|
i.tokenAddress,
|
|
5498
5498
|
JSON.stringify(W),
|
|
5499
5499
|
e
|
|
@@ -5618,9 +5618,9 @@ var $r = async (r, e, t) => {
|
|
|
5618
5618
|
makerFees: []
|
|
5619
5619
|
};
|
|
5620
5620
|
if (c !== void 0) {
|
|
5621
|
-
let
|
|
5622
|
-
if (f && s.type === "ERC1155")
|
|
5623
|
-
const Q = et(c, g.amount, u,
|
|
5621
|
+
let x = BigInt(1);
|
|
5622
|
+
if (f && s.type === "ERC1155") x = BigInt(s.amount);
|
|
5623
|
+
const Q = et(c, g.amount, u, x);
|
|
5624
5624
|
if (Q.length !== c.length) {
|
|
5625
5625
|
throw new m(
|
|
5626
5626
|
"One of the fees is too small, must be greater than 0.000001",
|
|
@@ -5630,14 +5630,14 @@ var $r = async (r, e, t) => {
|
|
|
5630
5630
|
v.makerFees = Q;
|
|
5631
5631
|
}
|
|
5632
5632
|
try {
|
|
5633
|
-
const
|
|
5634
|
-
P =
|
|
5635
|
-
} catch (
|
|
5633
|
+
const x = await o.createListing(v);
|
|
5634
|
+
P = x.result.id;
|
|
5635
|
+
} catch (x) {
|
|
5636
5636
|
throw new m(
|
|
5637
5637
|
"An error occurred while creating the listing",
|
|
5638
5638
|
"CREATE_ORDER_LISTING_ERROR",
|
|
5639
5639
|
{
|
|
5640
|
-
error:
|
|
5640
|
+
error: x,
|
|
5641
5641
|
collectionId: s.id,
|
|
5642
5642
|
collectionAddress: s.collectionAddress
|
|
5643
5643
|
}
|
|
@@ -5762,12 +5762,12 @@ async function to(r) {
|
|
|
5762
5762
|
}
|
|
5763
5763
|
|
|
5764
5764
|
// src/riskAssessment/riskAssessment.ts
|
|
5765
|
-
var
|
|
5765
|
+
var xt = async (r, e) => Object.fromEntries(
|
|
5766
5766
|
r.map((t) => [t.toLowerCase(), { sanctioned: false }])
|
|
5767
5767
|
);
|
|
5768
5768
|
|
|
5769
5769
|
// src/riskAssessment/common.ts
|
|
5770
|
-
var
|
|
5770
|
+
var Ot = (r, e) => false;
|
|
5771
5771
|
var qa = (r, e) => false;
|
|
5772
5772
|
var ja = (r) => false;
|
|
5773
5773
|
|
|
@@ -5893,7 +5893,7 @@ var Bt = class {
|
|
|
5893
5893
|
* @returns {Promise<AssessmentResult>} - A promise that resolves to the risk assessment result.
|
|
5894
5894
|
*/
|
|
5895
5895
|
async getRiskAssessment(e) {
|
|
5896
|
-
return await
|
|
5896
|
+
return await xt(e, this.config);
|
|
5897
5897
|
}
|
|
5898
5898
|
/**
|
|
5899
5899
|
* Helper method that checks if given risk assessment results contain sanctioned addresses.
|
|
@@ -5903,7 +5903,7 @@ var Bt = class {
|
|
|
5903
5903
|
* @returns {boolean} - Result of the check.
|
|
5904
5904
|
*/
|
|
5905
5905
|
checkIsAddressSanctioned(e, t) {
|
|
5906
|
-
return
|
|
5906
|
+
return Ot(e, t);
|
|
5907
5907
|
}
|
|
5908
5908
|
/**
|
|
5909
5909
|
* Connects to a blockchain network using the specified provider.
|
|
@@ -6382,12 +6382,12 @@ export {
|
|
|
6382
6382
|
wo as WidgetTheme,
|
|
6383
6383
|
Io as WidgetType,
|
|
6384
6384
|
D as WrappedBrowserProvider,
|
|
6385
|
-
|
|
6385
|
+
xt as fetchRiskAssessment,
|
|
6386
6386
|
Ct as getGasPriceInWei,
|
|
6387
6387
|
gn as getMetaMaskProviderDetail,
|
|
6388
6388
|
mn as getPassportProviderDetail,
|
|
6389
6389
|
Ie as getUnderlyingChainId,
|
|
6390
|
-
|
|
6390
|
+
Ot as isAddressSanctioned,
|
|
6391
6391
|
qa as isSingleAddressSanctioned,
|
|
6392
6392
|
De as metaMaskProviderInfo,
|
|
6393
6393
|
We as passportProviderInfo,
|
package/dist/node/index.cjs
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -33,6 +33,21 @@ export type SaleSuccess = {
|
|
|
33
33
|
transactionId: string;
|
|
34
34
|
[key: string]: unknown;
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Vendor error from custom authorization or quote webhooks.
|
|
38
|
+
* Present when the failure is due to a vendor-specific rejection.
|
|
39
|
+
*/
|
|
40
|
+
export type VendorError = {
|
|
41
|
+
code: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
};
|
|
44
|
+
export type SaleFailedError = {
|
|
45
|
+
type?: string;
|
|
46
|
+
data?: {
|
|
47
|
+
vendorError?: VendorError;
|
|
48
|
+
};
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
36
51
|
/**
|
|
37
52
|
* Type representing a Sale Widget with type FAILURE.
|
|
38
53
|
* @property {string} reason
|
|
@@ -42,8 +57,8 @@ export type SaleSuccess = {
|
|
|
42
57
|
export type SaleFailed = {
|
|
43
58
|
/** The reason why sale transaction failed. */
|
|
44
59
|
reason: string;
|
|
45
|
-
/**
|
|
46
|
-
error:
|
|
60
|
+
/** Error details. Will include vendorError if the failure is due to a vendor-specific rejection. */
|
|
61
|
+
error: SaleFailedError;
|
|
47
62
|
/** The timestamp of the failed swap. */
|
|
48
63
|
timestamp: number;
|
|
49
64
|
/** Chosen payment method */
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imtbl/checkout-sdk",
|
|
3
3
|
"description": "Immutable Checkout SDK",
|
|
4
|
-
"version": "2.13.1-alpha.
|
|
4
|
+
"version": "2.13.1-alpha.2",
|
|
5
5
|
"author": "immutable",
|
|
6
6
|
"bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@imtbl/blockchain-data": "2.13.1-alpha.
|
|
9
|
-
"@imtbl/bridge-sdk": "2.13.1-alpha.
|
|
10
|
-
"@imtbl/config": "2.13.1-alpha.
|
|
11
|
-
"@imtbl/dex-sdk": "2.13.1-alpha.
|
|
12
|
-
"@imtbl/generated-clients": "2.13.1-alpha.
|
|
13
|
-
"@imtbl/metrics": "2.13.1-alpha.
|
|
14
|
-
"@imtbl/orderbook": "2.13.1-alpha.
|
|
15
|
-
"@imtbl/passport": "2.13.1-alpha.
|
|
8
|
+
"@imtbl/blockchain-data": "2.13.1-alpha.2",
|
|
9
|
+
"@imtbl/bridge-sdk": "2.13.1-alpha.2",
|
|
10
|
+
"@imtbl/config": "2.13.1-alpha.2",
|
|
11
|
+
"@imtbl/dex-sdk": "2.13.1-alpha.2",
|
|
12
|
+
"@imtbl/generated-clients": "2.13.1-alpha.2",
|
|
13
|
+
"@imtbl/metrics": "2.13.1-alpha.2",
|
|
14
|
+
"@imtbl/orderbook": "2.13.1-alpha.2",
|
|
15
|
+
"@imtbl/passport": "2.13.1-alpha.2",
|
|
16
16
|
"@metamask/detect-provider": "^2.0.0",
|
|
17
17
|
"axios": "^1.6.5",
|
|
18
18
|
"ethers": "^6.13.4",
|