@silencelaboratories/walletprovider-sdk 0.0.7 → 0.0.9

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.
@@ -5,7 +5,19 @@ import { type IWalletProviderServiceClient } from './walletProviderServiceClient
5
5
  * @alpha
6
6
  */
7
7
  export interface KeygenResponse {
8
+ /**
9
+ * Unique ID of produced key used in subsequent API calls.
10
+ */
8
11
  keyId: string;
12
+ /**
13
+ * Public key encoded with SEC1 format.
14
+ *
15
+ * If point is uncompressed it's in a form of 0x04 || X || Y
16
+ *
17
+ * If point is compressed it's in a form Y || X,
18
+ *
19
+ * where Y is set to 0x02 if Y-coord is even, or 0x03 if Y-coord is odd
20
+ */
9
21
  publicKey: string;
10
22
  }
11
23
  /**
@@ -13,7 +25,13 @@ export interface KeygenResponse {
13
25
  * @alpha
14
26
  */
15
27
  export interface SignResponse {
28
+ /**
29
+ * Hexstring of length 128 bytes, in a form: r || s
30
+ */
16
31
  sign: string;
32
+ /**
33
+ * Recovery id, either 0, or 1
34
+ */
17
35
  recid: number;
18
36
  }
19
37
  /** Key parameters used during generation */
@@ -27,12 +45,16 @@ export declare class KeygenSetupOpts {
27
45
  /** Metadata for a key. Currently they store the permissions, can be set in a constructor of this class.
28
46
  If permissions are not set, all operations are allowed.
29
47
  */
30
- metadata: [number, string][];
31
- constructor({ t, n, key_label, permissions }: {
48
+ metadata: {
49
+ tag: number;
50
+ value: string;
51
+ }[];
52
+ constructor({ t, n, key_label, permissions, ephPK, }: {
32
53
  t: number;
33
54
  n: number;
34
55
  key_label?: string;
35
56
  permissions?: string;
57
+ ephPK?: string;
36
58
  });
37
59
  }
38
60
  /** Parameters used in Signature execution */
@@ -74,13 +96,14 @@ export declare class NetworkSigner {
74
96
  constructor(wpClient: IWalletProviderServiceClient, threshold: number, totalNodes: number, authModule: AuthModule);
75
97
  /** API to generate a distributed key that's generated by Silent Network.
76
98
  * Uses `authModule` to get authentication of the request from the User
99
+ * @param ephKey - ephemeral key used to authenticate the user during the session.
77
100
  * @param permissions - optional permissions that will be stored in the key metadata.
78
101
  * The permissions are validated during sign requests.
79
102
  * @returns {@link KeygenResponse} containing `keyId` and the `pubKey` public part of the key
80
103
  * @public
81
104
  * @alpha
82
105
  */
83
- authenticateAndCreateKey(permissions?: string): Promise<KeygenResponse>;
106
+ authenticateAndCreateKey(ephKey: Uint8Array, permissions?: string): Promise<KeygenResponse>;
84
107
  /** Generate a signature. Uses `authModule` to authenticate the sign request by the User.
85
108
  * The network chooses `t` nodes to execute the protocol.
86
109
  * @param keyId - the key id returned from `authenticateAndCreateKey`
@@ -1 +1 @@
1
- {"version":3,"file":"networkSigner.d.ts","sourceRoot":"","sources":["../src/networkSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAU,KAAK,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEtG;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,6CAA6C;AAC7C,qBAAa,eAAe;IAC1B,+GAA+G;IAC/G,CAAC,EAAE,MAAM,CAAC;IACV,kGAAkG;IAClG,CAAC,EAAE,MAAM,CAAC;IACV,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;gBAEjB,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,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6FAA6F;IAC7F,UAAU,EAAE,UAAU,CAAC;IACvB,qHAAqH;IACrH,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,SAAS,EAAE,4BAA4B,CAAC;IAExC;;;;;;OAMG;gBACS,QAAQ,EAAE,4BAA4B,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;IAYjH;;;;;;;;OAQG;IACG,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAwBjG;;;;;;;OAOG;IACU,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAexF"}
@@ -9,4 +9,6 @@ import { NetworkSigner } from './networkSigner';
9
9
  * @param threshold The threshold.
10
10
  */
11
11
  export declare function createViemAccount(networkSigner: NetworkSigner, keyId: string, publicKey: string): viem.LocalAccount;
12
+ /** Computes ETH address from ECDSA `publicKey` returned by Silent Network */
13
+ export declare function computeAddress(publicKey: string): viem.Address;
12
14
  //# sourceMappingURL=viemSigner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"viemSigner.d.ts","sourceRoot":"","sources":["../src/viemSigner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,YAAY,CAmCnH"}
1
+ {"version":3,"file":"viemSigner.d.ts","sourceRoot":"","sources":["../src/viemSigner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAI7B,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,YAAY,CAmCnH;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAa9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silencelaboratories/walletprovider-sdk",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Frontend SDK for Wallet Providers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,6 +31,7 @@
31
31
  "typescript-eslint": "^7.11.0"
32
32
  },
33
33
  "dependencies": {
34
+ "@noble/ed25519": "^2.1.0",
34
35
  "@noble/secp256k1": "^2.1.0",
35
36
  "viem": "^2.11.1"
36
37
  }