@imtbl/sdk 0.18.2 → 0.18.3

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/index.cjs CHANGED
@@ -2725,7 +2725,7 @@ class MultiRollupApiClients {
2725
2725
  }
2726
2726
 
2727
2727
  // eslint-disable-next-line @typescript-eslint/naming-convention
2728
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.18.2' };
2728
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.18.3' };
2729
2729
  const createConfig = ({ basePath, headers, }) => {
2730
2730
  if (!basePath.trim()) {
2731
2731
  throw Error('basePath can not be empty');
@@ -2785,7 +2785,7 @@ class APIError extends Error {
2785
2785
 
2786
2786
  /* eslint-disable implicit-arrow-linebreak */
2787
2787
  const defaultHeaders = {
2788
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.2',
2788
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.3',
2789
2789
  };
2790
2790
  /**
2791
2791
  * createAPIConfiguration to create a custom Configuration
@@ -3071,7 +3071,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
3071
3071
  chainID,
3072
3072
  coreContractAddress,
3073
3073
  registrationContractAddress,
3074
- sdkVersion: 'ts-immutable-sdk-0.18.2',
3074
+ sdkVersion: 'ts-immutable-sdk-0.18.3',
3075
3075
  });
3076
3076
  /**
3077
3077
  * Sets `sdkVersion` at the time of build
@@ -30328,6 +30328,34 @@ const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutin
30328
30328
 
30329
30329
 
30330
30330
 
30331
+
30332
+
30333
+
30334
+ const $5649bc8af91da370$export$1fb2bd867f4a9be3 = async (config, availableRoutingOptions, balanceRequirement)=>{
30335
+ if (balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 && balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE) return undefined;
30336
+ const requiredBalance = balanceRequirement.required;
30337
+ let hasAllowList = false;
30338
+ const onRampProvidersAllowList = await ($5a5ccedc98d53d25$export$9ec9fc71f3ce62c4)(config, availableRoutingOptions);
30339
+ Object.values(onRampProvidersAllowList).forEach((onRampAllowList)=>{
30340
+ if (onRampAllowList.length > 0 && !hasAllowList) hasAllowList = !!onRampAllowList.find((token)=>token.address === requiredBalance.token?.address);
30341
+ });
30342
+ if (!hasAllowList) return undefined;
30343
+ return {
30344
+ type: ($4b58188d47aafe8d$export$3af78bb3e8650ee6).ONRAMP,
30345
+ chainId: ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config),
30346
+ asset: {
30347
+ balance: requiredBalance.balance,
30348
+ formattedBalance: requiredBalance.formattedBalance,
30349
+ token: {
30350
+ ...requiredBalance.token
30351
+ }
30352
+ }
30353
+ };
30354
+ };
30355
+
30356
+
30357
+
30358
+
30331
30359
  const $c16168a9c28ae4fd$export$31ce7ba1a2956195 = (balanceRequirements)=>{
30332
30360
  let insufficientBalanceCount = 0;
30333
30361
  let insufficientRequirement;
@@ -30351,6 +30379,12 @@ const $c16168a9c28ae4fd$export$c39a7b7dc167cdb4 = async (config, availableRoutin
30351
30379
  const swapFundingStep = await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions, dexQuoteCache, ownerAddress, insufficientRequirement, tokenBalances, swappableTokens);
30352
30380
  return swapFundingStep;
30353
30381
  };
30382
+ const $c16168a9c28ae4fd$export$e1b6e4d22d0365ee = async (config, availableRoutingOptions, insufficientRequirement)=>{
30383
+ if (!availableRoutingOptions.onRamp) return undefined;
30384
+ if (insufficientRequirement === undefined) return undefined;
30385
+ const onRampFundingStep = await ($5649bc8af91da370$export$1fb2bd867f4a9be3)(config, availableRoutingOptions, insufficientRequirement);
30386
+ return onRampFundingStep;
30387
+ };
30354
30388
  const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, balanceRequirements, availableRoutingOptions)=>{
30355
30389
  let readOnlyProviders;
30356
30390
  try {
@@ -30371,7 +30405,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30371
30405
  let bridgeFundingStep;
30372
30406
  if (availableRoutingOptions.bridge && insufficientRequirement) bridgeFundingStep = await ($fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa)(config, readOnlyProviders, ownerAddress, availableRoutingOptions, insufficientRequirement, tokenBalances, feeEstimates);
30373
30407
  const swapFundingStep = await $c16168a9c28ae4fd$export$c39a7b7dc167cdb4(config, availableRoutingOptions, insufficientRequirement, dexQuoteCache, ownerAddress, tokenBalances, allowList.swap);
30374
- // Check on-ramp routes
30408
+ const onRampFundingStep = await $c16168a9c28ae4fd$export$e1b6e4d22d0365ee(config, availableRoutingOptions, insufficientRequirement);
30375
30409
  // Check swap routes
30376
30410
  // > Could bridge first
30377
30411
  // > Could on-ramp first
@@ -30384,7 +30418,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30384
30418
  fundingRoutes: []
30385
30419
  };
30386
30420
  let priority = 0;
30387
- if (bridgeFundingStep || swapFundingStep) {
30421
+ if (bridgeFundingStep || swapFundingStep || onRampFundingStep) {
30388
30422
  response.response.type = ($b23305044c0e096a$export$3057de18ac0c076).ROUTES_FOUND;
30389
30423
  response.response.message = "Routes found";
30390
30424
  }
@@ -30406,6 +30440,15 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30406
30440
  ]
30407
30441
  });
30408
30442
  }
30443
+ if (onRampFundingStep) {
30444
+ priority++;
30445
+ response.fundingRoutes.push({
30446
+ priority: priority,
30447
+ steps: [
30448
+ onRampFundingStep
30449
+ ]
30450
+ });
30451
+ }
30409
30452
  return response;
30410
30453
  };
30411
30454
 
@@ -31184,7 +31227,7 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
31184
31227
  function $parcel$export(e, n, v, s) {
31185
31228
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
31186
31229
  }
31187
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.2";
31230
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.3";
31188
31231
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
31189
31232
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
31190
31233
 
package/dist/index.js CHANGED
@@ -2703,7 +2703,7 @@ class MultiRollupApiClients {
2703
2703
  }
2704
2704
 
2705
2705
  // eslint-disable-next-line @typescript-eslint/naming-convention
2706
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.18.2' };
2706
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.18.3' };
2707
2707
  const createConfig = ({ basePath, headers, }) => {
2708
2708
  if (!basePath.trim()) {
2709
2709
  throw Error('basePath can not be empty');
@@ -2763,7 +2763,7 @@ class APIError extends Error {
2763
2763
 
2764
2764
  /* eslint-disable implicit-arrow-linebreak */
2765
2765
  const defaultHeaders = {
2766
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.2',
2766
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.3',
2767
2767
  };
2768
2768
  /**
2769
2769
  * createAPIConfiguration to create a custom Configuration
@@ -3049,7 +3049,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
3049
3049
  chainID,
3050
3050
  coreContractAddress,
3051
3051
  registrationContractAddress,
3052
- sdkVersion: 'ts-immutable-sdk-0.18.2',
3052
+ sdkVersion: 'ts-immutable-sdk-0.18.3',
3053
3053
  });
3054
3054
  /**
3055
3055
  * Sets `sdkVersion` at the time of build
@@ -30306,6 +30306,34 @@ const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutin
30306
30306
 
30307
30307
 
30308
30308
 
30309
+
30310
+
30311
+
30312
+ const $5649bc8af91da370$export$1fb2bd867f4a9be3 = async (config, availableRoutingOptions, balanceRequirement)=>{
30313
+ if (balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 && balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE) return undefined;
30314
+ const requiredBalance = balanceRequirement.required;
30315
+ let hasAllowList = false;
30316
+ const onRampProvidersAllowList = await ($5a5ccedc98d53d25$export$9ec9fc71f3ce62c4)(config, availableRoutingOptions);
30317
+ Object.values(onRampProvidersAllowList).forEach((onRampAllowList)=>{
30318
+ if (onRampAllowList.length > 0 && !hasAllowList) hasAllowList = !!onRampAllowList.find((token)=>token.address === requiredBalance.token?.address);
30319
+ });
30320
+ if (!hasAllowList) return undefined;
30321
+ return {
30322
+ type: ($4b58188d47aafe8d$export$3af78bb3e8650ee6).ONRAMP,
30323
+ chainId: ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config),
30324
+ asset: {
30325
+ balance: requiredBalance.balance,
30326
+ formattedBalance: requiredBalance.formattedBalance,
30327
+ token: {
30328
+ ...requiredBalance.token
30329
+ }
30330
+ }
30331
+ };
30332
+ };
30333
+
30334
+
30335
+
30336
+
30309
30337
  const $c16168a9c28ae4fd$export$31ce7ba1a2956195 = (balanceRequirements)=>{
30310
30338
  let insufficientBalanceCount = 0;
30311
30339
  let insufficientRequirement;
@@ -30329,6 +30357,12 @@ const $c16168a9c28ae4fd$export$c39a7b7dc167cdb4 = async (config, availableRoutin
30329
30357
  const swapFundingStep = await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions, dexQuoteCache, ownerAddress, insufficientRequirement, tokenBalances, swappableTokens);
30330
30358
  return swapFundingStep;
30331
30359
  };
30360
+ const $c16168a9c28ae4fd$export$e1b6e4d22d0365ee = async (config, availableRoutingOptions, insufficientRequirement)=>{
30361
+ if (!availableRoutingOptions.onRamp) return undefined;
30362
+ if (insufficientRequirement === undefined) return undefined;
30363
+ const onRampFundingStep = await ($5649bc8af91da370$export$1fb2bd867f4a9be3)(config, availableRoutingOptions, insufficientRequirement);
30364
+ return onRampFundingStep;
30365
+ };
30332
30366
  const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, balanceRequirements, availableRoutingOptions)=>{
30333
30367
  let readOnlyProviders;
30334
30368
  try {
@@ -30349,7 +30383,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30349
30383
  let bridgeFundingStep;
30350
30384
  if (availableRoutingOptions.bridge && insufficientRequirement) bridgeFundingStep = await ($fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa)(config, readOnlyProviders, ownerAddress, availableRoutingOptions, insufficientRequirement, tokenBalances, feeEstimates);
30351
30385
  const swapFundingStep = await $c16168a9c28ae4fd$export$c39a7b7dc167cdb4(config, availableRoutingOptions, insufficientRequirement, dexQuoteCache, ownerAddress, tokenBalances, allowList.swap);
30352
- // Check on-ramp routes
30386
+ const onRampFundingStep = await $c16168a9c28ae4fd$export$e1b6e4d22d0365ee(config, availableRoutingOptions, insufficientRequirement);
30353
30387
  // Check swap routes
30354
30388
  // > Could bridge first
30355
30389
  // > Could on-ramp first
@@ -30362,7 +30396,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30362
30396
  fundingRoutes: []
30363
30397
  };
30364
30398
  let priority = 0;
30365
- if (bridgeFundingStep || swapFundingStep) {
30399
+ if (bridgeFundingStep || swapFundingStep || onRampFundingStep) {
30366
30400
  response.response.type = ($b23305044c0e096a$export$3057de18ac0c076).ROUTES_FOUND;
30367
30401
  response.response.message = "Routes found";
30368
30402
  }
@@ -30384,6 +30418,15 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
30384
30418
  ]
30385
30419
  });
30386
30420
  }
30421
+ if (onRampFundingStep) {
30422
+ priority++;
30423
+ response.fundingRoutes.push({
30424
+ priority: priority,
30425
+ steps: [
30426
+ onRampFundingStep
30427
+ ]
30428
+ });
30429
+ }
30387
30430
  return response;
30388
30431
  };
30389
30432
 
@@ -31162,7 +31205,7 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
31162
31205
  function $parcel$export(e, n, v, s) {
31163
31206
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
31164
31207
  }
31165
- const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.2";
31208
+ const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.3";
31166
31209
  const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
31167
31210
  const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
31168
31211
 
package/dist/passport.js CHANGED
@@ -1709,7 +1709,7 @@ class MultiRollupApiClients {
1709
1709
  }
1710
1710
 
1711
1711
  // eslint-disable-next-line @typescript-eslint/naming-convention
1712
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.18.2' };
1712
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.18.3' };
1713
1713
  const createConfig = ({ basePath, headers, }) => {
1714
1714
  if (!basePath.trim()) {
1715
1715
  throw Error('basePath can not be empty');
@@ -1765,7 +1765,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
1765
1765
  chainID,
1766
1766
  coreContractAddress,
1767
1767
  registrationContractAddress,
1768
- sdkVersion: 'ts-immutable-sdk-0.18.2',
1768
+ sdkVersion: 'ts-immutable-sdk-0.18.3',
1769
1769
  });
1770
1770
  /**
1771
1771
  * Sets `sdkVersion` at the time of build
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.18.2",
4
+ "version": "0.18.3",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
@@ -31,6 +31,7 @@
31
31
  "typechain": "^8.1.1"
32
32
  },
33
33
  "devDependencies": {
34
+ "@imtbl/analytics": "0.0.0",
34
35
  "@imtbl/blockchain-data": "0.0.0",
35
36
  "@imtbl/checkout-sdk": "0.0.0",
36
37
  "@imtbl/checkout-widgets": "0.0.0",