@chainflip/sdk 1.2.1-alpha.2 → 1.2.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.
@@ -47,4 +47,4 @@ type TransactionOptions = {
47
47
  wait?: number;
48
48
  };
49
49
 
50
- export { type Asset as A, type ChainflipNetwork as C, type InternalAsset as I, type TransactionOptions as T, type Chain as a, type AssetOfChain as b, type ChainAssetMap as c, Chains as d, Assets as e, ChainflipNetworks as f, getInternalAsset as g };
50
+ export { type Asset as A, type ChainflipNetwork as C, type InternalAsset as I, type TransactionOptions as T, type Chain as a, type AssetOfChain as b, type ChainAssetMap as c, Chains as d, Assets as e, InternalAssets as f, ChainflipNetworks as g, getInternalAsset as h };
@@ -47,4 +47,4 @@ type TransactionOptions = {
47
47
  wait?: number;
48
48
  };
49
49
 
50
- export { type Asset as A, type ChainflipNetwork as C, type InternalAsset as I, type TransactionOptions as T, type Chain as a, type AssetOfChain as b, type ChainAssetMap as c, Chains as d, Assets as e, ChainflipNetworks as f, getInternalAsset as g };
50
+ export { type Asset as A, type ChainflipNetwork as C, type InternalAsset as I, type TransactionOptions as T, type Chain as a, type AssetOfChain as b, type ChainAssetMap as c, Chains as d, Assets as e, InternalAssets as f, ChainflipNetworks as g, getInternalAsset as h };
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as ChainflipNetwork, T as TransactionOptions } from './contracts-b4ZS6VAh.mjs';
2
+ import { C as ChainflipNetwork, T as TransactionOptions } from './contracts-JL66gtg_.mjs';
3
3
 
4
4
  type PendingRedemption = {
5
5
  amount: bigint;
package/dist/funding.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as ChainflipNetwork, T as TransactionOptions } from './contracts-b4ZS6VAh.js';
2
+ import { C as ChainflipNetwork, T as TransactionOptions } from './contracts-JL66gtg_.js';
3
3
 
4
4
  type PendingRedemption = {
5
5
  amount: bigint;
package/dist/swap.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as ChainflipNetwork, a as Chain, A as Asset, I as InternalAsset, b as AssetOfChain, T as TransactionOptions, c as ChainAssetMap } from './contracts-b4ZS6VAh.mjs';
3
- export { e as Assets, f as ChainflipNetworks, d as Chains, g as getChainflipId } from './contracts-b4ZS6VAh.mjs';
2
+ import { C as ChainflipNetwork, a as Chain, A as Asset, I as InternalAsset, b as AssetOfChain, T as TransactionOptions, c as ChainAssetMap } from './contracts-JL66gtg_.mjs';
3
+ export { e as Assets, f as ChainflipIds, g as ChainflipNetworks, d as Chains, h as getChainflipId } from './contracts-JL66gtg_.mjs';
4
4
  import { z } from 'zod';
5
5
 
6
6
  declare const tokenSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
@@ -617,4 +617,4 @@ declare class SwapSDK {
617
617
  }>;
618
618
  }
619
619
 
620
- export { Asset, type AssetData, Chain, type ChainData, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type VaultSwapStatusResponse };
620
+ export { Asset, type AssetData, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type VaultSwapStatusResponse };
package/dist/swap.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Signer } from 'ethers';
2
- import { C as ChainflipNetwork, a as Chain, A as Asset, I as InternalAsset, b as AssetOfChain, T as TransactionOptions, c as ChainAssetMap } from './contracts-b4ZS6VAh.js';
3
- export { e as Assets, f as ChainflipNetworks, d as Chains, g as getChainflipId } from './contracts-b4ZS6VAh.js';
2
+ import { C as ChainflipNetwork, a as Chain, A as Asset, I as InternalAsset, b as AssetOfChain, T as TransactionOptions, c as ChainAssetMap } from './contracts-JL66gtg_.js';
3
+ export { e as Assets, f as ChainflipIds, g as ChainflipNetworks, d as Chains, h as getChainflipId } from './contracts-JL66gtg_.js';
4
4
  import { z } from 'zod';
