@imtbl/sdk 1.78.1 → 1.78.2-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/{blockchain_data-dtlp9hdb.js → blockchain_data-QI7kewKD.js} +2 -2
- package/dist/blockchain_data.js +3 -3
- package/dist/browser/checkout/{AddTokensWidget-phRi8isq.js → AddTokensWidget-hN4Oz8Ns.js} +3 -3
- package/dist/browser/checkout/{BridgeWidget-DqBqp6iY.js → BridgeWidget-A_pLUANI.js} +6 -6
- package/dist/browser/checkout/{CommerceWidget-BakoRfZj.js → CommerceWidget-BoKaAY5y.js} +13 -13
- package/dist/browser/checkout/{FeesBreakdown-BeOGIvgY.js → FeesBreakdown-Cnmi6JuS.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-BID9kc9s.js → OnRampWidget-CYqTRHSC.js} +3 -3
- package/dist/browser/checkout/{SaleWidget-B6lZ8hGg.js → SaleWidget-DIW0k6AY.js} +10 -10
- package/dist/browser/checkout/{SpendingCapHero-DW6X8cGr.js → SpendingCapHero-Dp3KVsiY.js} +1 -1
- package/dist/browser/checkout/SwapWidget-CO4Ks4Im.js +1850 -0
- package/dist/browser/checkout/{TokenImage-DtkH2h2e.js → TokenImage-BNq0SnBY.js} +1 -1
- package/dist/browser/checkout/{TopUpView-BoCJELBq.js → TopUpView-CHsQmxQQ.js} +1 -1
- package/dist/browser/checkout/{WalletApproveHero-BxkUQIWN.js → WalletApproveHero-Bj4aKxP9.js} +3 -3
- package/dist/browser/checkout/{WalletWidget-C8iWV1OY.js → WalletWidget-BsKIkdBf.js} +3 -3
- package/dist/browser/checkout/{auto-track-Densi2-k.js → auto-track-BM5HqFI3.js} +1 -1
- package/dist/browser/checkout/{index-C-4DEd8a.js → index-BDZfw_Cp.js} +27 -135
- package/dist/browser/checkout/{index-CGZ3kTp1.js → index-CNJ98XFR.js} +2 -2
- package/dist/browser/checkout/{index-DSuIrOmV.js → index-Cp7l-bwg.js} +1 -1
- package/dist/browser/checkout/{index-CJ-HyQqV.js → index-D-MV_CPF.js} +1 -1
- package/dist/browser/checkout/{index-Djor6tHu.js → index-D0Nv1xcY.js} +1 -1
- package/dist/browser/checkout/{index-fbNLtQZy.js → index-D9AyMqDS.js} +1 -1
- package/dist/browser/checkout/{index-Bz7QkIrz.js → index-DatkoxOH.js} +1 -1
- package/dist/browser/checkout/{index-BWF1wMhZ.js → index-DubSxoZp.js} +1 -1
- package/dist/browser/checkout/{index.umd-BI-_-mXw.js → index.umd-Dyg-Hme-.js} +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/{useInterval-CfVGG_W7.js → useInterval-WSD1wTJp.js} +1 -1
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +181 -177
- package/dist/{checkout-B-BLfuyF.js → checkout-DUv7Lpgl.js} +5 -11
- package/dist/checkout.js +5 -5
- package/dist/{config-DK_IUjmj.js → config-CoKnE2K3.js} +1 -1
- package/dist/config.js +1 -1
- package/dist/{index-2-Yhh8Lo.js → index-BUSedeWh.js} +1 -1
- package/dist/{index-8TTFjDjB.js → index-DBt3LJ_R.js} +4 -4
- package/dist/{index-wc_sNfXQ.js → index-DRXK1WT6.js} +3 -3
- package/dist/{index-Bi3YfX-o.js → index-DSQMBlTv.js} +1 -1
- package/dist/{index-B0oHQE2a.js → index-J9VWkapC.js} +1 -1
- package/dist/{index-DmDCdEAA.js → index-TTaZqMOM.js} +8 -5
- package/dist/index.browser.js +5 -5
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +127 -56
- package/dist/index.js +14 -14
- package/dist/{minting_backend-Blarurl3.js → minting_backend-8VSOpVwa.js} +3 -3
- package/dist/minting_backend.js +5 -5
- package/dist/{orderbook-C8nW30oG.js → orderbook-CLE5NCQf.js} +1 -1
- package/dist/orderbook.js +2 -2
- package/dist/{passport-Dn-dJ0as.js → passport-CoyF1bR_.js} +116 -42
- package/dist/passport.js +4 -4
- package/dist/version.json +1 -1
- package/dist/{webhook-Bk8qJg4f.js → webhook-B-2ztLNv.js} +1 -1
- package/dist/webhook.js +2 -2
- package/dist/{x-BTBIq3r-.js → x-B-aZ25Wf.js} +3 -3
- package/dist/x.js +4 -4
- package/package.json +1 -1
- package/dist/browser/checkout/SwapWidget-UFkXHv2L.js +0 -1738
package/dist/index.cjs
CHANGED
|
@@ -217,7 +217,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
220
|
-
const SDK_VERSION$1 = '1.78.1';
|
|
220
|
+
const SDK_VERSION$1 = '1.78.2-alpha.1';
|
|
221
221
|
const getFrameParentDomain$1 = () => {
|
|
222
222
|
if (isNode$1()) {
|
|
223
223
|
return '';
|
|
@@ -457,7 +457,7 @@ const mergeProperties = (...args) => {
|
|
|
457
457
|
};
|
|
458
458
|
const cleanEventName = (eventName) => eventName.replace(/[^a-zA-Z0-9\s\-_]/g, '');
|
|
459
459
|
const getEventName = (flowName, eventName) => `${flowName}_${cleanEventName(eventName)}`;
|
|
460
|
-
const trackFlowFn = (moduleName, flowName, properties) => {
|
|
460
|
+
const trackFlowFn = (moduleName, flowName, trackStartEvent = true, properties) => {
|
|
461
461
|
// Track the start of the flow
|
|
462
462
|
const flowId = generateFlowId();
|
|
463
463
|
const flowStartTime = Date.now();
|
|
@@ -493,8 +493,10 @@ const trackFlowFn = (moduleName, flowName, properties) => {
|
|
|
493
493
|
currentStepCount++;
|
|
494
494
|
previousStepTime = currentTime;
|
|
495
495
|
};
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
if (trackStartEvent) {
|
|
497
|
+
// Trigger a Start Event as a record of creating the flow
|
|
498
|
+
addEvent('Start');
|
|
499
|
+
}
|
|
498
500
|
return {
|
|
499
501
|
details: {
|
|
500
502
|
moduleName,
|
|
@@ -511,11 +513,12 @@ const trackFlowFn = (moduleName, flowName, properties) => {
|
|
|
511
513
|
* Works similarly to `track`
|
|
512
514
|
* @param moduleName Name of the module being tracked (for namespacing purposes), e.g. `passport`
|
|
513
515
|
* @param flowName Name of the flow, e.g. `performTransaction`
|
|
516
|
+
* @param trackStartEvent Whether to track the start event in the flow
|
|
514
517
|
* @param properties Other properties to be sent with the event, other than duration
|
|
515
518
|
*
|
|
516
519
|
* @example
|
|
517
520
|
* ```ts
|
|
518
|
-
* const flow = trackFlow("passport", "performTransaction", { transationType: "transfer" });
|
|
521
|
+
* const flow = trackFlow("passport", "performTransaction", true, { transationType: "transfer" });
|
|
519
522
|
* // Do something...
|
|
520
523
|
* flow.addEvent("clickItem");
|
|
521
524
|
* // Do something...
|
|
@@ -15000,7 +15003,7 @@ class MultiRollupApiClients {
|
|
|
15000
15003
|
}
|
|
15001
15004
|
|
|
15002
15005
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15003
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.78.1' };
|
|
15006
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.78.2-alpha.1' };
|
|
15004
15007
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
15005
15008
|
if (!basePath.trim()) {
|
|
15006
15009
|
throw Error('basePath can not be empty');
|
|
@@ -15072,7 +15075,7 @@ class APIError extends Error {
|
|
|
15072
15075
|
|
|
15073
15076
|
/* eslint-disable implicit-arrow-linebreak */
|
|
15074
15077
|
const defaultHeaders$1 = {
|
|
15075
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.78.1',
|
|
15078
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.78.2-alpha.1',
|
|
15076
15079
|
};
|
|
15077
15080
|
/**
|
|
15078
15081
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -15662,7 +15665,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
15662
15665
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
15663
15666
|
class ApiConfiguration extends index$2.Configuration {
|
|
15664
15667
|
}
|
|
15665
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.78.1' };
|
|
15668
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.78.2-alpha.1' };
|
|
15666
15669
|
/**
|
|
15667
15670
|
* @dev use createImmutableXConfiguration instead
|
|
15668
15671
|
*/
|
|
@@ -15703,7 +15706,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
15703
15706
|
coreContractAddress,
|
|
15704
15707
|
registrationContractAddress,
|
|
15705
15708
|
registrationV4ContractAddress,
|
|
15706
|
-
sdkVersion: 'ts-immutable-sdk-1.78.1',
|
|
15709
|
+
sdkVersion: 'ts-immutable-sdk-1.78.2-alpha.1',
|
|
15707
15710
|
baseConfig,
|
|
15708
15711
|
});
|
|
15709
15712
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -25375,45 +25378,55 @@ const lazyDocumentReady = (initialiseFunction) => {
|
|
|
25375
25378
|
return lazyLoad(documentReadyPromise, initialiseFunction);
|
|
25376
25379
|
};
|
|
25377
25380
|
|
|
25378
|
-
const withMetrics = (fn, flowName) => {
|
|
25379
|
-
const flow = trackFlow('passport', flowName);
|
|
25381
|
+
const withMetrics = (fn, flowName, trackStartEvent = true, trackEndEvent = true) => {
|
|
25382
|
+
const flow = trackFlow('passport', flowName, trackStartEvent);
|
|
25380
25383
|
try {
|
|
25381
25384
|
return fn(flow);
|
|
25382
25385
|
}
|
|
25383
25386
|
catch (error) {
|
|
25384
25387
|
if (error instanceof Error) {
|
|
25385
|
-
trackError$1('passport', flowName, error);
|
|
25388
|
+
trackError$1('passport', flowName, error, { flowId: flow.details.flowId });
|
|
25389
|
+
}
|
|
25390
|
+
else {
|
|
25391
|
+
flow.addEvent('errored');
|
|
25386
25392
|
}
|
|
25387
|
-
flow.addEvent('errored');
|
|
25388
25393
|
throw error;
|
|
25389
25394
|
}
|
|
25390
25395
|
finally {
|
|
25391
|
-
|
|
25396
|
+
if (trackEndEvent) {
|
|
25397
|
+
flow.addEvent('End');
|
|
25398
|
+
}
|
|
25392
25399
|
}
|
|
25393
25400
|
};
|
|
25394
|
-
const withMetricsAsync = async (fn, flowName) => {
|
|
25395
|
-
const flow = trackFlow('passport', flowName);
|
|
25401
|
+
const withMetricsAsync = async (fn, flowName, trackStartEvent = true, trackEndEvent = true) => {
|
|
25402
|
+
const flow = trackFlow('passport', flowName, trackStartEvent);
|
|
25396
25403
|
try {
|
|
25397
25404
|
return await fn(flow);
|
|
25398
25405
|
}
|
|
25399
25406
|
catch (error) {
|
|
25400
25407
|
if (error instanceof Error) {
|
|
25401
|
-
trackError$1('passport', flowName, error);
|
|
25408
|
+
trackError$1('passport', flowName, error, { flowId: flow.details.flowId });
|
|
25409
|
+
}
|
|
25410
|
+
else {
|
|
25411
|
+
flow.addEvent('errored');
|
|
25402
25412
|
}
|
|
25403
|
-
flow.addEvent('errored');
|
|
25404
25413
|
throw error;
|
|
25405
25414
|
}
|
|
25406
25415
|
finally {
|
|
25407
|
-
|
|
25416
|
+
if (trackEndEvent) {
|
|
25417
|
+
flow.addEvent('End');
|
|
25418
|
+
}
|
|
25408
25419
|
}
|
|
25409
25420
|
};
|
|
25410
25421
|
|
|
25411
25422
|
const MAINNET = 'mainnet';
|
|
25412
25423
|
class MagicAdapter {
|
|
25413
25424
|
config;
|
|
25425
|
+
magicProviderProxyFactory;
|
|
25414
25426
|
lazyMagicClient;
|
|
25415
|
-
constructor(config) {
|
|
25427
|
+
constructor(config, magicProviderProxyFactory) {
|
|
25416
25428
|
this.config = config;
|
|
25429
|
+
this.magicProviderProxyFactory = magicProviderProxyFactory;
|
|
25417
25430
|
if (typeof window !== 'undefined') {
|
|
25418
25431
|
this.lazyMagicClient = lazyDocumentReady(() => {
|
|
25419
25432
|
const client = new magicSdk.Magic(this.config.magicPublishableApiKey, {
|
|
@@ -25441,7 +25454,7 @@ class MagicAdapter {
|
|
|
25441
25454
|
});
|
|
25442
25455
|
flow.addEvent('endLoginWithOIDC');
|
|
25443
25456
|
trackDuration('passport', flow.details.flowName, Math.round(performance.now() - startTime));
|
|
25444
|
-
return magicClient
|
|
25457
|
+
return this.magicProviderProxyFactory.createProxy(magicClient);
|
|
25445
25458
|
}, 'magicLogin')), PassportErrorType.WALLET_CONNECTION_ERROR);
|
|
25446
25459
|
}
|
|
25447
25460
|
async logout() {
|
|
@@ -26617,7 +26630,6 @@ class RelayerClient {
|
|
|
26617
26630
|
...request,
|
|
26618
26631
|
};
|
|
26619
26632
|
const user = await this.authManager.getUserZkEvm();
|
|
26620
|
-
const startTime = performance.now();
|
|
26621
26633
|
const response = await fetch(`${this.config.relayerUrl}/v1/transactions`, {
|
|
26622
26634
|
method: 'POST',
|
|
26623
26635
|
headers: {
|
|
@@ -26626,7 +26638,6 @@ class RelayerClient {
|
|
|
26626
26638
|
},
|
|
26627
26639
|
body: JSON.stringify(body),
|
|
26628
26640
|
});
|
|
26629
|
-
trackDuration('passport', 'postToRelayer', Math.round(performance.now() - startTime), { rpcMethod: request.method });
|
|
26630
26641
|
const jsonResponse = await response.json();
|
|
26631
26642
|
if (jsonResponse.error) {
|
|
26632
26643
|
throw jsonResponse.error;
|
|
@@ -27361,7 +27372,6 @@ const trackSessionActivityFn = async (args) => {
|
|
|
27361
27372
|
}
|
|
27362
27373
|
// If there is already a tracking call in progress, do nothing
|
|
27363
27374
|
if (currentSessionTrackCall[clientId]) {
|
|
27364
|
-
flow.addEvent('Existing Delay Early Exit');
|
|
27365
27375
|
return;
|
|
27366
27376
|
}
|
|
27367
27377
|
currentSessionTrackCall[clientId] = true;
|
|
@@ -27383,7 +27393,6 @@ const trackSessionActivityFn = async (args) => {
|
|
|
27383
27393
|
let details;
|
|
27384
27394
|
// Make the API call
|
|
27385
27395
|
try {
|
|
27386
|
-
flow.addEvent('Fetching details');
|
|
27387
27396
|
details = await get({
|
|
27388
27397
|
clientId,
|
|
27389
27398
|
wallet: from,
|
|
@@ -27391,9 +27400,7 @@ const trackSessionActivityFn = async (args) => {
|
|
|
27391
27400
|
sendCount: sendCount[clientId] || 0,
|
|
27392
27401
|
});
|
|
27393
27402
|
checkCount[clientId]++;
|
|
27394
|
-
flow.addEvent('Fetched details', { checkCount: checkCount[clientId] });
|
|
27395
27403
|
if (!details) {
|
|
27396
|
-
flow.addEvent('No details found');
|
|
27397
27404
|
return;
|
|
27398
27405
|
}
|
|
27399
27406
|
}
|
|
@@ -27415,7 +27422,7 @@ const trackSessionActivityFn = async (args) => {
|
|
|
27415
27422
|
catch (error) {
|
|
27416
27423
|
flow.addEvent('Failed to send Transaction');
|
|
27417
27424
|
const err = new Error('Failed to send transaction', { cause: error });
|
|
27418
|
-
trackError$1('passport', 'sessionActivityError', err);
|
|
27425
|
+
trackError$1('passport', 'sessionActivityError', err, { flowId: flow.details.flowId });
|
|
27419
27426
|
}
|
|
27420
27427
|
}
|
|
27421
27428
|
// if delay, perform delay.
|
|
@@ -27674,9 +27681,11 @@ class ZkEvmProvider {
|
|
|
27674
27681
|
}
|
|
27675
27682
|
catch (error) {
|
|
27676
27683
|
if (error instanceof Error) {
|
|
27677
|
-
trackError$1('passport', 'ethRequestAccounts', error);
|
|
27684
|
+
trackError$1('passport', 'ethRequestAccounts', error, { flowId: flow.details.flowId });
|
|
27685
|
+
}
|
|
27686
|
+
else {
|
|
27687
|
+
flow.addEvent('errored');
|
|
27678
27688
|
}
|
|
27679
|
-
flow.addEvent('errored');
|
|
27680
27689
|
throw error;
|
|
27681
27690
|
}
|
|
27682
27691
|
finally {
|
|
@@ -27709,9 +27718,11 @@ class ZkEvmProvider {
|
|
|
27709
27718
|
}
|
|
27710
27719
|
catch (error) {
|
|
27711
27720
|
if (error instanceof Error) {
|
|
27712
|
-
trackError$1('passport', 'eth_sendTransaction', error);
|
|
27721
|
+
trackError$1('passport', 'eth_sendTransaction', error, { flowId: flow.details.flowId });
|
|
27722
|
+
}
|
|
27723
|
+
else {
|
|
27724
|
+
flow.addEvent('errored');
|
|
27713
27725
|
}
|
|
27714
|
-
flow.addEvent('errored');
|
|
27715
27726
|
throw error;
|
|
27716
27727
|
}
|
|
27717
27728
|
finally {
|
|
@@ -27765,9 +27776,11 @@ class ZkEvmProvider {
|
|
|
27765
27776
|
}
|
|
27766
27777
|
catch (error) {
|
|
27767
27778
|
if (error instanceof Error) {
|
|
27768
|
-
trackError$1('passport', 'personal_sign', error);
|
|
27779
|
+
trackError$1('passport', 'personal_sign', error, { flowId: flow.details.flowId });
|
|
27780
|
+
}
|
|
27781
|
+
else {
|
|
27782
|
+
flow.addEvent('errored');
|
|
27769
27783
|
}
|
|
27770
|
-
flow.addEvent('errored');
|
|
27771
27784
|
throw error;
|
|
27772
27785
|
}
|
|
27773
27786
|
finally {
|
|
@@ -27801,9 +27814,11 @@ class ZkEvmProvider {
|
|
|
27801
27814
|
}
|
|
27802
27815
|
catch (error) {
|
|
27803
27816
|
if (error instanceof Error) {
|
|
27804
|
-
trackError$1('passport', 'eth_signTypedData', error);
|
|
27817
|
+
trackError$1('passport', 'eth_signTypedData', error, { flowId: flow.details.flowId });
|
|
27818
|
+
}
|
|
27819
|
+
else {
|
|
27820
|
+
flow.addEvent('errored');
|
|
27805
27821
|
}
|
|
27806
|
-
flow.addEvent('errored');
|
|
27807
27822
|
throw error;
|
|
27808
27823
|
}
|
|
27809
27824
|
finally {
|
|
@@ -27872,9 +27887,11 @@ class ZkEvmProvider {
|
|
|
27872
27887
|
}
|
|
27873
27888
|
catch (error) {
|
|
27874
27889
|
if (error instanceof Error) {
|
|
27875
|
-
trackError$1('passport', 'imSignEjectionTransaction', error);
|
|
27890
|
+
trackError$1('passport', 'imSignEjectionTransaction', error, { flowId: flow.details.flowId });
|
|
27891
|
+
}
|
|
27892
|
+
else {
|
|
27893
|
+
flow.addEvent('errored');
|
|
27876
27894
|
}
|
|
27877
|
-
flow.addEvent('errored');
|
|
27878
27895
|
throw error;
|
|
27879
27896
|
}
|
|
27880
27897
|
finally {
|
|
@@ -28012,6 +28029,63 @@ function announceProvider(detail) {
|
|
|
28012
28029
|
window.addEventListener('eip6963:requestProvider', handler);
|
|
28013
28030
|
}
|
|
28014
28031
|
|
|
28032
|
+
const shouldCheckMagicSession = (args) => (args?.length > 0
|
|
28033
|
+
&& typeof args[0] === 'object'
|
|
28034
|
+
&& 'method' in args[0]
|
|
28035
|
+
&& typeof args[0].method === 'string'
|
|
28036
|
+
&& ['personal_sign', 'eth_accounts'].includes(args[0].method));
|
|
28037
|
+
/**
|
|
28038
|
+
* Factory class for creating a Magic provider that automatically handles re-authentication.
|
|
28039
|
+
* This proxy wraps the Magic RPC provider to intercept certain RPC methods (`personal_sign`, `eth_accounts`)
|
|
28040
|
+
* and ensures the user is properly authenticated before executing them.
|
|
28041
|
+
*/
|
|
28042
|
+
class MagicProviderProxyFactory {
|
|
28043
|
+
authManager;
|
|
28044
|
+
config;
|
|
28045
|
+
constructor(authManager, config) {
|
|
28046
|
+
this.authManager = authManager;
|
|
28047
|
+
this.config = config;
|
|
28048
|
+
}
|
|
28049
|
+
createProxy(magicClient) {
|
|
28050
|
+
const magicRpcProvider = magicClient.rpcProvider;
|
|
28051
|
+
const proxyHandler = {
|
|
28052
|
+
get: (target, property, receiver) => {
|
|
28053
|
+
if (property === 'request') {
|
|
28054
|
+
return async (...args) => {
|
|
28055
|
+
try {
|
|
28056
|
+
if (shouldCheckMagicSession(args)) {
|
|
28057
|
+
const isUserLoggedIn = await magicClient.user.isLoggedIn();
|
|
28058
|
+
if (!isUserLoggedIn) {
|
|
28059
|
+
const user = await this.authManager.getUser();
|
|
28060
|
+
const idToken = user?.idToken;
|
|
28061
|
+
if (!idToken) {
|
|
28062
|
+
throw new Error('failed to obtain ID token');
|
|
28063
|
+
}
|
|
28064
|
+
await magicClient.openid.loginWithOIDC({
|
|
28065
|
+
jwt: idToken,
|
|
28066
|
+
providerId: this.config.magicProviderId,
|
|
28067
|
+
});
|
|
28068
|
+
}
|
|
28069
|
+
}
|
|
28070
|
+
// @ts-ignore - Invoke the request method with the provided arguments
|
|
28071
|
+
return target.request(...args);
|
|
28072
|
+
}
|
|
28073
|
+
catch (error) {
|
|
28074
|
+
if (error instanceof Error) {
|
|
28075
|
+
throw new Error(`ProviderProxy: ${error.message}`);
|
|
28076
|
+
}
|
|
28077
|
+
throw new Error(`ProviderProxy: ${error}`);
|
|
28078
|
+
}
|
|
28079
|
+
};
|
|
28080
|
+
}
|
|
28081
|
+
// Return the property from the target
|
|
28082
|
+
return Reflect.get(target, property, receiver);
|
|
28083
|
+
},
|
|
28084
|
+
};
|
|
28085
|
+
return new Proxy(magicRpcProvider, proxyHandler);
|
|
28086
|
+
}
|
|
28087
|
+
}
|
|
28088
|
+
|
|
28015
28089
|
const buildImxClientConfig = (passportModuleConfiguration) => {
|
|
28016
28090
|
if (passportModuleConfiguration.overrides) {
|
|
28017
28091
|
return createConfig$1({ basePath: passportModuleConfiguration.overrides.imxPublicApiDomain });
|
|
@@ -28030,7 +28104,8 @@ const buildImxApiClients = (passportModuleConfiguration) => {
|
|
|
28030
28104
|
const buildPrivateVars = (passportModuleConfiguration) => {
|
|
28031
28105
|
const config = new PassportConfiguration(passportModuleConfiguration);
|
|
28032
28106
|
const authManager = new AuthManager(config);
|
|
28033
|
-
const
|
|
28107
|
+
const magicProviderProxyFactory = new MagicProviderProxyFactory(authManager, config);
|
|
28108
|
+
const magicAdapter = new MagicAdapter(config, magicProviderProxyFactory);
|
|
28034
28109
|
const confirmationScreen = new ConfirmationScreen(config);
|
|
28035
28110
|
const multiRollupApiClients = new MultiRollupApiClients(config.multiRollupConfig);
|
|
28036
28111
|
const passportEventEmitter = new TypedEventEmitter();
|
|
@@ -28093,10 +28168,10 @@ class Passport {
|
|
|
28093
28168
|
* `connectImx` instead.
|
|
28094
28169
|
*/
|
|
28095
28170
|
async connectImxSilent() {
|
|
28096
|
-
return withMetricsAsync(() => this.passportImxProviderFactory.getProviderSilent(), 'connectImxSilent');
|
|
28171
|
+
return withMetricsAsync(() => this.passportImxProviderFactory.getProviderSilent(), 'connectImxSilent', false);
|
|
28097
28172
|
}
|
|
28098
28173
|
async connectImx() {
|
|
28099
|
-
return withMetricsAsync(() => this.passportImxProviderFactory.getProvider(), 'connectImx');
|
|
28174
|
+
return withMetricsAsync(() => this.passportImxProviderFactory.getProvider(), 'connectImx', false);
|
|
28100
28175
|
}
|
|
28101
28176
|
connectEvm(options = {
|
|
28102
28177
|
announceProvider: true,
|
|
@@ -28117,7 +28192,7 @@ class Passport {
|
|
|
28117
28192
|
});
|
|
28118
28193
|
}
|
|
28119
28194
|
return provider;
|
|
28120
|
-
}, 'connectEvm');
|
|
28195
|
+
}, 'connectEvm', false);
|
|
28121
28196
|
}
|
|
28122
28197
|
/**
|
|
28123
28198
|
*
|
|
@@ -28224,19 +28299,19 @@ class Passport {
|
|
|
28224
28299
|
return withMetricsAsync(async () => {
|
|
28225
28300
|
const user = await this.authManager.getUser();
|
|
28226
28301
|
return user?.profile;
|
|
28227
|
-
}, 'getUserInfo');
|
|
28302
|
+
}, 'getUserInfo', false);
|
|
28228
28303
|
}
|
|
28229
28304
|
async getIdToken() {
|
|
28230
28305
|
return withMetricsAsync(async () => {
|
|
28231
28306
|
const user = await this.authManager.getUser();
|
|
28232
28307
|
return user?.idToken;
|
|
28233
|
-
}, 'getIdToken');
|
|
28308
|
+
}, 'getIdToken', false);
|
|
28234
28309
|
}
|
|
28235
28310
|
async getAccessToken() {
|
|
28236
28311
|
return withMetricsAsync(async () => {
|
|
28237
28312
|
const user = await this.authManager.getUser();
|
|
28238
28313
|
return user?.accessToken;
|
|
28239
|
-
}, 'getAccessToken');
|
|
28314
|
+
}, 'getAccessToken', false, false);
|
|
28240
28315
|
}
|
|
28241
28316
|
async getLinkedAddresses() {
|
|
28242
28317
|
return withMetricsAsync(async () => {
|
|
@@ -28247,10 +28322,10 @@ class Passport {
|
|
|
28247
28322
|
const headers = { Authorization: `Bearer ${user.accessToken}` };
|
|
28248
28323
|
const getUserInfoResult = await this.multiRollupApiClients.passportProfileApi.getUserInfo({ headers });
|
|
28249
28324
|
return getUserInfoResult.data.linked_addresses;
|
|
28250
|
-
}, 'getLinkedAddresses');
|
|
28325
|
+
}, 'getLinkedAddresses', false);
|
|
28251
28326
|
}
|
|
28252
28327
|
async linkExternalWallet(params) {
|
|
28253
|
-
const flow = trackFlow('passport', 'linkExternalWallet');
|
|
28328
|
+
const flow = trackFlow('passport', 'linkExternalWallet', false);
|
|
28254
28329
|
const user = await this.authManager.getUser();
|
|
28255
28330
|
if (!user) {
|
|
28256
28331
|
throw new PassportError('User is not logged in', PassportErrorType.NOT_LOGGED_IN_ERROR);
|
|
@@ -28276,7 +28351,9 @@ class Passport {
|
|
|
28276
28351
|
if (error instanceof Error) {
|
|
28277
28352
|
trackError$1('passport', 'linkExternalWallet', error);
|
|
28278
28353
|
}
|
|
28279
|
-
|
|
28354
|
+
else {
|
|
28355
|
+
flow.addEvent('errored');
|
|
28356
|
+
}
|
|
28280
28357
|
if (globalAxios.isAxiosError(error) && error.response) {
|
|
28281
28358
|
if (error.response.data && isAPIError(error.response.data)) {
|
|
28282
28359
|
const { code, message } = error.response.data;
|
|
@@ -50522,7 +50599,7 @@ const flattenProperties = (properties) => {
|
|
|
50522
50599
|
};
|
|
50523
50600
|
|
|
50524
50601
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
50525
|
-
const SDK_VERSION = '1.78.1';
|
|
50602
|
+
const SDK_VERSION = '1.78.2-alpha.1';
|
|
50526
50603
|
const getFrameParentDomain = () => {
|
|
50527
50604
|
if (isNode()) {
|
|
50528
50605
|
return '';
|
|
@@ -55643,7 +55720,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
55643
55720
|
maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
|
|
55644
55721
|
};
|
|
55645
55722
|
|
|
55646
|
-
const SDK_VERSION_MARKER = '1.78.1';
|
|
55723
|
+
const SDK_VERSION_MARKER = '1.78.2-alpha.1';
|
|
55647
55724
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
55648
55725
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
55649
55726
|
|
|
@@ -60385,7 +60462,6 @@ class Checkout {
|
|
|
60385
60462
|
this.passport = config.passport;
|
|
60386
60463
|
// Initialise injected providers via EIP-6963
|
|
60387
60464
|
InjectedProvidersManager.getInstance().initialise();
|
|
60388
|
-
track('checkout_sdk', 'initialised');
|
|
60389
60465
|
}
|
|
60390
60466
|
/**
|
|
60391
60467
|
* Loads the widgets bundle and initiate the widgets factory.
|
|
@@ -60399,11 +60475,6 @@ class Checkout {
|
|
|
60399
60475
|
const validatedBuildVersion = validateAndBuildVersion(init.version);
|
|
60400
60476
|
const initVersionProvided = init.version !== undefined;
|
|
60401
60477
|
const widgetsVersion = await determineWidgetsVersion(validatedBuildVersion, initVersionProvided, versionConfig);
|
|
60402
|
-
track('checkout_sdk', 'widgets', {
|
|
60403
|
-
sdkVersion: globalPackageVersion(),
|
|
60404
|
-
validatedSdkVersion: validatedBuildVersion,
|
|
60405
|
-
widgetsVersion,
|
|
60406
|
-
});
|
|
60407
60478
|
try {
|
|
60408
60479
|
const factory = await this.loadEsModules(init.config, widgetsVersion);
|
|
60409
60480
|
return factory;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { c as config } from './config-
|
|
2
|
-
export { b as blockchainData } from './blockchain_data-
|
|
3
|
-
export { p as passport } from './passport-
|
|
4
|
-
export { o as orderbook } from './orderbook-
|
|
5
|
-
export { c as checkout } from './checkout-
|
|
6
|
-
export { x } from './x-
|
|
7
|
-
export { w as webhook } from './webhook-
|
|
8
|
-
export { m as mintingBackend } from './minting_backend-
|
|
9
|
-
import './index-
|
|
1
|
+
export { c as config } from './config-CoKnE2K3.js';
|
|
2
|
+
export { b as blockchainData } from './blockchain_data-QI7kewKD.js';
|
|
3
|
+
export { p as passport } from './passport-CoyF1bR_.js';
|
|
4
|
+
export { o as orderbook } from './orderbook-CLE5NCQf.js';
|
|
5
|
+
export { c as checkout } from './checkout-DUv7Lpgl.js';
|
|
6
|
+
export { x } from './x-B-aZ25Wf.js';
|
|
7
|
+
export { w as webhook } from './webhook-B-2ztLNv.js';
|
|
8
|
+
export { m as mintingBackend } from './minting_backend-8VSOpVwa.js';
|
|
9
|
+
import './index-TTaZqMOM.js';
|
|
10
10
|
import 'axios';
|
|
11
11
|
import 'lru-memorise';
|
|
12
12
|
import 'global-const';
|
|
13
|
-
import './index-
|
|
14
|
-
import './index-
|
|
15
|
-
import './index-
|
|
13
|
+
import './index-DRXK1WT6.js';
|
|
14
|
+
import './index-BUSedeWh.js';
|
|
15
|
+
import './index-DBt3LJ_R.js';
|
|
16
16
|
import '@ethersproject/keccak256';
|
|
17
17
|
import '@ethersproject/strings';
|
|
18
18
|
import 'bn.js';
|
|
@@ -35,7 +35,7 @@ import 'events';
|
|
|
35
35
|
import '@0xsequence/abi';
|
|
36
36
|
import '@0xsequence/core';
|
|
37
37
|
import 'uuid';
|
|
38
|
-
import './index-
|
|
38
|
+
import './index-DSQMBlTv.js';
|
|
39
39
|
import 'form-data';
|
|
40
40
|
import 'ethers-v6';
|
|
41
41
|
import 'merkletreejs';
|
|
@@ -48,5 +48,5 @@ import '@metamask/detect-provider';
|
|
|
48
48
|
import 'semver';
|
|
49
49
|
import '@ethersproject/units';
|
|
50
50
|
import '@ethersproject/bignumber';
|
|
51
|
-
import './index-
|
|
51
|
+
import './index-J9VWkapC.js';
|
|
52
52
|
import 'sns-validator';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BlockchainData } from './index-
|
|
2
|
-
import { h as handle } from './index-
|
|
3
|
-
import { t as track, e as setEnvironment, f as setPublishableApiKey } from './index-
|
|
1
|
+
import { B as BlockchainData } from './index-DRXK1WT6.js';
|
|
2
|
+
import { h as handle } from './index-J9VWkapC.js';
|
|
3
|
+
import { t as track, e as setEnvironment, f as setPublishableApiKey } from './index-TTaZqMOM.js';
|
|
4
4
|
|
|
5
5
|
const moduleName = 'minting_backend_sdk';
|
|
6
6
|
const trackInitializePersistencePG = () => {
|
package/dist/minting_backend.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { M as MintingBackendModule, a as mintingPersistencePg, b as mintingPersistencePrismaSqlite, p as processMint, r as recordMint, s as submitMintingRequests } from './minting_backend-
|
|
2
|
-
import './index-
|
|
3
|
-
import './index-
|
|
1
|
+
export { M as MintingBackendModule, a as mintingPersistencePg, b as mintingPersistencePrismaSqlite, p as processMint, r as recordMint, s as submitMintingRequests } from './minting_backend-8VSOpVwa.js';
|
|
2
|
+
import './index-DRXK1WT6.js';
|
|
3
|
+
import './index-BUSedeWh.js';
|
|
4
4
|
import 'axios';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-TTaZqMOM.js';
|
|
6
6
|
import 'lru-memorise';
|
|
7
7
|
import 'global-const';
|
|
8
|
-
import './index-
|
|
8
|
+
import './index-J9VWkapC.js';
|
|
9
9
|
import 'sns-validator';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-
|
|
1
|
+
import { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-DSQMBlTv.js';
|
|
2
2
|
|
|
3
3
|
var orderbook = /*#__PURE__*/Object.freeze({
|
|
4
4
|
__proto__: null,
|
package/dist/orderbook.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-
|
|
2
|
-
import './index-
|
|
1
|
+
export { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-DSQMBlTv.js';
|
|
2
|
+
import './index-TTaZqMOM.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import 'lru-memorise';
|
|
5
5
|
import 'global-const';
|