@getpara/server-sdk 3.20.0 → 3.22.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.
@@ -86,7 +86,21 @@ class ServerUtils {
86
86
  preKeygen(ctx, partnerId, pregenIdentifier, pregenIdentifierType, type, secretKey, sessionCookie) {
87
87
  return (0, import_keygen.preKeygen)(ctx, pregenIdentifier, pregenIdentifierType, type, secretKey, false, partnerId, sessionCookie);
88
88
  }
89
- signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, _cosmosSignDoc, canonicalTransaction, approvalCaseId) {
89
+ signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, _cosmosSignDoc, canonicalTransaction, approvalCaseId, canonicalMessage) {
90
+ if (canonicalMessage) {
91
+ return (0, import_signing.signMessage)(
92
+ ctx,
93
+ userId,
94
+ walletId,
95
+ share,
96
+ message,
97
+ sessionCookie,
98
+ isDKLS,
99
+ canonicalTransaction,
100
+ approvalCaseId,
101
+ canonicalMessage
102
+ );
103
+ }
90
104
  return (0, import_signing.signMessage)(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId);
91
105
  }
92
106
  signTransaction(ctx, userId, walletId, share, message, chainId, sessionCookie, isDKLS) {
@@ -104,7 +118,20 @@ class ServerUtils {
104
118
  ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie, type) {
105
119
  return (0, import_keygen.ed25519PreKeygen)(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie, type);
106
120
  }
107
- ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId) {
121
+ ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId, canonicalMessage) {
122
+ if (canonicalMessage) {
123
+ return (0, import_signing.ed25519Sign)(
124
+ ctx,
125
+ userId,
126
+ walletId,
127
+ share,
128
+ base64Bytes,
129
+ sessionCookie,
130
+ canonicalTransaction,
131
+ approvalCaseId,
132
+ canonicalMessage
133
+ );
134
+ }
108
135
  return (0, import_signing.ed25519Sign)(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId);
109
136
  }
110
137
  openPopup(_popupUrl) {
@@ -150,7 +150,7 @@ function sendTransaction(ctx, userId, walletId, share, tx, chainId, sessionCooki
150
150
  }));
151
151
  });
152
152
  }
