Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@exodus/assets-base
Advanced tools
[![npm][npm-image]][npm-url] [npm-image]: https://img.shields.io/npm/v/@exodus/assets-base.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/@exodus/assets-base
This package is intended to be for reusable asset names and basic asset properties across Exodus projects.
It's currently used in desktop, mobile, and pricing server. It will be backported to Exotrack.
yarn add @exodus/assets-base
import assets from '@exodus/assets-base'
for (const [key, val] of Object.entries(assets)) {
console.log(`${key}: ${val.properName}`) // bitcoin: Bitcoin
}
The assets/base/src/erc20-tokens/tokens.js
file is where we define our supported ERC-20 assets (note that these properties also apply to (mostly) all other assets in asset-base.js
). This file consists of a list of objects that more/less follow this object definition:
{
name: 'aeron',
properName: 'Aeron (old)',
decimals: 8,
ticker: 'ARN',
addresses: {
current: '0xBA5F11b16B155792Cf3B2E6880E8706859A8AEB6',
},
old: true,
}
These attributes are defined as follows:
Attribute | Definition | Desktop Usage | Mobile Usage | Pricing Server/Exchange Usage |
---|---|---|---|---|
name | The unique identifier of the asset which is used by code in both wallets to reference specific assets. Nuances are documented here. | :point_left: | :point_left: | name is notably, not used when making requests to the pricing and exchange servers; in those cases, ticker is used. See the ticker section below for details. |
properName | The name of the asset, as displayed to the user in our wallets. | :point_left: | :point_left: | n/a |
decimals | Many token contracts support fractional tokens. They accomplish this by using a scaling factor denoted by the value of decimals. This value indicates how many zeroes there are to the right of the decimal point the fixed-point representation of a token. | :point_left: | :point_left: | n/a |
ticker | A secondary unique identifier for assets. It is used for anything that requires the asset's symbol (eg: Bitcoin -> BTC). | This is used by desktop and mapped to a legacy property in that codebase called displayUnit . | In mobile, this attribute is used as a unique identifier to reference an asset. | In both cases, this attribute is used as an idenfiifer to reference a specific asset when interfacing with the exchange and pricing servers. Note that it is possible for two assets to have the same ticker - in these cases, the old attribute is used to differentiate between the two. |
addresses | These are the contract addresses. They are used to detect transactions/balances/send. Without them then you wouldn't know how to look up which token this is on the ETH blockchain. | :point_left: | :point_left: | n/a |
old (optional) | This flag exists to handle cases in which an asset has upgraded to it's own mainnet or the underlying contract has been upgraded. In these cases, there would be two assets with similar tickers and this flag would be used to imply the differentiation between the two. Details on how this works can be found here. | :point_left: | :point_left: | :point_left: |
Some notes on the above from @faris:
name
is required to be unique. No two assets can have the samename
. This is how assets are referenced.
ticker
doesn't have that requirement. However, the requests to the pricing server and the exchange useticker
. So when you have two identicaltickers
, things get messy.For the exchange specifically, if two assets have the same
ticker
, the wrong asset could activate on the exchange screen in the wallet. This would happen with mainnet swaps. For instance, theold
EOS would activate instead of the new EOS.To solve this, we added a hack which introduced the
old
property. Theold
property was meant to imply that there is an identificalticker
for a newer asset. So for the exchange, we skip over the old assets and activate the ones without theold
property.
FAQs
Base level package for supporting Exodus assets.
The npm package @exodus/assets-base receives a total of 3,763 weekly downloads. As such, @exodus/assets-base popularity was classified as popular.
We found that @exodus/assets-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 99 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.