diff --git a/javascript/engine-js/src/AbstractTokenScript.ts b/javascript/engine-js/src/AbstractTokenScript.ts index 018a560..280b575 100644 --- a/javascript/engine-js/src/AbstractTokenScript.ts +++ b/javascript/engine-js/src/AbstractTokenScript.ts @@ -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 }); } } diff --git a/javascript/tokenscript-viewer/src/components/viewers/util/getSingleTokenMetadata.ts b/javascript/tokenscript-viewer/src/components/viewers/util/getSingleTokenMetadata.ts index bc1cc9a..447e15a 100644 --- a/javascript/tokenscript-viewer/src/components/viewers/util/getSingleTokenMetadata.ts +++ b/javascript/tokenscript-viewer/src/components/viewers/util/getSingleTokenMetadata.ts @@ -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) diff --git a/javascript/tokenscript-viewer/src/components/viewers/util/getTokenScriptWithSingleTokenContext.ts b/javascript/tokenscript-viewer/src/components/viewers/util/getTokenScriptWithSingleTokenContext.ts index ca53ba5..4f16728 100644 --- a/javascript/tokenscript-viewer/src/components/viewers/util/getTokenScriptWithSingleTokenContext.ts +++ b/javascript/tokenscript-viewer/src/components/viewers/util/getTokenScriptWithSingleTokenContext.ts @@ -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];