Skip to content

@lelantos-org/sdk / internal / matchRef

Function: matchRef() ​

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

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

Find the one asset in known that ref names.

Returns undefined when nothing matches; the caller decides between a fetch and an error, since an id absent from a relayer-supplied list may still be resolvable from the chain.

Parameters ​

ParameterType
knownreadonly AssetInfo[]
refAssetRef

Returns ​

AssetInfo | undefined

Throws ​

when a symbol matches more than one asset. Two tokens may share a symbol, and picking either could send funds to the wrong one.