@imtbl/checkout-sdk 2.1.6 → 2.1.7-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 +33 -44
- package/dist/node/index.cjs +74 -85
- package/dist/node/index.js +78 -89
- package/package.json +10 -9
package/dist/node/index.cjs
CHANGED
|
@@ -395,19 +395,19 @@ var he = /* @__PURE__ */ ((a) => {
|
|
|
395
395
|
|
|
396
396
|
// src/env/constants.ts
|
|
397
397
|
var K = "development";
|
|
398
|
-
var
|
|
398
|
+
var G = 18;
|
|
399
399
|
var Ot = 6;
|
|
400
400
|
var _ = "native";
|
|
401
401
|
var we = {
|
|
402
402
|
name: "IMX",
|
|
403
403
|
symbol: "IMX",
|
|
404
|
-
decimals:
|
|
404
|
+
decimals: G,
|
|
405
405
|
address: _
|
|
406
406
|
};
|
|
407
407
|
var kn = {
|
|
408
408
|
name: "tIMX",
|
|
409
409
|
symbol: "tIMX",
|
|
410
|
-
decimals:
|
|
410
|
+
decimals: G,
|
|
411
411
|
address: _
|
|
412
412
|
};
|
|
413
413
|
var U = {
|
|
@@ -420,8 +420,8 @@ var Se = {
|
|
|
420
420
|
[_config.Environment.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
|
|
421
421
|
[_config.Environment.PRODUCTION]: "https://checkout-api.immutable.com"
|
|
422
422
|
};
|
|
423
|
-
var Bt = true;
|
|
424
423
|
var Mt = true;
|
|
424
|
+
var Bt = true;
|
|
425
425
|
var xt = true;
|
|
426
426
|
var bt = {
|
|
427
427
|
[_config.Environment.SANDBOX]: "https://global-stg.transak.com",
|
|
@@ -522,7 +522,7 @@ var te = {
|
|
|
522
522
|
nativeToken: Ae.get(1).nativeCurrency
|
|
523
523
|
}
|
|
524
524
|
};
|
|
525
|
-
var
|
|
525
|
+
var L = [
|
|
526
526
|
{
|
|
527
527
|
constant: true,
|
|
528
528
|
inputs: [],
|
|
@@ -789,7 +789,7 @@ var nt = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
// src/env/env.ts
|
|
792
|
-
var vn = "2.1.
|
|
792
|
+
var vn = "2.1.7-alpha.1";
|
|
793
793
|
var le = () => vn;
|
|
794
794
|
|
|
795
795
|
// src/availability/availability.ts
|
|
@@ -871,7 +871,7 @@ var Ut = {
|
|
|
871
871
|
allowMistmatchedChainId: false,
|
|
872
872
|
allowUnsupportedProvider: false
|
|
873
873
|
};
|
|
874
|
-
var
|
|
874
|
+
var b = class extends _ethers.BrowserProvider {
|
|
875
875
|
|
|
876
876
|
// eslint-disable-next-line max-len
|
|
877
877
|
constructor(e, t, n) {
|
|
@@ -894,13 +894,13 @@ var me = /* @__PURE__ */ ((o) => {
|
|
|
894
894
|
o["FULFILLMENTS_UNSETTLED"] = "FULFILLMENTS_UNSETTLED";
|
|
895
895
|
return o;
|
|
896
896
|
})(me || {});
|
|
897
|
-
var
|
|
897
|
+
var M = /* @__PURE__ */ ((o) => {
|
|
898
898
|
o["NATIVE"] = "NATIVE";
|
|
899
899
|
o["ERC20"] = "ERC20";
|
|
900
900
|
o["ERC721"] = "ERC721";
|
|
901
901
|
o["ERC1155"] = "ERC1155";
|
|
902
902
|
return o;
|
|
903
|
-
})(
|
|
903
|
+
})(M || {});
|
|
904
904
|
var fe = /* @__PURE__ */ ((t) => {
|
|
905
905
|
t["TRANSACTION"] = "TRANSACTION";
|
|
906
906
|
t["GAS"] = "GAS";
|
|
@@ -960,8 +960,8 @@ async function Re(r) {
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
// src/network/network.ts
|
|
963
|
-
var
|
|
964
|
-
async function
|
|
963
|
+
var Mn = 4902;
|
|
964
|
+
async function Bn(r, e, t) {
|
|
965
965
|
return await e.send("wallet_switchEthereumChain", [
|
|
966
966
|
{ chainId: _optionalChain([r, 'access', _7 => _7.get, 'call', _8 => _8(t), 'optionalAccess', _9 => _9.chainIdHex]) }
|
|
967
967
|
]);
|
|
@@ -1062,7 +1062,7 @@ async function jt(r, e, t) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
try {
|
|
1064
1064
|
if (e && "ethereumProvider" in e) {
|
|
1065
|
-
await
|
|
1065
|
+
await Bn(n, e, t);
|
|
1066
1066
|
} else {
|
|
1067
1067
|
throw new l(
|
|
1068
1068
|
"Incorrect provider type",
|
|
@@ -1071,7 +1071,7 @@ async function jt(r, e, t) {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
} catch (c) {
|
|
1073
1073
|
console.error(c);
|
|
1074
|
-
if (c.code ===
|
|
1074
|
+
if (c.code === Mn) {
|
|
1075
1075
|
try {
|
|
1076
1076
|
if ("ethereumProvider" in e) {
|
|
1077
1077
|
await it(n, e, t);
|
|
@@ -1095,7 +1095,7 @@ async function jt(r, e, t) {
|
|
|
1095
1095
|
);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
const a = new
|
|
1098
|
+
const a = new b(e.ethereumProvider);
|
|
1099
1099
|
const i = await a.getNetwork();
|
|
1100
1100
|
if (Number(i.chainId) !== t) {
|
|
1101
1101
|
throw new l(
|
|
@@ -1355,8 +1355,8 @@ var Ie = (_class3 = class {
|
|
|
1355
1355
|
}
|
|
1356
1356
|
this.environment = e.baseConfig.environment;
|
|
1357
1357
|
this.isProduction = !this.isDevelopment && this.environment === _config.Environment.PRODUCTION;
|
|
1358
|
-
this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _35 => _35.onRamp, 'optionalAccess', _36 => _36.enable]), () => (
|
|
1359
|
-
this.isSwapEnabled = _nullishCoalesce(_optionalChain([e, 'access', _37 => _37.swap, 'optionalAccess', _38 => _38.enable]), () => (
|
|
1358
|
+
this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _35 => _35.onRamp, 'optionalAccess', _36 => _36.enable]), () => ( Mt));
|
|
1359
|
+
this.isSwapEnabled = _nullishCoalesce(_optionalChain([e, 'access', _37 => _37.swap, 'optionalAccess', _38 => _38.enable]), () => ( Bt));
|
|
1360
1360
|
this.isBridgeEnabled = _nullishCoalesce(_optionalChain([e, 'access', _39 => _39.bridge, 'optionalAccess', _40 => _40.enable]), () => ( xt));
|
|
1361
1361
|
this.publishableKey = _nullishCoalesce(e.publishableKey, () => ( "<no-publishable-key>"));
|
|
1362
1362
|
this.networkMap = bn(this.isProduction, this.isDevelopment);
|
|
@@ -1435,7 +1435,7 @@ var O = (r) => !r || I(r, _);
|
|
|
1435
1435
|
async function _e(r, e) {
|
|
1436
1436
|
return await x(
|
|
1437
1437
|
async () => {
|
|
1438
|
-
const t = new (0, _ethers.Contract)(e, JSON.stringify(
|
|
1438
|
+
const t = new (0, _ethers.Contract)(e, JSON.stringify(L), r);
|
|
1439
1439
|
const [n, o, a] = await Promise.all([
|
|
1440
1440
|
t.name(),
|
|
1441
1441
|
t.symbol(),
|
|
@@ -1605,7 +1605,7 @@ async function mt(r, e, t) {
|
|
|
1605
1605
|
async () => {
|
|
1606
1606
|
const n = new (0, _ethers.Contract)(
|
|
1607
1607
|
t,
|
|
1608
|
-
JSON.stringify(
|
|
1608
|
+
JSON.stringify(L),
|
|
1609
1609
|
r
|
|
1610
1610
|
);
|
|
1611
1611
|
return Promise.all([
|
|
@@ -1692,7 +1692,7 @@ var jn = async (r, e, t, n) => {
|
|
|
1692
1692
|
if (m.value == null) return;
|
|
1693
1693
|
const f = BigInt(m.value);
|
|
1694
1694
|
let R = parseInt(g.decimals, 10);
|
|
1695
|
-
if (Number.isNaN(R)) R =
|
|
1695
|
+
if (Number.isNaN(R)) R = G;
|
|
1696
1696
|
const T = _nullishCoalesce(g.icon_url, () => ( E.icon));
|
|
1697
1697
|
const C = {
|
|
1698
1698
|
...g,
|
|
@@ -1743,7 +1743,7 @@ var Jt = async (r, e, t, n, o) => {
|
|
|
1743
1743
|
Vn(r, e, a, o)
|
|
1744
1744
|
);
|
|
1745
1745
|
};
|
|
1746
|
-
var
|
|
1746
|
+
var q = async (r, e, t, n, o = false) => {
|
|
1747
1747
|
if (!t && !e) {
|
|
1748
1748
|
throw new l(
|
|
1749
1749
|
"both walletAddress and provider are missing. At least one must be provided.",
|
|
@@ -1950,7 +1950,7 @@ async function rr(r, e, t, n) {
|
|
|
1950
1950
|
var _dexsdk = require('@imtbl/dex-sdk');
|
|
1951
1951
|
var _orderbook = require('@imtbl/orderbook');
|
|
1952
1952
|
var _blockchaindata = require('@imtbl/blockchain-data');
|
|
1953
|
-
function
|
|
1953
|
+
function Me(r, e, t, n) {
|
|
1954
1954
|
const o = t.get(r);
|
|
1955
1955
|
const a = t.get(e);
|
|
1956
1956
|
if (!o) {
|
|
@@ -1996,7 +1996,7 @@ function ae(r) {
|
|
|
1996
1996
|
}
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
1999
|
+
function Be(r) {
|
|
2000
2000
|
return new (0, _blockchaindata.BlockchainData)({
|
|
2001
2001
|
baseConfig: {
|
|
2002
2002
|
environment: r.environment
|
|
@@ -2021,7 +2021,7 @@ async function oo(r, e) {
|
|
|
2021
2021
|
const o = r.get(t);
|
|
2022
2022
|
if (!o) throw new Error(`Missing JsonRpcProvider for chain id: ${t}`);
|
|
2023
2023
|
try {
|
|
2024
|
-
const a =
|
|
2024
|
+
const a = Me(
|
|
2025
2025
|
t,
|
|
2026
2026
|
n,
|
|
2027
2027
|
r,
|
|
@@ -2265,7 +2265,7 @@ async function uo() {
|
|
|
2265
2265
|
"METAMASK_PROVIDER_ERROR"
|
|
2266
2266
|
);
|
|
2267
2267
|
}
|
|
2268
|
-
return new
|
|
2268
|
+
return new b(r);
|
|
2269
2269
|
}
|
|
2270
2270
|
async function sr(r, e) {
|
|
2271
2271
|
let t = null;
|
|
@@ -2275,7 +2275,7 @@ async function sr(r, e) {
|
|
|
2275
2275
|
n = D.getInstance().findProvider({ rdns: be.rdns });
|
|
2276
2276
|
if (!n) {
|
|
2277
2277
|
if (e) {
|
|
2278
|
-
t = new
|
|
2278
|
+
t = new b(
|
|
2279
2279
|
await e.connectEvm({ announceProvider: false })
|
|
2280
2280
|
);
|
|
2281
2281
|
} else {
|
|
@@ -2310,7 +2310,7 @@ async function sr(r, e) {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
2312
|
if (!t && n) {
|
|
2313
|
-
t = new
|
|
2313
|
+
t = new b(n.provider);
|
|
2314
2314
|
}
|
|
2315
2315
|
if (!t) {
|
|
2316
2316
|
console.error("Failed to create provider");
|
|
@@ -2329,11 +2329,11 @@ async function sr(r, e) {
|
|
|
2329
2329
|
function cr(r) {
|
|
2330
2330
|
return r && "send" in r && typeof r.send === "function";
|
|
2331
2331
|
}
|
|
2332
|
-
async function
|
|
2332
|
+
async function B(r, e, t) {
|
|
2333
2333
|
return x(
|
|
2334
2334
|
async () => {
|
|
2335
2335
|
if ("request" in e) {
|
|
2336
|
-
return new
|
|
2336
|
+
return new b(e);
|
|
2337
2337
|
}
|
|
2338
2338
|
if (_optionalChain([e, 'access', _88 => _88.ethereumProvider, 'optionalAccess', _89 => _89.isPassport])) {
|
|
2339
2339
|
return e;
|
|
@@ -2515,7 +2515,7 @@ var Io = async (r, e, t, n) => {
|
|
|
2515
2515
|
try {
|
|
2516
2516
|
const o = new (0, _ethers.Contract)(
|
|
2517
2517
|
t,
|
|
2518
|
-
JSON.stringify(
|
|
2518
|
+
JSON.stringify(L),
|
|
2519
2519
|
r
|
|
2520
2520
|
);
|
|
2521
2521
|
return await o.allowance(e, n);
|
|
@@ -2531,7 +2531,7 @@ var To = async (r, e, t, n, o) => {
|
|
|
2531
2531
|
try {
|
|
2532
2532
|
const a = new (0, _ethers.Contract)(
|
|
2533
2533
|
t,
|
|
2534
|
-
JSON.stringify(
|
|
2534
|
+
JSON.stringify(L),
|
|
2535
2535
|
r
|
|
2536
2536
|
);
|
|
2537
2537
|
const i = await a.approve.populateTransaction(n, o);
|
|
@@ -3022,7 +3022,7 @@ var Tr = async (r, e, t) => {
|
|
|
3022
3022
|
let i = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _104 => _104.token, 'access', _105 => _105.address]), () => ( ""));
|
|
3023
3023
|
let s = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _106 => _106.token, 'access', _107 => _107.name]), () => ( ""));
|
|
3024
3024
|
let c = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _108 => _108.token, 'access', _109 => _109.symbol]), () => ( ""));
|
|
3025
|
-
let d = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _110 => _110.token, 'access', _111 => _111.decimals]), () => (
|
|
3025
|
+
let d = _nullishCoalesce(_optionalChain([a, 'optionalAccess', _110 => _110.token, 'access', _111 => _111.decimals]), () => ( G));
|
|
3026
3026
|
if (!a && o.type === "ERC20") {
|
|
3027
3027
|
i = o.tokenAddress;
|
|
3028
3028
|
if (i.toLowerCase() in n) {
|
|
@@ -3031,7 +3031,7 @@ var Tr = async (r, e, t) => {
|
|
|
3031
3031
|
try {
|
|
3032
3032
|
const p = new (0, _ethers.Contract)(
|
|
3033
3033
|
o.tokenAddress,
|
|
3034
|
-
JSON.stringify(
|
|
3034
|
+
JSON.stringify(L),
|
|
3035
3035
|
t
|
|
3036
3036
|
);
|
|
3037
3037
|
const [u, m, E] = await Promise.all([
|
|
@@ -3125,7 +3125,7 @@ var hr = (r, e, t) => {
|
|
|
3125
3125
|
};
|
|
3126
3126
|
|
|
3127
3127
|
// src/smartCheckout/balanceCheck/balanceCheck.ts
|
|
3128
|
-
var
|
|
3128
|
+
var Bo = async (r, e, t, n, o = false) => {
|
|
3129
3129
|
try {
|
|
3130
3130
|
const a = /* @__PURE__ */ new Map();
|
|
3131
3131
|
Rr(n).forEach(
|
|
@@ -3134,7 +3134,7 @@ var Mo = async (r, e, t, n, o = false) => {
|
|
|
3134
3134
|
a.set(s.address.toLocaleLowerCase(), s);
|
|
3135
3135
|
}
|
|
3136
3136
|
);
|
|
3137
|
-
const { balances: i } = await
|
|
3137
|
+
const { balances: i } = await q(r, e, t, A(r), o);
|
|
3138
3138
|
return i.filter(
|
|
3139
3139
|
(s) => a.get((s.token.address || _).toLocaleLowerCase())
|
|
3140
3140
|
);
|
|
@@ -3211,7 +3211,7 @@ var Ar = async (r, e, t, n, o = false) => {
|
|
|
3211
3211
|
}
|
|
3212
3212
|
const c = [];
|
|
3213
3213
|
if (i.length > 0) {
|
|
3214
|
-
c.push(
|
|
3214
|
+
c.push(Bo(r, e, t, a, o));
|
|
3215
3215
|
}
|
|
3216
3216
|
if (s.length > 0) {
|
|
3217
3217
|
c.push(xo(e, t, a));
|
|
@@ -3365,7 +3365,7 @@ var vr = async (r, e, t, n) => {
|
|
|
3365
3365
|
if (n.bridge) {
|
|
3366
3366
|
const s = N(r);
|
|
3367
3367
|
if (e.has(s)) {
|
|
3368
|
-
a.set(s,
|
|
3368
|
+
a.set(s, q(
|
|
3369
3369
|
r,
|
|
3370
3370
|
e.get(s),
|
|
3371
3371
|
t,
|
|
@@ -3381,7 +3381,7 @@ var vr = async (r, e, t, n) => {
|
|
|
3381
3381
|
}
|
|
3382
3382
|
const i = A(r);
|
|
3383
3383
|
if (e.has(i)) {
|
|
3384
|
-
a.set(i,
|
|
3384
|
+
a.set(i, q(
|
|
3385
3385
|
r,
|
|
3386
3386
|
e.get(i),
|
|
3387
3387
|
t,
|
|
@@ -3785,8 +3785,8 @@ var Or = (r) => {
|
|
|
3785
3785
|
|
|
3786
3786
|
// src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
|
|
3787
3787
|
|
|
3788
|
-
var
|
|
3789
|
-
const o =
|
|
3788
|
+
var Mr = async (r, e, t, n) => {
|
|
3789
|
+
const o = Me(
|
|
3790
3790
|
t,
|
|
3791
3791
|
n,
|
|
3792
3792
|
e,
|
|
@@ -3836,7 +3836,7 @@ var Ge = async (r, e) => {
|
|
|
3836
3836
|
};
|
|
3837
3837
|
}
|
|
3838
3838
|
const t = Ho(A(r));
|
|
3839
|
-
const n =
|
|
3839
|
+
const n = Be(r);
|
|
3840
3840
|
const o = await n.getToken({
|
|
3841
3841
|
chainName: t,
|
|
3842
3842
|
contractAddress: e
|
|
@@ -3860,8 +3860,8 @@ var Ko = (r, e) => {
|
|
|
3860
3860
|
const t = Or(r);
|
|
3861
3861
|
return t >= e;
|
|
3862
3862
|
};
|
|
3863
|
-
var
|
|
3864
|
-
const a = _nullishCoalesce(_optionalChain([o, 'optionalAccess', _123 => _123.decimals]), () => (
|
|
3863
|
+
var Br = (r, e, t, n, o) => {
|
|
3864
|
+
const a = _nullishCoalesce(_optionalChain([o, 'optionalAccess', _123 => _123.decimals]), () => ( G));
|
|
3865
3865
|
const i = [];
|
|
3866
3866
|
if (e > 0) {
|
|
3867
3867
|
i.push({
|
|
@@ -3883,13 +3883,13 @@ var Mr = (r, e, t, n, o) => {
|
|
|
3883
3883
|
approvalGasFee: {
|
|
3884
3884
|
type: "GAS",
|
|
3885
3885
|
amount: n,
|
|
3886
|
-
formattedAmount: _ethers.formatUnits.call(void 0, n,
|
|
3886
|
+
formattedAmount: _ethers.formatUnits.call(void 0, n, G),
|
|
3887
3887
|
token: o
|
|
3888
3888
|
},
|
|
3889
3889
|
bridgeGasFee: {
|
|
3890
3890
|
type: "GAS",
|
|
3891
3891
|
amount: r,
|
|
3892
|
-
formattedAmount: _ethers.formatUnits.call(void 0, r,
|
|
3892
|
+
formattedAmount: _ethers.formatUnits.call(void 0, r, G),
|
|
3893
3893
|
token: o
|
|
3894
3894
|
},
|
|
3895
3895
|
bridgeFees: i
|
|
@@ -3942,7 +3942,7 @@ var je = async (r, e, t, n, o) => {
|
|
|
3942
3942
|
} else if (!p.find((P) => I(P.address, m))) {
|
|
3943
3943
|
return void 0;
|
|
3944
3944
|
}
|
|
3945
|
-
const E = await
|
|
3945
|
+
const E = await Mr(
|
|
3946
3946
|
r,
|
|
3947
3947
|
e,
|
|
3948
3948
|
a,
|
|
@@ -3959,7 +3959,7 @@ var je = async (r, e, t, n, o) => {
|
|
|
3959
3959
|
if (O(m)) {
|
|
3960
3960
|
const P = c.balances.find((v) => O(v.token.address));
|
|
3961
3961
|
if (P && P.balance >= n.amount + C) {
|
|
3962
|
-
const v =
|
|
3962
|
+
const v = Br(
|
|
3963
3963
|
g,
|
|
3964
3964
|
R,
|
|
3965
3965
|
T,
|
|
@@ -3974,7 +3974,7 @@ var je = async (r, e, t, n, o) => {
|
|
|
3974
3974
|
(P) => I(P.token.address, m)
|
|
3975
3975
|
);
|
|
3976
3976
|
if (y && y.balance >= n.amount) {
|
|
3977
|
-
const P =
|
|
3977
|
+
const P = Br(
|
|
3978
3978
|
g,
|
|
3979
3979
|
R,
|
|
3980
3980
|
T,
|
|
@@ -5054,15 +5054,15 @@ var Qr = async (r, e, t, n = {
|
|
|
5054
5054
|
let i = 18;
|
|
5055
5055
|
const s = _orderbook.constants.estimatedFulfillmentGasGwei;
|
|
5056
5056
|
const c = ae(r);
|
|
5057
|
-
const d =
|
|
5057
|
+
const d = Be(r);
|
|
5058
5058
|
const p = await S(
|
|
5059
5059
|
r,
|
|
5060
5060
|
"Time to get the address from the provider",
|
|
5061
5061
|
(await e.getSigner()).getAddress()
|
|
5062
5062
|
);
|
|
5063
5063
|
ft();
|
|
5064
|
-
|
|
5065
|
-
|
|
5064
|
+
q(r, e, p, N(r));
|
|
5065
|
+
q(r, e, p, A(r));
|
|
5066
5066
|
const { id: u, takerFees: m, fillAmount: E } = t[0];
|
|
5067
5067
|
let g;
|
|
5068
5068
|
try {
|
|
@@ -5401,7 +5401,7 @@ async function Jr(r, e) {
|
|
|
5401
5401
|
e.forEach((a) => {
|
|
5402
5402
|
if (a.type === "ERC20") {
|
|
5403
5403
|
const { tokenAddress: i } = a;
|
|
5404
|
-
t.push(or(i,
|
|
5404
|
+
t.push(or(i, L, r).decimals());
|
|
5405
5405
|
}
|
|
5406
5406
|
});
|
|
5407
5407
|
const n = await Promise.all(t);
|
|
@@ -5429,13 +5429,13 @@ async function Jr(r, e) {
|
|
|
5429
5429
|
|
|
5430
5430
|
|
|
5431
5431
|
|
|
5432
|
-
var
|
|
5432
|
+
var Ma = (r, e, t) => ({
|
|
5433
5433
|
type: "ERC721",
|
|
5434
5434
|
id: r,
|
|
5435
5435
|
contractAddress: e,
|
|
5436
5436
|
spenderAddress: t
|
|
5437
5437
|
});
|
|
5438
|
-
var
|
|
5438
|
+
var Ba = (r, e, t, n) => ({
|
|
5439
5439
|
type: "ERC1155",
|
|
5440
5440
|
id: r,
|
|
5441
5441
|
contractAddress: e,
|
|
@@ -5477,7 +5477,7 @@ var $r = async (r, e, t) => {
|
|
|
5477
5477
|
if (i.type === "ERC20") {
|
|
5478
5478
|
const f = new (0, _ethers.Contract)(
|
|
5479
5479
|
i.tokenAddress,
|
|
5480
|
-
JSON.stringify(
|
|
5480
|
+
JSON.stringify(L),
|
|
5481
5481
|
e
|
|
5482
5482
|
);
|
|
5483
5483
|
p = await S(
|
|
@@ -5530,7 +5530,7 @@ var $r = async (r, e, t) => {
|
|
|
5530
5530
|
}
|
|
5531
5531
|
const E = [];
|
|
5532
5532
|
if (m && s.type === "ERC1155") {
|
|
5533
|
-
const f =
|
|
5533
|
+
const f = Ba(
|
|
5534
5534
|
s.id,
|
|
5535
5535
|
s.collectionAddress,
|
|
5536
5536
|
a,
|
|
@@ -5538,7 +5538,7 @@ var $r = async (r, e, t) => {
|
|
|
5538
5538
|
);
|
|
5539
5539
|
E.push(f);
|
|
5540
5540
|
} else {
|
|
5541
|
-
const f =
|
|
5541
|
+
const f = Ma(s.id, s.collectionAddress, a);
|
|
5542
5542
|
E.push(f);
|
|
5543
5543
|
}
|
|
5544
5544
|
let g;
|
|
@@ -5884,7 +5884,7 @@ var _t = class {
|
|
|
5884
5884
|
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
5885
5885
|
*/
|
|
5886
5886
|
async checkIsWalletConnected(e) {
|
|
5887
|
-
const t = await
|
|
5887
|
+
const t = await B(
|
|
5888
5888
|
this.config,
|
|
5889
5889
|
e.provider,
|
|
5890
5890
|
{
|
|
@@ -5918,7 +5918,7 @@ var _t = class {
|
|
|
5918
5918
|
* @throws {Error} If the provider is not valid or if there is an error connecting to the network.
|
|
5919
5919
|
*/
|
|
5920
5920
|
async connect(e) {
|
|
5921
|
-
const t = await
|
|
5921
|
+
const t = await B(
|
|
5922
5922
|
this.config,
|
|
5923
5923
|
e.provider,
|
|
5924
5924
|
{
|
|
@@ -5940,7 +5940,7 @@ var _t = class {
|
|
|
5940
5940
|
* @throws {CheckoutError} When the network cannot be added to the wallet
|
|
5941
5941
|
*/
|
|
5942
5942
|
async addNetwork(e) {
|
|
5943
|
-
const t = await
|
|
5943
|
+
const t = await B(
|
|
5944
5944
|
this.config,
|
|
5945
5945
|
e.provider,
|
|
5946
5946
|
{
|
|
@@ -5961,7 +5961,7 @@ var _t = class {
|
|
|
5961
5961
|
* @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
|
|
5962
5962
|
*/
|
|
5963
5963
|
async switchNetwork(e) {
|
|
5964
|
-
const t = await
|
|
5964
|
+
const t = await B(
|
|
5965
5965
|
this.config,
|
|
5966
5966
|
e.provider,
|
|
5967
5967
|
{
|
|
@@ -5991,7 +5991,7 @@ var _t = class {
|
|
|
5991
5991
|
* @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
|
|
5992
5992
|
*/
|
|
5993
5993
|
async getBalance(e) {
|
|
5994
|
-
const t = await
|
|
5994
|
+
const t = await B(
|
|
5995
5995
|
this.config,
|
|
5996
5996
|
e.provider
|
|
5997
5997
|
);
|
|
@@ -6014,19 +6014,8 @@ var _t = class {
|
|
|
6014
6014
|
* @returns {Promise<GetAllBalancesResult>} - A promise that resolves to the result of retrieving the balances.
|
|
6015
6015
|
*/
|
|
6016
6016
|
async getAllBalances(e) {
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
this.config,
|
|
6020
|
-
e.provider,
|
|
6021
|
-
e.walletAddress,
|
|
6022
|
-
e.chainId
|
|
6023
|
-
);
|
|
6024
|
-
}
|
|
6025
|
-
const t = await M(
|
|
6026
|
-
this.config,
|
|
6027
|
-
e.provider
|
|
6028
|
-
);
|
|
6029
|
-
return G(
|
|
6017
|
+
const t = !e.provider || "ethereumProvider" in e.provider ? e.provider : new b(e.provider);
|
|
6018
|
+
return q(
|
|
6030
6019
|
this.config,
|
|
6031
6020
|
t,
|
|
6032
6021
|
e.walletAddress,
|
|
@@ -6063,7 +6052,7 @@ var _t = class {
|
|
|
6063
6052
|
* @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
|
|
6064
6053
|
*/
|
|
6065
6054
|
async sendTransaction(e) {
|
|
6066
|
-
const t = await
|
|
6055
|
+
const t = await B(
|
|
6067
6056
|
this.config,
|
|
6068
6057
|
e.provider,
|
|
6069
6058
|
{
|
|
@@ -6080,7 +6069,7 @@ var _t = class {
|
|
|
6080
6069
|
* @returns {Promise<T>} Returns the result of the provided block param.
|
|
6081
6070
|
*/
|
|
6082
6071
|
async providerCall(e, t) {
|
|
6083
|
-
const n = await
|
|
6072
|
+
const n = await B(
|
|
6084
6073
|
this.config,
|
|
6085
6074
|
e,
|
|
6086
6075
|
{
|
|
@@ -6100,7 +6089,7 @@ var _t = class {
|
|
|
6100
6089
|
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
6101
6090
|
*/
|
|
6102
6091
|
async getNetworkInfo(e) {
|
|
6103
|
-
const t = await
|
|
6092
|
+
const t = await B(
|
|
6104
6093
|
this.config,
|
|
6105
6094
|
e.provider,
|
|
6106
6095
|
{
|
|
@@ -6123,7 +6112,7 @@ var _t = class {
|
|
|
6123
6112
|
"This endpoint currently only processes the first order in the array."
|
|
6124
6113
|
);
|
|
6125
6114
|
}
|
|
6126
|
-
const t = await
|
|
6115
|
+
const t = await B(
|
|
6127
6116
|
this.config,
|
|
6128
6117
|
e.provider
|
|
6129
6118
|
);
|
|
@@ -6149,7 +6138,7 @@ var _t = class {
|
|
|
6149
6138
|
"This endpoint currently only processes the first order in the array."
|
|
6150
6139
|
);
|
|
6151
6140
|
}
|
|
6152
|
-
const t = await
|
|
6141
|
+
const t = await B(
|
|
6153
6142
|
this.config,
|
|
6154
6143
|
e.provider
|
|
6155
6144
|
);
|
|
@@ -6165,7 +6154,7 @@ var _t = class {
|
|
|
6165
6154
|
console.warn(
|
|
6166
6155
|
"This endpoint currently only processes the first order in the array."
|
|
6167
6156
|
);
|
|
6168
|
-
const t = await
|
|
6157
|
+
const t = await B(
|
|
6169
6158
|
this.config,
|
|
6170
6159
|
e.provider
|
|
6171
6160
|
);
|
|
@@ -6189,7 +6178,7 @@ var _t = class {
|
|
|
6189
6178
|
* @throws {CheckoutError} When item requirements cannot be mapped or checkout validation fails
|
|
6190
6179
|
*/
|
|
6191
6180
|
async smartCheckout(e) {
|
|
6192
|
-
const t = await
|
|
6181
|
+
const t = await B(
|
|
6193
6182
|
this.config,
|
|
6194
6183
|
e.provider
|
|
6195
6184
|
);
|
|
@@ -6250,7 +6239,7 @@ var _t = class {
|
|
|
6250
6239
|
let t;
|
|
6251
6240
|
let n = "IMX";
|
|
6252
6241
|
let o;
|
|
6253
|
-
const a = "request" in e.browserProvider ? new
|
|
6242
|
+
const a = "request" in e.browserProvider ? new b(e.browserProvider) : e.browserProvider;
|
|
6254
6243
|
const i = await (await a.getSigner()).getAddress();
|
|
6255
6244
|
const s = _optionalChain([a, 'access', _149 => _149.ethereumProvider, 'optionalAccess', _150 => _150.isPassport]) || false;
|
|
6256
6245
|
if (s && e.passport) {
|
|
@@ -6296,7 +6285,7 @@ var _t = class {
|
|
|
6296
6285
|
* @returns {Promise<SwapResult>} - A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
|
|
6297
6286
|
*/
|
|
6298
6287
|
async swap(e) {
|
|
6299
|
-
const t = await
|
|
6288
|
+
const t = await B(
|
|
6300
6289
|
this.config,
|
|
6301
6290
|
e.provider
|
|
6302
6291
|
);
|
|
@@ -6318,7 +6307,7 @@ var _t = class {
|
|
|
6318
6307
|
* @returns {Promise<SwapQuoteResult>} - A promise that resolves to the swap quote result.
|
|
6319
6308
|
*/
|
|
6320
6309
|
async swapQuote(e) {
|
|
6321
|
-
const t = await
|
|
6310
|
+
const t = await B(
|
|
6322
6311
|
this.config,
|
|
6323
6312
|
e.provider
|
|
6324
6313
|
);
|
|
@@ -6405,4 +6394,4 @@ var $e = class {
|
|
|
6405
6394
|
|
|
6406
6395
|
|
|
6407
6396
|
|
|
6408
|
-
exports.AddTokensEventType = Rn; exports.BlockExplorerService = $e; exports.BridgeEventType = ln; exports.ChainId = Z; exports.ChainName = tt; exports.ChainSlug = he; exports.Checkout = _t; exports.CheckoutConfiguration = Ie; exports.CheckoutError = l; exports.CheckoutErrorType = w; exports.CheckoutStatus = me; exports.CommerceEventType = mn; exports.CommerceFailureEventType = En; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = fn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = on; exports.ConnectTargetLayer = Tn; exports.ExchangeType = Gt; exports.FeeType = ke; exports.FundingStepType = ge; exports.GasEstimateType = ot; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = rn; exports.ItemType =
|
|
6397
|
+
exports.AddTokensEventType = Rn; exports.BlockExplorerService = $e; exports.BridgeEventType = ln; exports.ChainId = Z; exports.ChainName = tt; exports.ChainSlug = he; exports.Checkout = _t; exports.CheckoutConfiguration = Ie; exports.CheckoutError = l; exports.CheckoutErrorType = w; exports.CheckoutStatus = me; exports.CommerceEventType = mn; exports.CommerceFailureEventType = En; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = fn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = on; exports.ConnectTargetLayer = Tn; exports.ExchangeType = Gt; exports.FeeType = ke; exports.FundingStepType = ge; exports.GasEstimateType = ot; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = rn; exports.ItemType = M; exports.NetworkFilterTypes = pe; exports.OnRampEventType = un; exports.OrchestrationEventType = pn; exports.ProviderEventType = nn; exports.PurchaseEventType = Cn; exports.RoutingOutcomeType = at; exports.SaleEventType = cn; exports.SalePaymentTypes = dn; exports.SwapDirection = hn; exports.SwapEventType = sn; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = fe; exports.WalletEventType = an; exports.WalletFilterTypes = Ft; exports.WalletProviderName = ue; exports.WalletProviderRdns = Wt; exports.WidgetTheme = yn; exports.WidgetType = In; exports.WrappedBrowserProvider = b; exports.fetchRiskAssessment = vt; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = lo; exports.getPassportProviderDetail = co; exports.getUnderlyingChainId = Re; exports.isAddressSanctioned = Nt; exports.metaMaskProviderInfo = xe; exports.passportProviderInfo = be; exports.validateProvider = B;
|