@walletmesh/aztec-rpc-wallet 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/aztecRemoteWallet.d.ts +7 -6
  4. package/dist/aztecRemoteWallet.d.ts.map +1 -1
  5. package/dist/aztecRemoteWallet.js +15 -9
  6. package/dist/handlers/aztecAccountWallet.d.ts.map +1 -1
  7. package/dist/handlers/aztecAccountWallet.js +22 -22
  8. package/dist/serializers/account.d.ts +4 -7
  9. package/dist/serializers/account.d.ts.map +1 -1
  10. package/dist/serializers/account.js +28 -29
  11. package/dist/serializers/contract.d.ts +4 -56
  12. package/dist/serializers/contract.d.ts.map +1 -1
  13. package/dist/serializers/contract.js +62 -148
  14. package/dist/serializers/index.d.ts +1 -4
  15. package/dist/serializers/index.d.ts.map +1 -1
  16. package/dist/serializers/index.js +12 -12
  17. package/dist/serializers/log.d.ts +36 -83
  18. package/dist/serializers/log.d.ts.map +1 -1
  19. package/dist/serializers/log.js +96 -107
  20. package/dist/serializers/note.d.ts +14 -17
  21. package/dist/serializers/note.d.ts.map +1 -1
  22. package/dist/serializers/note.js +52 -29
  23. package/dist/serializers/transaction-utils.d.ts +44 -100
  24. package/dist/serializers/transaction-utils.d.ts.map +1 -1
  25. package/dist/serializers/transaction-utils.js +82 -118
  26. package/dist/serializers/transaction.d.ts +3 -6
  27. package/dist/serializers/transaction.d.ts.map +1 -1
  28. package/dist/serializers/transaction.js +39 -50
  29. package/dist/types.d.ts +8 -8
  30. package/dist/types.d.ts.map +1 -1
  31. package/dist/types.js +1 -1
  32. package/package.json +5 -5
  33. package/src/aztecRemoteWallet.test.ts +33 -29
  34. package/src/aztecRemoteWallet.ts +25 -14
  35. package/src/handlers/aztecAccountWallet.test.ts +78 -75
  36. package/src/handlers/aztecAccountWallet.ts +32 -35
  37. package/src/serializers/account.test.ts +18 -17
  38. package/src/serializers/account.ts +31 -49
  39. package/src/serializers/contract.test.ts +14 -16
  40. package/src/serializers/contract.ts +75 -164
  41. package/src/serializers/index.test.ts +20 -8
  42. package/src/serializers/index.ts +16 -20
  43. package/src/serializers/log.test.ts +201 -28
  44. package/src/serializers/log.ts +153 -146
  45. package/src/serializers/note.test.ts +26 -28
  46. package/src/serializers/note.ts +60 -36
  47. package/src/serializers/transaction-utils.ts +135 -211
  48. package/src/serializers/transaction.test.ts +190 -30
  49. package/src/serializers/transaction.ts +51 -72
  50. package/src/types.ts +9 -8
  51. package/vitest.config.ts +1 -1
  52. package/dist/serializers/contract-utils.d.ts +0 -40
  53. package/dist/serializers/contract-utils.d.ts.map +0 -1
  54. package/dist/serializers/contract-utils.js +0 -102
  55. package/dist/serializers/core.d.ts +0 -110
  56. package/dist/serializers/core.d.ts.map +0 -1
  57. package/dist/serializers/core.js +0 -130
  58. package/dist/serializers/types.d.ts +0 -49
  59. package/dist/serializers/types.d.ts.map +0 -1
  60. package/dist/serializers/types.js +0 -22
  61. package/src/serializers/contract-utils.ts +0 -104
  62. package/src/serializers/core.test.ts +0 -56
  63. package/src/serializers/core.ts +0 -141
  64. package/src/serializers/types.ts +0 -58
@@ -1,15 +1,19 @@
1
1
  import type { AztecWalletMethodMap } from '../types.js';
2
- import type { JSONRPCSerializedData, JSONRPCSerializer } from './types.js';
3
- import { encodeBase64, decodeBase64 } from './types.js';
4
- import { aztecAddressSerializer, frSerializer } from './core.js';
5
- import { SerializableContractInstance } from '@aztec/circuits.js';
2
+ import type { JSONRPCSerializedData, JSONRPCSerializer } from '@walletmesh/jsonrpc';
3
+ import {
4
+ SerializableContractInstance,
5
+ ContractClassSchema,
6
+ ContractClassWithIdSchema,
7
+ ContractInstanceWithAddressSchema,
8
+ } from '@aztec/circuits.js';
6
9
  import { ContractArtifactSchema } from '@aztec/foundation/abi';
