最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

solana - How to not sign a transaction but still send it? - Stack Overflow

programmeradmin3浏览0评论

This is in version 1 with anchor:

async function execute(
    program: Program<PaymentRollup>,
    rollupPDA: PublicKey,
    payments: Payment[],
    proof: number[][],
    accounts: any
) {
    return program.methods
        .executeCustomProgram(payments, proof)
        .accountsPartial({
            rollup: rollupPDA,
            ownerTokenAccount: accounts.SENDER_ATA,
            recipientTokenAccount: accounts.RECEIVER_ATA,
            tokenProgram: TOKEN_PROGRAM_ID,
        })
        .remainingAccounts(accounts.executeAccounts)
        .preInstructions([
            ComputeBudgetProgram.setComputeUnitLimit({ units: 1_000_000 })
        ])
        .rpc();
}

however in version 2 it needs to be build etc and i need a feepayer. If i don't make it a feePayerSigner and partiallySign it, the simulation works but i can't send it to the network because then i get a Transaction signature verification failure.

 const latestBlockhash = await rpcFactory.rpc.getLatestBlockhash().send();
    const transaction = pipe(
        createTransactionMessage({ version: 0 }),
        tx => setTransactionMessageFeePayer(ownerAddress, tx),
        tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash.value, tx),
        tx => appendTransactionMessageInstruction(createBatchTokenPaymentInstruction, tx),
    );

The entire idea is that we have a rollup which is signed and has permissions to spend funds and then afterwards we execute this so we don't require signing again (multiple times).

I'm totally lost, docs are of no help.

发布评论

评论列表(0)

  1. 暂无评论