@dynamic-labs-wallet/browser 0.0.328 → 0.0.330
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +106 -14
- package/index.esm.js +107 -15
- package/internal/core/bip340.cjs +1 -1
- package/internal/core/bip340.js +1 -1
- package/internal/core/ecdsa.cjs +1 -1
- package/internal/core/ecdsa.js +1 -1
- package/internal/core/ed25519.cjs +1 -1
- package/internal/core/ed25519.js +1 -1
- package/internal/core/ed_bls12_377.cjs +1 -0
- package/internal/core/ed_bls12_377.d.ts +21 -0
- package/internal/core/ed_bls12_377.js +1 -0
- package/internal/core/index.cjs +1 -1
- package/internal/core/index.d.ts +3 -2
- package/internal/core/index.js +1 -1
- package/internal/core/native.d.ts +17 -0
- package/internal/core/sr25519.cjs +1 -1
- package/internal/core/sr25519.js +1 -1
- package/internal/core/types.cjs +1 -1
- package/internal/core/types.d.ts +36 -0
- package/internal/core/types.js +1 -1
- package/internal/web/generated/libmpc_executor.d.ts +81 -60
- package/internal/web/generated/libmpc_executor.js +2 -2
- package/internal/web/generated/libmpc_executor_bg.wasm +0 -0
- package/internal/web/index.d.ts +5 -2
- package/internal/web/index.js +1 -1
- package/package.json +4 -4
- package/src/client.d.ts +6 -0
- package/src/client.d.ts.map +1 -1
- package/src/mpc/mpc.d.ts +3 -3
- package/src/mpc/mpc.d.ts.map +1 -1
- package/src/mpc/types.d.ts +5 -5
- package/src/mpc/types.d.ts.map +1 -1
- package/src/utils.d.ts.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as types_1 from"./types.js";import*as common_1 from"./common.js";import*as utils_1 from"@noble/hashes/utils";class EdBls12377{constructor(native,url){this.NATIVE=native,this.URL=url}async initKeygen(){const keygenInitKeypair=await(await this.NATIVE).initKeygen();return new types_1.EdBls12377InitKeygenResult(keygenInitKeypair.pubkey,keygenInitKeypair.keypair)}async exportID(keygenResult){return(await this.NATIVE).edBls12377GetExportID(getSecretShare(keygenResult))}async createRoom(numParties,apiKey){return(0,common_1.sanitizeNumberOfParties)(numParties),(await this.NATIVE).createRoom(this.URL,numParties,apiKey)}async keygen(roomUuid,numParties,threshold,keygenInit,keygenIds){if((0,common_1.sanitizeNumberOfParties)(numParties,threshold),keygenIds.length!==numParties-1)throw new Error(`keygenIds length must be exactly: ${numParties-1}, it is: `+keygenIds.length);const keygenResult=await(await this.NATIVE).edBls12377Keygen(roomUuid,this.URL,numParties,threshold,keygenInit.keygenSecret,keygenIds);return new types_1.EdBls12377KeygenResult(keygenResult.compute_key,keygenResult.address,keygenResult.secret_share)}async signRequest(roomUuid,keygenResult,requestPayload){const requestPayloadJson=serializeRequestPayload(requestPayload),signedRequestJson=await(await this.NATIVE).edBls12377signRequest(roomUuid,this.URL,getSecretShare(keygenResult),requestPayloadJson);return deserializeSignedRequest(signedRequestJson)}async refresh(roomUuid,keygenResult){const refreshedKeygenResult=await(await this.NATIVE).edBls12377Refresh(roomUuid,this.URL,getSecretShare(keygenResult));return new types_1.EdBls12377KeygenResult(refreshedKeygenResult.compute_key,refreshedKeygenResult.address,refreshedKeygenResult.secret_share)}async reshareNewParty(roomUuid,oldThreshold,newThreshold,keygenInit,keygenIds){const resharedKeygenResult=await(await this.NATIVE).edBls12377ReshareNewParty(roomUuid,this.URL,oldThreshold,newThreshold,keygenInit.keygenSecret,keygenIds);return new types_1.EdBls12377KeygenResult(resharedKeygenResult.compute_key,resharedKeygenResult.address,resharedKeygenResult.secret_share)}async reshareRemainingParty(roomUuid,newThreshold,keygenResult,keygenIds){const resharedKeygenResult=await(await this.NATIVE).edBls12377ReshareRemainingParty(roomUuid,this.URL,newThreshold,getSecretShare(keygenResult),keygenIds);return new types_1.EdBls12377KeygenResult(resharedKeygenResult.compute_key,resharedKeygenResult.address,resharedKeygenResult.secret_share)}async exportFullPrivateKey(roomUuid,keygenResult,toExportID){const exported=await(await this.NATIVE).edBls12377ExportFullPrivateKey(roomUuid,this.URL,getSecretShare(keygenResult),toExportID);return exported||void 0}async exportViewKey(roomUuid,keygenResult,toExportID){const exported=await(await this.NATIVE).edBls12377ExportViewKey(roomUuid,this.URL,getSecretShare(keygenResult),toExportID);return exported||void 0}async offlineExportFullPrivateKey(keygenResults){return(await this.NATIVE).edBls12377OfflineExportFullPrivateKey(serializeKeygenResults(keygenResults))}async offlineExportViewKey(keygenResults){return(await this.NATIVE).edBls12377OfflineExportViewKey(serializeKeygenResults(keygenResults))}async importPrivateKeyRecipient(roomUuid,threshold,keygenInit,keygenIds){const importKeygenResult=await(await this.NATIVE).edBls12377ImportPrivateKeyRecipient(roomUuid,this.URL,threshold,keygenInit.keygenSecret,keygenIds);return new types_1.EdBls12377KeygenResult(importKeygenResult.compute_key,importKeygenResult.address,importKeygenResult.secret_share)}async importPrivateKeyImporter(roomUuid,threshold,privateKey,keygenInit,keygenIds,isPrivateKeyRaw=!1){const importKeygenResult=await(await this.NATIVE).edBls12377ImportPrivateKeyImporter(roomUuid,this.URL,threshold,privateKey,keygenInit.keygenSecret,keygenIds,isPrivateKeyRaw);return new types_1.EdBls12377KeygenResult(importKeygenResult.compute_key,importKeygenResult.address,importKeygenResult.secret_share)}}function getSecretShare(keygenResult){return"string"==typeof keygenResult?keygenResult:keygenResult.secretShare}function serializeKeygenResults(keygenResults){return keygenResults.map(result=>"string"==typeof result?result:result.secretShare)}function serializeRequestPayload(requestPayload){const serializedPayload={function_id:(0,utils_1.bytesToHex)(requestPayload.function_id),is_root:requestPayload.is_root,program_checksum:requestPayload.program_checksum?(0,utils_1.bytesToHex)(requestPayload.program_checksum):null,inputs:requestPayload.inputs.map(input=>"record"===input.type?{type:"record",h:(0,utils_1.bytesToHex)(input.h),tag:(0,utils_1.bytesToHex)(input.tag)}:{type:input.type,index:(0,utils_1.bytesToHex)(input.index),fields:input.fields.map(utils_1.bytesToHex)})};return JSON.stringify(serializedPayload)}function deserializeSignedRequest(signedRequestJson){let parsed;try{parsed=JSON.parse(signedRequestJson)}catch(_a){throw new Error("Invalid signed request JSON returned from native bindings.")}if(!parsed||"object"!=typeof parsed||Array.isArray(parsed))throw new Error("Invalid signed request JSON returned from native bindings.");const signedRequest=parsed;return{signer:deserializeBytes(signedRequest.signer,"signer"),signature:deserializeBytes(signedRequest.signature,"signature"),tvk:deserializeBytes(signedRequest.tvk,"tvk"),gammas:deserializeBytesArray(signedRequest.gammas,"gammas")}}function deserializeBytes(value,fieldName){if("string"!=typeof value)throw new TypeError(fieldName+" must be a hex string in the native response.");return(0,utils_1.hexToBytes)(value)}function deserializeBytesArray(value,fieldName){if(Array.isArray(value))return value.map((item,index)=>deserializeBytes(item,fieldName+`[${index}]`));throw new TypeError(fieldName+" must be an array in the native response.")}export{EdBls12377};
|
package/internal/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340=exports.Sr25519=exports.ExportableEd25519=exports.Ed25519=exports.Ecdsa=exports.MessageHash=exports.BIP340KeygenResult=exports.BIP340InitKeygenResult=exports.Sr25519KeygenResult=exports.Sr25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.ExportableEd25519InitKeygenResult=exports.Ed25519KeygenResult=exports.Ed25519InitKeygenResult=exports.EcdsaSignature=exports.EcdsaPublicKey=exports.EcdsaKeygenResult=exports.EcdsaInitKeygenResult=void 0;const types_1=require("./types.cjs"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{value:types_1.EcdsaInitKeygenResult}),Object.defineProperty(exports,"EcdsaKeygenResult",{value:types_1.EcdsaKeygenResult}),Object.defineProperty(exports,"EcdsaPublicKey",{value:types_1.EcdsaPublicKey}),Object.defineProperty(exports,"EcdsaSignature",{value:types_1.EcdsaSignature}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{value:types_1.Ed25519InitKeygenResult}),Object.defineProperty(exports,"Ed25519KeygenResult",{value:types_1.Ed25519KeygenResult}),Object.defineProperty(exports,"ExportableEd25519InitKeygenResult",{value:types_1.ExportableEd25519InitKeygenResult}),Object.defineProperty(exports,"ExportableEd25519KeygenResult",{value:types_1.ExportableEd25519KeygenResult}),Object.defineProperty(exports,"Sr25519InitKeygenResult",{value:types_1.Sr25519InitKeygenResult}),Object.defineProperty(exports,"Sr25519KeygenResult",{value:types_1.Sr25519KeygenResult}),Object.defineProperty(exports,"BIP340InitKeygenResult",{value:types_1.BIP340InitKeygenResult}),Object.defineProperty(exports,"BIP340KeygenResult",{value:types_1.BIP340KeygenResult}),Object.defineProperty(exports,"MessageHash",{value:types_1.MessageHash}),require("./ecdsa.cjs")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{value:ecdsa_1.Ecdsa}),require("./ed25519.cjs")),ed25519_exportable_1=(Object.defineProperty(exports,"Ed25519",{value:ed25519_1.Ed25519}),require("./ed25519_exportable.cjs")),sr25519_1=(Object.defineProperty(exports,"ExportableEd25519",{value:ed25519_exportable_1.ExportableEd25519}),require("./sr25519.cjs")),bip340_1=(Object.defineProperty(exports,"Sr25519",{value:sr25519_1.Sr25519}),require("./bip340.cjs"))
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.EdBls12377=exports.BIP340=exports.Sr25519=exports.ExportableEd25519=exports.Ed25519=exports.Ecdsa=exports.MessageHash=exports.EdBls12377KeygenResult=exports.EdBls12377InitKeygenResult=exports.BIP340KeygenResult=exports.BIP340InitKeygenResult=exports.Sr25519KeygenResult=exports.Sr25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.ExportableEd25519InitKeygenResult=exports.Ed25519KeygenResult=exports.Ed25519InitKeygenResult=exports.EcdsaSignature=exports.EcdsaPublicKey=exports.EcdsaKeygenResult=exports.EcdsaInitKeygenResult=void 0;const types_1=require("./types.cjs"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{value:types_1.EcdsaInitKeygenResult}),Object.defineProperty(exports,"EcdsaKeygenResult",{value:types_1.EcdsaKeygenResult}),Object.defineProperty(exports,"EcdsaPublicKey",{value:types_1.EcdsaPublicKey}),Object.defineProperty(exports,"EcdsaSignature",{value:types_1.EcdsaSignature}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{value:types_1.Ed25519InitKeygenResult}),Object.defineProperty(exports,"Ed25519KeygenResult",{value:types_1.Ed25519KeygenResult}),Object.defineProperty(exports,"ExportableEd25519InitKeygenResult",{value:types_1.ExportableEd25519InitKeygenResult}),Object.defineProperty(exports,"ExportableEd25519KeygenResult",{value:types_1.ExportableEd25519KeygenResult}),Object.defineProperty(exports,"Sr25519InitKeygenResult",{value:types_1.Sr25519InitKeygenResult}),Object.defineProperty(exports,"Sr25519KeygenResult",{value:types_1.Sr25519KeygenResult}),Object.defineProperty(exports,"BIP340InitKeygenResult",{value:types_1.BIP340InitKeygenResult}),Object.defineProperty(exports,"BIP340KeygenResult",{value:types_1.BIP340KeygenResult}),Object.defineProperty(exports,"EdBls12377InitKeygenResult",{value:types_1.EdBls12377InitKeygenResult}),Object.defineProperty(exports,"EdBls12377KeygenResult",{value:types_1.EdBls12377KeygenResult}),Object.defineProperty(exports,"MessageHash",{value:types_1.MessageHash}),require("./ecdsa.cjs")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{value:ecdsa_1.Ecdsa}),require("./ed25519.cjs")),ed25519_exportable_1=(Object.defineProperty(exports,"Ed25519",{value:ed25519_1.Ed25519}),require("./ed25519_exportable.cjs")),sr25519_1=(Object.defineProperty(exports,"ExportableEd25519",{value:ed25519_exportable_1.ExportableEd25519}),require("./sr25519.cjs")),bip340_1=(Object.defineProperty(exports,"Sr25519",{value:sr25519_1.Sr25519}),require("./bip340.cjs")),ed_bls12_377_1=(Object.defineProperty(exports,"BIP340",{value:bip340_1.BIP340}),require("./ed_bls12_377.cjs"));Object.defineProperty(exports,"EdBls12377",{value:ed_bls12_377_1.EdBls12377});
|
package/internal/core/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash } from './types';
|
|
1
|
+
import { EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, EdBls12377InitKeygenResult, EdBls12377KeygenResult, EdBls12377FieldElement, EdBls12377GroupElement, EdBls12377RequestInput, EdBls12377RequestSignPayload, EdBls12377SignedRequest, MessageHash } from './types';
|
|
2
2
|
import { Ecdsa } from './ecdsa';
|
|
3
3
|
import { Ed25519 } from './ed25519';
|
|
4
4
|
import { ExportableEd25519 } from './ed25519_exportable';
|
|
5
5
|
import { Sr25519 } from './sr25519';
|
|
6
6
|
import { BIP340 } from './bip340';
|
|
7
|
+
import { EdBls12377 } from './ed_bls12_377';
|
|
7
8
|
import { DynamicNativeSdkInterface } from './native';
|
|
8
|
-
export { DynamicNativeSdkInterface, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash, Ecdsa, Ed25519, ExportableEd25519, Sr25519, BIP340, };
|
|
9
|
+
export { DynamicNativeSdkInterface, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, EdBls12377InitKeygenResult, EdBls12377KeygenResult, EdBls12377FieldElement, EdBls12377GroupElement, EdBls12377RequestInput, EdBls12377RequestSignPayload, EdBls12377SignedRequest, MessageHash, Ecdsa, Ed25519, ExportableEd25519, Sr25519, BIP340, EdBls12377, };
|
package/internal/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as types_1 from"./types.js";import*as ecdsa_1 from"./ecdsa.js";import*as ed25519_1 from"./ed25519.js";import*as ed25519_exportable_1 from"./ed25519_exportable.js";import*as sr25519_1 from"./sr25519.js";import*as bip340_1 from"./bip340.js";const EcdsaInitKeygenResult=types_1.EcdsaInitKeygenResult,EcdsaKeygenResult=types_1.EcdsaKeygenResult,EcdsaPublicKey=types_1.EcdsaPublicKey,EcdsaSignature=types_1.EcdsaSignature,Ed25519InitKeygenResult=types_1.Ed25519InitKeygenResult,Ed25519KeygenResult=types_1.Ed25519KeygenResult,ExportableEd25519InitKeygenResult=types_1.ExportableEd25519InitKeygenResult,ExportableEd25519KeygenResult=types_1.ExportableEd25519KeygenResult,Sr25519InitKeygenResult=types_1.Sr25519InitKeygenResult,Sr25519KeygenResult=types_1.Sr25519KeygenResult,BIP340InitKeygenResult=types_1.BIP340InitKeygenResult,BIP340KeygenResult=types_1.BIP340KeygenResult,MessageHash=types_1.MessageHash,Ecdsa=ecdsa_1.Ecdsa,Ed25519=ed25519_1.Ed25519,ExportableEd25519=ed25519_exportable_1.ExportableEd25519,Sr25519=sr25519_1.Sr25519,BIP340=bip340_1.BIP340;export{EcdsaInitKeygenResult,EcdsaKeygenResult,EcdsaPublicKey,EcdsaSignature,Ed25519InitKeygenResult,Ed25519KeygenResult,ExportableEd25519InitKeygenResult,ExportableEd25519KeygenResult,Sr25519InitKeygenResult,Sr25519KeygenResult,BIP340InitKeygenResult,BIP340KeygenResult,MessageHash,Ecdsa,Ed25519,ExportableEd25519,Sr25519,BIP340};
|
|
1
|
+
import*as types_1 from"./types.js";import*as ecdsa_1 from"./ecdsa.js";import*as ed25519_1 from"./ed25519.js";import*as ed25519_exportable_1 from"./ed25519_exportable.js";import*as sr25519_1 from"./sr25519.js";import*as bip340_1 from"./bip340.js";import*as ed_bls12_377_1 from"./ed_bls12_377.js";const EcdsaInitKeygenResult=types_1.EcdsaInitKeygenResult,EcdsaKeygenResult=types_1.EcdsaKeygenResult,EcdsaPublicKey=types_1.EcdsaPublicKey,EcdsaSignature=types_1.EcdsaSignature,Ed25519InitKeygenResult=types_1.Ed25519InitKeygenResult,Ed25519KeygenResult=types_1.Ed25519KeygenResult,ExportableEd25519InitKeygenResult=types_1.ExportableEd25519InitKeygenResult,ExportableEd25519KeygenResult=types_1.ExportableEd25519KeygenResult,Sr25519InitKeygenResult=types_1.Sr25519InitKeygenResult,Sr25519KeygenResult=types_1.Sr25519KeygenResult,BIP340InitKeygenResult=types_1.BIP340InitKeygenResult,BIP340KeygenResult=types_1.BIP340KeygenResult,EdBls12377InitKeygenResult=types_1.EdBls12377InitKeygenResult,EdBls12377KeygenResult=types_1.EdBls12377KeygenResult,MessageHash=types_1.MessageHash,Ecdsa=ecdsa_1.Ecdsa,Ed25519=ed25519_1.Ed25519,ExportableEd25519=ed25519_exportable_1.ExportableEd25519,Sr25519=sr25519_1.Sr25519,BIP340=bip340_1.BIP340,EdBls12377=ed_bls12_377_1.EdBls12377;export{EcdsaInitKeygenResult,EcdsaKeygenResult,EcdsaPublicKey,EcdsaSignature,Ed25519InitKeygenResult,Ed25519KeygenResult,ExportableEd25519InitKeygenResult,ExportableEd25519KeygenResult,Sr25519InitKeygenResult,Sr25519KeygenResult,BIP340InitKeygenResult,BIP340KeygenResult,EdBls12377InitKeygenResult,EdBls12377KeygenResult,MessageHash,Ecdsa,Ed25519,ExportableEd25519,Sr25519,BIP340,EdBls12377};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface EdBls12377NativeKeygenResult {
|
|
2
|
+
compute_key: string;
|
|
3
|
+
address: string;
|
|
4
|
+
secret_share: string;
|
|
5
|
+
}
|
|
1
6
|
export interface DynamicNativeSdkInterface {
|
|
2
7
|
initKeygen(): Promise<{
|
|
3
8
|
pubkey: string;
|
|
@@ -133,6 +138,18 @@ export interface DynamicNativeSdkInterface {
|
|
|
133
138
|
pubkey: string;
|
|
134
139
|
secret_share: string;
|
|
135
140
|
}>;
|
|
141
|
+
edBls12377GetExportID(secretShare: string): Promise<string>;
|
|
142
|
+
edBls12377Keygen(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<EdBls12377NativeKeygenResult>;
|
|
143
|
+
edBls12377signRequest(roomUUID: string, hostUrl: string, secretShare: string, requestPayload: string): Promise<string>;
|
|
144
|
+
edBls12377Refresh(roomUUID: string, hostUrl: string, secretShare: string): Promise<EdBls12377NativeKeygenResult>;
|
|
145
|
+
edBls12377ReshareNewParty(roomUUID: string, hostUrl: string, oldThreshold: number, newThreshold: number, keygenSecret: string, keygenIDs: string[]): Promise<EdBls12377NativeKeygenResult>;
|
|
146
|
+
edBls12377ReshareRemainingParty(roomUUID: string, hostUrl: string, newThreshold: number, secretShare: string, keygenIDs: string[]): Promise<EdBls12377NativeKeygenResult>;
|
|
147
|
+
edBls12377ExportFullPrivateKey(roomUUID: string, hostUrl: string, secretShare: string, toExportID: string): Promise<undefined | string>;
|
|
148
|
+
edBls12377ExportViewKey(roomUUID: string, hostUrl: string, secretShare: string, toExportID: string): Promise<undefined | string>;
|
|
149
|
+
edBls12377OfflineExportFullPrivateKey(keygenResults: string[]): Promise<string>;
|
|
150
|
+
edBls12377OfflineExportViewKey(keygenResults: string[]): Promise<string>;
|
|
151
|
+
edBls12377ImportPrivateKeyRecipient(roomUUID: string, hostUrl: string, threshold: number, secretShare: string, keygenIDs: string[]): Promise<EdBls12377NativeKeygenResult>;
|
|
152
|
+
edBls12377ImportPrivateKeyImporter(roomUUID: string, hostUrl: string, threshold: number, privateKey: string, secretShare: string, keygenIDs: string[], isPrivateKeyRaw: boolean): Promise<EdBls12377NativeKeygenResult>;
|
|
136
153
|
sr25519GetExportID(secretShare: string): Promise<string>;
|
|
137
154
|
sr25519Keygen(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
138
155
|
pubkey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Sr25519=void 0;const _1=require("./index.cjs"),utils_1=require("@noble/hashes/utils"),common_1=require("./common.cjs");class Sr25519{constructor(native,url){this.NATIVE=native,this.URL=url}async initKeygen(){const keygenInitKeypair=await(await this.NATIVE).initKeygen();return new _1.Sr25519InitKeygenResult(keygenInitKeypair.pubkey,keygenInitKeypair.keypair)}async exportID(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare;return(await this.NATIVE).sr25519GetExportID(secretShare)}async createRoom(numParties,apiKey){return(0,common_1.sanitizeNumberOfParties)(numParties),(await this.NATIVE).createRoom(this.URL,numParties,apiKey)}async keygen(roomUuid,numParties,threshold,keygenInit,keygenIds){if((0,common_1.sanitizeNumberOfParties)(numParties,threshold),keygenIds.length!==numParties-1)throw new Error(`keygenIds length must be exactly: ${numParties-1}, it is: `+keygenIds.length);const keygenResult=await(await this.NATIVE).sr25519Keygen(roomUuid,this.URL,numParties,threshold,keygenInit.keygenSecret,keygenIds);if(!keygenResult.pubkey||!keygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(keygenResult.pubkey),secretShareHex=keygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async sign(roomUuid,keygenResult,msg,derivationPath=[]){"string"!=typeof msg&&(msg=(0,utils_1.bytesToHex)(msg));const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,signature=await(await this.NATIVE).sr25519Sign(roomUuid,this.URL,secretShare,msg,Array.from(derivationPath));return(0,utils_1.hexToBytes)(signature)}async refresh(roomUuid,keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,refreshedKeygenResult=await(await this.NATIVE).sr25519Refresh(roomUuid,this.URL,secretShare);if(!refreshedKeygenResult.pubkey||!refreshedKeygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(refreshedKeygenResult.pubkey),secretShareHex=refreshedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareNewParty(roomUuid,oldThreshold,newThreshold,keygenInit,keygenIds){const resharedKeygenResult=await(await this.NATIVE).sr25519ReshareNewParty(roomUuid,this.URL,oldThreshold,newThreshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareRemainingParty(roomUuid,newThreshold,keygenResult,keygenIds){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,resharedKeygenResult=await(await this.NATIVE).sr25519ReshareRemainingParty(roomUuid,this.URL,newThreshold,secretShare,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async derivePubkey(keygenResult,derivationPath=[]){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,derivedPubkey=await(await this.NATIVE).sr25519DerivePubkey(secretShare,Array.from(derivationPath));return(0,utils_1.hexToBytes)(derivedPubkey)}async getPubkey(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,pubKey=await(await this.NATIVE).sr25519GetPubkey(secretShare);return(0,utils_1.hexToBytes)(pubKey)}async derivePubkeyFromPubkey(pubkey,derivation){const derivedPubkey=await(await this.NATIVE).sr25519DerivePubkeyFromPubkey((0,utils_1.bytesToHex)(pubkey),Array.from(derivation));return(0,utils_1.hexToBytes)(derivedPubkey)}async exportFullPrivateKey(roomUuid,keygenResult,toExportID){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,exported=await(await this.NATIVE).sr25519ExportFullPrivateKey(roomUuid,this.URL,secretShare,toExportID);return exported||void 0}async derivePrivateKeyFromPrivateKey(privkey,isPrivateKeyRaw,derivationPath=[]){return(await this.NATIVE).sr25519DerivePrivateKeyFromPrivateKey(privkey,Array.from(derivationPath),isPrivateKeyRaw)}async offlineExportFullPrivateKey(keygenResults){const secretShares=keygenResults.map(k=>{if("string"==typeof k)return k;if(k instanceof _1.Sr25519KeygenResult)return k.secretShare;throw"UnknownType"});return(await this.NATIVE).sr25519OfflineExportFullPrivateKey(secretShares)}async importPrivateKeyRecipient(roomUuid,threshold,keygenInit,keygenIds){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyRecipient(roomUuid,this.URL,threshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async importPrivateKeyImporter(roomUuid,threshold,privateKey,keygenInit,keygenIds,isPrivateKeyRaw=!1){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyImporter(roomUuid,this.URL,threshold,privateKey,keygenInit.keygenSecret,keygenIds,isPrivateKeyRaw),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}}exports.Sr25519=Sr25519;
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Sr25519=void 0;const _1=require("./index.cjs"),utils_1=require("@noble/hashes/utils"),common_1=require("./common.cjs");class Sr25519{constructor(native,url){this.NATIVE=native,this.URL=url}async initKeygen(){const keygenInitKeypair=await(await this.NATIVE).initKeygen();return new _1.Sr25519InitKeygenResult(keygenInitKeypair.pubkey,keygenInitKeypair.keypair)}async exportID(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare;return(await this.NATIVE).sr25519GetExportID(secretShare)}async createRoom(numParties,apiKey){return(0,common_1.sanitizeNumberOfParties)(numParties),(await this.NATIVE).createRoom(this.URL,numParties,apiKey)}async keygen(roomUuid,numParties,threshold,keygenInit,keygenIds){if((0,common_1.sanitizeNumberOfParties)(numParties,threshold),keygenIds.length!==numParties-1)throw new Error(`keygenIds length must be exactly: ${numParties-1}, it is: `+keygenIds.length);const keygenResult=await(await this.NATIVE).sr25519Keygen(roomUuid,this.URL,numParties,threshold,keygenInit.keygenSecret,keygenIds);if(!keygenResult.pubkey||!keygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(keygenResult.pubkey),secretShareHex=keygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async sign(roomUuid,keygenResult,msg,derivationPath=[]){"string"!=typeof msg&&(msg=(0,utils_1.bytesToHex)(msg));const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,signature=await(await this.NATIVE).sr25519Sign(roomUuid,this.URL,secretShare,msg,Array.from(derivationPath));return(0,utils_1.hexToBytes)(signature)}async refresh(roomUuid,keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,refreshedKeygenResult=await(await this.NATIVE).sr25519Refresh(roomUuid,this.URL,secretShare);if(!refreshedKeygenResult.pubkey||!refreshedKeygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(refreshedKeygenResult.pubkey),secretShareHex=refreshedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareNewParty(roomUuid,oldThreshold,newThreshold,keygenInit,keygenIds){const resharedKeygenResult=await(await this.NATIVE).sr25519ReshareNewParty(roomUuid,this.URL,oldThreshold,newThreshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareRemainingParty(roomUuid,newThreshold,keygenResult,keygenIds){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,resharedKeygenResult=await(await this.NATIVE).sr25519ReshareRemainingParty(roomUuid,this.URL,newThreshold,secretShare,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async derivePubkey(keygenResult,derivationPath=[]){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,derivedPubkey=await(await this.NATIVE).sr25519DerivePubkey(secretShare,Array.from(derivationPath));return(0,utils_1.hexToBytes)(derivedPubkey)}async getPubkey(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,pubKey=await(await this.NATIVE).sr25519GetPubkey(secretShare);return(0,utils_1.hexToBytes)(pubKey)}async derivePubkeyFromPubkey(pubkey,derivation){const derivedPubkey=await(await this.NATIVE).sr25519DerivePubkeyFromPubkey((0,utils_1.bytesToHex)(pubkey),Array.from(derivation));return(0,utils_1.hexToBytes)(derivedPubkey)}async exportFullPrivateKey(roomUuid,keygenResult,toExportID){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,exported=await(await this.NATIVE).sr25519ExportFullPrivateKey(roomUuid,this.URL,secretShare,toExportID);return exported||void 0}async derivePrivateKeyFromPrivateKey(privkey,isPrivateKeyRaw,derivationPath=[]){return(await this.NATIVE).sr25519DerivePrivateKeyFromPrivateKey(privkey,Array.from(derivationPath),isPrivateKeyRaw)}async offlineExportFullPrivateKey(keygenResults){const secretShares=keygenResults.map(k=>{if("string"==typeof k)return k;if(k instanceof _1.Sr25519KeygenResult)return k.secretShare;throw new Error("UnknownType")});return(await this.NATIVE).sr25519OfflineExportFullPrivateKey(secretShares)}async importPrivateKeyRecipient(roomUuid,threshold,keygenInit,keygenIds){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyRecipient(roomUuid,this.URL,threshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async importPrivateKeyImporter(roomUuid,threshold,privateKey,keygenInit,keygenIds,isPrivateKeyRaw=!1){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyImporter(roomUuid,this.URL,threshold,privateKey,keygenInit.keygenSecret,keygenIds,isPrivateKeyRaw),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}}exports.Sr25519=Sr25519;
|
package/internal/core/sr25519.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as _1 from"./index.js";import*as common_1 from"./common.js";import*as utils_1 from"@noble/hashes/utils";class Sr25519{constructor(native,url){this.NATIVE=native,this.URL=url}async initKeygen(){const keygenInitKeypair=await(await this.NATIVE).initKeygen();return new _1.Sr25519InitKeygenResult(keygenInitKeypair.pubkey,keygenInitKeypair.keypair)}async exportID(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare;return(await this.NATIVE).sr25519GetExportID(secretShare)}async createRoom(numParties,apiKey){return(0,common_1.sanitizeNumberOfParties)(numParties),(await this.NATIVE).createRoom(this.URL,numParties,apiKey)}async keygen(roomUuid,numParties,threshold,keygenInit,keygenIds){if((0,common_1.sanitizeNumberOfParties)(numParties,threshold),keygenIds.length!==numParties-1)throw new Error(`keygenIds length must be exactly: ${numParties-1}, it is: `+keygenIds.length);const keygenResult=await(await this.NATIVE).sr25519Keygen(roomUuid,this.URL,numParties,threshold,keygenInit.keygenSecret,keygenIds);if(!keygenResult.pubkey||!keygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(keygenResult.pubkey),secretShareHex=keygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async sign(roomUuid,keygenResult,msg,derivationPath=[]){"string"!=typeof msg&&(msg=(0,utils_1.bytesToHex)(msg));const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,signature=await(await this.NATIVE).sr25519Sign(roomUuid,this.URL,secretShare,msg,Array.from(derivationPath));return(0,utils_1.hexToBytes)(signature)}async refresh(roomUuid,keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,refreshedKeygenResult=await(await this.NATIVE).sr25519Refresh(roomUuid,this.URL,secretShare);if(!refreshedKeygenResult.pubkey||!refreshedKeygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(refreshedKeygenResult.pubkey),secretShareHex=refreshedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareNewParty(roomUuid,oldThreshold,newThreshold,keygenInit,keygenIds){const resharedKeygenResult=await(await this.NATIVE).sr25519ReshareNewParty(roomUuid,this.URL,oldThreshold,newThreshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareRemainingParty(roomUuid,newThreshold,keygenResult,keygenIds){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,resharedKeygenResult=await(await this.NATIVE).sr25519ReshareRemainingParty(roomUuid,this.URL,newThreshold,secretShare,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async derivePubkey(keygenResult,derivationPath=[]){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,derivedPubkey=await(await this.NATIVE).sr25519DerivePubkey(secretShare,Array.from(derivationPath));return(0,utils_1.hexToBytes)(derivedPubkey)}async getPubkey(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,pubKey=await(await this.NATIVE).sr25519GetPubkey(secretShare);return(0,utils_1.hexToBytes)(pubKey)}async derivePubkeyFromPubkey(pubkey,derivation){const derivedPubkey=await(await this.NATIVE).sr25519DerivePubkeyFromPubkey((0,utils_1.bytesToHex)(pubkey),Array.from(derivation));return(0,utils_1.hexToBytes)(derivedPubkey)}async exportFullPrivateKey(roomUuid,keygenResult,toExportID){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,exported=await(await this.NATIVE).sr25519ExportFullPrivateKey(roomUuid,this.URL,secretShare,toExportID);return exported||void 0}async derivePrivateKeyFromPrivateKey(privkey,isPrivateKeyRaw,derivationPath=[]){return(await this.NATIVE).sr25519DerivePrivateKeyFromPrivateKey(privkey,Array.from(derivationPath),isPrivateKeyRaw)}async offlineExportFullPrivateKey(keygenResults){const secretShares=keygenResults.map(k=>{if("string"==typeof k)return k;if(k instanceof _1.Sr25519KeygenResult)return k.secretShare;throw"UnknownType"});return(await this.NATIVE).sr25519OfflineExportFullPrivateKey(secretShares)}async importPrivateKeyRecipient(roomUuid,threshold,keygenInit,keygenIds){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyRecipient(roomUuid,this.URL,threshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async importPrivateKeyImporter(roomUuid,threshold,privateKey,keygenInit,keygenIds,isPrivateKeyRaw=!1){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyImporter(roomUuid,this.URL,threshold,privateKey,keygenInit.keygenSecret,keygenIds,isPrivateKeyRaw),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}}export{Sr25519};
|
|
1
|
+
import*as _1 from"./index.js";import*as common_1 from"./common.js";import*as utils_1 from"@noble/hashes/utils";class Sr25519{constructor(native,url){this.NATIVE=native,this.URL=url}async initKeygen(){const keygenInitKeypair=await(await this.NATIVE).initKeygen();return new _1.Sr25519InitKeygenResult(keygenInitKeypair.pubkey,keygenInitKeypair.keypair)}async exportID(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare;return(await this.NATIVE).sr25519GetExportID(secretShare)}async createRoom(numParties,apiKey){return(0,common_1.sanitizeNumberOfParties)(numParties),(await this.NATIVE).createRoom(this.URL,numParties,apiKey)}async keygen(roomUuid,numParties,threshold,keygenInit,keygenIds){if((0,common_1.sanitizeNumberOfParties)(numParties,threshold),keygenIds.length!==numParties-1)throw new Error(`keygenIds length must be exactly: ${numParties-1}, it is: `+keygenIds.length);const keygenResult=await(await this.NATIVE).sr25519Keygen(roomUuid,this.URL,numParties,threshold,keygenInit.keygenSecret,keygenIds);if(!keygenResult.pubkey||!keygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(keygenResult.pubkey),secretShareHex=keygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async sign(roomUuid,keygenResult,msg,derivationPath=[]){"string"!=typeof msg&&(msg=(0,utils_1.bytesToHex)(msg));const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,signature=await(await this.NATIVE).sr25519Sign(roomUuid,this.URL,secretShare,msg,Array.from(derivationPath));return(0,utils_1.hexToBytes)(signature)}async refresh(roomUuid,keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,refreshedKeygenResult=await(await this.NATIVE).sr25519Refresh(roomUuid,this.URL,secretShare);if(!refreshedKeygenResult.pubkey||!refreshedKeygenResult.secret_share)throw new Error("Keygen failed, no public key or secret share was returned.");const pubkey=(0,utils_1.hexToBytes)(refreshedKeygenResult.pubkey),secretShareHex=refreshedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareNewParty(roomUuid,oldThreshold,newThreshold,keygenInit,keygenIds){const resharedKeygenResult=await(await this.NATIVE).sr25519ReshareNewParty(roomUuid,this.URL,oldThreshold,newThreshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async reshareRemainingParty(roomUuid,newThreshold,keygenResult,keygenIds){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,resharedKeygenResult=await(await this.NATIVE).sr25519ReshareRemainingParty(roomUuid,this.URL,newThreshold,secretShare,keygenIds),pubkey=(0,utils_1.hexToBytes)(resharedKeygenResult.pubkey),secretShareHex=resharedKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async derivePubkey(keygenResult,derivationPath=[]){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,derivedPubkey=await(await this.NATIVE).sr25519DerivePubkey(secretShare,Array.from(derivationPath));return(0,utils_1.hexToBytes)(derivedPubkey)}async getPubkey(keygenResult){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,pubKey=await(await this.NATIVE).sr25519GetPubkey(secretShare);return(0,utils_1.hexToBytes)(pubKey)}async derivePubkeyFromPubkey(pubkey,derivation){const derivedPubkey=await(await this.NATIVE).sr25519DerivePubkeyFromPubkey((0,utils_1.bytesToHex)(pubkey),Array.from(derivation));return(0,utils_1.hexToBytes)(derivedPubkey)}async exportFullPrivateKey(roomUuid,keygenResult,toExportID){const secretShare="string"==typeof keygenResult?keygenResult:keygenResult.secretShare,exported=await(await this.NATIVE).sr25519ExportFullPrivateKey(roomUuid,this.URL,secretShare,toExportID);return exported||void 0}async derivePrivateKeyFromPrivateKey(privkey,isPrivateKeyRaw,derivationPath=[]){return(await this.NATIVE).sr25519DerivePrivateKeyFromPrivateKey(privkey,Array.from(derivationPath),isPrivateKeyRaw)}async offlineExportFullPrivateKey(keygenResults){const secretShares=keygenResults.map(k=>{if("string"==typeof k)return k;if(k instanceof _1.Sr25519KeygenResult)return k.secretShare;throw new Error("UnknownType")});return(await this.NATIVE).sr25519OfflineExportFullPrivateKey(secretShares)}async importPrivateKeyRecipient(roomUuid,threshold,keygenInit,keygenIds){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyRecipient(roomUuid,this.URL,threshold,keygenInit.keygenSecret,keygenIds),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}async importPrivateKeyImporter(roomUuid,threshold,privateKey,keygenInit,keygenIds,isPrivateKeyRaw=!1){const importKeygenResult=await(await this.NATIVE).sr25519ImportPrivateKeyImporter(roomUuid,this.URL,threshold,privateKey,keygenInit.keygenSecret,keygenIds,isPrivateKeyRaw),pubkey=(0,utils_1.hexToBytes)(importKeygenResult.pubkey),secretShareHex=importKeygenResult.secret_share;return new _1.Sr25519KeygenResult(pubkey,secretShareHex)}}export{Sr25519};
|
package/internal/core/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340InitKeygenResult=exports.BIP340KeygenResult=exports.EcdsaSignature=exports.Sr25519InitKeygenResult=exports.ExportableEd25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.Sr25519KeygenResult=exports.Ed25519InitKeygenResult=exports.Ed25519KeygenResult=exports.EcdsaInitKeygenResult=exports.EcdsaKeygenResult=exports.EcdsaPublicKey=exports.MessageHash=void 0;const utils_1=require("@noble/hashes/utils"),sha3_1=require("@noble/hashes/sha3"),sha256_1=require("@noble/hashes/sha256");class MessageHash{constructor(bytes){if(this.bytes=new Uint8Array,"string"==typeof bytes){if(bytes.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=(0,utils_1.hexToBytes)(bytes)}else{if(bytes.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=bytes}}static sha256(message){return new MessageHash((0,sha256_1.sha256)(message))}static sha256d(message){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(message)))}static keccak256(message){return new MessageHash((0,sha3_1.keccak_256)(message))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}exports.MessageHash=MessageHash,MessageHash.LENGTH=32;class EcdsaPublicKey{constructor(pubkey){if("string"==typeof pubkey&&(pubkey=(0,utils_1.hexToBytes)(pubkey)),pubkey.length===EcdsaPublicKey.LENGTH+1)this.pubkey=pubkey.slice(1);else{if(pubkey.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+pubkey.length);this.pubkey=pubkey}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){const isOdd=1&this.pubkey[63];return new Uint8Array([2+isOdd,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}exports.EcdsaPublicKey=EcdsaPublicKey,EcdsaPublicKey.LENGTH=64;class EcdsaKeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.EcdsaKeygenResult=EcdsaKeygenResult;class EcdsaInitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.EcdsaInitKeygenResult=EcdsaInitKeygenResult;class Ed25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.Ed25519KeygenResult=Ed25519KeygenResult;class Ed25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.Ed25519InitKeygenResult=Ed25519InitKeygenResult;class Sr25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.Sr25519KeygenResult=Sr25519KeygenResult;class ExportableEd25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.ExportableEd25519KeygenResult=ExportableEd25519KeygenResult;class ExportableEd25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.ExportableEd25519InitKeygenResult=ExportableEd25519InitKeygenResult;class Sr25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.Sr25519InitKeygenResult=Sr25519InitKeygenResult;class EcdsaSignature{static fromBuffer(expandedSignature){"string"==typeof expandedSignature&&(expandedSignature=(0,utils_1.hexToBytes)(expandedSignature));const maxSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,minSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(expandedSignature.length<minSize||expandedSignature.length>maxSize)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${minSize}..${maxSize} bytes, found: `+expandedSignature.length);const r=expandedSignature.subarray(0,EcdsaSignature.FIELD_SIZE),s=expandedSignature.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),v=expandedSignature[2*EcdsaSignature.FIELD_SIZE],der=expandedSignature.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(r,s,v,der)}constructor(r,s,v,DERencoding){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(r.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+r.length);if(!Number.isInteger(v)||v<27||30<v)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+v);if(DERencoding.length<EcdsaSignature.MIN_DER_LEN||DERencoding.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+DERencoding.length);this.r=r,this.s=s,this.v=v,this.der=DERencoding}}exports.EcdsaSignature=EcdsaSignature,EcdsaSignature.FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.BIP340KeygenResult=BIP340KeygenResult;class BIP340InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.BIP340InitKeygenResult=BIP340InitKeygenResult;
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.EdBls12377InitKeygenResult=exports.EdBls12377KeygenResult=exports.BIP340InitKeygenResult=exports.BIP340KeygenResult=exports.EcdsaSignature=exports.Sr25519InitKeygenResult=exports.ExportableEd25519InitKeygenResult=exports.ExportableEd25519KeygenResult=exports.Sr25519KeygenResult=exports.Ed25519InitKeygenResult=exports.Ed25519KeygenResult=exports.EcdsaInitKeygenResult=exports.EcdsaKeygenResult=exports.EcdsaPublicKey=exports.MessageHash=void 0;const utils_1=require("@noble/hashes/utils"),sha3_1=require("@noble/hashes/sha3"),sha256_1=require("@noble/hashes/sha256");class MessageHash{constructor(bytes){if(this.bytes=new Uint8Array,"string"==typeof bytes){if(bytes.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=(0,utils_1.hexToBytes)(bytes)}else{if(bytes.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=bytes}}static sha256(message){return new MessageHash((0,sha256_1.sha256)(message))}static sha256d(message){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(message)))}static keccak256(message){return new MessageHash((0,sha3_1.keccak_256)(message))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}exports.MessageHash=MessageHash,MessageHash.LENGTH=32;class EcdsaPublicKey{constructor(pubkey){if("string"==typeof pubkey&&(pubkey=(0,utils_1.hexToBytes)(pubkey)),pubkey.length===EcdsaPublicKey.LENGTH+1)this.pubkey=pubkey.slice(1);else{if(pubkey.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+pubkey.length);this.pubkey=pubkey}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){const isOdd=1&this.pubkey[63];return new Uint8Array([2+isOdd,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}exports.EcdsaPublicKey=EcdsaPublicKey,EcdsaPublicKey.LENGTH=64;class EcdsaKeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.EcdsaKeygenResult=EcdsaKeygenResult;class EcdsaInitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.EcdsaInitKeygenResult=EcdsaInitKeygenResult;class Ed25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.Ed25519KeygenResult=Ed25519KeygenResult;class Ed25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.Ed25519InitKeygenResult=Ed25519InitKeygenResult;class Sr25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.Sr25519KeygenResult=Sr25519KeygenResult;class ExportableEd25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.ExportableEd25519KeygenResult=ExportableEd25519KeygenResult;class ExportableEd25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.ExportableEd25519InitKeygenResult=ExportableEd25519InitKeygenResult;class Sr25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.Sr25519InitKeygenResult=Sr25519InitKeygenResult;class EcdsaSignature{static fromBuffer(expandedSignature){"string"==typeof expandedSignature&&(expandedSignature=(0,utils_1.hexToBytes)(expandedSignature));const maxSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,minSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(expandedSignature.length<minSize||expandedSignature.length>maxSize)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${minSize}..${maxSize} bytes, found: `+expandedSignature.length);const r=expandedSignature.subarray(0,EcdsaSignature.FIELD_SIZE),s=expandedSignature.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),v=expandedSignature[2*EcdsaSignature.FIELD_SIZE],der=expandedSignature.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(r,s,v,der)}constructor(r,s,v,DERencoding){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(r.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+r.length);if(!Number.isInteger(v)||v<27||30<v)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+v);if(DERencoding.length<EcdsaSignature.MIN_DER_LEN||DERencoding.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+DERencoding.length);this.r=r,this.s=s,this.v=v,this.der=DERencoding}}exports.EcdsaSignature=EcdsaSignature,EcdsaSignature.FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}exports.BIP340KeygenResult=BIP340KeygenResult;class BIP340InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.BIP340InitKeygenResult=BIP340InitKeygenResult;class EdBls12377KeygenResult{constructor(computeKey,address,secretShare){this.computeKey=computeKey,this.address=address,this.secretShare=secretShare}}exports.EdBls12377KeygenResult=EdBls12377KeygenResult;class EdBls12377InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}exports.EdBls12377InitKeygenResult=EdBls12377InitKeygenResult;
|
package/internal/core/types.d.ts
CHANGED
|
@@ -76,3 +76,39 @@ export declare class BIP340InitKeygenResult {
|
|
|
76
76
|
keygenSecret: string;
|
|
77
77
|
constructor(keygenId: string, keygenSecret: string);
|
|
78
78
|
}
|
|
79
|
+
export type EdBls12377FieldElement = Uint8Array;
|
|
80
|
+
export type EdBls12377GroupElement = Uint8Array;
|
|
81
|
+
export interface EdBls12377SimpleRequestInput {
|
|
82
|
+
type: 'constant' | 'public' | 'private' | 'external_record';
|
|
83
|
+
index: EdBls12377FieldElement;
|
|
84
|
+
fields: EdBls12377FieldElement[];
|
|
85
|
+
}
|
|
86
|
+
export interface EdBls12377RecordRequestInput {
|
|
87
|
+
type: 'record';
|
|
88
|
+
h: EdBls12377GroupElement;
|
|
89
|
+
tag: EdBls12377FieldElement;
|
|
90
|
+
}
|
|
91
|
+
export type EdBls12377RequestInput = EdBls12377SimpleRequestInput | EdBls12377RecordRequestInput;
|
|
92
|
+
export interface EdBls12377RequestSignPayload {
|
|
93
|
+
function_id: EdBls12377FieldElement;
|
|
94
|
+
is_root: boolean;
|
|
95
|
+
program_checksum: EdBls12377FieldElement | null;
|
|
96
|
+
inputs: EdBls12377RequestInput[];
|
|
97
|
+
}
|
|
98
|
+
export interface EdBls12377SignedRequest {
|
|
99
|
+
signer: Uint8Array;
|
|
100
|
+
signature: Uint8Array;
|
|
101
|
+
tvk: EdBls12377FieldElement;
|
|
102
|
+
gammas: EdBls12377GroupElement[];
|
|
103
|
+
}
|
|
104
|
+
export declare class EdBls12377KeygenResult {
|
|
105
|
+
computeKey: string;
|
|
106
|
+
address: string;
|
|
107
|
+
secretShare: string;
|
|
108
|
+
constructor(computeKey: string, address: string, secretShare: string);
|
|
109
|
+
}
|
|
110
|
+
export declare class EdBls12377InitKeygenResult {
|
|
111
|
+
keygenId: string;
|
|
112
|
+
keygenSecret: string;
|
|
113
|
+
constructor(keygenId: string, keygenSecret: string);
|
|
114
|
+
}
|
package/internal/core/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as utils_1 from"@noble/hashes/utils";import*as sha3_1 from"@noble/hashes/sha3";import*as sha256_1 from"@noble/hashes/sha256";class MessageHash{constructor(bytes){if(this.bytes=new Uint8Array,"string"==typeof bytes){if(bytes.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=(0,utils_1.hexToBytes)(bytes)}else{if(bytes.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=bytes}}static sha256(message){return new MessageHash((0,sha256_1.sha256)(message))}static sha256d(message){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(message)))}static keccak256(message){return new MessageHash((0,sha3_1.keccak_256)(message))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}MessageHash.LENGTH=32;class EcdsaPublicKey{constructor(pubkey){if("string"==typeof pubkey&&(pubkey=(0,utils_1.hexToBytes)(pubkey)),pubkey.length===EcdsaPublicKey.LENGTH+1)this.pubkey=pubkey.slice(1);else{if(pubkey.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+pubkey.length);this.pubkey=pubkey}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){const isOdd=1&this.pubkey[63];return new Uint8Array([2+isOdd,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}EcdsaPublicKey.LENGTH=64;class EcdsaKeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class EcdsaInitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Ed25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class Ed25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Sr25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class ExportableEd25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class ExportableEd25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Sr25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class EcdsaSignature{static fromBuffer(expandedSignature){"string"==typeof expandedSignature&&(expandedSignature=(0,utils_1.hexToBytes)(expandedSignature));const maxSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,minSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(expandedSignature.length<minSize||expandedSignature.length>maxSize)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${minSize}..${maxSize} bytes, found: `+expandedSignature.length);const r=expandedSignature.subarray(0,EcdsaSignature.FIELD_SIZE),s=expandedSignature.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),v=expandedSignature[2*EcdsaSignature.FIELD_SIZE],der=expandedSignature.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(r,s,v,der)}constructor(r,s,v,DERencoding){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(r.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+r.length);if(!Number.isInteger(v)||v<27||30<v)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+v);if(DERencoding.length<EcdsaSignature.MIN_DER_LEN||DERencoding.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+DERencoding.length);this.r=r,this.s=s,this.v=v,this.der=DERencoding}}EcdsaSignature.FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class BIP340InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}export{MessageHash,EcdsaPublicKey,EcdsaKeygenResult,EcdsaInitKeygenResult,Ed25519KeygenResult,Ed25519InitKeygenResult,Sr25519KeygenResult,ExportableEd25519KeygenResult,ExportableEd25519InitKeygenResult,Sr25519InitKeygenResult,EcdsaSignature,BIP340KeygenResult,BIP340InitKeygenResult};
|
|
1
|
+
import*as utils_1 from"@noble/hashes/utils";import*as sha3_1 from"@noble/hashes/sha3";import*as sha256_1 from"@noble/hashes/sha256";class MessageHash{constructor(bytes){if(this.bytes=new Uint8Array,"string"==typeof bytes){if(bytes.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=(0,utils_1.hexToBytes)(bytes)}else{if(bytes.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+bytes.length);this.bytes=bytes}}static sha256(message){return new MessageHash((0,sha256_1.sha256)(message))}static sha256d(message){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(message)))}static keccak256(message){return new MessageHash((0,sha3_1.keccak_256)(message))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}MessageHash.LENGTH=32;class EcdsaPublicKey{constructor(pubkey){if("string"==typeof pubkey&&(pubkey=(0,utils_1.hexToBytes)(pubkey)),pubkey.length===EcdsaPublicKey.LENGTH+1)this.pubkey=pubkey.slice(1);else{if(pubkey.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+pubkey.length);this.pubkey=pubkey}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){const isOdd=1&this.pubkey[63];return new Uint8Array([2+isOdd,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}EcdsaPublicKey.LENGTH=64;class EcdsaKeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class EcdsaInitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Ed25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class Ed25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Sr25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class ExportableEd25519KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class ExportableEd25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class Sr25519InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class EcdsaSignature{static fromBuffer(expandedSignature){"string"==typeof expandedSignature&&(expandedSignature=(0,utils_1.hexToBytes)(expandedSignature));const maxSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,minSize=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(expandedSignature.length<minSize||expandedSignature.length>maxSize)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${minSize}..${maxSize} bytes, found: `+expandedSignature.length);const r=expandedSignature.subarray(0,EcdsaSignature.FIELD_SIZE),s=expandedSignature.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),v=expandedSignature[2*EcdsaSignature.FIELD_SIZE],der=expandedSignature.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(r,s,v,der)}constructor(r,s,v,DERencoding){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(r.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+r.length);if(!Number.isInteger(v)||v<27||30<v)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+v);if(DERencoding.length<EcdsaSignature.MIN_DER_LEN||DERencoding.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+DERencoding.length);this.r=r,this.s=s,this.v=v,this.der=DERencoding}}EcdsaSignature.FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(pubkey,secretShare){this.pubkey=pubkey,this.secretShare=secretShare}}class BIP340InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}class EdBls12377KeygenResult{constructor(computeKey,address,secretShare){this.computeKey=computeKey,this.address=address,this.secretShare=secretShare}}class EdBls12377InitKeygenResult{constructor(keygenId,keygenSecret){this.keygenId=keygenId,this.keygenSecret=keygenSecret}}export{MessageHash,EcdsaPublicKey,EcdsaKeygenResult,EcdsaInitKeygenResult,Ed25519KeygenResult,Ed25519InitKeygenResult,Sr25519KeygenResult,ExportableEd25519KeygenResult,ExportableEd25519InitKeygenResult,Sr25519InitKeygenResult,EcdsaSignature,BIP340KeygenResult,BIP340InitKeygenResult,EdBls12377KeygenResult,EdBls12377InitKeygenResult};
|
|
@@ -1,74 +1,95 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function ecdsaSign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array): Promise<string>;
|
|
3
|
-
export function ecdsaRefresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
4
|
-
export function ecdsaReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
5
|
-
export function ecdsaReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
6
|
-
export function ecdsaDerivePubkey(secret_share: string, derivation_path: Uint32Array): Promise<string>;
|
|
7
|
-
export function ecdsaGetXpub(secret_share: string): Promise<string>;
|
|
8
|
-
export function ecdsaDerivePubkeyFromXpub(xpub: string, derivation_path: Uint32Array): Promise<string>;
|
|
9
|
-
export function ecdsaGetExportID(secret_share: string): Promise<string>;
|
|
10
|
-
export function ecdsaExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
11
|
-
export function ecdsaOfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
12
|
-
export function ecdsaDerivePrivateKeyFromXpriv(xpriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
13
|
-
export function ecdsaImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
14
|
-
export function ecdsaImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], chaincode_hex: string): Promise<KeygenResult>;
|
|
15
|
-
export function bip340Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
16
|
-
export function bip340Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
17
|
-
export function bip340Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
18
|
-
export function bip340ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
19
|
-
export function bip340ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
1
|
+
export function bip340DerivePrivateKeyFromXpriv(xpriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
20
2
|
export function bip340DeriveTweakPubkey(secret_share: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
21
|
-
export function bip340GetXpub(secret_share: string): Promise<string>;
|
|
22
3
|
export function bip340DeriveTweakPubkeyFromXpub(xpub: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
23
|
-
export function bip340GetExportID(secret_share: string): Promise<string>;
|
|
24
4
|
export function bip340ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
25
|
-
export function
|
|
26
|
-
export function
|
|
27
|
-
export function bip340ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
5
|
+
export function bip340GetExportID(secret_share: string): Promise<string>;
|
|
6
|
+
export function bip340GetXpub(secret_share: string): Promise<string>;
|
|
28
7
|
export function bip340ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], chaincode_hex: string): Promise<KeygenResult>;
|
|
29
|
-
export function
|
|
30
|
-
export function
|
|
31
|
-
export function
|
|
32
|
-
export function
|
|
33
|
-
export function
|
|
34
|
-
export function
|
|
35
|
-
export function
|
|
36
|
-
export function sr25519DerivePubkeyFromPubkey(pubkey: string, derivation_path: string[]): Promise<string>;
|
|
37
|
-
export function sr25519GetExportID(secret_share: string): Promise<string>;
|
|
38
|
-
export function sr25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
39
|
-
export function sr25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
40
|
-
export function sr25519DerivePrivateKeyFromPrivateKey(private_key: string, derivation_path: string[], is_private_key_raw: boolean): Promise<string>;
|
|
41
|
-
export function sr25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
42
|
-
export function sr25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], is_private_key_raw: boolean): Promise<KeygenResult>;
|
|
8
|
+
export function bip340ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
9
|
+
export function bip340Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
10
|
+
export function bip340OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
11
|
+
export function bip340Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
12
|
+
export function bip340ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
13
|
+
export function bip340ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
14
|
+
export function bip340Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
43
15
|
export function createRoom(host_addr: string, num_parties: number, api_token: string): Promise<string>;
|
|
44
|
-
export function
|
|
45
|
-
export function
|
|
46
|
-
export function
|
|
47
|
-
export function
|
|
48
|
-
export function
|
|
49
|
-
export function
|
|
50
|
-
export function
|
|
16
|
+
export function ecdsaDerivePrivateKeyFromXpriv(xpriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
17
|
+
export function ecdsaDerivePubkey(secret_share: string, derivation_path: Uint32Array): Promise<string>;
|
|
18
|
+
export function ecdsaDerivePubkeyFromXpub(xpub: string, derivation_path: Uint32Array): Promise<string>;
|
|
19
|
+
export function ecdsaExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
20
|
+
export function ecdsaGetExportID(secret_share: string): Promise<string>;
|
|
21
|
+
export function ecdsaGetXpub(secret_share: string): Promise<string>;
|
|
22
|
+
export function ecdsaImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], chaincode_hex: string): Promise<KeygenResult>;
|
|
23
|
+
export function ecdsaImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
24
|
+
export function ecdsaKeygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
25
|
+
export function ecdsaOfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
26
|
+
export function ecdsaRefresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
27
|
+
export function ecdsaReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
28
|
+
export function ecdsaReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
29
|
+
export function ecdsaSign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array): Promise<string>;
|
|
30
|
+
export function ed25519DerivePrivateKeyFromSpriv(spriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
51
31
|
export function ed25519DerivePubkey(secret_share: string, derivation_path: Uint32Array): Promise<string>;
|
|
52
|
-
export function ed25519GetSpub(secret_share: string): Promise<string>;
|
|
53
32
|
export function ed25519DerivePubkeyFromSpub(spub: string, derivation_path: Uint32Array): Promise<string>;
|
|
54
|
-
export function ed25519GetExportID(secret_share: string): Promise<string>;
|
|
55
33
|
export function ed25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
56
|
-
export function
|
|
57
|
-
export function
|
|
58
|
-
export function ed25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
34
|
+
export function ed25519GetExportID(secret_share: string): Promise<string>;
|
|
35
|
+
export function ed25519GetSpub(secret_share: string): Promise<string>;
|
|
59
36
|
export function ed25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], is_private_key_raw: boolean): Promise<KeygenResult>;
|
|
60
|
-
export function
|
|
37
|
+
export function ed25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
38
|
+
export function ed25519Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
39
|
+
export function ed25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
40
|
+
export function ed25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
41
|
+
export function ed25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
42
|
+
export function ed25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
43
|
+
export function ed25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array): Promise<string>;
|
|
44
|
+
export function edBls12377ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
45
|
+
export function edBls12377ExportViewKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
46
|
+
export function edBls12377GetExportID(secret_share: string): Promise<string>;
|
|
47
|
+
export function edBls12377ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], is_private_key_raw: boolean): Promise<EdBls12377KeygenResult>;
|
|
48
|
+
export function edBls12377ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<EdBls12377KeygenResult>;
|
|
49
|
+
export function edBls12377Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<EdBls12377KeygenResult>;
|
|
50
|
+
export function edBls12377OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
51
|
+
export function edBls12377OfflineExportViewKey(secret_shares: string[]): Promise<string>;
|
|
52
|
+
export function edBls12377Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<EdBls12377KeygenResult>;
|
|
53
|
+
export function edBls12377ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<EdBls12377KeygenResult>;
|
|
54
|
+
export function edBls12377ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<EdBls12377KeygenResult>;
|
|
55
|
+
export function edBls12377signRequest(room_uuid: string, host_addr: string, secret_share: string, request_payload_json: string): Promise<string>;
|
|
56
|
+
export function exportableEd25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
57
|
+
export function exportableEd25519GetExportID(secret_share: string): Promise<string>;
|
|
58
|
+
export function exportableEd25519GetPubkey(secret_share: string): Promise<string>;
|
|
59
|
+
export function exportableEd25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
60
|
+
export function exportableEd25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
61
|
+
export function exportableEd25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
61
62
|
export function exportableEd25519ReceiveKey(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
62
|
-
export function exportableEd25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string): Promise<string>;
|
|
63
63
|
export function exportableEd25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
64
64
|
export function exportableEd25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
65
65
|
export function exportableEd25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
66
|
-
export function
|
|
67
|
-
export function
|
|
68
|
-
export function
|
|
69
|
-
export function
|
|
70
|
-
export function
|
|
71
|
-
export function
|
|
66
|
+
export function exportableEd25519SampleKey(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
67
|
+
export function exportableEd25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string): Promise<string>;
|
|
68
|
+
export function initKeygen(): Promise<KeygenInit>;
|
|
69
|
+
export function sr25519DerivePrivateKeyFromPrivateKey(private_key: string, derivation_path: string[], is_private_key_raw: boolean): Promise<string>;
|
|
70
|
+
export function sr25519DerivePubkey(secret_share: string, derivation_path: string[]): Promise<string>;
|
|
71
|
+
export function sr25519DerivePubkeyFromPubkey(pubkey: string, derivation_path: string[]): Promise<string>;
|
|
72
|
+
export function sr25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
73
|
+
export function sr25519GetExportID(secret_share: string): Promise<string>;
|
|
74
|
+
export function sr25519GetPubkey(secret_share: string): Promise<string>;
|
|
75
|
+
export function sr25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[], is_private_key_raw: boolean): Promise<KeygenResult>;
|
|
76
|
+
export function sr25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
77
|
+
export function sr25519Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
78
|
+
export function sr25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
79
|
+
export function sr25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
80
|
+
export function sr25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
81
|
+
export function sr25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
82
|
+
export function sr25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: string[]): Promise<string>;
|
|
83
|
+
export function start(): void;
|
|
84
|
+
export class EdBls12377KeygenResult {
|
|
85
|
+
static __wrap(ptr: any): any;
|
|
86
|
+
__destroy_into_raw(): number | undefined;
|
|
87
|
+
__wbg_ptr: number | undefined;
|
|
88
|
+
free(): void;
|
|
89
|
+
get address(): string;
|
|
90
|
+
get compute_key(): string;
|
|
91
|
+
get secret_share(): string;
|
|
92
|
+
}
|
|
72
93
|
export class KeygenInit {
|
|
73
94
|
static __wrap(ptr: any): any;
|
|
74
95
|
constructor(keypair: string, pubkey: string);
|
|
@@ -83,9 +104,9 @@ export class KeygenResult {
|
|
|
83
104
|
__destroy_into_raw(): number | undefined;
|
|
84
105
|
__wbg_ptr: number | undefined;
|
|
85
106
|
free(): void;
|
|
86
|
-
get secret_share(): string;
|
|
87
107
|
get pubkey(): string;
|
|
108
|
+
get secret_share(): string;
|
|
88
109
|
}
|
|
89
|
-
export default __wbg_init;
|
|
90
110
|
export function initSync(module: any): any;
|
|
91
111
|
declare function __wbg_init(module_or_path: any): Promise<any>;
|
|
112
|
+
export { __wbg_init as default };
|