UNPKG

@simplito/privmx-webendpoint

Version:

PrivMX Web Endpoint library

67 lines (66 loc) 2.87 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtKeyNative = void 0; const ApiStatic_1 = require("./ApiStatic"); const BaseNative_1 = require("./BaseNative"); class ExtKeyNative extends BaseNative_1.BaseNative { async newApi() { throw new Error("Use the specialized version of method instead."); } async deleteApi(ptr) { return this.runAsync((taskId) => this.api.lib.ExtKey_deleteExtKey(taskId, ptr)); } async deleteExtKey(ptr) { return this.runAsync((taskId) => this.api.lib.ExtKey_deleteExtKey(taskId, ptr)); } static async fromSeed(args) { const api = ApiStatic_1.ApiStatic.getInstance(); return api.runAsync((taskId) => api.lib.ExtKey_fromSeed(taskId, args)); } static async fromBase58(args) { // base58: string const api = ApiStatic_1.ApiStatic.getInstance(); return api.runAsync((taskId) => api.lib.ExtKey_fromBase58(taskId, args)); } static async generateRandom(args) { const api = ApiStatic_1.ApiStatic.getInstance(); return api.runAsync((taskId) => api.lib.ExtKey_generateRandom(taskId, args)); } async derive(ptr, args) { // index: number return this.runAsync((taskId) => this.api.lib.ExtKey_derive(taskId, ptr, args)); } async deriveHardened(ptr, args) { // index: number return this.runAsync((taskId) => this.api.lib.ExtKey_deriveHardened(taskId, ptr, args)); } getPrivatePartAsBase58(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivatePartAsBase58(taskId, ptr, args)); } getPublicPartAsBase58(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicPartAsBase58(taskId, ptr, args)); } getPrivateKey(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivateKey(taskId, ptr, args)); } getPublicKey(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicKey(taskId, ptr, args)); } getPrivateEncKey(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivateEncKey(taskId, ptr, args)); } getPublicKeyAsBase58Address(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicKeyAsBase58Address(taskId, ptr, args)); } getChainCode(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_getChainCode(taskId, ptr, args)); } verifyCompactSignatureWithHash(ptr, args) { // message: Uint8Array, signature: Uint8Array return this.runAsync((taskId) => this.api.lib.ExtKey_verifyCompactSignatureWithHash(taskId, ptr, args)); } isPrivate(ptr, args) { return this.runAsync((taskId) => this.api.lib.ExtKey_isPrivate(taskId, ptr, args)); } } exports.ExtKeyNative = ExtKeyNative;