Add address to output data
This commit is contained in:
parent
58cdb3a362
commit
6c616bff78
2 changed files with 3 additions and 1 deletions
|
@ -122,6 +122,7 @@ class Psbt {
|
||||||
return this.__CACHE.__TX.outs.map(output => ({
|
return this.__CACHE.__TX.outs.map(output => ({
|
||||||
script: bufferutils_1.cloneBuffer(output.script),
|
script: bufferutils_1.cloneBuffer(output.script),
|
||||||
value: output.value,
|
value: output.value,
|
||||||
|
address: address_1.fromOutputScript(output.script, this.opts.network),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
combine(...those) {
|
combine(...those) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
TransactionInput,
|
TransactionInput,
|
||||||
} from 'bip174/src/lib/interfaces';
|
} from 'bip174/src/lib/interfaces';
|
||||||
import { checkForInput } from 'bip174/src/lib/utils';
|
import { checkForInput } from 'bip174/src/lib/utils';
|
||||||
import { toOutputScript } from './address';
|
import { fromOutputScript, toOutputScript } from './address';
|
||||||
import { cloneBuffer, reverseBuffer } from './bufferutils';
|
import { cloneBuffer, reverseBuffer } from './bufferutils';
|
||||||
import { hash160 } from './crypto';
|
import { hash160 } from './crypto';
|
||||||
import {
|
import {
|
||||||
|
@ -159,6 +159,7 @@ export class Psbt {
|
||||||
return this.__CACHE.__TX.outs.map(output => ({
|
return this.__CACHE.__TX.outs.map(output => ({
|
||||||
script: cloneBuffer(output.script),
|
script: cloneBuffer(output.script),
|
||||||
value: output.value,
|
value: output.value,
|
||||||
|
address: fromOutputScript(output.script, this.opts.network),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue