o1-labs / o1js

TypeScript framework for zk-SNARKs and zkApps

Home Page:https://docs.minaprotocol.com/en/zkapps/how-to-write-a-zkapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mina-signer uses different types for fee on delegation vs. payment transaction

jrwashburn opened this issue · comments

The fee type is different for a Payment vs. a stakeDelegation.

Fee needs to be a number to signPayment, but a string to signStakeDelegation.

For example:

const payment = {
  to: publicKey1,
  from: publicKey2,
  amount: amount * 1000000000,
  fee: 1000000,
  nonce: senderNonce,
};
const signedPayment = minaClient.signPayment(payment, privateKey);

const delegation = {
  to: producer,
  from: destinationKeyPair.publicKey,
  fee: '1000000',
  nonce: delegationNonce,
}

const signedDelegation = minaClient.signStakeDelegation(delegation, privateKey);

no, as far as I can see they use the same type for fee, these are the input types:

export type StakeDelegation = Common;
export type Payment = Common & { readonly amount: UInt64 };

the type is number | string | bigint

I'm kinda curious though what issue you had @jrwashburn

I will try to reproduce and build a sample app, assuming I can.