0

I have a code that uses keypair from file to sign transactions.

  const payer = Keypair.fromSecretKey(BufferJs.from(keypair));
  const wallet = new anchor.Wallet(payer);

  ////
  ////

  const tx = await rewardPoolProgram.rpc.initializePool(
    nonce,
    rewardDuration,
    lockPeriod,
    {
      accounts: {
        authority: wallet.publicKey,
        stakingMint: tokenMint.publicKey,
        stakingVault,
        rewardMint: tokenMint.publicKey,
        rewardVault,
        poolSigner: poolSigner,
        pool: pool.publicKey,
        tokenProgram: TOKEN_PROGRAM_ID,
      },
      signers: [pool],
      instructions: [
        await rewardPoolProgram.account.pool.createInstruction(pool),
      ],
    }
  );

It used to work fine months ago, today I tried it again and have this error:

Uncaught (in promise) Error: Invalid arguments: authority not provided.
    at common.ts:50:1
    at Array.forEach (<anonymous>)
    at validateAccounts (common.ts:45:1)
    at ix (instruction.ts:28:1)
    at txFn (transaction.ts:17:1)
    at Object.rpc [as initializePool] (rpc.ts:16:1)
    at createPool (createPool.ts:34:1)
    at async onFinish (CreatePool.tsx:22:1)

Does Solana no longer allow to sign transaction by keypair anymore?

3
  • Can you provide some code?
    – Jacob Creech
    Commented Aug 22, 2022 at 12:16
  • @JacobCreech Added code to the question
    – agentp
    Commented Aug 22, 2022 at 18:13
  • Without the source code of rewardPoolProgram this will be difficult for most to answer. I'm voting to close this question unless we can get a more complete picture of the problem. Commented Jan 2 at 3:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.