@silencelaboratories/walletprovider-sdk 0.4.1 → 1.4.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/LICENSE +103 -0
- package/README.md +60 -11
- package/dist/auth/EOAauthentication.d.ts +13 -10
- package/dist/auth/authentication.d.ts +54 -50
- package/dist/auth/ephemeralAuthentication.d.ts +26 -12
- package/dist/auth/passkeyAuthentication.d.ts +2 -2
- package/dist/builder/signRequest.d.ts +28 -0
- package/dist/builder/userAuth.d.ts +28 -0
- package/dist/client/ethUtil.d.ts +8 -0
- package/dist/client/httpClient.d.ts +23 -0
- package/dist/client/networkRequest.d.ts +82 -0
- package/dist/client/networkResponse.d.ts +118 -0
- package/dist/client/networkSigner.d.ts +31 -47
- package/dist/client/walletProviderServiceClient.d.ts +22 -19
- package/dist/client/walletProviderServiceClientInterface.d.ts +25 -20
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +24 -5
- package/dist/index.esm.js +1 -1
- package/dist/setupMessage.d.ts +18 -32
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/encoder.d.ts +6 -1
- package/dist/utils/validator.d.ts +5 -4
- package/dist/viemSigner.d.ts +11 -2
- package/package.json +5 -4
- package/dist/client/types.d.ts +0 -60
package/dist/utils/encoder.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const arrayBufferToBase64Url: (a: ArrayBuffer) => string;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param serialized MUST be in canonicalized JSON format
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const calculateFinalChallenge: (serialized: string) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EphKeySignAlgorithm } from '../auth/ephemeralAuthentication';
|
|
2
|
+
import { MPCSignAlgorithm } from '../client/networkSigner';
|
|
2
3
|
export declare const throwIfInvalidString: (key: string, value: string) => void;
|
|
3
|
-
export declare const throwIfInvalidEphPK: (ephKey: Uint8Array, signAlg:
|
|
4
|
-
export declare const throwIfInvalidEphSK: (ephKey: Uint8Array, signAlg:
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const throwIfInvalidEphPK: (ephKey: Uint8Array, signAlg: EphKeySignAlgorithm) => void;
|
|
5
|
+
export declare const throwIfInvalidEphSK: (ephKey: Uint8Array, signAlg: EphKeySignAlgorithm) => void;
|
|
6
|
+
export declare const throwIfInvalidMPCSignAlg: (signAlg: MPCSignAlgorithm) => void;
|
|
6
7
|
export declare const throwIf: (condition: boolean, message: string) => void;
|
package/dist/viemSigner.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { LocalAccount } from 'viem/accounts';
|
|
2
|
-
import { NetworkSigner } from './client/networkSigner';
|
|
2
|
+
import { MPCSignAlgorithm, NetworkSigner } from './client/networkSigner';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
|
+
/**
|
|
5
|
+
* Options for creating a distributed signing request for signing transactions using Silent Network.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface DSGOpts {
|
|
9
|
+
threshold: number;
|
|
10
|
+
keyId: string;
|
|
11
|
+
signAlg: MPCSignAlgorithm;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* Create a new viem custom account for signing transactions using
|
|
6
15
|
* the MPC network.
|
|
@@ -9,7 +18,7 @@ import { Address } from 'viem';
|
|
|
9
18
|
* @param publicKey Associated public key of the selected Key ID.
|
|
10
19
|
* @param signAlg The signature algorithm for signing (default: secp256k1).
|
|
11
20
|
*/
|
|
12
|
-
export declare function createViemAccount(networkSigner: NetworkSigner,
|
|
21
|
+
export declare function createViemAccount(networkSigner: NetworkSigner, publicKey: string, dsgOpts: DSGOpts): LocalAccount;
|
|
13
22
|
/** Computes ETH address from ECDSA `publicKey` returned by Silent Network
|
|
14
23
|
* @public
|
|
15
24
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silencelaboratories/walletprovider-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"author": "Silence Laboratories",
|
|
5
5
|
"description": "Frontend SDK for Wallet Providers",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"formatcheck": "prettier --check --cache .",
|
|
23
23
|
"lint": "eslint --cache ./src/**/*.ts",
|
|
24
24
|
"typecheck": "tsc -p . --noEmit",
|
|
25
|
-
"test": "vitest",
|
|
25
|
+
"test": "vitest run",
|
|
26
26
|
"build": "node build.js && npm run build:declaration",
|
|
27
27
|
"build:declaration": "tsc -p . --emitDeclarationOnly",
|
|
28
28
|
"clean": "rimraf dist",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"docs": "npm run build:declaration && api-extractor run --local --verbose && api-documenter markdown -i ./temp -o ./docs"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@commitlint/config-conventional": "^12.1.1",
|
|
33
34
|
"@eslint/js": "9.14.0",
|
|
34
35
|
"@microsoft/api-documenter": "^7.25.2",
|
|
35
36
|
"@microsoft/api-extractor": "^7.46.2",
|
|
@@ -44,12 +45,12 @@
|
|
|
44
45
|
"rimraf": "^6.0.1",
|
|
45
46
|
"typescript": "5.6.3",
|
|
46
47
|
"typescript-eslint": "8.13.0",
|
|
47
|
-
"vitest": "^2.1.8"
|
|
48
|
-
"@commitlint/config-conventional": "^12.1.1"
|
|
48
|
+
"vitest": "^2.1.8"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@noble/curves": "^1.6.0",
|
|
52
52
|
"js-base64": "^3.7.7",
|
|
53
|
+
"json-canonicalize": "^1.0.6",
|
|
53
54
|
"viem": "2.21.54"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/dist/client/types.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Response from the network for keygen requests
|
|
3
|
-
* @alpha
|
|
4
|
-
*/
|
|
5
|
-
export interface KeygenResponse {
|
|
6
|
-
/**
|
|
7
|
-
* Unique ID of produced key used in subsequent API calls.
|
|
8
|
-
*/
|
|
9
|
-
keyId: string;
|
|
10
|
-
/**
|
|
11
|
-
* Public key encoded with SEC1 format.
|
|
12
|
-
*
|
|
13
|
-
* If point is uncompressed it's in a form of 0x04 || X || Y
|
|
14
|
-
*
|
|
15
|
-
* If point is compressed it's in a form Y || X,
|
|
16
|
-
*
|
|
17
|
-
* where Y is set to 0x02 if Y-coord is even, or 0x03 if Y-coord is odd
|
|
18
|
-
*/
|
|
19
|
-
publicKey: string;
|
|
20
|
-
/**
|
|
21
|
-
* Signature algorithm that uses this key for signing
|
|
22
|
-
*/
|
|
23
|
-
signAlg: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Response from the network for sign request
|
|
27
|
-
* @alpha
|
|
28
|
-
*/
|
|
29
|
-
export interface SignResponse {
|
|
30
|
-
transactionId: string;
|
|
31
|
-
/**
|
|
32
|
-
* Hexstring of length 128 bytes, in a form: r || s
|
|
33
|
-
*/
|
|
34
|
-
sign: string;
|
|
35
|
-
/**
|
|
36
|
-
* Recovery id, either 0, or 1
|
|
37
|
-
*/
|
|
38
|
-
recid: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Response from the network for adding ephemeral key request
|
|
42
|
-
* @alpha
|
|
43
|
-
*/
|
|
44
|
-
export interface OperationStatusResponse {
|
|
45
|
-
/**
|
|
46
|
-
* Status of the request.
|
|
47
|
-
*/
|
|
48
|
-
status: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Response from the network for registering passkey request
|
|
52
|
-
* @alpha
|
|
53
|
-
*/
|
|
54
|
-
export interface RegisterPasskeyResponse {
|
|
55
|
-
/**
|
|
56
|
-
* The registered passkey credential id. This helps both the user and the network to identify the passkey.
|
|
57
|
-
* @alpha
|
|
58
|
-
*/
|
|
59
|
-
passkeyCredentialId: string;
|
|
60
|
-
}
|