{in,out}puts => tx{In,Out}puts
This commit is contained in:
parent
6c616bff78
commit
e7345d5446
4 changed files with 8 additions and 8 deletions
|
@ -109,7 +109,7 @@ class Psbt {
|
||||||
set locktime(locktime) {
|
set locktime(locktime) {
|
||||||
this.setLocktime(locktime);
|
this.setLocktime(locktime);
|
||||||
}
|
}
|
||||||
get inputs() {
|
get txInputs() {
|
||||||
return this.__CACHE.__TX.ins.map(input => ({
|
return this.__CACHE.__TX.ins.map(input => ({
|
||||||
hash: bufferutils_1.cloneBuffer(input.hash),
|
hash: bufferutils_1.cloneBuffer(input.hash),
|
||||||
index: input.index,
|
index: input.index,
|
||||||
|
@ -118,7 +118,7 @@ class Psbt {
|
||||||
witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)),
|
witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
get outputs() {
|
get txOutputs() {
|
||||||
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,
|
||||||
|
|
|
@ -523,9 +523,9 @@ describe(`Psbt`, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.strictEqual(psbt.inputCount, 1);
|
assert.strictEqual(psbt.inputCount, 1);
|
||||||
assert.strictEqual(psbt.inputs[0].sequence, 0xffffffff);
|
assert.strictEqual(psbt.txInputs[0].sequence, 0xffffffff);
|
||||||
psbt.setInputSequence(0, 0);
|
psbt.setInputSequence(0, 0);
|
||||||
assert.strictEqual(psbt.inputs[0].sequence, 0);
|
assert.strictEqual(psbt.txInputs[0].sequence, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws if input index is too high', () => {
|
it('throws if input index is too high', () => {
|
||||||
|
|
|
@ -145,7 +145,7 @@ export class Psbt {
|
||||||
this.setLocktime(locktime);
|
this.setLocktime(locktime);
|
||||||
}
|
}
|
||||||
|
|
||||||
get inputs(): Input[] {
|
get txInputs(): Input[] {
|
||||||
return this.__CACHE.__TX.ins.map(input => ({
|
return this.__CACHE.__TX.ins.map(input => ({
|
||||||
hash: cloneBuffer(input.hash),
|
hash: cloneBuffer(input.hash),
|
||||||
index: input.index,
|
index: input.index,
|
||||||
|
@ -155,7 +155,7 @@ export class Psbt {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
get outputs(): Output[] {
|
get txOutputs(): Output[] {
|
||||||
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,
|
||||||
|
|
4
types/psbt.d.ts
vendored
4
types/psbt.d.ts
vendored
|
@ -46,8 +46,8 @@ export declare class Psbt {
|
||||||
readonly inputCount: number;
|
readonly inputCount: number;
|
||||||
version: number;
|
version: number;
|
||||||
locktime: number;
|
locktime: number;
|
||||||
readonly inputs: Input[];
|
readonly txInputs: Input[];
|
||||||
readonly outputs: Output[];
|
readonly txOutputs: Output[];
|
||||||
combine(...those: Psbt[]): this;
|
combine(...those: Psbt[]): this;
|
||||||
clone(): Psbt;
|
clone(): Psbt;
|
||||||
setMaximumFeeRate(satoshiPerByte: number): void;
|
setMaximumFeeRate(satoshiPerByte: number): void;
|
||||||
|
|
Loading…
Add table
Reference in a new issue