7
- import { serializeContractClassWithId, deserializeContractClassWithId } from './contract-utils.js';
10
+ import { AztecAddress, Fr } from '@aztec/aztec.js';
11
+ import type { ContractInstanceWithAddress } from '@aztec/aztec.js';
12
+ import { jsonStringify, jsonParseWithSchema } from '@aztec/foundation/json-rpc';
8
13
 
9
14
  /**
10
15
  * Serializer for the aztec_getContractInstance RPC method.
11
16
  * Handles serialization of contract instance queries and results between JSON-RPC format and native Aztec types.
12
- * Used to retrieve deployed contract instances by their address.
13
17
  */
14
18
  export class AztecGetContractInstanceSerializer
15
19
  implements
@@ -28,25 +32,17 @@ export class AztecGetContractInstanceSerializer
28
32
  serialize: (
29
33
  method: string,
30
34
  value: AztecWalletMethodMap['aztec_getContractInstance']['params'],
31
- ): JSONRPCSerializedData => {
32
- const { address } = value;
33
- return {
34
- method,
35
- serialized: encodeBase64(aztecAddressSerializer.serialize(address)),
36
- };
37
- },
38
- /**
39
- * Deserializes contract instance query parameters from RPC transport.
40
- * @param method - The RPC method name
41
- * @param data - The serialized address data
42
- * @returns Deserialized query parameters
43
- */
35
+ ): JSONRPCSerializedData => ({
36
+ method,
37
+ serialized: jsonStringify(value.address),
38
+ }),
44
39
  deserialize: (
45
40
  method: string,
46
41
  data: JSONRPCSerializedData,
47
42
  ): AztecWalletMethodMap['aztec_getContractInstance']['params'] => {
48
- const address = aztecAddressSerializer.deserialize(decodeBase64(data.serialized));
49
- return { address };
43
+ return {
44
+ address: jsonParseWithSchema(data.serialized, AztecAddress.schema),
45
+ };
50
46
  },
51
47
  };
52
48
 
@@ -57,37 +53,18 @@ export class AztecGetContractInstanceSerializer
57
53
  * @param value - The contract instance data including address and state
58
54
  * @returns Serialized contract instance data
59
55
  */
60
- serialize: (
61
- method: string,
62
- value: AztecWalletMethodMap['aztec_getContractInstance']['result'],
63
- ): JSONRPCSerializedData => {
64
- const serializable = new SerializableContractInstance(value);
65
- const { address } = value;
66
-
67
- return {
68
- method,
69
- serialized: encodeBase64(
70
- JSON.stringify({
71
- instance: serializable.toBuffer().toString('hex'),
72
- address: aztecAddressSerializer.serialize(address),
73
- }),
74
- ),
75
- };
76
- },
77
- /**
78
- * Deserializes the contract instance query result.
79
- * @param method - The RPC method name
80
- * @param data - The serialized contract instance data
81
- * @returns Deserialized contract instance
82
- */
83
- deserialize: (
84
- method: string,
85
- data: JSONRPCSerializedData,
86
- ): AztecWalletMethodMap['aztec_getContractInstance']['result'] => {
87
- const { instance, address } = JSON.parse(decodeBase64(data.serialized));
88
- const baseInstance = SerializableContractInstance.fromBuffer(Buffer.from(instance, 'hex'));
89
- const deserializedAddress = aztecAddressSerializer.deserialize(address);
90
- return baseInstance.withAddress(deserializedAddress);
56
+ serialize: (method: string, value: ContractInstanceWithAddress): JSONRPCSerializedData => ({
57
+ method,
58
+ serialized: JSON.stringify({
59
+ serializableContractInstance: new SerializableContractInstance(value).toBuffer(),
60
+ address: jsonStringify(value.address),
61
+ }),
62
+ }),
63
+ deserialize: (method: string, data: JSONRPCSerializedData): ContractInstanceWithAddress => {
64
+ const parsed = JSON.parse(data.serialized);
65
+ return SerializableContractInstance.fromBuffer(
66
+ Buffer.from(parsed.serializableContractInstance),
67
+ ).withAddress(jsonParseWithSchema(parsed.address, AztecAddress.schema));
91
68
  },
92
69
  };
