@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 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAA6B,MAAM,sCAAsC,CAAC;AAC9F,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAC5B,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,mCAAmC,EAEzC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAA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C;AAkHH,QAAA,MAAe,mBAAmB;;;;;;+BAAU,mBAAmB;;;;;;6BAA4C,CAAC;AAE5G,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAI7C,CAAC"}
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { BlockNumberPositiveSchema } from '@aztec-labs/foundation/branded-types';
|
|
2
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionCall } from '@aztec-labs/stdlib/abi';
|
|
3
|
+
import { AuthWitness } from '@aztec-labs/stdlib/auth-witness';
|
|
4
|
+
import { ContractInstancePreimageSchema, ContractInstancePreimageWithAddressSchema } from '@aztec-labs/stdlib/contract';
|
|
5
|
+
import { Gas, ManaUsageEstimate } from '@aztec-labs/stdlib/gas';
|
|
6
|
+
import { refineTxHashAndRange } from '@aztec-labs/stdlib/logs';
|
|
7
|
+
import { AbiDecodedSchema, getSchemaParameters, getSchemaReturnType, optional, schemas, zodFor } from '@aztec-labs/stdlib/schemas';
|
|
8
|
+
import { Capsule, HashedValues, SimulationOverrides, TxHash, TxProfileResult, TxReceiptSchema, UtilityExecutionResult, inTxSchema } from '@aztec-labs/stdlib/tx';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { EventCursor } from '../api/event_cursor.js';
|
|
11
|
+
import { NO_FROM, NO_WAIT } from '../contract/interaction_options.js';
|
|
12
|
+
import { TxSimulationResultWithAppOffset } from './tx_simulation_result_with_app_offset.js';
|
|
13
|
+
/** Whether the contract has been initialized. */ export var ContractInitializationStatus = /*#__PURE__*/ function(ContractInitializationStatus) {
|
|
14
|
+
/** The contract has been initialized (initialization nullifier found). */ ContractInitializationStatus["INITIALIZED"] = "INITIALIZED";
|
|
15
|
+
/** The contract has not been initialized (instance is known, but no initialization nullifier found). */ ContractInitializationStatus["UNINITIALIZED"] = "UNINITIALIZED";
|
|
16
|
+
/**
|
|
17
|
+
* Initialization status cannot be determined. The contract instance is not registered in this wallet, so we have
|
|
18
|
+
* limited ability to check for initialization. The contract may or may not have been initialized.
|
|
19
|
+
*/ ContractInitializationStatus["UNKNOWN"] = "UNKNOWN";
|
|
20
|
+
return ContractInitializationStatus;
|
|
21
|
+
}({});
|
|
22
|
+
export const ExecutionPayloadSchema = z.object({
|
|
23
|
+
calls: z.array(FunctionCall.schema),
|
|
24
|
+
authWitnesses: z.array(AuthWitness.schema),
|
|
25
|
+
capsules: z.array(Capsule.schema),
|
|
26
|
+
extraHashedArgs: z.array(HashedValues.schema),
|
|
27
|
+
feePayer: optional(schemas.AztecAddress)
|
|
28
|
+
});
|
|
29
|
+
export const GasSettingsOptionSchema = z.object({
|
|
30
|
+
gasSettings: optional(z.object({
|
|
31
|
+
gasLimits: optional(Gas.schema),
|
|
32
|
+
teardownGasLimits: optional(Gas.schema),
|
|
33
|
+
maxFeePerGas: optional(z.object({
|
|
34
|
+
feePerDaGas: schemas.BigInt,
|
|
35
|
+
feePerL2Gas: schemas.BigInt
|
|
36
|
+
})),
|
|
37
|
+
maxPriorityFeePerGas: optional(z.object({
|
|
38
|
+
feePerDaGas: schemas.BigInt,
|
|
39
|
+
feePerL2Gas: schemas.BigInt
|
|
40
|
+
}))
|
|
41
|
+
})),
|
|
42
|
+
congestionEstimate: optional(z.nativeEnum(ManaUsageEstimate))
|
|
43
|
+
});
|
|
44
|
+
export const WaitOptsSchema = z.object({
|
|
45
|
+
ignoreDroppedReceiptsFor: optional(z.number()),
|
|
46
|
+
timeout: optional(z.number()),
|
|
47
|
+
interval: optional(z.number()),
|
|
48
|
+
dontThrowOnRevert: optional(z.boolean()),
|
|
49
|
+
initialDelay: optional(z.number())
|
|
50
|
+
});
|
|
51
|
+
const FromSchema = z.union([
|
|
52
|
+
schemas.AztecAddress,
|
|
53
|
+
z.literal(NO_FROM)
|
|
54
|
+
]);
|
|
55
|
+
export const SendOptionsSchema = z.object({
|
|
56
|
+
from: FromSchema,
|
|
57
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
58
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
59
|
+
fee: optional(GasSettingsOptionSchema),
|
|
60
|
+
wait: optional(z.union([
|
|
61
|
+
z.literal(NO_WAIT),
|
|
62
|
+
WaitOptsSchema
|
|
63
|
+
])),
|
|
64
|
+
additionalScopes: optional(z.array(schemas.AztecAddress)),
|
|
65
|
+
sendMessagesAs: optional(schemas.AztecAddress)
|
|
66
|
+
});
|
|
67
|
+
export const SimulateOptionsSchema = z.object({
|
|
68
|
+
from: FromSchema,
|
|
69
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
70
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
71
|
+
fee: optional(GasSettingsOptionSchema),
|
|
72
|
+
skipTxValidation: optional(z.boolean()),
|
|
73
|
+
skipFeeEnforcement: optional(z.boolean()),
|
|
74
|
+
includeMetadata: optional(z.boolean()),
|
|
75
|
+
additionalScopes: optional(z.array(schemas.AztecAddress)),
|
|
76
|
+
sendMessagesAs: optional(schemas.AztecAddress),
|
|
77
|
+
overrides: optional(SimulationOverrides.schema)
|
|
78
|
+
});
|
|
79
|
+
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
80
|
+
profileMode: z.enum([
|
|
81
|
+
'gates',
|
|
82
|
+
'execution-steps',
|
|
83
|
+
'full'
|
|
84
|
+
]),
|
|
85
|
+
skipProofGeneration: optional(z.boolean())
|
|
86
|
+
});
|
|
87
|
+
export const MessageHashOrIntentSchema = z.union([
|
|
88
|
+
z.object({
|
|
89
|
+
consumer: schemas.AztecAddress,
|
|
90
|
+
innerHash: schemas.Fr
|
|
91
|
+
}),
|
|
92
|
+
z.object({
|
|
93
|
+
caller: schemas.AztecAddress,
|
|
94
|
+
call: FunctionCall.schema
|
|
95
|
+
})
|
|
96
|
+
]);
|
|
97
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
98
|
+
eventSelector: schemas.EventSelector,
|
|
99
|
+
abiType: AbiTypeSchema,
|
|
100
|
+
fieldNames: z.array(z.string())
|
|
101
|
+
});
|
|
102
|
+
// Event filters share `txHash ⊕ block-range` semantics with `LogsQueryBase` (see stdlib `logs_query.ts`)
|
|
103
|
+
// but the field schemas stay local.
|
|
104
|
+
const eventFilterBaseShape = {
|
|
105
|
+
txHash: optional(TxHash.schema),
|
|
106
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
107
|
+
toBlock: optional(BlockNumberPositiveSchema)
|
|
108
|
+
};
|
|
109
|
+
export const PrivateEventFilterSchema = refineTxHashAndRange(z.object({
|
|
110
|
+
...eventFilterBaseShape,
|
|
111
|
+
contractAddress: schemas.AztecAddress,
|
|
112
|
+
scopes: z.array(schemas.AztecAddress)
|
|
113
|
+
}));
|
|
114
|
+
export const PublicEventFilterSchema = refineTxHashAndRange(z.object({
|
|
115
|
+
...eventFilterBaseShape,
|
|
116
|
+
contractAddress: schemas.AztecAddress,
|
|
117
|
+
afterEvent: optional(EventCursor.schema)
|
|
118
|
+
}));
|
|
119
|
+
export const PrivateEventSchema = zodFor()(z.object({
|
|
120
|
+
event: AbiDecodedSchema,
|
|
121
|
+
metadata: inTxSchema()
|
|
122
|
+
}));
|
|
123
|
+
export const PublicEventSchema = zodFor()(z.object({
|
|
124
|
+
event: AbiDecodedSchema,
|
|
125
|
+
metadata: z.intersection(inTxSchema(), z.object({
|
|
126
|
+
contractAddress: schemas.AztecAddress
|
|
127
|
+
}))
|
|
128
|
+
}));
|
|
129
|
+
export const ContractMetadataSchema = z.object({
|
|
130
|
+
instance: optional(ContractInstancePreimageWithAddressSchema),
|
|
131
|
+
initializationStatus: z.nativeEnum(ContractInitializationStatus),
|
|
132
|
+
isContractPublished: z.boolean(),
|
|
133
|
+
isContractUpdated: z.boolean(),
|
|
134
|
+
updatedContractClassId: optional(schemas.Fr)
|
|
135
|
+
});
|
|
136
|
+
export const ContractClassMetadataSchema = z.object({
|
|
137
|
+
isArtifactRegistered: z.boolean(),
|
|
138
|
+
isContractClassPubliclyRegistered: z.boolean()
|
|
139
|
+
});
|
|
140
|
+
export const ContractFunctionPatternSchema = z.object({
|
|
141
|
+
contract: z.union([
|
|
142
|
+
schemas.AztecAddress,
|
|
143
|
+
z.literal('*')
|
|
144
|
+
]),
|
|
145
|
+
function: z.union([
|
|
146
|
+
z.string(),
|
|
147
|
+
z.literal('*')
|
|
148
|
+
]),
|
|
149
|
+
additionalScopes: optional(z.union([
|
|
150
|
+
z.array(schemas.AztecAddress),
|
|
151
|
+
z.literal('*')
|
|
152
|
+
]))
|
|
153
|
+
});
|
|
154
|
+
export const AccountsCapabilitySchema = z.object({
|
|
155
|
+
type: z.literal('accounts'),
|
|
156
|
+
canGet: optional(z.boolean()),
|
|
157
|
+
canCreateAuthWit: optional(z.boolean())
|
|
158
|
+
});
|
|
159
|
+
export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
|
|
160
|
+
accounts: z.array(z.object({
|
|
161
|
+
alias: z.string(),
|
|
162
|
+
item: schemas.AztecAddress
|
|
163
|
+
}))
|
|
164
|
+
});
|
|
165
|
+
export const ContractsCapabilitySchema = z.object({
|
|
166
|
+
type: z.literal('contracts'),
|
|
167
|
+
contracts: z.union([
|
|
168
|
+
z.literal('*'),
|
|
169
|
+
z.array(schemas.AztecAddress)
|
|
170
|
+
]),
|
|
171
|
+
canRegister: optional(z.boolean()),
|
|
172
|
+
canGetMetadata: optional(z.boolean())
|
|
173
|
+
});
|
|
174
|
+
export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
|
|
175
|
+
export const ContractClassesCapabilitySchema = z.object({
|
|
176
|
+
type: z.literal('contractClasses'),
|
|
177
|
+
classes: z.union([
|
|
178
|
+
z.literal('*'),
|
|
179
|
+
z.array(schemas.Fr)
|
|
180
|
+
]),
|
|
181
|
+
canRegister: optional(z.boolean()),
|
|
182
|
+
canGetMetadata: z.boolean()
|
|
183
|
+
});
|
|
184
|
+
export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
|
|
185
|
+
export const SimulationCapabilitySchema = z.object({
|
|
186
|
+
type: z.literal('simulation'),
|
|
187
|
+
transactions: optional(z.object({
|
|
188
|
+
scope: z.union([
|
|
189
|
+
z.literal('*'),
|
|
190
|
+
z.array(ContractFunctionPatternSchema)
|
|
191
|
+
])
|
|
192
|
+
})),
|
|
193
|
+
utilities: optional(z.object({
|
|
194
|
+
scope: z.union([
|
|
195
|
+
z.literal('*'),
|
|
196
|
+
z.array(ContractFunctionPatternSchema)
|
|
197
|
+
])
|
|
198
|
+
}))
|
|
199
|
+
});
|
|
200
|
+
export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
|
|
201
|
+
export const TransactionCapabilitySchema = z.object({
|
|
202
|
+
type: z.literal('transaction'),
|
|
203
|
+
scope: z.union([
|
|
204
|
+
z.literal('*'),
|
|
205
|
+
z.array(ContractFunctionPatternSchema)
|
|
206
|
+
])
|
|
207
|
+
});
|
|
208
|
+
export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
|
|
209
|
+
export const DataCapabilitySchema = z.object({
|
|
210
|
+
type: z.literal('data'),
|
|
211
|
+
addressBook: optional(z.boolean()),
|
|
212
|
+
privateEvents: optional(z.object({
|
|
213
|
+
contracts: z.union([
|
|
214
|
+
z.literal('*'),
|
|
215
|
+
z.array(schemas.AztecAddress)
|
|
216
|
+
])
|
|
217
|
+
}))
|
|
218
|
+
});
|
|
219
|
+
export const GrantedDataCapabilitySchema = DataCapabilitySchema;
|
|
220
|
+
export const CapabilitySchema = z.discriminatedUnion('type', [
|
|
221
|
+
AccountsCapabilitySchema,
|
|
222
|
+
ContractsCapabilitySchema,
|
|
223
|
+
ContractClassesCapabilitySchema,
|
|
224
|
+
SimulationCapabilitySchema,
|
|
225
|
+
TransactionCapabilitySchema,
|
|
226
|
+
DataCapabilitySchema
|
|
227
|
+
]);
|
|
228
|
+
export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
|
|
229
|
+
GrantedAccountsCapabilitySchema,
|
|
230
|
+
GrantedContractsCapabilitySchema,
|
|
231
|
+
GrantedContractClassesCapabilitySchema,
|
|
232
|
+
GrantedSimulationCapabilitySchema,
|
|
233
|
+
GrantedTransactionCapabilitySchema,
|
|
234
|
+
GrantedDataCapabilitySchema
|
|
235
|
+
]);
|
|
236
|
+
export const AppCapabilitiesSchema = z.object({
|
|
237
|
+
version: z.literal('1.0'),
|
|
238
|
+
metadata: z.object({
|
|
239
|
+
name: z.string(),
|
|
240
|
+
version: z.string(),
|
|
241
|
+
description: optional(z.string()),
|
|
242
|
+
url: optional(z.string()),
|
|
243
|
+
icon: optional(z.string())
|
|
244
|
+
}),
|
|
245
|
+
capabilities: z.array(CapabilitySchema),
|
|
246
|
+
behavior: optional(z.object({
|
|
247
|
+
mode: optional(z.enum([
|
|
248
|
+
'strict',
|
|
249
|
+
'permissive'
|
|
250
|
+
])),
|
|
251
|
+
expiration: optional(z.number())
|
|
252
|
+
}))
|
|
253
|
+
});
|
|
254
|
+
export const WalletCapabilitiesSchema = z.object({
|
|
255
|
+
version: z.literal('1.0'),
|
|
256
|
+
granted: z.array(GrantedCapabilitySchema),
|
|
257
|
+
wallet: z.object({
|
|
258
|
+
name: z.string(),
|
|
259
|
+
version: z.string()
|
|
260
|
+
}),
|
|
261
|
+
expiresAt: optional(z.number())
|
|
262
|
+
});
|
|
263
|
+
const OffchainEffectSchema = z.object({
|
|
264
|
+
data: z.array(schemas.Fr),
|
|
265
|
+
contractAddress: schemas.AztecAddress
|
|
266
|
+
});
|
|
267
|
+
const OffchainMessageSchema = z.object({
|
|
268
|
+
recipient: schemas.AztecAddress,
|
|
269
|
+
payload: z.array(schemas.Fr),
|
|
270
|
+
contractAddress: schemas.AztecAddress
|
|
271
|
+
});
|
|
272
|
+
const OffchainOutputSchema = z.object({
|
|
273
|
+
offchainEffects: z.array(OffchainEffectSchema),
|
|
274
|
+
offchainMessages: z.array(OffchainMessageSchema)
|
|
275
|
+
});
|
|
276
|
+
/**
|
|
277
|
+
* Record of all wallet method schemas (excluding batch).
|
|
278
|
+
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
279
|
+
*/ const WalletMethodSchemas = {
|
|
280
|
+
getChainInfo: z.function({
|
|
281
|
+
input: z.tuple([]),
|
|
282
|
+
output: z.object({
|
|
283
|
+
chainId: schemas.Fr,
|
|
284
|
+
version: schemas.Fr
|
|
285
|
+
})
|
|
286
|
+
}),
|
|
287
|
+
getContractMetadata: z.function({
|
|
288
|
+
input: z.tuple([
|
|
289
|
+
schemas.AztecAddress
|
|
290
|
+
]),
|
|
291
|
+
output: ContractMetadataSchema
|
|
292
|
+
}),
|
|
293
|
+
getContractClassMetadata: z.function({
|
|
294
|
+
input: z.tuple([
|
|
295
|
+
schemas.Fr
|
|
296
|
+
]),
|
|
297
|
+
output: ContractClassMetadataSchema
|
|
298
|
+
}),
|
|
299
|
+
getPrivateEvents: z.function({
|
|
300
|
+
input: z.tuple([
|
|
301
|
+
EventMetadataDefinitionSchema,
|
|
302
|
+
PrivateEventFilterSchema
|
|
303
|
+
]),
|
|
304
|
+
output: z.array(PrivateEventSchema)
|
|
305
|
+
}),
|
|
306
|
+
registerSender: z.function({
|
|
307
|
+
input: z.tuple([
|
|
308
|
+
schemas.AztecAddress,
|
|
309
|
+
optional(z.string())
|
|
310
|
+
]),
|
|
311
|
+
output: schemas.AztecAddress
|
|
312
|
+
}),
|
|
313
|
+
getAddressBook: z.function({
|
|
314
|
+
input: z.tuple([]),
|
|
315
|
+
output: z.array(z.object({
|
|
316
|
+
alias: z.string(),
|
|
317
|
+
item: schemas.AztecAddress
|
|
318
|
+
}))
|
|
319
|
+
}),
|
|
320
|
+
getAccounts: z.function({
|
|
321
|
+
input: z.tuple([]),
|
|
322
|
+
output: z.array(z.object({
|
|
323
|
+
alias: z.string(),
|
|
324
|
+
item: schemas.AztecAddress
|
|
325
|
+
}))
|
|
326
|
+
}),
|
|
327
|
+
registerContract: z.function({
|
|
328
|
+
input: z.tuple([
|
|
329
|
+
ContractInstancePreimageSchema,
|
|
330
|
+
optional(ContractArtifactSchema),
|
|
331
|
+
optional(schemas.Fr)
|
|
332
|
+
]),
|
|
333
|
+
output: z.void()
|
|
334
|
+
}),
|
|
335
|
+
registerContractClass: z.function({
|
|
336
|
+
input: z.tuple([
|
|
337
|
+
ContractArtifactSchema
|
|
338
|
+
]),
|
|
339
|
+
output: z.void()
|
|
340
|
+
}),
|
|
341
|
+
simulateTx: z.function({
|
|
342
|
+
input: z.tuple([
|
|
343
|
+
ExecutionPayloadSchema,
|
|
344
|
+
SimulateOptionsSchema
|
|
345
|
+
]),
|
|
346
|
+
output: TxSimulationResultWithAppOffset.schema
|
|
347
|
+
}),
|
|
348
|
+
executeUtility: z.function({
|
|
349
|
+
input: z.tuple([
|
|
350
|
+
FunctionCall.schema,
|
|
351
|
+
z.object({
|
|
352
|
+
scopes: z.array(schemas.AztecAddress),
|
|
353
|
+
authWitnesses: optional(z.array(AuthWitness.schema))
|
|
354
|
+
})
|
|
355
|
+
]),
|
|
356
|
+
output: UtilityExecutionResult.schema
|
|
357
|
+
}),
|
|
358
|
+
profileTx: z.function({
|
|
359
|
+
input: z.tuple([
|
|
360
|
+
ExecutionPayloadSchema,
|
|
361
|
+
ProfileOptionsSchema
|
|
362
|
+
]),
|
|
363
|
+
output: TxProfileResult.schema
|
|
364
|
+
}),
|
|
365
|
+
sendTx: z.function({
|
|
366
|
+
input: z.tuple([
|
|
367
|
+
ExecutionPayloadSchema,
|
|
368
|
+
SendOptionsSchema
|
|
369
|
+
]),
|
|
370
|
+
output: z.union([
|
|
371
|
+
z.object({
|
|
372
|
+
txHash: TxHash.schema
|
|
373
|
+
}).merge(OffchainOutputSchema),
|
|
374
|
+
z.object({
|
|
375
|
+
receipt: TxReceiptSchema
|
|
376
|
+
}).merge(OffchainOutputSchema)
|
|
377
|
+
])
|
|
378
|
+
}),
|
|
379
|
+
createAuthWit: z.function({
|
|
380
|
+
input: z.tuple([
|
|
381
|
+
schemas.AztecAddress,
|
|
382
|
+
MessageHashOrIntentSchema
|
|
383
|
+
]),
|
|
384
|
+
output: AuthWitness.schema
|
|
385
|
+
}),
|
|
386
|
+
requestCapabilities: z.function({
|
|
387
|
+
input: z.tuple([
|
|
388
|
+
AppCapabilitiesSchema
|
|
389
|
+
]),
|
|
390
|
+
output: WalletCapabilitiesSchema
|
|
391
|
+
})
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* Creates batch schemas from the individual wallet methods.
|
|
395
|
+
* This allows us to define them once and derive batch schemas automatically,
|
|
396
|
+
* reducing duplication and ensuring consistency.
|
|
397
|
+
*/ function createBatchSchemas(methodSchemas) {
|
|
398
|
+
const names = Object.keys(methodSchemas);
|
|
399
|
+
const namesAndArgs = names.map((name)=>z.object({
|
|
400
|
+
name: z.literal(name),
|
|
401
|
+
args: getSchemaParameters(methodSchemas[name])
|
|
402
|
+
}));
|
|
403
|
+
const namesAndReturns = names.map((name)=>{
|
|
404
|
+
const returnType = getSchemaReturnType(methodSchemas[name]);
|
|
405
|
+
return z.object({
|
|
406
|
+
name: z.literal(name),
|
|
407
|
+
// void-returning methods serialize to a missing `result` key over JSON-RPC, so their field must be optional:
|
|
408
|
+
// value-returning methods keep it required so a dropped result is still caught.
|
|
409
|
+
result: returnType instanceof z.ZodVoid ? returnType.optional() : returnType
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
// Type assertion needed because discriminatedUnion expects a tuple type [T, T, ...T[]]
|
|
413
|
+
// but we're building the array dynamically. The runtime behavior is correct.
|
|
414
|
+
return {
|
|
415
|
+
input: z.discriminatedUnion('name', namesAndArgs),
|
|
416
|
+
output: z.discriminatedUnion('name', namesAndReturns)
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
const { input: BatchedMethodSchema, output: BatchedResultSchema } = createBatchSchemas(WalletMethodSchemas);
|
|
420
|
+
export { BatchedMethodSchema, BatchedResultSchema };
|
|
421
|
+
export const WalletSchema = {
|
|
422
|
+
...WalletMethodSchemas,
|
|
423
|
+
// @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
|
|
424
|
+
batch: z.function({
|
|
425
|
+
input: z.tuple([
|
|
426
|
+
z.array(BatchedMethodSchema)
|
|
427
|
+
]),
|
|
428
|
+
output: z.array(BatchedResultSchema)
|
|
429
|
+
})
|
|
430
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aztec-labs/aztec.js",
|
|
3
|
+
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
+
"version": "6.0.0-nightly.20260829",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./abi": "./dest/api/abi.js",
|
|
8
|
+
"./account": "./dest/api/account.js",
|
|
9
|
+
"./addresses": "./dest/api/addresses.js",
|
|
10
|
+
"./authorization": "./dest/api/authorization.js",
|
|
11
|
+
"./block": "./dest/api/block.js",
|
|
12
|
+
"./contracts": "./dest/api/contract.js",
|
|
13
|
+
"./crypto": "./dest/api/crypto.js",
|
|
14
|
+
"./deployment": "./dest/api/deployment.js",
|
|
15
|
+
"./ethereum": "./dest/api/ethereum.js",
|
|
16
|
+
"./events": "./dest/api/events.js",
|
|
17
|
+
"./fee": "./dest/api/fee.js",
|
|
18
|
+
"./fee/testing": "./dest/api/fee_testing.js",
|
|
19
|
+
"./fields": "./dest/api/fields.js",
|
|
20
|
+
"./keys": "./dest/api/keys.js",
|
|
21
|
+
"./log": "./dest/api/log.js",
|
|
22
|
+
"./messaging": "./dest/api/messaging.js",
|
|
23
|
+
"./node": "./dest/api/node.js",
|
|
24
|
+
"./note": "./dest/api/note.js",
|
|
25
|
+
"./protocol": "./dest/api/protocol.js",
|
|
26
|
+
"./trees": "./dest/api/trees.js",
|
|
27
|
+
"./tx": "./dest/api/tx.js",
|
|
28
|
+
"./utils": "./dest/api/utils.js",
|
|
29
|
+
"./wallet": "./dest/api/wallet.js"
|
|
30
|
+
},
|
|
31
|
+
"typedocOptions": {
|
|
32
|
+
"entryPoints": [
|
|
33
|
+
"./src/api/abi.ts",
|
|
34
|
+
"./src/api/account.ts",
|
|
35
|
+
"./src/api/contract.ts",
|
|
36
|
+
"./src/api/deployment.ts",
|
|
37
|
+
"./src/api/ethereum.ts",
|
|
38
|
+
"./src/api/fee.ts",
|
|
39
|
+
"./src/api/fields.ts",
|
|
40
|
+
"./src/api/keys.ts",
|
|
41
|
+
"./src/api/tx.ts",
|
|
42
|
+
"./src/api/wallet.ts"
|
|
43
|
+
],
|
|
44
|
+
"name": "Aztec.js",
|
|
45
|
+
"tsconfig": "./tsconfig.json"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
49
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
50
|
+
"build:ts": "../scripts/tsc.sh",
|
|
51
|
+
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts ./src/contract/protocol_contracts",
|
|
52
|
+
"generate": "node --no-warnings --loader @swc-node/register/esm src/scripts/generate_protocol_contract_types.ts && run -T prettier -w src/contract/protocol_contracts",
|
|
53
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
54
|
+
},
|
|
55
|
+
"inherits": [
|
|
56
|
+
"../package.common.json",
|
|
57
|
+
"./package.local.json"
|
|
58
|
+
],
|
|
59
|
+
"jest": {
|
|
60
|
+
"moduleNameMapper": {
|
|
61
|
+
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
62
|
+
},
|
|
63
|
+
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
64
|
+
"rootDir": "./src",
|
|
65
|
+
"transform": {
|
|
66
|
+
"^.+\\.tsx?$": [
|
|
67
|
+
"@swc/jest",
|
|
68
|
+
{
|
|
69
|
+
"jsc": {
|
|
70
|
+
"parser": {
|
|
71
|
+
"syntax": "typescript",
|
|
72
|
+
"decorators": true
|
|
73
|
+
},
|
|
74
|
+
"transform": {
|
|
75
|
+
"decoratorVersion": "2022-03"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"extensionsToTreatAsEsm": [
|
|
82
|
+
".ts"
|
|
83
|
+
],
|
|
84
|
+
"reporters": [
|
|
85
|
+
"default"
|
|
86
|
+
],
|
|
87
|
+
"testTimeout": 120000,
|
|
88
|
+
"setupFiles": [
|
|
89
|
+
"../../foundation/src/jest/setup.mjs"
|
|
90
|
+
],
|
|
91
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
92
|
+
"setupFilesAfterEnv": [
|
|
93
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"dependencies": {
|
|
97
|
+
"@aztec-labs/constants": "6.0.0-nightly.20260829",
|
|
98
|
+
"@aztec-labs/entrypoints": "6.0.0-nightly.20260829",
|
|
99
|
+
"@aztec-labs/ethereum": "6.0.0-nightly.20260829",
|
|
100
|
+
"@aztec-labs/foundation": "6.0.0-nightly.20260829",
|
|
101
|
+
"@aztec-labs/protocol-contracts": "6.0.0-nightly.20260829",
|
|
102
|
+
"@aztec-labs/standard-contracts": "6.0.0-nightly.20260829",
|
|
103
|
+
"@aztec-labs/stdlib": "6.0.0-nightly.20260829",
|
|
104
|
+
"@aztec/l1-artifacts": "6.0.0-nightly.20260826",
|
|
105
|
+
"axios": "^1.15.1",
|
|
106
|
+
"tslib": "^2.4.0",
|
|
107
|
+
"viem": "npm:@aztec/viem@2.38.2",
|
|
108
|
+
"zod": "^4"
|
|
109
|
+
},
|
|
110
|
+
"devDependencies": {
|
|
111
|
+
"@aztec-labs/builder": "6.0.0-nightly.20260829",
|
|
112
|
+
"@aztec/protocol-contracts-artifacts": "6.0.0-nightly.20260826",
|
|
113
|
+
"@jest/globals": "^30.0.0",
|
|
114
|
+
"@types/jest": "^30.0.0",
|
|
115
|
+
"@types/node": "^22.15.17",
|
|
116
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
117
|
+
"buffer": "^6.0.3",
|
|
118
|
+
"crypto-browserify": "^3.12.1",
|
|
119
|
+
"jest": "^30.0.0",
|
|
120
|
+
"jest-mock-extended": "^4.0.0",
|
|
121
|
+
"process": "^0.11.10",
|
|
122
|
+
"resolve-typescript-plugin": "^2.0.1",
|
|
123
|
+
"stream-browserify": "^3.0.0",
|
|
124
|
+
"ts-loader": "^9.5.4",
|
|
125
|
+
"ts-node": "^10.9.1",
|
|
126
|
+
"typescript": "^5.3.3",
|
|
127
|
+
"util": "^0.12.5"
|
|
128
|
+
},
|
|
129
|
+
"files": [
|
|
130
|
+
"dest",
|
|
131
|
+
"src",
|
|
132
|
+
"!*.test.*"
|
|
133
|
+
],
|
|
134
|
+
"types": "./dest/index.d.ts",
|
|
135
|
+
"engines": {
|
|
136
|
+
"node": ">=20.10"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { DefaultAccountEntrypointOptions } from '@aztec-labs/entrypoints/account';
|
|
2
|
+
import type { AuthWitnessProvider, ChainInfo, EntrypointInterface } from '@aztec-labs/entrypoints/interfaces';
|
|
3
|
+
import { AuthWitness } from '@aztec-labs/stdlib/auth-witness';
|
|
4
|
+
import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
|
|
5
|
+
import type { CompleteAddress } from '@aztec-labs/stdlib/contract';
|
|
6
|
+
import type { GasSettings } from '@aztec-labs/stdlib/gas';
|
|
7
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec-labs/stdlib/tx';
|
|
8
|
+
|
|
9
|
+
import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Provides authorization for actions via the AuthWitness mechanism.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthorizationProvider {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an authentication witness from an inner hash with consumer, or a call intent
|
|
17
|
+
* @param intent - The action (or inner hash) to authorize
|
|
18
|
+
* @param chainInfo - Chain information needed for message hash computation
|
|
19
|
+
*/
|
|
20
|
+
createAuthWit(intent: IntentInnerHash | CallIntent, chainInfo: ChainInfo): Promise<AuthWitness>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// docs:start:account-interface
|
|
24
|
+
/**
|
|
25
|
+
* Minimal interface for transaction execution and authorization.
|
|
26
|
+
*/
|
|
27
|
+
export type Account = EntrypointInterface &
|
|
28
|
+
AuthorizationProvider & {
|
|
29
|
+
/** Returns the complete address for this account. */
|
|
30
|
+
getCompleteAddress(): CompleteAddress;
|
|
31
|
+
/** Returns the address for this account. */
|
|
32
|
+
getAddress(): AztecAddress;
|
|
33
|
+
};
|
|
34
|
+
// docs:end:account-interface
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An account implementation that uses authwits as an authentication mechanism
|
|
38
|
+
* and can assemble transaction execution requests for an entrypoint.
|
|
39
|
+
*/
|
|
40
|
+
export class BaseAccount implements Account {
|
|
41
|
+
constructor(
|
|
42
|
+
private entrypoint: EntrypointInterface,
|
|
43
|
+
private authWitnessProvider: AuthWitnessProvider,
|
|
44
|
+
private completeAddress: CompleteAddress,
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
createTxExecutionRequest(
|
|
48
|
+
exec: ExecutionPayload,
|
|
49
|
+
gasSettings: GasSettings,
|
|
50
|
+
chainInfo: ChainInfo,
|
|
51
|
+
options: DefaultAccountEntrypointOptions,
|
|
52
|
+
): Promise<TxExecutionRequest> {
|
|
53
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, chainInfo, options);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
wrapExecutionPayload(exec: ExecutionPayload, chainInfo: ChainInfo, options?: any): Promise<ExecutionPayload> {
|
|
57
|
+
return this.entrypoint.wrapExecutionPayload(exec, chainInfo, options);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async createAuthWit(messageHashOrIntent: CallIntent | IntentInnerHash, chainInfo: ChainInfo): Promise<AuthWitness> {
|
|
61
|
+
const messageHash = await computeAuthWitMessageHash(messageHashOrIntent, chainInfo);
|
|
62
|
+
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getCompleteAddress(): CompleteAddress {
|
|
66
|
+
return this.completeAddress;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
getAddress(): AztecAddress {
|
|
70
|
+
return this.completeAddress.address;
|
|
71
|
+
}
|
|
72
|
+
}
|