@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 โ
| Parameter | Type |
|---|---|
known | readonly AssetInfo[] |
ref | AssetRef |
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.