@aztec/cli 0.16.3 → 0.16.5

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.
Files changed (40) hide show
  1. package/dest/bin/index.js +0 -0
  2. package/package.json +8 -8
  3. package/src/bin/index.ts +0 -22
  4. package/src/client.ts +0 -68
  5. package/src/cmds/add_contract.ts +0 -27
  6. package/src/cmds/add_note.ts +0 -24
  7. package/src/cmds/block_number.ts +0 -12
  8. package/src/cmds/call.ts +0 -35
  9. package/src/cmds/check_deploy.ts +0 -17
  10. package/src/cmds/compute_selector.ts +0 -10
  11. package/src/cmds/create_account.ts +0 -39
  12. package/src/cmds/deploy.ts +0 -77
  13. package/src/cmds/deploy_l1_contracts.ts +0 -25
  14. package/src/cmds/example_contracts.ts +0 -12
  15. package/src/cmds/generate_p2p_private_key.ts +0 -13
  16. package/src/cmds/generate_private_key.ts +0 -23
  17. package/src/cmds/get_account.ts +0 -18
  18. package/src/cmds/get_accounts.ts +0 -19
  19. package/src/cmds/get_contract_data.ts +0 -39
  20. package/src/cmds/get_logs.ts +0 -71
  21. package/src/cmds/get_node_info.ts +0 -17
  22. package/src/cmds/get_recipient.ts +0 -18
  23. package/src/cmds/get_recipients.ts +0 -19
  24. package/src/cmds/get_tx_receipt.ts +0 -18
  25. package/src/cmds/inspect_contract.ts +0 -29
  26. package/src/cmds/parse_parameter_struct.ts +0 -30
  27. package/src/cmds/register_account.ts +0 -24
  28. package/src/cmds/register_recipient.ts +0 -21
  29. package/src/cmds/send.ts +0 -40
  30. package/src/cmds/unbox.ts +0 -11
  31. package/src/encoding.ts +0 -115
  32. package/src/github.ts +0 -3
  33. package/src/index.ts +0 -487
  34. package/src/test/mocks.ts +0 -65
  35. package/src/unbox.ts +0 -345
  36. package/src/update/common.ts +0 -16
  37. package/src/update/noir.ts +0 -79
  38. package/src/update/npm.ts +0 -134
  39. package/src/update/update.ts +0 -132
  40. package/src/utils.ts +0 -439
