npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@defisaver/tokens

v1.5.51

Published

Centralized asset data & utility functions

Downloads

2,600

Readme

@defisaver/tokens

Table of contents

Type aliases

Variables

Functions

Type aliases

AaveMarketData

Ƭ AaveMarketData: Object

Type declaration

| Name | Type | | :------ | :------ | | dataProvider | string | | lendingPool | string | | lendingPoolAddressProvider | string | | name | string |

Defined in

types.ts:70


AddressMapping

Ƭ AddressMapping: Object

Index signature

▪ [key: number]: string

Defined in

types.ts:6


AssetData

Ƭ AssetData: Object

Chain-specific asset info type

Type declaration

| Name | Type | | :------ | :------ | | aaveCollateral | boolean | | address | string | | addresses | AddressMapping | | compoundCollateral | boolean | | decimals | number | | exchange | boolean | | feedAvailability | BoolMapping | | icon | Function | | isStable | boolean | | name | string | | nativeChainId | number | | symbol | string | | underlyingAsset | string | | yearnCollateral | boolean |

Defined in

types.ts:36


AssetDataBase

Ƭ AssetDataBase: Object

Chain-agnostic asset info type

Type declaration

| Name | Type | | :------ | :------ | | aaveCollateral | boolean | | addresses | AddressMapping | | compoundCollateral | boolean | | decimals | number | | exchange | boolean | | feedAvailability | BoolMapping | | icon | Function | | isStable | boolean | | name | string | | nativeChainId | number | | symbol | string | | underlyingAsset | string | | yearnCollateral | boolean |

Defined in

types.ts:17


ExtendedIlkData

Ƭ ExtendedIlkData: IlkData | { assetData: AssetData }

Defined in

types.ts:77


IlkData

Ƭ IlkData: Object

Maker ilk info type

Type declaration

| Name | Type | | :------ | :------ | | asset | string | | assetAddress? | string | | clip? | string | | clipCalc? | string | | flip? | string | | ilkBytes | string | | ilkLabel | string | | isCrop | boolean | | isLP | boolean | | join | string | | pip | string |

Defined in

types.ts:56

Variables

MAXUINT

MAXUINT: string = '115792089237316195423570985008687907853269984665640564039457584007913129639935'

Defined in

index.ts:27


aaveV2Markets

aaveV2Markets: AaveMarketData[]

Defined in

aaveV2Markets.ts:3


assets

assets: AssetDataBase[]

Defined in

assets.ts:254


ilks

ilks: IlkData[]

Defined in

ilks.ts:5


reflexerCollTypes

reflexerCollTypes: IlkData[]

Defined in

reflexerCollTypes.ts:3


utils

utils: Object

Type declaration

| Name | Type | | :------ | :------ | | bytesToString | (hex: string) => string | | compare | (a: string, b: string) => boolean | | stringToBytes | (str: string) => string |

Defined in

index.ts:25

Functions

assetAmountInEth

Const assetAmountInEth(amount, asset?): string

Parameters

| Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | amount | string | number | object | undefined | Amount in wei | | asset | string | 'ETH' | Asset symbol (or MCD-${symbol} for maker asset - always 18dec) |

Returns

string

Defined in

index.ts:149


assetAmountInWei

Const assetAmountInWei(amount, asset): string

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | amount | string | number | object | Amount in eth | | asset | string | Asset symbol |

Returns

string

Defined in

index.ts:170


getAaveV2MarketInfo

Const getAaveV2MarketInfo(name?): void | AaveMarketData

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | name | string | '' |

Returns

void | AaveMarketData

Defined in

index.ts:142


getAssetInfo

Const getAssetInfo(symbol?, chainId?): AssetData

Returns asset info. Warning: will not throw if asset not found. Instead, will return a placeholder object.

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | symbol | string | '' | | chainId? | number | undefined |

Returns

AssetData

Defined in

index.ts:60


getAssetInfoByAddress

Const getAssetInfoByAddress(address?, chainId?): AssetData

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | address | string | '' | | chainId? | number | undefined |

Returns

AssetData

Defined in

index.ts:95


getIlkInfo

Const getIlkInfo(ilk?): ExtendedIlkData

Returns Maker or Reflexer ilk info, and asset info as assetData attribute. Warning: will not throw if ilk not found. Instead, will return a placeholder object.

Parameters

| Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | ilk | string | '' | Ilk encoded as string or as hex |

Returns

ExtendedIlkData

Defined in

index.ts:73


ilkToAsset

Const ilkToAsset(ilk?): string

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | ilk | string | '' |

Returns

string

Defined in

index.ts:100


set

Const set(key, value): void

Parameters

| Name | Type | | :------ | :------ | | key | string | | value | any |

Returns

void

Defined in

index.ts:21


tokenFromJoin

Const tokenFromJoin(join, fromIlks?): string

Parameters

| Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | join | string | undefined | Maker or Reflexer ilk join | | fromIlks | IlkData[] | ilks | |

Returns

string

Token symbol

Defined in

index.ts:122


tokenFromMakerJoin

Const tokenFromMakerJoin(join): string

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | join | string | Maker ilk join |

Returns

string

Token symbol

Defined in

index.ts:134


tokenFromReflexerJoin

Const tokenFromReflexerJoin(join): string

Parameters

| Name | Type | Description | | :------ | :------ | :------ | | join | string | Reflexer ilk join |

Returns

string

Token symbol

Defined in

index.ts:140