From ce0d388f7849b53a23eb232d68468dd4f0b09792 Mon Sep 17 00:00:00 2001 From: tomasklim Date: Tue, 6 Aug 2024 14:11:10 +0200 Subject: [PATCH] feat(connect): use network shortcut not just symbol for identification --- packages/blockchain-link-types/src/common.ts | 1 + packages/connect/src/backend/Blockchain.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/blockchain-link-types/src/common.ts b/packages/blockchain-link-types/src/common.ts index 0d9fbeed2140..57e457921f2f 100644 --- a/packages/blockchain-link-types/src/common.ts +++ b/packages/blockchain-link-types/src/common.ts @@ -32,6 +32,7 @@ export interface ServerInfo { blockHeight: number; blockHash: string; consensusBranchId?: number; // zcash current branch id + network?: string; // old Blockbooks do not have network set } export type TokenStandard = 'ERC20' | 'ERC1155' | 'ERC721' | 'SPL'; diff --git a/packages/connect/src/backend/Blockchain.ts b/packages/connect/src/backend/Blockchain.ts index 7cc5e54c0e27..f1937ad4bfe7 100644 --- a/packages/connect/src/backend/Blockchain.ts +++ b/packages/connect/src/backend/Blockchain.ts @@ -130,7 +130,10 @@ export class Blockchain { const shortcut = getNormalizedShortcut(this.coinInfo.shortcut); - if (info.shortcut.toLowerCase() !== shortcut.toLowerCase()) { + if ( + info.network?.toLowerCase() !== shortcut.toLowerCase() && + info.shortcut.toLowerCase() !== shortcut.toLowerCase() + ) { throw ERRORS.TypedError('Backend_Invalid'); }