93
70
  }
@@ -95,7 +72,6 @@ export class AztecGetContractInstanceSerializer
95
72
  /**
96
73
  * Serializer for the aztec_getContractClass RPC method.
97
74
  * Handles serialization of contract class queries and results between JSON-RPC format and native Aztec types.
98
- * Used to retrieve contract class definitions by their ID.
99
75
  */
100
76
  export class AztecGetContractClassSerializer
101
77
  implements
@@ -114,25 +90,18 @@ export class AztecGetContractClassSerializer
114
90
  serialize: (
115
91
  method: string,
116
92
  value: AztecWalletMethodMap['aztec_getContractClass']['params'],
117
- ): JSONRPCSerializedData => {
118
- const { id } = value;
119
- return {
120
- method,
121
- serialized: encodeBase64(frSerializer.serialize(id)),
122
- };
123
- },
124
- /**
125
- * Deserializes contract class query parameters from RPC transport.
126
- * @param method - The RPC method name
127
- * @param data - The serialized class ID data
128
- * @returns Deserialized query parameters
129
- */
93
+ ): JSONRPCSerializedData => ({
94
+ method,
95
+ serialized: JSON.stringify({
96
+ id: value.id.toString(),
97
+ }),
98
+ }),
130
99
  deserialize: (
131
100
  method: string,
132
101
  data: JSONRPCSerializedData,
133
102
  ): AztecWalletMethodMap['aztec_getContractClass']['params'] => {
134
- const id = frSerializer.deserialize(decodeBase64(data.serialized));
135
- return { id };
103
+ const { id } = JSON.parse(data.serialized);
104
+ return { id: Fr.fromString(id) };
136
105
  },
137
106
  };
138
107
 
@@ -146,25 +115,16 @@ export class AztecGetContractClassSerializer
146
115
  serialize: (
147
116
  method: string,
148
117
  value: AztecWalletMethodMap['aztec_getContractClass']['result'],
149
- ): JSONRPCSerializedData => {
150
- const serialized = serializeContractClassWithId(value);
151
- return {
152
- method,
153
- serialized: encodeBase64(JSON.stringify(serialized)),
154
- };
155
- },
156
- /**
157
- * Deserializes the contract class query result.
158
- * @param method - The RPC method name
159
- * @param data - The serialized contract class data
160
- * @returns Deserialized contract class with ID
161
- */
118
+ ): JSONRPCSerializedData => ({
119
+ method,
120
+ serialized: JSON.stringify(value),
121
+ }),
162
122
  deserialize: (
163
123
  method: string,
164
124
  data: JSONRPCSerializedData,
165
125
  ): AztecWalletMethodMap['aztec_getContractClass']['result'] => {
166
- const parsed = JSON.parse(decodeBase64(data.serialized));
167
- return deserializeContractClassWithId(parsed);
126
+ const parsed = JSON.parse(data.serialized);
127
+ return ContractClassWithIdSchema.parse(parsed);
168
128
  },
169
129
  };
170
130
  }
@@ -172,7 +132,6 @@ export class AztecGetContractClassSerializer
172
132
  /**
173
133
  * Serializer for the aztec_getContractArtifact RPC method.
174
134
  * Handles serialization of contract artifact queries and results between JSON-RPC format and native Aztec types.
175
- * Used to retrieve contract artifacts (ABI, bytecode, etc.) by their ID.
176
135
  */
177
136
  export class AztecGetContractArtifactSerializer
178
137
  implements
@@ -191,25 +150,18 @@ export class AztecGetContractArtifactSerializer
191
150
  serialize: (
192
151
  method: string,
193
152
  value: AztecWalletMethodMap['aztec_getContractArtifact']['params'],
194
- ): JSONRPCSerializedData => {
195
- const { id } = value;
196
- return {
197
- method,
198
- serialized: encodeBase64(frSerializer.serialize(id)),
199
- };
200
- },
201
- /**
202
- * Deserializes contract artifact query parameters from RPC transport.
203
- * @param method - The RPC method name
204
- * @param data - The serialized artifact ID data
205
- * @returns Deserialized query parameters
206
- */
153
+ ): JSONRPCSerializedData => ({
154
+ method,
155
+ serialized: JSON.stringify({
156
+ id: value.id.toString(),
157
+ }),
158
+ }),
207
159
  deserialize: (
208
160
  method: string,
209
161
  data: JSONRPCSerializedData,
210
162
  ): AztecWalletMethodMap['aztec_getContractArtifact']['params'] => {
211
- const id = frSerializer.deserialize(decodeBase64(data.serialized));
212
- return { id };
163
+ const { id } = JSON.parse(data.serialized);
164
+ return { id: Fr.fromString(id) };
213
165
  },
