@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 +8 -0
- package/package.json +3 -3
- package/types/chain-info.d.ts +13 -16
- package/types/chain-util.d.ts +17 -38
- package/types/fetcher.d.ts +25 -33
- package/types/registry.d.ts +9 -11
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.
|
|
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.
|
|
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": "
|
|
81
|
+
"gitHead": "6660513da7c427a1b8166f1a68a1c3af6079ab11"
|
|
82
82
|
}
|
package/types/chain-info.d.ts
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
4
|
+
chain_name: string;
|
|
5
|
+
fetcher: ChainRegistryFetcher;
|
|
8
6
|
}
|
|
9
|
-
|
|
10
7
|
export declare class ChainInfo {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
}
|
package/types/chain-util.d.ts
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
5
|
+
chain_name: string;
|
|
6
|
+
chain_info: ChainInfo;
|
|
14
7
|
}
|
|
15
|
-
|
|
16
8
|
export declare class ChainRegistryChainUtil {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
}
|
package/types/fetcher.d.ts
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
assetLists?: AssetList[];
|
|
5
|
+
chains?: Chain[];
|
|
6
|
+
ibcData?: IBCInfo[];
|
|
7
|
+
urls?: string[];
|
|
15
8
|
}
|
|
16
|
-
|
|
17
9
|
export declare class ChainRegistryFetcher implements ChainRegistry {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
}
|
package/types/registry.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { ChainRegistryChainUtil } from './chain-util';
|
|
2
2
|
import { ChainRegistryFetcher, ChainRegistryFetcherOptions } from './fetcher';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
protected _options: ChainRegistryClientOptions;
|
|
11
|
+
constructor(options: ChainRegistryClientOptions);
|
|
12
|
+
generateUrls(): void;
|
|
13
|
+
getChainUtil(chainName: string): ChainRegistryChainUtil;
|
|
16
14
|
}
|