@imtbl/sdk 1.43.5 → 1.43.6
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-b707cdfe.js +1 -0
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/{checkout-835624fb.js → checkout-2b3fb1c2.js} +2 -2
- package/dist/{checkout.d-ae9ca847.d.ts → checkout.d-7613e722.d.ts} +5 -0
- package/dist/checkout.d.ts +1 -1
- package/dist/checkout.js +1 -1
- package/dist/{config-e6decb95.js → config-85c79b7b.js} +1 -1
- package/dist/config.js +1 -1
- package/dist/{index-cfadae12.js → index-1465defe.js} +1 -1
- package/dist/{index-974c422d.js → index-3379fae3.js} +1 -1
- package/dist/{index-7d2761cb.js → index-79a47cb5.js} +1 -1
- package/dist/{index-3c4d20df.js → index-8891a569.js} +1 -1
- package/dist/{index-d7b7aff9.js → index-c6873334.js} +1 -1
- package/dist/{index-1ff17202.js → index-db991a0e.js} +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +12 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{minting_backend-10ddbfd1.js → minting_backend-e41ac518.js} +1 -1
- package/dist/minting_backend.js +1 -1
- package/dist/{orderbook-10fe79b7.js → orderbook-0f158b43.js} +1 -1
- package/dist/orderbook.js +1 -1
- package/dist/{passport-e96a6719.js → passport-5ce49992.js} +1 -1
- package/dist/passport.js +1 -1
- package/dist/webhook-acd3b92c.js +1 -0
- package/dist/webhook.js +1 -1
- package/dist/{x-7dcaea97.js → x-95ef888b.js} +1 -1
- package/dist/x.js +1 -1
- package/package.json +1 -1
- package/dist/blockchain_data-08e66ad1.js +0 -1
- package/dist/webhook-8b165b7a.js +0 -1
|
@@ -2756,6 +2756,8 @@ declare class Checkout {
|
|
|
2756
2756
|
/**
|
|
2757
2757
|
* Determines the requirements for performing a buy.
|
|
2758
2758
|
* @param {BuyParams} params - The parameters for the buy.
|
|
2759
|
+
* @deprecated Please use orderbook.fulfillOrder or orderbook.fulfillBulkOrders instead. The smartCheckout
|
|
2760
|
+
* method can still be used to ensure the transaction requirements are met before preparing the order fulfillment
|
|
2759
2761
|
*/
|
|
2760
2762
|
buy(params: BuyParams): Promise<BuyResult>;
|
|
2761
2763
|
/**
|
|
@@ -2763,11 +2765,14 @@ declare class Checkout {
|
|
|
2763
2765
|
* @param {SellParams} params - The parameters for the sell.
|
|
2764
2766
|
* Only currently actions the first order in the array until we support batch processing.
|
|
2765
2767
|
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
2768
|
+
* @deprecated Please use orderbook.prepareListing or orderbook.prepareBulkListing instead. The smartCheckout
|
|
2769
|
+
* method can still be used to ensure the transaction requirements are met before preparing the listing
|
|
2766
2770
|
*/
|
|
2767
2771
|
sell(params: SellParams): Promise<SellResult>;
|
|
2768
2772
|
/**
|
|
2769
2773
|
* Cancels a sell.
|
|
2770
2774
|
* @param {CancelParams} params - The parameters for the cancel.
|
|
2775
|
+
* @deprecated Please use orderbook.prepareOrderCancellations instead.
|
|
2771
2776
|
*/
|
|
2772
2777
|
cancel(params: CancelParams): Promise<CancelResult>;
|
|
2773
2778
|
/**
|
package/dist/checkout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AllowedNetworkConfig, q as AvailableRoutingOptions, B as BalanceDelta, ba as BlockExplorerService, bC as BridgeClaimWithdrawalFailed, bB as BridgeClaimWithdrawalSuccess, by as BridgeEventType, bA as BridgeFailed, r as BridgeFundingStep, bz as BridgeTransactionSent, c7 as BridgeWidgetConfiguration, c0 as BridgeWidgetParams, s as BuyOrder, u as BuyOverrides, t as BuyParams, w as BuyResult, x as BuyResultFailed, D as BuyResultFulfillmentsUnsettled, y as BuyResultInsufficientFunds, z as BuyResultSuccess, H as BuyToken, K as CancelOverrides, J as CancelParams, L as CancelResult, M as CancelResultFailed, Q as CancelResultFulfillmentsUnsettled, O as CancelResultGasless, P as CancelResultSuccess, b as ChainId, d as ChainName, e as ChainSlug, S as CheckConnectionParams, U as CheckConnectionResult, C as Checkout, Y as CheckoutBridgeConfiguration, b9 as CheckoutConfiguration, b8 as CheckoutErrorType, V as CheckoutModuleConfiguration, X as CheckoutOnRampConfiguration, f as CheckoutStatus, Z as CheckoutSwapConfiguration, bZ as CheckoutWidgetsConfig, bf as ConnectEventType, _ as ConnectParams, $ as ConnectResult, b_ as ConnectTargetLayer, c6 as ConnectWidgetConfiguration, b$ as ConnectWidgetParams, bh as ConnectionFailed, bg as ConnectionSuccess, a0 as CreateProviderParams, a1 as CreateProviderResult, a2 as DexConfig, E as EIP1193Provider, i as EIP6963ProviderDetail, h as EIP6963ProviderInfo, a3 as ERC20ItemRequirement, a4 as ERC721Balance, a5 as ERC721ItemRequirement, b7 as ErrorType, j as ExchangeType, a6 as FailedGaslessCancellation, a7 as Fee, a8 as FeePercentage, a9 as FeeToken, F as FeeType, aa as FiatRampParams, ab as FulfillmentTransaction, ac as FundingItem, ad as FundingRoute, ae as FundingStep, k as FundingStepType, af as GasAmount, ag as GasEstimateBridgeToL2Result, ah as GasEstimateParams, ai as GasEstimateSwapResult, aj as GasEstimateTokenConfig, G as GasEstimateType, ak as GasToken, l as GasTokenType, al as GetAllBalancesParams, am as GetAllBalancesResult, an as GetBalanceParams, ao as GetBalanceResult, ap as GetNetworkAllowListParams, aq as GetNetworkAllowListResult, ar as GetNetworkParams, at as GetTokenAllowListParams, au as GetTokenAllowListResult, as as GetTokenInfoParams, av as GetWalletAllowListParams, aw as GetWalletAllowListResult, I as IMMUTABLE_API_BASE_URL, bb as IMTBLWidgetEvents, bW as IWidgetsFactory, ax as ItemBalance, m as ItemType, be as LanguageChanged, ay as NativeItemRequirement, az as NetworkFilter, N as NetworkFilterTypes, aA as NetworkInfo, aB as NoRouteOptions, aC as NoRoutesFound, bK as OnRampEventType, bM as OnRampFailed, aD as OnRampFundingStep, aF as OnRampProviderFees, bL as OnRampSuccess, c3 as OnRampWidgetParams, ca as OnrampWidgetConfiguration, bU as OrchestrationEvent, bJ as OrchestrationEventData, bD as OrchestrationEventType, aE as OrderFee, aG as PendingGaslessCancellation, bV as ProviderEvent, bc as ProviderEventType, bd as ProviderUpdated, aH as RemoteConfiguration, bH as RequestBridgeEvent, bE as RequestConnectEvent, bI as RequestOnrampEvent, bG as RequestSwapEvent, bF as RequestWalletEvent, aI as RoutesFound, aJ as RoutingOutcome, R as RoutingOutcomeType, br as SaleEventType, bt as SaleFailed, c5 as SaleItem, bv as SalePaymentMethod, bw as SalePaymentToken, bx as SalePaymentTypes, bs as SaleSuccess, bu as SaleTransactionSuccess, cb as SaleWidgetConfiguration, c4 as SaleWidgetParams, aK as SellOrder, aL as SellParams, aM as SellResult, aN as SellResultFailed, aO as SellResultInsufficientFunds, aP as SellResultSuccess, aQ as SellToken, bY as SemanticVersion, aR as SendTransactionParams, aS as SendTransactionResult, aT as SmartCheckoutInsufficient, aU as SmartCheckoutParams, aV as SmartCheckoutResult, aW as SmartCheckoutRouter, aX as SmartCheckoutSufficient, aY as SuccessfulGaslessCancellation, bn as SwapEventType, bp as SwapFailed, aZ as SwapFundingStep, bq as SwapRejected, bo as SwapSuccess, c9 as SwapWidgetConfiguration, c2 as SwapWidgetParams, a_ as SwitchNetworkParams, a$ as SwitchNetworkResult, b0 as TokenAmountEstimate, b1 as TokenBalance, b2 as TokenFilter, T as TokenFilterTypes, b3 as TokenInfo, n as TransactionOrGasType, b4 as TransactionRequirement, cf as WalletConnectConfig, bj as WalletConnectManager, bi as WalletConnectProviderChanged, bm as WalletDisconnect, bk as WalletEventType, b5 as WalletFilter, W as WalletFilterTypes, b6 as WalletInfo, bl as WalletNetworkSwitch, o as WalletProviderName, p as WalletProviderRdns, c8 as WalletWidgetConfiguration, c1 as WalletWidgetParams, bX as Widget, cd as WidgetConfiguration, bP as WidgetConfigurations, bT as WidgetEvent, bS as WidgetEventData, bR as WidgetEventTypes, ce as WidgetLanguage, bQ as WidgetParameters, bO as WidgetProperties, cc as WidgetTheme, bN as WidgetType, a as getMetaMaskProviderDetail, g as getPassportProviderDetail, v as validateProvider } from './checkout.d-
|
|
1
|
+
export { A as AllowedNetworkConfig, q as AvailableRoutingOptions, B as BalanceDelta, ba as BlockExplorerService, bC as BridgeClaimWithdrawalFailed, bB as BridgeClaimWithdrawalSuccess, by as BridgeEventType, bA as BridgeFailed, r as BridgeFundingStep, bz as BridgeTransactionSent, c7 as BridgeWidgetConfiguration, c0 as BridgeWidgetParams, s as BuyOrder, u as BuyOverrides, t as BuyParams, w as BuyResult, x as BuyResultFailed, D as BuyResultFulfillmentsUnsettled, y as BuyResultInsufficientFunds, z as BuyResultSuccess, H as BuyToken, K as CancelOverrides, J as CancelParams, L as CancelResult, M as CancelResultFailed, Q as CancelResultFulfillmentsUnsettled, O as CancelResultGasless, P as CancelResultSuccess, b as ChainId, d as ChainName, e as ChainSlug, S as CheckConnectionParams, U as CheckConnectionResult, C as Checkout, Y as CheckoutBridgeConfiguration, b9 as CheckoutConfiguration, b8 as CheckoutErrorType, V as CheckoutModuleConfiguration, X as CheckoutOnRampConfiguration, f as CheckoutStatus, Z as CheckoutSwapConfiguration, bZ as CheckoutWidgetsConfig, bf as ConnectEventType, _ as ConnectParams, $ as ConnectResult, b_ as ConnectTargetLayer, c6 as ConnectWidgetConfiguration, b$ as ConnectWidgetParams, bh as ConnectionFailed, bg as ConnectionSuccess, a0 as CreateProviderParams, a1 as CreateProviderResult, a2 as DexConfig, E as EIP1193Provider, i as EIP6963ProviderDetail, h as EIP6963ProviderInfo, a3 as ERC20ItemRequirement, a4 as ERC721Balance, a5 as ERC721ItemRequirement, b7 as ErrorType, j as ExchangeType, a6 as FailedGaslessCancellation, a7 as Fee, a8 as FeePercentage, a9 as FeeToken, F as FeeType, aa as FiatRampParams, ab as FulfillmentTransaction, ac as FundingItem, ad as FundingRoute, ae as FundingStep, k as FundingStepType, af as GasAmount, ag as GasEstimateBridgeToL2Result, ah as GasEstimateParams, ai as GasEstimateSwapResult, aj as GasEstimateTokenConfig, G as GasEstimateType, ak as GasToken, l as GasTokenType, al as GetAllBalancesParams, am as GetAllBalancesResult, an as GetBalanceParams, ao as GetBalanceResult, ap as GetNetworkAllowListParams, aq as GetNetworkAllowListResult, ar as GetNetworkParams, at as GetTokenAllowListParams, au as GetTokenAllowListResult, as as GetTokenInfoParams, av as GetWalletAllowListParams, aw as GetWalletAllowListResult, I as IMMUTABLE_API_BASE_URL, bb as IMTBLWidgetEvents, bW as IWidgetsFactory, ax as ItemBalance, m as ItemType, be as LanguageChanged, ay as NativeItemRequirement, az as NetworkFilter, N as NetworkFilterTypes, aA as NetworkInfo, aB as NoRouteOptions, aC as NoRoutesFound, bK as OnRampEventType, bM as OnRampFailed, aD as OnRampFundingStep, aF as OnRampProviderFees, bL as OnRampSuccess, c3 as OnRampWidgetParams, ca as OnrampWidgetConfiguration, bU as OrchestrationEvent, bJ as OrchestrationEventData, bD as OrchestrationEventType, aE as OrderFee, aG as PendingGaslessCancellation, bV as ProviderEvent, bc as ProviderEventType, bd as ProviderUpdated, aH as RemoteConfiguration, bH as RequestBridgeEvent, bE as RequestConnectEvent, bI as RequestOnrampEvent, bG as RequestSwapEvent, bF as RequestWalletEvent, aI as RoutesFound, aJ as RoutingOutcome, R as RoutingOutcomeType, br as SaleEventType, bt as SaleFailed, c5 as SaleItem, bv as SalePaymentMethod, bw as SalePaymentToken, bx as SalePaymentTypes, bs as SaleSuccess, bu as SaleTransactionSuccess, cb as SaleWidgetConfiguration, c4 as SaleWidgetParams, aK as SellOrder, aL as SellParams, aM as SellResult, aN as SellResultFailed, aO as SellResultInsufficientFunds, aP as SellResultSuccess, aQ as SellToken, bY as SemanticVersion, aR as SendTransactionParams, aS as SendTransactionResult, aT as SmartCheckoutInsufficient, aU as SmartCheckoutParams, aV as SmartCheckoutResult, aW as SmartCheckoutRouter, aX as SmartCheckoutSufficient, aY as SuccessfulGaslessCancellation, bn as SwapEventType, bp as SwapFailed, aZ as SwapFundingStep, bq as SwapRejected, bo as SwapSuccess, c9 as SwapWidgetConfiguration, c2 as SwapWidgetParams, a_ as SwitchNetworkParams, a$ as SwitchNetworkResult, b0 as TokenAmountEstimate, b1 as TokenBalance, b2 as TokenFilter, T as TokenFilterTypes, b3 as TokenInfo, n as TransactionOrGasType, b4 as TransactionRequirement, cf as WalletConnectConfig, bj as WalletConnectManager, bi as WalletConnectProviderChanged, bm as WalletDisconnect, bk as WalletEventType, b5 as WalletFilter, W as WalletFilterTypes, b6 as WalletInfo, bl as WalletNetworkSwitch, o as WalletProviderName, p as WalletProviderRdns, c8 as WalletWidgetConfiguration, c1 as WalletWidgetParams, bX as Widget, cd as WidgetConfiguration, bP as WidgetConfigurations, bT as WidgetEvent, bS as WidgetEventData, bR as WidgetEventTypes, ce as WidgetLanguage, bQ as WidgetParameters, bO as WidgetProperties, cc as WidgetTheme, bN as WidgetType, a as getMetaMaskProviderDetail, g as getPassportProviderDetail, v as validateProvider } from './checkout.d-7613e722.js';
|
|
2
2
|
import './index.d-c4a4c17d.js';
|
|
3
3
|
import './json-rpc-provider.d-5c038bd9.js';
|
|
4
4
|
import './Passport.d-011d5035.js';
|
package/dist/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as BlockExplorerService,a as BridgeEventType,C as ChainId,b as ChainName,d as ChainSlug,e as Checkout,f as CheckoutConfiguration,g as CheckoutErrorType,h as CheckoutStatus,i as ConnectEventType,j as ConnectTargetLayer,E as ExchangeType,F as FeeType,k as FundingStepType,G as GasEstimateType,l as GasTokenType,I as IMMUTABLE_API_BASE_URL,m as IMTBLWidgetEvents,n as ItemType,N as NetworkFilterTypes,O as OnRampEventType,o as OrchestrationEventType,P as ProviderEventType,R as RoutingOutcomeType,S as SaleEventType,p as SalePaymentTypes,q as SwapEventType,T as TokenFilterTypes,r as TransactionOrGasType,W as WalletEventType,s as WalletFilterTypes,t as WalletProviderName,u as WalletProviderRdns,v as WidgetTheme,w as WidgetType,x as getMetaMaskProviderDetail,y as getPassportProviderDetail,z as validateProvider}from"./checkout-
|
|
1
|
+
export{B as BlockExplorerService,a as BridgeEventType,C as ChainId,b as ChainName,d as ChainSlug,e as Checkout,f as CheckoutConfiguration,g as CheckoutErrorType,h as CheckoutStatus,i as ConnectEventType,j as ConnectTargetLayer,E as ExchangeType,F as FeeType,k as FundingStepType,G as GasEstimateType,l as GasTokenType,I as IMMUTABLE_API_BASE_URL,m as IMTBLWidgetEvents,n as ItemType,N as NetworkFilterTypes,O as OnRampEventType,o as OrchestrationEventType,P as ProviderEventType,R as RoutingOutcomeType,S as SaleEventType,p as SalePaymentTypes,q as SwapEventType,T as TokenFilterTypes,r as TransactionOrGasType,W as WalletEventType,s as WalletFilterTypes,t as WalletProviderName,u as WalletProviderRdns,v as WidgetTheme,w as WidgetType,x as getMetaMaskProviderDetail,y as getPassportProviderDetail,z as validateProvider}from"./checkout-2b3fb1c2.js";import"./index-1465defe.js";import"axios";import"lru-memorise";import"global-const";import"ethers";import"@ethersproject/providers";import"@metamask/detect-provider";import"@uniswap/sdk-core";import"assert";import"@uniswap/v3-sdk";import"@ethersproject/solidity";import"@uniswap/router-sdk";import"./index-db991a0e.js";import"form-data";import"ethers-v6";import"merkletreejs";import"@opensea/seaport-js";import"./index-79a47cb5.js";import"./index-8891a569.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,I as r,K as a,a as t}from"./index-
|
|
1
|
+
import{E as e,I as r,K as a,a as t}from"./index-1465defe.js";var n=Object.freeze({__proto__:null,get Environment(){return e},ImmutableConfiguration:r,get KeyHeaders(){return a},addKeysToHeadersOverride:t});export{n as c};
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{E as Environment,I as ImmutableConfiguration,K as KeyHeaders,a as addKeysToHeadersOverride}from"./index-
|
|
1
|
+
export{E as Environment,I as ImmutableConfiguration,K as KeyHeaders,a as addKeysToHeadersOverride}from"./index-1465defe.js";import"axios";import"lru-memorise";import"global-const";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"axios";import{memorise as t}from"lru-memorise";import{getGlobalisedValue as n}from"global-const";const r=()=>"undefined"==typeof window,i=()=>!r();var o;!function(e){e.RUNTIME_ID="rid",e.PASSPORT_CLIENT_ID="passportClientId",e.ENVIRONMENT="env",e.PUBLISHABLE_API_KEY="pak",e.IDENTITY="uid",e.DOMAIN="domain",e.SDK_VERSION="sdkVersion"}(o||(o={}));async function s(t,n){const r=e.create({baseURL:"https://api.immutable.com"}),i=JSON.stringify(n),o={payload:Buffer.from(i).toString("base64")};return(await r.post(t,o)).data}const a=()=>i()&&window.localStorage,c=e=>`__IMX-${e}`;function d(e){if(a())return(e=>{if(null!==e)try{return JSON.parse(e)}catch(t){return e}})(window.localStorage.getItem(c(e)))}const l=(e,t)=>!!a()&&(window.localStorage.setItem(c(e),(e=>"string"==typeof e?e:JSON.stringify(e))(t)),!0);var u;let m,f;!function(e){e.EVENTS="events",e.RUNTIME="runtime"}(u||(u={}));m=d(u.EVENTS)||[],f=d(u.RUNTIME)||{};const p=(e,t)=>{f={...f,[e]:t},l(u.RUNTIME,f)},w=e=>{if(void 0!==f[e])return f[e]},I=e=>{const t=[];return Object.entries(e).forEach((([e,n])=>{"string"!=typeof e&&"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||t.push([e,n.toString()])})),t},E="1.43.
|
|
1
|
+
import e from"axios";import{memorise as t}from"lru-memorise";import{getGlobalisedValue as n}from"global-const";const r=()=>"undefined"==typeof window,i=()=>!r();var o;!function(e){e.RUNTIME_ID="rid",e.PASSPORT_CLIENT_ID="passportClientId",e.ENVIRONMENT="env",e.PUBLISHABLE_API_KEY="pak",e.IDENTITY="uid",e.DOMAIN="domain",e.SDK_VERSION="sdkVersion"}(o||(o={}));async function s(t,n){const r=e.create({baseURL:"https://api.immutable.com"}),i=JSON.stringify(n),o={payload:Buffer.from(i).toString("base64")};return(await r.post(t,o)).data}const a=()=>i()&&window.localStorage,c=e=>`__IMX-${e}`;function d(e){if(a())return(e=>{if(null!==e)try{return JSON.parse(e)}catch(t){return e}})(window.localStorage.getItem(c(e)))}const l=(e,t)=>!!a()&&(window.localStorage.setItem(c(e),(e=>"string"==typeof e?e:JSON.stringify(e))(t)),!0);var u;let m,f;!function(e){e.EVENTS="events",e.RUNTIME="runtime"}(u||(u={}));m=d(u.EVENTS)||[],f=d(u.RUNTIME)||{};const p=(e,t)=>{f={...f,[e]:t},l(u.RUNTIME,f)},w=e=>{if(void 0!==f[e])return f[e]},I=e=>{const t=[];return Object.entries(e).forEach((([e,n])=>{"string"!=typeof e&&"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||t.push([e,n.toString()])})),t},E="1.43.6",h=()=>{if(r())return"";let e;try{window.self!==window.top&&(e=r()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"")}catch(e){}return e||(e=window.location.hostname),e};let y=!1;const g=async()=>{y=!0;try{const e=I((()=>{if(p(o.SDK_VERSION,E),r())return{browser:"nodejs",sdkVersion:E};const e=h();return e&&p(o.DOMAIN,e),{sdkVersion:E,browser:window.navigator.userAgent,domain:e,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}})()),t={version:1,data:{runtimeDetails:e,runtimeId:w(o.RUNTIME_ID)}},n=await s("/v1/sdk/initialise",t),{runtimeId:i}=n;p(o.RUNTIME_ID,i)}catch(e){y=!1}};function b(e,t){return(...n)=>{try{const r=e(...n);return r instanceof Promise?r.catch((()=>t)):r}catch(e){return t}}}const S=b((function(){return!i()&&("undefined"!=typeof process&&void 0!==process.env.JEST_WORKER_ID)}),!1),N="imtbl__metrics",T=(e,t)=>n(N,e,t),K=b(((e,r)=>{const i=t(r,{lruOptions:{ttl:5e3,max:1e3}});return n(N,e,i)})("track",((e,t,n)=>{(e=>{m.push(e),l(u.EVENTS,m)})({event:`${e}.${t}`,time:(new Date).toISOString(),...n&&{properties:I(n)}})}))),_=b((async()=>{if(!1===y)return void await g();const e=m;if(0===e.length)return;const t=e.length,n={version:1,data:{events:e,details:f}};var r;await s("/v1/sdk/metrics",n)instanceof Error||(r=t,m=m.slice(r),l(u.EVENTS,m))})),v=async()=>{await _(),setTimeout(v,5e3)};let L=!1;const O=()=>{L||(L=!0,v())};S()||b(T("startFlushing",O))();const A=(e,t,n,r)=>K(e,t,{...r||{},duration:n}),R=(...e)=>{if(!e.some((e=>!!e)))return;let t={};return e.forEach((e=>{e&&(t={...t,...e})})),t},D=(e,t)=>`${e}_${t}`,M=b(((e,t,n)=>{const r=D(t,"start"),i=(()=>{const e=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`})(),o=performance.now(),s=Math.round(o+performance.timeOrigin);let a=R(n,{flowId:i,flowStartTime:s});A(e,r,0,a);return{details:{moduleName:e,flowName:t,flowId:i,flowStartTime:s},addEvent:b(((n,r)=>{const c=D(t,n),d=Math.round(performance.now()-o),l=R(a,r,{flowId:i,flowStartTime:s,duration:d});A(e,c,d,l)})),addFlowProperties:b((e=>{a=R(a,e,{flowId:i,flowStartTime:s})})),end:b((n=>{const r=D(t,"end"),c=Math.round(performance.now()-o),d=R(a,n,{flowId:i,flowStartTime:s});A(e,r,c,d)}))}})),P=b((e=>{const t=(e=>{if(e.passportId)return`passport:${e.passportId.toLowerCase()}`;if(e.ethAddress)return`ethAddress:${e.ethAddress.toLowerCase()}`;throw new Error("invalid_identity")})(e);t&&(p(o.IDENTITY,t),K("metrics","identify",e.traits))})),$=b(T("setEnvironment",(e=>{p(o.ENVIRONMENT,e)}))),U=b(T("setPassportClientId",(e=>{p(o.PASSPORT_CLIENT_ID,e)}))),V=b(T("setPublishableApiKey",(e=>{p(o.PUBLISHABLE_API_KEY,e)}))),k=b(T("getDetail",w));var B,Y;!function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(B||(B={})),function(e){e.API_KEY="x-immutable-api-key",e.PUBLISHABLE_KEY="x-immutable-publishable-key",e.RATE_LIMITING_KEY="x-api-key"}(Y||(Y={}));class x{environment;rateLimitingKey;apiKey;publishableKey;constructor(e){this.environment=e.environment,this.publishableKey=e.publishableKey,this.apiKey=e.apiKey,this.rateLimitingKey=e.rateLimitingKey,$(e.environment),K("config","created_imtbl_config")}}const C=(e,t)=>{if(!e||!e.apiKey&&!e.publishableKey&&!e.rateLimitingKey)return t;const n={};return e.apiKey&&(n[Y.API_KEY]=e.apiKey),e.publishableKey&&(n[Y.PUBLISHABLE_KEY]=e.publishableKey,V(e.publishableKey)),e.rateLimitingKey&&(n[Y.RATE_LIMITING_KEY]=e.rateLimitingKey),t&&t.headers?{...t,headers:{...n,...t.headers}}:{...t,headers:n}};export{o as D,B as E,x as I,Y as K,C as a,V as b,U as c,M as d,A as e,k as g,P as i,$ as s,K as t};
|