Skip to content

Commit

Permalink
Aug 24, 2024, 12:12 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 24, 2024
1 parent 4e6df02 commit fca9707
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/custom-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,12 @@ export function getAdapter(relay: Relay, paraId: number){

export function getAssetRegistryObject(paraId: number, localId: string, relay: Relay): MyAssetRegistryObject{
let assetRegistry = getAssetRegistry(relay)
const formattedLocalId = JSON.stringify(localId).replace(/\\|"/g, "")
let asset = assetRegistry.find((assetRegistryObject: MyAssetRegistryObject) => {
if(paraId === 0 && assetRegistryObject.tokenData.chain === 0){
return true
}
return assetRegistryObject.tokenData.chain === paraId && JSON.stringify(assetRegistryObject.tokenData.localId).replace(/\\|"/g, "") === localId
return assetRegistryObject.tokenData.chain === paraId && JSON.stringify(assetRegistryObject.tokenData.localId).replace(/\\|"/g, "") === formattedLocalId
})
if(asset === undefined){
// throw new Error(`Balance Adapter: Asset not found in registry: chainId: ${paraId}, localId: ${localId} | localId stringify: ${JSON.stringify(localId)}`)
Expand Down

0 comments on commit fca9707

Please sign in to comment.