@shapeshiftoss/caip 5.2.3 → 5.3.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.
@@ -1,5 +1,6 @@
1
1
  import { ChainId, ChainNamespace, ChainReference } from '../chainId/chainId';
2
- export declare type AccountId = string;
2
+ import { Nominal } from '../utils';
3
+ export declare type AccountId = Nominal<string, 'AccountId'>;
3
4
  declare type ToAccountIdWithChainId = {
4
5
  chainId: ChainId;
5
6
  account: string;
@@ -16,14 +16,7 @@ export declare const writeFiles: (data: Record<string, Record<string, string>>)
16
16
  export declare const fetchData: (URL: string) => Promise<CoinCapCoin[]>;
17
17
  export declare const parseEthData: (data: CoinCapCoin[]) => Record<string, string>;
18
18
  export declare const parseData: (d: CoinCapCoin[]) => {
19
- "eip155:1": Record<string, string>;
20
- "bip122:000000000019d6689c085ae165831e93": {
21
- [x: string]: string;
22
- };
23
- "cosmos:cosmoshub-4": {
24
- [x: string]: string;
25
- };
26
- "cosmos:osmosis-1": {
19
+ [x: string]: {
27
20
  [x: string]: string;
28
21
  };
29
22
  };
@@ -10,14 +10,7 @@ export declare const writeFiles: (data: Record<string, Record<string, string>>)
10
10
  export declare const fetchData: (URL: string) => Promise<CoingeckoCoin[]>;
11
11
  export declare const parseEthData: (data: CoingeckoCoin[]) => Record<string, string>;
12
12
  export declare const parseData: (d: CoingeckoCoin[]) => {
13
- "eip155:1": Record<string, string>;
14
- "bip122:000000000019d6689c085ae165831e93": {
15
- [x: string]: string;
16
- };
17
- "cosmos:cosmoshub-4": {
18
- [x: string]: string;
19
- };
20
- "cosmos:osmosis-1": {
13
+ [x: string]: {
21
14
  [x: string]: string;
22
15
  };
23
16
  };
@@ -1,6 +1,7 @@
1
1
  import { ChainId, ChainNamespace, ChainReference } from '../chainId/chainId';
2
2
  import { ASSET_NAMESPACE_STRINGS, ASSET_REFERENCE } from '../constants';
3
- export declare type AssetId = string;
3
+ import { Nominal } from '../utils';
4
+ export declare type AssetId = Nominal<string, 'AssetId'>;
4
5
  export declare type AssetNamespace = typeof ASSET_NAMESPACE_STRINGS[number];
5
6
  export declare type AssetReference = typeof ASSET_REFERENCE[keyof typeof ASSET_REFERENCE];
6
7
  declare type ToAssetIdWithChainId = {
@@ -1,5 +1,6 @@
1
1
  import { CHAIN_NAMESPACE, CHAIN_REFERENCE } from '../constants';
2
- export declare type ChainId = string;
2
+ import { Nominal } from '../utils';
3
+ export declare type ChainId = Nominal<string, 'ChainId'>;
3
4
  export declare type ChainNamespace = typeof CHAIN_NAMESPACE[keyof typeof CHAIN_NAMESPACE];
4
5
  export declare type ChainReference = typeof CHAIN_REFERENCE[keyof typeof CHAIN_REFERENCE];
5
6
  declare type ToChainIdArgs = {
@@ -1,13 +1,13 @@
1
- import { AssetNamespace } from './assetId/assetId';
2
- import { ChainNamespace, ChainReference } from './chainId/chainId';
3
- export declare const btcAssetId = "bip122:000000000019d6689c085ae165831e93/slip44:0";
4
- export declare const ethAssetId = "eip155:1/slip44:60";
5
- export declare const cosmosAssetId = "cosmos:cosmoshub-4/slip44:118";
6
- export declare const osmosisAssetId = "cosmos:osmosis-1/slip44:118";
7
- export declare const ethChainId = "eip155:1";
8
- export declare const btcChainId = "bip122:000000000019d6689c085ae165831e93";
9
- export declare const cosmosChainId = "cosmos:cosmoshub-4";
10
- export declare const osmosisChainId = "cosmos:osmosis-1";
1
+ import { AssetId, AssetNamespace } from './assetId/assetId';
2
+ import { ChainId, ChainNamespace, ChainReference } from './chainId/chainId';
3
+ export declare const btcAssetId: AssetId;
4
+ export declare const ethAssetId: AssetId;
5
+ export declare const cosmosAssetId: AssetId;
6
+ export declare const osmosisAssetId: AssetId;
7
+ export declare const ethChainId: ChainId;
8
+ export declare const btcChainId: ChainId;
9
+ export declare const cosmosChainId: ChainId;
10
+ export declare const osmosisChainId: ChainId;
11
11
  export declare const CHAIN_NAMESPACE: {
12
12
  readonly Ethereum: "eip155";
13
13
  readonly Bitcoin: "bip122";
@@ -5,7 +5,7 @@ export declare const isChainReference: (maybeChainReference: ChainReference | st
5
5
  export declare const isAssetNamespace: (maybeAssetNamespace: AssetNamespace | string) => maybeAssetNamespace is "cw20" | "cw721" | "erc20" | "erc721" | "slip44" | "native" | "ibc";
6
6
  export declare const isAssetReference: (maybeAssetReference: AssetReference | string) => maybeAssetReference is AssetReference;
7
7
  export declare const isAssetId: (maybeAssetId: AssetId | string) => maybeAssetId is AssetReference;
8
- export declare const isChainId: (maybeChainId: ChainId | string) => maybeChainId is string;
8
+ export declare const isChainId: (maybeChainId: ChainId | string) => maybeChainId is ChainId;
9
9
  export declare const assertIsChainId: (value: ChainId | string | undefined) => asserts value is ChainId;
10
10
  export declare const assertIsChainNamespace: (value: ChainNamespace | string | undefined) => asserts value is ChainNamespace;
11
11
  export declare const assertIsChainReference: (value: ChainReference | string | undefined) => asserts value is ChainReference;
package/dist/utils.d.ts CHANGED
@@ -17,3 +17,8 @@ export declare const makeCosmosHubData: () => {
17
17
  export declare const makeOsmosisData: () => {
18
18
  [x: string]: string;
19
19
  };
20
+ interface Flavoring<FlavorT> {
21
+ _type?: FlavorT;
22
+ }
23
+ export declare type Nominal<T, FlavorT> = T & Flavoring<FlavorT>;
24
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/caip",
3
- "version": "5.2.3",
3
+ "version": "5.3.0",
4
4
  "description": "CAIP Implementation",
5
5
  "homepage": "",
6
6
  "license": "MIT",