@imtbl/sdk 0.1.9-alpha.1 → 0.1.9-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/blockchain-data.d.ts +22 -3
- package/dist/blockchain-data.js +62 -329
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +58 -11
- package/dist/checkout_sdk.js +76 -87
- package/dist/checkout_widgets.d.ts +49 -34
- package/dist/checkout_widgets.js +81 -41
- package/dist/erc721-permissioned-mintable.d.ts +4 -4
- package/dist/erc721-permissioned-mintable.js +4 -4
- package/dist/immutablex_client.js +1 -1
- package/dist/index.cjs +259 -485
- package/dist/index.d.ts +133 -54
- package/dist/index.js +255 -483
- package/dist/orderbook.d.ts +2 -2
- package/dist/orderbook.js +8 -8
- package/dist/passport.d.ts +1 -1
- package/dist/passport.js +27 -16
- package/package.json +1 -1
package/dist/checkout_widgets.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import 'react';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -92,8 +92,6 @@ $parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => $04521
|
|
|
92
92
|
Network["SEPOLIA"] = "Sepolia";
|
|
93
93
|
Network["IMTBL_ZKEVM_TESTNET"] = "Immutable zkEVM Testnet";
|
|
94
94
|
Network["IMTBL_ZKEVM_DEVNET"] = "Immutable zkEVM Devnet";
|
|
95
|
-
Network["POLYGON_ZKEVM_TESTNET"] = "Polygon zkEVM Testnet";
|
|
96
|
-
Network["POLYGON_ZKEVM"] = "Polygon zkEVM";
|
|
97
95
|
})($045213b18e9f1f94$export$95be4ae94445245a || ($045213b18e9f1f94$export$95be4ae94445245a = {}));
|
|
98
96
|
var $045213b18e9f1f94$export$c88931fdc51854eb;
|
|
99
97
|
(function(WidgetTheme) {
|
|
@@ -115,14 +113,48 @@ var $1f969328e5988c99$exports = {};
|
|
|
115
113
|
$parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
|
|
116
114
|
|
|
117
115
|
|
|
116
|
+
function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
117
|
+
if (!provider) {
|
|
118
|
+
// eslint-disable-next-line no-console
|
|
119
|
+
console.error("no provider parsed");
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
let attempts = 0;
|
|
123
|
+
const maxAttempts = 10;
|
|
124
|
+
let timer;
|
|
125
|
+
const attemptToSetProvider = ()=>{
|
|
126
|
+
try {
|
|
127
|
+
const elements = document.getElementsByTagName(tagName);
|
|
128
|
+
const widget = elements[0];
|
|
129
|
+
widget.setProvider(provider);
|
|
130
|
+
window.clearInterval(timer);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
attempts++;
|
|
133
|
+
if (attempts >= maxAttempts) {
|
|
134
|
+
window.clearInterval(timer);
|
|
135
|
+
// eslint-disable-next-line no-console
|
|
136
|
+
console.error("failed to set the provider");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
timer = window.setInterval(attemptToSetProvider, 10);
|
|
141
|
+
attemptToSetProvider();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
118
146
|
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
119
|
-
const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount ,
|
|
147
|
+
const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , provider: provider } = props;
|
|
148
|
+
(useEffect)(()=>{
|
|
149
|
+
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, provider);
|
|
150
|
+
}, [
|
|
151
|
+
provider
|
|
152
|
+
]);
|
|
120
153
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
121
154
|
return /*#__PURE__*/ (jsx)("imtbl-bridge", {
|
|
122
155
|
widgetConfig: config,
|
|
123
156
|
walletProvider: walletProvider,
|
|
124
157
|
fromContractAddress: fromContractAddress ?? "",
|
|
125
|
-
fromNetwork: fromNetwork ?? "",
|
|
126
158
|
amount: amount ?? ""
|
|
127
159
|
});
|
|
128
160
|
}
|
|
@@ -133,12 +165,10 @@ var $f2083cd30e2f5c56$exports = {};
|
|
|
133
165
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
134
166
|
|
|
135
167
|
|
|
136
|
-
function $f2083cd30e2f5c56$export$49d62957f420a1e2(
|
|
137
|
-
const { walletProvider: walletProvider } = props;
|
|
168
|
+
function $f2083cd30e2f5c56$export$49d62957f420a1e2() {
|
|
138
169
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
139
170
|
return /*#__PURE__*/ (jsx)("imtbl-connect", {
|
|
140
|
-
widgetConfig: config
|
|
141
|
-
walletProvider: walletProvider
|
|
171
|
+
widgetConfig: config
|
|
142
172
|
});
|
|
143
173
|
}
|
|
144
174
|
|
|
@@ -148,8 +178,15 @@ var $a4fbb8e3a6aeff58$exports = {};
|
|
|
148
178
|
$parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
|
|
149
179
|
/* eslint-disable max-len */
|
|
150
180
|
|
|
181
|
+
|
|
182
|
+
|
|
151
183
|
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
152
|
-
const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress } = props;
|
|
184
|
+
const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress , provider: provider } = props;
|
|
185
|
+
(useEffect)(()=>{
|
|
186
|
+
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, provider);
|
|
187
|
+
}, [
|
|
188
|
+
provider
|
|
189
|
+
]);
|
|
153
190
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
154
191
|
return /*#__PURE__*/ (jsx)("imtbl-swap", {
|
|
155
192
|
widgetConfig: config,
|
|
@@ -166,8 +203,15 @@ var $89d55ace0f8f1c07$exports = {};
|
|
|
166
203
|
$parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
|
|
167
204
|
|
|
168
205
|
|
|
206
|
+
|
|
207
|
+
|
|
169
208
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
170
|
-
const { walletProvider: walletProvider } = props;
|
|
209
|
+
const { walletProvider: walletProvider , provider: provider } = props;
|
|
210
|
+
(useEffect)(()=>{
|
|
211
|
+
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, provider);
|
|
212
|
+
}, [
|
|
213
|
+
provider
|
|
214
|
+
]);
|
|
171
215
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
172
216
|
return /*#__PURE__*/ (jsx)("imtbl-wallet", {
|
|
173
217
|
widgetConfig: config,
|
|
@@ -178,44 +222,40 @@ function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
|
178
222
|
|
|
179
223
|
var $430e3eda76fa4d5f$exports = {};
|
|
180
224
|
|
|
225
|
+
$parcel$export($430e3eda76fa4d5f$exports, "DEFAULT_CHECKOUT_VERSION", () => $430e3eda76fa4d5f$export$391f2d917401f2bb);
|
|
226
|
+
$parcel$export($430e3eda76fa4d5f$exports, "validateAndBuildVersion", () => $430e3eda76fa4d5f$export$46b1ae20f762ad4c);
|
|
181
227
|
$parcel$export($430e3eda76fa4d5f$exports, "CheckoutWidgets", () => $430e3eda76fa4d5f$export$af210a0808087845);
|
|
182
228
|
$parcel$export($430e3eda76fa4d5f$exports, "UpdateConfig", () => $430e3eda76fa4d5f$export$bf1548ba7e61c17f);
|
|
183
|
-
$
|
|
229
|
+
const $430e3eda76fa4d5f$export$391f2d917401f2bb = "0.1.9-alpha";
|
|
230
|
+
function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
231
|
+
if (!version || version?.major === undefined || version.major < 0) return $430e3eda76fa4d5f$export$391f2d917401f2bb;
|
|
232
|
+
if (version.major === 0 && version.minor === 0 && version.patch === 0) return $430e3eda76fa4d5f$export$391f2d917401f2bb;
|
|
233
|
+
let validatedVersion = $430e3eda76fa4d5f$export$391f2d917401f2bb;
|
|
234
|
+
if (!Number.isNaN(version.major) && version.major >= 0) validatedVersion = version.major.toString();
|
|
235
|
+
if (version.minor !== undefined && !Number.isNaN(version.minor) && version.minor >= 0) validatedVersion += `.${version.minor.toString()}`;
|
|
236
|
+
if (version.patch !== undefined && !Number.isNaN(version.patch) && version.patch >= 0) {
|
|
237
|
+
if (version.minor === undefined) validatedVersion += `.0.${version.patch.toString()}`;
|
|
238
|
+
else validatedVersion += `.${version.patch.toString()}`;
|
|
239
|
+
}
|
|
240
|
+
// TODO: at the moment all of the releases that include
|
|
241
|
+
// the checkout widgets script have '-alpha' appended
|
|
242
|
+
// Change this when we go to testnet. ticket WT-1432
|
|
243
|
+
validatedVersion += "-alpha";
|
|
244
|
+
if (version.build !== undefined) validatedVersion += `.${version.build}`;
|
|
245
|
+
return validatedVersion;
|
|
246
|
+
}
|
|
184
247
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
185
248
|
const checkoutWidgetJS = document.createElement("script");
|
|
186
|
-
|
|
249
|
+
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
250
|
+
{
|
|
251
|
+
const cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
252
|
+
checkoutWidgetJS.setAttribute("src", cdnUrl);
|
|
253
|
+
}
|
|
187
254
|
document.head.appendChild(checkoutWidgetJS);
|
|
188
255
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
189
256
|
}
|
|
190
257
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
191
258
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
192
259
|
}
|
|
193
|
-
function $430e3eda76fa4d5f$export$931068bc678f0d73(tagName, provider) {
|
|
194
|
-
if (!provider) {
|
|
195
|
-
// eslint-disable-next-line no-console
|
|
196
|
-
console.error("no provider parsed");
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
let attempts = 0;
|
|
200
|
-
const maxAttempts = 10;
|
|
201
|
-
let timer;
|
|
202
|
-
const attemptToSetProvider = ()=>{
|
|
203
|
-
try {
|
|
204
|
-
const elements = document.getElementsByTagName(tagName);
|
|
205
|
-
const widget = elements[0];
|
|
206
|
-
widget.setProvider(provider);
|
|
207
|
-
window.clearInterval(timer);
|
|
208
|
-
} catch (err) {
|
|
209
|
-
attempts++;
|
|
210
|
-
if (attempts >= maxAttempts) {
|
|
211
|
-
window.clearInterval(timer);
|
|
212
|
-
// eslint-disable-next-line no-console
|
|
213
|
-
console.error("failed to set the provider");
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
timer = window.setInterval(attemptToSetProvider, 10);
|
|
218
|
-
attemptToSetProvider();
|
|
219
|
-
}
|
|
220
260
|
|
|
221
|
-
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $045213b18e9f1f94$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $430e3eda76fa4d5f$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, $045213b18e9f1f94$export$95be4ae94445245a as Network, $ad06b030b1a3ba34$export$b80d2daf830437b9 as OrchestrationEventType, $
|
|
261
|
+
export { $15cc9e120aa6f3bf$export$d1bfa21f7c76447a as BridgeEventType, $1f969328e5988c99$export$30f61ebf204c69f6 as BridgeReact, $045213b18e9f1f94$export$75be0f6af9650f2c as CheckoutWidgetTagNames, $430e3eda76fa4d5f$export$af210a0808087845 as CheckoutWidgets, $a85ecdbd885c58ad$export$e72e7f9969a47dd3 as ConnectEventType, $f2083cd30e2f5c56$export$49d62957f420a1e2 as ConnectReact, $430e3eda76fa4d5f$export$391f2d917401f2bb as DEFAULT_CHECKOUT_VERSION, $207ed853f11d19d5$export$5a0ace85cae72d45 as IMTBLWidgetEvents, $045213b18e9f1f94$export$95be4ae94445245a as Network, $ad06b030b1a3ba34$export$b80d2daf830437b9 as OrchestrationEventType, $53d219e7f6bf0cd6$export$140a49745ab55563 as SwapEventType, $a4fbb8e3a6aeff58$export$971e031379577f4 as SwapReact, $430e3eda76fa4d5f$export$bf1548ba7e61c17f as UpdateConfig, $77b6aac5c353d4a9$export$d9be06b70b28c742 as WalletEventType, $89d55ace0f8f1c07$export$ceaac94f34dba154 as WalletReact, $045213b18e9f1f94$export$c88931fdc51854eb as WidgetTheme, $430e3eda76fa4d5f$export$46b1ae20f762ad4c as validateAndBuildVersion };
|
|
@@ -409,25 +409,25 @@ declare class ERC721PermissionedMintable {
|
|
|
409
409
|
/**
|
|
410
410
|
* @returns a populated transaction for the setApprovalForAll contract function
|
|
411
411
|
*/
|
|
412
|
-
|
|
412
|
+
populateSetApprovalForAll(operator: PromiseOrValue<string>, approved: PromiseOrValue<boolean>, overrides?: Overrides & {
|
|
413
413
|
from?: PromiseOrValue<string>;
|
|
414
414
|
}): Promise<PopulatedTransaction>;
|
|
415
415
|
/**
|
|
416
416
|
* @returns a populated transaction for the setBaseURI contract function
|
|
417
417
|
*/
|
|
418
|
-
|
|
418
|
+
populateSetBaseURI(baseURI_: PromiseOrValue<string>, overrides?: Overrides & {
|
|
419
419
|
from?: PromiseOrValue<string>;
|
|
420
420
|
}): Promise<PopulatedTransaction>;
|
|
421
421
|
/**
|
|
422
422
|
* @returns a populated transaction for the setContractURI contract function
|
|
423
423
|
*/
|
|
424
|
-
|
|
424
|
+
populateSetContractURI(_contractURI: PromiseOrValue<string>, overrides?: Overrides & {
|
|
425
425
|
from?: PromiseOrValue<string>;
|
|
426
426
|
}): Promise<PopulatedTransaction>;
|
|
427
427
|
/**
|
|
428
428
|
* @returns a populated transaction for the setRoyaltyAllowlistRegistry contract function
|
|
429
429
|
*/
|
|
430
|
-
|
|
430
|
+
populateSetRoyaltyAllowlistRegistry(_royaltyAllowlist: PromiseOrValue<string>, overrides?: Overrides & {
|
|
431
431
|
from?: PromiseOrValue<string>;
|
|
432
432
|
}): Promise<PopulatedTransaction>;
|
|
433
433
|
}
|
|
@@ -1139,25 +1139,25 @@ class ERC721PermissionedMintable {
|
|
|
1139
1139
|
/**
|
|
1140
1140
|
* @returns a populated transaction for the setApprovalForAll contract function
|
|
1141
1141
|
*/
|
|
1142
|
-
async
|
|
1142
|
+
async populateSetApprovalForAll(operator, approved, overrides = {}) {
|
|
1143
1143
|
return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides);
|
|
1144
1144
|
}
|
|
1145
1145
|
/**
|
|
1146
1146
|
* @returns a populated transaction for the setBaseURI contract function
|
|
1147
1147
|
*/
|
|
1148
|
-
async
|
|
1148
|
+
async populateSetBaseURI(baseURI_, overrides = {}) {
|
|
1149
1149
|
return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides);
|
|
1150
1150
|
}
|
|
1151
1151
|
/**
|
|
1152
1152
|
* @returns a populated transaction for the setContractURI contract function
|
|
1153
1153
|
*/
|
|
1154
|
-
async
|
|
1154
|
+
async populateSetContractURI(_contractURI, overrides = {}) {
|
|
1155
1155
|
return await this.contract.populateTransaction.setContractURI(_contractURI, overrides);
|
|
1156
1156
|
}
|
|
1157
1157
|
/**
|
|
1158
1158
|
* @returns a populated transaction for the setRoyaltyAllowlistRegistry contract function
|
|
1159
1159
|
*/
|
|
1160
|
-
async
|
|
1160
|
+
async populateSetRoyaltyAllowlistRegistry(_royaltyAllowlist, overrides = {}) {
|
|
1161
1161
|
return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(_royaltyAllowlist, overrides);
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
16
16
|
chainID,
|
|
17
17
|
coreContractAddress,
|
|
18
18
|
registrationContractAddress,
|
|
19
|
-
sdkVersion: 'ts-immutable-sdk-0.1.9-alpha.
|
|
19
|
+
sdkVersion: 'ts-immutable-sdk-0.1.9-alpha.2',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|