|
|
@ -143,12 +143,13 @@ Address._transformHash = function(hash){ |
|
|
|
* @return {Address} |
|
|
|
*/ |
|
|
|
Address._transformObject = function(data) { |
|
|
|
$.checkArgument(data.hash, 'Must provide a `hash` property'); |
|
|
|
$.checkArgument(data.hash || data.hashBuffer, 'Must provide a `hash` or `hashBuffer` property'); |
|
|
|
$.checkArgument(data.type, 'Must provide a `type` property'); |
|
|
|
data.hashBuffer = new Buffer(data.hash, 'hex'); |
|
|
|
data.network = Networks.get(data.network) || Networks.defaultNetwork; |
|
|
|
|
|
|
|
return data; |
|
|
|
return { |
|
|
|
hashBuffer: data.hash ? new Buffer(data.hash, 'hex') : data.hashBuffer, |
|
|
|
network: Networks.get(data.network) || Networks.defaultNetwork, |
|
|
|
type: data.type |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|