@aztec/aztec.js 0.0.1-commit.d3ec352c → 0.0.1-commit.d431d1c

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 (155) hide show
  1. package/dest/account/account.d.ts +25 -40
  2. package/dest/account/account.d.ts.map +1 -1
  3. package/dest/account/account.js +19 -47
  4. package/dest/account/account_contract.d.ts +9 -10
  5. package/dest/account/account_contract.d.ts.map +1 -1
  6. package/dest/account/account_with_secret_key.d.ts +21 -9
  7. package/dest/account/account_with_secret_key.d.ts.map +1 -1
  8. package/dest/account/account_with_secret_key.js +21 -4
  9. package/dest/account/index.d.ts +4 -3
  10. package/dest/account/index.d.ts.map +1 -1
  11. package/dest/account/index.js +2 -0
  12. package/dest/account/signerless_account.d.ts +6 -7
  13. package/dest/account/signerless_account.d.ts.map +1 -1
  14. package/dest/account/signerless_account.js +8 -11
  15. package/dest/api/account.d.ts +2 -4
  16. package/dest/api/account.d.ts.map +1 -1
  17. package/dest/api/account.js +1 -3
  18. package/dest/api/authorization.d.ts +2 -2
  19. package/dest/api/authorization.d.ts.map +1 -1
  20. package/dest/api/authorization.js +1 -1
  21. package/dest/api/block.d.ts +2 -2
  22. package/dest/api/block.d.ts.map +1 -1
  23. package/dest/api/block.js +1 -1
  24. package/dest/api/fields.d.ts +3 -2
  25. package/dest/api/fields.d.ts.map +1 -1
  26. package/dest/api/fields.js +2 -1
  27. package/dest/api/protocol.d.ts +7 -1
  28. package/dest/api/protocol.d.ts.map +1 -1
  29. package/dest/api/protocol.js +6 -0
  30. package/dest/api/wallet.d.ts +2 -2
  31. package/dest/api/wallet.d.ts.map +1 -1
  32. package/dest/api/wallet.js +1 -1
  33. package/dest/authorization/call_authorization_request.d.ts +23 -2
  34. package/dest/authorization/call_authorization_request.d.ts.map +1 -1
  35. package/dest/contract/batch_call.d.ts +1 -1
  36. package/dest/contract/batch_call.d.ts.map +1 -1
  37. package/dest/contract/batch_call.js +3 -1
  38. package/dest/contract/contract_base.d.ts +4 -1
  39. package/dest/contract/contract_base.d.ts.map +1 -1
  40. package/dest/contract/contract_function_interaction.d.ts +1 -1
  41. package/dest/contract/deploy_method.d.ts +2 -2
  42. package/dest/contract/deploy_method.d.ts.map +1 -1
  43. package/dest/contract/deploy_method.js +6 -5
  44. package/dest/contract/protocol_contracts/auth-registry.d.ts +36 -0
  45. package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
  46. package/dest/contract/protocol_contracts/auth-registry.js +976 -0
  47. package/dest/contract/protocol_contracts/contract-class-registry.d.ts +35 -0
  48. package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
  49. package/dest/contract/protocol_contracts/contract-class-registry.js +797 -0
  50. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +31 -0
  51. package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
  52. package/dest/contract/protocol_contracts/contract-instance-registry.js +871 -0
  53. package/dest/contract/protocol_contracts/fee-juice.d.ts +30 -0
  54. package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
  55. package/dest/contract/protocol_contracts/fee-juice.js +840 -0
  56. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
  57. package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
  58. package/dest/contract/protocol_contracts/multi-call-entrypoint.js +576 -0
  59. package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
  60. package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
  61. package/dest/contract/protocol_contracts/public-checks.js +592 -0
  62. package/dest/contract/sent_tx.d.ts +2 -3
  63. package/dest/contract/sent_tx.d.ts.map +1 -1
  64. package/dest/contract/wait_for_proven.d.ts +2 -2
  65. package/dest/contract/wait_for_proven.d.ts.map +1 -1
  66. package/dest/deployment/broadcast_function.js +4 -4
  67. package/dest/deployment/publish_class.js +3 -3
  68. package/dest/deployment/publish_instance.d.ts +2 -2
  69. package/dest/deployment/publish_instance.d.ts.map +1 -1
  70. package/dest/deployment/publish_instance.js +3 -3
  71. package/dest/ethereum/portal_manager.d.ts +9 -6
  72. package/dest/ethereum/portal_manager.d.ts.map +1 -1
  73. package/dest/ethereum/portal_manager.js +17 -18
  74. package/dest/fee/fee_juice_payment_method_with_claim.js +1 -1
  75. package/dest/fee/private_fee_payment_method.js +1 -1
  76. package/dest/fee/public_fee_payment_method.js +1 -1
  77. package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
  78. package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
  79. package/dest/scripts/generate_protocol_contract_types.js +120 -0
  80. package/dest/utils/abi_types.d.ts +2 -2
  81. package/dest/utils/abi_types.d.ts.map +1 -1
  82. package/dest/utils/authwit.d.ts +4 -2
  83. package/dest/utils/authwit.d.ts.map +1 -1
  84. package/dest/utils/authwit.js +4 -4
  85. package/dest/utils/cross_chain.d.ts +2 -2
  86. package/dest/utils/cross_chain.d.ts.map +1 -1
  87. package/dest/utils/fee_juice.js +1 -1
  88. package/dest/utils/field_compressed_string.js +1 -1
  89. package/dest/utils/pub_key.d.ts +2 -2
  90. package/dest/utils/pub_key.d.ts.map +1 -1
  91. package/dest/utils/pub_key.js +1 -1
  92. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
  93. package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
  94. package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
  95. package/dest/wallet/account_manager.d.ts +6 -9
  96. package/dest/wallet/account_manager.d.ts.map +1 -1
  97. package/dest/wallet/account_manager.js +6 -12
  98. package/dest/wallet/deploy_account_method.d.ts +18 -4
  99. package/dest/wallet/deploy_account_method.d.ts.map +1 -1
  100. package/dest/wallet/deploy_account_method.js +8 -6
  101. package/dest/wallet/wallet.d.ts +242 -955
  102. package/dest/wallet/wallet.d.ts.map +1 -1
  103. package/dest/wallet/wallet.js +61 -88
  104. package/package.json +14 -12
  105. package/src/account/account.ts +34 -58
  106. package/src/account/account_contract.ts +7 -8
  107. package/src/account/account_with_secret_key.ts +34 -9
  108. package/src/account/index.ts +3 -2
  109. package/src/account/signerless_account.ts +14 -13
  110. package/src/api/account.ts +9 -3
  111. package/src/api/authorization.ts +1 -0
  112. package/src/api/block.ts +1 -1
  113. package/src/api/fields.ts +2 -1
  114. package/src/api/protocol.ts +7 -0
  115. package/src/api/wallet.ts +4 -2
  116. package/src/authorization/call_authorization_request.ts +1 -1
  117. package/src/contract/batch_call.ts +4 -2
  118. package/src/contract/deploy_method.ts +8 -7
  119. package/src/contract/protocol_contracts/auth-registry.ts +554 -0
  120. package/src/contract/protocol_contracts/contract-class-registry.ts +442 -0
  121. package/src/contract/protocol_contracts/contract-instance-registry.ts +502 -0
  122. package/src/contract/protocol_contracts/fee-juice.ts +466 -0
  123. package/src/contract/protocol_contracts/multi-call-entrypoint.ts +338 -0
  124. package/src/contract/protocol_contracts/public-checks.ts +324 -0
  125. package/src/contract/sent_tx.ts +1 -2
  126. package/src/deployment/broadcast_function.ts +4 -4
  127. package/src/deployment/publish_class.ts +3 -3
  128. package/src/deployment/publish_instance.ts +3 -6
  129. package/src/ethereum/portal_manager.ts +20 -24
  130. package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
  131. package/src/fee/private_fee_payment_method.ts +1 -1
  132. package/src/fee/public_fee_payment_method.ts +1 -1
  133. package/src/scripts/generate_protocol_contract_types.ts +150 -0
  134. package/src/utils/abi_types.ts +1 -1
  135. package/src/utils/authwit.ts +4 -4
  136. package/src/utils/cross_chain.ts +1 -1
  137. package/src/utils/fee_juice.ts +1 -1
  138. package/src/utils/field_compressed_string.ts +1 -1
  139. package/src/utils/pub_key.ts +2 -2
  140. package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
  141. package/src/wallet/account_manager.ts +6 -14
  142. package/src/wallet/deploy_account_method.ts +20 -11
  143. package/src/wallet/wallet.ts +162 -83
  144. package/dest/account/interface.d.ts +0 -19
  145. package/dest/account/interface.d.ts.map +0 -1
  146. package/dest/account/interface.js +0 -5
  147. package/dest/contract/protocol_contracts.d.ts +0 -9
  148. package/dest/contract/protocol_contracts.d.ts.map +0 -1
  149. package/dest/contract/protocol_contracts.js +0 -26
  150. package/dest/contract/unsafe_contract.d.ts +0 -15
  151. package/dest/contract/unsafe_contract.d.ts.map +0 -1
  152. package/dest/contract/unsafe_contract.js +0 -6
  153. package/src/account/interface.ts +0 -25
  154. package/src/contract/protocol_contracts.ts +0 -35
  155. package/src/contract/unsafe_contract.ts +0 -19