153
- function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId) {
153
+ function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId, canonicalMessage) {
154
154
  return __async(this, null, function* () {
155
155
  return new Promise((resolve, reject) => __async(null, null, function* () {
156
156
  const workId = uuid.v4();
@@ -174,13 +174,13 @@ function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKL
174
174
  worker.postMessage({
175
175
  env: ctx.env,
176
176
  apiKey: ctx.apiKey,
177
- params: __spreadValues({
177
+ params: __spreadValues(__spreadValues({
178
178
  share,
179
179
  walletId,
180
180
  userId,
181
181
  message,
182
182
  canonicalTransaction
183
- }, approvalCaseId ? { approvalCaseId } : {}),
183
+ }, approvalCaseId ? { approvalCaseId } : {}), canonicalMessage ? { canonicalMessage } : {}),
184
184
  functionType: "SIGN_MESSAGE",
185
185
  offloadMPCComputationURL: ctx.offloadMPCComputationURL,
186
186
  disableWorkers: ctx.disableWorkers,
@@ -196,7 +196,7 @@ function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKL
196
196
  }));
197
197
  });
198
198
  }
199
- function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId) {
199
+ function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId, canonicalMessage) {
200
200
  return __async(this, null, function* () {
201
201
  return new Promise((resolve, reject) => __async(null, null, function* () {
202
202
  const workId = uuid.v4();
@@ -220,13 +220,13 @@ function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, c
220
220
  worker.postMessage({
221
221
  env: ctx.env,
222
222
  apiKey: ctx.apiKey,
223
- params: __spreadValues({
223
+ params: __spreadValues(__spreadValues({
224
224
  share,
225
225
  walletId,
226
226
  userId,
227
227
  base64Bytes,
228
228
  canonicalTransaction
229
- }, approvalCaseId ? { approvalCaseId } : {}),
229
+ }, approvalCaseId ? { approvalCaseId } : {}), canonicalMessage ? { canonicalMessage } : {}),
230
230
  functionType: "ED25519_SIGN",
231
231
  offloadMPCComputationURL: ctx.offloadMPCComputationURL,
232
232
  disableWorkers: ctx.disableWorkers,
@@ -173,11 +173,22 @@ function withMPCNetworkHost(ctx, share) {
173
173
  return share;
174
174
  }
175
175
  }
176
- function ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId) {
176
+ function ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId, canonicalMessage) {
177
177
  return __async(this, null, function* () {
178
178
  const protocolId = uuid.v4();
179
179
  const hostedShare = withMPCNetworkHost(ctx, share);
180
- const preSignMessageRes = approvalCaseId ? ctx.client.preSignMessage(
180
+ const preSignMessageRes = canonicalMessage ? ctx.client.preSignMessage(
181
+ userId,
182
+ walletId,
183
+ base64Bytes,
184
+ "ED25519",
185
+ void 0,
186
+ protocolId,
187
+ void 0,
188
+ canonicalTransaction,
189
+ approvalCaseId,
190
+ canonicalMessage
191
+ ) : approvalCaseId ? ctx.client.preSignMessage(
181
192
  userId,
182
193
  walletId,
183
194
  base64Bytes,
@@ -310,10 +321,21 @@ function preKeygen(ctx, partnerId, pregenIdentifier, pregenIdentifierType, type,
310
321
  }
311
322
  });
312
323
  }
313
- function signMessage(ctx, share, walletId, userId, message, canonicalTransaction, approvalCaseId) {
324
+ function signMessage(ctx, share, walletId, userId, message, canonicalTransaction, approvalCaseId, canonicalMessage) {
314
325
  return __async(this, null, function* () {
315
326
  const protocolId = uuid.v4();
316
- const preSignMessageRes = approvalCaseId ? ctx.client.preSignMessage(
327
+ const preSignMessageRes = canonicalMessage ? ctx.client.preSignMessage(
328
+ userId,
329
+ walletId,
330
+ message,
331
+ null,
332
+ null,
333
+ protocolId,
334
+ true,
335
+ canonicalTransaction,
336
+ approvalCaseId,
337
+ canonicalMessage
338
+ ) : approvalCaseId ? ctx.client.preSignMessage(
317
339
  userId,
318
340
  walletId,
319
341
  message,
@@ -137,10 +137,22 @@ function executeMessage(ctx, message) {
137
137
  return withRetry(() => walletUtils.sendTransaction(ctx, share, walletId, userId, tx, chainId));
138
138
  }
139
139
  case "SIGN_MESSAGE": {
140
- const { share, walletId, userId, message: message2, canonicalTransaction, approvalCaseId } = params;
141
- return withRetry(
142
- () => walletUtils.signMessage(ctx, share, walletId, userId, message2, canonicalTransaction, approvalCaseId)
143
- );
140
+ const { share, walletId, userId, message: message2, canonicalTransaction, approvalCaseId, canonicalMessage } = params;
141
+ return withRetry(() => {
142
+ if (canonicalMessage) {
143
+ return walletUtils.signMessage(
144
+ ctx,
145
+ share,
146
+ walletId,
147
+ userId,
148
+ message2,
149
+ canonicalTransaction,
150
+ approvalCaseId,
151
+ canonicalMessage
152
+ );
153
+ }
154
+ return walletUtils.signMessage(ctx, share, walletId, userId, message2, canonicalTransaction, approvalCaseId);
155
+ });
144
156
  }
145
157
  case "REFRESH": {
146
158
  const { share, walletId, userId } = params;
@@ -172,7 +184,19 @@ function executeMessage(ctx, message) {
172
184
  return walletUtils.ed25519Keygen(ctx, userId, void 0, void 0, type);
173
185
  }
174
186
  case "ED25519_SIGN": {
175
- const { share, walletId, userId, base64Bytes, canonicalTransaction, approvalCaseId } = params;
187
+ const { share, walletId, userId, base64Bytes, canonicalTransaction, approvalCaseId, canonicalMessage } = params;
188
+ if (canonicalMessage) {
189
+ return walletUtils.ed25519Sign(
190
+ ctx,
191
+ share,
192
+ userId,
193
+ walletId,
194
+ base64Bytes,
195
+ canonicalTransaction,
196
+ approvalCaseId,
197
+ canonicalMessage
198
+ );
199
+ }
176
200
  return walletUtils.ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId);
177
201
  }
178
202
  case "ED25519_PREKEYGEN": {
@@ -35,7 +35,21 @@ class ServerUtils {
35
35
  preKeygen(ctx, partnerId, pregenIdentifier, pregenIdentifierType, type, secretKey, sessionCookie) {
36
36
  return preKeygen(ctx, pregenIdentifier, pregenIdentifierType, type, secretKey, false, partnerId, sessionCookie);
37
37
  }
38
- signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, _cosmosSignDoc, canonicalTransaction, approvalCaseId) {
38
+ signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, _cosmosSignDoc, canonicalTransaction, approvalCaseId, canonicalMessage) {
39
+ if (canonicalMessage) {
40
+ return signMessage(
41
+ ctx,
42
+ userId,
43
+ walletId,
44
+ share,
45
+ message,
46
+ sessionCookie,
47
+ isDKLS,
48
+ canonicalTransaction,
49
+ approvalCaseId,
50
+ canonicalMessage
51
+ );
52
+ }
39
53
  return signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId);
40
54
  }
41
55
  signTransaction(ctx, userId, walletId, share, message, chainId, sessionCookie, isDKLS) {
@@ -53,7 +67,20 @@ class ServerUtils {
53
67
  ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie, type) {
54
68
  return ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie, type);
55
69
  }
56
- ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId) {
70
+ ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId, canonicalMessage) {
71
+ if (canonicalMessage) {
72
+ return ed25519Sign(
73
+ ctx,
74
+ userId,
75
+ walletId,
76
+ share,
77
+ base64Bytes,
78
+ sessionCookie,
79
+ canonicalTransaction,
80
+ approvalCaseId,
81
+ canonicalMessage
82
+ );
83
+ }
57
84
  return ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId);
58
85
  }
59
86
  async openPopup(_popupUrl) {
@@ -78,7 +78,7 @@ async function sendTransaction(ctx, userId, walletId, share, tx, chainId, sessio
78
78
  }
79
79
  });
80
80
  }
81
- async function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId) {
81
+ async function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS, canonicalTransaction, approvalCaseId, canonicalMessage) {
82
82
  return new Promise(async (resolve, reject) => {
83
83
  const workId = uuid.v4();
84
84
  try {
@@ -107,7 +107,8 @@ async function signMessage(ctx, userId, walletId, share, message, sessionCookie,
107
107
  userId,
108
108
  message,
109
109
  canonicalTransaction,
110
- ...approvalCaseId ? { approvalCaseId } : {}
110
+ ...approvalCaseId ? { approvalCaseId } : {},
111
+ ...canonicalMessage ? { canonicalMessage } : {}
111
112
  },
112
113
  functionType: "SIGN_MESSAGE",
113
114
  offloadMPCComputationURL: ctx.offloadMPCComputationURL,
@@ -123,7 +124,7 @@ async function signMessage(ctx, userId, walletId, share, message, sessionCookie,
123
124
  }
124
125
  });
125
126
  }
126
- async function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId) {
127
+ async function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie, canonicalTransaction, approvalCaseId, canonicalMessage) {
127
128
  return new Promise(async (resolve, reject) => {
128
129
  const workId = uuid.v4();
129
130
  try {
@@ -152,7 +153,8 @@ async function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCoo
152
153
  userId,
153
154
  base64Bytes,
154
155
  canonicalTransaction,
155
- ...approvalCaseId ? { approvalCaseId } : {}
156
+ ...approvalCaseId ? { approvalCaseId } : {},
157
+ ...canonicalMessage ? { canonicalMessage } : {}
156
158
  },
157
159
  functionType: "ED25519_SIGN",
158
160
  offloadMPCComputationURL: ctx.offloadMPCComputationURL,
@@ -90,10 +90,21 @@ function withMPCNetworkHost(ctx, share) {
90
90
  return share;
91
91
  }
92
92
  }
93
- async function ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId) {
93
+ async function ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId, canonicalMessage) {
94
94
  const protocolId = uuid.v4();
95
95
  const hostedShare = withMPCNetworkHost(ctx, share);
96
- const preSignMessageRes = approvalCaseId ? ctx.client.preSignMessage(
96
+ const preSignMessageRes = canonicalMessage ? ctx.client.preSignMessage(
97
+ userId,
98
+ walletId,
99
+ base64Bytes,
100
+ "ED25519",
101
+ void 0,
102
+ protocolId,
103
+ void 0,
104
+ canonicalTransaction,
105
+ approvalCaseId,
106
+ canonicalMessage
107
+ ) : approvalCaseId ? ctx.client.preSignMessage(
97
108
  userId,
98
109
  walletId,
99
110
  base64Bytes,
@@ -219,9 +230,20 @@ async function preKeygen(ctx, partnerId, pregenIdentifier, pregenIdentifierType,
219
230
  throw wrapMpcError(`error creating account of type ${type} with walletId ${walletId}`, mpcErr, { walletId, protocolId });
220
231
  }
221
232
  }
222
- async function signMessage(ctx, share, walletId, userId, message, canonicalTransaction, approvalCaseId) {
233
+ async function signMessage(ctx, share, walletId, userId, message, canonicalTransaction, approvalCaseId, canonicalMessage) {
223
234
  const protocolId = uuid.v4();
224
- const preSignMessageRes = approvalCaseId ? ctx.client.preSignMessage(
235
+ const preSignMessageRes = canonicalMessage ? ctx.client.preSignMessage(
236
+ userId,
237
+ walletId,
238
+ message,
239
+ null,
240
+ null,
241
+ protocolId,
242
+ true,
243
+ canonicalTransaction,
244
+ approvalCaseId,
245
+ canonicalMessage
246
+ ) : approvalCaseId ? ctx.client.preSignMessage(
225
247
  userId,
226
248
  walletId,
227
249
  message,
@@ -111,10 +111,22 @@ function executeMessage(ctx, message) {
111
111
  return withRetry(() => walletUtils.sendTransaction(ctx, share, walletId, userId, tx, chainId));
112
112
  }
113
113
  case "SIGN_MESSAGE": {
114
- const { share, walletId, userId, message: message2, canonicalTransaction, approvalCaseId } = params;
115
- return withRetry(
116
- () => walletUtils.signMessage(ctx, share, walletId, userId, message2, canonicalTransaction, approvalCaseId)
117
- );
114
+ const { share, walletId, userId, message: message2, canonicalTransaction, approvalCaseId, canonicalMessage } = params;
115
+ return withRetry(() => {
116
+ if (canonicalMessage) {
117
+ return walletUtils.signMessage(
118
+ ctx,
119
+ share,
120
+ walletId,
121
+ userId,
122
+ message2,
123
+ canonicalTransaction,
124
+ approvalCaseId,
125
+ canonicalMessage
126
+ );
127
+ }
128
+ return walletUtils.signMessage(ctx, share, walletId, userId, message2, canonicalTransaction, approvalCaseId);
129
+ });
118
130
  }
119
131
  case "REFRESH": {
120
132
  const { share, walletId, userId } = params;
@@ -146,7 +158,19 @@ function executeMessage(ctx, message) {
146
158
  return walletUtils.ed25519Keygen(ctx, userId, void 0, void 0, type);
147
159
  }
148
160
  case "ED25519_SIGN": {
149
- const { share, walletId, userId, base64Bytes, canonicalTransaction, approvalCaseId } = params;
161
+ const { share, walletId, userId, base64Bytes, canonicalTransaction, approvalCaseId, canonicalMessage } = params;
162
+ if (canonicalMessage) {
163
+ return walletUtils.ed25519Sign(
164
+ ctx,
165
+ share,
166
+ userId,
167
+ walletId,
168
+ base64Bytes,
169
+ canonicalTransaction,
170
+ approvalCaseId,
171
+ canonicalMessage
172
+ );
173
+ }
150
174
  return walletUtils.ed25519Sign(ctx, share, userId, walletId, base64Bytes, canonicalTransaction, approvalCaseId);
151
175
  }
152
176
  case "ED25519_PREKEYGEN": {
@@ -1,6 +1,6 @@
1
1
  import http from 'node:http';
2
2
  import https from 'node:https';
3
- import type { Ctx, SignatureRes, PlatformUtils, TPregenIdentifierType, TWalletType, CanonicalTransactionContext } from '@getpara/core-sdk';
3
+ import type { Ctx, SignatureRes, PlatformUtils, TPregenIdentifierType, TWalletType, CanonicalMessageContext, CanonicalTransactionContext } from '@getpara/core-sdk';
4
4
  import { BackupKitEmailProps, SDKType } from '@getpara/user-management-client';
5
5
  import { ServerLocalStorage } from './ServerLocalStorage.js';
6
6
  import { ServerSessionStorage } from './ServerSessionStorage.js';
@@ -24,7 +24,7 @@ export declare class ServerUtils implements PlatformUtils {
24
24
  signer: string;
25
25
  walletId: string;
26
26
  }>;
27
- signMessage(ctx: Ctx, userId: string, walletId: string, share: string, message: string, sessionCookie: string, isDKLS?: boolean, _cosmosSignDoc?: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
27
+ signMessage(ctx: Ctx, userId: string, walletId: string, share: string, message: string, sessionCookie: string, isDKLS?: boolean, _cosmosSignDoc?: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
28
28
  signTransaction(ctx: Ctx, userId: string, walletId: string, share: string, message: string, chainId: string, sessionCookie: string, isDKLS?: boolean): Promise<SignatureRes>;
29
29
  sendTransaction(ctx: Ctx, userId: string, walletId: string, share: string, tx: string, chainId: string, sessionCookie: string, isDKLS?: boolean): Promise<SignatureRes>;
30
30
  signHash(_address: string, _hash: string): Promise<{
@@ -40,7 +40,7 @@ export declare class ServerUtils implements PlatformUtils {
40
40
  signer: string;
41
41
  walletId: string;
42
42
  }>;
43
- ed25519Sign(ctx: Ctx, userId: string, walletId: string, share: string, base64Bytes: string, sessionCookie: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
43
+ ed25519Sign(ctx: Ctx, userId: string, walletId: string, share: string, base64Bytes: string, sessionCookie: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
44
44
  localStorage: ServerLocalStorage;
45
45
  sessionStorage: ServerSessionStorage;
46
46
  secureStorage: any;
@@ -0,0 +1,2 @@
1
+ export * from './index.js';
2
+ export { default } from './index.js';
@@ -1,5 +1,5 @@
1
- import type { CanonicalTransactionContext, Ctx, SignatureRes } from '@getpara/core-sdk';
1
+ import type { CanonicalMessageContext, CanonicalTransactionContext, Ctx, SignatureRes } from '@getpara/core-sdk';
2
2
  export declare function signTransaction(ctx: Ctx, userId: string, walletId: string, share: string, tx: string, chainId: string, sessionCookie?: string, isDKLS?: boolean): Promise<SignatureRes>;
3
3
  export declare function sendTransaction(ctx: Ctx, userId: string, walletId: string, share: string, tx: string, chainId: string, sessionCookie?: string, isDKLS?: boolean): Promise<SignatureRes>;
4
- export declare function signMessage(ctx: Ctx, userId: string, walletId: string, share: string, message: string, sessionCookie?: string, isDKLS?: boolean, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
5
- export declare function ed25519Sign(ctx: Ctx, userId: string, walletId: string, share: string, base64Bytes: string, sessionCookie?: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
4
+ export declare function signMessage(ctx: Ctx, userId: string, walletId: string, share: string, message: string, sessionCookie?: string, isDKLS?: boolean, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
5
+ export declare function ed25519Sign(ctx: Ctx, userId: string, walletId: string, share: string, base64Bytes: string, sessionCookie?: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
@@ -1,4 +1,4 @@
1
- import { Ctx, TPregenIdentifierType, SignatureRes, TWalletType, type CanonicalTransactionContext } from '@getpara/core-sdk';
1
+ import { Ctx, TPregenIdentifierType, SignatureRes, TWalletType, type CanonicalMessageContext, type CanonicalTransactionContext } from '@getpara/core-sdk';
2
2
  export declare function ed25519Keygen(ctx: Ctx, userId: string, _sessionCookie?: string, _emailProps?: unknown, type?: TWalletType): Promise<{
3
3
  signer: string;
4
4
  walletId: string;
@@ -7,7 +7,7 @@ export declare function ed25519PreKeygen(ctx: Ctx, pregenIdentifier: string, pre
7
7
  signer: string;
8
8
  walletId: string;
9
9
  }>;
10
- export declare function ed25519Sign(ctx: Ctx, share: string, userId: string, walletId: string, base64Bytes: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
10
+ export declare function ed25519Sign(ctx: Ctx, share: string, userId: string, walletId: string, base64Bytes: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
11
11
  export declare function keygen(ctx: Ctx, userId: string, type: Exclude<TWalletType, 'SOLANA'>, secretKey: string | null): Promise<{
12
12
  signer: string;
13
13
  walletId: string;
@@ -16,7 +16,7 @@ export declare function preKeygen(ctx: Ctx, partnerId: string, pregenIdentifier:
16
16
  signer: string;
17
17
  walletId: string;
18
18
  }>;
19
- export declare function signMessage(ctx: Ctx, share: string, walletId: string, userId: string, message: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string): Promise<SignatureRes>;
19
+ export declare function signMessage(ctx: Ctx, share: string, walletId: string, userId: string, message: string, canonicalTransaction?: CanonicalTransactionContext, approvalCaseId?: string, canonicalMessage?: CanonicalMessageContext): Promise<SignatureRes>;
20
20
  export declare function signTransaction(ctx: Ctx, share: string, walletId: string, userId: string, tx: string, chainId: string): Promise<SignatureRes>;
21
21
  export declare function sendTransaction(ctx: Ctx, share: string, walletId: string, userId: string, tx: string, chainId: string): Promise<SignatureRes>;
22
22
  export declare function refresh(ctx: Ctx, share: string, walletId: string, userId: string): Promise<string>;
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/server-sdk",
3
- "version": "3.20.0",
3
+ "version": "3.22.0",
4
4
  "dependencies": {
5
- "@getpara/core-sdk": "3.20.0",
6
- "@getpara/user-management-client": "3.20.0",
7
- "@getpara/viem-v2-integration": "3.20.0",
5
+ "@getpara/core-sdk": "3.22.0",
6
+ "@getpara/user-management-client": "3.22.0",
7
+ "@getpara/viem-v2-integration": "3.22.0",
8
+ "axios": "^1.8.4",
8
9
  "uuid": "^11.1.1",
10
+ "viem": "^2.39.0",
9
11
  "ws": "^8.21.0"
10
12
  },
11
13
  "devDependencies": {
@@ -16,20 +18,37 @@
16
18
  "dist",
17
19
  "package.json"
18
20
  ],
19
- "gitHead": "0a7224c678bc2b172bd41cce75637a8783869a93",
21
+ "gitHead": "4ca50a0fc70e11370595f16daad0f1ac4da0edbc",
20
22
  "main": "dist/cjs/index.js",
21
23
  "module": "dist/esm/index.js",
22
24
  "scripts": {
23
25
  "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
24
26
  "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
25
27
  "build:esm": "rm -rf dist/esm && tsc --module es2020 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":[\"wasm_exec.js\"]}' > dist/esm/package.json",
26
- "build:types": "rm -rf dist/types && tsc --module es2020 --declarationDir dist/types --emitDeclarationOnly --declaration",
28
+ "build:types": "tsc --emitDeclarationOnly && cp scripts/index.d.mts dist/types/index.d.mts",
27
29
  "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
28
- "test": "vitest run --coverage"
30
+ "test": "vitest run --coverage",
31
+ "typecheck": "tsc --noEmit"
29
32
  },
30
33
  "sideEffects": [
31
34
  "wasm_exec.js"
32
35
  ],
33
36
  "types": "dist/types/index.d.ts",
34
- "typings": "dist/types/index.d.ts"
37
+ "typings": "dist/types/index.d.ts",
38
+ "exports": {
39
+ ".": {
40
+ "import": {
41
+ "types": "./dist/types/index.d.mts",
42
+ "default": "./dist/esm/index.js"
43
+ },
44
+ "require": {
45
+ "types": "./dist/types/index.d.ts",
46
+ "default": "./dist/cjs/index.js"
47
+ }
48
+ },
49
+ "./dist/cjs/workers/worker": {
50
+ "require": "./dist/cjs/workers/worker.js",
51
+ "default": "./dist/cjs/workers/worker.js"
52
+ }
53
+ }
35
54
  }