@keystonehq/bc-ur-registry
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -10,4 +10,5 @@ /// <reference types="node" /> | ||
private deviceId?; | ||
private version?; | ||
getRegistryType: () => import("../RegistryType").RegistryType; | ||
constructor(masterFingerprint: Buffer, keys: CryptoHDKey[], device?: string, deviceId?: string); | ||
constructor(masterFingerprint: Buffer, keys: CryptoHDKey[], device?: string, deviceId?: string, version?: string); | ||
getMasterFingerprint: () => Buffer; | ||
@@ -17,2 +18,3 @@ getKeys: () => CryptoHDKey[]; | ||
getDeviceId: () => string; | ||
getVersion: () => string; | ||
toDataItem: () => DataItem; | ||
@@ -19,0 +21,0 @@ static fromDataItem: (dataItem: DataItem) => CryptoMultiAccounts; |
@@ -14,5 +14,6 @@ "use strict"; | ||
Keys[Keys["deviceId"] = 4] = "deviceId"; | ||
Keys[Keys["version"] = 5] = "version"; | ||
})(Keys || (Keys = {})); | ||
class CryptoMultiAccounts extends RegistryItem_1.RegistryItem { | ||
constructor(masterFingerprint, keys, device, deviceId) { | ||
constructor(masterFingerprint, keys, device, deviceId, version) { | ||
super(); | ||
@@ -23,2 +24,3 @@ this.masterFingerprint = masterFingerprint; | ||
this.deviceId = deviceId; | ||
this.version = version; | ||
this.getRegistryType = () => RegistryType_1.RegistryTypes.CRYPTO_MULTI_ACCOUNTS; | ||
@@ -29,2 +31,3 @@ this.getMasterFingerprint = () => this.masterFingerprint; | ||
this.getDeviceId = () => this.deviceId; | ||
this.getVersion = () => this.version; | ||
this.toDataItem = () => { | ||
@@ -48,2 +51,5 @@ const map = {}; | ||
} | ||
if (this.version) { | ||
map[Keys.version] = this.version; | ||
} | ||
return new lib_1.DataItem(map); | ||
@@ -65,3 +71,4 @@ }; | ||
const deviceId = map[Keys.deviceId]; | ||
return new CryptoMultiAccounts(masterFingerprint, cryptoHDKeys, device, deviceId); | ||
const version = map[Keys.version]; | ||
return new CryptoMultiAccounts(masterFingerprint, cryptoHDKeys, device, deviceId, version); | ||
}; | ||
@@ -68,0 +75,0 @@ CryptoMultiAccounts.fromCBOR = (_cborPayload) => { |
{ | ||
"name": "@keystonehq/bc-ur-registry", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "A JS implementation of Uniform Resources(UR) Registry specification from Blockchain Commons", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -11,2 +11,3 @@ import {RegistryTypes} from "../RegistryType"; | ||
deviceId, | ||
version, | ||
} | ||
@@ -21,3 +22,4 @@ | ||
private device?: string, | ||
private deviceId?: string | ||
private deviceId?: string, | ||
private version?: string | ||
) { | ||
@@ -31,2 +33,3 @@ super(); | ||
public getDeviceId = () => this.deviceId; | ||
public getVersion = () => this.version; | ||
@@ -51,2 +54,5 @@ public toDataItem = (): DataItem => { | ||
} | ||
if (this.version) { | ||
map[Keys.version] = this.version; | ||
} | ||
return new DataItem(map); | ||
@@ -66,3 +72,4 @@ }; | ||
const deviceId = map[Keys.deviceId]; | ||
return new CryptoMultiAccounts(masterFingerprint, cryptoHDKeys, device, deviceId); | ||
const version = map[Keys.version]; | ||
return new CryptoMultiAccounts(masterFingerprint, cryptoHDKeys, device, deviceId, version); | ||
}; | ||
@@ -69,0 +76,0 @@ |
Sorry, the diff of this file is not supported yet
255965
4387