Exemplo n.º 1
0
 fromJSON (json) {
   this.privKey = json.privKey ? PrivKey.fromHex(json.privKey) : undefined
   this.pubKey = json.pubKey ? PubKey.fromFastHex(json.pubKey) : undefined
   this.otherPubKey = json.otherPubKey ? PubKey.fromFastHex(json.otherPubKey) : undefined
   this.script = json.script ? Script.fromHex(json.script) : undefined
   this.address = json.address ? Address.fromJSON(json.address) : undefined
   this.keyPair = json.keyPair ? KeyPair.fromJSON(json.keyPair) : undefined
   this.initialized = json.initialized
   if (json.pubKeys) {
     let pubKeys = []
     json.pubKeys.forEach(function (pubKey) {
       pubKeys.push(PubKey.fromFastHex(pubKey))
     })
     this.pubKeys = pubKeys
   }
   return this
 }
Exemplo n.º 2
0
 json.pubKeys.forEach(function (pubKey) {
   pubKeys.push(PubKey.fromFastHex(pubKey))
 })