package/src/index.ts DELETED
@@ -1,487 +0,0 @@
1
- import { initAztecJs } from '@aztec/aztec.js/init';
2
- import { DebugLogger, LogFn } from '@aztec/foundation/log';
3
- import { fileURLToPath } from '@aztec/foundation/url';
4
- import { addNoirCompilerCommanderActions } from '@aztec/noir-compiler/cli';
5
-
6
- import { Command, Option } from 'commander';
7
- import { readFileSync } from 'fs';
8
- import { dirname, resolve } from 'path';
9
-
10
- import {
11
- parseAztecAddress,
12
- parseEthereumAddress,
13
- parseField,
14
- parseOptionalAztecAddress,
15
- parseOptionalInteger,
16
- parseOptionalLogId,
17
- parseOptionalSelector,
18
- parseOptionalTxHash,
19
- parsePartialAddress,
20
- parsePrivateKey,
21
- parsePublicKey,
22
- parseSaltFromHexString,
23
- parseTxHash,
24
- } from './utils.js';
25
-
26
- const { ETHEREUM_HOST = 'http://localhost:8545', PRIVATE_KEY, API_KEY } = process.env;
27
-
28
- /**
29
- * Returns commander program that defines the CLI.
30
- * @param log - Console logger.
31
- * @param debugLogger - Debug logger.
32
- * @returns The CLI.
33
- */
34
- export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
35
- const program = new Command();
36
-
37
- const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../package.json');
38
- const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
39
- const logJson = (obj: object) => log(JSON.stringify(obj, null, 2));
40
-
41
- program.name('aztec-cli').description('CLI for interacting with Aztec.').version(cliVersion);
42
-
43
- const pxeOption = new Option('-u, --rpc-url <string>', 'URL of the PXE')
44
- .env('PXE_URL')
45
- .default('http://localhost:8080')
46
- .makeOptionMandatory(true);
47
-
48
- const createPrivateKeyOption = (description: string, mandatory: boolean) =>
49
- new Option('-k, --private-key <string>', description)
50
- .env('PRIVATE_KEY')
51
- .argParser(parsePrivateKey)
52
- .makeOptionMandatory(mandatory);
53
-
54
- program.hook('preAction', initAztecJs);
55
-
56
- program
57
- .command('deploy-l1-contracts')
58
- .description('Deploys all necessary Ethereum contracts for Aztec.')
59
- .requiredOption(
60
- '-u, --rpc-url <string>',
61
- 'Url of the ethereum host. Chain identifiers localhost and testnet can be used',
62
- ETHEREUM_HOST,
63
- )
64
- .option('-a, --api-key <string>', 'Api key for the ethereum host', API_KEY)
65
- .requiredOption('-p, --private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
66
- .option(
67
- '-m, --mnemonic <string>',
68
- 'The mnemonic to use in deployment',
69
- 'test test test test test test test test test test test junk',
70
- )
71
- .action(async options => {
72
- const { deployL1Contracts } = await import('./cmds/deploy_l1_contracts.js');
73
- await deployL1Contracts(
74
- options.rpcUrl,
75
- options.apiKey ?? '',
76
- options.privateKey,
77
- options.mnemonic,
78
- log,
79
- debugLogger,
80
- );
81
- });
82
-
83
- program
84
- .command('generate-private-key')
85
- .summary('Generates an encryption private key.')
86
- .description(
87
- 'Generates a private key which fits into the scalar field used by Grumpkin curve, can be used as an encryption private key.',
88
- )
89
- .option(
90
- '-m, --mnemonic',
91
- 'An optional mnemonic string used for the private key generation. If not provided, random private key will be generated.',
92
- )
93
- .action(async options => {
94
- const { generatePrivateKey } = await import('./cmds/generate_private_key.js');
95
- generatePrivateKey(options.mnemonic, log);
96
- });
97
-
98
- program
99
- .command('generate-p2p-private-key')
100
- .summary('Generates a LibP2P peer private key.')
101
- .description('Generates a private key that can be used for running a node on a LibP2P network.')
102
- .action(async () => {
103
- const { generateP2PPrivateKey } = await import('./cmds/generate_p2p_private_key.js');
104
- await generateP2PPrivateKey(log);
105
- });
106
-
107
- program
108
- .command('create-account')
109
- .description(
110
- 'Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).',
111
- )
112
- .summary('Creates an aztec account that can be used for sending transactions.')
113
- .addOption(
114
- createPrivateKeyOption('Private key for note encryption and transaction signing. Uses random by default.', false),
115
- )
116
- .addOption(pxeOption)
117
- // `options.wait` is default true. Passing `--no-wait` will set it to false.
118
- // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
119
- .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction')
120
- .action(async ({ rpcUrl, privateKey, wait }) => {
121
- const { createAccount } = await import('./cmds/create_account.js');
122
- await createAccount(rpcUrl, privateKey, wait, debugLogger, log);
123
- });
124
-
125
- program
126
- .command('register-account')
127
- .description(
128
- 'Registers an aztec account that can be used for sending transactions. Registers the account on the PXE. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).',
129
- )
130
- .summary('Registers an aztec account that can be used for sending transactions.')
131
- .addOption(createPrivateKeyOption('Private key for note encryption and transaction signing.', true))
132
- .requiredOption(
133
- '-pa, --partial-address <partialAddress>',
134
- 'The partially computed address of the account contract.',
135
- parsePartialAddress,
136
- )
137
- .addOption(pxeOption)
138
- .action(async ({ rpcUrl, privateKey, partialAddress }) => {
139
- const { registerAccount } = await import('./cmds/register_account.js');
140
- await registerAccount(rpcUrl, privateKey, partialAddress, debugLogger, log);
141
- });
142
-
143
- program
144
- .command('deploy')
145
- .description('Deploys a compiled Aztec.nr contract to Aztec.')
146
- .argument(
147
- '<artifact>',
148
- "A compiled Aztec.nr contract's artifact in JSON format or name of a contract artifact exported by @aztec/noir-contracts",
149
- )
150
- .option('-a, --args <constructorArgs...>', 'Contract constructor arguments', [])
151
- .addOption(pxeOption)
152
- .option(
153
- '-k, --public-key <string>',
154
- 'Optional encryption public key for this address. Set this value only if this contract is expected to receive private notes, which will be encrypted using this public key.',
155
- parsePublicKey,
156
- )
157
- .option(
158
- '-p, --portal-address <hex string>',
159
- 'Optional L1 portal address to link the contract to.',
160
- parseEthereumAddress,
161
- )
162
- .option(
163
- '-s, --salt <hex string>',
164
- 'Optional deployment salt as a hex string for generating the deployment address.',
165
- parseSaltFromHexString,
166
- )
167
- .option('--json', 'Emit output as json')
168
- // `options.wait` is default true. Passing `--no-wait` will set it to false.
169
- // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
170
- .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction')
171
- .action(async (artifactPath, { json, rpcUrl, publicKey, args: rawArgs, portalAddress, salt, wait }) => {
172
- const { deploy } = await import('./cmds/deploy.js');
173
- await deploy(
174
- artifactPath,
175
- json,
176
- rpcUrl,
177
- publicKey,
178
- rawArgs,
179
- portalAddress,
180
- salt,
181
- wait,
182
- debugLogger,
183
- log,
184
- logJson,
185
- );
186
- });
187
-
188
- program
189
- .command('check-deploy')
190
- .description('Checks if a contract is deployed to the specified Aztec address.')
191
- .requiredOption(
192
- '-ca, --contract-address <address>',
193
- 'An Aztec address to check if contract has been deployed to.',
194
- parseAztecAddress,
195
- )
196
- .addOption(pxeOption)
197
- .action(async options => {
198
- const { checkDeploy } = await import('./cmds/check_deploy.js');
199
- await checkDeploy(options.rpcUrl, options.contractAddress, debugLogger, log);
200
- });
201
-
202
- program
203
- .command('add-contract')
204
- .description(
205
- 'Adds an existing contract to the PXE. This is useful if you have deployed a contract outside of the PXE and want to use it with the PXE.',
206
- )
207
- .requiredOption(
208
- '-c, --contract-artifact <fileLocation>',
209
- "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts",
210
- )
211
- .requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
212
- .requiredOption('-pa, --partial-address <address>', 'Partial address of the contract', parsePartialAddress)
213
- .option('-p, --public-key <public key>', 'Optional public key for this contract', parsePublicKey)
214
- .option('--portal-address <address>', 'Optional address to a portal contract on L1', parseEthereumAddress)
215
- .addOption(pxeOption)
216
- .action(async options => {
217
- const { addContract } = await import('./cmds/add_contract.js');
218
- await addContract(
219
- options.rpcUrl,
220
- options.contractArtifact,
221
- options.contractAddress,
222
- options.partialAddress,
223
- options.publicKey,
224
- options.portalContract,
225
- debugLogger,
226
- log,
227
- );
228
- });
229
-
230
- program
231
- .command('get-tx-receipt')
232
- .description('Gets the receipt for the specified transaction hash.')
233
- .argument('<txHash>', 'A transaction hash to get the receipt for.', parseTxHash)
234
- .addOption(pxeOption)
235
- .action(async (txHash, options) => {
236
- const { getTxReceipt } = await import('./cmds/get_tx_receipt.js');
237
- await getTxReceipt(options.rpcUrl, txHash, debugLogger, log);
238
- });
239
-
240
- program
241
- .command('get-contract-data')
242
- .description('Gets information about the Aztec contract deployed at the specified address.')
243
- .argument('<contractAddress>', 'Aztec address of the contract.', parseAztecAddress)
244
- .addOption(pxeOption)
245
- .option('-b, --include-bytecode <boolean>', "Include the contract's public function bytecode, if any.", false)
246
- .action(async (contractAddress, options) => {
247
- const { getContractData } = await import('./cmds/get_contract_data.js');
248
- await getContractData(options.rpcUrl, contractAddress, options.includeBytecode, debugLogger, log);
249
- });
250
-
251
- program
252
- .command('get-logs')
253
- .description('Gets all the unencrypted logs from an intersection of all the filter params.')
254
- .option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash)
255
- .option(
256
- '-fb, --from-block <blockNum>',
257
- 'Initial block number for getting logs (defaults to 1).',
258
- parseOptionalInteger,
259
- )
260
- .option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger)
261
- .option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId)
262
- .option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress)
263
- .option('-s, --selector <hex string>', 'Event selector to filter logs by.', parseOptionalSelector)
264
- .addOption(pxeOption)
265
- .option('--follow', 'If set, will keep polling for new logs until interrupted.')
266
- .action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, selector, rpcUrl, follow }) => {
267
- const { getLogs } = await import('./cmds/get_logs.js');
268
- await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, selector, rpcUrl, follow, debugLogger, log);
269
- });
270
-
271
- program
272
- .command('register-recipient')
273
- .description('Register a recipient in the PXE.')
274
- .requiredOption('-a, --address <aztecAddress>', "The account's Aztec address.", parseAztecAddress)
275
- .requiredOption('-p, --public-key <publicKey>', 'The account public key.', parsePublicKey)
276
- .requiredOption(
277
- '-pa, --partial-address <partialAddress>',
278
- 'The partially computed address of the account contract.',
279
- parsePartialAddress,
280
- )
281
- .addOption(pxeOption)
282
- .action(async ({ address, publicKey, partialAddress, rpcUrl }) => {
283
- const { registerRecipient } = await import('./cmds/register_recipient.js');
284
- await registerRecipient(address, publicKey, partialAddress, rpcUrl, debugLogger, log);
285
- });
286
-
287
- program
288
- .command('get-accounts')
289
- .description('Gets all the Aztec accounts stored in the PXE.')
290
- .addOption(pxeOption)
291
- .action(async (options: any) => {
292
- const { getAccounts } = await import('./cmds/get_accounts.js');
293
- await getAccounts(options.rpcUrl, debugLogger, log);
294
- });
295
-
296
- program
297
- .command('get-account')
298
- .description('Gets an account given its Aztec address.')
299
- .argument('<address>', 'The Aztec address to get account for', parseAztecAddress)
300
- .addOption(pxeOption)
301
- .action(async (address, options) => {
302
- const { getAccount } = await import('./cmds/get_account.js');
303
- await getAccount(address, options.rpcUrl, debugLogger, log);
304
- });
305
-
306
- program
307
- .command('get-recipients')
308
- .description('Gets all the recipients stored in the PXE.')
309
- .addOption(pxeOption)
310
- .action(async (options: any) => {
311
- const { getRecipients } = await import('./cmds/get_recipients.js');
312
- await getRecipients(options.rpcUrl, debugLogger, log);
313
- });
314
-
315
- program
316
- .command('get-recipient')
317
- .description('Gets a recipient given its Aztec address.')
318
- .argument('<address>', 'The Aztec address to get recipient for', parseAztecAddress)
319
- .addOption(pxeOption)
320
- .action(async (address, options) => {
321
- const { getRecipient } = await import('./cmds/get_recipient.js');
322
- await getRecipient(address, options.rpcUrl, debugLogger, log);
323
- });
324
-
325
- program
326
- .command('send')
327
- .description('Calls a function on an Aztec contract.')
328
- .argument('<functionName>', 'Name of function to execute')
329
- .option('-a, --args [functionArgs...]', 'Function arguments', [])
330
- .requiredOption(
331
- '-c, --contract-artifact <fileLocation>',
332
- "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts",
333
- )
334
- .requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
335
- .addOption(createPrivateKeyOption("The sender's private key.", true))
336
- .addOption(pxeOption)
337
- .option('--no-wait', 'Print transaction hash without waiting for it to be mined')
338
- .action(async (functionName, options) => {
339
- const { send } = await import('./cmds/send.js');
340
- await send(
341
- functionName,
342
- options.args,
343
- options.contractArtifact,
344
- options.contractAddress,
345
- options.privateKey,
346
- options.rpcUrl,
347
- !options.noWait,
348
- debugLogger,
349
- log,
350
- );
351
- });
352
-
353
- program
354
- .command('call')
355
- .description(
356
- 'Simulates the execution of a view (read-only) function on a deployed contract, without modifying state.',
357
- )
358
- .argument('<functionName>', 'Name of function to call')
359
- .option('-a, --args [functionArgs...]', 'Function arguments', [])
360
- .requiredOption(
361
- '-c, --contract-artifact <fileLocation>',
362
- "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts",
363
- )
364
- .requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress)
365
- .option('-f, --from <string>', 'Aztec address of the caller. If empty, will use the first account from RPC.')
366
- .addOption(pxeOption)
367
- .action(async (functionName, options) => {
368
- const { call } = await import('./cmds/call.js');
369
- await call(
370
- functionName,
371
- options.args,
372
- options.contractArtifact,
373
- options.contractAddress,
374
- options.from,
375
- options.rpcUrl,
376
- debugLogger,
377
- log,
378
- );
379
- });
380
-
381
- program
382
- .command('add-note')
383
- .description('Adds a note to the database in the PXE.')
384
- .argument('<address>', 'The Aztec address of the note owner.', parseAztecAddress)
385
- .argument('<contractAddress>', 'Aztec address of the contract.', parseAztecAddress)
386
- .argument('<storageSlot>', 'The storage slot of the note.', parseField)
387
- .argument('<txHash>', 'The tx hash of the tx containing the note.', parseTxHash)
388
- .requiredOption('-n, --note [note...]', 'The members of a Note serialized as hex strings.', [])
389
- .addOption(pxeOption)
390
- .action(async (address, contractAddress, storageSlot, txHash, options) => {
391
- const { addNote } = await import('./cmds/add_note.js');
392
- await addNote(address, contractAddress, storageSlot, txHash, options.note, options.rpcUrl, debugLogger);
393
- });
394
-
395
- // Helper for users to decode hex strings into structs if needed.
396
- program
397
- .command('parse-parameter-struct')
398
- .description("Helper for parsing an encoded string into a contract's parameter struct.")
399
- .argument('<encodedString>', 'The encoded hex string')
400
- .requiredOption(
401
- '-c, --contract-artifact <fileLocation>',
402
- "A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts",
403
- )
404
- .requiredOption('-p, --parameter <parameterName>', 'The name of the struct parameter to decode into')
405
- .action(async (encodedString, options) => {
406
- const { parseParameterStruct } = await import('./cmds/parse_parameter_struct.js');
407
- await parseParameterStruct(encodedString, options.contractArtifact, options.parameter, log);
408
- });
409
-
410
- program
411
- .command('block-number')
412
- .description('Gets the current Aztec L2 block number.')
413
- .addOption(pxeOption)
414
- .action(async (options: any) => {
415
- const { blockNumber } = await import('./cmds/block_number.js');
416
- await blockNumber(options.rpcUrl, debugLogger, log);
417
- });
418
-
419
- program
420
- .command('example-contracts')
421
- .description('Lists the example contracts available to deploy from @aztec/noir-contracts')
422
- .action(async () => {
423
- const { exampleContracts } = await import('./cmds/example_contracts.js');
424
- await exampleContracts(log);
425
- });
426
-
427
- program
428
- .command('unbox')
429
- .description(
430
- 'Unboxes an example contract from @aztec/boxes. Also Copies `noir-libs` dependencies and setup simple frontend for the contract using its ABI.',
431
- )
432
- .argument('<contractName>', 'Name of the contract to unbox, e.g. "PrivateToken"')
433
- .argument(
434
- '[localDirectory]',
435
- 'Local directory to unbox source folder to (relative or absolute), optional - defaults to `<contractName>/`',
436
- )
437
- .action(async (contractName, localDirectory) => {
438
- const { unbox } = await import('./cmds/unbox.js');
439
- await unbox(contractName, localDirectory, cliVersion, log);
440
- });
441
-
442
- program
443
- .command('get-node-info')
444
- .description('Gets the information of an aztec node at a URL.')
445
- .addOption(pxeOption)
446
- .action(async options => {
447
- const { getNodeInfo } = await import('./cmds/get_node_info.js');
448
- await getNodeInfo(options.rpcUrl, debugLogger, log);
449
- });
450
-
451
- program
452
- .command('inspect-contract')
453
- .description('Shows list of external callable functions for a contract')
454
- .argument(
455
- '<contractArtifactFile>',
456
- `A compiled Noir contract's artifact in JSON format or name of a contract artifact exported by @aztec/noir-contracts`,
457
- )
458
- .action(async (contractArtifactFile: string) => {
459
- const { inspectContract } = await import('./cmds/inspect_contract.js');
460
- await inspectContract(contractArtifactFile, debugLogger, log);
461
- });
462
-
463
- program
464
- .command('compute-selector')
465
- .description('Given a function signature, it computes a selector')
466
- .argument('<functionSignature>', 'Function signature to compute selector for e.g. foo(Field)')
467
- .action(async (functionSignature: string) => {
468
- const { computeSelector } = await import('./cmds/compute_selector.js');
469
- computeSelector(functionSignature, log);
470
- });
471
-
472
- program
473
- .command('update')
474
- .description('Updates Nodejs and Noir dependencies')
475
- .argument('[projectPath]', 'Path to the project directory', process.cwd())
476
- .option('--contract [paths...]', 'Paths to contracts to update dependencies', [])
477
- .option('--sandbox-version <semver>', 'The sandbox version to update to. Defaults to latest', 'latest')
478
- .addOption(pxeOption)
479
- .action(async (projectPath: string, options) => {
480
- const { update } = await import('./update/update.js');
481
- await update(projectPath, options.contract, options.rpcUrl, options.sandboxVersion, log, debugLogger);
482
- });
483
-
484
- addNoirCompilerCommanderActions(program, log);
485
-
486
- return program;
487
- }
package/src/test/mocks.ts DELETED
@@ -1,65 +0,0 @@
1
- import { ABIParameterVisibility, ContractArtifact, FunctionType } from '@aztec/foundation/abi';
2
-
3
- export const mockContractArtifact: ContractArtifact = {
4
- name: 'MockContract',
5
- functions: [
6
- {
7
- name: 'constructor',
8
- functionType: FunctionType.SECRET,
9
- isInternal: false,
10
- parameters: [
11
- {
12
- name: 'constructorParam1',
13
- type: {
14
- kind: 'field',
15
- },
16
- visibility: ABIParameterVisibility.SECRET,
17
- },
18
- ],
19
- returnTypes: [],
20
- bytecode: 'constructorBytecode',
21
- },
22
- {
23
- name: 'mockFunction',
24
- functionType: FunctionType.SECRET,
25
- isInternal: false,
26
- parameters: [
27
- {
28
- name: 'fieldParam',
29
- type: { kind: 'field' },
30
- visibility: ABIParameterVisibility.SECRET,
31
- },
32
- {
33
- name: 'boolParam',
34
- type: { kind: 'boolean' },
35
- visibility: ABIParameterVisibility.SECRET,
36
- },
37
- {
38
- name: 'integerParam',
39
- type: { kind: 'integer', sign: 'signed', width: 32 },
40
- visibility: ABIParameterVisibility.SECRET,
41
- },
42
- {
43
- name: 'arrayParam',
44
- type: { kind: 'array', length: 3, type: { kind: 'field' } },
45
- visibility: ABIParameterVisibility.SECRET,
46
- },
47
- {
48
- name: 'structParam',
49
- type: {
50
- kind: 'struct',
51
- path: 'mystruct',
52
- fields: [
53
- { name: 'subField1', type: { kind: 'field' } },
54
- { name: 'subField2', type: { kind: 'boolean' } },
55
- ],
56
- },
57
- visibility: ABIParameterVisibility.SECRET,
58
- },
59
- ],
60
- returnTypes: [{ kind: 'boolean' }],
61
- bytecode: 'mockBytecode',
62
- },
63
- ],
64
- events: [],
65
- };