Skip to content

Commit

Permalink
feat(connect): use network shortcut not just symbol for identification
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Aug 6, 2024
1 parent dba8ea4 commit ce0d388
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/blockchain-link-types/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 4 additions & 1 deletion packages/connect/src/backend/Blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit ce0d388

Please sign in to comment.