mina-signer uses different types for fee on delegation vs. payment transaction
jrwashburn opened this issue · comments
Jonathan Washburn commented
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);
Gregor Mitscha-Baude commented
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 };
Gregor Mitscha-Baude commented
the type is number | string | bigint
Gregor Mitscha-Baude commented
I'm kinda curious though what issue you had @jrwashburn
Jonathan Washburn commented
I will try to reproduce and build a sample app, assuming I can.
Jonathan Washburn commented
hmm, cannot repro.
https://gist.github.com/jrwashburn/b07780fcc1072f18b915fcb5adeeb050
I apologize; will close.