UNPKG

sendover

Version:

Tools for creating and paying invoices privately on Bitcoin SV

72 lines 3.39 kB
import { BigNumber, PrivateKey, PublicKey } from '@bsv/sdk'; import bsvJs from 'babbage-bsv'; /** * Returns a payment address for use by the sender, given the recipient's public key, the sender's private key and the invoice number. * * @param params All parameters are provided in an object * @param params.senderPrivateKey The private key of the sender in WIF format * @param params.recipientPublicKey The public key of the recipient in hexadecimal DER format * @param params.invoiceNumber The invoice number to use * @param params.revealCounterpartyLinkage=false When true, reveals the root shared secret between the two counterparties rather than performing key derivation, returning it as a hex string * @param params.revealPaymentLinkage=false When true, reveals the secret between the two counterparties used for this specific invoice number, rather than performing key derivation. Returns the linkage as a hex string * @param params.returnType=address] The destination key return type, either `address` or `publicKey` * * @returns The destination address or public key */ export declare function getPaymentAddress(params: { senderPrivateKey: string | bsvJs.crypto.BN | bsvJs.PrivateKey; recipientPublicKey: string | bsvJs.PublicKey; invoiceNumber: string; revealCounterpartyLinkage?: boolean; revealPaymentLinkage?: boolean; returnType?: 'address' | 'publicKey' | 'babbage-bsv'; }): string | bsvJs.PublicKey; export declare function computePaymentContext(params: { senderPrivateKey: string | BigNumber | PrivateKey; recipientPublicKey: string | PublicKey; invoiceNumber: string; }): { publicKey: PublicKey; sharedSecret: number[]; hmac: number[]; }; /** * @param params All parameters are provided in an object * @param params.senderPrivateKey The private key of the sender in WIF format * @param params.recipientPublicKey The public key of the recipient in hexadecimal DER format * @param params.invoiceNumber The invoice number to use * * @returns The destination public key */ export declare function getPaymentPubKey(params: { senderPrivateKey: string | BigNumber | PrivateKey; recipientPublicKey: string | PublicKey; invoiceNumber: string; }): PublicKey; /** * @param params All parameters are provided in an object * @param params.senderPrivateKey The private key of the sender in WIF format * @param params.recipientPublicKey The public key of the recipient in hexadecimal DER format * @param params.invoiceNumber The invoice number to use * * @returns The destination public key Base58 string */ export declare function getPaymentPubKeyString(params: { senderPrivateKey: string | BigNumber | PrivateKey; recipientPublicKey: string | PublicKey; invoiceNumber: string; }): string; /** * @param params All parameters are provided in an object * @param params.senderPrivateKey The private key of the sender in WIF format * @param params.recipientPublicKey The public key of the recipient in hexadecimal DER format * @param params.invoiceNumber The invoice number to use * * @returns The destination address as Base58 string */ export declare function getPaymentAddressString(params: { senderPrivateKey: string | BigNumber | PrivateKey; recipientPublicKey: string | PublicKey; invoiceNumber: string; }): string; //# sourceMappingURL=getPaymentAddress.d.ts.map