Skip to content

Commit 6c616bf

Browse files
committed
Add address to output data
1 parent 58cdb3a commit 6c616bf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/psbt.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class Psbt {
122122
return this.__CACHE.__TX.outs.map(output => ({
123123
script: bufferutils_1.cloneBuffer(output.script),
124124
value: output.value,
125+
address: address_1.fromOutputScript(output.script, this.opts.network),
125126
}));
126127
}
127128
combine(...those) {

ts_src/psbt.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TransactionInput,
1414
} from 'bip174/src/lib/interfaces';
1515
import { checkForInput } from 'bip174/src/lib/utils';
16-
import { toOutputScript } from './address';
16+
import { fromOutputScript, toOutputScript } from './address';
1717
import { cloneBuffer, reverseBuffer } from './bufferutils';
1818
import { hash160 } from './crypto';
1919
import {
@@ -159,6 +159,7 @@ export class Psbt {
159159
return this.__CACHE.__TX.outs.map(output => ({
160160
script: cloneBuffer(output.script),
161161
value: output.value,
162+
address: fromOutputScript(output.script, this.opts.network),
162163
}));
163164
}
164165

0 commit comments

Comments
 (0)