@chain-registry/client 1.14.0 → 1.14.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.14.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.14.0...@chain-registry/client@1.14.1) (2023-07-12)
7
+
8
+ **Note:** Version bump only for package @chain-registry/client
9
+
10
+
11
+
12
+
13
+
6
14
  # [1.14.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.13.0...@chain-registry/client@1.14.0) (2023-07-11)
7
15
 
8
16
  **Note:** Version bump only for package @chain-registry/client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chain-registry/client",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Chain Registry Client",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmology-tech/chain-registry",
@@ -74,9 +74,9 @@
74
74
  "dependencies": {
75
75
  "@babel/runtime": "^7.21.0",
76
76
  "@chain-registry/types": "^0.16.0",
77
- "@chain-registry/utils": "^1.13.0",
77
+ "@chain-registry/utils": "^1.13.1",
78
78
  "bfs-path": "^1.0.2",
79
79
  "cross-fetch": "^3.1.5"
80
80
  },
81
- "gitHead": "235baabaa618def6fc1bd1de9cd84660c30d1d71"
81
+ "gitHead": "6660513da7c427a1b8166f1a68a1c3af6079ab11"
82
82
  }
@@ -1,22 +1,19 @@
1
1
  import { AssetList, Chain, IBCInfo } from '@chain-registry/types';
2
-
3
2
  import { ChainRegistryFetcher } from './fetcher';
4
-
5
3
  export interface ChainInfoOptions {
6
- chain_name: string;
7
- fetcher: ChainRegistryFetcher;
4
+ chain_name: string;
5
+ fetcher: ChainRegistryFetcher;
8
6
  }
9
-
10
7
  export declare class ChainInfo {
11
- chain_name: string;
12
- fetcher: ChainRegistryFetcher;
13
- protected _chain: Chain;
14
- protected _asset_list: AssetList;
15
- protected _asset_lists: AssetList[];
16
- protected _ibc_data: IBCInfo[];
17
- constructor(options: ChainInfoOptions);
18
- refresh(): void;
19
- get chain(): Chain;
20
- get nativeAssetLists(): AssetList;
21
- get assetLists(): AssetList[];
8
+ chain_name: string;
9
+ fetcher: ChainRegistryFetcher;
10
+ protected _chain: Chain;
11
+ protected _asset_list: AssetList;
12
+ protected _asset_lists: AssetList[];
13
+ protected _ibc_data: IBCInfo[];
14
+ constructor(options: ChainInfoOptions);
15
+ refresh(): void;
16
+ get chain(): Chain;
17
+ get nativeAssetLists(): AssetList;
18
+ get assetLists(): any[];
22
19
  }
@@ -1,44 +1,23 @@
1
1
  import { Asset } from '@chain-registry/types';
2
- import type {
3
- CoinDenom,
4
- CoinGeckoUSD,
5
- Exponent,
6
- PriceHash
7
- } from '@chain-registry/utils';
8
-
2
+ import type { CoinDenom, CoinGeckoUSD, Exponent, PriceHash } from '@chain-registry/utils';
9
3
  import { ChainInfo } from './chain-info';
10
-
11
4
  export interface ChainRegistryChainUtilOptions {
12
- chain_name: string;
13
- chain_info: ChainInfo;
5
+ chain_name: string;
6
+ chain_info: ChainInfo;
14
7
  }
15
-
16
8
  export declare class ChainRegistryChainUtil {
17
- chain_name: string;
18
- chain_info: ChainInfo;
19
- all_Asset: Asset[];
20
- constructor(options: ChainRegistryChainUtilOptions);
21
- getAssetByDenom(denom: CoinDenom): Asset;
22
- getDenomByCoinGeckoId(coinGeckoId: string): CoinDenom;
23
- getSymbolByChainDenom(denom: CoinDenom): string;
24
- getChainDenomBySymbol(token: string): CoinDenom;
25
- getExponentByDenom(denom: CoinDenom): Exponent;
26
- convertCoinGeckoPricesToDenomPriceMap(
27
- prices: Record<string, CoinGeckoUSD>
28
- ): PriceHash;
29
- noDecimals(num: number | string): string;
30
- convertBaseUnitsToDollarValue(
31
- prices: PriceHash,
32
- symbol: string,
33
- amount: string | number
34
- ): string;
35
- convertDollarValueToDenomUnits(
36
- prices: PriceHash,
37
- symbol: string,
38
- value: string | number
39
- ): string;
40
- convertBaseUnitsToDisplayUnits(
41
- symbol: string,
42
- amount: string | number
43
- ): string;
9
+ chain_name: string;
10
+ chain_info: ChainInfo;
11
+ _all_Asset: Asset[];
12
+ constructor(options: ChainRegistryChainUtilOptions);
13
+ getAssetByDenom(denom: CoinDenom): Asset;
14
+ getDenomByCoinGeckoId(coinGeckoId: string): CoinDenom;
15
+ getSymbolByChainDenom(denom: CoinDenom): string;
16
+ getChainDenomBySymbol(token: string): CoinDenom;
17
+ getExponentByDenom(denom: CoinDenom): Exponent;
18
+ convertCoinGeckoPricesToDenomPriceMap(prices: Record<string, CoinGeckoUSD>): PriceHash;
19
+ noDecimals(num: number | string): string;
20
+ convertBaseUnitsToDollarValue(prices: PriceHash, symbol: string, amount: string | number): string;
21
+ convertDollarValueToDenomUnits(prices: PriceHash, symbol: string, value: string | number): string;
22
+ convertBaseUnitsToDisplayUnits(symbol: string, amount: string | number): string;
44
23
  }
