@imtbl/sdk 2.0.4-alpha.2 → 2.0.4-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cdn.js +11 -11
- package/package.json +10 -10
|
@@ -88727,7 +88727,7 @@ var immutable = (() => {
|
|
|
88727
88727
|
(typeof p3 == "string" || typeof l5 == "string" || typeof l5 == "number" || typeof l5 == "boolean") && c4.push([p3, l5.toString()]);
|
|
88728
88728
|
}), c4;
|
|
88729
88729
|
};
|
|
88730
|
-
var kr = "2.0.4-alpha.
|
|
88730
|
+
var kr = "2.0.4-alpha.4";
|
|
88731
88731
|
var Je = () => ir() ? "" : window.location.ancestorOrigins && window.location.ancestorOrigins.length > 0 ? new URL(window.location.ancestorOrigins[0]).hostname : document.referrer ? new URL(window.document.referrer).hostname : "";
|
|
88732
88732
|
var ze = () => {
|
|
88733
88733
|
if (ir()) return "";
|
|
@@ -91611,7 +91611,7 @@ Cause: ${o3.message}
|
|
|
91611
91611
|
this.config = e2, this.activitiesApi = new Xe2(e2.indexer), this.chainsApi = new Ze2(e2.indexer), this.collectionApi = new Je2(e2.indexer), this.nftOwnersApi = new st2(e2.indexer), this.nftsApi = new at(e2.indexer), this.ordersApi = new nt2(e2.orderBook), this.passportApi = new ot2(e2.passport), this.passportProfileApi = new it2(e2.passport), this.guardianApi = new et2(e2.passport);
|
|
91612
91612
|
}
|
|
91613
91613
|
};
|
|
91614
|
-
var un2 = { "x-sdk-version": "ts-immutable-sdk-2.0.4-alpha.
|
|
91614
|
+
var un2 = { "x-sdk-version": "ts-immutable-sdk-2.0.4-alpha.4" };
|
|
91615
91615
|
var Z = ({ basePath: o3, headers: e2 }) => {
|
|
91616
91616
|
if (!o3.trim()) throw Error("basePath can not be empty");
|
|
91617
91617
|
let t3 = { ...un2, ...e2 || {} }, r9 = { basePath: o3, baseOptions: { headers: t3 } };
|
|
@@ -91630,7 +91630,7 @@ Cause: ${o3.message}
|
|
|
91630
91630
|
super(e2), this.code = t3, this.details = u7, this.link = h5, this.traceId = p3;
|
|
91631
91631
|
}
|
|
91632
91632
|
};
|
|
91633
|
-
var R2 = { sdkVersion: "ts-immutable-sdk-multi-rollup-api-client-2.0.4-alpha.
|
|
91633
|
+
var R2 = { sdkVersion: "ts-immutable-sdk-multi-rollup-api-client-2.0.4-alpha.4" };
|
|
91634
91634
|
var c = (a2) => {
|
|
91635
91635
|
let { baseConfig: e2, basePath: t3, headers: u7 } = a2;
|
|
91636
91636
|
if (!t3.trim()) throw Error("basePath can not be empty");
|
|
@@ -119258,14 +119258,14 @@ Cause: ${o3.message}
|
|
|
119258
119258
|
};
|
|
119259
119259
|
var B = class extends ir2.Configuration {
|
|
119260
119260
|
};
|
|
119261
|
-
var ne3 = { "x-sdk-version": "ts-immutable-sdk-2.0.4-alpha.
|
|
119261
|
+
var ne3 = { "x-sdk-version": "ts-immutable-sdk-2.0.4-alpha.4" };
|
|
119262
119262
|
var Qe3 = ({ coreContractAddress: t3, registrationContractAddress: e2, registrationV4ContractAddress: a2, chainID: f8, basePath: n6, headers: i3, sdkVersion: s2, baseConfig: o3 }) => {
|
|
119263
119263
|
if (!n6.trim()) throw Error("basePath can not be empty");
|
|
119264
119264
|
s2 && (ne3["x-sdk-version"] = s2), i3 = { ...i3 || {}, ...p(o3, { headers: i3 })?.headers || {}, ...ne3 };
|
|
119265
119265
|
let m3 = { basePath: n6, baseOptions: { headers: i3 } };
|
|
119266
119266
|
return { apiConfiguration: new B(m3), ethConfiguration: { coreContractAddress: t3, registrationContractAddress: e2, registrationV4ContractAddress: a2, chainID: f8 } };
|
|
119267
119267
|
};
|
|
119268
|
-
var ce3 = ({ basePath: t3, chainID: e2, coreContractAddress: a2, registrationContractAddress: f8, registrationV4ContractAddress: n6, baseConfig: i3 }) => Qe3({ basePath: t3, chainID: e2, coreContractAddress: a2, registrationContractAddress: f8, registrationV4ContractAddress: n6, sdkVersion: "ts-immutable-sdk-2.0.4-alpha.
|
|
119268
|
+
var ce3 = ({ basePath: t3, chainID: e2, coreContractAddress: a2, registrationContractAddress: f8, registrationV4ContractAddress: n6, baseConfig: i3 }) => Qe3({ basePath: t3, chainID: e2, coreContractAddress: a2, registrationContractAddress: f8, registrationV4ContractAddress: n6, sdkVersion: "ts-immutable-sdk-2.0.4-alpha.4", baseConfig: i3 });
|
|
119269
119269
|
var Ye3 = ({ baseConfig: t3 }) => ce3({ basePath: "https://api.x.immutable.com", chainID: 1, coreContractAddress: "0x5FDCCA53617f4d2b9134B29090C87D01058e27e9", registrationContractAddress: "0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c", registrationV4ContractAddress: "0xac88a57943b5BBa1ecd931F8494cAd0B7F717590", baseConfig: t3 });
|
|
119270
119270
|
var de2 = ({ baseConfig: t3 }) => ce3({ basePath: "https://api.sandbox.x.immutable.com", chainID: 11155111, coreContractAddress: "0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98", registrationContractAddress: "0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97", registrationV4ContractAddress: "0xd1527c65c6287ec5ab816d328eb83bb4cb690e92", baseConfig: t3 });
|
|
119271
119271
|
var V3 = class {
|
|
@@ -142355,7 +142355,7 @@ Cause: ${o3.message}
|
|
|
142355
142355
|
var Z7 = (f8) => f8.token.type === "native";
|
|
142356
142356
|
var v7 = (f8) => f8.type === "native";
|
|
142357
142357
|
var P1 = (f8, e2) => {
|
|
142358
|
-
if (f8.token.address !== e2.token.address) throw new Error("Token mismatch: token addresses must be the same");
|
|
142358
|
+
if (f8.token.address.toLowerCase() !== e2.token.address.toLowerCase()) throw new Error("Token mismatch: token addresses must be the same");
|
|
142359
142359
|
return { value: f8.value + e2.value, token: f8.token };
|
|
142360
142360
|
};
|
|
142361
142361
|
var v12 = (f8, e2) => ({ value: f8.value + e2.value, token: f8.token });
|
|
@@ -142365,7 +142365,7 @@ Cause: ${o3.message}
|
|
|
142365
142365
|
throw new Error("Token mismatch: token types must be the same");
|
|
142366
142366
|
};
|
|
142367
142367
|
var h1 = (f8, e2) => {
|
|
142368
|
-
if (f8.token.address !== e2.token.address) throw new Error("Token mismatch: token addresses must be the same");
|
|
142368
|
+
if (f8.token.address.toLowerCase() !== e2.token.address.toLowerCase()) throw new Error("Token mismatch: token addresses must be the same");
|
|
142369
142369
|
return { value: f8.value - e2.value, token: f8.token };
|
|
142370
142370
|
};
|
|
142371
142371
|
var R1 = (f8, e2) => ({ value: f8.value - e2.value, token: f8.token });
|
|
@@ -142768,7 +142768,7 @@ Cause: ${o3.message}
|
|
|
142768
142768
|
}
|
|
142769
142769
|
var M6 = (f8, e2) => f8.type === "native" ? e2 : I62;
|
|
142770
142770
|
var S62 = (f8, e2, t3, n6, a2) => v7(f8) ? a2.length === 0 ? t3 : n6 : e2;
|
|
142771
|
-
function
|
|
142771
|
+
function c1(f8, e2, t3, n6, a2, b7, i3, r9, o3, d3) {
|
|
142772
142772
|
let s2 = S62(e2, n6, i3, r9, d3), { calldata: l5, maximumAmountIn: u7 } = k6(f8, e2, t3, s2, a2, b7, d3), m3 = d3.length > 0, T13 = o3 ? S7(m3, o3, t3.gasEstimate) : null, C5 = M6(f8, u7);
|
|
142773
142773
|
return { transaction: { data: l5, to: d3.length > 0 ? r9 : i3, value: C5, from: n6 }, gasFeeEstimate: T13 ? w4(T13) : null };
|
|
142774
142774
|
}
|
|
@@ -142779,7 +142779,7 @@ Cause: ${o3.message}
|
|
|
142779
142779
|
}
|
|
142780
142780
|
return n6.maybeWrapAmount(e2);
|
|
142781
142781
|
};
|
|
142782
|
-
function
|
|
142782
|
+
function p1(f8, e2, t3, n6) {
|
|
142783
142783
|
let a2 = _62(f8, e2, t3, n6);
|
|
142784
142784
|
return { gasEstimate: f8.gasEstimate, route: f8.route, amountIn: a2, amountOut: f8.amountOut, tradeType: f8.tradeType };
|
|
142785
142785
|
}
|
|
@@ -142867,7 +142867,7 @@ Cause: ${o3.message}
|
|
|
142867
142867
|
f7.validate(t3, n6, i3, b7, e2);
|
|
142868
142868
|
let d3 = [u0(t3, this.batchProvider, this.nativeToken), u0(n6, this.batchProvider, this.nativeToken), this.getSecondaryFees(this.batchProvider), V02(this.batchProvider, this.nativeToken)], [s2, l5, u7, m3] = await Promise.all(d3), T13 = this.parseTokenLiteral(t3, s2), C5 = this.parseTokenLiteral(n6, l5), [x7, X8] = o3 === TradeType.EXACT_INPUT ? [T13, C5] : [C5, T13], B8 = y6(a2, x7);
|
|
142869
142869
|
if (this.nativeTokenService.isWrapOrUnwrap(T13, C5)) return this.getUnsignedWrapUnwrapTx(x7, y6(a2, T13), e2, m3);
|
|
142870
|
-
let V10 = new t0(u7, T13), s0 = H0(B8, V10, o3, this.nativeTokenService), T14 = await this.router.findOptimalRoute(s0, this.nativeTokenService.maybeWrapToken(X8), o3, i3), P0 =
|
|
142870
|
+
let V10 = new t0(u7, T13), s0 = H0(B8, V10, o3, this.nativeTokenService), T14 = await this.router.findOptimalRoute(s0, this.nativeTokenService.maybeWrapToken(X8), o3, i3), P0 = p1(T14, B8, V10, this.nativeTokenService), C1 = c1(T13, C5, P0, e2, b7, r9, this.routerContractAddress, this.swapProxyContractAddress, m3, u7), { quotedAmount: w1, quotedAmountWithMaxSlippage: v0 } = G0(this.nativeTokenService, P0, b7, X8), h0 = q0(o3, B8, v0, { routerAddress: this.routerContractAddress, secondaryFeeAddress: this.swapProxyContractAddress }, u7), A1 = h0 ? await W0(this.provider, e2, h0, m3) : null;
|
|
142871
142871
|
return { quote: B6(w1, v0, b7, V10), approval: A1, swap: C1 };
|
|
142872
142872
|
}
|
|
142873
142873
|
async getUnsignedSwapTxFromAmountIn(e2, t3, n6, a2, b7 = 0.1, i3 = 3, r9 = y0()) {
|
|
@@ -143620,7 +143620,7 @@ Cause: ${o3.message}
|
|
|
143620
143620
|
maxFeePerGas: BigInt(15e9),
|
|
143621
143621
|
maxPriorityFeePerGas: BigInt(1e10)
|
|
143622
143622
|
};
|
|
143623
|
-
var Do = "2.0.4-alpha.
|
|
143623
|
+
var Do = "2.0.4-alpha.4";
|
|
143624
143624
|
var at7 = () => false;
|
|
143625
143625
|
var Se8 = () => Do;
|
|
143626
143626
|
var ve9 = (r9, e2) => {
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imtbl/sdk",
|
|
3
3
|
"description": "Immutable Typescript SDK",
|
|
4
|
-
"version": "2.0.4-alpha.
|
|
4
|
+
"version": "2.0.4-alpha.4",
|
|
5
5
|
"author": "Immutable",
|
|
6
6
|
"bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@imtbl/blockchain-data": "2.0.4-alpha.
|
|
9
|
-
"@imtbl/checkout-sdk": "2.0.4-alpha.
|
|
10
|
-
"@imtbl/config": "2.0.4-alpha.
|
|
11
|
-
"@imtbl/minting-backend": "2.0.4-alpha.
|
|
12
|
-
"@imtbl/orderbook": "2.0.4-alpha.
|
|
13
|
-
"@imtbl/passport": "2.0.4-alpha.
|
|
14
|
-
"@imtbl/webhook": "2.0.4-alpha.
|
|
15
|
-
"@imtbl/x-client": "2.0.4-alpha.
|
|
16
|
-
"@imtbl/x-provider": "2.0.4-alpha.
|
|
8
|
+
"@imtbl/blockchain-data": "2.0.4-alpha.4",
|
|
9
|
+
"@imtbl/checkout-sdk": "2.0.4-alpha.4",
|
|
10
|
+
"@imtbl/config": "2.0.4-alpha.4",
|
|
11
|
+
"@imtbl/minting-backend": "2.0.4-alpha.4",
|
|
12
|
+
"@imtbl/orderbook": "2.0.4-alpha.4",
|
|
13
|
+
"@imtbl/passport": "2.0.4-alpha.4",
|
|
14
|
+
"@imtbl/webhook": "2.0.4-alpha.4",
|
|
15
|
+
"@imtbl/x-client": "2.0.4-alpha.4",
|
|
16
|
+
"@imtbl/x-provider": "2.0.4-alpha.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"eslint": "^8.40.0",
|