@imtbl/checkout-sdk 2.4.9 → 2.4.10-alpha.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.
@@ -801,7 +801,7 @@ var it = {
801
801
  };
802
802
 
803
803
  // src/env/env.ts
804
- var _o = "2.4.9";
804
+ var _o = "2.4.10-alpha.0";
805
805
  var me = () => _o;
806
806
 
807
807
  // src/availability/availability.ts
@@ -1515,13 +1515,19 @@ var Ae = class {
1515
1515
  const o = this.getCache(t);
1516
1516
  if (o) return Promise.resolve(o);
1517
1517
  const n = await this.httpClient.get(t);
1518
- const a = n.data?.items?.map((s) => {
1519
- const c = { ...s.token };
1520
- if (!c.address && c.address_hash) {
1521
- c.address = c.address_hash;
1518
+ const a = n.data?.items?.map(
1519
+ (s) => {
1520
+ const c = {
1521
+ ...s.token,
1522
+ address: s.token.address_hash,
1523
+ holders: s.token.holders_count
1524
+ };
1525
+ return {
1526
+ ...s,
1527
+ token: c
1528
+ };
1522
1529
  }
1523
- return { ...s, token: c };
1524
- }) || [];
1530
+ ) || [];
1525
1531
  const i = {
1526
1532
  items: a.filter(
1527
1533
  (s) => s.token.address && s.token.address !== this.nativeToken.address
@@ -408,7 +408,7 @@ var Ae = /* @__PURE__ */ ((a) => {
408
408
  // src/env/constants.ts
409
409
  var Z = "development";
410
410
  var G = 18;
411
- var Mt = 6;
411
+ var Bt = 6;
412
412
  var _ = "native";
413
413
  var Se = {
414
414
  name: "IMX",
@@ -432,7 +432,7 @@ var Pe = {
432
432
  [_config.Environment.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
433
433
  [_config.Environment.PRODUCTION]: "https://checkout-api.immutable.com"
434
434
  };
435
- var Bt = true;
435
+ var Mt = true;
436
436
  var xt = true;
437
437
  var bt = true;
438
438
  var Lt = {
@@ -801,7 +801,7 @@ var ot = {
801
801
  };
802
802
 
803
803
  // src/env/env.ts
804
- var vn = "2.4.9";
804
+ var vn = "2.4.10-alpha.0";
805
805
  var pe = () => vn;
806
806
 
807
807
  // src/availability/availability.ts
@@ -906,13 +906,13 @@ var fe = /* @__PURE__ */ ((o) => {
906
906
  o["FULFILLMENTS_UNSETTLED"] = "FULFILLMENTS_UNSETTLED";
907
907
  return o;
908
908
  })(fe || {});
909
- var M = /* @__PURE__ */ ((o) => {
909
+ var B = /* @__PURE__ */ ((o) => {
910
910
  o["NATIVE"] = "NATIVE";
911
911
  o["ERC20"] = "ERC20";
912
912
  o["ERC721"] = "ERC721";
913
913
  o["ERC1155"] = "ERC1155";
914
914
  return o;
915
- })(M || {});
915
+ })(B || {});
916
916
  var ge = /* @__PURE__ */ ((t) => {
917
917
  t["TRANSACTION"] = "TRANSACTION";
918
918
  t["GAS"] = "GAS";
@@ -973,7 +973,7 @@ async function Ce(r) {
973
973
 
974
974
  // src/network/network.ts
975
975
  var Vt = 4902;
976
- async function Mn(r, e, t) {
976
+ async function Bn(r, e, t) {
977
977
  return await e.send("wallet_switchEthereumChain", [
978
978
  { chainId: _optionalChain([r, 'access', _7 => _7.get, 'call', _8 => _8(t), 'optionalAccess', _9 => _9.chainIdHex]) }
979
979
  ]);
@@ -1055,7 +1055,7 @@ async function Te(r, e) {
1055
1055
  }
1056
1056
  );
1057
1057
  }
1058
- var Bn = (r) => _optionalChain([r, 'access', _15 => _15.error, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.originalError, 'optionalAccess', _18 => _18.code]) === Vt || _optionalChain([r, 'access', _19 => _19.error, 'optionalAccess', _20 => _20.code]) === Vt;
1058
+ var Mn = (r) => _optionalChain([r, 'access', _15 => _15.error, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.originalError, 'optionalAccess', _18 => _18.code]) === Vt || _optionalChain([r, 'access', _19 => _19.error, 'optionalAccess', _20 => _20.code]) === Vt;
1059
1059
  async function Ht(r, e, t) {
1060
1060
  const { networkMap: n } = r;
1061
1061
  const o = await Y(r, {
@@ -1074,10 +1074,10 @@ async function Ht(r, e, t) {
1074
1074
  );
1075
1075
  }
1076
1076
  try {
1077
- await Mn(n, e, t);
1077
+ await Bn(n, e, t);
1078
1078
  } catch (c) {
1079
1079
  console.error(c);
1080
- if (Bn(c)) {
1080
+ if (Mn(c)) {
1081
1081
  try {
1082
1082
  await it(n, e, t);
1083
1083
  } catch (d) {
@@ -1352,7 +1352,7 @@ var Ie = (_class2 = class {
1352
1352
  }
1353
1353
  this.environment = e.baseConfig.environment;
1354
1354
  this.isProduction = !this.isDevelopment && this.environment === _config.Environment.PRODUCTION;
1355
- this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _41 => _41.onRamp, 'optionalAccess', _42 => _42.enable]), () => ( Bt));
1355
+ this.isOnRampEnabled = _nullishCoalesce(_optionalChain([e, 'access', _41 => _41.onRamp, 'optionalAccess', _42 => _42.enable]), () => ( Mt));
1356
1356
  this.isSwapEnabled = _nullishCoalesce(_optionalChain([e, 'access', _43 => _43.swap, 'optionalAccess', _44 => _44.enable]), () => ( xt));
1357
1357
  this.isBridgeEnabled = _nullishCoalesce(_optionalChain([e, 'access', _45 => _45.bridge, 'optionalAccess', _46 => _46.enable]), () => ( bt));
1358
1358
  this.publishableKey = _nullishCoalesce(e.publishableKey, () => ( "<no-publishable-key>"));
@@ -1388,7 +1388,7 @@ var Wn = (r, e) => {
1388
1388
  }
1389
1389
  return parseFloat(r.substring(0, t + e + 1)).toString();
1390
1390
  };
1391
- var K = (r, e = Mt) => {
1391
+ var K = (r, e = Bt) => {
1392
1392
  const t = r.indexOf(".");
1393
1393
  if (t === -1) return r;
1394
1394
  const n = Wn(r, e);
@@ -1515,13 +1515,19 @@ var he = (_class3 = class {
1515
1515
  const n = this.getCache(t);
1516
1516
  if (n) return Promise.resolve(n);
1517
1517
  const o = await this.httpClient.get(t);
1518
- const a = _optionalChain([o, 'access', _61 => _61.data, 'optionalAccess', _62 => _62.items, 'optionalAccess', _63 => _63.map, 'call', _64 => _64((i) => {
1519
- const c = { ...i.token };
1520
- if (!c.address && c.address_hash) {
1521
- c.address = c.address_hash;
1518
+ const a = _optionalChain([o, 'access', _61 => _61.data, 'optionalAccess', _62 => _62.items, 'optionalAccess', _63 => _63.map, 'call', _64 => _64(
1519
+ (i) => {
1520
+ const c = {
1521
+ ...i.token,
1522
+ address: i.token.address_hash,
1523
+ holders: i.token.holders_count
1524
+ };
1525
+ return {
1526
+ ...i,
1527
+ token: c
1528
+ };
1522
1529
  }
1523
- return { ...i, token: c };
1524
- })]) || [];
1530
+ )]) || [];
1525
1531
  const s = {
1526
1532
  items: a.filter(
1527
1533
  (i) => i.token.address && i.token.address !== this.nativeToken.address
@@ -1855,7 +1861,7 @@ async function Xt(r) {
1855
1861
  }
1856
1862
 
1857
1863
  // src/fiatRamp/fiatRamp.ts
1858
- var Me = class {
1864
+ var Be = class {
1859
1865
 
1860
1866
  /**
1861
1867
  * Constructs a new instance of the FiatRampService class.
@@ -1956,7 +1962,7 @@ async function tr(r, e, t, n) {
1956
1962
  var _dexsdk = require('@imtbl/dex-sdk');
1957
1963
  var _orderbook = require('@imtbl/orderbook');
1958
1964
  var _blockchaindata = require('@imtbl/blockchain-data');
1959
- function Be(r, e, t, n) {
1965
+ function Me(r, e, t, n) {
1960
1966
  const o = t.get(r);
1961
1967
  const a = t.get(e);
1962
1968
  if (!o) {
@@ -2027,7 +2033,7 @@ async function io(r, e) {
2027
2033
  const o = r.get(t);
2028
2034
  if (!o) throw new Error(`Missing JsonRpcProvider for chain id: ${t}`);
2029
2035
  try {
2030
- const a = Be(
2036
+ const a = Me(
2031
2037
  t,
2032
2038
  n,
2033
2039
  r,
@@ -2335,7 +2341,7 @@ async function sr(r, e) {
2335
2341
  function ir(r) {
2336
2342
  return r && "send" in r && typeof r.send === "function";
2337
2343
  }
2338
- async function B(r, e, t) {
2344
+ async function M(r, e, t) {
2339
2345
  return x(
2340
2346
  async () => {
2341
2347
  if ("request" in e) {
@@ -2930,7 +2936,7 @@ var Oo = (r) => {
2930
2936
  });
2931
2937
  return t.concat(Array.from(e.values()));
2932
2938
  };
2933
- var Mo = (r) => {
2939
+ var Bo = (r) => {
2934
2940
  const e = /* @__PURE__ */ new Map();
2935
2941
  const t = [];
2936
2942
  r.forEach((n) => {
@@ -2946,7 +2952,7 @@ var Mo = (r) => {
2946
2952
  });
2947
2953
  return t.concat(Array.from(e.values()));
2948
2954
  };
2949
- var gr = (r) => Mo(Oo(_o(r)));
2955
+ var gr = (r) => Bo(Oo(_o(r)));
2950
2956
 
2951
2957
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2952
2958
 
@@ -3792,7 +3798,7 @@ var _r = (r) => {
3792
3798
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3793
3799
 
3794
3800
  var Or = async (r, e, t, n) => {
3795
- const o = Be(
3801
+ const o = Me(
3796
3802
  t,
3797
3803
  n,
3798
3804
  e,
@@ -3866,7 +3872,7 @@ var Yo = (r, e) => {
3866
3872
  const t = _r(r);
3867
3873
  return t >= e;
3868
3874
  };
3869
- var Mr = (r, e, t, n, o) => {
3875
+ var Br = (r, e, t, n, o) => {
3870
3876
  const a = _nullishCoalesce(_optionalChain([o, 'optionalAccess', _139 => _139.decimals]), () => ( G));
3871
3877
  const s = [];
3872
3878
  if (e > 0) {
@@ -3901,7 +3907,7 @@ var Mr = (r, e, t, n, o) => {
3901
3907
  bridgeFees: s
3902
3908
  };
3903
3909
  };
3904
- var Br = (r, e, t, n, o) => ({
3910
+ var Mr = (r, e, t, n, o) => ({
3905
3911
  type: "BRIDGE",
3906
3912
  chainId: r,
3907
3913
  fundingItem: {
@@ -3965,14 +3971,14 @@ var Ve = async (r, e, t, n, o) => {
3965
3971
  if (O(m)) {
3966
3972
  const P = c.balances.find((N) => O(N.token.address));
3967
3973
  if (P && P.balance >= n.amount + C) {
3968
- const N = Mr(
3974
+ const N = Br(
3969
3975
  E,
3970
3976
  R,
3971
3977
  I,
3972
3978
  f,
3973
3979
  i
3974
3980
  );
3975
- return Br(a, P, n, "NATIVE", N);
3981
+ return Mr(a, P, n, "NATIVE", N);
3976
3982
  }
3977
3983
  return void 0;
3978
3984
  }
@@ -3980,14 +3986,14 @@ var Ve = async (r, e, t, n, o) => {
3980
3986
  (P) => T(P.token.address, m)
3981
3987
  );
3982
3988
  if (y && y.balance >= n.amount) {
3983
- const P = Mr(
3989
+ const P = Br(
3984
3990
  E,
3985
3991
  R,
3986
3992
  I,
3987
3993
  f,
3988
3994
  i
3989
3995
  );
3990
- return Br(a, y, n, "ERC20", P);
3996
+ return Mr(a, y, n, "ERC20", P);
3991
3997
  }
3992
3998
  return void 0;
3993
3999
  };
@@ -5806,7 +5812,7 @@ var Ot = class {
5806
5812
  constructor(e = ja) {
5807
5813
  this.httpClient = new le(e);
5808
5814
  this.config = new Ie(e, this.httpClient);
5809
- this.fiatRampService = new Me(this.config);
5815
+ this.fiatRampService = new Be(this.config);
5810
5816
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5811
5817
  this.availability = ke(
5812
5818
  this.config.isDevelopment,
@@ -5890,7 +5896,7 @@ var Ot = class {
5890
5896
  * @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
5891
5897
  */
5892
5898
  async checkIsWalletConnected(e) {
5893
- const t = await B(
5899
+ const t = await M(
5894
5900
  this.config,
5895
5901
  e.provider,
5896
5902
  {
@@ -5924,7 +5930,7 @@ var Ot = class {
5924
5930
  * @throws {Error} If the provider is not valid or if there is an error connecting to the network.
5925
5931
  */
5926
5932
  async connect(e) {
5927
- const t = await B(
5933
+ const t = await M(
5928
5934
  this.config,
5929
5935
  e.provider,
5930
5936
  {
@@ -5946,7 +5952,7 @@ var Ot = class {
5946
5952
  * @throws {CheckoutError} When the network cannot be added to the wallet
5947
5953
  */
5948
5954
  async addNetwork(e) {
5949
- const t = await B(
5955
+ const t = await M(
5950
5956
  this.config,
5951
5957
  e.provider,
5952
5958
  {
@@ -5967,7 +5973,7 @@ var Ot = class {
5967
5973
  * @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
5968
5974
  */
5969
5975
  async switchNetwork(e) {
5970
- const t = await B(
5976
+ const t = await M(
5971
5977
  this.config,
5972
5978
  e.provider,
5973
5979
  {
@@ -5997,7 +6003,7 @@ var Ot = class {
5997
6003
  * @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
5998
6004
  */
5999
6005
  async getBalance(e) {
6000
- const t = await B(
6006
+ const t = await M(
6001
6007
  this.config,
6002
6008
  e.provider
6003
6009
  );
@@ -6058,7 +6064,7 @@ var Ot = class {
6058
6064
  * @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
6059
6065
  */
6060
6066
  async sendTransaction(e) {
6061
- const t = await B(
6067
+ const t = await M(
6062
6068
  this.config,
6063
6069
  e.provider,
6064
6070
  {
@@ -6075,7 +6081,7 @@ var Ot = class {
6075
6081
  * @returns {Promise<T>} Returns the result of the provided block param.
6076
6082
  */
6077
6083
  async providerCall(e, t) {
6078
- const n = await B(
6084
+ const n = await M(
6079
6085
  this.config,
6080
6086
  e,
6081
6087
  {
@@ -6095,7 +6101,7 @@ var Ot = class {
6095
6101
  * @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
6096
6102
  */
6097
6103
  async getNetworkInfo(e) {
6098
- const t = await B(
6104
+ const t = await M(
6099
6105
  this.config,
6100
6106
  e.provider,
6101
6107
  {
@@ -6118,7 +6124,7 @@ var Ot = class {
6118
6124
  "This endpoint currently only processes the first order in the array."
6119
6125
  );
6120
6126
  }
6121
- const t = await B(
6127
+ const t = await M(
6122
6128
  this.config,
6123
6129
  e.provider
6124
6130
  );
@@ -6144,7 +6150,7 @@ var Ot = class {
6144
6150
  "This endpoint currently only processes the first order in the array."
6145
6151
  );
6146
6152
  }
6147
- const t = await B(
6153
+ const t = await M(
6148
6154
  this.config,
6149
6155
  e.provider
6150
6156
  );
@@ -6160,7 +6166,7 @@ var Ot = class {
6160
6166
  console.warn(
6161
6167
  "This endpoint currently only processes the first order in the array."
6162
6168
  );
6163
- const t = await B(
6169
+ const t = await M(
6164
6170
  this.config,
6165
6171
  e.provider
6166
6172
  );
@@ -6184,7 +6190,7 @@ var Ot = class {
6184
6190
  * @throws {CheckoutError} When item requirements cannot be mapped or checkout validation fails
6185
6191
  */
6186
6192
  async smartCheckout(e) {
6187
- const t = await B(
6193
+ const t = await M(
6188
6194
  this.config,
6189
6195
  e.provider
6190
6196
  );
@@ -6291,7 +6297,7 @@ var Ot = class {
6291
6297
  * @returns {Promise<SwapResult>} - A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
6292
6298
  */
6293
6299
  async swap(e) {
6294
- const t = await B(
6300
+ const t = await M(
6295
6301
  this.config,
6296
6302
  e.provider
6297
6303
  );
@@ -6313,7 +6319,7 @@ var Ot = class {
6313
6319
  * @returns {Promise<SwapQuoteResult>} - A promise that resolves to the swap quote result.
6314
6320
  */
6315
6321
  async swapQuote(e) {
6316
- const t = await B(
6322
+ const t = await M(
6317
6323
  this.config,
6318
6324
  e.provider
6319
6325
  );
@@ -6401,4 +6407,4 @@ var Xe = class {
6401
6407
 
6402
6408
 
6403
6409
 
6404
- exports.AddTokensEventType = En; exports.BlockExplorerService = Xe; exports.BridgeEventType = dn; exports.ChainId = Q; exports.ChainName = rt; exports.ChainSlug = Ae; exports.Checkout = Ot; exports.CheckoutConfiguration = Ie; exports.CheckoutError = p; exports.CheckoutErrorType = w; exports.CheckoutStatus = fe; exports.CommerceEventType = un; exports.CommerceFailureEventType = fn; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = mn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = nn; exports.ConnectTargetLayer = In; exports.ExchangeType = qt; exports.FeeType = ve; exports.FundingStepType = Re; exports.GasEstimateType = at; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = tn; exports.ItemType = M; exports.NetworkFilterTypes = ue; exports.OnRampEventType = pn; exports.OrchestrationEventType = ln; exports.ProviderEventType = rn; exports.PurchaseEventType = Rn; exports.RoutingOutcomeType = st; exports.SaleEventType = sn; exports.SalePaymentTypes = cn; exports.SwapDirection = hn; exports.SwapEventType = an; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = ge; exports.TransferEventType = Cn; exports.WalletEventType = on; exports.WalletFilterTypes = Wt; exports.WalletProviderName = me; exports.WalletProviderRdns = Ut; exports.WidgetTheme = yn; exports.WidgetType = Tn; exports.WrappedBrowserProvider = b; exports.fetchRiskAssessment = Nt; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = mo; exports.getPassportProviderDetail = uo; exports.getUnderlyingChainId = Ce; exports.isAddressSanctioned = _t; exports.metaMaskProviderInfo = be; exports.passportProviderInfo = Le; exports.validateProvider = B;
6410
+ exports.AddTokensEventType = En; exports.BlockExplorerService = Xe; exports.BridgeEventType = dn; exports.ChainId = Q; exports.ChainName = rt; exports.ChainSlug = Ae; exports.Checkout = Ot; exports.CheckoutConfiguration = Ie; exports.CheckoutError = p; exports.CheckoutErrorType = w; exports.CheckoutStatus = fe; exports.CommerceEventType = un; exports.CommerceFailureEventType = fn; exports.CommerceFlowType = An; exports.CommerceSuccessEventType = mn; exports.CommerceUserActionEventType = gn; exports.ConnectEventType = nn; exports.ConnectTargetLayer = In; exports.ExchangeType = qt; exports.FeeType = ve; exports.FundingStepType = Re; exports.GasEstimateType = at; exports.GasTokenType = Ee; exports.IMMUTABLE_API_BASE_URL = U; exports.IMTBLWidgetEvents = tn; exports.ItemType = B; exports.NetworkFilterTypes = ue; exports.OnRampEventType = pn; exports.OrchestrationEventType = ln; exports.ProviderEventType = rn; exports.PurchaseEventType = Rn; exports.RoutingOutcomeType = st; exports.SaleEventType = sn; exports.SalePaymentTypes = cn; exports.SwapDirection = hn; exports.SwapEventType = an; exports.TokenFilterTypes = ne; exports.TransactionOrGasType = ge; exports.TransferEventType = Cn; exports.WalletEventType = on; exports.WalletFilterTypes = Wt; exports.WalletProviderName = me; exports.WalletProviderRdns = Ut; exports.WidgetTheme = yn; exports.WidgetType = Tn; exports.WrappedBrowserProvider = b; exports.fetchRiskAssessment = Nt; exports.getGasPriceInWei = Et; exports.getMetaMaskProviderDetail = mo; exports.getPassportProviderDetail = uo; exports.getUnderlyingChainId = Ce; exports.isAddressSanctioned = _t; exports.metaMaskProviderInfo = be; exports.passportProviderInfo = Le; exports.validateProvider = M;
@@ -408,7 +408,7 @@ var Ae = /* @__PURE__ */ ((a) => {
408
408
  // src/env/constants.ts
409
409
  var Z = "development";
410
410
  var G = 18;
411
- var Mt = 6;
411
+ var Bt = 6;
412
412
  var _ = "native";
413
413
  var Se = {
414
414
  name: "IMX",
@@ -432,7 +432,7 @@ var Pe = {
432
432
  [ee.SANDBOX]: "https://checkout-api.sandbox.immutable.com",
433
433
  [ee.PRODUCTION]: "https://checkout-api.immutable.com"
434
434
  };
435
- var Bt = true;
435
+ var Mt = true;
436
436
  var xt = true;
437
437
  var bt = true;
438
438
  var Lt = {
@@ -801,7 +801,7 @@ var ot = {
801
801
  };
802
802
 
803
803
  // src/env/env.ts
804
- var vn = "2.4.9";
804
+ var vn = "2.4.10-alpha.0";
805
805
  var pe = () => vn;
806
806
 
807
807
  // src/availability/availability.ts
@@ -906,13 +906,13 @@ var fe = /* @__PURE__ */ ((o) => {
906
906
  o["FULFILLMENTS_UNSETTLED"] = "FULFILLMENTS_UNSETTLED";
907
907
  return o;
908
908
  })(fe || {});
909
- var M = /* @__PURE__ */ ((o) => {
909
+ var B = /* @__PURE__ */ ((o) => {
910
910
  o["NATIVE"] = "NATIVE";
911
911
  o["ERC20"] = "ERC20";
912
912
  o["ERC721"] = "ERC721";
913
913
  o["ERC1155"] = "ERC1155";
914
914
  return o;
915
- })(M || {});
915
+ })(B || {});
916
916
  var ge = /* @__PURE__ */ ((t) => {
917
917
  t["TRANSACTION"] = "TRANSACTION";
918
918
  t["GAS"] = "GAS";
@@ -973,7 +973,7 @@ async function Ce(r) {
973
973
 
974
974
  // src/network/network.ts
975
975
  var Vt = 4902;
976
- async function Mn(r, e, t) {
976
+ async function Bn(r, e, t) {
977
977
  return await e.send("wallet_switchEthereumChain", [
978
978
  { chainId: r.get(t)?.chainIdHex }
979
979
  ]);
@@ -1055,7 +1055,7 @@ async function Te(r, e) {
1055
1055
  }
1056
1056
  );
1057
1057
  }
1058
- var Bn = (r) => r.error?.data?.originalError?.code === Vt || r.error?.code === Vt;
1058
+ var Mn = (r) => r.error?.data?.originalError?.code === Vt || r.error?.code === Vt;
1059
1059
  async function Ht(r, e, t) {
1060
1060
  const { networkMap: n } = r;
1061
1061
  const o = await Y(r, {
@@ -1074,10 +1074,10 @@ async function Ht(r, e, t) {
1074
1074
  );
1075
1075
  }
1076
1076
  try {
1077
- await Mn(n, e, t);
1077
+ await Bn(n, e, t);
1078
1078
  } catch (c) {
1079
1079
  console.error(c);
1080
- if (Bn(c)) {
1080
+ if (Mn(c)) {
1081
1081
  try {
1082
1082
  await it(n, e, t);
1083
1083
  } catch (d) {
@@ -1352,7 +1352,7 @@ var Ie = class {
1352
1352
  }
1353
1353
  this.environment = e.baseConfig.environment;
1354
1354
  this.isProduction = !this.isDevelopment && this.environment === oe.PRODUCTION;
1355
- this.isOnRampEnabled = e.onRamp?.enable ?? Bt;
1355
+ this.isOnRampEnabled = e.onRamp?.enable ?? Mt;
1356
1356
  this.isSwapEnabled = e.swap?.enable ?? xt;
1357
1357
  this.isBridgeEnabled = e.bridge?.enable ?? bt;
1358
1358
  this.publishableKey = e.publishableKey ?? "<no-publishable-key>";
@@ -1388,7 +1388,7 @@ var Wn = (r, e) => {
1388
1388
  }
1389
1389
  return parseFloat(r.substring(0, t + e + 1)).toString();
1390
1390
  };
1391
- var K = (r, e = Mt) => {
1391
+ var K = (r, e = Bt) => {
1392
1392
  const t = r.indexOf(".");
1393
1393
  if (t === -1) return r;
1394
1394
  const n = Wn(r, e);
@@ -1515,13 +1515,19 @@ var he = class {
1515
1515
  const n = this.getCache(t);
1516
1516
  if (n) return Promise.resolve(n);
1517
1517
  const o = await this.httpClient.get(t);
1518
- const a = o.data?.items?.map((i) => {
1519
- const c = { ...i.token };
1520
- if (!c.address && c.address_hash) {
1521
- c.address = c.address_hash;
1518
+ const a = o.data?.items?.map(
1519
+ (i) => {
1520
+ const c = {
1521
+ ...i.token,
1522
+ address: i.token.address_hash,
1523
+ holders: i.token.holders_count
1524
+ };
1525
+ return {
1526
+ ...i,
1527
+ token: c
1528
+ };
1522
1529
  }
1523
- return { ...i, token: c };
1524
- }) || [];
1530
+ ) || [];
1525
1531
  const s = {
1526
1532
  items: a.filter(
1527
1533
  (i) => i.token.address && i.token.address !== this.nativeToken.address
@@ -1855,7 +1861,7 @@ async function Xt(r) {
1855
1861
  }
1856
1862
 
1857
1863
  // src/fiatRamp/fiatRamp.ts
1858
- var Me = class {
1864
+ var Be = class {
1859
1865
  config;
1860
1866
  /**
1861
1867
  * Constructs a new instance of the FiatRampService class.
@@ -1956,7 +1962,7 @@ import { ImmutableConfiguration as rr } from "@imtbl/config";
1956
1962
  import { Exchange as to } from "@imtbl/dex-sdk";
1957
1963
  import { Orderbook as ro } from "@imtbl/orderbook";
1958
1964
  import { BlockchainData as no } from "@imtbl/blockchain-data";
1959
- function Be(r, e, t, n) {
1965
+ function Me(r, e, t, n) {
1960
1966
  const o = t.get(r);
1961
1967
  const a = t.get(e);
1962
1968
  if (!o) {
@@ -2027,7 +2033,7 @@ async function io(r, e) {
2027
2033
  const o = r.get(t);
2028
2034
  if (!o) throw new Error(`Missing JsonRpcProvider for chain id: ${t}`);
2029
2035
  try {
2030
- const a = Be(
2036
+ const a = Me(
2031
2037
  t,
2032
2038
  n,
2033
2039
  r,
@@ -2335,7 +2341,7 @@ async function sr(r, e) {
2335
2341
  function ir(r) {
2336
2342
  return r && "send" in r && typeof r.send === "function";
2337
2343
  }
2338
- async function B(r, e, t) {
2344
+ async function M(r, e, t) {
2339
2345
  return x(
2340
2346
  async () => {
2341
2347
  if ("request" in e) {
@@ -2930,7 +2936,7 @@ var Oo = (r) => {
2930
2936
  });
2931
2937
  return t.concat(Array.from(e.values()));
2932
2938
  };
2933
- var Mo = (r) => {
2939
+ var Bo = (r) => {
2934
2940
  const e = /* @__PURE__ */ new Map();
2935
2941
  const t = [];
2936
2942
  r.forEach((n) => {
@@ -2946,10 +2952,10 @@ var Mo = (r) => {
2946
2952
  });
2947
2953
  return t.concat(Array.from(e.values()));
2948
2954
  };
2949
- var gr = (r) => Mo(Oo(_o(r)));
2955
+ var gr = (r) => Bo(Oo(_o(r)));
2950
2956
 
2951
2957
  // src/smartCheckout/balanceCheck/balanceRequirement.ts
2952
- import { Contract as Bo, formatUnits as Fe } from "ethers";
2958
+ import { Contract as Mo, formatUnits as Fe } from "ethers";
2953
2959
  var Er = (r) => r.map((e) => {
2954
2960
  switch (e.type) {
2955
2961
  case "ERC20":
@@ -3035,7 +3041,7 @@ var Tr = async (r, e, t) => {
3035
3041
  continue;
3036
3042
  }
3037
3043
  try {
3038
- const l = new Bo(
3044
+ const l = new Mo(
3039
3045
  o.tokenAddress,
3040
3046
  JSON.stringify(L),
3041
3047
  t
@@ -3792,7 +3798,7 @@ var _r = (r) => {
3792
3798
  // src/smartCheckout/routing/bridge/getBridgeFeeEstimate.ts
3793
3799
  import { BridgeFeeActions as Ko } from "@imtbl/bridge-sdk";
3794
3800
  var Or = async (r, e, t, n) => {
3795
- const o = Be(
3801
+ const o = Me(
3796
3802
  t,
3797
3803
  n,
3798
3804
  e,
@@ -3866,7 +3872,7 @@ var Yo = (r, e) => {
3866
3872
  const t = _r(r);
3867
3873
  return t >= e;
3868
3874
  };
3869
- var Mr = (r, e, t, n, o) => {
3875
+ var Br = (r, e, t, n, o) => {
3870
3876
  const a = o?.decimals ?? G;
3871
3877
  const s = [];
3872
3878
  if (e > 0) {
@@ -3901,7 +3907,7 @@ var Mr = (r, e, t, n, o) => {
3901
3907
  bridgeFees: s
3902
3908
  };
3903
3909
  };
3904
- var Br = (r, e, t, n, o) => ({
3910
+ var Mr = (r, e, t, n, o) => ({
3905
3911
  type: "BRIDGE",
3906
3912
  chainId: r,
3907
3913
  fundingItem: {
@@ -3965,14 +3971,14 @@ var Ve = async (r, e, t, n, o) => {
3965
3971
  if (O(m)) {
3966
3972
  const P = c.balances.find((N) => O(N.token.address));
3967
3973
  if (P && P.balance >= n.amount + C) {
3968
- const N = Mr(
3974
+ const N = Br(
3969
3975
  E,
3970
3976
  R,
3971
3977
  I,
3972
3978
  f,
3973
3979
  i
3974
3980
  );
3975
- return Br(a, P, n, "NATIVE", N);
3981
+ return Mr(a, P, n, "NATIVE", N);
3976
3982
  }
3977
3983
  return void 0;
3978
3984
  }
@@ -3980,14 +3986,14 @@ var Ve = async (r, e, t, n, o) => {
3980
3986
  (P) => T(P.token.address, m)
3981
3987
  );
3982
3988
  if (y && y.balance >= n.amount) {
3983
- const P = Mr(
3989
+ const P = Br(
3984
3990
  E,
3985
3991
  R,
3986
3992
  I,
3987
3993
  f,
3988
3994
  i
3989
3995
  );
3990
- return Br(a, y, n, "ERC20", P);
3996
+ return Mr(a, y, n, "ERC20", P);
3991
3997
  }
3992
3998
  return void 0;
3993
3999
  };
@@ -5430,9 +5436,9 @@ async function Yr(r, e) {
5430
5436
  }
5431
5437
 
5432
5438
  // src/smartCheckout/sell/sell.ts
5433
- import { Contract as Oa, parseUnits as Ma } from "ethers";
5439
+ import { Contract as Oa, parseUnits as Ba } from "ethers";
5434
5440
  import {
5435
- constants as Ba
5441
+ constants as Ma
5436
5442
  } from "@imtbl/orderbook";
5437
5443
  import { track as xa } from "@imtbl/metrics";
5438
5444
  var ba = (r, e, t) => ({
@@ -5449,7 +5455,7 @@ var La = (r, e, t, n) => ({
5449
5455
  amount: BigInt(n)
5450
5456
  });
5451
5457
  var Da = (r, e = 18) => {
5452
- const t = Ma(r.amount, e);
5458
+ const t = Ba(r.amount, e);
5453
5459
  if (r.type === "NATIVE") {
5454
5460
  return {
5455
5461
  type: "NATIVE",
@@ -5560,7 +5566,7 @@ var Jr = async (r, e, t) => {
5560
5566
  type: "GAS",
5561
5567
  gasToken: {
5562
5568
  type: "NATIVE",
5563
- limit: BigInt(Ba.estimatedFulfillmentGasGwei)
5569
+ limit: BigInt(Ma.estimatedFulfillmentGasGwei)
5564
5570
  }
5565
5571
  }
5566
5572
  )
@@ -5806,7 +5812,7 @@ var Ot = class {
5806
5812
  constructor(e = ja) {
5807
5813
  this.httpClient = new le(e);
5808
5814
  this.config = new Ie(e, this.httpClient);
5809
- this.fiatRampService = new Me(this.config);
5815
+ this.fiatRampService = new Be(this.config);
5810
5816
  this.readOnlyProviders = /* @__PURE__ */ new Map();
5811
5817
  this.availability = ke(
5812
5818
  this.config.isDevelopment,
@@ -5890,7 +5896,7 @@ var Ot = class {
5890
5896
  * @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
5891
5897
  */
5892
5898
  async checkIsWalletConnected(e) {
5893
- const t = await B(
5899
+ const t = await M(
5894
5900
  this.config,
5895
5901
  e.provider,
5896
5902
  {
@@ -5924,7 +5930,7 @@ var Ot = class {
5924
5930
  * @throws {Error} If the provider is not valid or if there is an error connecting to the network.
5925
5931
  */
5926
5932
  async connect(e) {
5927
- const t = await B(
5933
+ const t = await M(
5928
5934
  this.config,
5929
5935
  e.provider,
5930
5936
  {
@@ -5946,7 +5952,7 @@ var Ot = class {
5946
5952
  * @throws {CheckoutError} When the network cannot be added to the wallet
5947
5953
  */
5948
5954
  async addNetwork(e) {
5949
- const t = await B(
5955
+ const t = await M(
5950
5956
  this.config,
5951
5957
  e.provider,
5952
5958
  {
@@ -5967,7 +5973,7 @@ var Ot = class {
5967
5973
  * @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
5968
5974
  */
5969
5975
  async switchNetwork(e) {
5970
- const t = await B(
5976
+ const t = await M(
5971
5977
  this.config,
5972
5978
  e.provider,
5973
5979
  {
@@ -5997,7 +6003,7 @@ var Ot = class {
5997
6003
  * @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
5998
6004
  */
5999
6005
  async getBalance(e) {
6000
- const t = await B(
6006
+ const t = await M(
6001
6007
  this.config,
6002
6008
  e.provider
6003
6009
  );
@@ -6058,7 +6064,7 @@ var Ot = class {
6058
6064
  * @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
6059
6065
  */
6060
6066
  async sendTransaction(e) {
6061
- const t = await B(
6067
+ const t = await M(
6062
6068
  this.config,
6063
6069
  e.provider,
6064
6070
  {
@@ -6075,7 +6081,7 @@ var Ot = class {
6075
6081
  * @returns {Promise<T>} Returns the result of the provided block param.
6076
6082
  */
6077
6083
  async providerCall(e, t) {
6078
- const n = await B(
6084
+ const n = await M(
6079
6085
  this.config,
6080
6086
  e,
6081
6087
  {
@@ -6095,7 +6101,7 @@ var Ot = class {
6095
6101
  * @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
6096
6102
  */
6097
6103
  async getNetworkInfo(e) {
6098
- const t = await B(
6104
+ const t = await M(
6099
6105
  this.config,
6100
6106
  e.provider,
6101
6107
  {
@@ -6118,7 +6124,7 @@ var Ot = class {
6118
6124
  "This endpoint currently only processes the first order in the array."
6119
6125
  );
6120
6126
  }
6121
- const t = await B(
6127
+ const t = await M(
6122
6128
  this.config,
6123
6129
  e.provider
6124
6130
  );
@@ -6144,7 +6150,7 @@ var Ot = class {
6144
6150
  "This endpoint currently only processes the first order in the array."
6145
6151
  );
6146
6152
  }
6147
- const t = await B(
6153
+ const t = await M(
6148
6154
  this.config,
6149
6155
  e.provider
6150
6156
  );
@@ -6160,7 +6166,7 @@ var Ot = class {
6160
6166
  console.warn(
6161
6167
  "This endpoint currently only processes the first order in the array."
6162
6168
  );
6163
- const t = await B(
6169
+ const t = await M(
6164
6170
  this.config,
6165
6171
  e.provider
6166
6172
  );
@@ -6184,7 +6190,7 @@ var Ot = class {
6184
6190
  * @throws {CheckoutError} When item requirements cannot be mapped or checkout validation fails
6185
6191
  */
6186
6192
  async smartCheckout(e) {
6187
- const t = await B(
6193
+ const t = await M(
6188
6194
  this.config,
6189
6195
  e.provider
6190
6196
  );
@@ -6291,7 +6297,7 @@ var Ot = class {
6291
6297
  * @returns {Promise<SwapResult>} - A promise that resolves to the swap result (swap tx, swap tx receipt, quote used in the swap).
6292
6298
  */
6293
6299
  async swap(e) {
6294
- const t = await B(
6300
+ const t = await M(
6295
6301
  this.config,
6296
6302
  e.provider
6297
6303
  );
@@ -6313,7 +6319,7 @@ var Ot = class {
6313
6319
  * @returns {Promise<SwapQuoteResult>} - A promise that resolves to the swap quote result.
6314
6320
  */
6315
6321
  async swapQuote(e) {
6316
- const t = await B(
6322
+ const t = await M(
6317
6323
  this.config,
6318
6324
  e.provider
6319
6325
  );
@@ -6371,7 +6377,7 @@ export {
6371
6377
  Ee as GasTokenType,
6372
6378
  U as IMMUTABLE_API_BASE_URL,
6373
6379
  tn as IMTBLWidgetEvents,
6374
- M as ItemType,
6380
+ B as ItemType,
6375
6381
  ue as NetworkFilterTypes,
6376
6382
  pn as OnRampEventType,
6377
6383
  ln as OrchestrationEventType,
@@ -6400,5 +6406,5 @@ export {
6400
6406
  _t as isAddressSanctioned,
6401
6407
  be as metaMaskProviderInfo,
6402
6408
  Le as passportProviderInfo,
6403
- B as validateProvider
6409
+ M as validateProvider
6404
6410
  };
@@ -2,6 +2,27 @@ import { HttpStatusCode } from 'axios';
2
2
  export declare enum BlockscoutTokenType {
3
3
  ERC20 = "ERC-20"
4
4
  }
5
+ export interface BlockscoutERC20Response {
6
+ items: BlockscoutERC20ResponseItem[];
7
+ next_page_params: BlockscoutTokenPagination | null;
8
+ }
9
+ export interface BlockscoutERC20ResponseItem {
10
+ token: {
11
+ address_hash: string;
12
+ decimals: string;
13
+ name: string;
14
+ symbol: string;
15
+ holders_count: string;
16
+ circulating_market_cap: string;
17
+ exchange_rate: string;
18
+ total_supply: string;
19
+ icon_url: string;
20
+ type: BlockscoutTokenType;
21
+ };
22
+ value: string;
23
+ token_id: string | null;
24
+ token_instance: string | null;
25
+ }
5
26
  export interface BlockscoutTokens {
6
27
  items: BlockscoutToken[];
7
28
  next_page_params: BlockscoutTokenPagination | null;
@@ -19,6 +40,7 @@ export interface BlockscoutTokenData {
19
40
  name: string;
20
41
  symbol: string;
21
42
  icon_url: string;
43
+ holders: string;
22
44
  type: BlockscoutTokenType;
23
45
  }
24
46
  export interface BlockscoutError {
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@imtbl/checkout-sdk",
3
3
  "description": "Immutable Checkout SDK",
4
- "version": "2.4.9",
4
+ "version": "2.4.10-alpha.0",
5
5
  "author": "immutable",
6
6
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
7
7
  "dependencies": {
8
- "@imtbl/blockchain-data": "2.4.9",
9
- "@imtbl/bridge-sdk": "2.4.9",
10
- "@imtbl/config": "2.4.9",
11
- "@imtbl/dex-sdk": "2.4.9",
12
- "@imtbl/generated-clients": "2.4.9",
13
- "@imtbl/metrics": "2.4.9",
14
- "@imtbl/orderbook": "2.4.9",
15
- "@imtbl/passport": "2.4.9",
8
+ "@imtbl/blockchain-data": "2.4.10-alpha.0",
9
+ "@imtbl/bridge-sdk": "2.4.10-alpha.0",
10
+ "@imtbl/config": "2.4.10-alpha.0",
11
+ "@imtbl/dex-sdk": "2.4.10-alpha.0",
12
+ "@imtbl/generated-clients": "2.4.10-alpha.0",
13
+ "@imtbl/metrics": "2.4.10-alpha.0",
14
+ "@imtbl/orderbook": "2.4.10-alpha.0",
15
+ "@imtbl/passport": "2.4.10-alpha.0",
16
16
  "@metamask/detect-provider": "^2.0.0",
17
17
  "axios": "^1.6.5",
18
18
  "ethers": "^6.13.4",