214
166
  };
215
167
 
@@ -223,32 +175,21 @@ export class AztecGetContractArtifactSerializer
223
175
  serialize: (
224
176
  method: string,
225
177
  value: AztecWalletMethodMap['aztec_getContractArtifact']['result'],
226
- ): JSONRPCSerializedData => {
227
- return {
228
- method,
229
- serialized: encodeBase64(JSON.stringify(value)),
230
- };
231
- },
232
- /**
233
- * Deserializes the contract artifact query result.
234
- * @param method - The RPC method name
235
- * @param data - The serialized artifact data
236
- * @returns Deserialized contract artifact
237
- * @throws If the data doesn't match the contract artifact schema
238
- */
178
+ ): JSONRPCSerializedData => ({
179
+ method,
180
+ serialized: JSON.stringify(ContractArtifactSchema.parse(value)),
181
+ }),
239
182
  deserialize: (
240
183
  method: string,
241
184
  data: JSONRPCSerializedData,
242
- ): AztecWalletMethodMap['aztec_getContractArtifact']['result'] => {
243
- return ContractArtifactSchema.parse(JSON.parse(decodeBase64(data.serialized)));
244
- },
185
+ ): AztecWalletMethodMap['aztec_getContractArtifact']['result'] =>
186
+ ContractArtifactSchema.parse(JSON.parse(data.serialized)),
245
187
  };
246
188
  }
247
189
 
248
190
  /**
249
191
  * Serializer for the aztec_registerContract RPC method.
250
192
  * Handles serialization of contract registration requests between JSON-RPC format and native Aztec types.
251
- * Used to register new contract instances with optional artifacts.
252
193
  */
253
194
  export class AztecRegisterContractSerializer
254
195
  implements
@@ -267,44 +208,24 @@ export class AztecRegisterContractSerializer
267
208
  serialize: (
268
209
  method: string,
269
210
  value: AztecWalletMethodMap['aztec_registerContract']['params'],
270
- ): JSONRPCSerializedData => {
271
- const { instance, artifact } = value;
272
- const serializable = new SerializableContractInstance(instance);
273
-
274
- const serializedInstance = {
275
- instance: Buffer.from(serializable.toBuffer()).toString('base64'),
276
- address: aztecAddressSerializer.serialize(instance.address),
277
- };
278
-
279
- const serializedArtifact = artifact ? JSON.stringify(artifact) : undefined;
280
-
281
- return {
282
- method,
283
- serialized: encodeBase64(
284
- JSON.stringify({
285
- instance: serializedInstance,
286
- artifact: serializedArtifact,
287
- }),
288
- ),
289
- };
290
- },
291
- /**
292
- * Deserializes contract registration parameters from RPC transport.
293
- * @param method - The RPC method name
294
- * @param data - The serialized registration data
295
- * @returns Deserialized registration parameters
296
- */
211
+ ): JSONRPCSerializedData => ({
212
+ method,
213
+ serialized: JSON.stringify({
214
+ serializableContractInstance: new SerializableContractInstance(value.instance).toBuffer(),
215
+ address: value.instance.address.toString(),
216
+ artifact: value.artifact ? ContractArtifactSchema.parse(value.artifact) : undefined,
217
+ }),
218
+ }),
297
219
  deserialize: (
298
220
  method: string,
299
221
  data: JSONRPCSerializedData,
300
222
  ): AztecWalletMethodMap['aztec_registerContract']['params'] => {
301
- const { instance, artifact } = JSON.parse(decodeBase64(data.serialized));
302
- const { instance: instanceBuffer, address } = instance;
303
- const baseInstance = SerializableContractInstance.fromBuffer(Buffer.from(instanceBuffer, 'base64'));
304
- const deserializedAddress = aztecAddressSerializer.deserialize(address);
223
+ const { serializableContractInstance, address, artifact } = JSON.parse(data.serialized);
305
224
  return {
306
- instance: baseInstance.withAddress(deserializedAddress),
307
- artifact: artifact ? JSON.parse(artifact) : undefined,
225
+ instance: SerializableContractInstance.fromBuffer(
226
+ Buffer.from(serializableContractInstance),
227
+ ).withAddress(AztecAddress.fromString(address)),
228
+ artifact: artifact ? ContractArtifactSchema.parse(artifact) : undefined,
308
229
  };
309
230
  },
