fix: paychan utils arguments name (#2463)

This commit is contained in:
tequ
2023-09-16 03:39:07 +09:00
committed by GitHub
parent 556addff64
commit 7679df4551
2 changed files with 6 additions and 6 deletions

View File

@@ -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)
}

View File

@@ -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)
}