@walletmesh/aztec-rpc-wallet 0.5.0 → 0.5.4

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.
@@ -1,4 +1,4 @@
1
- [**@walletmesh/aztec-rpc-wallet v0.5.0**](../README.md)
1
+ [**@walletmesh/aztec-rpc-wallet v0.5.4**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > `const` `readonly` **AztecWalletErrorMap**: `Record`\<`AztecWalletErrorType`, \{ `code`: `number`; `message`: `string`; \}\>
10
10
 
11
- Defined in: [aztec/rpc-wallet/src/errors.ts:59](https://github.com/WalletMesh/walletmesh-packages/blob/fd734440d9c5e6ff3c77f868722c74b1be65d39d/aztec/rpc-wallet/src/errors.ts#L59)
11
+ Defined in: [aztec/rpc-wallet/src/errors.ts:59](https://github.com/WalletMesh/walletmesh-packages/blob/441c37c9745b2e99f43add247d17e8d0e84a0495/aztec/rpc-wallet/src/errors.ts#L59)
12
12
 
13
13
  A map associating each AztecWalletErrorType with a specific JSON-RPC error code
14
14
  and a human-readable message. This map is used by the [AztecWalletError](../classes/AztecWalletError.md) class
@@ -1,4 +1,4 @@
1
- [**@walletmesh/aztec-rpc-wallet v0.5.0**](../README.md)
1
+ [**@walletmesh/aztec-rpc-wallet v0.5.4**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > `const` **AztecWalletSerializer**: [`JSONRPCSerializer`](https://github.com/WalletMesh/walletmesh-packages/tree/main/core/jsonrpc/docs/interfaces/JSONRPCSerializer.md)\<`JSONRPCParams`, `unknown`\>
10
10
 
11
- Defined in: [aztec/rpc-wallet/src/wallet/serializers.ts:263](https://github.com/WalletMesh/walletmesh-packages/blob/fd734440d9c5e6ff3c77f868722c74b1be65d39d/aztec/rpc-wallet/src/wallet/serializers.ts#L263)
11
+ Defined in: [aztec/rpc-wallet/src/wallet/serializers.ts:263](https://github.com/WalletMesh/walletmesh-packages/blob/441c37c9745b2e99f43add247d17e8d0e84a0495/aztec/rpc-wallet/src/wallet/serializers.ts#L263)
12
12
 
13
13
  A comprehensive [JSONRPCSerializer](https://github.com/WalletMesh/walletmesh-packages/tree/main/core/jsonrpc/docs/interfaces/JSONRPCSerializer.md) for all Aztec wallet methods.
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walletmesh/aztec-rpc-wallet",
3
- "version": "0.5.0",
3
+ "version": "0.5.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,11 +21,11 @@
21
21
  "typedoc-plugin-markdown": "^4.8.1"
22
22
  },
23
23
  "dependencies": {
24
- "@aztec/aztec.js": "1.2.1",
25
- "@aztec/blob-lib": "1.2.1",
26
- "@aztec/entrypoints": "1.2.1",
27
- "@aztec/foundation": "1.2.1",
28
- "@aztec/stdlib": "1.2.1",
24
+ "@aztec/aztec.js": "2.0.3",
25
+ "@aztec/blob-lib": "2.0.3",
26
+ "@aztec/entrypoints": "2.0.3",
27
+ "@aztec/foundation": "2.0.3",
28
+ "@aztec/stdlib": "2.0.3",
29
29
  "zod": "^3.25.76",
30
30
  "@walletmesh/jsonrpc": "^0.5.2",
31
31
  "@walletmesh/router": "^0.5.2"
@@ -540,10 +540,9 @@ describe('AztecDappWallet', () => {
540
540
  it('should call aztec_simulateTx', async () => {
541
541
  const txRequest = { request: {} } as unknown as TxExecutionRequest;
542
542
  const simulatedTx = { tx: txRequest, privateReturnValues: [] };
543
- const msgSender = await AztecAddress.random();
544
543
  provider.call.mockResolvedValue(simulatedTx);
545
544
 
546
- const result = await wallet.simulateTx(txRequest, true, false, false, { msgSender });
545
+ const result = await wallet.simulateTx(txRequest, true, false, false );
547
546
 
548
547
  expect(provider.call).toHaveBeenCalledWith(testChainId, {
549
548
  method: 'aztec_simulateTx',
@@ -552,7 +551,6 @@ describe('AztecDappWallet', () => {
552
551
  simulatePublic: true,
553
552
  skipTxValidation: false,
554
553
  skipFeeEnforcement: false,
555
- overrides: { msgSender },
556
554
  },
557
555
  });
558
556
  expect(result).toEqual(simulatedTx);
@@ -143,7 +143,7 @@ export function createContractInteractionHandlers() {
143
143
  logger.debug('Proving result:', provingResult);
144
144
 
145
145
  logger.debug('Creating transaction from proving result...');
146
- const tx = provingResult.toTx();
146
+ const tx = await provingResult.toTx();
147
147
  logger.debug('Transaction created:', tx);
148
148
 
149
149
  logger.debug('Sending transaction to network...');
@@ -236,6 +236,7 @@ export function createContractInteractionHandlers() {
236
236
  const contractAddressSalt = Fr.random();
237
237
  const txOpts = await getTxOptions(ctx);
238
238
  const opts: DeployOptions = {
239
+ from: ctx.wallet.getAddress(),
239
240
  contractAddressSalt,
240
241
  fee: await getFeeOptions(ctx),
241
242
  };
@@ -185,8 +185,6 @@ describe('Transaction Handlers', () => {
185
185
  const simulatePublic = true;
186
186
  const skipTxValidation = true;
187
187
  const skipFeeEnforcement = true;
188
- const msgSender = '0x1234567890abcdef' as unknown as AztecAddress;
189
- const overrides = { msgSender };
190
188
 
191
189
  const expectedSimulation = {
192
190
  txRequest,
@@ -201,7 +199,6 @@ describe('Transaction Handlers', () => {
201
199
  simulatePublic,
202
200
  skipTxValidation,
203
201
  skipFeeEnforcement,
204
- overrides,
205
202
  ]);
206
203
 
207
204
  expect(mockWallet.simulateTx).toHaveBeenCalledWith(
@@ -209,7 +206,7 @@ describe('Transaction Handlers', () => {
209
206
  simulatePublic,
210
207
  skipTxValidation,
211
208
  skipFeeEnforcement,
212
- overrides,
209
+ undefined
213
210
  );
214
211
  expect(result).toBe(expectedSimulation);
215
212
  });
@@ -1,7 +1,8 @@
1
1
  import type { ContractArtifact } from '@aztec/aztec.js';
2
2
  import { AuthWitness, AztecAddress, Fr } from '@aztec/aztec.js';
3
3
  import { ExecutionPayload } from '@aztec/entrypoints/payload';
4
- import { FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
4
+ import { emptyFunctionArtifact, FunctionCall, FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
5
+ import { randomContractArtifact } from '@aztec/stdlib/testing';
5
6
  import { Capsule, HashedValues } from '@aztec/stdlib/tx';
6
7
  import { describe, expect, it } from 'vitest';
7
8
  import { AztecWalletSerializer } from './serializers.js';
@@ -95,40 +96,15 @@ describe('ExecutionPayload Serialization', () => {
95
96
  describe('DeployContract Serialization', () => {
96
97
  it('should serialize and deserialize aztec_wmDeployContract params correctly', async () => {
97
98
  // Create a minimal valid ContractArtifact
98
- const artifact: ContractArtifact = {
99
- name: 'TestContract',
100
- functions: [
101
- {
102
- name: 'constructor',
103
- functionType: FunctionType.PRIVATE,
104
- isInternal: false,
105
- isStatic: false,
106
- isInitializer: true,
107
- parameters: [
108
- {
109
- name: 'owner',
110
- type: { kind: 'field' },
111
- visibility: 'private',
112
- },
113
- ],
114
- returnTypes: [],
115
- errorTypes: {},
116
- bytecode: Buffer.from('test'),
117
- debugSymbols: '',
118
- },
119
- ],
120
- nonDispatchPublicFunctions: [],
121
- outputs: {
122
- structs: {},
123
- globals: {},
124
- },
125
- storageLayout: {},
126
- notes: {},
127
- fileMap: {},
128
- };
99
+ const artifact: ContractArtifact = await randomContractArtifact();
129
100
 
130
101
  const args = [AztecAddress.random().toString(), '12345'];
131
102
  const constructorName = 'constructor';
103
+ const functionArtifact = emptyFunctionArtifact();
104
+ functionArtifact.name = constructorName;
105
+ functionArtifact.functionType = FunctionType.PUBLIC;
106
+ functionArtifact.isInitializer = true;
107
+ artifact.functions.push(functionArtifact);
132
108
 
133
109
  // Test params serialization
134
110
  const params = { artifact, args, constructorName };
@@ -151,9 +127,10 @@ describe('DeployContract Serialization', () => {
151
127
  constructorName?: string;
152
128
  };
153
129
 
130
+
154
131
  // Verify the artifact structure
155
132
  expect(result.artifact).toBeDefined();
156
- expect(result.artifact.name).toBe('TestContract');
133
+ expect(result.artifact.name).toBe(artifact.name);
157
134
  expect(result.artifact.functions).toHaveLength(1);
158
135
  expect(result.artifact.functions[0]?.name).toBe('constructor');
159
136
  expect(result.artifact.functions[0]?.isInitializer).toBe(true);
@@ -166,18 +143,7 @@ describe('DeployContract Serialization', () => {
166
143
  });
167
144
 
168
145
  it('should handle aztec_wmDeployContract without constructorName', async () => {
169
- const artifact: ContractArtifact = {
170
- name: 'TestContract',
171
- functions: [],
172
- nonDispatchPublicFunctions: [],
173
- outputs: {
174
- structs: {},
175
- globals: {},
176
- },
177
- storageLayout: {},
178
- notes: {},
179
- fileMap: {},
180
- };
146
+ const artifact: ContractArtifact = await randomContractArtifact();
181
147
 
182
148
  const args: unknown[] = [];
183
149
 
@@ -218,18 +184,7 @@ describe('DeployContract Serialization', () => {
218
184
  });
219
185
 
220
186
  it('should validate args array in aztec_wmDeployContract', async () => {
221
- const artifact: ContractArtifact = {
222
- name: 'TestContract',
223
- functions: [],
224
- nonDispatchPublicFunctions: [],
225
- outputs: {
226
- structs: {},
227
- globals: {},
228
- },
229
- storageLayout: {},
230
- notes: {},
231
- fileMap: {},
232
- };
187
+ const artifact: ContractArtifact = await randomContractArtifact();
233
188
 
234
189
  // Test with various types in args array
235
190
  const args = ['string value', 123, true, { nested: 'object' }, ['array', 'of', 'values'], null];
@@ -69,7 +69,7 @@ import type { AztecWalletMethodMap } from '../types.js';
69
69
  const ContractMetadataSchema = z.object({
70
70
  contractInstance: z.union([ContractInstanceWithAddressSchema, z.undefined()]),
71
71
  isContractInitialized: z.boolean(),
72
- isContractPubliclyDeployed: z.boolean(),
72
+ isContractPublished: z.boolean(),
73
73
  }) satisfies ZodFor<ContractMetadata>;
74
74
 
75
75
  const ContractClassMetadataSchema = z.object({