Skip to content

Commit

Permalink
fix: originId selection
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Nov 27, 2024
1 parent 51f41fc commit 4564c9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion javascript/engine-js/src/AbstractTokenScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export abstract class AbstractTokenScript implements ITokenScript {
blockChain: 'eth',
tokenType: contract.getInterface() ?? "erc721",
chainId: addresses[key].chain,
contractAddress: addresses[key].address,
contractAddress: addresses[key].address
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getSingleTokenMetadata = async (chain: number, contract: string, to
selectedOrigin = {
...selectedOrigin,
...meta,
name: meta.title
name: meta?.title
};

if (meta.contractType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export async function getTokenScriptWithSingleTokenContext(
// Try to load single token
const singleTokenData = await getSingleTokenMetadata(selectedOrigin.chainId, selectedOrigin.contractAddress, tokenId, tokenScript.getEngine());

// If name isn't provided let's fall back to the name specified in the
if (!singleTokenData.collection.name)
singleTokenData.collection.name = selectedOrigin.originId;

selectedOrigin = {...singleTokenData.collection, ...selectedOrigin}
if (singleTokenData.detail)
selectedOrigin.tokenDetails = [singleTokenData.detail];
Expand Down

0 comments on commit 4564c9f

Please sign in to comment.