diff --git a/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts b/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts index b1ca35d58..d070b73ac 100644 --- a/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts +++ b/src/assets/providers/tbtc/solana/WormholeGateway.v2.ts @@ -169,11 +169,20 @@ export function newThresholdWormholeGateway( custodianData.wrappedTbtcMint as string ); const recipientToken = await Token.getAssociatedTokenAddress( - ASSOCIATED_TOKEN_PROGRAM_ID, - TOKEN_PROGRAM_ID, - tbtcMint, - recipient - ); + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + tbtcMint, + recipient + ); + const recipientTokenAta = Token.createAssociatedTokenAccountInstruction( + ASSOCIATED_TOKEN_PROGRAM_ID, + TOKEN_PROGRAM_ID, + tbtcMint, + recipientToken, + recipient, // owner + recipient // payer + ) + console.log(recipientToken); const tokenBridgeWrappedAsset = tokenBridge.deriveWrappedMetaKey( TOKEN_BRIDGE_PROGRAM_ID, wrappedTbtcMint @@ -222,11 +231,13 @@ export function newThresholdWormholeGateway( tokenBridgeProgram: TOKEN_BRIDGE_PROGRAM_ID, coreBridgeProgram: CORE_BRIDGE_PROGRAM_ID, }; - const tx = program.methods + const tx = await program.methods .receiveTbtc(parsed.hash) .accounts(accounts) .transaction(); - return tx; + return new Transaction() + .add(recipientTokenAta) + .add(tx); }; const sendTbtc = async ( @@ -305,8 +316,6 @@ export function newThresholdWormholeGateway( tokenBridgeProgram: TOKEN_BRIDGE_PROGRAM_ID, coreBridgeProgram: CORE_BRIDGE_PROGRAM_ID } - console.log('accounts', Object.entries(wrappedAccounts).map(([k, v]) => [k, v.toBase58()])); - console.log('args', Object.entries(args).map(([k, v]) => [k, v.toString()])); return sendTbtcWrapped(program, args, wrappedAccounts); } else { const gatewayAccounts = { diff --git a/src/components/TokenSelectors/EvmTokenPicker.tsx b/src/components/TokenSelectors/EvmTokenPicker.tsx index 74d6795a8..fc312354e 100644 --- a/src/components/TokenSelectors/EvmTokenPicker.tsx +++ b/src/components/TokenSelectors/EvmTokenPicker.tsx @@ -90,6 +90,12 @@ export default function EvmTokenPicker( const isMigrationEligible = useCallback( (address: string) => { + // TODO at the end of a transfer from from Solanato Eth an error happens + /** + * Select as source solana + * Select as target eth + * Sent the tokens, and hit transfer more tokens button + */ const assetMap = getMigrationAssetMap(chainId); return !!assetMap.get(getEthAddress(address)); },