#Unable to Sign Mint Transaction Twice Using Auro Wallet

1 messages · Page 1 of 1 (latest)

shut torrent
#

I am currently building a Next.js application using the Mina fungible token standard, and I am trying to integrate the mint functionality with the Auro wallet. Here are the relevant parts of my implementation:

MintForm Component

MintForm Component Gist

Worker Service File

Worker Service Gist

I am running into the following error when attempting to mint tokens:

Couldn't send zkApp command: (invalid ("Authorization kind does not match the authorization" ((expected Signature) (got None_given))))

Context

I am using O1js to create the mint transaction, and the issue seems to stem from signing the transaction with both feePayer and admin private keys. Here is the relevant code snippet:

mintTx.sign([feePayer.privateKey, admin.privateKey]);

This code works perfectly fine when using private keys directly in a script outside of the Auro wallet, like this:

const feePayerPrivateKey = PrivateKey.fromBase58("");
const adminPrivateKey = PrivateKey.fromBase58("");
transaction.sign([feePayerPrivateKey, adminPrivateKey]);

However, I am struggling to achieve the same result when using the Auro wallet. Since both the feePayer and admin are actually the same wallet, is there a way to sign the transaction twice using the Auro wallet?

Any guidance or suggestions on how to handle this scenario with the Auro wallet would be greatly appreciated.

Thank you!

#

@fading swallow

#

Unable to Sign Mint Transaction Twice Using Auro Wallet

shut torrent
#

@pine mortar

#

Also I need this sign for Token deployment:
deployTx.sign([feePayer.privateKey, contract.privateKey,admin.privateKey]);

pine mortar
#

Just send the tx from admin, so the feePayer === admin

shut torrent
fading swallow
# shut torrent I am currently building a Next.js application using the Mina fungible token stan...

I haven't tried using the same private key for feePayer and admin, you can try it ()

  1. If the same private key is used, is it enough to sign only once (in nodejs , if ok ,then try with auro)?
    transaction.sign([feePayerPrivateKey]) or transaction.sign([adminPrivateKey])
    https://gist.github.com/izzetemredemir/1de9174bf01f2a376b31372a47b6085a#file-contractworker-ts-L140

  2. You can try to sign with different private keys using feePayer and admin to ensure that auro can run normally

  3. You can use onlySign to get the sign result. The following is the relevant document. When onlySign is true, auro only signs and returns the result (not broadcast). If you need to sign again, you can request another signature after returning (but you can try the first step first)
    https://docs.aurowallet.com/general/reference/api-reference/methods/mina_sendtransaction

shut torrent
#

Can I use onlySign result again in another tx?

shut torrent
fading swallow
pine mortar
#

("Authorization kind does not match the authorization" ((expected Signature) (got None_given)) means that you're missing the signature by one of the required keys. The only required signature, if you send FungibleToken.mint transaction with admin being the feePayer, is the admin signature.
Make sure that you use right private key - it should be private key of admin (NOT FungibleTokenAdmin contract). The admin address is what you have in the FungibleTokenAdmin state in the private adminPublicKey state variable. Also, it makes sense to check that you fetch all the accounts for the token contract, namely

  • tokenAddress
  • {tokenAddress, tokenId}
  • adminAddress
  • adminContractAddress
  • {mintAddress, tokenId}
fading swallow
fading swallow