To cancel the stream, you can follow example below.
constsourceChain=CHAIN_ID_BSC;consttargetChain=CHAIN_ID_SOLANA;constreceiver="<evm address>";constsender="<evm address>";consttokenMint="<solana mint address>";constdataAccount="<pubkey of stream data account>";constcancelReceipt=awaitethClient.cancelStream(sender, receiver, tokenMint, dataAccount);
Now you can find signed Vaa bytes of your payload sent to wormhole.
Now post this signed vaa to wormhole solana core bridge program, parse the payloads from vaa and send the parsed data to solana zebec bridge program. This part is optional because it's handled by zebec's specialized relayer.
constpayerAddress=wallet.publicKey.toString();constbridgeAddress=getBridgeAddressForChain(targetChain);constvaaBuf=Buffer.from(vaaBytes);setDefaultWasm("node"); // use bundler for browser// posting vaa in solanaawaitpostVaaSolanaWithRetry( connection,wallet.signTransaction, bridgeAddress, payerAddress, vaaBuf,MAX_VAA_UPLOAD_RETRIES_SOLANA,);constparsedVaa=parse_vaa(cancelStreamVaa);constparsedPayload=parseZebecPayload(Buffer.from(parsedVaa.payload));constresult=awaitsolanaClient.cancelStream(cancelStreamVaa, <CancelTokenStreamPayload>parsedPayload);