@silencelaboratories/walletprovider-sdk 0.3.0 → 1.3.0
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/README.md +107 -92
- package/dist/EOAauthentication.d.ts +14 -4
- package/dist/authentication.d.ts +35 -22
- package/dist/encoding.d.ts +1 -0
- package/dist/ephemeralAuthentication.d.ts +29 -6
- package/dist/index.cjs.js +6 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.esm.js +6 -1
- package/dist/networkSigner.d.ts +31 -96
- package/dist/passkeyAuthentication.d.ts +3 -4
- package/dist/setupMessage.d.ts +70 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/validator.d.ts +4 -1
- package/dist/walletProviderServiceClient.d.ts +19 -8
- package/dist/walletProviderServiceClientInterface.d.ts +23 -7
- package/package.json +8 -6
package/dist/validator.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { SignAlgorithm } from './ephemeralAuthentication';
|
|
1
2
|
export declare const throwIfInvalidString: (key: string, value: string) => void;
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const throwIfInvalidEphPK: (ephKey: Uint8Array, signAlg: SignAlgorithm) => void;
|
|
4
|
+
export declare const throwIfInvalidEphSK: (ephKey: Uint8Array, signAlg: SignAlgorithm) => void;
|
|
5
|
+
export declare const throwIfInvalidSignAlg: (signAlg: SignAlgorithm) => void;
|
|
3
6
|
export declare const throwIf: (condition: boolean, message: string) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AuthModule } from './authentication';
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
1
|
+
import { AuthModule, DkgAuthModule } from './authentication';
|
|
2
|
+
import { type KeygenResponse, type SignResponse, type OperationStatusResponse, type RegisterPasskeyResponse } from './networkSigner';
|
|
3
|
+
import { MetadataSetupOpts, KeygenSetupOpts, SignSetupOpts } from './setupMessage';
|
|
4
|
+
import { ApiVersion, type ClientConfig, IWalletProviderServiceClient, QueryPath } from './walletProviderServiceClientInterface';
|
|
4
5
|
/**
|
|
5
6
|
* The Websocket client to the Wallet Provider backend service.
|
|
6
7
|
* All requests are relayed by this entity to the MPC network.
|
|
@@ -9,24 +10,34 @@ import { type ClientConfig, IWalletProviderServiceClient } from './walletProvide
|
|
|
9
10
|
export declare class WalletProviderServiceClient implements IWalletProviderServiceClient {
|
|
10
11
|
walletProviderId: string;
|
|
11
12
|
walletProviderUrl: string;
|
|
12
|
-
|
|
13
|
+
apiVersion: ApiVersion;
|
|
13
14
|
/**
|
|
14
15
|
* Create new client that connects to the backend service
|
|
15
16
|
* @param config - config containing information about backend service
|
|
16
17
|
*/
|
|
17
18
|
constructor(config: ClientConfig);
|
|
19
|
+
getVersion(): ApiVersion;
|
|
18
20
|
getWalletId(): string;
|
|
19
21
|
startKeygen({ setup, authModule, }: {
|
|
20
22
|
setup: KeygenSetupOpts;
|
|
21
|
-
authModule:
|
|
23
|
+
authModule: DkgAuthModule;
|
|
22
24
|
}): Promise<KeygenResponse>;
|
|
23
25
|
startSigngen({ setup, authModule }: {
|
|
24
26
|
setup: SignSetupOpts;
|
|
25
27
|
authModule: AuthModule;
|
|
26
28
|
}): Promise<SignResponse>;
|
|
27
29
|
addEphemeralKey({ setup, authModule, }: {
|
|
28
|
-
setup:
|
|
30
|
+
setup: MetadataSetupOpts;
|
|
31
|
+
authModule: DkgAuthModule;
|
|
32
|
+
}): Promise<OperationStatusResponse>;
|
|
33
|
+
revokeEphemeralKey({ setup, authModule, }: {
|
|
34
|
+
setup: MetadataSetupOpts;
|
|
35
|
+
authModule: AuthModule;
|
|
36
|
+
}): Promise<OperationStatusResponse>;
|
|
37
|
+
registerPasskey({ setup, authModule, }: {
|
|
38
|
+
setup: MetadataSetupOpts;
|
|
29
39
|
authModule: AuthModule;
|
|
30
|
-
}): Promise<
|
|
31
|
-
connect(setupOpts: KeygenSetupOpts | SignSetupOpts |
|
|
40
|
+
}): Promise<RegisterPasskeyResponse>;
|
|
41
|
+
connect(path: QueryPath, setupOpts: KeygenSetupOpts | SignSetupOpts | MetadataSetupOpts, authModule: AuthModule): Promise<string>;
|
|
42
|
+
connectV2(path: QueryPath, setupOpts: KeygenSetupOpts | SignSetupOpts | MetadataSetupOpts, authModule: AuthModule): Promise<string>;
|
|
32
43
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AuthModule, UserAuthentication } from './authentication';
|
|
2
|
-
import {
|
|
2
|
+
import { KeygenResponse, SignResponse, OperationStatusResponse, RegisterPasskeyResponse } from './networkSigner';
|
|
3
|
+
import { MetadataSetupOpts, KeygenSetupOpts, SignSetupOpts } from './setupMessage';
|
|
3
4
|
/**
|
|
4
5
|
* The config used to create Wallet Provider Service backend client.
|
|
5
6
|
* Please refer to {@link https://shipyard.rs/silencelaboratories/crates/wallet-provider-service | example backend service}
|
|
@@ -7,6 +8,10 @@ import { AddEphemeralKeyOpts, KeygenResponse, KeygenSetupOpts, SignResponse, Sig
|
|
|
7
8
|
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export type ClientConfig = {
|
|
11
|
+
/**
|
|
12
|
+
* The version of the API used to connect to the service
|
|
13
|
+
*/
|
|
14
|
+
apiVersion: ApiVersion;
|
|
10
15
|
/**
|
|
11
16
|
* The id of the Wallet Provider Service
|
|
12
17
|
* @alpha
|
|
@@ -18,12 +23,18 @@ export type ClientConfig = {
|
|
|
18
23
|
*/
|
|
19
24
|
walletProviderUrl: string;
|
|
20
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* The API version of the Wallet Provider Service
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export type ApiVersion = 'v1' | 'v2';
|
|
21
31
|
export type Signer = (challenge: string) => Promise<UserAuthentication>;
|
|
22
32
|
/** Interface for client of Wallet Provider Service
|
|
23
33
|
* @alpha
|
|
24
34
|
*/
|
|
25
35
|
export interface IWalletProviderServiceClient {
|
|
26
36
|
getWalletId(): string;
|
|
37
|
+
getVersion(): ApiVersion;
|
|
27
38
|
startKeygen({ setup, authModule }: {
|
|
28
39
|
setup: KeygenSetupOpts;
|
|
29
40
|
authModule: AuthModule;
|
|
@@ -33,11 +44,16 @@ export interface IWalletProviderServiceClient {
|
|
|
33
44
|
authModule: AuthModule;
|
|
34
45
|
}): Promise<SignResponse>;
|
|
35
46
|
addEphemeralKey({ setup, authModule, }: {
|
|
36
|
-
setup:
|
|
47
|
+
setup: MetadataSetupOpts;
|
|
37
48
|
authModule: AuthModule;
|
|
38
|
-
}): Promise<
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
}): Promise<OperationStatusResponse>;
|
|
50
|
+
revokeEphemeralKey({ setup, authModule, }: {
|
|
51
|
+
setup: MetadataSetupOpts;
|
|
52
|
+
authModule: AuthModule;
|
|
53
|
+
}): Promise<OperationStatusResponse>;
|
|
54
|
+
registerPasskey({ setup, authModule, }: {
|
|
55
|
+
setup: MetadataSetupOpts;
|
|
56
|
+
authModule: AuthModule;
|
|
57
|
+
}): Promise<RegisterPasskeyResponse>;
|
|
43
58
|
}
|
|
59
|
+
export type QueryPath = 'signgen' | 'keygen' | 'addEphemeralKey' | 'revokeEphemeralKey' | 'registerPasskey';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silencelaboratories/walletprovider-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"author": "Silence Laboratories",
|
|
5
5
|
"description": "Frontend SDK for Wallet Providers",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"formatcheck": "prettier --check --cache .",
|
|
22
22
|
"lint": "eslint --cache ./src/**/*.ts",
|
|
23
23
|
"typecheck": "tsc -p . --noEmit",
|
|
24
|
+
"test": "vitest",
|
|
24
25
|
"build": "node build.js && npm run build:declaration",
|
|
25
26
|
"build:declaration": "tsc -p . --emitDeclarationOnly",
|
|
26
27
|
"clean": "rimraf dist",
|
|
@@ -28,24 +29,25 @@
|
|
|
28
29
|
"docs": "npm run build:declaration && api-extractor run --local --verbose && api-documenter markdown -i ./temp -o ./docs"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@eslint/js": "
|
|
32
|
+
"@eslint/js": "9.14.0",
|
|
32
33
|
"@microsoft/api-documenter": "^7.25.2",
|
|
33
34
|
"@microsoft/api-extractor": "^7.46.2",
|
|
34
35
|
"@types/eslint-plugin-security": "^3.0.0",
|
|
35
36
|
"esbuild": "0.24.0",
|
|
36
37
|
"esbuild-node-externals": "^1.15.0",
|
|
37
|
-
"eslint": "
|
|
38
|
+
"eslint": "9.14.0",
|
|
38
39
|
"eslint-plugin-security": "^3.0.1",
|
|
39
40
|
"globals": "^15.3.0",
|
|
40
41
|
"npm-dts": "^1.3.13",
|
|
41
|
-
"prettier": "
|
|
42
|
+
"prettier": "3.3.3",
|
|
42
43
|
"rimraf": "^6.0.1",
|
|
43
44
|
"typescript": "5.6.3",
|
|
44
|
-
"typescript-eslint": "
|
|
45
|
+
"typescript-eslint": "8.13.0",
|
|
46
|
+
"vitest": "^2.1.5"
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
47
49
|
"@noble/curves": "^1.6.0",
|
|
48
50
|
"js-base64": "^3.7.7",
|
|
49
|
-
"viem": "2.21.
|
|
51
|
+
"viem": "2.21.54"
|
|
50
52
|
}
|
|
51
53
|
}
|