@aztec-labs/aztec.js 6.0.0-nightly.20260829
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.
- package/README.md +44 -0
- package/dest/account/account.d.ts +44 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +31 -0
- package/dest/account/account_contract.d.ts +49 -0
- package/dest/account/account_contract.d.ts.map +1 -0
- package/dest/account/account_contract.js +20 -0
- package/dest/account/index.d.ts +11 -0
- package/dest/account/index.d.ts.map +1 -0
- package/dest/account/index.js +6 -0
- package/dest/api/abi.d.ts +4 -0
- package/dest/api/abi.d.ts.map +1 -0
- package/dest/api/abi.js +1 -0
- package/dest/api/account.d.ts +5 -0
- package/dest/api/account.d.ts.map +1 -0
- package/dest/api/account.js +3 -0
- package/dest/api/addresses.d.ts +4 -0
- package/dest/api/addresses.d.ts.map +1 -0
- package/dest/api/addresses.js +3 -0
- package/dest/api/authorization.d.ts +5 -0
- package/dest/api/authorization.d.ts.map +1 -0
- package/dest/api/authorization.js +4 -0
- package/dest/api/block.d.ts +3 -0
- package/dest/api/block.d.ts.map +1 -0
- package/dest/api/block.js +2 -0
- package/dest/api/contract.d.ts +48 -0
- package/dest/api/contract.d.ts.map +1 -0
- package/dest/api/contract.js +46 -0
- package/dest/api/crypto.d.ts +2 -0
- package/dest/api/crypto.d.ts.map +1 -0
- package/dest/api/crypto.js +1 -0
- package/dest/api/deployment.d.ts +4 -0
- package/dest/api/deployment.d.ts.map +1 -0
- package/dest/api/deployment.js +3 -0
- package/dest/api/eth_address.d.ts +2 -0
- package/dest/api/eth_address.d.ts.map +1 -0
- package/dest/api/eth_address.js +1 -0
- package/dest/api/ethereum.d.ts +2 -0
- package/dest/api/ethereum.d.ts.map +1 -0
- package/dest/api/ethereum.js +1 -0
- package/dest/api/event_cursor.d.ts +44 -0
- package/dest/api/event_cursor.d.ts.map +1 -0
- package/dest/api/event_cursor.js +42 -0
- package/dest/api/events.d.ts +36 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +59 -0
- package/dest/api/fee.d.ts +6 -0
- package/dest/api/fee.d.ts.map +1 -0
- package/dest/api/fee.js +4 -0
- package/dest/api/fee_testing.d.ts +2 -0
- package/dest/api/fee_testing.d.ts.map +1 -0
- package/dest/api/fee_testing.js +1 -0
- package/dest/api/fields.d.ts +4 -0
- package/dest/api/fields.d.ts.map +1 -0
- package/dest/api/fields.js +3 -0
- package/dest/api/keys.d.ts +4 -0
- package/dest/api/keys.d.ts.map +1 -0
- package/dest/api/keys.js +3 -0
- package/dest/api/log.d.ts +3 -0
- package/dest/api/log.d.ts.map +1 -0
- package/dest/api/log.js +2 -0
- package/dest/api/messaging.d.ts +3 -0
- package/dest/api/messaging.d.ts.map +1 -0
- package/dest/api/messaging.js +2 -0
- package/dest/api/node.d.ts +25 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +22 -0
- package/dest/api/note.d.ts +2 -0
- package/dest/api/note.d.ts.map +1 -0
- package/dest/api/note.js +1 -0
- package/dest/api/protocol.d.ts +6 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +5 -0
- package/dest/api/trees.d.ts +3 -0
- package/dest/api/trees.d.ts.map +1 -0
- package/dest/api/trees.js +2 -0
- package/dest/api/tx.d.ts +3 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +13 -0
- package/dest/api/utils.d.ts.map +1 -0
- package/dest/api/utils.js +12 -0
- package/dest/api/wallet.d.ts +8 -0
- package/dest/api/wallet.d.ts.map +1 -0
- package/dest/api/wallet.js +7 -0
- package/dest/authorization/call_authorization_request.d.ts +46 -0
- package/dest/authorization/call_authorization_request.d.ts.map +1 -0
- package/dest/authorization/call_authorization_request.js +72 -0
- package/dest/contract/base_contract_interaction.d.ts +32 -0
- package/dest/contract/base_contract_interaction.d.ts.map +1 -0
- package/dest/contract/base_contract_interaction.js +24 -0
- package/dest/contract/batch_call.d.ts +27 -0
- package/dest/contract/batch_call.d.ts.map +1 -0
- package/dest/contract/batch_call.js +152 -0
- package/dest/contract/checker.d.ts +11 -0
- package/dest/contract/checker.d.ts.map +1 -0
- package/dest/contract/checker.js +107 -0
- package/dest/contract/contract.d.ts +33 -0
- package/dest/contract/contract.d.ts.map +1 -0
- package/dest/contract/contract.js +36 -0
- package/dest/contract/contract_base.d.ts +51 -0
- package/dest/contract/contract_base.d.ts.map +1 -0
- package/dest/contract/contract_base.js +38 -0
- package/dest/contract/contract_function_interaction.d.ts +67 -0
- package/dest/contract/contract_function_interaction.d.ts.map +1 -0
- package/dest/contract/contract_function_interaction.js +218 -0
- package/dest/contract/deploy_method.d.ts +433 -0
- package/dest/contract/deploy_method.d.ts.map +1 -0
- package/dest/contract/deploy_method.js +471 -0
- package/dest/contract/fastforward_contract_update.d.ts +25 -0
- package/dest/contract/fastforward_contract_update.d.ts.map +1 -0
- package/dest/contract/fastforward_contract_update.js +57 -0
- package/dest/contract/interaction_options.d.ts +213 -0
- package/dest/contract/interaction_options.d.ts.map +1 -0
- package/dest/contract/interaction_options.js +87 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +18 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +137 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +25 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +366 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +24 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +383 -0
- package/dest/contract/wait_for_proven.d.ts +18 -0
- package/dest/contract/wait_for_proven.d.ts.map +1 -0
- package/dest/contract/wait_for_proven.js +17 -0
- package/dest/contract/wait_opts.d.ts +21 -0
- package/dest/contract/wait_opts.d.ts.map +1 -0
- package/dest/contract/wait_opts.js +5 -0
- package/dest/deployment/contract_deployer.d.ts +28 -0
- package/dest/deployment/contract_deployer.d.ts.map +1 -0
- package/dest/deployment/contract_deployer.js +35 -0
- package/dest/deployment/publish_class.d.ts +6 -0
- package/dest/deployment/publish_class.d.ts.map +1 -0
- package/dest/deployment/publish_class.js +17 -0
- package/dest/deployment/publish_instance.d.ts +10 -0
- package/dest/deployment/publish_instance.d.ts.map +1 -0
- package/dest/deployment/publish_instance.js +11 -0
- package/dest/ethereum/portal_manager.d.ts +146 -0
- package/dest/ethereum/portal_manager.d.ts.map +1 -0
- package/dest/ethereum/portal_manager.js +415 -0
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +23 -0
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -0
- package/dest/fee/fee_juice_payment_method_with_claim.js +46 -0
- package/dest/fee/fee_payment_method.d.ts +26 -0
- package/dest/fee/fee_payment_method.d.ts.map +1 -0
- package/dest/fee/fee_payment_method.js +3 -0
- package/dest/fee/private_fee_payment_method.d.ts +69 -0
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -0
- package/dest/fee/private_fee_payment_method.js +122 -0
- package/dest/fee/public_fee_payment_method.d.ts +59 -0
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -0
- package/dest/fee/public_fee_payment_method.js +116 -0
- package/dest/fee/sponsored_fee_payment.d.ts +17 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
- package/dest/fee/sponsored_fee_payment.js +33 -0
- package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
- package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
- package/dest/scripts/generate_protocol_contract_types.js +128 -0
- package/dest/test/fixtures.d.ts +13 -0
- package/dest/test/fixtures.d.ts.map +1 -0
- package/dest/test/fixtures.js +185 -0
- package/dest/utils/abi_types.d.ts +32 -0
- package/dest/utils/abi_types.d.ts.map +1 -0
- package/dest/utils/abi_types.js +1 -0
- package/dest/utils/authwit.d.ts +119 -0
- package/dest/utils/authwit.d.ts.map +1 -0
- package/dest/utils/authwit.js +266 -0
- package/dest/utils/cross_chain.d.ts +28 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +26 -0
- package/dest/utils/fee_juice.d.ts +8 -0
- package/dest/utils/fee_juice.d.ts.map +1 -0
- package/dest/utils/fee_juice.js +10 -0
- package/dest/utils/field_compressed_string.d.ts +17 -0
- package/dest/utils/field_compressed_string.d.ts.map +1 -0
- package/dest/utils/field_compressed_string.js +15 -0
- package/dest/utils/node.d.ts +24 -0
- package/dest/utils/node.d.ts.map +1 -0
- package/dest/utils/node.js +80 -0
- package/dest/utils/pub_key.d.ts +9 -0
- package/dest/utils/pub_key.d.ts.map +1 -0
- package/dest/utils/pub_key.js +8 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +33 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +63 -0
- package/dest/wallet/account_manager.d.ts +73 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +102 -0
- package/dest/wallet/capabilities.d.ts +456 -0
- package/dest/wallet/capabilities.d.ts.map +1 -0
- package/dest/wallet/capabilities.js +3 -0
- package/dest/wallet/deploy_account_method.d.ts +97 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +127 -0
- package/dest/wallet/index.d.ts +5 -0
- package/dest/wallet/index.d.ts.map +1 -0
- package/dest/wallet/index.js +4 -0
- package/dest/wallet/tx_simulation_result_with_app_offset.d.ts +40 -0
- package/dest/wallet/tx_simulation_result_with_app_offset.d.ts.map +1 -0
- package/dest/wallet/tx_simulation_result_with_app_offset.js +65 -0
- package/dest/wallet/wallet.d.ts +1451 -0
- package/dest/wallet/wallet.d.ts.map +1 -0
- package/dest/wallet/wallet.js +430 -0
- package/package.json +138 -0
- package/src/account/account.ts +72 -0
- package/src/account/account_contract.ts +80 -0
- package/src/account/index.ts +12 -0
- package/src/api/README.md +7 -0
- package/src/api/abi.ts +42 -0
- package/src/api/account.ts +12 -0
- package/src/api/addresses.ts +3 -0
- package/src/api/authorization.ts +15 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +86 -0
- package/src/api/crypto.ts +1 -0
- package/src/api/deployment.ts +3 -0
- package/src/api/eth_address.ts +1 -0
- package/src/api/ethereum.ts +10 -0
- package/src/api/event_cursor.ts +60 -0
- package/src/api/events.ts +79 -0
- package/src/api/fee.ts +5 -0
- package/src/api/fee_testing.ts +1 -0
- package/src/api/fields.ts +3 -0
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +2 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +30 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +6 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +20 -0
- package/src/api/utils.ts +14 -0
- package/src/api/wallet.ts +83 -0
- package/src/authorization/call_authorization_request.ts +93 -0
- package/src/contract/base_contract_interaction.ts +62 -0
- package/src/contract/batch_call.ts +188 -0
- package/src/contract/checker.ts +122 -0
- package/src/contract/contract.ts +52 -0
- package/src/contract/contract_base.ts +73 -0
- package/src/contract/contract_function_interaction.ts +297 -0
- package/src/contract/deploy_method.ts +877 -0
- package/src/contract/fastforward_contract_update.ts +71 -0
- package/src/contract/interaction_options.ts +301 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +104 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +241 -0
- package/src/contract/protocol_contracts/fee-juice.ts +257 -0
- package/src/contract/wait_for_proven.ts +43 -0
- package/src/contract/wait_opts.ts +26 -0
- package/src/deployment/contract_deployer.ts +40 -0
- package/src/deployment/publish_class.ts +34 -0
- package/src/deployment/publish_instance.ts +24 -0
- package/src/ethereum/portal_manager.ts +539 -0
- package/src/fee/fee_juice_payment_method_with_claim.ts +63 -0
- package/src/fee/fee_payment_method.ts +26 -0
- package/src/fee/private_fee_payment_method.ts +145 -0
- package/src/fee/public_fee_payment_method.ts +145 -0
- package/src/fee/sponsored_fee_payment.ts +45 -0
- package/src/scripts/generate_protocol_contract_types.ts +160 -0
- package/src/test/fixtures.ts +126 -0
- package/src/utils/abi_types.ts +32 -0
- package/src/utils/authwit.ts +327 -0
- package/src/utils/cross_chain.ts +55 -0
- package/src/utils/fee_juice.ts +14 -0
- package/src/utils/field_compressed_string.ts +27 -0
- package/src/utils/node.ts +110 -0
- package/src/utils/pub_key.ts +12 -0
- package/src/wallet/account_entrypoint_meta_payment_method.ts +76 -0
- package/src/wallet/account_manager.ts +164 -0
- package/src/wallet/capabilities.ts +505 -0
- package/src/wallet/deploy_account_method.ts +234 -0
- package/src/wallet/index.ts +4 -0
- package/src/wallet/tx_simulation_result_with_app_offset.ts +100 -0
- package/src/wallet/wallet.ts +668 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/* Autogenerated file, do not edit! */ /* eslint-disable */ import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
|
|
2
|
+
import { FunctionType } from '@aztec-labs/stdlib/abi';
|
|
3
|
+
import { ContractBase } from '../contract_base.js';
|
|
4
|
+
const FeeJuiceContractArtifact = {
|
|
5
|
+
name: 'FeeJuice',
|
|
6
|
+
aztecVersion: '6.0.0-nightly.20260826',
|
|
7
|
+
functions: [
|
|
8
|
+
{
|
|
9
|
+
...{
|
|
10
|
+
functionType: FunctionType.PRIVATE,
|
|
11
|
+
name: 'claim',
|
|
12
|
+
isOnlySelf: false,
|
|
13
|
+
isStatic: false,
|
|
14
|
+
isInitializer: false,
|
|
15
|
+
parameters: [
|
|
16
|
+
{
|
|
17
|
+
name: 'to',
|
|
18
|
+
type: {
|
|
19
|
+
kind: 'struct',
|
|
20
|
+
fields: [
|
|
21
|
+
{
|
|
22
|
+
name: 'inner',
|
|
23
|
+
type: {
|
|
24
|
+
kind: 'field'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
29
|
+
},
|
|
30
|
+
visibility: 'private'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'amount',
|
|
34
|
+
type: {
|
|
35
|
+
kind: 'integer',
|
|
36
|
+
sign: 'unsigned',
|
|
37
|
+
width: 128
|
|
38
|
+
},
|
|
39
|
+
visibility: 'private'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'secret',
|
|
43
|
+
type: {
|
|
44
|
+
kind: 'field'
|
|
45
|
+
},
|
|
46
|
+
visibility: 'private'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'message_leaf_index',
|
|
50
|
+
type: {
|
|
51
|
+
kind: 'field'
|
|
52
|
+
},
|
|
53
|
+
visibility: 'private'
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
errorTypes: {
|
|
57
|
+
'11019205087382408538': {
|
|
58
|
+
error_kind: 'string',
|
|
59
|
+
string: 'Field failed to decompose into specified 4 limbs'
|
|
60
|
+
},
|
|
61
|
+
'12370419938245003393': {
|
|
62
|
+
error_kind: 'string',
|
|
63
|
+
string: 'Field failed to decompose into specified 36 limbs'
|
|
64
|
+
},
|
|
65
|
+
'14990209321349310352': {
|
|
66
|
+
error_kind: 'string',
|
|
67
|
+
string: 'attempt to add with overflow'
|
|
68
|
+
},
|
|
69
|
+
'15835548349546956319': {
|
|
70
|
+
error_kind: 'string',
|
|
71
|
+
string: 'Field failed to decompose into specified 32 limbs'
|
|
72
|
+
},
|
|
73
|
+
'16431471497789672479': {
|
|
74
|
+
error_kind: 'string',
|
|
75
|
+
string: 'Index out of bounds'
|
|
76
|
+
},
|
|
77
|
+
'1998584279744703196': {
|
|
78
|
+
error_kind: 'string',
|
|
79
|
+
string: 'attempt to subtract with overflow'
|
|
80
|
+
},
|
|
81
|
+
'361444214588792908': {
|
|
82
|
+
error_kind: 'string',
|
|
83
|
+
string: 'attempt to multiply with overflow'
|
|
84
|
+
},
|
|
85
|
+
'5421095327929394772': {
|
|
86
|
+
error_kind: 'string',
|
|
87
|
+
string: 'attempt to bit-shift with overflow'
|
|
88
|
+
},
|
|
89
|
+
'6609888949476313245': {
|
|
90
|
+
error_kind: 'string',
|
|
91
|
+
string: 'Message not in state'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
bytecode: Buffer.from([]),
|
|
96
|
+
debugSymbols: ''
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
...{
|
|
100
|
+
functionType: FunctionType.PRIVATE,
|
|
101
|
+
name: 'claim_and_end_setup',
|
|
102
|
+
isOnlySelf: false,
|
|
103
|
+
isStatic: false,
|
|
104
|
+
isInitializer: false,
|
|
105
|
+
parameters: [
|
|
106
|
+
{
|
|
107
|
+
name: 'to',
|
|
108
|
+
type: {
|
|
109
|
+
kind: 'struct',
|
|
110
|
+
fields: [
|
|
111
|
+
{
|
|
112
|
+
name: 'inner',
|
|
113
|
+
type: {
|
|
114
|
+
kind: 'field'
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
119
|
+
},
|
|
120
|
+
visibility: 'private'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'amount',
|
|
124
|
+
type: {
|
|
125
|
+
kind: 'integer',
|
|
126
|
+
sign: 'unsigned',
|
|
127
|
+
width: 128
|
|
128
|
+
},
|
|
129
|
+
visibility: 'private'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'secret',
|
|
133
|
+
type: {
|
|
134
|
+
kind: 'field'
|
|
135
|
+
},
|
|
136
|
+
visibility: 'private'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'message_leaf_index',
|
|
140
|
+
type: {
|
|
141
|
+
kind: 'field'
|
|
142
|
+
},
|
|
143
|
+
visibility: 'private'
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
errorTypes: {
|
|
147
|
+
'11019205087382408538': {
|
|
148
|
+
error_kind: 'string',
|
|
149
|
+
string: 'Field failed to decompose into specified 4 limbs'
|
|
150
|
+
},
|
|
151
|
+
'12370419938245003393': {
|
|
152
|
+
error_kind: 'string',
|
|
153
|
+
string: 'Field failed to decompose into specified 36 limbs'
|
|
154
|
+
},
|
|
155
|
+
'14990209321349310352': {
|
|
156
|
+
error_kind: 'string',
|
|
157
|
+
string: 'attempt to add with overflow'
|
|
158
|
+
},
|
|
159
|
+
'15835548349546956319': {
|
|
160
|
+
error_kind: 'string',
|
|
161
|
+
string: 'Field failed to decompose into specified 32 limbs'
|
|
162
|
+
},
|
|
163
|
+
'16431471497789672479': {
|
|
164
|
+
error_kind: 'string',
|
|
165
|
+
string: 'Index out of bounds'
|
|
166
|
+
},
|
|
167
|
+
'1998584279744703196': {
|
|
168
|
+
error_kind: 'string',
|
|
169
|
+
string: 'attempt to subtract with overflow'
|
|
170
|
+
},
|
|
171
|
+
'361444214588792908': {
|
|
172
|
+
error_kind: 'string',
|
|
173
|
+
string: 'attempt to multiply with overflow'
|
|
174
|
+
},
|
|
175
|
+
'5421095327929394772': {
|
|
176
|
+
error_kind: 'string',
|
|
177
|
+
string: 'attempt to bit-shift with overflow'
|
|
178
|
+
},
|
|
179
|
+
'6609888949476313245': {
|
|
180
|
+
error_kind: 'string',
|
|
181
|
+
string: 'Message not in state'
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
bytecode: Buffer.from([]),
|
|
186
|
+
debugSymbols: ''
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
...{
|
|
190
|
+
functionType: FunctionType.PUBLIC,
|
|
191
|
+
name: 'public_dispatch',
|
|
192
|
+
isOnlySelf: false,
|
|
193
|
+
isStatic: false,
|
|
194
|
+
isInitializer: false,
|
|
195
|
+
parameters: [
|
|
196
|
+
{
|
|
197
|
+
name: 'selector',
|
|
198
|
+
type: {
|
|
199
|
+
kind: 'field'
|
|
200
|
+
},
|
|
201
|
+
visibility: 'private'
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
errorTypes: {
|
|
205
|
+
'1080336462466469436': {
|
|
206
|
+
error_kind: 'string',
|
|
207
|
+
string: 'Function check_balance can only be called statically'
|
|
208
|
+
},
|
|
209
|
+
'11194752367584870169': {
|
|
210
|
+
error_kind: 'fmtstring',
|
|
211
|
+
length: 27,
|
|
212
|
+
item_types: [
|
|
213
|
+
{
|
|
214
|
+
kind: 'field'
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
'13455385521185560676': {
|
|
219
|
+
error_kind: 'string',
|
|
220
|
+
string: 'Storage slot 0 not allowed. Storage slots must start from 1.'
|
|
221
|
+
},
|
|
222
|
+
'14990209321349310352': {
|
|
223
|
+
error_kind: 'string',
|
|
224
|
+
string: 'attempt to add with overflow'
|
|
225
|
+
},
|
|
226
|
+
'15860392472534760515': {
|
|
227
|
+
error_kind: 'string',
|
|
228
|
+
string: 'Function balance_of_public can only be called statically'
|
|
229
|
+
},
|
|
230
|
+
'8637882143979902881': {
|
|
231
|
+
error_kind: 'string',
|
|
232
|
+
string: 'Function _increase_public_balance can only be called by the same contract'
|
|
233
|
+
},
|
|
234
|
+
'9543832133280402246': {
|
|
235
|
+
error_kind: 'string',
|
|
236
|
+
string: 'Balance too low'
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
bytecode: Buffer.from([]),
|
|
241
|
+
debugSymbols: ''
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
nonDispatchPublicFunctions: [
|
|
245
|
+
{
|
|
246
|
+
functionType: FunctionType.PUBLIC,
|
|
247
|
+
name: '_increase_public_balance',
|
|
248
|
+
isOnlySelf: true,
|
|
249
|
+
isStatic: false,
|
|
250
|
+
isInitializer: false,
|
|
251
|
+
parameters: [
|
|
252
|
+
{
|
|
253
|
+
name: 'to',
|
|
254
|
+
type: {
|
|
255
|
+
kind: 'struct',
|
|
256
|
+
fields: [
|
|
257
|
+
{
|
|
258
|
+
name: 'inner',
|
|
259
|
+
type: {
|
|
260
|
+
kind: 'field'
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
265
|
+
},
|
|
266
|
+
visibility: 'private'
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'amount',
|
|
270
|
+
type: {
|
|
271
|
+
kind: 'integer',
|
|
272
|
+
sign: 'unsigned',
|
|
273
|
+
width: 128
|
|
274
|
+
},
|
|
275
|
+
visibility: 'private'
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
errorTypes: {
|
|
279
|
+
'13455385521185560676': {
|
|
280
|
+
error_kind: 'string',
|
|
281
|
+
string: 'Storage slot 0 not allowed. Storage slots must start from 1.'
|
|
282
|
+
},
|
|
283
|
+
'14990209321349310352': {
|
|
284
|
+
error_kind: 'string',
|
|
285
|
+
string: 'attempt to add with overflow'
|
|
286
|
+
},
|
|
287
|
+
'8637882143979902881': {
|
|
288
|
+
error_kind: 'string',
|
|
289
|
+
string: 'Function _increase_public_balance can only be called by the same contract'
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
functionType: FunctionType.PUBLIC,
|
|
295
|
+
name: 'balance_of_public',
|
|
296
|
+
isOnlySelf: false,
|
|
297
|
+
isStatic: true,
|
|
298
|
+
isInitializer: false,
|
|
299
|
+
parameters: [
|
|
300
|
+
{
|
|
301
|
+
name: 'owner',
|
|
302
|
+
type: {
|
|
303
|
+
kind: 'struct',
|
|
304
|
+
fields: [
|
|
305
|
+
{
|
|
306
|
+
name: 'inner',
|
|
307
|
+
type: {
|
|
308
|
+
kind: 'field'
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
313
|
+
},
|
|
314
|
+
visibility: 'private'
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
returnType: {
|
|
318
|
+
kind: 'integer',
|
|
319
|
+
sign: 'unsigned',
|
|
320
|
+
width: 128
|
|
321
|
+
},
|
|
322
|
+
errorTypes: {
|
|
323
|
+
'13455385521185560676': {
|
|
324
|
+
error_kind: 'string',
|
|
325
|
+
string: 'Storage slot 0 not allowed. Storage slots must start from 1.'
|
|
326
|
+
},
|
|
327
|
+
'15860392472534760515': {
|
|
328
|
+
error_kind: 'string',
|
|
329
|
+
string: 'Function balance_of_public can only be called statically'
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
functionType: FunctionType.PUBLIC,
|
|
335
|
+
name: 'check_balance',
|
|
336
|
+
isOnlySelf: false,
|
|
337
|
+
isStatic: true,
|
|
338
|
+
isInitializer: false,
|
|
339
|
+
parameters: [
|
|
340
|
+
{
|
|
341
|
+
name: 'fee_limit',
|
|
342
|
+
type: {
|
|
343
|
+
kind: 'integer',
|
|
344
|
+
sign: 'unsigned',
|
|
345
|
+
width: 128
|
|
346
|
+
},
|
|
347
|
+
visibility: 'private'
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
errorTypes: {
|
|
351
|
+
'1080336462466469436': {
|
|
352
|
+
error_kind: 'string',
|
|
353
|
+
string: 'Function check_balance can only be called statically'
|
|
354
|
+
},
|
|
355
|
+
'13455385521185560676': {
|
|
356
|
+
error_kind: 'string',
|
|
357
|
+
string: 'Storage slot 0 not allowed. Storage slots must start from 1.'
|
|
358
|
+
},
|
|
359
|
+
'9543832133280402246': {
|
|
360
|
+
error_kind: 'string',
|
|
361
|
+
string: 'Balance too low'
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
outputs: {
|
|
367
|
+
structs: {},
|
|
368
|
+
globals: {}
|
|
369
|
+
},
|
|
370
|
+
storageLayout: {},
|
|
371
|
+
fileMap: {}
|
|
372
|
+
};
|
|
373
|
+
export class FeeJuiceContract extends ContractBase {
|
|
374
|
+
constructor(wallet){
|
|
375
|
+
super(ProtocolContractAddress.FeeJuice, FeeJuiceContractArtifact, wallet);
|
|
376
|
+
}
|
|
377
|
+
/** Returns an interface to the canonical FeeJuiceContract instance, bound to the given wallet. */ static withWallet(wallet) {
|
|
378
|
+
return new FeeJuiceContract(wallet);
|
|
379
|
+
}
|
|
380
|
+
/** @deprecated Use `withWallet` instead. */ static at(wallet) {
|
|
381
|
+
return FeeJuiceContract.withWallet(wallet);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec-labs/foundation/branded-types';
|
|
2
|
+
import type { AztecNode } from '@aztec-labs/stdlib/interfaces/client';
|
|
3
|
+
import type { TxReceipt } from '@aztec-labs/stdlib/tx';
|
|
4
|
+
/**
|
|
5
|
+
* Options for waiting for a transaction to be proven.
|
|
6
|
+
*/
|
|
7
|
+
export type WaitForProvenOpts = {
|
|
8
|
+
/** Time to wait for the tx to be proven before timing out */
|
|
9
|
+
provenTimeout?: number;
|
|
10
|
+
/** Elapsed time between polls to the node */
|
|
11
|
+
interval?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const DefaultWaitForProvenOpts: WaitForProvenOpts;
|
|
14
|
+
/**
|
|
15
|
+
* Wait for a transaction to be proven by polling the node
|
|
16
|
+
*/
|
|
17
|
+
export declare function waitForProven(node: AztecNode, receipt: TxReceipt, opts?: WaitForProvenOpts): Promise<BlockNumber>;
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9mb3JfcHJvdmVuLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9mb3JfcHJvdmVuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBRXhFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3RFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBSXZEOztHQUVHO0FBQ0gsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLDZEQUE2RDtJQUM3RCxhQUFhLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdkIsNkNBQTZDO0lBQzdDLFFBQVEsQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUNuQixDQUFDO0FBRUYsZUFBTyxNQUFNLHdCQUF3QixFQUFFLGlCQUd0QyxDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBc0IsYUFBYSxDQUNqQyxJQUFJLEVBQUUsU0FBUyxFQUNmLE9BQU8sRUFBRSxTQUFTLEVBQ2xCLElBQUksQ0FBQyxFQUFFLGlCQUFpQixHQUN2QixPQUFPLENBQUMsV0FBVyxDQUFDLENBYXRCIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait_for_proven.d.ts","sourceRoot":"","sources":["../../src/contract/wait_for_proven.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAGtC,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,SAAS,EAClB,IAAI,CAAC,EAAE,iBAAiB,GACvB,OAAO,CAAC,WAAW,CAAC,CAatB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { retryUntil } from '@aztec-labs/foundation/retry';
|
|
2
|
+
import { DefaultWaitOpts } from './wait_opts.js';
|
|
3
|
+
export const DefaultWaitForProvenOpts = {
|
|
4
|
+
provenTimeout: 600,
|
|
5
|
+
interval: DefaultWaitOpts.interval
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Wait for a transaction to be proven by polling the node
|
|
9
|
+
*/ export async function waitForProven(node, receipt, opts) {
|
|
10
|
+
if (!receipt.blockNumber) {
|
|
11
|
+
throw new Error(`Cannot wait for proven: receipt of tx ${receipt.txHash} does not have a block number`);
|
|
12
|
+
}
|
|
13
|
+
return await retryUntil(async ()=>{
|
|
14
|
+
const provenBlock = await node.getBlockNumber('proven');
|
|
15
|
+
return provenBlock >= receipt.blockNumber ? provenBlock : undefined;
|
|
16
|
+
}, 'isProven', opts?.provenTimeout ?? DefaultWaitForProvenOpts.provenTimeout, opts?.interval ?? DefaultWaitForProvenOpts.interval);
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TxStatus } from '@aztec-labs/stdlib/tx';
|
|
2
|
+
/** Options related to waiting for a tx. */
|
|
3
|
+
export type WaitOpts = {
|
|
4
|
+
/** The amount of time to ignore TxStatus.DROPPED receipts (in seconds) due to the presumption that it is being propagated by the p2p network. Defaults to 5. */
|
|
5
|
+
ignoreDroppedReceiptsFor?: number;
|
|
6
|
+
/** The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 300 (5 min). */
|
|
7
|
+
timeout?: number;
|
|
8
|
+
/** The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. */
|
|
9
|
+
interval?: number;
|
|
10
|
+
/** Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts. */
|
|
11
|
+
dontThrowOnRevert?: boolean;
|
|
12
|
+
/** The minimum inclusion status to wait for. If set, waits until the receipt reaches this status or higher. Defaults to CHECKPOINTED. */
|
|
13
|
+
waitForStatus?: TxStatus;
|
|
14
|
+
/**
|
|
15
|
+
* The time (in seconds) to wait before the first receipt poll. Defaults to 0. Used to avoid checking for a receipt
|
|
16
|
+
* right after sending a tx, when we know it cannot have been mined yet. Counts against `timeout`.
|
|
17
|
+
*/
|
|
18
|
+
initialDelay?: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const DefaultWaitOpts: WaitOpts;
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FpdF9vcHRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Qvd2FpdF9vcHRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRXRELDJDQUEyQztBQUMzQyxNQUFNLE1BQU0sUUFBUSxHQUFHO0lBQ3JCLGdLQUFnSztJQUNoSyx3QkFBd0IsQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUNsQyxzR0FBc0c7SUFDdEcsT0FBTyxDQUFDLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLHNHQUFzRztJQUN0RyxRQUFRLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDbEIsMEhBQTBIO0lBQzFILGlCQUFpQixDQUFDLEVBQUUsT0FBTyxDQUFDO0lBQzVCLHlJQUF5STtJQUN6SSxhQUFhLENBQUMsRUFBRSxRQUFRLENBQUM7SUFDekI7OztPQUdHO0lBQ0gsWUFBWSxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ3ZCLENBQUM7QUFFRixlQUFPLE1BQU0sZUFBZSxFQUFFLFFBSTdCLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait_opts.d.ts","sourceRoot":"","sources":["../../src/contract/wait_opts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAAG;IACrB,gKAAgK;IAChK,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,sGAAsG;IACtG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yIAAyI;IACzI,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAI7B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
|
|
2
|
+
import { Contract } from '../contract/contract.js';
|
|
3
|
+
import { type DeployInstantiationOptions, DeployMethod } from '../contract/deploy_method.js';
|
|
4
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
5
|
+
/**
|
|
6
|
+
* A class for deploying contract.
|
|
7
|
+
* @remarks Keeping this around even though we have Aztec.nr contract types because it can be useful for non-TS users.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ContractDeployer {
|
|
10
|
+
private artifact;
|
|
11
|
+
private wallet;
|
|
12
|
+
private constructorName?;
|
|
13
|
+
constructor(artifact: ContractArtifact, wallet: Wallet, constructorName?: string | undefined);
|
|
14
|
+
/**
|
|
15
|
+
* Deploy a contract using the provided instantiation parameters and constructor arguments.
|
|
16
|
+
* Creates a new DeployMethod instance that can be used to send the deployment transaction.
|
|
17
|
+
*
|
|
18
|
+
* The first argument is the {@link DeployInstantiationOptions} (salt, deployer) — pass `{}` to
|
|
19
|
+
* accept defaults (random salt, deployer = AztecAddress.ZERO). The remaining arguments are the
|
|
20
|
+
* constructor arguments for the contract.
|
|
21
|
+
*
|
|
22
|
+
* @param instantiation - Salt and deployer to mix into the address derivation.
|
|
23
|
+
* @param args - The constructor arguments for the contract being deployed.
|
|
24
|
+
* @returns A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
|
|
25
|
+
*/
|
|
26
|
+
deploy(args?: any[], instantiation?: DeployInstantiationOptions): DeployMethod<Contract>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfZGVwbG95ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZXBsb3ltZW50L2NvbnRyYWN0X2RlcGxveWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFHL0QsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ25ELE9BQU8sRUFBRSxLQUFLLDBCQUEwQixFQUFFLFlBQVksRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQzdGLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRWxEOzs7R0FHRztBQUNILHFCQUFhLGdCQUFnQjtJQUV6QixPQUFPLENBQUMsUUFBUTtJQUNoQixPQUFPLENBQUMsTUFBTTtJQUNkLE9BQU8sQ0FBQyxlQUFlLENBQUM7SUFIMUIsWUFDVSxRQUFRLEVBQUUsZ0JBQWdCLEVBQzFCLE1BQU0sRUFBRSxNQUFNLEVBQ2QsZUFBZSxDQUFDLG9CQUFRLEVBQzlCO0lBRUo7Ozs7Ozs7Ozs7O09BV0c7SUFDSSxNQUFNLENBQUMsSUFBSSxDQUFDLEVBQUUsR0FBRyxFQUFFLEVBQUUsYUFBYSxDQUFDLEVBQUUsMEJBQTBCLDBCQVFyRTtDQUNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract_deployer.d.ts","sourceRoot":"","sources":["../../src/deployment/contract_deployer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,KAAK,0BAA0B,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;GAGG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,eAAe,CAAC;IAH1B,YACU,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,oBAAQ,EAC9B;IAEJ;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,aAAa,CAAC,EAAE,0BAA0B,0BAQrE;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Contract } from '../contract/contract.js';
|
|
2
|
+
import { DeployMethod } from '../contract/deploy_method.js';
|
|
3
|
+
/**
|
|
4
|
+
* A class for deploying contract.
|
|
5
|
+
* @remarks Keeping this around even though we have Aztec.nr contract types because it can be useful for non-TS users.
|
|
6
|
+
*/ export class ContractDeployer {
|
|
7
|
+
artifact;
|
|
8
|
+
wallet;
|
|
9
|
+
constructorName;
|
|
10
|
+
constructor(artifact, wallet, constructorName){
|
|
11
|
+
this.artifact = artifact;
|
|
12
|
+
this.wallet = wallet;
|
|
13
|
+
this.constructorName = constructorName;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Deploy a contract using the provided instantiation parameters and constructor arguments.
|
|
17
|
+
* Creates a new DeployMethod instance that can be used to send the deployment transaction.
|
|
18
|
+
*
|
|
19
|
+
* The first argument is the {@link DeployInstantiationOptions} (salt, deployer) — pass `{}` to
|
|
20
|
+
* accept defaults (random salt, deployer = AztecAddress.ZERO). The remaining arguments are the
|
|
21
|
+
* constructor arguments for the contract.
|
|
22
|
+
*
|
|
23
|
+
* @param instantiation - Salt and deployer to mix into the address derivation.
|
|
24
|
+
* @param args - The constructor arguments for the contract being deployed.
|
|
25
|
+
* @returns A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
|
|
26
|
+
*/ deploy(args, instantiation) {
|
|
27
|
+
const postDeployCtor = (instance, wallet)=>Contract.at(instance.address, this.artifact, wallet);
|
|
28
|
+
return DeployMethod.create(this.wallet, {
|
|
29
|
+
artifact: this.artifact,
|
|
30
|
+
postDeployCtor,
|
|
31
|
+
args,
|
|
32
|
+
constructorNameOrArtifact: this.constructorName
|
|
33
|
+
}, instantiation);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ContractArtifact } from '@aztec-labs/stdlib/abi';
|
|
2
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
3
|
+
import type { Wallet } from '../wallet/index.js';
|
|
4
|
+
/** Sets up a call to publish a contract class given its artifact. */
|
|
5
|
+
export declare function publishContractClass(wallet: Wallet, artifact: ContractArtifact): Promise<ContractFunctionInteraction>;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGlzaF9jbGFzcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlcGxveW1lbnQvcHVibGlzaF9jbGFzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBa0IsTUFBTSx3QkFBd0IsQ0FBQztBQUkvRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBRWhHLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRWpELHFFQUFxRTtBQUNyRSx3QkFBc0Isb0JBQW9CLENBQ3hDLE1BQU0sRUFBRSxNQUFNLEVBQ2QsUUFBUSxFQUFFLGdCQUFnQixHQUN6QixPQUFPLENBQUMsMkJBQTJCLENBQUMsQ0FldEMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish_class.d.ts","sourceRoot":"","sources":["../../src/deployment/publish_class.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAI/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qEAAqE;AACrE,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,2BAA2B,CAAC,CAetC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS } from '@aztec-labs/constants';
|
|
2
|
+
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
3
|
+
import { ProtocolContractAddress } from '@aztec-labs/protocol-contracts';
|
|
4
|
+
import { bufferAsFields } from '@aztec-labs/stdlib/abi';
|
|
5
|
+
import { getContractClassFromArtifact } from '@aztec-labs/stdlib/contract';
|
|
6
|
+
import { Capsule } from '@aztec-labs/stdlib/tx';
|
|
7
|
+
import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
|
|
8
|
+
/** Sets up a call to publish a contract class given its artifact. */ export async function publishContractClass(wallet, artifact) {
|
|
9
|
+
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } = await getContractClassFromArtifact(artifact);
|
|
10
|
+
const classRegistry = ContractClassRegistryContract.withWallet(wallet);
|
|
11
|
+
const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
|
|
12
|
+
return classRegistry.methods.publish(artifactHash, privateFunctionsRoot, publicBytecodeCommitment).with({
|
|
13
|
+
capsules: [
|
|
14
|
+
new Capsule(ProtocolContractAddress.ContractClassRegistry, new Fr(CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT), encodedBytecode)
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContractInstanceWithAddress } from '@aztec-labs/stdlib/contract';
|
|
2
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
3
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
4
|
+
/**
|
|
5
|
+
* Sets up a call to the canonical contract instance registry to publish a contract instance.
|
|
6
|
+
* @param wallet - The wallet to use for the publication (setup) tx.
|
|
7
|
+
* @param instance - The instance to publish.
|
|
8
|
+
*/
|
|
9
|
+
export declare function publishInstance(wallet: Wallet, instance: ContractInstanceWithAddress): ContractFunctionInteraction;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGlzaF9pbnN0YW5jZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlcGxveW1lbnQvcHVibGlzaF9pbnN0YW5jZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRS9FLE9BQU8sS0FBSyxFQUFFLDJCQUEyQixFQUFFLE1BQU0sOENBQThDLENBQUM7QUFFaEcsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFbEQ7Ozs7R0FJRztBQUNILHdCQUFnQixlQUFlLENBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUUsMkJBQTJCLEdBQUcsMkJBQTJCLENBWWxIIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish_instance.d.ts","sourceRoot":"","sources":["../../src/deployment/publish_instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,2BAA2B,GAAG,2BAA2B,CAYlH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContractInstanceRegistryContract } from '../contract/protocol_contracts/contract-instance-registry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sets up a call to the canonical contract instance registry to publish a contract instance.
|
|
4
|
+
* @param wallet - The wallet to use for the publication (setup) tx.
|
|
5
|
+
* @param instance - The instance to publish.
|
|
6
|
+
*/ export function publishInstance(wallet, instance) {
|
|
7
|
+
const contractInstanceRegistry = ContractInstanceRegistryContract.withWallet(wallet);
|
|
8
|
+
const { salt, currentContractClassId: contractClassId, publicKeys, deployer: instanceDeployer } = instance;
|
|
9
|
+
const isUniversalDeploy = instanceDeployer.isZero();
|
|
10
|
+
return contractInstanceRegistry.methods.publish_for_public_execution(salt, contractClassId, instance.initializationHash, instance.immutablesHash, publicKeys, isUniversalDeploy);
|
|
11
|
+
}
|