require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../API/admin-calls.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../functions/utils/create-provider.cjs`),i=require(`../../functions/pre-transaction/constructAdminData.cjs`),a=require(`../AccountActions/AccountActions.cjs`),o=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),s=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`);let c=require(`@solana/web3.js`);var l=async(t,i,o,l)=>{let u=n.validateAndGetChainId([t]),d=a.AccountActions.getAddressFromSubAccount(u,o);if(!d)throw Error(`Public account address is not available`);let{fetchRpcUrl:f}=e.networkRegistry[u];if(!f)throw Error(`RPC URL not found for the specified chain ID`);let p=r.createCustomSolanaConnection(f),m=new c.PublicKey(d),{instructions:h,programId:g}=await s.buildSolanaTransferInstructions(p,m,new c.PublicKey(l),t,i);return{connection:p,chainId:u,senderAddress:d,senderPublickey:m,programId:g,instructions:h}},u=async(e,n,r,a,s,c)=>{let[{connection:u,chainId:d,senderPublickey:f,instructions:p},m]=await Promise.all([l(n,r,a,s),e.getEthereumAddress()]),h=await o.sendProxyV0Transaction({connection:u,chainId:d,subAccount:a,payerPublicKey:f,instructions:p});return t.emitTxPublicData(i.constructAdminData(c,d,[n.erc20TokenAddress],[r],m)),h},d=async(e,t,n,r)=>{let{connection:i,senderPublickey:a,instructions:s}=await l(e,t,n,r);return o.serializeProxyV0Transaction(i,a,s)};exports.getSolanaProxySendSerializedTransaction=d,exports.hinkalSolanaProxySend=u;