@aztec/cli-wallet 0.0.0-test.1 → 0.0.1-commit.023c3e5

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 (111) hide show
  1. package/README.md +30 -0
  2. package/dest/bin/index.d.ts +2 -1
  3. package/dest/bin/index.js +58 -26
  4. package/dest/cmds/authorize_action.d.ts +4 -3
  5. package/dest/cmds/authorize_action.d.ts.map +1 -1
  6. package/dest/cmds/authorize_action.js +11 -5
  7. package/dest/cmds/bridge_fee_juice.d.ts +4 -4
  8. package/dest/cmds/bridge_fee_juice.d.ts.map +1 -1
  9. package/dest/cmds/bridge_fee_juice.js +10 -8
  10. package/dest/cmds/check_tx.d.ts +5 -3
  11. package/dest/cmds/check_tx.d.ts.map +1 -1
  12. package/dest/cmds/check_tx.js +147 -6
  13. package/dest/cmds/create_account.d.ts +9 -7
  14. package/dest/cmds/create_account.d.ts.map +1 -1
  15. package/dest/cmds/create_account.js +61 -36
  16. package/dest/cmds/create_authwit.d.ts +4 -3
  17. package/dest/cmds/create_authwit.d.ts.map +1 -1
  18. package/dest/cmds/create_authwit.js +6 -6
  19. package/dest/cmds/deploy.d.ts +7 -4
  20. package/dest/cmds/deploy.d.ts.map +1 -1
  21. package/dest/cmds/deploy.js +98 -58
  22. package/dest/cmds/deploy_account.d.ts +6 -8
  23. package/dest/cmds/deploy_account.d.ts.map +1 -1
  24. package/dest/cmds/deploy_account.js +60 -37
  25. package/dest/cmds/import_test_accounts.d.ts +3 -3
  26. package/dest/cmds/import_test_accounts.d.ts.map +1 -1
  27. package/dest/cmds/import_test_accounts.js +6 -9
  28. package/dest/cmds/index.d.ts +3 -3
  29. package/dest/cmds/index.d.ts.map +1 -1
  30. package/dest/cmds/index.js +83 -115
  31. package/dest/cmds/profile.d.ts +8 -0
  32. package/dest/cmds/profile.d.ts.map +1 -0
  33. package/dest/cmds/profile.js +28 -0
  34. package/dest/cmds/register_contract.d.ts +7 -3
  35. package/dest/cmds/register_contract.d.ts.map +1 -1
  36. package/dest/cmds/register_contract.js +20 -7
  37. package/dest/cmds/register_sender.d.ts +4 -3
  38. package/dest/cmds/register_sender.d.ts.map +1 -1
  39. package/dest/cmds/send.d.ts +8 -9
  40. package/dest/cmds/send.d.ts.map +1 -1
  41. package/dest/cmds/send.js +51 -28
  42. package/dest/cmds/simulate.d.ts +7 -3
  43. package/dest/cmds/simulate.d.ts.map +1 -1
  44. package/dest/cmds/simulate.js +26 -20
  45. package/dest/storage/wallet_db.d.ts +7 -19
  46. package/dest/storage/wallet_db.d.ts.map +1 -1
  47. package/dest/storage/wallet_db.js +49 -55
  48. package/dest/utils/authorizations.d.ts +6 -0
  49. package/dest/utils/authorizations.d.ts.map +1 -0
  50. package/dest/utils/authorizations.js +28 -0
  51. package/dest/utils/cli_wallet_and_node_wrapper.d.ts +12 -0
  52. package/dest/utils/cli_wallet_and_node_wrapper.d.ts.map +1 -0
  53. package/dest/utils/cli_wallet_and_node_wrapper.js +25 -0
  54. package/dest/utils/constants.d.ts +4 -0
  55. package/dest/utils/constants.d.ts.map +1 -0
  56. package/dest/utils/constants.js +7 -0
  57. package/dest/utils/ecdsa.d.ts +1 -3
  58. package/dest/utils/ecdsa.d.ts.map +1 -1
  59. package/dest/utils/options/fees.d.ts +22 -28
  60. package/dest/utils/options/fees.d.ts.map +1 -1
  61. package/dest/utils/options/fees.js +86 -145
  62. package/dest/utils/options/index.d.ts +1 -1
  63. package/dest/utils/options/options.d.ts +9 -5
  64. package/dest/utils/options/options.d.ts.map +1 -1
  65. package/dest/utils/options/options.js +26 -14
  66. package/dest/utils/profiling.d.ts +5 -0
  67. package/dest/utils/profiling.d.ts.map +1 -0
  68. package/dest/utils/profiling.js +68 -0
  69. package/dest/utils/wallet.d.ts +35 -0
  70. package/dest/utils/wallet.d.ts.map +1 -0
  71. package/dest/utils/wallet.js +204 -0
  72. package/package.json +29 -22
  73. package/src/bin/index.ts +63 -33
  74. package/src/cmds/authorize_action.ts +16 -5
  75. package/src/cmds/bridge_fee_juice.ts +16 -12
  76. package/src/cmds/check_tx.ts +180 -5
  77. package/src/cmds/create_account.ts +72 -42
  78. package/src/cmds/create_authwit.ts +9 -5
  79. package/src/cmds/deploy.ts +103 -67
  80. package/src/cmds/deploy_account.ts +72 -37
  81. package/src/cmds/import_test_accounts.ts +7 -11
  82. package/src/cmds/index.ts +256 -220
  83. package/src/cmds/profile.ts +48 -0
  84. package/src/cmds/register_contract.ts +28 -5
  85. package/src/cmds/register_sender.ts +3 -2
  86. package/src/cmds/send.ts +51 -25
  87. package/src/cmds/simulate.ts +37 -24
  88. package/src/storage/wallet_db.ts +53 -68
  89. package/src/utils/authorizations.ts +51 -0
  90. package/src/utils/cli_wallet_and_node_wrapper.ts +35 -0
  91. package/src/utils/constants.ts +4 -0
  92. package/src/utils/options/fees.ts +136 -207
  93. package/src/utils/options/options.ts +41 -19
  94. package/src/utils/profiling.ts +172 -0
  95. package/src/utils/wallet.ts +283 -0
  96. package/dest/cmds/add_authwit.d.ts +0 -4
  97. package/dest/cmds/add_authwit.d.ts.map +0 -1
  98. package/dest/cmds/add_authwit.js +0 -4
  99. package/dest/cmds/cancel_tx.d.ts +0 -11
  100. package/dest/cmds/cancel_tx.d.ts.map +0 -1
  101. package/dest/cmds/cancel_tx.js +0 -38
  102. package/dest/utils/accounts.d.ts +0 -11
  103. package/dest/utils/accounts.d.ts.map +0 -1
  104. package/dest/utils/accounts.js +0 -87
  105. package/dest/utils/pxe_wrapper.d.ts +0 -10
  106. package/dest/utils/pxe_wrapper.d.ts.map +0 -1
  107. package/dest/utils/pxe_wrapper.js +0 -21
  108. package/src/cmds/add_authwit.ts +0 -13
  109. package/src/cmds/cancel_tx.ts +0 -62
  110. package/src/utils/accounts.ts +0 -102
  111. package/src/utils/pxe_wrapper.ts +0 -26