@@ -15,6 +15,7 @@ import {
15
15
  } from './interaction_options.js';
16
16
 
17
17
  /** A batch of function calls to be sent as a single transaction through a wallet. */
18
+ // docs:start:batch_call_class
18
19
  export class BatchCall extends BaseContractInteraction {
19
20
  constructor(
20
21
  wallet: Wallet,
@@ -22,6 +23,7 @@ export class BatchCall extends BaseContractInteraction {
22
23
  ) {
23
24
  super(wallet);
24
25
  }
26
+ // docs:end:batch_call_class
25
27
 
26
28
  /**
27
29
  * Returns an execution request that represents this operation.
@@ -74,13 +76,13 @@ export class BatchCall extends BaseContractInteraction {
74
76
  { indexedExecutionPayloads: [], utility: [], publicIndex: 0, privateIndex: 0 },
75
77
  );
76
78
 
77
- const batchRequests: Array<BatchedMethod<'simulateUtility'> | BatchedMethod<'simulateTx'>> = [];
79
+ const batchRequests: BatchedMethod[] = [];
78
80
 
79
81
  // Add utility calls to batch
80
82
  for (const [call] of utility) {
81
83
  batchRequests.push({
82
84
  name: 'simulateUtility' as const,
83
- args: [call, options?.authWitnesses] as const,
85
+ args: [call, options?.authWitnesses],
84
86
  });
85
87
  }
86
88
 
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, getInitializer } from '@aztec/stdlib/abi';
3
3
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -184,16 +184,17 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
184
184
 
185
185
  // Publish the contract class if it hasn't been published already.
186
186
  if (!options?.skipClassPublication) {
187
- if ((await this.wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
188
- this.log.debug(
189
- `Skipping publication of already-registered contract class ${contractClass.id.toString()} for ${instance.address.toString()}`,
190
- );
191
- } else {
187
+ const classMetadata = await this.wallet.getContractClassMetadata(contractClass.id);
188
+ if (!classMetadata.isContractClassPubliclyRegistered) {
192
189
  this.log.info(
193
190
  `Creating request for publishing contract class ${contractClass.id.toString()} as part of deployment for ${instance.address.toString()}`,
194
191
  );
195
192
  const registerContractClassInteraction = await publishContractClass(this.wallet, this.artifact);
196
193
  calls.push(await registerContractClassInteraction.request());
194
+ } else {
195
+ this.log.debug(
196
+ `Skipping contract class publication for ${contractClass.id.toString()} as it is already registered`,
197
+ );
197
198
  }
198
199
  }
199
200
 
@@ -202,7 +203,7 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
202
203
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/15596):
203
204
  // Read the artifact, and if there are no public functions, warn the caller that publication of the
204
205
  // contract instance is not necessary (until such time as they wish to update the instance (i.e. change its class_id)).
205
- const deploymentInteraction = await publishInstance(this.wallet, instance);
206
+ const deploymentInteraction = publishInstance(this.wallet, instance);
206
207
  calls.push(await deploymentInteraction.request());
207
208
  }
208
209
 
@@ -0,0 +1,554 @@
1
+ /* Autogenerated file, do not edit! */
2
+ /* eslint-disable */
3
+ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
4
+ import { FunctionType } from '@aztec/stdlib/abi';
5
+
6
+ import type { ContractArtifact } from '../../api/abi.js';
7
+ import { PublicKeys } from '../../api/keys.js';
8
+ import type {
9
+ AztecAddressLike,
10
+ EthAddressLike,
11
+ FieldLike,
12
+ FunctionSelectorLike,
13
+ WrappedFieldLike,
14
+ } from '../../utils/abi_types.js';
15
+ import type { Wallet } from '../../wallet/wallet.js';
16
+ import { ContractBase, type ContractMethod } from '../contract_base.js';
17
+ import { ContractFunctionInteraction } from '../contract_function_interaction.js';
18
+
19
+ const AuthRegistryContractArtifact: ContractArtifact = {
20
+ name: 'AuthRegistry',
21
+ functions: [
22
+ {
23
+ ...{
24
+ functionType: FunctionType.PRIVATE,
25
+ name: 'set_authorized_private',
26
+ isOnlySelf: false,
27
+ isStatic: false,
28
+ isInitializer: false,
29
+ parameters: [
30
+ {
31
+ name: 'approver',
32
+ type: {
33
+ kind: 'struct',
34
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
35
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
36
+ },
37
+ visibility: 'private',
38
+ },
39
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
40
+ { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
41
+ ],
42
+ returnTypes: [],
43
+ errorTypes: {
44
+ '2754040237334517471': { error_kind: 'fmtstring', length: 92, item_types: [] },
45
+ '7555607922535724711': { error_kind: 'string', string: 'Preimage mismatch' },
46
+ '9894212961085021188': { error_kind: 'string', string: 'Message not authorized by account' },
47
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
48
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
49
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
50
+ },
51
+ },
52
+ bytecode: Buffer.from([]),
53
+ debugSymbols: '',
54
+ },
55
+ {
56
+ ...{
57
+ functionType: FunctionType.UTILITY,
58
+ name: 'utility_is_consumable',
59
+ isOnlySelf: false,
60
+ isStatic: false,
61
+ isInitializer: false,
62
+ parameters: [
63
+ {
64
+ name: 'on_behalf_of',
65
+ type: {
66
+ kind: 'struct',
67
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
68
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
69
+ },
70
+ visibility: 'private',
71
+ },
72
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
73
+ ],
74
+ returnTypes: [{ kind: 'boolean' }],
75
+ errorTypes: {
76
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
77
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
78
+ '13455385521185560676': {
79
+ error_kind: 'string',
80
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
81
+ },
82
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
83
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
84
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
85
+ },
86
+ },
87
+ bytecode: Buffer.from([]),
88
+ debugSymbols: '',
89
+ },
90
+ {
91
+ ...{
92
+ functionType: FunctionType.UTILITY,
93
+ name: 'process_message',
94
+ isOnlySelf: false,
95
+ isStatic: false,
96
+ isInitializer: false,
97
+ parameters: [
98
+ {
99
+ name: 'message_ciphertext',
100
+ type: {
101
+ kind: 'struct',
102
+ fields: [
103
+ { name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
104
+ { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
105
+ ],
106
+ path: 'std::collections::bounded_vec::BoundedVec',
107
+ },
108
+ visibility: 'private',
109
+ },
110
+ {
111
+ name: 'message_context',
112
+ type: {
113
+ kind: 'struct',
114
+ fields: [
115
+ { name: 'tx_hash', type: { kind: 'field' } },
116
+ {
117
+ name: 'unique_note_hashes_in_tx',
118
+ type: {
119
+ kind: 'struct',
120
+ fields: [
121
+ { name: 'storage', type: { kind: 'array', length: 64, type: { kind: 'field' } } },
122
+ { name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
123
+ ],
124
+ path: 'std::collections::bounded_vec::BoundedVec',
125
+ },
126
+ },
127
+ { name: 'first_nullifier_in_tx', type: { kind: 'field' } },
128
+ {
129
+ name: 'recipient',
130
+ type: {
131
+ kind: 'struct',
132
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
133
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
134
+ },
135
+ },
136
+ ],
137
+ path: 'aztec::messages::processing::message_context::MessageContext',
138
+ },
139
+ visibility: 'private',
140
+ },
141
+ ],
142
+ returnTypes: [],
143
+ errorTypes: {
144
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
145
+ '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
146
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
147
+ '2967937905572420042': {
148
+ error_kind: 'fmtstring',
149
+ length: 61,
150
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
151
+ },
152
+ '3330370348214585450': {
153
+ error_kind: 'fmtstring',
154
+ length: 48,
155
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
156
+ },
157
+ '3670003311596808700': {
158
+ error_kind: 'fmtstring',
159
+ length: 77,
160
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
161
+ },
162
+ '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
163
+ '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
164
+ '9791669845391776238': {
165
+ error_kind: 'string',
166
+ string: '0 has a square root; you cannot claim it is not square',
167
+ },
168
+ '9885968605480832328': {
169
+ error_kind: 'string',
170
+ string: 'Attempted to read past the length of a CapsuleArray',
171
+ },
172
+ '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
173
+ '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
174
+ '11021520179822076911': {
175
+ error_kind: 'string',
176
+ string: 'Attempted to delete past the length of a CapsuleArray',
177
+ },
178
+ '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
179
+ '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
180
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
181
+ '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
182
+ '13557316507370296400': {
183
+ error_kind: 'fmtstring',
184
+ length: 130,
185
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
186
+ },
187
+ '14938672389828944159': {
188
+ error_kind: 'fmtstring',
189
+ length: 146,
190
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
191
+ },
192
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
193
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
194
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
195
+ '17531474008201752295': {
196
+ error_kind: 'fmtstring',
197
+ length: 133,
198
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
199
+ },
200
+ },
201
+ },
202
+ bytecode: Buffer.from([]),
203
+ debugSymbols: '',
204
+ },
205
+ {
206
+ ...{
207
+ functionType: FunctionType.PUBLIC,
208
+ name: 'public_dispatch',
209
+ isOnlySelf: false,
210
+ isStatic: false,
211
+ isInitializer: false,
212
+ parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
213
+ returnTypes: [],
214
+ errorTypes: {
215
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
216
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
217
+ '5525725861591553972': { error_kind: 'string', string: 'rejecting all' },
218
+ '11691217184967371519': {
219
+ error_kind: 'string',
220
+ string: 'Function is_reject_all can only be called statically',
221
+ },
222
+ '12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
223
+ '13455385521185560676': {
224
+ error_kind: 'string',
225
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
226
+ },
227
+ '13929691561421487185': {
228
+ error_kind: 'string',
229
+ string: 'Function _set_authorized can only be called by the same contract',
230
+ },
231
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
232
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
233
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
234
+ '17089945683942782951': { error_kind: 'string', string: 'unauthorized' },
235
+ '17312933876399746100': {
236
+ error_kind: 'string',
237
+ string: 'Function is_consumable can only be called statically',
238
+ },
239
+ },
240
+ },
241
+ bytecode: Buffer.from([]),
242
+ debugSymbols: '',
243
+ },
244
+ {
245
+ ...{
246
+ functionType: FunctionType.UTILITY,
247
+ name: 'sync_private_state',
248
+ isOnlySelf: false,
249
+ isStatic: false,
250
+ isInitializer: false,
251
+ parameters: [],
252
+ returnTypes: [],
253
+ errorTypes: {
254
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
255
+ '992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
256
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
257
+ '2967937905572420042': {
258
+ error_kind: 'fmtstring',
259
+ length: 61,
260
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
261
+ },
262
+ '3330370348214585450': {
263
+ error_kind: 'fmtstring',
264
+ length: 48,
265
+ item_types: [{ kind: 'field' }, { kind: 'field' }],
266
+ },
267
+ '3670003311596808700': {
268
+ error_kind: 'fmtstring',
269
+ length: 77,
270
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
271
+ },
272
+ '4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
273
+ '4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
274
+ '9791669845391776238': {
275
+ error_kind: 'string',
276
+ string: '0 has a square root; you cannot claim it is not square',
277
+ },
278
+ '9885968605480832328': {
279
+ error_kind: 'string',
280
+ string: 'Attempted to read past the length of a CapsuleArray',
281
+ },
282
+ '10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
283
+ '10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
284
+ '11021520179822076911': {
285
+ error_kind: 'string',
286
+ string: 'Attempted to delete past the length of a CapsuleArray',
287
+ },
288
+ '11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
289
+ '12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
290
+ '12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
291
+ '12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
292
+ '13557316507370296400': {
293
+ error_kind: 'fmtstring',
294
+ length: 130,
295
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
296
+ },
297
+ '14938672389828944159': {
298
+ error_kind: 'fmtstring',
299
+ length: 146,
300
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
301
+ },
302
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
303
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
304
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
305
+ '17531474008201752295': {
306
+ error_kind: 'fmtstring',
307
+ length: 133,
308
+ item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
309
+ },
310
+ },
311
+ },
312
+ bytecode: Buffer.from([]),
313
+ debugSymbols: '',
314
+ },
315
+ ],
316
+ nonDispatchPublicFunctions: [
317
+ {
318
+ functionType: FunctionType.PUBLIC,
319
+ name: '_set_authorized',
320
+ isOnlySelf: true,
321
+ isStatic: false,
322
+ isInitializer: false,
323
+ parameters: [
324
+ {
325
+ name: 'approver',
326
+ type: {
327
+ kind: 'struct',
328
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
329
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
330
+ },
331
+ visibility: 'private',
332
+ },
333
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
334
+ { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
335
+ ],
336
+ returnTypes: [],
337
+ errorTypes: {
338
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
339
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
340
+ '13455385521185560676': {
341
+ error_kind: 'string',
342
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
343
+ },
344
+ '13929691561421487185': {
345
+ error_kind: 'string',
346
+ string: 'Function _set_authorized can only be called by the same contract',
347
+ },
348
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
349
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
350
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
351
+ },
352
+ },
353
+ {
354
+ functionType: FunctionType.PUBLIC,
355
+ name: 'consume',
356
+ isOnlySelf: false,
357
+ isStatic: false,
358
+ isInitializer: false,
359
+ parameters: [
360
+ {
361
+ name: 'on_behalf_of',
362
+ type: {
363
+ kind: 'struct',
364
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
365
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
366
+ },
367
+ visibility: 'private',
368
+ },
369
+ { name: 'inner_hash', type: { kind: 'field' }, visibility: 'private' },
370
+ ],
371
+ returnTypes: [{ kind: 'field' }],
372
+ errorTypes: {
373
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
374
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
375
+ '5525725861591553972': { error_kind: 'string', string: 'rejecting all' },
376
+ '13455385521185560676': {
377
+ error_kind: 'string',
378
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
379
+ },
380
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
381
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
382
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
383
+ '17089945683942782951': { error_kind: 'string', string: 'unauthorized' },
384
+ },
385
+ },
386
+ {
387
+ functionType: FunctionType.PUBLIC,
388
+ name: 'is_consumable',
389
+ isOnlySelf: false,
390
+ isStatic: true,
391
+ isInitializer: false,
392
+ parameters: [
393
+ {
394
+ name: 'on_behalf_of',
395
+ type: {
396
+ kind: 'struct',
397
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
398
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
399
+ },
400
+ visibility: 'private',
401
+ },
402
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
403
+ ],
404
+ returnTypes: [{ kind: 'boolean' }],
405
+ errorTypes: {
406
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
407
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
408
+ '13455385521185560676': {
409
+ error_kind: 'string',
410
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
411
+ },
412
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
413
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
414
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
415
+ '17312933876399746100': {
416
+ error_kind: 'string',
417
+ string: 'Function is_consumable can only be called statically',
418
+ },
419
+ },
420
+ },
421
+ {
422
+ functionType: FunctionType.PUBLIC,
423
+ name: 'is_reject_all',
424
+ isOnlySelf: false,
425
+ isStatic: true,
426
+ isInitializer: false,
427
+ parameters: [
428
+ {
429
+ name: 'on_behalf_of',
430
+ type: {
431
+ kind: 'struct',
432
+ fields: [{ name: 'inner', type: { kind: 'field' } }],
433
+ path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
434
+ },
435
+ visibility: 'private',
436
+ },
437
+ ],
438
+ returnTypes: [{ kind: 'boolean' }],
439
+ errorTypes: {
440
+ '11691217184967371519': {
441
+ error_kind: 'string',
442
+ string: 'Function is_reject_all can only be called statically',
443
+ },
444
+ '13455385521185560676': {
445
+ error_kind: 'string',
446
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
447
+ },
448
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
449
+ },
450
+ },
451
+ {
452
+ functionType: FunctionType.PUBLIC,
453
+ name: 'set_authorized',
454
+ isOnlySelf: false,
455
+ isStatic: false,
456
+ isInitializer: false,
457
+ parameters: [
458
+ { name: 'message_hash', type: { kind: 'field' }, visibility: 'private' },
459
+ { name: 'authorize', type: { kind: 'boolean' }, visibility: 'private' },
460
+ ],
461
+ returnTypes: [],
462
+ errorTypes: {
463
+ '361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
464
+ '1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
465
+ '13455385521185560676': {
466
+ error_kind: 'string',
467
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
468
+ },
469
+ '14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
470
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
471
+ '16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
472
+ },
473
+ },
474
+ {
475
+ functionType: FunctionType.PUBLIC,
476
+ name: 'set_reject_all',
477
+ isOnlySelf: false,
478
+ isStatic: false,
479
+ isInitializer: false,
480
+ parameters: [{ name: 'reject', type: { kind: 'boolean' }, visibility: 'private' }],
481
+ returnTypes: [],
482
+ errorTypes: {
483
+ '13455385521185560676': {
484
+ error_kind: 'string',
485
+ string: 'Storage slot 0 not allowed. Storage slots must start from 1.',
486
+ },
487
+ '15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
488
+ },
489
+ },
490
+ ],
491
+ outputs: { structs: {}, globals: {} },
492
+ storageLayout: {},
493
+ fileMap: {},
494
+ };
495
+
496
+ export class AuthRegistryContract extends ContractBase {
497
+ private constructor(wallet: Wallet) {
498
+ super(ProtocolContractAddress.AuthRegistry, AuthRegistryContractArtifact, wallet);
499
+ }
500
+
501
+ public static at(wallet: Wallet): AuthRegistryContract {
502
+ return new AuthRegistryContract(wallet);
503
+ }
504
+
505
+ declare public methods: {
506
+ /** consume(on_behalf_of: struct, inner_hash: field) */
507
+ consume: ((on_behalf_of: AztecAddressLike, inner_hash: FieldLike) => ContractFunctionInteraction) &
508
+ Pick<ContractMethod, 'selector'>;
509
+
510
+ /** is_consumable(on_behalf_of: struct, message_hash: field) */
511
+ is_consumable: ((on_behalf_of: AztecAddressLike, message_hash: FieldLike) => ContractFunctionInteraction) &
512
+ Pick<ContractMethod, 'selector'>;
513
+
514
+ /** is_reject_all(on_behalf_of: struct) */
515
+ is_reject_all: ((on_behalf_of: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
516
+
517
+ /** process_message(message_ciphertext: struct, message_context: struct) */
518
+ process_message: ((
519
+ message_ciphertext: FieldLike[],
520
+ message_context: {
521
+ tx_hash: FieldLike;
522
+ unique_note_hashes_in_tx: FieldLike[];
523
+ first_nullifier_in_tx: FieldLike;
524
+ recipient: AztecAddressLike;
525
+ },
526
+ ) => ContractFunctionInteraction) &
527
+ Pick<ContractMethod, 'selector'>;
528
+
529
+ /** public_dispatch(selector: field) */
530
+ public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
531
+
532
+ /** set_authorized(message_hash: field, authorize: boolean) */
533
+ set_authorized: ((message_hash: FieldLike, authorize: boolean) => ContractFunctionInteraction) &
534
+ Pick<ContractMethod, 'selector'>;
535
+
536
+ /** set_authorized_private(approver: struct, message_hash: field, authorize: boolean) */
537
+ set_authorized_private: ((
538
+ approver: AztecAddressLike,
539
+ message_hash: FieldLike,
540
+ authorize: boolean,
541
+ ) => ContractFunctionInteraction) &
542
+ Pick<ContractMethod, 'selector'>;
543
+
544
+ /** set_reject_all(reject: boolean) */
545
+ set_reject_all: ((reject: boolean) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
546
+
547
+ /** sync_private_state() */
548
+ sync_private_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
549
+
550
+ /** utility_is_consumable(on_behalf_of: struct, message_hash: field) */
551
+ utility_is_consumable: ((on_behalf_of: AztecAddressLike, message_hash: FieldLike) => ContractFunctionInteraction) &
552
+ Pick<ContractMethod, 'selector'>;
553
+ };
554
+ }