@getpara/web-sdk 1.16.0 → 1.17.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.
@@ -87,20 +87,34 @@ function ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType) {
87
87
  }
88
88
  function ed25519Sign(ctx, share, userId, walletId, base64Bytes) {
89
89
  return __async(this, null, function* () {
90
- const { protocolId } = yield ctx.client.preSignMessage(userId, walletId, base64Bytes, WalletScheme.ED25519);
91
- try {
92
- const base64Sig = yield new Promise(
93
- (resolve, reject) => globalThis.ed25519Sign(share, protocolId, base64Bytes, (err, result) => {
94
- if (err) {
95
- reject(err);
96
- }
97
- resolve(result);
98
- })
99
- );
100
- return { signature: base64Sig };
101
- } catch (e) {
102
- throw new Error(`error signing for account of type SOLANA with userId ${userId} and walletId ${walletId}`);
103
- }
90
+ const protocolId = uuid.v4();
91
+ const preSignMessageRes = ctx.client.preSignMessage(
92
+ userId,
93
+ walletId,
94
+ base64Bytes,
95
+ WalletScheme.ED25519,
96
+ void 0,
97
+ protocolId
98
+ );
99
+ const signRes = function() {
100
+ return __async(this, null, function* () {
101
+ try {
102
+ const base64Sig = yield new Promise(
103
+ (resolve, reject) => globalThis.ed25519Sign(share, protocolId, base64Bytes, (err, result) => {
104
+ if (err) {
105
+ reject(err);
106
+ }
107
+ resolve(result);
108
+ })
109
+ );
110
+ return { signature: base64Sig };
111
+ } catch (e) {
112
+ throw new Error(`error signing for account of type SOLANA with userId ${userId} and walletId ${walletId}`);
113
+ }
114
+ });
115
+ }();
116
+ yield preSignMessageRes;
117
+ return yield signRes;
104
118
  });
105
119
  }
106
120
  function keygen(ctx, userId, type, secretKey) {
@@ -19,7 +19,7 @@ export interface Message {
19
19
  * Executes an operation with retry capabilities
20
20
  * @param operation The function to execute
21
21
  * @param maxRetries Maximum number of retries (default: 2)
22
- * @param timeoutMs Timeout in milliseconds (default: 8000)
22
+ * @param timeoutMs Timeout in milliseconds (default: 10000)
23
23
  * @returns The result of the operation
24
24
  */
25
25
  export declare function withRetry<T>(operation: () => Promise<T>, maxRetries?: number, timeoutMs?: number): Promise<T>;
@@ -118,7 +118,7 @@ function executeMessage(ctx, message) {
118
118
  }
119
119
  });
120
120
  }
121
- function withRetry(operation, maxRetries = 2, timeoutMs = 8e3) {
121
+ function withRetry(operation, maxRetries = 2, timeoutMs = 1e4) {
122
122
  return __async(this, null, function* () {
123
123
  let retries = 0;
124
124
  while (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/web-sdk",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "wasm_exec.js"
9
9
  ],
10
10
  "dependencies": {
11
- "@getpara/core-sdk": "1.16.0",
12
- "@getpara/user-management-client": "1.16.0",
11
+ "@getpara/core-sdk": "1.17.0",
12
+ "@getpara/user-management-client": "1.17.0",
13
13
  "base64url": "3.0.1",
14
14
  "buffer": "6.0.3",
15
15
  "cbor-web": "8.1.0",
@@ -35,5 +35,5 @@
35
35
  "dist",
36
36
  "package.json"
37
37
  ],
38
- "gitHead": "27004dc519903d24ffafa0d8da16976dae9278a2"
38
+ "gitHead": "857cb45a49040c475fa7431f36134b0d5cb630f5"
39
39
  }