@@ -1,4 +1,8 @@
1
- import { type AccountWalletWithSecretKey, type AztecAddress } from '@aztec/aztec.js';
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { AuthWitness } from '@aztec/aztec.js/authorization';
3
+ import type { AztecNode } from '@aztec/aztec.js/node';
2
4
  import type { LogFn } from '@aztec/foundation/log';
3
- export declare function simulate(wallet: AccountWalletWithSecretKey, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, profile: boolean, log: LogFn): Promise<void>;
4
- //# sourceMappingURL=simulate.d.ts.map
5
+ import type { CLIFeeArgs } from '../utils/options/fees.js';
6
+ import type { CLIWallet } from '../utils/wallet.js';
7
+ export declare function simulate(wallet: CLIWallet, node: AztecNode, from: AztecAddress, functionName: string, functionArgsIn: any[], contractArtifactPath: string, contractAddress: AztecAddress, feeOpts: CLIFeeArgs, authWitnesses: AuthWitness[], verbose: boolean, log: LogFn): Promise<void>;
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ltdWxhdGUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbWRzL3NpbXVsYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUU1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUtuRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUzRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVwRCx3QkFBc0IsUUFBUSxDQUM1QixNQUFNLEVBQUUsU0FBUyxFQUNqQixJQUFJLEVBQUUsU0FBUyxFQUNmLElBQUksRUFBRSxZQUFZLEVBQ2xCLFlBQVksRUFBRSxNQUFNLEVBQ3BCLGNBQWMsRUFBRSxHQUFHLEVBQUUsRUFDckIsb0JBQW9CLEVBQUUsTUFBTSxFQUM1QixlQUFlLEVBQUUsWUFBWSxFQUM3QixPQUFPLEVBQUUsVUFBVSxFQUNuQixhQUFhLEVBQUUsV0FBVyxFQUFFLEVBQzVCLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLEdBQUcsRUFBRSxLQUFLLGlCQTZCWCJ9
@@ -1 +1 @@
1
- {"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,YAAY,EAAgC,MAAM,iBAAiB,CAAC;AAEnH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAkBnD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,iBAcX"}
1
+ {"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,iBA6BX"}
@@ -1,26 +1,32 @@
1
- import { Contract } from '@aztec/aztec.js';
1
+ import { Contract } from '@aztec/aztec.js/contracts';
2
2
  import { prepTx } from '@aztec/cli/utils';
