Add name attribute to Payments
This commit is contained in:
parent
8bbe7c7178
commit
c403757ce8
23 changed files with 105 additions and 8 deletions
ts_src/payments
|
@ -116,6 +116,11 @@ export function p2sh(a: Payment, opts?: PaymentOpts): Payment {
|
|||
if (o.redeem && o.redeem.witness) return o.redeem.witness;
|
||||
if (o.input) return [];
|
||||
});
|
||||
lazy.prop(o, 'name', () => {
|
||||
const nameParts = ['p2sh'];
|
||||
if (o.redeem !== undefined) nameParts.push(o.redeem.name!);
|
||||
return nameParts.join('-');
|
||||
});
|
||||
|
||||
if (opts.validate) {
|
||||
let hash: Buffer = Buffer.from([]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue