diff --git a/src/app/components/tezos-fa-form/tezos-fa-form.store.ts b/src/app/components/tezos-fa-form/tezos-fa-form.store.ts index af09b20b4..4e075dea1 100644 --- a/src/app/components/tezos-fa-form/tezos-fa-form.store.ts +++ b/src/app/components/tezos-fa-form/tezos-fa-form.store.ts @@ -104,7 +104,11 @@ export class TezosFAFormStore extends ComponentStore { }) private updateWithError = this.updater((state: TezosFAFormState, error: unknown) => { - const tezosFAFormError = isTezosFAFormError(error) ? error : unknownError() + const tezosFAFormError = isTezosFAFormError(error) ? error : unknownError(error) + + if (tezosFAFormError.type === TezosFAFormErrorType.UNKNOWN && tezosFAFormError.error) { + console.error(error) + } return { ...state, @@ -253,6 +257,10 @@ export class TezosFAFormStore extends ComponentStore { private async getTokenInterface(contract: TezosContract, tokenInterface?: TokenInterface): Promise { if (!tokenInterface) { const metadata = await this.getContractMetadata(contract) + if (!metadata) { + return undefined + } + if (hasTokenInterface(metadata, TokenInterface.FA1p2)) { return TokenInterface.FA1p2 } else if (hasTokenInterface(metadata, TokenInterface.FA2)) { diff --git a/src/app/components/tezos-fa-form/tezos-fa-form.types.ts b/src/app/components/tezos-fa-form/tezos-fa-form.types.ts index 2d390c6eb..74b7c8b89 100644 --- a/src/app/components/tezos-fa-form/tezos-fa-form.types.ts +++ b/src/app/components/tezos-fa-form/tezos-fa-form.types.ts @@ -49,7 +49,9 @@ export interface ContractNotFoundError extends TezosFAFormBaseError { tokenInterfaces: TokenInterface[] } export interface TokenMetadataMissingError extends TezosFAFormBaseError {} export interface TokenVagueError extends TezosFAFormBaseError { tokens: TokenDetails[] } -export interface UnknownError extends TezosFAFormBaseError {} +export interface UnknownError extends TezosFAFormBaseError { + error?: any +} export type TezosFAFormError = | ContractNotFoundError diff --git a/src/app/components/tezos-fa-form/tezos-fa-form.utils.ts b/src/app/components/tezos-fa-form/tezos-fa-form.utils.ts index c3651457f..a10f11a60 100644 --- a/src/app/components/tezos-fa-form/tezos-fa-form.utils.ts +++ b/src/app/components/tezos-fa-form/tezos-fa-form.utils.ts @@ -22,8 +22,8 @@ export function tokenVaugeError(tokenMetadataRegistry: Record