@@ -1,38 +1,30 @@
1
- import {
2
- AssetList,
3
- Chain,
4
- ChainRegistry,
5
- IBCInfo
6
- } from '@chain-registry/types';
7
-
1
+ import { AssetList, Chain, ChainRegistry, IBCInfo } from '@chain-registry/types';
8
2
  import { ChainInfo } from './chain-info';
9
-
10
3
  export interface ChainRegistryFetcherOptions {
11
- assetLists?: AssetList[];
12
- chains?: Chain[];
13
- ibcData?: IBCInfo[];
14
- urls?: string[];
4
+ assetLists?: AssetList[];
5
+ chains?: Chain[];
6
+ ibcData?: IBCInfo[];
7
+ urls?: string[];
15
8
  }
16
-
17
9
  export declare class ChainRegistryFetcher implements ChainRegistry {
18
- urls: string[];
19
- protected _asset_lists: AssetList[];
20
- protected _chains: Chain[];
21
- protected _ibc_data: IBCInfo[];
22
- private chainInfoList: ChainInfo[];
23
- constructor(options: ChainRegistryFetcherOptions);
24
- get chains(): Chain[];
25
- get assetLists(): AssetList[];
26
- get ibcData(): IBCInfo[];
27
- getChain(chainName: string): Chain;
28
- getChainAssetList(chainName: string): AssetList;
29
- getGeneratedAssetLists(chainName: string): AssetList[];
30
- getChainIbcData(chainName: string): IBCInfo;
31
- getChainInfo(chainName: string): ChainInfo;
32
- upsertChain(data: Chain): void;
33
- updateAssetList(data: AssetList): void;
34
- upsertIbcData(data: IBCInfo): void;
35
- update(data: Chain | AssetList | IBCInfo): void;
36
- fetch(url): Promise<void>;
37
- fetchUrls(): Promise<void[]>;
10
+ urls: string[];
11
+ protected _asset_lists: AssetList[];
12
+ protected _chains: Chain[];
13
+ protected _ibc_data: IBCInfo[];
14
+ private chainInfoList;
15
+ constructor(options?: ChainRegistryFetcherOptions);
16
+ get chains(): Chain[];
17
+ get assetLists(): AssetList[];
18
+ get ibcData(): IBCInfo[];
19
+ getChain(chainName: string): Chain;
20
+ getChainAssetList(chainName: string): AssetList;
21
+ getGeneratedAssetLists(chainName: string): AssetList[];
22
+ getChainIbcData(chainName: string): IBCInfo[];
23
+ getChainInfo(chainName: string): ChainInfo;
24
+ upsertChain(data: Chain): void;
25
+ updateAssetList(data: AssetList): void;
26
+ upsertIbcData(data: IBCInfo): void;
27
+ update(data: Chain | AssetList | IBCInfo): void;
28
+ fetch(url: any): Promise<void>;
29
+ fetchUrls(): Promise<void[]>;
38
30
  }
@@ -1,16 +1,14 @@
1
1
  import { ChainRegistryChainUtil } from './chain-util';
2
2
  import { ChainRegistryFetcher, ChainRegistryFetcherOptions } from './fetcher';
3
-
4
- export interface ChainRegistryClientOptions
5
- extends ChainRegistryFetcherOptions {
6
- chainNames: string[];
7
- assetListNames?: string[];
8
- ibcNamePairs?: string[][];
9
- baseUrl?: string;
3
+ export interface ChainRegistryClientOptions extends ChainRegistryFetcherOptions {
4
+ chainNames: string[];
5
+ assetListNames?: string[];
6
+ ibcNamePairs?: string[][];
7
+ baseUrl?: string;
10
8
  }
11
9
  export declare class ChainRegistryClient extends ChainRegistryFetcher {
12
- protected _options: ChainRegistryClientOptions;
13
- constructor(options: ChainRegistryClientOptions);
14
- generateUrls(): void;
15
- getChainUtil(chainName: string): ChainRegistryChainUtil;
10
+ protected _options: ChainRegistryClientOptions;
11
+ constructor(options: ChainRegistryClientOptions);
12
+ generateUrls(): void;
13
+ getChainUtil(chainName: string): ChainRegistryChainUtil;
16
14
  }