-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4895a4
commit 0537055
Showing
8 changed files
with
70 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Asset, AssetDenomUnit, AssetList } from '@chain-registry/types'; | ||
export type Denom = AssetDenomUnit['denom']; | ||
export type Exponent = AssetDenomUnit['exponent']; | ||
export declare const customFind: <T>(array: T[], filterFn: (item: T) => boolean) => T | undefined; | ||
export declare const getAssetByDenom: (assets: AssetList[], denom: Denom, chainName?: string) => Asset | undefined; | ||
export declare const getAssetBySymbol: (assets: AssetList[], symbol: string, chainName?: string) => Asset | undefined; | ||
export declare const getDenomByCoinGeckoId: (assets: AssetList[], coinGeckoId: string, chainName?: string) => Denom | undefined; | ||
type GetCoinGeckoIdByDenomOptions = { | ||
chainName?: string; | ||
allowTestnet?: boolean; | ||
customAssetFilter?: (asset: Asset) => boolean; | ||
excludedChainNames?: string[]; | ||
}; | ||
export declare const getCoinGeckoIdByDenom: (assets: AssetList[], denom: Denom, { chainName, allowTestnet, customAssetFilter, excludedChainNames }?: GetCoinGeckoIdByDenomOptions) => string | undefined; | ||
export declare const getSymbolByDenom: (assets: AssetList[], denom: Denom, chainName?: string) => string | undefined; | ||
export declare const getDenomBySymbol: (assets: AssetList[], symbol: string, chainName?: string) => Denom | undefined; | ||
export declare const getExponentFromAsset: (asset: Asset) => number | undefined; | ||
export declare const getExponentByDenom: (assets: AssetList[], denom: Denom, chainName?: string) => Exponent | undefined; | ||
export declare const getExponentBySymbol: (assets: AssetList[], symbol: string, chainName?: string) => Exponent | undefined; | ||
export declare const getNativeTokenByChainName: (assets: AssetList[], chainName: string) => Asset | undefined; | ||
export declare const getTokenLogoByDenom: (assets: AssetList[], denom: Denom, chainName?: string) => string | undefined; | ||
export declare const getChainLogo: (assets: AssetList[], chainName: string) => string | undefined; | ||
export declare const getTokenNameByDenom: (assets: AssetList[], denom: Denom, chainName?: string) => string | undefined; | ||
export declare const getChainNameByDenom: (assets: AssetList[], denom: Denom) => string | undefined; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { AssetList } from '@chain-registry/types'; | ||
import { Denom } from './assets'; | ||
export interface CoinGeckoUSDPrice { | ||
usd: number; | ||
} | ||
export interface DenomPriceMap { | ||
[key: Denom]: number; | ||
} | ||
export declare const mapCoinGeckoPricesToDenoms: (assets: AssetList[], prices: Record<string, CoinGeckoUSDPrice>) => DenomPriceMap; | ||
export declare const roundDown: (value: number | string) => string; | ||
export declare const convertBaseUnitToDollarValue: (assets: AssetList[], prices: DenomPriceMap, symbol: string, amount: string | number, chainName?: string) => string; | ||
export declare const convertDollarValueToBaseUnit: (assets: AssetList[], prices: DenomPriceMap, symbol: string, value: string | number, chainName?: string) => string; | ||
export declare const convertBaseUnitToDisplayUnit: (assets: AssetList[], symbol: string, amount: string | number, chainName?: string) => string; | ||
export declare const convertDisplayUnitToBaseUnit: (assets: AssetList[], symbol: string, amount: string | number, chainName?: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Chain } from '@chain-registry/types'; | ||
export declare const getGasPriceRangesFromChain: (chain: Chain) => { | ||
low: number; | ||
average: number; | ||
high: number; | ||
}; | ||
export declare const getChainByChainName: (chains: Chain[], chainName: string) => Chain | undefined; | ||
export declare const getChainByChainId: (chains: Chain[], chainId: string) => Chain | undefined; | ||
export declare const getChainNameByChainId: (chains: Chain[], chainId: string) => string | undefined; | ||
export declare const getChainIdByChainName: (chains: Chain[], chainName: string) => string | undefined; | ||
export declare const getChainGasPriceRanges: (chains: Chain[], chainName: string) => { | ||
low: number; | ||
average: number; | ||
high: number; | ||
} | undefined; | ||
export declare const getChainPrettyName: (chains: Chain[], chainName: string) => string | undefined; | ||
export declare const getChainBech32Prefix: (chains: Chain[], chainName: string) => string | undefined; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './asset-list-util'; | ||
export * from './fees'; | ||
export * from './utils'; | ||
export * from './ibc'; | ||
export * from './calc'; | ||
export * from './chains'; | ||
export * from './assets'; |
This file was deleted.
Oops, something went wrong.