@@ -9,17 +9,19 @@ type Transport = import('@ledgerhq/hw-transport').default;
9
9
export type TransactionInfoNimiq < Version extends NimiqVersion > = {
10
10
sender : NimiqPrimitive < 'Address' , Version > ,
11
11
recipient : NimiqPrimitive < 'Address' , Version > ,
12
- value : number , // In Luna
13
- fee ?: number ,
14
12
validityStartHeight : number ,
15
13
network ?: Network ,
16
14
flags ?: number ,
17
15
} & ( Version extends NimiqVersion . ALBATROSS ? {
16
+ value : bigint , // In Luna
17
+ fee ?: bigint ,
18
18
senderType ?: AccountTypeNimiq ,
19
19
senderData ?: Uint8Array ,
20
20
recipientType ?: AccountTypeNimiq ,
21
21
recipientData ?: Uint8Array ,
22
22
} : {
23
+ value : number , // In Luna
24
+ fee ?: number ,
23
25
senderType ?: Exclude < AccountTypeNimiq , AccountTypeNimiq . STAKING > ,
24
26
recipientType ?: Exclude < AccountTypeNimiq , AccountTypeNimiq . STAKING > ,
25
27
extraData ?: Uint8Array ,
@@ -119,20 +121,23 @@ export default class RequestSignTransactionNimiq<Version extends NimiqVersion>
119
121
nimiqTx = new Nimiq . ExtendedTransaction (
120
122
tx . sender , senderType as NonNullable < typeof tx . senderType > ,
121
123
tx . recipient , recipientType as NonNullable < typeof tx . recipientType > ,
122
- tx . value , fee , tx . validityStartHeight , flags , extraData , /* proof */ undefined , networkId ,
124
+ tx . value , Number ( fee ) , tx . validityStartHeight , flags , extraData ,
125
+ /* proof */ undefined , networkId ,
123
126
) ;
124
127
} else {
125
128
const signerPubKey = new Nimiq . PublicKey ( signerPubKeyBytes ) ;
126
129
nimiqTx = new Nimiq . BasicTransaction (
127
130
signerPubKey , tx . recipient ,
128
- tx . value , fee , tx . validityStartHeight , /* signature */ undefined , networkId ,
131
+ tx . value , Number ( fee ) , tx . validityStartHeight ,
132
+ /* signature */ undefined , networkId ,
129
133
) ;
130
134
}
131
135
} else if ( ! isNimiqLegacy ( Nimiq ) && ! isTransactionInfoNimiqLegacy ( tx ) ) {
132
136
nimiqTx = new Nimiq . Transaction (
133
137
tx . sender , senderType , tx . senderData ,
134
138
tx . recipient , recipientType , tx . recipientData ,
135
- BigInt ( tx . value ) , BigInt ( fee ) , tx . flags , tx . validityStartHeight , networkId ,
139
+ tx . value , BigInt ( fee ) , tx . flags ,
140
+ tx . validityStartHeight , networkId ,
136
141
) ;
137
142
} else {
138
143
throw new Error ( 'Invalid transactionInfo' ) ;
@@ -169,14 +174,14 @@ export default class RequestSignTransactionNimiq<Version extends NimiqVersion>
169
174
}
170
175
} else {
171
176
const signerPubKey = new Nimiq . PublicKey ( signerPubKeyBytes ) ;
172
- const signature = Nimiq . Signature . fromBytes ( signatureBytes ) ;
177
+ const signature = Nimiq . Signature . deserialize ( signatureBytes ) ;
173
178
nimiqTx . proof = Nimiq . SignatureProof . singleSig ( signerPubKey , signature ) . serialize ( ) ;
174
179
if ( stakerSignatureBytes ) {
175
180
// The Ledger app created a staker signature, which means it's a staking transaction with a staker
176
181
// signature proof in its recipient data but for which the empty default signature proof was passed,
177
182
// such that the Ledger created the staker signature with the same private key as staker private key
178
183
// as the transaction sender key.
179
- const stakerSignature = Nimiq . Signature . fromBytes ( stakerSignatureBytes ) ;
184
+ const stakerSignature = Nimiq . Signature . deserialize ( stakerSignatureBytes ) ;
180
185
const stakerSignatureProof = Nimiq . SignatureProof . singleSig ( signerPubKey , stakerSignature ) ;
181
186
// Overwrite the empty default signature proof in the staking transaction's recipient data. The
182
187
// signature proof is always at the very end of the recipient data, for recipient data which include
0 commit comments