diff --git a/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts b/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts index b111b648c..caba8a1ed 100644 --- a/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts +++ b/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts @@ -14,7 +14,10 @@ import { THRESHOLD_TBTC_SOLANA_PROGRAM, } from "../../../../utils/consts"; import { - CHAIN_ID_ETH, + CHAIN_ID_ARBITRUM, + CHAIN_ID_BASE, + CHAIN_ID_OPTIMISM, + CHAIN_ID_POLYGON, CHAIN_ID_SOLANA, ChainId, SignedVaa, @@ -176,6 +179,18 @@ function sendTbtcWrapped( return tx; } +const CANNONICAL_CHAINS: number[] = [ + CHAIN_ID_POLYGON, + CHAIN_ID_OPTIMISM, + CHAIN_ID_ARBITRUM, + CHAIN_ID_BASE, + CHAIN_ID_SOLANA, +]; + +const isCanonical = (chainId: number) => { + return CANNONICAL_CHAINS.includes(chainId); +}; + /** * Send tBtc beween gateways allow burn and mint of tBtc */ @@ -347,7 +362,7 @@ export function newThresholdWormholeGateway( new PublicKey(senderToken), new PublicKey(wallet.getAddress()!) ); - if (recipientChain === CHAIN_ID_ETH) { + if (!isCanonical(recipientChain)) { const wrappedAccounts = { custodian, wrappedTbtcToken,