@silencelaboratories/walletprovider-sdk 4.0.0-hackaton → 4.0.1-hackathon
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/dist/EOAauthentication.d.ts +67 -0
- package/dist/authentication.d.ts +146 -0
- package/dist/client/api.d.ts +18 -0
- package/dist/client/intentServiceClient.d.ts +4 -0
- package/dist/client/keyRefresher.d.ts +34 -0
- package/dist/client/types.d.ts +60 -0
- package/dist/encoding.d.ts +4 -0
- package/dist/ephemeralAuthentication.d.ts +44 -0
- package/dist/networkSigner.d.ts +129 -0
- package/dist/passkeyAuthentication.d.ts +28 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/validator.d.ts +6 -0
- package/dist/walletProviderServiceClient.d.ts +43 -0
- package/dist/walletProviderServiceClientInterface.d.ts +59 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.55.1"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SignAlgorithm } from './ephemeralAuthentication';
|
|
2
|
+
export declare const throwIfInvalidString: (key: string, value: string) => void;
|
|
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;
|
|
6
|
+
export declare const throwIf: (condition: boolean, message: string) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
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';
|
|
5
|
+
/**
|
|
6
|
+
* The Websocket client to the Wallet Provider backend service.
|
|
7
|
+
* All requests are relayed by this entity to the MPC network.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export declare class WalletProviderServiceClient implements IWalletProviderServiceClient {
|
|
11
|
+
walletProviderId: string;
|
|
12
|
+
walletProviderUrl: string;
|
|
13
|
+
apiVersion: ApiVersion;
|
|
14
|
+
/**
|
|
15
|
+
* Create new client that connects to the backend service
|
|
16
|
+
* @param config - config containing information about backend service
|
|
17
|
+
*/
|
|
18
|
+
constructor(config: ClientConfig);
|
|
19
|
+
getVersion(): ApiVersion;
|
|
20
|
+
getWalletId(): string;
|
|
21
|
+
startKeygen({ setups, authModule, }: {
|
|
22
|
+
setups: KeygenSetupOpts[];
|
|
23
|
+
authModule: DkgAuthModule;
|
|
24
|
+
}): Promise<KeygenResponse[]>;
|
|
25
|
+
startSigngen({ setup, authModule }: {
|
|
26
|
+
setup: SignSetupOpts;
|
|
27
|
+
authModule: AuthModule;
|
|
28
|
+
}): Promise<SignResponse>;
|
|
29
|
+
addEphemeralKey({ setup, authModule, }: {
|
|
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;
|
|
39
|
+
authModule: AuthModule;
|
|
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>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AuthModule, UserAuthentication } from './authentication';
|
|
2
|
+
import { KeygenResponse, SignResponse, OperationStatusResponse, RegisterPasskeyResponse } from './networkSigner';
|
|
3
|
+
import { MetadataSetupOpts, KeygenSetupOpts, SignSetupOpts } from './setupMessage';
|
|
4
|
+
/**
|
|
5
|
+
* The config used to create Wallet Provider Service backend client.
|
|
6
|
+
* Please refer to {@link https://shipyard.rs/silencelaboratories/crates/wallet-provider-service | example backend service}
|
|
7
|
+
* implementation for requirements that the backend service must fulfill.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export type ClientConfig = {
|
|
11
|
+
/**
|
|
12
|
+
* The version of the API used to connect to the service
|
|
13
|
+
*/
|
|
14
|
+
apiVersion: ApiVersion;
|
|
15
|
+
/**
|
|
16
|
+
* The id of the Wallet Provider Service
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
19
|
+
walletProviderId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The URL used to connect to the service
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
walletProviderUrl: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The API version of the Wallet Provider Service
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export type ApiVersion = 'v1' | 'v2';
|
|
31
|
+
export type Signer = (challenge: string) => Promise<UserAuthentication>;
|
|
32
|
+
/** Interface for client of Wallet Provider Service
|
|
33
|
+
* @alpha
|
|
34
|
+
*/
|
|
35
|
+
export interface IWalletProviderServiceClient {
|
|
36
|
+
getWalletId(): string;
|
|
37
|
+
getVersion(): ApiVersion;
|
|
38
|
+
startKeygen({ setups, authModule }: {
|
|
39
|
+
setups: KeygenSetupOpts[];
|
|
40
|
+
authModule: AuthModule;
|
|
41
|
+
}): Promise<KeygenResponse[]>;
|
|
42
|
+
startSigngen({ setup, authModule }: {
|
|
43
|
+
setup: SignSetupOpts;
|
|
44
|
+
authModule: AuthModule;
|
|
45
|
+
}): Promise<SignResponse>;
|
|
46
|
+
addEphemeralKey({ setup, authModule, }: {
|
|
47
|
+
setup: MetadataSetupOpts;
|
|
48
|
+
authModule: AuthModule;
|
|
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>;
|
|
58
|
+
}
|
|
59
|
+
export type QueryPath = 'signgen' | 'keygen' | 'addEphemeralKey' | 'revokeEphemeralKey' | 'registerPasskey';
|
package/package.json
CHANGED