3
3
  import { format } from 'util';
4
- function printProfileResult(result, log) {
5
- log(format('\nSimulation result:'));
6
- log(format('Return value:', JSON.stringify(result.returnValues, null, 2)));
7
- log(format('\nGate count per circuit:'));
8
- let acc = 0;
9
- result.gateCounts.forEach((r)=>{
10
- acc += r.gateCount;
11
- log(format(' ', r.circuitName.padEnd(50), 'Gates:', r.gateCount.toLocaleString(), '\tAcc:', acc.toLocaleString()));
12
- });
13
- log(format('\nTotal gates:', acc.toLocaleString()));
14
- }
15
- export async function simulate(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, profile, log) {
4
+ import { printAuthorizations } from '../utils/authorizations.js';
5
+ import { printProfileResult } from '../utils/profiling.js';
6
+ export async function simulate(wallet, node, from, functionName, functionArgsIn, contractArtifactPath, contractAddress, feeOpts, authWitnesses, verbose, log) {
16
7
  const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
17
- const contract = await Contract.at(contractAddress, contractArtifact, wallet);
8
+ const contract = Contract.at(contractAddress, contractArtifact, wallet);
18
9
  const call = contract.methods[functionName](...functionArgs);
19
- if (profile) {
20
- const result = await call.simulateWithProfile();
21
- printProfileResult(result, log);
22
- } else {
23
- const result = await call.simulate();
24
- log(format('\nSimulation result: ', result, '\n'));
10
+ const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(node, wallet, from);
11
+ const simulationResult = await call.simulate({
12
+ fee: {
13
+ paymentMethod,
14
+ gasSettings
15
+ },
16
+ from,
17
+ authWitnesses,
18
+ includeMetadata: true
19
+ });
20
+ if (verbose) {
21
+ await printAuthorizations(simulationResult.offchainEffects, async (address)=>{
22
+ const metadata = await wallet.getContractMetadata(address);
23
+ if (!metadata.instance) {
24
+ return undefined;
25
+ }
26
+ const artifact = await wallet.getContractArtifact(metadata.instance.currentContractClassId);
27
+ return artifact;
28
+ }, log);
29
+ printProfileResult(simulationResult.stats, log);
25
30
  }
31
+ log(format('\nSimulation result: ', simulationResult.result, '\n'));
26
32
  }
@@ -1,13 +1,10 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
2
  import type { LogFn } from '@aztec/foundation/log';
5
3
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
6
4
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
7
5
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
8
- import { GasSettings } from '@aztec/stdlib/gas';
9
6
  import type { TxHash } from '@aztec/stdlib/tx';
10
- import type { AccountType } from '../utils/accounts.js';
7
+ import type { AccountType } from '../utils/constants.js';
11
8
  export declare const Aliases: readonly ["accounts", "contracts", "artifacts", "secrets", "transactions", "authwits"];
12
9
  export type AliasType = (typeof Aliases)[number];
13
10
  export declare class WalletDB {
@@ -23,7 +20,7 @@ export declare class WalletDB {
23
20
  secret: string;
24
21
  leafIndex: bigint;
25
22
  }>;
26
- storeAccount(address: AztecAddress, { type, secretKey, salt, alias, publicKey, }: {
23
+ storeAccount(address: AztecAddress, { type, secretKey, salt, alias, publicKey }: {
27
24
  type: AccountType;
28
25
  secretKey: Fr;
29
26
  salt: Fr;
@@ -33,18 +30,9 @@ export declare class WalletDB {
33
30
  storeSender(address: AztecAddress, alias: string, log: LogFn): Promise<void>;
34
31
  storeContract(address: AztecAddress, artifactPath: string, log: LogFn, alias?: string): Promise<void>;
35
32
  storeAuthwitness(authWit: AuthWitness, log: LogFn, alias?: string): Promise<void>;
36
- storeTx({ txHash, nonce, cancellable, gasSettings, }: {
33
+ storeTx({ txHash }: {
37
34
  txHash: TxHash;
38
- nonce: Fr;
39
- cancellable: boolean;
40
- gasSettings: GasSettings;
41
35
  }, log: LogFn, alias?: string): Promise<void>;
42
- retrieveTxData(txHash: TxHash): Promise<{
43
- txHash: TxHash;
44
- nonce: Fr;
45
- cancellable: boolean;
46
- gasSettings: GasSettings;
47
- }>;
48
36
  tryRetrieveAlias(arg: string): string;
49
37
  retrieveAliasFromCache(arg: string): string;
50
38
  retrieveAlias(arg: string): Promise<string>;
@@ -53,13 +41,13 @@ export declare class WalletDB {
53
41
  value: string;
54
42
  }[]>;
55
43
  storeAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string, metadata: Buffer): Promise<void>;
56
- retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer>;
44
+ retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer<ArrayBufferLike>>;
57
45
  retrieveAccount(address: AztecAddress | string): Promise<{
58
46
  address: string | AztecAddress;
59
47
  secretKey: Fr;
60
48
  salt: Fr;
61
- type: "schnorr" | "ecdsasecp256r1ssh" | "ecdsasecp256k1";
49
+ type: "ecdsasecp256k1" | "ecdsasecp256r1" | "ecdsasecp256r1ssh" | "schnorr";
62
50
  }>;
63
51
  storeAlias(type: AliasType, key: string, value: Buffer, log: LogFn): Promise<void>;
64
52
  }
65
- //# sourceMappingURL=wallet_db.d.ts.map
53
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0X2RiLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc3RvcmFnZS93YWxsZXRfZGIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5nc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,IAAI,CAAC,EAAE,SAAS;;;SAWjC;IAEK,oBAAoB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAGtG;IAEK,uBAAuB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,oCAOvF;IAEK,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;;;;;OASnD;IAEK,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAMvE;CACF"}
@@ -1,5 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { GasSettings } from '@aztec/stdlib/gas';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
2
  import { extractECDSAPublicKeyFromBase64String } from '../utils/ecdsa.js';
4
3
  export const Aliases = [
5
4
  'accounts',
@@ -10,10 +9,10 @@ export const Aliases = [
10
9
  'authwits'
11
10
  ];
12
11
  export class WalletDB {
12
+ #store;
13
13
  #accounts;
14
14
  #aliases;
15
15
  #bridgedFeeJuice;
16
- #transactions;
17
16
  static instance;
18
17
  aliasCache = new Map();
19
18
  static getInstance() {
@@ -23,10 +22,10 @@ export class WalletDB {
23
22
  return WalletDB.instance;
24
23
  }
25
24
  async init(store) {
25
+ this.#store = store;
26
26
  this.#accounts = store.openMap('accounts');
27
27
  this.#aliases = store.openMap('aliases');
28
28
  this.#bridgedFeeJuice = store.openMap('bridgedFeeJuice');
29
- this.#transactions = store.openMap('transactions');
30
29
  await this.refreshAliasCache();
31
30
  }
32
31
  async refreshAliasCache() {
@@ -36,13 +35,15 @@ export class WalletDB {
36
35
  ]));
37
36
  }
38
37
  async pushBridgedFeeJuice(recipient, secret, amount, leafIndex, log) {
39
- let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
40
- stackPointer++;
41
- await this.#bridgedFeeJuice.set(`${recipient.toString()}:${stackPointer}`, Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`));
42
- await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([
43
- stackPointer
44
- ]));
45
- log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
38
+ await this.#store.transactionAsync(async ()=>{
39
+ let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
40
+ stackPointer++;
41
+ await this.#bridgedFeeJuice.set(`${recipient.toString()}:${stackPointer}`, Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`));
42
+ await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([
43
+ stackPointer
44
+ ]));
45
+ log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
46
+ });
46
47
  }
47
48
  async popBridgedFeeJuice(recipient, log) {
48
49
  let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
@@ -62,17 +63,22 @@ export class WalletDB {
62
63
  };
63
64
  }
64
65
  async storeAccount(address, { type, secretKey, salt, alias, publicKey }, log) {
65
- if (alias) {
66
- await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
67
- }
68
- await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
69
- await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
70
- await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
66
+ let publicSigningKey;
71
67
  if (type === 'ecdsasecp256r1ssh' && publicKey) {
72
- const publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
73
- await this.storeAccountMetadata(address, 'publicSigningKey', publicSigningKey);
68
+ publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
74
69
  }
75
- await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
70
+ await this.#store.transactionAsync(async ()=>{
71
+ if (alias) {
72
+ await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
73
+ }
74
+ await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
75
+ await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
76
+ await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
77
+ if (publicSigningKey) {
78
+ await this.#accounts.set(`${address.toString()}:publicSigningKey`, publicSigningKey);
79
+ }
80
+ await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
81
+ });
76
82
  log(`Account stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
77
83
  await this.refreshAliasCache();
78
84
  }
@@ -82,54 +88,42 @@ export class WalletDB {
82
88
  await this.refreshAliasCache();
83
89
  }
84
90
  async storeContract(address, artifactPath, log, alias) {
85
- if (alias) {
86
- await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
87
- await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
88
- }
89
- await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
90
- await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
91
- await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
91
+ await this.#store.transactionAsync(async ()=>{
92
+ if (alias) {
93
+ await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
94
+ await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
95
+ }
96
+ await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
97
+ await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
98
+ await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
99
+ });
92
100
  log(`Contract stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
93
101
  await this.refreshAliasCache();
94
102
  }
95
103
  async storeAuthwitness(authWit, log, alias) {
96
- if (alias) {
97
- await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
98
- }
99
- await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
104
+ await this.#store.transactionAsync(async ()=>{
105
+ if (alias) {
106
+ await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
107
+ }
108
+ await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
109
+ });
100
110
  log(`Authorization witness stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
101
111
  await this.refreshAliasCache();
102
112
  }
103
- async storeTx({ txHash, nonce, cancellable, gasSettings }, log, alias) {
104
- if (alias) {
105
- await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
106
- }
107
- await this.#transactions.set(`${txHash.toString()}:nonce`, nonce.toBuffer());
108
- await this.#transactions.set(`${txHash.toString()}:cancellable`, Buffer.from(cancellable ? 'true' : 'false'));
109
- await this.#transactions.set(`${txHash.toString()}:gasSettings`, gasSettings.toBuffer());
110
- await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
113
+ async storeTx({ txHash }, log, alias) {
114
+ await this.#store.transactionAsync(async ()=>{
115
+ if (alias) {
116
+ await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
117
+ }
118
+ await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
119
+ });
111
120
  log(`Transaction hash stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
112
121
  await this.refreshAliasCache();
113
122
  }
114
- async retrieveTxData(txHash) {
115
- const nonceBuffer = await this.#transactions.getAsync(`${txHash.toString()}:nonce`);
116
- if (!nonceBuffer) {
117
- throw new Error(`Could not find ${txHash.toString()}:nonce. Transaction with hash "${txHash.toString()}" does not exist on this wallet.`);
118
- }
119
- const nonce = Fr.fromBuffer(nonceBuffer);
120
- const cancellable = (await this.#transactions.getAsync(`${txHash.toString()}:cancellable`)).toString() === 'true';
121
- const gasBuffer = await this.#transactions.getAsync(`${txHash.toString()}:gasSettings`);
122
- return {
123
- txHash,
124
- nonce,
125
- cancellable,
126
- gasSettings: GasSettings.fromBuffer(gasBuffer)
127
- };
128
- }
129
123
  tryRetrieveAlias(arg) {
130
124
  try {
131
125
  return this.retrieveAliasFromCache(arg);
132
- } catch (e) {
126
+ } catch {
133
127
  return arg;
134
128
  }
135
129
  }
@@ -0,0 +1,6 @@
1
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
2
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
3
+ import type { LogFn } from '@aztec/foundation/log';
4
+ import type { OffchainEffect } from '@aztec/stdlib/tx';
5
+ export declare function printAuthorizations(offchainEffects: OffchainEffect[], artifactRetriever: (address: AztecAddress) => Promise<ContractArtifact | undefined>, log: LogFn): Promise<void>;
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbnMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9hdXRob3JpemF0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRTlELE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRW5ELE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSXZELHdCQUFzQixtQkFBbUIsQ0FDdkMsZUFBZSxFQUFFLGNBQWMsRUFBRSxFQUNqQyxpQkFBaUIsRUFBRSxDQUFDLE9BQU8sRUFBRSxZQUFZLEtBQUssT0FBTyxDQUFDLGdCQUFnQixHQUFHLFNBQVMsQ0FBQyxFQUNuRixHQUFHLEVBQUUsS0FBSyxpQkFzQ1gifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorizations.d.ts","sourceRoot":"","sources":["../../src/utils/authorizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,cAAc,EAAE,EACjC,iBAAiB,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,EACnF,GAAG,EAAE,KAAK,iBAsCX"}
@@ -0,0 +1,28 @@
1
+ import { CallAuthorizationRequest } from '@aztec/aztec.js/authorization';
2
+ import { decodeFromAbi, getFunctionArtifact } from '@aztec/stdlib/abi';
3
+ import { format } from 'util';
4
+ export async function printAuthorizations(offchainEffects, artifactRetriever, log) {
5
+ log(format('\nAuthorizations requested by the tx:\n'));
6
+ const callAuthorizationSelector = await CallAuthorizationRequest.getSelector();
7
+ const callAuthorizationEffects = offchainEffects.filter((effect)=>effect.data[0].equals(callAuthorizationSelector.toField()));
8
+ for (const callAuthorizationEffect of callAuthorizationEffects){
9
+ const callAuthorizationRequest = await CallAuthorizationRequest.fromFields(callAuthorizationEffect.data);
10
+ const artifact = await artifactRetriever(callAuthorizationEffect.contractAddress);
11
+ if (!artifact) {
12
+ log(format(' -', `Call authorization. Inner hash: ${callAuthorizationRequest.innerHash.toString()}\n`));
13
+ log(format(' ', `Contract: unknown@${callAuthorizationEffect.contractAddress}`));
14
+ log(format(' ', `${callAuthorizationRequest.functionSelector.toString()}(\n${callAuthorizationRequest.args.map((arg)=>` ${arg.toString()}`).join(',\n')}\n )`));
15
+ } else {
16
+ const functionAbi = await getFunctionArtifact(artifact, callAuthorizationRequest.functionSelector);
17
+ const callData = decodeFromAbi(functionAbi.parameters.map((param)=>param.type), callAuthorizationRequest.args);
18
+ const parameters = functionAbi.parameters.map((param, i)=>({
19
+ name: param.name,
20
+ value: callData[i]
21
+ }));
22
+ log(format(' -', `Call authorization. Inner hash: ${callAuthorizationRequest.innerHash.toString()}`));
23
+ log(format(' ', `Contract: ${artifact.name}@${callAuthorizationEffect.contractAddress}`));
24
+ log(format(' ', /* eslint-disable-next-line @typescript-eslint/no-base-to-string */ `${functionAbi.name}(\n${parameters.map((p)=>` ${p.name}: ${p.value}`).join(',\n')}\n )`));
25
+ }
26
+ log(`\n`);
27
+ }
28
+ }
@@ -0,0 +1,12 @@
1
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
2
+ import { CLIWallet } from './wallet.js';
3
+ export declare const DEFAULT_TX_TIMEOUT_S = 180;
4
+ export declare class CliWalletAndNodeWrapper {
5
+ private _wallet;
6
+ private _node;
7
+ constructor();
8
+ get wallet(): CLIWallet;
9
+ get node(): AztecNode;
10
+ setNodeAndWallet(node: AztecNode, wallet: CLIWallet): void;
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpX3dhbGxldF9hbmRfbm9kZV93cmFwcGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvY2xpX3dhbGxldF9hbmRfbm9kZV93cmFwcGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRWpFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFeEMsZUFBTyxNQUFNLG9CQUFvQixNQUFNLENBQUM7QUFNeEMscUJBQWEsdUJBQXVCO0lBQ2xDLE9BQU8sQ0FBQyxPQUFPLENBQXdCO0lBQ3ZDLE9BQU8sQ0FBQyxLQUFLLENBQXdCO0lBRXJDLGNBQWdCO0lBRWhCLElBQUksTUFBTSxjQUtUO0lBRUQsSUFBSSxJQUFJLElBQUksU0FBUyxDQUtwQjtJQUVELGdCQUFnQixDQUFDLElBQUksRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVMsUUFHbEQ7Q0FDRiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli_wallet_and_node_wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/cli_wallet_and_node_wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAMxC,qBAAa,uBAAuB;IAClC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,KAAK,CAAwB;IAErC,cAAgB;IAEhB,IAAI,MAAM,cAKT;IAED,IAAI,IAAI,IAAI,SAAS,CAKpB;IAED,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,QAGlD;CACF"}
@@ -0,0 +1,25 @@
1
+ export const DEFAULT_TX_TIMEOUT_S = 180;
2
+ /*
3
+ * Wrapper class for CLIWallet and AztecNode, avoids initialization issues due to closures when providing CLIWallet
4
+ * and AztecNode to injected commander.js commands
5
+ */ export class CliWalletAndNodeWrapper {
6
+ _wallet;
7
+ _node;
8
+ constructor(){}
9
+ get wallet() {
10
+ if (!this._wallet) {
11
+ throw new Error('Wallet not initialized while it should have been initialized in preSubcommand');
12
+ }
13
+ return this._wallet;
14
+ }
15
+ get node() {
16
+ if (!this._node) {
17
+ throw new Error('Node not initialized while it should have been initialized in preSubcommand');
18
+ }
19
+ return this._node;
20
+ }
21
+ setNodeAndWallet(node, wallet) {
22
+ this._node = node;
23
+ this._wallet = wallet;
24
+ }
25
+ }
@@ -0,0 +1,4 @@
1
+ export declare const MIN_FEE_PADDING = 0.5;
2
+ export declare const AccountTypes: readonly ["schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1"];
3
+ export type AccountType = (typeof AccountTypes)[number];
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSxlQUFlLE1BQU0sQ0FBQztBQUVuQyxlQUFPLE1BQU0sWUFBWSwrRUFBZ0YsQ0FBQztBQUMxRyxNQUFNLE1BQU0sV0FBVyxHQUFHLENBQUMsT0FBTyxZQUFZLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,YAAY,+EAAgF,CAAC;AAC1G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const MIN_FEE_PADDING = 0.5;
2
+ export const AccountTypes = [
3
+ 'schnorr',
4
+ 'ecdsasecp256r1',
5
+ 'ecdsasecp256r1ssh',
6
+ 'ecdsasecp256k1'
7
+ ];
@@ -1,4 +1,2 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
1
  export declare function extractECDSAPublicKeyFromBase64String(base64PublicKey: string): Buffer;
4
- //# sourceMappingURL=ecdsa.d.ts.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWNkc2EuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9lY2RzYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx3QkFBZ0IscUNBQXFDLENBQUMsZUFBZSxFQUFFLE1BQU0sR0FBRyxNQUFNLENBY3JGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":";;AAAA,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAcrF"}
1
+ {"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":"AAAA,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAcrF"}
@@ -1,41 +1,35 @@
1
- import { type AccountWallet, type DeployAccountOptions, type FeePaymentMethod, type PXE, type SendMethodOptions } from '@aztec/aztec.js';
1
+ import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
2
+ import type { AztecNode } from '@aztec/aztec.js/node';
3
+ import type { Wallet } from '@aztec/aztec.js/wallet';
2
4
  import type { LogFn } from '@aztec/foundation/log';
5
+ import type { FieldsOf } from '@aztec/foundation/types';
6
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
3
7
  import { GasFees, GasSettings } from '@aztec/stdlib/gas';
8
+ import type { FeeOptions } from '@aztec/wallet-sdk/base-wallet';
4
9
  import { Option } from 'commander';
5
10
  import type { WalletDB } from '../../storage/wallet_db.js';
6
- export type CliFeeArgs = {
11
+ export type RawCliFeeArgs = {
7
12
  estimateGasOnly: boolean;
8
13
  gasLimits?: string;
9
14
  payment?: string;
10
15
  maxFeesPerGas?: string;
11
16
  maxPriorityFeesPerGas?: string;
12
- estimateGas?: boolean;
13
17
  };
14
- export interface IFeeOpts {
15
- estimateOnly: boolean;
16
- gasSettings: GasSettings;
17
- toSendOpts(sender: AccountWallet): Promise<SendMethodOptions>;
18
- toDeployAccountOpts(sender: AccountWallet): Promise<DeployAccountOptions>;
19
- }
20
- export declare function printGasEstimates(feeOpts: IFeeOpts, gasEstimates: Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>, log: LogFn): void;
21
- export declare class FeeOpts implements IFeeOpts {
18
+ export type ParsedFeeOptions = {
19
+ paymentMethod?: FeePaymentMethod;
20
+ gasSettings?: Partial<FieldsOf<GasSettings>>;
21
+ };
22
+ export declare function getPaymentMethodOption(): Option;
23
+ export declare function parsePaymentMethod(payment: string, log: LogFn, db?: WalletDB): (wallet: Wallet, from: AztecAddress, gasSettings: GasSettings) => Promise<FeePaymentMethod | undefined>;
24
+ export declare function parseGasFees(gasFees: string): GasFees;
25
+ export declare class CLIFeeArgs {
22
26
  estimateOnly: boolean;
23
- gasSettings: GasSettings;
24
- private paymentMethodFactory;
25
- private getDeployWallet;
26
- private estimateGas;
27
- constructor(estimateOnly: boolean, gasSettings: GasSettings, paymentMethodFactory: (sender: AccountWallet) => Promise<FeePaymentMethod>, getDeployWallet: (sender: AccountWallet, paymentMethod: FeePaymentMethod) => Promise<AccountWallet | undefined>, estimateGas: boolean);
28
- toSendOpts(sender: AccountWallet): Promise<SendMethodOptions>;
29
- toDeployAccountOpts(sender: AccountWallet): Promise<DeployAccountOptions>;
30
- static paymentMethodOption(): Option;
27
+ private paymentMethod;
28
+ private gasSettings;
29
+ constructor(estimateOnly: boolean, paymentMethod: (wallet: Wallet, feePayer: AztecAddress, gasSettings: GasSettings) => Promise<FeePaymentMethod | undefined>, gasSettings: Partial<FieldsOf<GasSettings>>);
30
+ toUserFeeOptions(node: AztecNode, wallet: Wallet, from: AztecAddress): Promise<ParsedFeeOptions>;
31
+ static parse(args: RawCliFeeArgs, log: LogFn, db?: WalletDB): CLIFeeArgs;
31
32
  static getOptions(): Option[];
32
- static fromCli(args: CliFeeArgs, pxe: PXE, log: LogFn, db?: WalletDB): Promise<FeeOpts>;
33
33
  }
34
- export declare class FeeOptsWithFeePayer extends FeeOpts {
35
- static paymentMethodOption(): Option;
36
- static getOptions(): Option[];
37
- static fromCli(args: CliFeeArgs, pxe: PXE, log: LogFn, db?: WalletDB): Promise<FeeOptsWithFeePayer>;
38
- }
39
- export declare function parsePaymentMethod(payment: string, allowCustomFeePayer: boolean, log: LogFn, db?: WalletDB): (sender: AccountWallet) => Promise<FeePaymentMethod>;
40
- export declare function parseGasFees(gasFees: string): GasFees;
41
- //# sourceMappingURL=fees.d.ts.map
34
+ export declare function printGasEstimates(feeOpts: FeeOptions, gasEstimates: Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>, log: LogFn): void;
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL29wdGlvbnMvZmVlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3RELE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRXJELE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3hELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRCxPQUFPLEVBQU8sT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRWhFLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFFbkMs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