5
5
 
6
6
  declare const tokenSwapParamsSchema: (network: ChainflipNetwork) => z.ZodUnion<[z.ZodObject<{
@@ -617,4 +617,4 @@ declare class SwapSDK {
617
617
  }>;
618
618
  }
619
619
 
620
- export { Asset, type AssetData, Chain, type ChainData, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type VaultSwapStatusResponse };
620
+ export { Asset, type AssetData, Chain, type ChainData, InternalAsset as ChainflipId, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type DepositAddressStatusResponse, type FailedVaultSwapStatusResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, type VaultSwapStatusResponse };
package/dist/swap.js CHANGED
@@ -83,27 +83,27 @@ function assertIsValidAssetAndChain(assetAndChain2) {
83
83
  function getInternalAsset(asset2) {
84
84
  const map = {
85
85
  [exports.Chains.Ethereum]: {
86
- [exports.Assets.USDC]: InternalAssets.Usdc,
87
- [exports.Assets.FLIP]: InternalAssets.Flip,
88
- [exports.Assets.ETH]: InternalAssets.Eth
86
+ [exports.Assets.USDC]: exports.ChainflipIds.Usdc,
87
+ [exports.Assets.FLIP]: exports.ChainflipIds.Flip,
88
+ [exports.Assets.ETH]: exports.ChainflipIds.Eth
89
89
  },
90
90
  [exports.Chains.Bitcoin]: {
91
- [exports.Assets.BTC]: InternalAssets.Btc
91
+ [exports.Assets.BTC]: exports.ChainflipIds.Btc
92
92
  },
93
93
  [exports.Chains.Polkadot]: {
94
- [exports.Assets.DOT]: InternalAssets.Dot
94
+ [exports.Assets.DOT]: exports.ChainflipIds.Dot
95
95
  }
96
96
  };
97
97
  return readChainAssetValue(map, asset2);
98
98
  }
99
- var arrayToMap, InternalAssets; exports.Chains = void 0; exports.Assets = void 0; exports.ChainflipNetworks = void 0; var isTestnet, assetConstants, chainConstants, readChainAssetValue;
99
+ var arrayToMap; exports.ChainflipIds = void 0; exports.Chains = void 0; exports.Assets = void 0; exports.ChainflipNetworks = void 0; var isTestnet, assetConstants, chainConstants, readChainAssetValue;
100
100
  var init_enums = __esm({
101
101
  "../shared/src/enums.ts"() {
102
102
  arrayToMap = /* @__PURE__ */ __name((array) => Object.fromEntries(array.map((key) => [
103
103
  key,
104
104
  key
105
105
  ])), "arrayToMap");
106
- InternalAssets = arrayToMap([
106
+ exports.ChainflipIds = arrayToMap([
107
107
  "Flip",
108
108
  "Usdc",
109
109
  "Dot",
@@ -130,35 +130,35 @@ var init_enums = __esm({
130
130
  ]);
131
131
  isTestnet = /* @__PURE__ */ __name((network) => network !== exports.ChainflipNetworks.mainnet, "isTestnet");
132
132
  assetConstants = {
133
- [InternalAssets.Eth]: {
133
+ [exports.ChainflipIds.Eth]: {
134
134
  chain: exports.Chains.Ethereum,
135
135
  asset: exports.Assets.ETH,
136
136
  name: "Ether",
137
137
  decimals: 18,
138
138
  contractId: 1
139
139
  },
140
- [InternalAssets.Flip]: {
140
+ [exports.ChainflipIds.Flip]: {
141
141
  chain: exports.Chains.Ethereum,
142
142
  asset: exports.Assets.FLIP,
143
143
  name: "FLIP",
144
144
  decimals: 18,
145
145
  contractId: 2
146
146
  },
147
- [InternalAssets.Usdc]: {
147
+ [exports.ChainflipIds.Usdc]: {
148
148
  chain: exports.Chains.Ethereum,
149
149
  asset: exports.Assets.USDC,
150
150
  name: "USDC",
151
151
  decimals: 6,
152
152
  contractId: 3
153
153
  },
154
- [InternalAssets.Dot]: {
154
+ [exports.ChainflipIds.Dot]: {
155
155
  chain: exports.Chains.Polkadot,
156
156
  asset: exports.Assets.DOT,
157
157
  name: "Polkadot",
158
158
  decimals: 10,
159
159
  contractId: 4
160
160
  },
161
- [InternalAssets.Btc]: {
161
+ [exports.ChainflipIds.Btc]: {
162
162
  chain: exports.Chains.Bitcoin,
163
163
  asset: exports.Assets.BTC,
164
164
  name: "Bitcoin",
@@ -4592,7 +4592,7 @@ var init_parsers = __esm({
4592
4592
  rustEnum = /* @__PURE__ */ __name((values) => z.object({
4593
4593
  __kind: z.enum(values)
4594
4594
  }).transform(({ __kind }) => __kind), "rustEnum");
4595
- rustEnum(enumValues(InternalAssets));
4595
+ rustEnum(enumValues(exports.ChainflipIds));
4596
4596
  rustEnum(enumValues(exports.Chains));
4597
4597
  chain = z.nativeEnum(exports.Chains);
4598
4598
  asset = z.nativeEnum(exports.Assets);
@@ -8601,9 +8601,9 @@ var extractOverrides = /* @__PURE__ */ __name((transactionOverrides) => {
8601
8601
  return ethersOverrides;
8602
8602
  }, "extractOverrides");
8603
8603
  function getTokenContractAddress(asset2, network, assert2 = true) {
8604
- if (asset2 === InternalAssets.Flip)
8604
+ if (asset2 === exports.ChainflipIds.Flip)
8605
8605
  return ADDRESSES[network].FLIP_CONTRACT_ADDRESS;
8606
- if (asset2 === InternalAssets.Usdc)
8606
+ if (asset2 === exports.ChainflipIds.Usdc)
8607
8607
  return ADDRESSES[network].USDC_CONTRACT_ADDRESS;
8608
8608
  if (assert2) {
8609
8609
  throw new Error("Only FLIP and USDC are supported for now");
@@ -8977,7 +8977,6 @@ var SwapSDK = _SwapSDK;
8977
8977
 
8978
8978
  // src/swap/index.ts
8979
8979
  init_enums();
8980
- init_enums();
8981
8980
  /*! Bundled license information:
8982
8981
 
8983
8982
  @trpc/client/dist/httpUtils-b9d0cb48.mjs:
package/dist/swap.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { getTokenContractAddress, getEnvironment, getVaultManagerContractAddress, approve, checkAllowance, Vault__factory, extractOverrides } from './chunk-2GNHNTY7.mjs';
2
2
  import { ccmMetadataSchema } from './chunk-KLVDY4K6.mjs';
3
3
  import { __name, z, numericString, Chains, Assets, ethereumAddress, dotAddress, ChainflipNetworks, assetConstants, isTestnet, readChainAssetValue, __publicField, assert, isTokenCall, isTokenSwap, getInternalAsset, chainConstants, btcAddress } from './chunk-3LCS6BBP.mjs';
4
- export { Assets, ChainflipNetworks, Chains, getInternalAsset as getChainflipId } from './chunk-3LCS6BBP.mjs';
4
+ export { Assets, InternalAssets as ChainflipIds, ChainflipNetworks, Chains, getInternalAsset as getChainflipId } from './chunk-3LCS6BBP.mjs';
5
5
  import { decodeAddress } from '@polkadot/util-crypto';
6
6
  import axios from 'axios';
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/sdk",
3
- "version": "1.2.1-alpha.2",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "exports": {
6
6
  "./swap": {