@imtbl/sdk 1.6.1 → 1.7.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/blockchain_data.js +5 -4
- package/dist/browser/checkout/sdk.js +7 -7
- package/dist/browser/checkout/widgets.js +62 -62
- package/dist/checkout.d.ts +2 -0
- package/dist/checkout.js +18 -9
- package/dist/config.js +4 -3
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +363 -358
- package/dist/index.d.ts +2 -0
- package/dist/index.js +363 -358
- package/dist/orderbook.js +4 -3
- package/dist/passport.d.ts +1 -0
- package/dist/passport.js +386 -389
- package/dist/x.js +5 -4
- package/package.json +1 -1
package/dist/checkout.d.ts
CHANGED
|
@@ -21340,6 +21340,7 @@ declare class Passport {
|
|
|
21340
21340
|
private readonly multiRollupApiClients;
|
|
21341
21341
|
private readonly passportImxProviderFactory;
|
|
21342
21342
|
private readonly passportEventEmitter;
|
|
21343
|
+
private readonly guardianClient;
|
|
21343
21344
|
constructor(passportModuleConfiguration: PassportModuleConfiguration);
|
|
21344
21345
|
/**
|
|
21345
21346
|
* @deprecated The method `login` with an argument of `{ useCachedSession: true }` should be used in conjunction with
|
|
@@ -22959,6 +22960,7 @@ interface FiatRampWidgetParams {
|
|
|
22959
22960
|
tokenAmount?: string;
|
|
22960
22961
|
tokenSymbol?: string;
|
|
22961
22962
|
email?: string;
|
|
22963
|
+
allowedTokens?: string[];
|
|
22962
22964
|
}
|
|
22963
22965
|
declare class FiatRampService {
|
|
22964
22966
|
readonly config: CheckoutConfiguration;
|
package/dist/checkout.js
CHANGED
|
@@ -107,7 +107,7 @@ const storeDetail$1 = (key, value) => {
|
|
|
107
107
|
};
|
|
108
108
|
setItem$1(Store$1.RUNTIME, RUNTIME_DETAILS$1);
|
|
109
109
|
};
|
|
110
|
-
const getDetail$1 = (key) => {
|
|
110
|
+
const getDetail$1$1 = (key) => {
|
|
111
111
|
// Handle the scenario where detail is a falsy value
|
|
112
112
|
if (RUNTIME_DETAILS$1[key] === undefined) {
|
|
113
113
|
return undefined;
|
|
@@ -139,7 +139,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
142
|
-
const SDK_VERSION$1 = '1.
|
|
142
|
+
const SDK_VERSION$1 = '1.7.0';
|
|
143
143
|
const getReferrer$1 = () => {
|
|
144
144
|
if (isNode$1()) {
|
|
145
145
|
return '';
|
|
@@ -182,7 +182,7 @@ const initialise$2 = async () => {
|
|
|
182
182
|
initialised$1 = true;
|
|
183
183
|
try {
|
|
184
184
|
const runtimeDetails = flattenProperties$1(getRuntimeDetails$1());
|
|
185
|
-
const existingRuntimeId = getDetail$1(Detail$1.RUNTIME_ID);
|
|
185
|
+
const existingRuntimeId = getDetail$1$1(Detail$1.RUNTIME_ID);
|
|
186
186
|
const body = {
|
|
187
187
|
version: 1,
|
|
188
188
|
data: {
|
|
@@ -314,6 +314,7 @@ const setPublishableApiKeyFn$1 = (publishableApiKey) => {
|
|
|
314
314
|
storeDetail$1(Detail$1.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
315
315
|
};
|
|
316
316
|
errorBoundary$1(getGlobalisedValue$2('setPublishableApiKey', setPublishableApiKeyFn$1));
|
|
317
|
+
errorBoundary$1(getGlobalisedValue$2('getDetail', getDetail$1$1));
|
|
317
318
|
|
|
318
319
|
var Environment$1;
|
|
319
320
|
(function (Environment) {
|
|
@@ -17446,7 +17447,7 @@ const storeDetail = (key, value) => {
|
|
|
17446
17447
|
};
|
|
17447
17448
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
17448
17449
|
};
|
|
17449
|
-
const getDetail = (key) => {
|
|
17450
|
+
const getDetail$1 = (key) => {
|
|
17450
17451
|
// Handle the scenario where detail is a falsy value
|
|
17451
17452
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
17452
17453
|
return undefined;
|
|
@@ -17478,7 +17479,7 @@ const flattenProperties = (properties) => {
|
|
|
17478
17479
|
};
|
|
17479
17480
|
|
|
17480
17481
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
17481
|
-
const SDK_VERSION = '1.
|
|
17482
|
+
const SDK_VERSION = '1.7.0';
|
|
17482
17483
|
const getReferrer = () => {
|
|
17483
17484
|
if (isNode()) {
|
|
17484
17485
|
return '';
|
|
@@ -17521,7 +17522,7 @@ const initialise = async () => {
|
|
|
17521
17522
|
initialised = true;
|
|
17522
17523
|
try {
|
|
17523
17524
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
17524
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
17525
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
17525
17526
|
const body = {
|
|
17526
17527
|
version: 1,
|
|
17527
17528
|
data: {
|
|
@@ -17653,6 +17654,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
17653
17654
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
17654
17655
|
};
|
|
17655
17656
|
errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
17657
|
+
errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
17656
17658
|
|
|
17657
17659
|
var Environment;
|
|
17658
17660
|
(function (Environment) {
|
|
@@ -27723,7 +27725,7 @@ class APIError extends Error {
|
|
|
27723
27725
|
|
|
27724
27726
|
/* eslint-disable implicit-arrow-linebreak */
|
|
27725
27727
|
const defaultHeaders = {
|
|
27726
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.
|
|
27728
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.7.0',
|
|
27727
27729
|
};
|
|
27728
27730
|
/**
|
|
27729
27731
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -29090,7 +29092,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
29090
29092
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
29091
29093
|
};
|
|
29092
29094
|
|
|
29093
|
-
const SDK_VERSION_MARKER = '1.
|
|
29095
|
+
const SDK_VERSION_MARKER = '1.7.0';
|
|
29094
29096
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
29095
29097
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
29096
29098
|
|
|
@@ -32604,13 +32606,15 @@ class FiatRampService {
|
|
|
32604
32606
|
const productsAvailed = 'productsAvailed=buy';
|
|
32605
32607
|
const exchangeScreenTitle = 'exchangeScreenTitle=Buy';
|
|
32606
32608
|
const themeColor = 'themeColor=0D0D0D';
|
|
32609
|
+
const defaultFiat = 'defaultFiatAmount=50&defaultFiatCurrency=usd';
|
|
32607
32610
|
widgetUrl += `${transakPublishableKey}&`
|
|
32608
32611
|
+ `${zkevmNetwork}&`
|
|
32609
32612
|
+ `${defaultPaymentMethod}&`
|
|
32610
32613
|
+ `${disableBankTransfer}&`
|
|
32611
32614
|
+ `${productsAvailed}&`
|
|
32612
32615
|
+ `${exchangeScreenTitle}&`
|
|
32613
|
-
+ `${themeColor}
|
|
32616
|
+
+ `${themeColor}&`
|
|
32617
|
+
+ `${defaultFiat}`;
|
|
32614
32618
|
if (params.isPassport && params.email) {
|
|
32615
32619
|
const encodedEmail = encodeURIComponent(params.email);
|
|
32616
32620
|
widgetUrl += `&email=${encodedEmail}&isAutoFillUserData=true&disableWalletAddressForm=true`;
|
|
@@ -32624,6 +32628,9 @@ class FiatRampService {
|
|
|
32624
32628
|
if (params.walletAddress) {
|
|
32625
32629
|
widgetUrl += `&walletAddress=${params.walletAddress}`;
|
|
32626
32630
|
}
|
|
32631
|
+
if (params.allowedTokens) {
|
|
32632
|
+
widgetUrl += `&cryptoCurrencyList=${params.allowedTokens?.join(',').toLowerCase()}`;
|
|
32633
|
+
}
|
|
32627
32634
|
return widgetUrl;
|
|
32628
32635
|
}
|
|
32629
32636
|
}
|
|
@@ -33070,6 +33077,7 @@ class Checkout {
|
|
|
33070
33077
|
tokenAmount = params.tokenAmount;
|
|
33071
33078
|
tokenSymbol = token.symbol;
|
|
33072
33079
|
}
|
|
33080
|
+
const allowedTokens = tokenList?.tokens?.filter((t) => t.symbol).map((t) => t.symbol);
|
|
33073
33081
|
return await this.fiatRampService.createWidgetUrl({
|
|
33074
33082
|
exchangeType: params.exchangeType,
|
|
33075
33083
|
isPassport,
|
|
@@ -33077,6 +33085,7 @@ class Checkout {
|
|
|
33077
33085
|
tokenAmount,
|
|
33078
33086
|
tokenSymbol,
|
|
33079
33087
|
email,
|
|
33088
|
+
allowedTokens,
|
|
33080
33089
|
});
|
|
33081
33090
|
}
|
|
33082
33091
|
/**
|
package/dist/config.js
CHANGED
|
@@ -96,7 +96,7 @@ const storeDetail = (key, value) => {
|
|
|
96
96
|
};
|
|
97
97
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
98
98
|
};
|
|
99
|
-
const getDetail = (key) => {
|
|
99
|
+
const getDetail$1 = (key) => {
|
|
100
100
|
// Handle the scenario where detail is a falsy value
|
|
101
101
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
102
102
|
return undefined;
|
|
@@ -128,7 +128,7 @@ const flattenProperties = (properties) => {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
131
|
-
const SDK_VERSION = '1.
|
|
131
|
+
const SDK_VERSION = '1.7.0';
|
|
132
132
|
const getReferrer = () => {
|
|
133
133
|
if (isNode()) {
|
|
134
134
|
return '';
|
|
@@ -171,7 +171,7 @@ const initialise = async () => {
|
|
|
171
171
|
initialised = true;
|
|
172
172
|
try {
|
|
173
173
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
174
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
174
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
175
175
|
const body = {
|
|
176
176
|
version: 1,
|
|
177
177
|
data: {
|
|
@@ -303,6 +303,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
303
303
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
304
304
|
};
|
|
305
305
|
const setPublishableApiKey = errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
306
|
+
errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
306
307
|
|
|
307
308
|
var Environment;
|
|
308
309
|
(function (Environment) {
|