@dfns/blockchain-integration
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -7,5 +7,6 @@ /// <reference types="node" /> | ||
getPublicKey(): Buffer; | ||
getPublicKeyAsync(asHex?: boolean): Promise<Buffer>; | ||
getPublicKeyAsHex(): Buffer; | ||
getPublicKeyAsync(asHex: boolean): Promise<Buffer>; | ||
sign(hash: Buffer): Promise<any>; | ||
} | ||
export declare function createSigningGroup(t: number, n: number): Promise<string>; |
@@ -18,3 +18,3 @@ "use strict"; | ||
}; | ||
var _groupId, _publicKey, _isInitialized; | ||
var _groupId, _publicKey, _publicKeyAsHex, _isInitialized; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,2 +29,3 @@ exports.createSigningGroup = exports.SigningGroup = void 0; | ||
_publicKey.set(this, void 0); | ||
_publicKeyAsHex.set(this, void 0); | ||
_isInitialized.set(this, void 0); | ||
@@ -35,3 +36,4 @@ __classPrivateFieldSet(this, _groupId, groupId); | ||
async init() { | ||
__classPrivateFieldSet(this, _publicKey, await this.getPublicKeyAsync()); | ||
__classPrivateFieldSet(this, _publicKeyAsHex, await this.getPublicKeyAsync(true)); | ||
__classPrivateFieldSet(this, _publicKey, await this.getPublicKeyAsync(false)); | ||
__classPrivateFieldSet(this, _isInitialized, true); | ||
@@ -45,3 +47,9 @@ } | ||
} | ||
async getPublicKeyAsync(asHex = true) { | ||
getPublicKeyAsHex() { | ||
if (!__classPrivateFieldGet(this, _isInitialized)) { | ||
throw new SigningGroupNotInitializedError_1.SigningGroupNotInitializedError(); | ||
} | ||
return __classPrivateFieldGet(this, _publicKeyAsHex); | ||
} | ||
async getPublicKeyAsync(asHex) { | ||
const res = await node_fetch_1.default(`${API_URL}/groups/${__classPrivateFieldGet(this, _groupId)}/config`, { | ||
@@ -74,3 +82,3 @@ headers: { | ||
exports.SigningGroup = SigningGroup; | ||
_groupId = new WeakMap(), _publicKey = new WeakMap(), _isInitialized = new WeakMap(); | ||
_groupId = new WeakMap(), _publicKey = new WeakMap(), _publicKeyAsHex = new WeakMap(), _isInitialized = new WeakMap(); | ||
async function createSigningGroup(t, n) { | ||
@@ -100,4 +108,4 @@ const res = await node_fetch_1.default(`${API_URL}/start`, { | ||
return new Promise((resolve) => { | ||
setTimeout(() => resolve(true), ms); | ||
setTimeout(resolve, ms); | ||
}); | ||
}; |
{ | ||
"name": "@dfns/blockchain-integration", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Blockchain integration Kit for DFNS", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12180
263