@chainflip/sdk 1.11.0 → 1.11.2

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/swap.cjs CHANGED
@@ -659,12 +659,12 @@ var NetworkInfo = z6__default.default.object({
659
659
  ),
660
660
  cfBrokerCommissionBps: z6__default.default.number()
661
661
  });
662
- var ChainflipAsset = z6.z.enum(chainflip.chainflipAssets);
662
+ var ChainflipAsset2 = z6.z.enum(chainflip.chainflipAssets);
663
663
  var NetworkStatus = z6.z.object({
664
664
  assets: z6.z.object({
665
- deposit: z6.z.array(ChainflipAsset),
666
- destination: z6.z.array(ChainflipAsset),
667
- all: z6.z.array(ChainflipAsset)
665
+ deposit: z6.z.array(ChainflipAsset2),
666
+ destination: z6.z.array(ChainflipAsset2),
667
+ all: z6.z.array(ChainflipAsset2)
668
668
  }),
669
669
  boostDepositsEnabled: z6.z.boolean(),
670
670
  cfBrokerCommissionBps: z6.z.number()
@@ -885,8 +885,6 @@ var ADDRESSES = {
885
885
  };
886
886
  var ASSET_BLACKLIST = ["Dot"];
887
887
  var envSafeAssetBlacklist = (network) => isTestnet(network) ? ASSET_BLACKLIST : ASSET_BLACKLIST;
888
-
889
- // ../shared/src/dataStructures.ts
890
888
  var MultiCache = class {
891
889
  constructor(fetchers) {
892
890
  this.fetchers = fetchers;
@@ -1009,7 +1007,7 @@ var getChainData = (chain2, network, env) => ({
1009
1007
 
1010
1008
  // package.json
1011
1009
  var package_default = {
1012
- version: "1.11.0"};
1010
+ version: "1.11.2"};
1013
1011
 
1014
1012
  // src/swap/consts.ts
1015
1013
  var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
@@ -1116,7 +1114,7 @@ var SwapSDK = class {
1116
1114
  ]);
1117
1115
  const supportedChains = new Set(supportedAssets.map((a) => chainflip.assetConstants[a].chain));
1118
1116
  if (sourceChain && !supportedChains.has(sourceChain)) return [];
1119
- return [...supportedChains].map((chain2) => getChainData(chain2, this.options.network, env)).filter((chain2) => chain2.chain !== sourceChain);
1117
+ return [...supportedChains].filter((chain2) => chain2 !== "Polkadot").map((chain2) => getChainData(chain2, this.options.network, env)).filter((chain2) => chain2.chain !== sourceChain);
1120
1118
  }
1121
1119
  async getStateChainEnvironment() {
1122
1120
  return this.cache.read("environment");
@@ -1149,7 +1147,7 @@ var SwapSDK = class {
1149
1147
  this.getStateChainEnvironment(),
1150
1148
  this.getSupportedAssets(type)
1151
1149
  ]);
1152
- return supportedAssets.map((asset2) => getAssetData(asset2, this.options.network, env)).filter((asset2) => !chain2 || asset2.chain === chain2);
1150
+ return supportedAssets.filter((asset2) => asset2 !== "Dot").map((asset2) => getAssetData(asset2, this.options.network, env)).filter((asset2) => !chain2 || asset2.chain === chain2);
1153
1151
  }
1154
1152
  // eslint-disable-next-line class-methods-use-this
1155
1153
  shouldTakeCommission() {
@@ -1457,8 +1455,8 @@ var SwapSDK = class {
1457
1455
  };
1458
1456
  var arrayToMap = (array) => Object.fromEntries(array.map((item) => [item, item]));
1459
1457
  var ChainflipNetworks = arrayToMap(chainflip.chainflipNetworks);
1460
- var InternalAssets = arrayToMap(chainflip.chainflipAssets);
1461
- var Chains = arrayToMap(chainflip.chainflipChains);
1458
+ var InternalAssets = arrayToMap(chainflip.chainflipAssets.filter((asset2) => asset2 !== "Dot"));
1459
+ var Chains = arrayToMap(chainflip.chainflipChains.filter((chain2) => chain2 !== "Polkadot"));
1462
1460
  var Assets = arrayToMap(chainflip.assetSymbols);
1463
1461
 
1464
1462
  Object.defineProperty(exports, "getChainflipId", {
package/dist/swap.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, ChainflipNetwork, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
2
- export { AssetSymbol as Asset, ChainflipChain as Chain, ChainflipAsset as ChainflipId, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
2
+ export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
3
3
  import { HexString } from '@chainflip/utils/types';
4
4
  import { z } from 'zod';
5
5
 
@@ -137,8 +137,12 @@ type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST' | 'REFU
137
137
  type PoolFee = Fee<'LIQUIDITY'>;
138
138
  type PaidFee = SwapFee | PoolFee;
139
139
  type PoolInfo = {
140
- baseAsset: AssetAndChain;
141
- quoteAsset: AssetAndChain;
140
+ baseAsset: Exclude<AssetAndChain, {
141
+ chain: 'Polkadot';
142
+ }>;
143
+ quoteAsset: Exclude<AssetAndChain, {
144
+ chain: 'Polkadot';
145
+ }>;
142
146
  fee: Omit<PoolFee, 'type'>;
143
147
  };
144
148
  type BoostedQuoteDetails = {
@@ -146,8 +150,12 @@ type BoostedQuoteDetails = {
146
150
  maxBoostFeeBps: number;
147
151
  };
148
152
  interface BaseQuoteDetails {
149
- srcAsset: AssetAndChain;
150
- destAsset: AssetAndChain;
153
+ srcAsset: Exclude<AssetAndChain, {
154
+ chain: 'Polkadot';
155
+ }>;
156
+ destAsset: Exclude<AssetAndChain, {
157
+ chain: 'Polkadot';
158
+ }>;
151
159
  isVaultSwap: boolean;
152
160
  isOnChain: boolean;
153
161
  ccmParams?: {
@@ -220,7 +228,7 @@ type FillOrKillParams = {
220
228
  });
221
229
 
222
230
  interface ChainData {
223
- chain: ChainflipChain;
231
+ chain: Exclude<ChainflipChain, 'Polkadot'>;
224
232
  name: string;
225
233
  evmChainId: number | undefined;
226
234
  isMainnet: boolean;
@@ -272,7 +280,7 @@ type BoostPoolDepth = {
272
280
  feeTierBps: number;
273
281
  availableAmount: bigint;
274
282
  asset: AssetSymbol;
275
- chain: ChainflipChain;
283
+ chain: Exclude<ChainflipChain, 'Polkadot'>;
276
284
  };
277
285
 
278
286
  type ChunkFailureReason = 'PriceImpactLimit' | 'MinPriceViolation' | 'OraclePriceSlippageExceeded' | 'OraclePriceStale' | 'PredecessorSwapFailure' | 'SafeModeActive';
@@ -597,6 +605,11 @@ declare class SwapSDK {
597
605
  checkBoostEnabled(): Promise<boolean>;
598
606
  }
599
607
 
608
+ /**
609
+ * This file provides backwards compatibility for exports from before we started
610
+ * moving common stuff to the toolkit
611
+ */
612
+
600
613
  declare const ChainflipNetworks: {
601
614
  mainnet: "mainnet";
602
615
  backspin: "backspin";
@@ -608,7 +621,6 @@ declare const InternalAssets: {
608
621
  Usdt: "Usdt";
609
622
  Flip: "Flip";
610
623
  Eth: "Eth";
611
- Dot: "Dot";
612
624
  Btc: "Btc";
613
625
  ArbUsdc: "ArbUsdc";
614
626
  ArbEth: "ArbEth";
@@ -622,7 +634,6 @@ declare const Chains: {
622
634
  Ethereum: "Ethereum";
623
635
  Arbitrum: "Arbitrum";
624
636
  Bitcoin: "Bitcoin";
625
- Polkadot: "Polkadot";
626
637
  Solana: "Solana";
627
638
  Assethub: "Assethub";
628
639
  };
@@ -635,5 +646,7 @@ declare const Assets: {
635
646
  BTC: "BTC";
636
647
  SOL: "SOL";
637
648
  };
649
+ type Chain = Exclude<ChainflipChain, 'Polkadot'>;
650
+ type InternalAsset = Exclude<ChainflipAsset, 'Dot'>;
638
651
 
639
- export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type ChainData, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
652
+ export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type Chain, type ChainData, type InternalAsset as ChainflipId, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
package/dist/swap.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AssetAndChain, UncheckedAssetAndChain, ChainflipChain, ChainflipAsset, AssetOfChain, AssetSymbol, ChainflipNetwork, ChainAssetMap, ChainMap } from '@chainflip/utils/chainflip';
2
- export { AssetSymbol as Asset, ChainflipChain as Chain, ChainflipAsset as ChainflipId, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
2
+ export { AssetSymbol as Asset, ChainflipNetwork, UncheckedAssetAndChain, getInternalAsset as getChainflipId } from '@chainflip/utils/chainflip';
3
3
  import { HexString } from '@chainflip/utils/types';
4
4
  import { z } from 'zod';
5
5
 
@@ -137,8 +137,12 @@ type SwapFee = Fee<'NETWORK' | 'INGRESS' | 'EGRESS' | 'BROKER' | 'BOOST' | 'REFU
137
137
  type PoolFee = Fee<'LIQUIDITY'>;
138
138
  type PaidFee = SwapFee | PoolFee;
139
139
  type PoolInfo = {
140
- baseAsset: AssetAndChain;
141
- quoteAsset: AssetAndChain;
140
+ baseAsset: Exclude<AssetAndChain, {
141
+ chain: 'Polkadot';
142
+ }>;
143
+ quoteAsset: Exclude<AssetAndChain, {
144
+ chain: 'Polkadot';
145
+ }>;
142
146
  fee: Omit<PoolFee, 'type'>;
143
147
  };
144
148
  type BoostedQuoteDetails = {
@@ -146,8 +150,12 @@ type BoostedQuoteDetails = {
146
150
  maxBoostFeeBps: number;
147
151
  };
148
152
  interface BaseQuoteDetails {
149
- srcAsset: AssetAndChain;
150
- destAsset: AssetAndChain;
153
+ srcAsset: Exclude<AssetAndChain, {
154
+ chain: 'Polkadot';
155
+ }>;
156
+ destAsset: Exclude<AssetAndChain, {
157
+ chain: 'Polkadot';
158
+ }>;
151
159
  isVaultSwap: boolean;
152
160
  isOnChain: boolean;
153
161
  ccmParams?: {
@@ -220,7 +228,7 @@ type FillOrKillParams = {
220
228
  });
221
229
 
222
230
  interface ChainData {
223
- chain: ChainflipChain;
231
+ chain: Exclude<ChainflipChain, 'Polkadot'>;
224
232
  name: string;
225
233
  evmChainId: number | undefined;
226
234
  isMainnet: boolean;
@@ -272,7 +280,7 @@ type BoostPoolDepth = {
272
280
  feeTierBps: number;
273
281
  availableAmount: bigint;
274
282
  asset: AssetSymbol;
275
- chain: ChainflipChain;
283
+ chain: Exclude<ChainflipChain, 'Polkadot'>;
276
284
  };
277
285
 
278
286
  type ChunkFailureReason = 'PriceImpactLimit' | 'MinPriceViolation' | 'OraclePriceSlippageExceeded' | 'OraclePriceStale' | 'PredecessorSwapFailure' | 'SafeModeActive';
@@ -597,6 +605,11 @@ declare class SwapSDK {
597
605
  checkBoostEnabled(): Promise<boolean>;
598
606
  }
599
607
 
608
+ /**
609
+ * This file provides backwards compatibility for exports from before we started
610
+ * moving common stuff to the toolkit
611
+ */
612
+
600
613
  declare const ChainflipNetworks: {
601
614
  mainnet: "mainnet";
602
615
  backspin: "backspin";
@@ -608,7 +621,6 @@ declare const InternalAssets: {
608
621
  Usdt: "Usdt";
609
622
  Flip: "Flip";
610
623
  Eth: "Eth";
611
- Dot: "Dot";
612
624
  Btc: "Btc";
613
625
  ArbUsdc: "ArbUsdc";
614
626
  ArbEth: "ArbEth";
@@ -622,7 +634,6 @@ declare const Chains: {
622
634
  Ethereum: "Ethereum";
623
635
  Arbitrum: "Arbitrum";
624
636
  Bitcoin: "Bitcoin";
625
- Polkadot: "Polkadot";
626
637
  Solana: "Solana";
627
638
  Assethub: "Assethub";
628
639
  };
@@ -635,5 +646,7 @@ declare const Assets: {
635
646
  BTC: "BTC";
636
647
  SOL: "SOL";
637
648
  };
649
+ type Chain = Exclude<ChainflipChain, 'Polkadot'>;
650
+ type InternalAsset = Exclude<ChainflipAsset, 'Dot'>;
638
651
 
639
- export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type ChainData, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
652
+ export { type AssetData, Assets, type BoostPoolDepth, type BoostQuote, type Chain, type ChainData, type InternalAsset as ChainflipId, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, type ChainsAndAssets, type DCABoostQuote, type DCAQuote, type DepositAddressRequestV2, type DepositAddressResponseV2, type EncodeCfParametersRequest, type FillOrKillParamsWithSlippage, type Quote, type QuoteRequest, type QuoteResponseV2, type RegularQuote, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponseV2, type VaultSwapRequest, type VaultSwapResponse };
package/dist/swap.js CHANGED
@@ -618,12 +618,12 @@ var NetworkInfo = z6.object({
618
618
  ),
619
619
  cfBrokerCommissionBps: z6.number()
620
620
  });
621
- var ChainflipAsset = z.enum(chainflipAssets);
621
+ var ChainflipAsset2 = z.enum(chainflipAssets);
622
622
  var NetworkStatus = z.object({
623
623
  assets: z.object({
624
- deposit: z.array(ChainflipAsset),
625
- destination: z.array(ChainflipAsset),
626
- all: z.array(ChainflipAsset)
624
+ deposit: z.array(ChainflipAsset2),
625
+ destination: z.array(ChainflipAsset2),
626
+ all: z.array(ChainflipAsset2)
627
627
  }),
628
628
  boostDepositsEnabled: z.boolean(),
629
629
  cfBrokerCommissionBps: z.number()
@@ -713,8 +713,6 @@ var apiContract = c.router(
713
713
  pathPrefix: "/api"
714
714
  }
715
715
  );
716
-
717
- // ../shared/src/dataStructures.ts
718
716
  var MultiCache = class {
719
717
  constructor(fetchers) {
720
718
  this.fetchers = fetchers;
@@ -815,7 +813,7 @@ var getChainData = (chain2, network, env) => ({
815
813
 
816
814
  // package.json
817
815
  var package_default = {
818
- version: "1.11.0"};
816
+ version: "1.11.2"};
819
817
 
820
818
  // src/swap/consts.ts
821
819
  var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
@@ -922,7 +920,7 @@ var SwapSDK = class {
922
920
  ]);
923
921
  const supportedChains = new Set(supportedAssets.map((a) => assetConstants[a].chain));
924
922
  if (sourceChain && !supportedChains.has(sourceChain)) return [];
925
- return [...supportedChains].map((chain2) => getChainData(chain2, this.options.network, env)).filter((chain2) => chain2.chain !== sourceChain);
923
+ return [...supportedChains].filter((chain2) => chain2 !== "Polkadot").map((chain2) => getChainData(chain2, this.options.network, env)).filter((chain2) => chain2.chain !== sourceChain);
926
924
  }
927
925
  async getStateChainEnvironment() {
928
926
  return this.cache.read("environment");
@@ -955,7 +953,7 @@ var SwapSDK = class {
955
953
  this.getStateChainEnvironment(),
956
954
  this.getSupportedAssets(type)
957
955
  ]);
958
- return supportedAssets.map((asset2) => getAssetData(asset2, this.options.network, env)).filter((asset2) => !chain2 || asset2.chain === chain2);
956
+ return supportedAssets.filter((asset2) => asset2 !== "Dot").map((asset2) => getAssetData(asset2, this.options.network, env)).filter((asset2) => !chain2 || asset2.chain === chain2);
959
957
  }
960
958
  // eslint-disable-next-line class-methods-use-this
961
959
  shouldTakeCommission() {
@@ -1263,8 +1261,8 @@ var SwapSDK = class {
1263
1261
  };
1264
1262
  var arrayToMap = (array) => Object.fromEntries(array.map((item) => [item, item]));
1265
1263
  var ChainflipNetworks = arrayToMap(chainflipNetworks);
1266
- var InternalAssets = arrayToMap(chainflipAssets);
1267
- var Chains = arrayToMap(chainflipChains);
1264
+ var InternalAssets = arrayToMap(chainflipAssets.filter((asset2) => asset2 !== "Dot"));
1265
+ var Chains = arrayToMap(chainflipChains.filter((chain2) => chain2 !== "Polkadot"));
1268
1266
  var Assets = arrayToMap(assetSymbols);
1269
1267
 
1270
1268
  export { Assets, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, SwapSDK };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/sdk",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "",
5
5
  "exports": {
6
6
  "./swap": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@chainflip/bitcoin": "^1.2.7",
56
- "@chainflip/rpc": "~1.11.0",
56
+ "@chainflip/rpc": "~1.11.7",
57
57
  "@chainflip/solana": "^2.2.0",
58
58
  "@chainflip/utils": "^0.11.1",
59
59
  "@ts-rest/core": "^3.52.1",