310
231
  };
@@ -319,24 +240,14 @@ export class AztecRegisterContractSerializer
319
240
  serialize: (
320
241
  method: string,
321
242
  value: AztecWalletMethodMap['aztec_registerContract']['result'],
322
- ): JSONRPCSerializedData => {
323
- return {
324
- method,
325
- serialized: encodeBase64(JSON.stringify(value)),
326
- };
327
- },
328
- /**
329
- * Deserializes the contract registration result.
330
- * @param method - The RPC method name
331
- * @param data - The serialized result data
332
- * @returns Boolean indicating success
333
- */
243
+ ): JSONRPCSerializedData => ({
244
+ method,
245
+ serialized: JSON.stringify(value),
246
+ }),
334
247
  deserialize: (
335
248
  method: string,
336
249
  data: JSONRPCSerializedData,
337
- ): AztecWalletMethodMap['aztec_registerContract']['result'] => {
338
- return JSON.parse(decodeBase64(data.serialized));
339
- },
250
+ ): AztecWalletMethodMap['aztec_registerContract']['result'] => JSON.parse(data.serialized),
340
251
  };
341
252
  }
342
253
 
@@ -2,6 +2,7 @@ import { describe, expect, it, beforeEach, vi } from 'vitest';
2
2
  import { AztecWalletSerializer } from './index.js';
3
3
  import { AztecAddress, Tx } from '@aztec/aztec.js';
4
4
  import type { JSONRPCSerializer } from './types.js';
5
+ import type { AztecWalletMethodMap } from '../types.js';
5
6
 
