Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function signPaymentChannelClaim(
channel: string,
amount: string,
privateKey: string
): string {
validate.signPaymentChannelClaim({channel, amount, privateKey})
const signingData = binary.encodeForSigningClaim({
channel: channel,
amount: xrpToDrops(amount)
})
return keypairs.sign(signingData, privateKey)
}
function verifyPaymentChannelClaim(
channel: string,
amount: string,
signature: string,
publicKey: string
): string {
validate.verifyPaymentChannelClaim({channel, amount, signature, publicKey})
const signingData = binary.encodeForSigningClaim({
channel: channel,
amount: xrpToDrops(amount)
})
return keypairs.verify(signingData, signature, publicKey)
}