Asset stream initialization can be performed in following way.
constnow=nowInSec();conststartTime= now +180; /* * three min added deliberately because it takes times for your payload to hit * zebec program in solana **/constendTime= startTime +6000; // 100 min conststreamAmount="1";constreceiver= <evmaddress>;constsender=signer.address;constcanCancel=true;constcanUpdate=true;consttokenMint="<solana mint address>";constsourceChain=CHAIN_ID_BSC;constreceipt=awaitethClient.initStream(startTime.toString(),endTime.toString(), streamAmount, receiver, sender, canCancel, canUpdate, tokenMint,);
Now you can find signed Vaa bytes of your payload sent from wormhole guardian rpc hosts.
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(streamVaa);constparsedPayload=parseZebecPayload(Buffer.from(parsedVaa.payload));constresult=awaitsolanaClient.initializeStream(streamVaa, <TokenStreamPayload>parsedPayload);console.log(result);