6
7
  describe('AztecWalletSerializer', () => {
7
8
  // Test known method (using aztec_setScopes as an example)
@@ -14,8 +15,8 @@ describe('AztecWalletSerializer', () => {
14
15
  const resultSerializer = (AztecWalletSerializer as Required<JSONRPCSerializer<unknown, unknown>>).result;
15
16
 
16
17
  describe('params', () => {
17
- it('should serialize params for known methods', () => {
18
- const params = { scopes: [AztecAddress.random()] };
18
+ it('should serialize params for known methods', async () => {
19
+ const params = { scopes: [await AztecAddress.random()] };
19
20
  const result = AztecWalletSerializer.params.serialize(knownMethod, params);
20
21
  expect(result).toBeDefined();
21
22
  expect(result.method).toBe(knownMethod);
@@ -97,26 +98,37 @@ describe('AztecWalletSerializer', () => {
97
98
  });
98
99
 
99
100
  describe('integration', () => {
100
- it('should handle contract methods', () => {
101
+ it('should handle contract methods', async () => {
101
102
  const method = 'aztec_getContractInstance';
102
- const params = { address: AztecAddress.random() };
103
+ const params = { address: await AztecAddress.random() };
103
104
 
104
105
  const serializedParams = AztecWalletSerializer.params.serialize(method, params);
105
106
  expect(serializedParams).toBeDefined();
106
107
  expect(serializedParams.method).toBe(method);
107
108
  expect(typeof serializedParams.serialized).toBe('string');
109
+
110
+ const deserializedParams = AztecWalletSerializer.params.deserialize(
111
+ method,
112
+ serializedParams,
113
+ ) as AztecWalletMethodMap['aztec_getContractInstance']['params'];
114
+ expect(deserializedParams.address.toString()).toBe(params.address.toString());
108
115
  });
109
116
 
110
- it('should handle transaction methods', () => {
117
+ it('should handle transaction methods', async () => {
111
118
  const method = 'aztec_sendTx';
112
- const params = {
113
- tx: Tx.random(),
114
- };
119
+ const tx = await Tx.random();
120
+ const params = { tx };
115
121
 
116
122
  const serializedParams = AztecWalletSerializer.params.serialize(method, params);
117
123
  expect(serializedParams).toBeDefined();
118
124
  expect(serializedParams.method).toBe(method);
119
125
  expect(typeof serializedParams.serialized).toBe('string');
126
+
127
+ const deserializedParams = AztecWalletSerializer.params.deserialize(
128
+ method,
129
+ serializedParams,
130
+ ) as AztecWalletMethodMap['aztec_sendTx']['params'];
131
+ expect(deserializedParams.tx.toBuffer().toString('hex')).toBe(tx.toBuffer().toString('hex'));
120
132
  });
121
133
  });
122
134
  });
@@ -1,13 +1,10 @@
1
1
  import type { AztecWalletMethodMap } from '../types.js';
2
- import type { JSONRPCSerializer, JSONRPCSerializedData } from './types.js';
3
- import { encodeBase64 } from './types.js';
2
+ import type { JSONRPCSerializedData, JSONRPCSerializer } from '@walletmesh/jsonrpc';
4
3
 
5
4
  /**
6
5
  * Re-export all serializer types and implementations.
7
6
  * This provides a single entry point for importing any serializer functionality.
8
7
  */
9
- export * from './types.js';
10
- export * from './core.js';
11
8
  export * from './account.js';
12
9
  export * from './contract.js';
13
10
  export * from './transaction.js';
@@ -32,16 +29,15 @@ import {
32
29
  aztecProveTxSerializer,
33
30
  aztecSendTxSerializer,
34
31
  aztecGetTxReceiptSerializer,
32
+ aztecGetTxEffectSerializer,
33
+ aztecSimulateTxSerializer,
35
34
  } from './transaction.js';
35
+ import { aztecGetNotesSerializer, aztecAddNoteSerializer, aztecAddNullifiedNoteSerializer } from './note.js';
36
36
  import {
37
- aztecGetIncomingNotesSerializer,
38
- aztecAddNoteSerializer,
39
- aztecAddNullifiedNoteSerializer,
40
- } from './note.js';
41
- import {
42
- aztecGetUnencryptedLogsSerializer,
43
- aztecGetEncryptedEventsSerializer,
44
- aztecGetUnencryptedEventsSerializer,
37
+ aztecGetPublicLogsSerializer,
38
+ aztecGetContractClassLogsSerializer,
39
+ aztecGetPrivateEventsSerializer,
40
+ aztecGetPublicEventsSerializer,
45
41
  } from './log.js';
46
42
 
47
43
  /**
@@ -86,16 +82,19 @@ const methodSerializers: Record<AztecMethodName, JSONRPCSerializer<unknown, unkn
86
82
  aztec_proveTx: aztecProveTxSerializer,
87
83
  aztec_sendTx: aztecSendTxSerializer,
88
84
  aztec_getTxReceipt: aztecGetTxReceiptSerializer,
85
+ aztec_getTxEffect: aztecGetTxEffectSerializer,
86
+ aztec_simulateTx: aztecSimulateTxSerializer,
89
87
 
90
88
  // Note methods
91
- aztec_getIncomingNotes: aztecGetIncomingNotesSerializer,
89
+ aztec_getNotes: aztecGetNotesSerializer,
92
90
  aztec_addNote: aztecAddNoteSerializer,
93
91
  aztec_addNullifiedNote: aztecAddNullifiedNoteSerializer,
94
92
 
95
93
  // Log methods
96
- aztec_getUnencryptedLogs: aztecGetUnencryptedLogsSerializer,
97
- aztec_getEncryptedEvents: aztecGetEncryptedEventsSerializer,
98
- aztec_getUnencryptedEvents: aztecGetUnencryptedEventsSerializer,
94
+ aztec_getPublicLogs: aztecGetPublicLogsSerializer,
95
+ aztec_getContractClassLogs: aztecGetContractClassLogsSerializer,
96
+ aztec_getPrivateEvents: aztecGetPrivateEventsSerializer,
97
+ aztec_getPublicEvents: aztecGetPublicEventsSerializer,
99
98
  };
100
99
 
101
100
  /**
@@ -109,7 +108,7 @@ const methodSerializers: Record<AztecMethodName, JSONRPCSerializer<unknown, unkn
109
108
  function wrapUnknownValue(method: string, value: unknown): JSONRPCSerializedData {
110
109
  return {
111
110
  method,
112
- serialized: encodeBase64(JSON.stringify(value)),
111
+ serialized: JSON.stringify(value),
113
112
  };
114
113
  }
115
114
 
@@ -208,6 +207,3 @@ export const AztecWalletSerializer: JSONRPCSerializer<unknown, unknown> = {
208
207
  },
209
208
  },
210
209
  };
211
-
212
- // Export the main serializer interface
213
- export type { JSONRPCSerializer } from './types.js';