Skip to main content

Class: AssetRegistry

Defined in: packages/overcast-core/src/assets/index.ts:73

An in-memory lookup from asset address to its curated Asset metadata.

The core package ships the class only — it is deliberately never populated here. Each deployment (e.g. the backend) constructs an instance from its own hard-coded allowlist, which doubles as the set of assets it will accept.

Constructors

Constructor

new AssetRegistry(assets?): AssetRegistry;

Defined in: packages/overcast-core/src/assets/index.ts:76

Parameters

ParameterTypeDefault value
assetsobject[][]

Returns

AssetRegistry

Methods

get()

get(address):
| {
address: string;
cashLike?: boolean;
chain?: string;
coinGeckoId?: string;
decimals?: number;
lastKnownPriceUsd?: number;
logoUrl?: string;
name?: string;
rwa?: boolean;
symbol?: string;
volatility?: number;
}
| undefined;

Defined in: packages/overcast-core/src/assets/index.ts:91

The asset for an address, or undefined if it isn't registered.

Parameters

ParameterType
addressstring

Returns

Type Literal
{
address: string;
cashLike?: boolean;
chain?: string;
coinGeckoId?: string;
decimals?: number;
lastKnownPriceUsd?: number;
logoUrl?: string;
name?: string;
rwa?: boolean;
symbol?: string;
volatility?: number;
}
address
address: string;

The on-chain address (mint) that uniquely identifies the asset.

cashLike?
optional cashLike?: boolean;

Whether or not the asset can be treated similar to cash

chain?
optional chain?: string;

The chain the asset lives on.

coinGeckoId?
optional coinGeckoId?: string;

CoinGecko id for price lookups, e.g. usd-coin.

decimals?
optional decimals?: number;

Number of decimal places in the asset's native units.

lastKnownPriceUsd?
optional lastKnownPriceUsd?: number;

Last known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset.

logoUrl?
optional logoUrl?: string;

Logo of the coin

name?
optional name?: string;

Human name of the asset.

rwa?
optional rwa?: boolean;

Whether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset.

symbol?
optional symbol?: string;

Human ticker, e.g. USDC.

volatility?
optional volatility?: number;

Volatility of the asset


undefined


getOrDefault()

getOrDefault(address): object;

Defined in: packages/overcast-core/src/assets/index.ts:108

Like get, but defaults the asset if not available

Parameters

ParameterType
addressstring

Returns

address
address: string;

The on-chain address (mint) that uniquely identifies the asset.

cashLike?
optional cashLike?: boolean;

Whether or not the asset can be treated similar to cash

chain?
optional chain?: string;

The chain the asset lives on.

coinGeckoId?
optional coinGeckoId?: string;

CoinGecko id for price lookups, e.g. usd-coin.

decimals?
optional decimals?: number;

Number of decimal places in the asset's native units.

lastKnownPriceUsd?
optional lastKnownPriceUsd?: number;

Last known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset.

logoUrl?
optional logoUrl?: string;

Logo of the coin

name?
optional name?: string;

Human name of the asset.

rwa?
optional rwa?: boolean;

Whether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset.

symbol?
optional symbol?: string;

Human ticker, e.g. USDC.

volatility?
optional volatility?: number;

Volatility of the asset


has()

has(address): boolean;

Defined in: packages/overcast-core/src/assets/index.ts:96

Whether an address is a registered (allowlisted) asset.

Parameters

ParameterType
addressstring

Returns

boolean


list()

list(): object[];

Defined in: packages/overcast-core/src/assets/index.ts:86

Every registered asset, in insertion order.

Returns


register()

register(asset): void;

Defined in: packages/overcast-core/src/assets/index.ts:81

Add (or overwrite) an asset, keyed by its address.

Parameters

ParameterTypeDescription
asset{ address: string; cashLike?: boolean; chain?: string; coinGeckoId?: string; decimals?: number; lastKnownPriceUsd?: number; logoUrl?: string; name?: string; rwa?: boolean; symbol?: string; volatility?: number; }-
asset.addressstringThe on-chain address (mint) that uniquely identifies the asset.
asset.cashLike?booleanWhether or not the asset can be treated similar to cash
asset.chain?stringThe chain the asset lives on.
asset.coinGeckoId?stringCoinGecko id for price lookups, e.g. usd-coin.
asset.decimals?numberNumber of decimal places in the asset's native units.
asset.lastKnownPriceUsd?numberLast known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset.
asset.logoUrl?stringLogo of the coin
asset.name?stringHuman name of the asset.
asset.rwa?booleanWhether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset.
asset.symbol?stringHuman ticker, e.g. USDC.
asset.volatility?numberVolatility of the asset

Returns

void


require()

require(address): object;

Defined in: packages/overcast-core/src/assets/index.ts:101

Like get, but throws when the asset isn't registered.

Parameters

ParameterType
addressstring

Returns

address
address: string;

The on-chain address (mint) that uniquely identifies the asset.

cashLike?
optional cashLike?: boolean;

Whether or not the asset can be treated similar to cash

chain?
optional chain?: string;

The chain the asset lives on.

coinGeckoId?
optional coinGeckoId?: string;

CoinGecko id for price lookups, e.g. usd-coin.

decimals?
optional decimals?: number;

Number of decimal places in the asset's native units.

lastKnownPriceUsd?
optional lastKnownPriceUsd?: number;

Last known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset.

logoUrl?
optional logoUrl?: string;

Logo of the coin

name?
optional name?: string;

Human name of the asset.

rwa?
optional rwa?: boolean;

Whether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset.

symbol?
optional symbol?: string;

Human ticker, e.g. USDC.

volatility?
optional volatility?: number;

Volatility of the asset