DefinitelyTyped/types/build-output-script/index.d.ts
2019-02-01 21:21:21 +01:00

34 lines
1.1 KiB
TypeScript

// Type definitions for build-output-script 1.0
// Project: https://github.com/lukechilds/build-output-script#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
export = buildOutputScript;
/**
* Builds a P2PKH Bitcoin transaction output script from an array of P2PKH addresses and amounts.
* Will also work with any Bitcoin derived cryptocurrencies with a single byte pubkey hash address prefix.
*
* The output script is returned as a hex string and can be passed directly in to ledgerjs.
*
* @param outputs An array of one or more output objects.
* @returns A (hex string) P2PKH transaction output script.
*/
declare function buildOutputScript(
outputs: [buildOutputScript.Output, ...buildOutputScript.Output[]]
): string;
declare namespace buildOutputScript {
interface Output {
/**
* A valid P2PKH address.
*/
address: string;
/**
* Value to send to `address` in satoshis.
*/
value: number;
}
}