mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-05 09:46:45 +00:00
fix: paychan utils arguments name (#2463)
This commit is contained in:
@@ -7,19 +7,19 @@ import { xrpToDrops } from './xrpConversion'
|
||||
* Sign a payment channel claim.
|
||||
*
|
||||
* @param channel - Channel identifier specified by the paymentChannelClaim.
|
||||
* @param amount - Amount specified by the paymentChannelClaim.
|
||||
* @param xrpAmount - XRP Amount specified by the paymentChannelClaim.
|
||||
* @param privateKey - Private Key to sign paymentChannelClaim with.
|
||||
* @returns True if the channel is valid.
|
||||
* @category Utilities
|
||||
*/
|
||||
function signPaymentChannelClaim(
|
||||
channel: string,
|
||||
amount: string,
|
||||
xrpAmount: string,
|
||||
privateKey: string,
|
||||
): string {
|
||||
const signingData = encodeForSigningClaim({
|
||||
channel,
|
||||
amount: xrpToDrops(amount),
|
||||
amount: xrpToDrops(xrpAmount),
|
||||
})
|
||||
return sign(signingData, privateKey)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { xrpToDrops } from './xrpConversion'
|
||||
* Verify the signature of a payment channel claim.
|
||||
*
|
||||
* @param channel - Channel identifier specified by the paymentChannelClaim.
|
||||
* @param amount - Amount specified by the paymentChannelClaim.
|
||||
* @param xrpAmount - XRP Amount specified by the paymentChannelClaim.
|
||||
* @param signature - Signature produced from signing paymentChannelClaim.
|
||||
* @param publicKey - Public key that signed the paymentChannelClaim.
|
||||
* @returns True if the channel is valid.
|
||||
@@ -16,13 +16,13 @@ import { xrpToDrops } from './xrpConversion'
|
||||
// eslint-disable-next-line max-params -- Needs 4 params
|
||||
function verifyPaymentChannelClaim(
|
||||
channel: string,
|
||||
amount: string,
|
||||
xrpAmount: string,
|
||||
signature: string,
|
||||
publicKey: string,
|
||||
): boolean {
|
||||
const signingData = encodeForSigningClaim({
|
||||
channel,
|
||||
amount: xrpToDrops(amount),
|
||||
amount: xrpToDrops(xrpAmount),
|
||||
})
|
||||
return verify(signingData, signature, publicKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user