Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@exodus/assets-base

Package Overview
Dependencies
Maintainers
0
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/assets-base - npm Package Compare versions

Comparing version 12.0.0 to 12.0.1

LICENSE

10

CHANGELOG.md

@@ -6,2 +6,12 @@ # Change Log

## [12.0.1](https://github.com/ExodusMovement/assets/compare/@exodus/assets-base@12.0.0...@exodus/assets-base@12.0.1) (2024-12-02)
### License
* license: re-license under MIT license (#4586)
## [12.0.0](https://github.com/ExodusMovement/assets/compare/@exodus/assets-base@11.3.2...@exodus/assets-base@12.0.0) (2024-10-21)

@@ -8,0 +18,0 @@

9

package.json
{
"name": "@exodus/assets-base",
"version": "12.0.0",
"version": "12.0.1",
"description": "Base level package for supporting Exodus assets.",

@@ -8,3 +8,3 @@ "type": "module",

"author": "Exodus Movement, Inc.",
"license": "UNLICENSED",
"license": "MIT",
"homepage": "https://github.com/ExodusMovement/assets/tree/master/shield/assets-base",

@@ -107,3 +107,6 @@ "files": [

},
"gitHead": "365c14faa86538156507e78bda1f9d85f6c29111"
"publishConfig": {
"access": "public"
},
"gitHead": "e6da63a2b30d63f37996da247c599d911b43b17b"
}

@@ -7,6 +7,4 @@ # Exodus Assets Base

This package is intended to be for reusable asset names and basic asset properties across Exodus projects.
This package aggregates all built-in asset metadata packages for use across all Exodus projects. Please limit the usage of this package to testing or places where it makes sense. It only makes sense when Custom Tokens or other dynamic asset features are not needed.
It's currently used in desktop, mobile, and pricing server. It will be backported to Exotrack.
## Scripts

@@ -20,2 +18,4 @@

Token names for chains that support Custom Tokens are no longer chose, they need to be generated. Asset names for Custom Tokens are generated by the Custom Tokens Registry. Here we provide the `ct` script for generating the asset names for inclusion into asset metadata libraries as built-in assets.
#### `ct`

@@ -31,3 +31,3 @@

- Have a CMC API KEY set as env variable `CMC_PRO_API_KEY`
- Define `input.yml` (see [asset-lis.yml](scripts/asset-list.yml) example) and
- Define `input.yml` (see [asset-lis-sol-example.yml](scripts/asset-list-sol-example.yml) example) and

@@ -38,3 +38,3 @@ ```

In addition to data to paste in `@exodus/assets-base`, it will print out data to paste in other static files like clients' `scss` files.
The script will output data to be pasted into asset metadata packages. The output may be out-of-date.

@@ -56,3 +56,3 @@ ## Usage

- such that `asset.name !== asset.baseAsset.name`: it is a "non-primary" asset of the chain
- that has a specific `assetType` property: `ETHEREUM_ERC20`, `BINANCE_TOKEN`, `SOLANA_TOKEN`, `OTHER` (ontologygas).
- that has a specific `assetType` property: `ETHEREUM_ERC20`, `BINANCE_TOKEN`, `SOLANA_TOKEN`.

@@ -66,15 +66,12 @@ In some cases a token can be a "gas" token(`feeAsset`): the asset used to pay for fees on the given network (e.g ontologygas, vethor, tfuel).

Note that the lower level implementation of tokens (`accountState`, nomenclature of variables, imports...) isn't standardized yet but it is planned to unify it in the future.
## Asset Attributes Documentation
The `assets-base/src/<asset>.js` files are where we define our supported assets. These files consists of a list of objects that more/less follow this object definition:
Assets are defined in the asset metadata packages. We have one asset metadata package per chain. Example: `@exodus/ethereum-meta` for the Ethereum chain. These packages export objects with the following (partial) list of properties:
```js
{
name: 'aeron',
name: 'aeron_ethereum_deadbeef',
baseAssetName: 'ethereum',
feeAssetName: 'ethereum',
assetType: 'ETHEREUM_ERC20',
properName: 'Aeron (old)',
decimals: 8,

@@ -85,9 +82,7 @@ ticker: 'ARN',

units: [ base: 0, [ticker]: 18 ]
properTicker: 'ARN',
displayName: 'Aeron',
displayTicker: 'ARN',
displayNetworkName: 'Ethereum',
displayNetworkTicker: 'ETH',
addresses: {
current: '0xBA5F11b16B155792Cf3B2E6880E8706859A8AEB6',
},
old: true, // deprecated
addresses: { current: '0xBA5F11b16B155792Cf3B2E6880E8706859A8AEB6' },
}

@@ -100,4 +95,4 @@ ```

| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | The unique identifier of the asset which is used by code in both wallets to reference specific assets. Nuances are [documented here](https://github.com/ExodusMovement/exodus-core/pull/264/files#r456422332). | :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 |
| `name` | The unique identifier of the asset which is used by code in all wallets to reference specific assets. | :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. |
| `displayName` | The name of the asset, as displayed to the user in our wallets. | :point_left: | :point_left: | n/a |
| `decimals` | Many assets support fractional values. 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 |

@@ -108,3 +103,3 @@ | `baseAssetName` (optional) | The base asset name. This field only applies to tokens. The base asset of tokens is the primary asset of a blockchain. If this field is not defined it MUST fall back to `name`. This makes primary assets on chains without tokens their own base asset. E.g. the `baseAssetName` of ERC20 tokens on the Ethereum network is `ethereum`. E.g. the `baseAssetName` of `bitcoin` is `bitcoin`. | This field is mapped into an asset object to be accessed as `asset.baseAsset` | This field is mapped into an asset object to be accessed as `asset.baseAsset` | n/a |

| `ticker` | A secondary unique identifier for assets. It is used for anything that requires the asset's symbol (eg: Bitcoin -> BTC). | On desktop it is not required to be unique in the code, however we should treat it as unique because of mobile and exchange usage. | 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. |
| `properTicker` (optional) | The ticker we display to the user. This field MUST fall back to the value of `ticker` if not defined. It MAY only be used for display purposes. | :point_left: | :point_left: | n/a |
| `displayTicker` (optional) | The ticker we display to the user. This field MUST fall back to the value of `ticker` if not defined. It MAY only be used for display purposes. | :point_left: | :point_left: | n/a |
| `tickerAlias` (optional) | This property is specific to Ethereum-like tokens (but may be ported to others). It updates the `Unit` object to recognize `tickerAlias` as the same unit as `ticker`. | :point_left: | :point_left: | n/a |

@@ -116,3 +111,2 @@ | `tickerAliases` (optional) | This property is specific to Ethereum-like tokens (but may be ported to others). It behaves the same as `tickerAlias` except that it is an array of aliases. | :point_left: | :point_left: | n/a |

| `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) (deprecated) | 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](https://github.com/ExodusMovement/exodus-core/pull/264/files#r456422332). | :point_left: | :point_left: | :point_left: |

@@ -123,6 +117,4 @@ Some notes on the above from @faris:

>
> `ticker` is required to be unique on mobile. Desktop does not have that requirement but since it is on mobile, we must treat it as such on desktop too. The requests to the pricing server and the exchange use `ticker` (updated by @feri).
> `ticker` is required to be unique. The requests to the pricing server and the exchange use `ticker` (updated by @feri).
>
> 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, the `old` EOS would activate instead of the new EOS.
>
> To solve this, we added a hack which introduced the `old` property. The `old` property was meant to imply that there is an identifical `ticker` for a newer asset. So for the exchange, we skip over the old assets and activate the ones without the `old` property.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc