walletkey: fix getType in toJSON.
This commit is contained in:
parent
3db140e119
commit
7129370b2b
@ -7,10 +7,11 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var KeyRing = require('../primitives/keyring');
|
|
||||||
var util = require('../utils/util');
|
var util = require('../utils/util');
|
||||||
var Path = require('./path');
|
var Address = require('../primitives/address');
|
||||||
|
var KeyRing = require('../primitives/keyring');
|
||||||
var Script = require('../script/script');
|
var Script = require('../script/script');
|
||||||
|
var Path = require('./path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a key ring which amounts to an address.
|
* Represents a key ring which amounts to an address.
|
||||||
@ -133,7 +134,7 @@ WalletKey.prototype.toJSON = function toJSON() {
|
|||||||
publicKey: this.publicKey.toString('hex'),
|
publicKey: this.publicKey.toString('hex'),
|
||||||
script: this.script ? this.script.toRaw().toString('hex') : null,
|
script: this.script ? this.script.toRaw().toString('hex') : null,
|
||||||
program: this.witness ? this.getProgram().toRaw().toString('hex') : null,
|
program: this.witness ? this.getProgram().toRaw().toString('hex') : null,
|
||||||
type: Script.typesByVal[this.getType()].toLowerCase(),
|
type: Address.typesByVal[this.getType()].toLowerCase(),
|
||||||
address: this.getAddress('string')
|
address: this.getAddress('string')
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user