Skip to content

@lelantos-org/sdk / wallet / matchRef

Function: matchRef() โ€‹

ts
function matchRef(known, ref): AssetInfo | undefined;

Defined in: @lelantos-org/sdk/dist/wallet/asset-ref.d.ts:39

Find the one asset in known that ref names.

undefined when nothing matches โ€” the caller decides whether that is worth a fetch or an error, since an id may be resolvable from the chain even when it is absent from a relayer-supplied list.

Parameters โ€‹

ParameterType
knownreadonly AssetInfo[]
refAssetRef

Returns โ€‹

AssetInfo | undefined

Throws โ€‹

when a symbol matches more than one asset. Two tokens may legitimately share a symbol, and picking either would send funds to whichever happened to be registered first.

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub