@dynamic-labs-wallet/browser 0.0.66 → 0.0.68
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.js +148 -53
- package/index.esm.js +147 -54
- package/internal/core/ecdsa.d.ts +1 -1
- package/internal/core/ecdsa.js +1 -1
- package/internal/core/ed25519.js +1 -1
- package/internal/core/ed25519_exportable.d.ts +21 -0
- package/internal/core/ed25519_exportable.js +1 -0
- package/internal/core/index.d.ts +4 -2
- package/internal/core/index.js +1 -1
- package/internal/core/native.d.ts +65 -0
- package/internal/core/sr25519.d.ts +22 -0
- package/internal/core/sr25519.js +1 -0
- package/internal/core/types.d.ts +20 -0
- package/internal/core/types.js +1 -1
- package/internal/web/generated/libmpc_executor.d.ts +60 -99
- 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 +8 -2
- package/internal/web/index.js +1 -1
- package/package.json +5 -2
- package/src/backup/providers/googleDrive.d.ts +4 -4
- package/src/backup/providers/googleDrive.d.ts.map +1 -1
- package/src/backup/utils.d.ts +37 -0
- package/src/backup/utils.d.ts.map +1 -0
- package/src/client.d.ts +10 -7
- package/src/client.d.ts.map +1 -1
- package/src/utils.d.ts +27 -2
- package/src/utils.d.ts.map +1 -1
- package/internal/web/generated/libmpc_executor_bg.wasm.d.ts +0 -64
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, DynamicNativeSdkInterface } from './';
|
|
2
|
+
export declare class ExportableEd25519 {
|
|
3
|
+
protected readonly NATIVE: Promise<DynamicNativeSdkInterface>;
|
|
4
|
+
protected readonly URL: string;
|
|
5
|
+
protected constructor(native: Promise<DynamicNativeSdkInterface>, url: string);
|
|
6
|
+
initKeygen(): Promise<ExportableEd25519InitKeygenResult>;
|
|
7
|
+
exportID(keygenResult: ExportableEd25519KeygenResult | string): Promise<string>;
|
|
8
|
+
createRoom(numParties: number, apiKey: string): Promise<string>;
|
|
9
|
+
sampleKey(roomUuid: string, numParties: number, threshold: number, keygenInit: ExportableEd25519InitKeygenResult, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
10
|
+
receiveKey(roomUuid: string, numParties: number, threshold: number, keygenInit: ExportableEd25519InitKeygenResult, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
11
|
+
sign(roomUuid: string, keygenResult: ExportableEd25519KeygenResult | string, msg: Uint8Array | string): Promise<Uint8Array>;
|
|
12
|
+
refresh(roomUuid: string, keygenResult: ExportableEd25519KeygenResult | string): Promise<ExportableEd25519KeygenResult>;
|
|
13
|
+
reshareNewParty(roomUuid: string, oldThreshold: number, newThreshold: number, keygenInit: ExportableEd25519InitKeygenResult, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
14
|
+
reshareRemainingParty(roomUuid: string, newThreshold: number, keygenResult: ExportableEd25519KeygenResult | string, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
15
|
+
getPrivateKey(keygenResult: ExportableEd25519KeygenResult | string): Promise<string>;
|
|
16
|
+
exportFullPrivateKey(roomUuid: string, keygenResult: ExportableEd25519KeygenResult | string, toExportID: string): Promise<string | undefined>;
|
|
17
|
+
offlineExportFullPrivateKey(keygenResults: ExportableEd25519KeygenResult[] | string[]): Promise<string>;
|
|
18
|
+
importPrivateKeyRecipient(roomUuid: string, threshold: number, keygenInit: ExportableEd25519InitKeygenResult, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
19
|
+
importPrivateKeyImporter(roomUuid: string, threshold: number, privateKey: string, keygenInit: ExportableEd25519InitKeygenResult, keygenIds: string[]): Promise<ExportableEd25519KeygenResult>;
|
|
20
|
+
getPubkey(keygenResult: ExportableEd25519KeygenResult | string): Promise<string>;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExportableEd25519=void 0;let _1=require("./"),utils_1=require("@noble/hashes/utils"),common_1=require("./common");class ExportableEd25519{constructor(e,t){this.NATIVE=e,this.URL=t}async initKeygen(){var e=await(await this.NATIVE).initKeygen();return new _1.ExportableEd25519InitKeygenResult(e.pubkey,e.keypair)}async exportID(e){e="string"==typeof e?e:e.secretShare;return(await this.NATIVE).exportableEd25519GetExportID(e)}async createRoom(e,t){return(0,common_1.sanitizeNumberOfParties)(e),(await this.NATIVE).createRoom(this.URL,e,t)}async sampleKey(e,t,r,a,s){if((0,common_1.sanitizeNumberOfParties)(t,r),s.length!==t-1)throw new Error(`keygenIds length must be exactly: ${t-1}, it is: `+s.length);e=await(await this.NATIVE).exportableEd25519SampleKey(e,this.URL,t,r,a.keygenSecret,s);if(e.pubkey&&e.secret_share)return t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share,new _1.ExportableEd25519KeygenResult(t,r);throw new Error("Key sampling failed, no public key or secret share was returned.")}async receiveKey(e,t,r,a,s){if((0,common_1.sanitizeNumberOfParties)(t,r),s.length!==t-1)throw new Error(`keygenIds length must be exactly: ${t-1}, it is: `+s.length);e=await(await this.NATIVE).exportableEd25519ReceiveKey(e,this.URL,t,r,a.keygenSecret,s);if(e.pubkey&&e.secret_share)return t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share,new _1.ExportableEd25519KeygenResult(t,r);throw new Error("Key receive failed, no public key or secret share was returned.")}async sign(e,t,r){"string"!=typeof r&&(r=(0,utils_1.bytesToHex)(r));t="string"==typeof t?t:t.secretShare,e=await(await this.NATIVE).exportableEd25519Sign(e,this.URL,t,r);return(0,utils_1.hexToBytes)(e)}async refresh(e,t){var t="string"==typeof t?t:t.secretShare,e=await(await this.NATIVE).exportableEd25519Refresh(e,this.URL,t);if(e.pubkey&&e.secret_share)return t=(0,utils_1.hexToBytes)(e.pubkey),e=e.secret_share,new _1.ExportableEd25519KeygenResult(t,e);throw new Error("Keygen failed, no public key or secret share was returned.")}async reshareNewParty(e,t,r,a,s){e=await(await this.NATIVE).exportableEd25519ReshareNewParty(e,this.URL,t,r,a.keygenSecret,s),t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share;return new _1.ExportableEd25519KeygenResult(t,r)}async reshareRemainingParty(e,t,r,a){r="string"==typeof r?r:r.secretShare,e=await(await this.NATIVE).exportableEd25519ReshareRemainingParty(e,this.URL,t,r,a),t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share;return new _1.ExportableEd25519KeygenResult(t,r)}async getPrivateKey(e){e="string"==typeof e?e:e.secretShare;return(await this.NATIVE).exportableEd25519GetPubkey(e)}async exportFullPrivateKey(e,t,r){t="string"==typeof t?t:t.secretShare,e=await(await this.NATIVE).exportableEd25519ExportFullPrivateKey(e,this.URL,t,r);return e||void 0}async offlineExportFullPrivateKey(e){e=e.map(e=>{if("string"==typeof e)return e;if(e instanceof _1.ExportableEd25519KeygenResult)return e.secretShare;throw new Error("UnknownType")});return(await this.NATIVE).exportableEd25519OfflineExportFullPrivateKey(e)}async importPrivateKeyRecipient(e,t,r,a){e=await(await this.NATIVE).exportableEd25519ImportPrivateKeyRecipient(e,this.URL,t,r.keygenSecret,a),t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share;return new _1.ExportableEd25519KeygenResult(t,r)}async importPrivateKeyImporter(e,t,r,a,s){e=await(await this.NATIVE).exportableEd25519ImportPrivateKeyImporter(e,this.URL,t,r,a.keygenSecret,s),t=(0,utils_1.hexToBytes)(e.pubkey),r=e.secret_share;return new _1.ExportableEd25519KeygenResult(t,r)}async getPubkey(e){e="string"==typeof e?e:e.secretShare;return(await this.NATIVE).exportableEd25519GetPubkey(e)}}exports.ExportableEd25519=ExportableEd25519;
|
package/internal/core/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash } from './types';
|
|
1
|
+
import { EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash } from './types';
|
|
2
2
|
import { Ecdsa } from './ecdsa';
|
|
3
3
|
import { Ed25519 } from './ed25519';
|
|
4
|
+
import { ExportableEd25519 } from './ed25519_exportable';
|
|
5
|
+
import { Sr25519 } from './sr25519';
|
|
4
6
|
import { BIP340 } from './bip340';
|
|
5
7
|
import { DynamicNativeSdkInterface } from './native';
|
|
6
|
-
export { DynamicNativeSdkInterface, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash, Ecdsa, Ed25519, BIP340, };
|
|
8
|
+
export { DynamicNativeSdkInterface, EcdsaInitKeygenResult, EcdsaKeygenResult, EcdsaPublicKey, EcdsaSignature, Ed25519InitKeygenResult, Ed25519KeygenResult, ExportableEd25519InitKeygenResult, ExportableEd25519KeygenResult, Sr25519InitKeygenResult, Sr25519KeygenResult, BIP340InitKeygenResult, BIP340KeygenResult, MessageHash, Ecdsa, Ed25519, ExportableEd25519, Sr25519, BIP340, };
|
package/internal/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340=exports.Ed25519=exports.Ecdsa=exports.MessageHash=exports.BIP340KeygenResult=exports.BIP340InitKeygenResult=exports.Ed25519KeygenResult=exports.Ed25519InitKeygenResult=exports.EcdsaSignature=exports.EcdsaPublicKey=exports.EcdsaKeygenResult=exports.EcdsaInitKeygenResult=void 0;let types_1=require("./types"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaInitKeygenResult}}),Object.defineProperty(exports,"EcdsaKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaKeygenResult}}),Object.defineProperty(exports,"EcdsaPublicKey",{enumerable:!0,get:function(){return types_1.EcdsaPublicKey}}),Object.defineProperty(exports,"EcdsaSignature",{enumerable:!0,get:function(){return types_1.EcdsaSignature}}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519InitKeygenResult}}),Object.defineProperty(exports,"Ed25519KeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519KeygenResult}}),Object.defineProperty(exports,"BIP340InitKeygenResult",{enumerable:!0,get:function(){return types_1.BIP340InitKeygenResult}}),Object.defineProperty(exports,"BIP340KeygenResult",{enumerable:!0,get:function(){return types_1.BIP340KeygenResult}}),Object.defineProperty(exports,"MessageHash",{enumerable:!0,get:function(){return types_1.MessageHash}}),require("./ecdsa")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{enumerable:!0,get:function(){return ecdsa_1.Ecdsa}}),require("./ed25519")),
|
|
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;let types_1=require("./types"),ecdsa_1=(Object.defineProperty(exports,"EcdsaInitKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaInitKeygenResult}}),Object.defineProperty(exports,"EcdsaKeygenResult",{enumerable:!0,get:function(){return types_1.EcdsaKeygenResult}}),Object.defineProperty(exports,"EcdsaPublicKey",{enumerable:!0,get:function(){return types_1.EcdsaPublicKey}}),Object.defineProperty(exports,"EcdsaSignature",{enumerable:!0,get:function(){return types_1.EcdsaSignature}}),Object.defineProperty(exports,"Ed25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519InitKeygenResult}}),Object.defineProperty(exports,"Ed25519KeygenResult",{enumerable:!0,get:function(){return types_1.Ed25519KeygenResult}}),Object.defineProperty(exports,"ExportableEd25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.ExportableEd25519InitKeygenResult}}),Object.defineProperty(exports,"ExportableEd25519KeygenResult",{enumerable:!0,get:function(){return types_1.ExportableEd25519KeygenResult}}),Object.defineProperty(exports,"Sr25519InitKeygenResult",{enumerable:!0,get:function(){return types_1.Sr25519InitKeygenResult}}),Object.defineProperty(exports,"Sr25519KeygenResult",{enumerable:!0,get:function(){return types_1.Sr25519KeygenResult}}),Object.defineProperty(exports,"BIP340InitKeygenResult",{enumerable:!0,get:function(){return types_1.BIP340InitKeygenResult}}),Object.defineProperty(exports,"BIP340KeygenResult",{enumerable:!0,get:function(){return types_1.BIP340KeygenResult}}),Object.defineProperty(exports,"MessageHash",{enumerable:!0,get:function(){return types_1.MessageHash}}),require("./ecdsa")),ed25519_1=(Object.defineProperty(exports,"Ecdsa",{enumerable:!0,get:function(){return ecdsa_1.Ecdsa}}),require("./ed25519")),ed25519_exportable_1=(Object.defineProperty(exports,"Ed25519",{enumerable:!0,get:function(){return ed25519_1.Ed25519}}),require("./ed25519_exportable")),sr25519_1=(Object.defineProperty(exports,"ExportableEd25519",{enumerable:!0,get:function(){return ed25519_exportable_1.ExportableEd25519}}),require("./sr25519")),bip340_1=(Object.defineProperty(exports,"Sr25519",{enumerable:!0,get:function(){return sr25519_1.Sr25519}}),require("./bip340"));Object.defineProperty(exports,"BIP340",{enumerable:!0,get:function(){return bip340_1.BIP340}});
|
|
@@ -68,6 +68,39 @@ export interface DynamicNativeSdkInterface {
|
|
|
68
68
|
pubkey: string;
|
|
69
69
|
secret_share: string;
|
|
70
70
|
}>;
|
|
71
|
+
exportableEd25519GetExportID(secretShare: string): Promise<string>;
|
|
72
|
+
exportableEd25519SampleKey(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
73
|
+
pubkey: string;
|
|
74
|
+
secret_share: string;
|
|
75
|
+
}>;
|
|
76
|
+
exportableEd25519ReceiveKey(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
77
|
+
pubkey: string;
|
|
78
|
+
secret_share: string;
|
|
79
|
+
}>;
|
|
80
|
+
exportableEd25519Sign(roomUUID: string, hostUrl: string, secretShare: string, msgHex: string): Promise<string>;
|
|
81
|
+
exportableEd25519Refresh(roomUUID: string, hostUrl: string, secretShare: string): Promise<{
|
|
82
|
+
pubkey: string;
|
|
83
|
+
secret_share: string;
|
|
84
|
+
}>;
|
|
85
|
+
exportableEd25519ReshareNewParty(roomUUID: string, hostUrl: string, oldThreshold: number, newThreshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
86
|
+
pubkey: string;
|
|
87
|
+
secret_share: string;
|
|
88
|
+
}>;
|
|
89
|
+
exportableEd25519ReshareRemainingParty(roomUUID: string, hostUrl: string, newThreshold: number, secretShare: string, keygenIDs: string[]): Promise<{
|
|
90
|
+
pubkey: string;
|
|
91
|
+
secret_share: string;
|
|
92
|
+
}>;
|
|
93
|
+
exportableEd25519GetPubkey(secretShare: string): Promise<string>;
|
|
94
|
+
exportableEd25519ExportFullPrivateKey(roomUUID: string, hostUrl: string, secretShare: string, toExportID: string): Promise<undefined | string>;
|
|
95
|
+
exportableEd25519OfflineExportFullPrivateKey(keygenResults: string[]): Promise<string>;
|
|
96
|
+
exportableEd25519ImportPrivateKeyRecipient(roomUUID: string, hostUrl: string, threshold: number, secretShare: string, keygenIDs: string[]): Promise<{
|
|
97
|
+
pubkey: string;
|
|
98
|
+
secret_share: string;
|
|
99
|
+
}>;
|
|
100
|
+
exportableEd25519ImportPrivateKeyImporter(roomUUID: string, hostUrl: string, threshold: number, privateKey: string, secretShare: string, keygenIDs: string[]): Promise<{
|
|
101
|
+
pubkey: string;
|
|
102
|
+
secret_share: string;
|
|
103
|
+
}>;
|
|
71
104
|
bip340GetExportID(secretShare: string): Promise<string>;
|
|
72
105
|
bip340Keygen(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
73
106
|
pubkey: string;
|
|
@@ -100,4 +133,36 @@ export interface DynamicNativeSdkInterface {
|
|
|
100
133
|
pubkey: string;
|
|
101
134
|
secret_share: string;
|
|
102
135
|
}>;
|
|
136
|
+
sr25519GetExportID(secretShare: string): Promise<string>;
|
|
137
|
+
sr25519Keygen(roomUUID: string, hostUrl: string, numParties: number, threshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
138
|
+
pubkey: string;
|
|
139
|
+
secret_share: string;
|
|
140
|
+
}>;
|
|
141
|
+
sr25519Sign(roomUUID: string, hostUrl: string, secretShare: string, msgHex: string, derivationPath: string[]): Promise<string>;
|
|
142
|
+
sr25519Refresh(roomUUID: string, hostUrl: string, secretShare: string): Promise<{
|
|
143
|
+
pubkey: string;
|
|
144
|
+
secret_share: string;
|
|
145
|
+
}>;
|
|
146
|
+
sr25519ReshareNewParty(roomUUID: string, hostUrl: string, oldThreshold: number, newThreshold: number, keygenSecret: string, keygenIDs: string[]): Promise<{
|
|
147
|
+
pubkey: string;
|
|
148
|
+
secret_share: string;
|
|
149
|
+
}>;
|
|
150
|
+
sr25519ReshareRemainingParty(roomUUID: string, hostUrl: string, newThreshold: number, secretShare: string, keygenIDs: string[]): Promise<{
|
|
151
|
+
pubkey: string;
|
|
152
|
+
secret_share: string;
|
|
153
|
+
}>;
|
|
154
|
+
sr25519DerivePubkey(secretShare: string, derivationPath: string[]): Promise<string>;
|
|
155
|
+
sr25519GetPubkey(secretShare: string): Promise<string>;
|
|
156
|
+
sr25519DerivePubkeyFromPubkey(pubkey: string, derivation: string[]): Promise<string>;
|
|
157
|
+
sr25519ExportFullPrivateKey(roomUUID: string, hostUrl: string, secretShare: string, toExportID: string): Promise<undefined | string>;
|
|
158
|
+
sr25519DerivePrivateKeyFromPrivateKey(privkey: string, derive: string[], isPrivateKeyRaw: boolean): Promise<string>;
|
|
159
|
+
sr25519OfflineExportFullPrivateKey(keygenResults: string[]): Promise<string>;
|
|
160
|
+
sr25519ImportPrivateKeyRecipient(roomUUID: string, hostUrl: string, threshold: number, secretShare: string, keygenIDs: string[]): Promise<{
|
|
161
|
+
pubkey: string;
|
|
162
|
+
secret_share: string;
|
|
163
|
+
}>;
|
|
164
|
+
sr25519ImportPrivateKeyImporter(roomUUID: string, hostUrl: string, threshold: number, privateKey: string, secretShare: string, keygenIDs: string[], isPrivateKeyRaw: boolean): Promise<{
|
|
165
|
+
pubkey: string;
|
|
166
|
+
secret_share: string;
|
|
167
|
+
}>;
|
|
103
168
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Sr25519InitKeygenResult, Sr25519KeygenResult, DynamicNativeSdkInterface } from './';
|
|
2
|
+
export declare class Sr25519 {
|
|
3
|
+
protected readonly NATIVE: Promise<DynamicNativeSdkInterface>;
|
|
4
|
+
protected readonly URL: string;
|
|
5
|
+
protected constructor(native: Promise<DynamicNativeSdkInterface>, url: string);
|
|
6
|
+
initKeygen(): Promise<Sr25519InitKeygenResult>;
|
|
7
|
+
exportID(keygenResult: Sr25519KeygenResult | string): Promise<string>;
|
|
8
|
+
createRoom(numParties: number, apiKey: string): Promise<string>;
|
|
9
|
+
keygen(roomUuid: string, numParties: number, threshold: number, keygenInit: Sr25519InitKeygenResult, keygenIds: string[]): Promise<Sr25519KeygenResult>;
|
|
10
|
+
sign(roomUuid: string, keygenResult: Sr25519KeygenResult | string, msg: Uint8Array | string, derivationPath?: string[]): Promise<Uint8Array>;
|
|
11
|
+
refresh(roomUuid: string, keygenResult: Sr25519KeygenResult | string): Promise<Sr25519KeygenResult>;
|
|
12
|
+
reshareNewParty(roomUuid: string, oldThreshold: number, newThreshold: number, keygenInit: Sr25519InitKeygenResult, keygenIds: string[]): Promise<Sr25519KeygenResult>;
|
|
13
|
+
reshareRemainingParty(roomUuid: string, newThreshold: number, keygenResult: Sr25519KeygenResult | string, keygenIds: string[]): Promise<Sr25519KeygenResult>;
|
|
14
|
+
derivePubkey(keygenResult: Sr25519KeygenResult | string, derivationPath?: string[]): Promise<Uint8Array>;
|
|
15
|
+
getPubkey(keygenResult: Sr25519KeygenResult | string): Promise<Uint8Array>;
|
|
16
|
+
derivePubkeyFromPubkey(pubkey: Uint8Array, derivation: string[]): Promise<Uint8Array>;
|
|
17
|
+
exportFullPrivateKey(roomUuid: string, keygenResult: Sr25519KeygenResult | string, toExportID: string): Promise<string | undefined>;
|
|
18
|
+
derivePrivateKeyFromPrivateKey(privkey: string, isPrivateKeyRaw: boolean, derivationPath?: string[]): Promise<string>;
|
|
19
|
+
offlineExportFullPrivateKey(keygenResults: Sr25519KeygenResult[] | string[]): Promise<string>;
|
|
20
|
+
importPrivateKeyRecipient(roomUuid: string, threshold: number, keygenInit: Sr25519InitKeygenResult, keygenIds: string[]): Promise<Sr25519KeygenResult>;
|
|
21
|
+
importPrivateKeyImporter(roomUuid: string, threshold: number, privateKey: string, keygenInit: Sr25519InitKeygenResult, keygenIds: string[], isPrivateKeyRaw?: boolean): Promise<Sr25519KeygenResult>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Sr25519=void 0;let _1=require("./"),utils_1=require("@noble/hashes/utils"),common_1=require("./common");class Sr25519{constructor(e,r){this.NATIVE=e,this.URL=r}async initKeygen(){var e=await(await this.NATIVE).initKeygen();return new _1.Sr25519InitKeygenResult(e.pubkey,e.keypair)}async exportID(e){e="string"==typeof e?e:e.secretShare;return(await this.NATIVE).sr25519GetExportID(e)}async createRoom(e,r){return(0,common_1.sanitizeNumberOfParties)(e),(await this.NATIVE).createRoom(this.URL,e,r)}async keygen(e,r,t,s,i){if((0,common_1.sanitizeNumberOfParties)(r,t),i.length!==r-1)throw new Error(`keygenIds length must be exactly: ${r-1}, it is: `+i.length);e=await(await this.NATIVE).sr25519Keygen(e,this.URL,r,t,s.keygenSecret,i);if(e.pubkey&&e.secret_share)return r=(0,utils_1.hexToBytes)(e.pubkey),t=e.secret_share,new _1.Sr25519KeygenResult(r,t);throw new Error("Keygen failed, no public key or secret share was returned.")}async sign(e,r,t,s=[]){"string"!=typeof t&&(t=(0,utils_1.bytesToHex)(t));r="string"==typeof r?r:r.secretShare,e=await(await this.NATIVE).sr25519Sign(e,this.URL,r,t,Array.from(s));return(0,utils_1.hexToBytes)(e)}async refresh(e,r){var r="string"==typeof r?r:r.secretShare,e=await(await this.NATIVE).sr25519Refresh(e,this.URL,r);if(e.pubkey&&e.secret_share)return r=(0,utils_1.hexToBytes)(e.pubkey),e=e.secret_share,new _1.Sr25519KeygenResult(r,e);throw new Error("Keygen failed, no public key or secret share was returned.")}async reshareNewParty(e,r,t,s,i){e=await(await this.NATIVE).sr25519ReshareNewParty(e,this.URL,r,t,s.keygenSecret,i),r=(0,utils_1.hexToBytes)(e.pubkey),t=e.secret_share;return new _1.Sr25519KeygenResult(r,t)}async reshareRemainingParty(e,r,t,s){t="string"==typeof t?t:t.secretShare,e=await(await this.NATIVE).sr25519ReshareRemainingParty(e,this.URL,r,t,s),r=(0,utils_1.hexToBytes)(e.pubkey),t=e.secret_share;return new _1.Sr25519KeygenResult(r,t)}async derivePubkey(e,r=[]){e="string"==typeof e?e:e.secretShare,e=await(await this.NATIVE).sr25519DerivePubkey(e,Array.from(r));return(0,utils_1.hexToBytes)(e)}async getPubkey(e){e="string"==typeof e?e:e.secretShare,e=await(await this.NATIVE).sr25519GetPubkey(e);return(0,utils_1.hexToBytes)(e)}async derivePubkeyFromPubkey(e,r){e=await(await this.NATIVE).sr25519DerivePubkeyFromPubkey((0,utils_1.bytesToHex)(e),Array.from(r));return(0,utils_1.hexToBytes)(e)}async exportFullPrivateKey(e,r,t){r="string"==typeof r?r:r.secretShare,e=await(await this.NATIVE).sr25519ExportFullPrivateKey(e,this.URL,r,t);return e||void 0}async derivePrivateKeyFromPrivateKey(e,r,t=[]){return(await this.NATIVE).sr25519DerivePrivateKeyFromPrivateKey(e,Array.from(t),r)}async offlineExportFullPrivateKey(e){e=e.map(e=>{if("string"==typeof e)return e;if(e instanceof _1.Sr25519KeygenResult)return e.secretShare;throw"UnknownType"});return(await this.NATIVE).sr25519OfflineExportFullPrivateKey(e)}async importPrivateKeyRecipient(e,r,t,s){e=await(await this.NATIVE).sr25519ImportPrivateKeyRecipient(e,this.URL,r,t.keygenSecret,s),r=(0,utils_1.hexToBytes)(e.pubkey),t=e.secret_share;return new _1.Sr25519KeygenResult(r,t)}async importPrivateKeyImporter(e,r,t,s,i,a=!1){e=await(await this.NATIVE).sr25519ImportPrivateKeyImporter(e,this.URL,r,t,s.keygenSecret,i,a),r=(0,utils_1.hexToBytes)(e.pubkey),t=e.secret_share;return new _1.Sr25519KeygenResult(r,t)}}exports.Sr25519=Sr25519;
|
package/internal/core/types.d.ts
CHANGED
|
@@ -35,6 +35,26 @@ export declare class Ed25519InitKeygenResult {
|
|
|
35
35
|
keygenSecret: string;
|
|
36
36
|
constructor(keygenId: string, keygenSecret: string);
|
|
37
37
|
}
|
|
38
|
+
export declare class Sr25519KeygenResult {
|
|
39
|
+
pubkey: Uint8Array;
|
|
40
|
+
secretShare: string;
|
|
41
|
+
constructor(pubkey: Uint8Array, secretShare: string);
|
|
42
|
+
}
|
|
43
|
+
export declare class ExportableEd25519KeygenResult {
|
|
44
|
+
pubkey: Uint8Array;
|
|
45
|
+
secretShare: string;
|
|
46
|
+
constructor(pubkey: Uint8Array, secretShare: string);
|
|
47
|
+
}
|
|
48
|
+
export declare class ExportableEd25519InitKeygenResult {
|
|
49
|
+
keygenId: string;
|
|
50
|
+
keygenSecret: string;
|
|
51
|
+
constructor(keygenId: string, keygenSecret: string);
|
|
52
|
+
}
|
|
53
|
+
export declare class Sr25519InitKeygenResult {
|
|
54
|
+
keygenId: string;
|
|
55
|
+
keygenSecret: string;
|
|
56
|
+
constructor(keygenId: string, keygenSecret: string);
|
|
57
|
+
}
|
|
38
58
|
export declare class EcdsaSignature {
|
|
39
59
|
private static readonly FIELD_SIZE;
|
|
40
60
|
private static readonly MAX_DER_LEN;
|
package/internal/core/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.BIP340InitKeygenResult=exports.BIP340KeygenResult=exports.EcdsaSignature=exports.Ed25519InitKeygenResult=exports.Ed25519KeygenResult=exports.EcdsaInitKeygenResult=exports.EcdsaKeygenResult=exports.EcdsaPublicKey=exports.MessageHash=void 0;let utils_1=require("@noble/hashes/utils"),sha3_1=require("@noble/hashes/sha3"),sha256_1=require("@noble/hashes/sha256");class MessageHash{constructor(e){if(this.bytes=new Uint8Array,"string"==typeof e){if(e.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+e.length);this.bytes=(0,utils_1.hexToBytes)(e)}else{if(e.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+e.length);this.bytes=e}}static sha256(e){return new MessageHash((0,sha256_1.sha256)(e))}static sha256d(e){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(e)))}static keccak256(e){return new MessageHash((0,sha3_1.keccak_256)(e))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}(exports.MessageHash=MessageHash).LENGTH=32;class EcdsaPublicKey{constructor(e){if((e="string"==typeof e?(0,utils_1.hexToBytes)(e):e).length===EcdsaPublicKey.LENGTH+1)this.pubkey=e.slice(1);else{if(e.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+e.length);this.pubkey=e}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){var e=1&this.pubkey[63];return new Uint8Array([2+e,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}(exports.EcdsaPublicKey=EcdsaPublicKey).LENGTH=64;class EcdsaKeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.EcdsaKeygenResult=EcdsaKeygenResult;class EcdsaInitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.EcdsaInitKeygenResult=EcdsaInitKeygenResult;class Ed25519KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.Ed25519KeygenResult=Ed25519KeygenResult;class Ed25519InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.Ed25519InitKeygenResult=Ed25519InitKeygenResult;class EcdsaSignature{static fromBuffer(e){"string"==typeof e&&(e=(0,utils_1.hexToBytes)(e));var s=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,t=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(e.length<t||e.length>s)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${t}..${s} bytes, found: `+e.length);var t=e.subarray(0,EcdsaSignature.FIELD_SIZE),s=e.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),r=e[2*EcdsaSignature.FIELD_SIZE],e=e.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(t,s,r,e)}constructor(e,s,t,r){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(e.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+e.length);if(!Number.isInteger(t)||t<27||30<t)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+t);if(r.length<EcdsaSignature.MIN_DER_LEN||r.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+r.length);this.r=e,this.s=s,this.v=t,this.der=r}}(exports.EcdsaSignature=EcdsaSignature).FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.BIP340KeygenResult=BIP340KeygenResult;class BIP340InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.BIP340InitKeygenResult=BIP340InitKeygenResult;
|
|
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;let utils_1=require("@noble/hashes/utils"),sha3_1=require("@noble/hashes/sha3"),sha256_1=require("@noble/hashes/sha256");class MessageHash{constructor(e){if(this.bytes=new Uint8Array,"string"==typeof e){if(e.length!==2*MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+e.length);this.bytes=(0,utils_1.hexToBytes)(e)}else{if(e.length!==MessageHash.LENGTH)throw new Error("Invalid length for MessageHash: "+e.length);this.bytes=e}}static sha256(e){return new MessageHash((0,sha256_1.sha256)(e))}static sha256d(e){return new MessageHash((0,sha256_1.sha256)((0,sha256_1.sha256)(e)))}static keccak256(e){return new MessageHash((0,sha3_1.keccak_256)(e))}toHex(){return(0,utils_1.bytesToHex)(this.bytes)}}(exports.MessageHash=MessageHash).LENGTH=32;class EcdsaPublicKey{constructor(e){if((e="string"==typeof e?(0,utils_1.hexToBytes)(e):e).length===EcdsaPublicKey.LENGTH+1)this.pubkey=e.slice(1);else{if(e.length!==EcdsaPublicKey.LENGTH)throw new RangeError(`Invalid ${this.constructor.name} length, expected: ${EcdsaPublicKey.LENGTH} bytes, found: `+e.length);this.pubkey=e}}serializeUncompressed(){return new Uint8Array([4,...this.pubkey])}serializeCompressed(){var e=1&this.pubkey[63];return new Uint8Array([2+e,...this.pubkey.slice(0,32)])}pubKeyAsHex(){return(0,utils_1.bytesToHex)(this.serializeUncompressed())}}(exports.EcdsaPublicKey=EcdsaPublicKey).LENGTH=64;class EcdsaKeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.EcdsaKeygenResult=EcdsaKeygenResult;class EcdsaInitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.EcdsaInitKeygenResult=EcdsaInitKeygenResult;class Ed25519KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.Ed25519KeygenResult=Ed25519KeygenResult;class Ed25519InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.Ed25519InitKeygenResult=Ed25519InitKeygenResult;class Sr25519KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.Sr25519KeygenResult=Sr25519KeygenResult;class ExportableEd25519KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.ExportableEd25519KeygenResult=ExportableEd25519KeygenResult;class ExportableEd25519InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.ExportableEd25519InitKeygenResult=ExportableEd25519InitKeygenResult;class Sr25519InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.Sr25519InitKeygenResult=Sr25519InitKeygenResult;class EcdsaSignature{static fromBuffer(e){"string"==typeof e&&(e=(0,utils_1.hexToBytes)(e));var s=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MAX_DER_LEN+1,t=2*EcdsaSignature.FIELD_SIZE+EcdsaSignature.MIN_DER_LEN+1;if(e.length<t||e.length>s)throw new RangeError(`Invalid ${this.constructor.name} length, expected between ${t}..${s} bytes, found: `+e.length);var t=e.subarray(0,EcdsaSignature.FIELD_SIZE),s=e.subarray(EcdsaSignature.FIELD_SIZE,2*EcdsaSignature.FIELD_SIZE),r=e[2*EcdsaSignature.FIELD_SIZE],e=e.subarray(2*EcdsaSignature.FIELD_SIZE+1);return new EcdsaSignature(t,s,r,e)}constructor(e,s,t,r){if(s.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 's' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+s.length);if(e.length!==EcdsaSignature.FIELD_SIZE)throw new RangeError(`Invalid 'r' length, expected: ${EcdsaSignature.FIELD_SIZE} found: `+e.length);if(!Number.isInteger(t)||t<27||30<t)throw new RangeError("Invalid 'v' value, expected 27/28/29/30 found: "+t);if(r.length<EcdsaSignature.MIN_DER_LEN||r.length>EcdsaSignature.MAX_DER_LEN)throw new RangeError(`Invalid DER encoding, expected length: ${EcdsaSignature.MIN_DER_LEN}..${EcdsaSignature.MAX_DER_LEN} found: `+r.length);this.r=e,this.s=s,this.v=t,this.der=r}}(exports.EcdsaSignature=EcdsaSignature).FIELD_SIZE=32,EcdsaSignature.MAX_DER_LEN=72,EcdsaSignature.MIN_DER_LEN=8;class BIP340KeygenResult{constructor(e,s){this.pubkey=e,this.secretShare=s}}exports.BIP340KeygenResult=BIP340KeygenResult;class BIP340InitKeygenResult{constructor(e,s){this.keygenId=e,this.keygenSecret=s}}exports.BIP340InitKeygenResult=BIP340InitKeygenResult;
|
|
@@ -1,130 +1,91 @@
|
|
|
1
1
|
export function initKeygen(): Promise<KeygenInit>;
|
|
2
2
|
export function createRoom(host_addr: string, num_parties: number, api_token: string): Promise<string>;
|
|
3
|
-
export function ecdsaKeygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids:
|
|
3
|
+
export function ecdsaKeygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
4
4
|
export function ecdsaSign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array): Promise<string>;
|
|
5
5
|
export function ecdsaRefresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
6
|
-
export function ecdsaReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids:
|
|
7
|
-
export function ecdsaReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids:
|
|
6
|
+
export function ecdsaReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
7
|
+
export function ecdsaReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
8
8
|
export function ecdsaDerivePubkey(secret_share: string, derivation_path: Uint32Array): Promise<string>;
|
|
9
9
|
export function ecdsaGetXpub(secret_share: string): Promise<string>;
|
|
10
10
|
export function ecdsaDerivePubkeyFromXpub(xpub: string, derivation_path: Uint32Array): Promise<string>;
|
|
11
11
|
export function ecdsaGetExportID(secret_share: string): Promise<string>;
|
|
12
12
|
export function ecdsaExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
13
|
-
export function ecdsaOfflineExportFullPrivateKey(secret_shares:
|
|
13
|
+
export function ecdsaOfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
14
14
|
export function ecdsaDerivePrivateKeyFromXpriv(xpriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
15
|
-
export function ecdsaImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids:
|
|
16
|
-
export function ecdsaImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids:
|
|
17
|
-
export function ed25519Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids:
|
|
15
|
+
export function ecdsaImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
16
|
+
export function ecdsaImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
17
|
+
export function ed25519Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
18
18
|
export function ed25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array): Promise<string>;
|
|
19
19
|
export function ed25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
20
|
-
export function ed25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids:
|
|
21
|
-
export function ed25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids:
|
|
20
|
+
export function ed25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
21
|
+
export function ed25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
22
22
|
export function ed25519DerivePubkey(secret_share: string, derivation_path: Uint32Array): Promise<string>;
|
|
23
23
|
export function ed25519GetSpub(secret_share: string): Promise<string>;
|
|
24
24
|
export function ed25519DerivePubkeyFromSpub(spub: string, derivation_path: Uint32Array): Promise<string>;
|
|
25
25
|
export function ed25519GetExportID(secret_share: string): Promise<string>;
|
|
26
26
|
export function ed25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
27
|
-
export function ed25519OfflineExportFullPrivateKey(secret_shares:
|
|
27
|
+
export function ed25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
28
28
|
export function ed25519DerivePrivateKeyFromSpriv(spriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
29
|
-
export function ed25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids:
|
|
30
|
-
export function ed25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids:
|
|
31
|
-
export function bip340Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids:
|
|
29
|
+
export function ed25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
30
|
+
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>;
|
|
31
|
+
export function bip340Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
32
32
|
export function bip340Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
33
33
|
export function bip340Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
34
|
-
export function bip340ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids:
|
|
35
|
-
export function bip340ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids:
|
|
34
|
+
export function bip340ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
35
|
+
export function bip340ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
36
36
|
export function bip340DeriveTweakPubkey(secret_share: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
37
37
|
export function bip340GetXpub(secret_share: string): Promise<string>;
|
|
38
38
|
export function bip340DeriveTweakPubkeyFromXpub(xpub: string, derivation_path: Uint32Array, opt_tweak: string): Promise<string>;
|
|
39
39
|
export function bip340GetExportID(secret_share: string): Promise<string>;
|
|
40
40
|
export function bip340ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
41
|
-
export function bip340OfflineExportFullPrivateKey(secret_shares:
|
|
41
|
+
export function bip340OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
42
42
|
export function bip340DerivePrivateKeyFromXpriv(xpriv: string, derivation_path: Uint32Array): Promise<string>;
|
|
43
|
-
export function bip340ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids:
|
|
44
|
-
export function bip340ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids:
|
|
43
|
+
export function bip340ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
44
|
+
export function bip340ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
45
|
+
export function exportableEd25519SampleKey(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
46
|
+
export function exportableEd25519ReceiveKey(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
47
|
+
export function exportableEd25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string): Promise<string>;
|
|
48
|
+
export function exportableEd25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
49
|
+
export function exportableEd25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
50
|
+
export function exportableEd25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
51
|
+
export function exportableEd25519GetPubkey(secret_share: string): Promise<string>;
|
|
52
|
+
export function exportableEd25519GetExportID(secret_share: string): Promise<string>;
|
|
53
|
+
export function exportableEd25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
54
|
+
export function exportableEd25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
55
|
+
export function exportableEd25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
56
|
+
export function exportableEd25519ImportPrivateKeyImporter(room_uuid: string, host_addr: string, threshold: number, private_key_hex: string, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
57
|
+
export function sr25519Keygen(room_uuid: string, host_addr: string, num_parties: number, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
58
|
+
export function sr25519Sign(room_uuid: string, host_addr: string, secret_share: string, msg_hex: string, derivation_path: string[]): Promise<string>;
|
|
59
|
+
export function sr25519Refresh(room_uuid: string, host_addr: string, secret_share: string): Promise<KeygenResult>;
|
|
60
|
+
export function sr25519ReshareNewParty(room_uuid: string, host_addr: string, _old_threshold: number, new_threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
61
|
+
export function sr25519ReshareRemainingParty(room_uuid: string, host_addr: string, new_threshold: number, secret_share: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
62
|
+
export function sr25519DerivePubkey(secret_share: string, derivation_path: string[]): Promise<string>;
|
|
63
|
+
export function sr25519GetPubkey(secret_share: string): Promise<string>;
|
|
64
|
+
export function sr25519DerivePubkeyFromPubkey(pubkey: string, derivation_path: string[]): Promise<string>;
|
|
65
|
+
export function sr25519GetExportID(secret_share: string): Promise<string>;
|
|
66
|
+
export function sr25519ExportFullPrivateKey(room_uuid: string, host_addr: string, secret_share: string, export_to: string): Promise<string | undefined>;
|
|
67
|
+
export function sr25519OfflineExportFullPrivateKey(secret_shares: string[]): Promise<string>;
|
|
68
|
+
export function sr25519DerivePrivateKeyFromPrivateKey(private_key: string, derivation_path: string[], is_private_key_raw: boolean): Promise<string>;
|
|
69
|
+
export function sr25519ImportPrivateKeyRecipient(room_uuid: string, host_addr: string, threshold: number, keygen_secret: string, keygen_ids: string[]): Promise<KeygenResult>;
|
|
70
|
+
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>;
|
|
45
71
|
export function start(): void;
|
|
46
72
|
export class KeygenInit {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
static __wrap(ptr: any): any;
|
|
74
|
+
constructor(keypair: string, pubkey: string);
|
|
75
|
+
__destroy_into_raw(): number;
|
|
76
|
+
__wbg_ptr: number;
|
|
77
|
+
free(): void;
|
|
78
|
+
get keypair(): string;
|
|
79
|
+
get pubkey(): string;
|
|
51
80
|
}
|
|
52
81
|
export class KeygenResult {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
82
|
+
static __wrap(ptr: any): any;
|
|
83
|
+
__destroy_into_raw(): number | undefined;
|
|
84
|
+
__wbg_ptr: number | undefined;
|
|
85
|
+
free(): void;
|
|
86
|
+
get secret_share(): string;
|
|
87
|
+
get pubkey(): string;
|
|
56
88
|
}
|
|
57
|
-
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
export interface InitOutput {
|
|
61
|
-
readonly memory: WebAssembly.Memory;
|
|
62
|
-
readonly __wbg_keygeninit_free: (a: number, b: number) => void;
|
|
63
|
-
readonly __wbg_get_keygeninit_keypair: (a: number, b: number) => void;
|
|
64
|
-
readonly __wbg_get_keygeninit_pubkey: (a: number, b: number) => void;
|
|
65
|
-
readonly keygeninit_new: (a: number, b: number, c: number, d: number) => number;
|
|
66
|
-
readonly initKeygen: () => number;
|
|
67
|
-
readonly createRoom: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
68
|
-
readonly ecdsaKeygen: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
69
|
-
readonly ecdsaSign: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
70
|
-
readonly ecdsaRefresh: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
71
|
-
readonly ecdsaReshareNewParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
72
|
-
readonly ecdsaReshareRemainingParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
73
|
-
readonly ecdsaDerivePubkey: (a: number, b: number, c: number, d: number) => number;
|
|
74
|
-
readonly ecdsaGetXpub: (a: number, b: number) => number;
|
|
75
|
-
readonly ecdsaDerivePubkeyFromXpub: (a: number, b: number, c: number, d: number) => number;
|
|
76
|
-
readonly ecdsaGetExportID: (a: number, b: number) => number;
|
|
77
|
-
readonly ecdsaExportFullPrivateKey: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
78
|
-
readonly ecdsaOfflineExportFullPrivateKey: (a: number, b: number) => number;
|
|
79
|
-
readonly ecdsaDerivePrivateKeyFromXpriv: (a: number, b: number, c: number, d: number) => number;
|
|
80
|
-
readonly ecdsaImportPrivateKeyRecipient: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
81
|
-
readonly ecdsaImportPrivateKeyImporter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
82
|
-
readonly ed25519Keygen: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
83
|
-
readonly ed25519Sign: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
84
|
-
readonly ed25519Refresh: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
85
|
-
readonly ed25519ReshareNewParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
86
|
-
readonly ed25519ReshareRemainingParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
87
|
-
readonly ed25519DerivePubkey: (a: number, b: number, c: number, d: number) => number;
|
|
88
|
-
readonly ed25519GetSpub: (a: number, b: number) => number;
|
|
89
|
-
readonly ed25519DerivePubkeyFromSpub: (a: number, b: number, c: number, d: number) => number;
|
|
90
|
-
readonly ed25519GetExportID: (a: number, b: number) => number;
|
|
91
|
-
readonly ed25519ExportFullPrivateKey: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
92
|
-
readonly ed25519OfflineExportFullPrivateKey: (a: number, b: number) => number;
|
|
93
|
-
readonly ed25519DerivePrivateKeyFromSpriv: (a: number, b: number, c: number, d: number) => number;
|
|
94
|
-
readonly ed25519ImportPrivateKeyRecipient: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
95
|
-
readonly ed25519ImportPrivateKeyImporter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
|
|
96
|
-
readonly bip340Keygen: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
97
|
-
readonly bip340Sign: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
|
|
98
|
-
readonly bip340Refresh: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
99
|
-
readonly bip340ReshareNewParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
100
|
-
readonly bip340ReshareRemainingParty: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
101
|
-
readonly bip340DeriveTweakPubkey: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
102
|
-
readonly bip340GetXpub: (a: number, b: number) => number;
|
|
103
|
-
readonly bip340DeriveTweakPubkeyFromXpub: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
104
|
-
readonly bip340GetExportID: (a: number, b: number) => number;
|
|
105
|
-
readonly bip340ExportFullPrivateKey: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
106
|
-
readonly bip340OfflineExportFullPrivateKey: (a: number, b: number) => number;
|
|
107
|
-
readonly bip340DerivePrivateKeyFromXpriv: (a: number, b: number, c: number, d: number) => number;
|
|
108
|
-
readonly bip340ImportPrivateKeyRecipient: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
109
|
-
readonly bip340ImportPrivateKeyImporter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
110
|
-
readonly start: () => void;
|
|
111
|
-
readonly __wbg_keygenresult_free: (a: number, b: number) => void;
|
|
112
|
-
readonly __wbg_get_keygenresult_secret_share: (a: number, b: number) => void;
|
|
113
|
-
readonly __wbg_get_keygenresult_pubkey: (a: number, b: number) => void;
|
|
114
|
-
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
115
|
-
readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
116
|
-
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
117
|
-
readonly __wbindgen_export_3: (a: number, b: number) => void;
|
|
118
|
-
readonly __wbindgen_export_4: (a: number, b: number, c: number) => void;
|
|
119
|
-
readonly __wbindgen_export_5: (a: number, b: number, c: number) => void;
|
|
120
|
-
readonly __wbindgen_export_6: (a: number) => void;
|
|
121
|
-
readonly __wbindgen_export_7: (a: number, b: number, c: number, d: number) => void;
|
|
122
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
123
|
-
readonly __wbindgen_export_8: (a: number, b: number, c: number) => void;
|
|
124
|
-
readonly __wbindgen_start: () => void;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
128
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
129
|
-
|
|
130
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
89
|
+
export default __wbg_init;
|
|
90
|
+
export function initSync(module: any): any;
|
|
91
|
+
declare function __wbg_init(module_or_path: any): Promise<any>;
|