@aztec/aztec.js 0.0.1-commit.fce3e4f → 0.0.1-commit.ff7989d6c
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/dest/account/account.d.ts +25 -40
- package/dest/account/account.d.ts.map +1 -1
- package/dest/account/account.js +19 -47
- package/dest/account/account_contract.d.ts +9 -10
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.d.ts +21 -9
- package/dest/account/account_with_secret_key.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.js +21 -4
- package/dest/account/index.d.ts +4 -3
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +2 -0
- package/dest/account/signerless_account.d.ts +6 -7
- package/dest/account/signerless_account.d.ts.map +1 -1
- package/dest/account/signerless_account.js +8 -11
- package/dest/api/account.d.ts +2 -4
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +1 -3
- package/dest/api/authorization.d.ts +2 -2
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +1 -1
- package/dest/api/contract.d.ts +18 -12
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +16 -10
- package/dest/api/deployment.d.ts +1 -2
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +0 -1
- package/dest/api/events.d.ts +10 -6
- package/dest/api/events.d.ts.map +1 -1
- package/dest/api/events.js +30 -20
- package/dest/api/fields.d.ts +4 -2
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +3 -1
- package/dest/api/keys.d.ts +1 -1
- package/dest/api/keys.js +1 -1
- package/dest/api/node.d.ts +8 -4
- package/dest/api/node.d.ts.map +1 -1
- package/dest/api/node.js +7 -3
- package/dest/api/protocol.d.ts +7 -1
- package/dest/api/protocol.d.ts.map +1 -1
- package/dest/api/protocol.js +6 -0
- package/dest/api/tx.d.ts +2 -2
- package/dest/api/tx.d.ts.map +1 -1
- package/dest/api/tx.js +1 -1
- package/dest/api/wallet.d.ts +3 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +2 -1
- package/dest/authorization/call_authorization_request.d.ts +23 -2
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +8 -10
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +5 -17
- package/dest/contract/batch_call.d.ts +3 -3
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +11 -6
- package/dest/contract/contract_base.d.ts +4 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +3 -12
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +10 -7
- package/dest/contract/deploy_method.d.ts +77 -18
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +56 -30
- package/dest/contract/interaction_options.d.ts +49 -5
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +8 -1
- package/dest/contract/protocol_contracts/auth-registry.d.ts +36 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/auth-registry.js +997 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +15 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +139 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +426 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.js +593 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/public-checks.js +601 -0
- package/dest/contract/wait_for_proven.d.ts +2 -2
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +1 -1
- package/dest/contract/wait_opts.d.ts +16 -0
- package/dest/contract/wait_opts.d.ts.map +1 -0
- package/dest/contract/wait_opts.js +5 -0
- package/dest/deployment/publish_class.js +3 -3
- package/dest/deployment/publish_instance.d.ts +2 -2
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +3 -3
- package/dest/ethereum/portal_manager.d.ts +9 -6
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +17 -18
- package/dest/fee/fee_juice_payment_method_with_claim.js +7 -7
- package/dest/fee/private_fee_payment_method.js +11 -11
- package/dest/fee/public_fee_payment_method.js +11 -11
- package/dest/fee/sponsored_fee_payment.js +3 -3
- 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 +120 -0
- package/dest/utils/abi_types.d.ts +2 -2
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +9 -7
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +6 -10
- package/dest/utils/cross_chain.d.ts +2 -2
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/node.d.ts +12 -1
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +46 -0
- package/dest/utils/pub_key.d.ts +2 -2
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
- package/dest/wallet/account_manager.d.ts +6 -9
- package/dest/wallet/account_manager.d.ts.map +1 -1
- package/dest/wallet/account_manager.js +6 -12
- package/dest/wallet/capabilities.d.ts +452 -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 +47 -8
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +34 -6
- package/dest/wallet/index.d.ts +2 -1
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +1 -0
- package/dest/wallet/wallet.d.ts +1817 -984
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +216 -101
- package/package.json +25 -14
- package/src/account/account.ts +34 -58
- package/src/account/account_contract.ts +7 -8
- package/src/account/account_with_secret_key.ts +34 -9
- package/src/account/index.ts +3 -2
- package/src/account/signerless_account.ts +14 -13
- package/src/api/account.ts +9 -3
- package/src/api/authorization.ts +1 -0
- package/src/api/contract.ts +24 -9
- package/src/api/deployment.ts +0 -1
- package/src/api/events.ts +35 -27
- package/src/api/fields.ts +3 -1
- package/src/api/keys.ts +2 -2
- package/src/api/node.ts +7 -3
- package/src/api/protocol.ts +7 -0
- package/src/api/tx.ts +2 -0
- package/src/api/wallet.ts +52 -3
- package/src/authorization/call_authorization_request.ts +1 -1
- package/src/contract/base_contract_interaction.ts +27 -15
- package/src/contract/batch_call.ts +10 -13
- package/src/contract/contract_function_interaction.ts +17 -7
- package/src/contract/deploy_method.ts +146 -36
- package/src/contract/interaction_options.ts +56 -4
- package/src/contract/protocol_contracts/auth-registry.ts +551 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +99 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
- package/src/contract/protocol_contracts/fee-juice.ts +264 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +334 -0
- package/src/contract/protocol_contracts/public-checks.ts +318 -0
- package/src/contract/wait_for_proven.ts +1 -1
- package/src/contract/wait_opts.ts +21 -0
- package/src/deployment/publish_class.ts +3 -3
- package/src/deployment/publish_instance.ts +3 -6
- package/src/ethereum/portal_manager.ts +20 -24
- package/src/fee/fee_juice_payment_method_with_claim.ts +6 -6
- package/src/fee/private_fee_payment_method.ts +8 -8
- package/src/fee/public_fee_payment_method.ts +9 -9
- package/src/fee/sponsored_fee_payment.ts +3 -3
- package/src/scripts/generate_protocol_contract_types.ts +150 -0
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +20 -8
- package/src/utils/cross_chain.ts +1 -1
- package/src/utils/fee_juice.ts +1 -1
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/node.ts +62 -0
- package/src/utils/pub_key.ts +2 -2
- package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
- package/src/wallet/account_manager.ts +6 -14
- package/src/wallet/capabilities.ts +500 -0
- package/src/wallet/deploy_account_method.ts +75 -14
- package/src/wallet/index.ts +1 -0
- package/src/wallet/wallet.ts +375 -110
- package/dest/account/interface.d.ts +0 -19
- package/dest/account/interface.d.ts.map +0 -1
- package/dest/account/interface.js +0 -5
- package/dest/contract/deploy_sent_tx.d.ts +0 -48
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.js +0 -46
- package/dest/contract/protocol_contracts.d.ts +0 -9
- package/dest/contract/protocol_contracts.d.ts.map +0 -1
- package/dest/contract/protocol_contracts.js +0 -26
- package/dest/contract/sent_tx.d.ts +0 -51
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.js +0 -90
- package/dest/contract/unsafe_contract.d.ts +0 -15
- package/dest/contract/unsafe_contract.d.ts.map +0 -1
- package/dest/contract/unsafe_contract.js +0 -6
- package/dest/deployment/broadcast_function.d.ts +0 -24
- package/dest/deployment/broadcast_function.d.ts.map +0 -1
- package/dest/deployment/broadcast_function.js +0 -74
- package/src/account/interface.ts +0 -25
- package/src/contract/deploy_sent_tx.ts +0 -75
- package/src/contract/protocol_contracts.ts +0 -35
- package/src/contract/sent_tx.ts +0 -130
- package/src/contract/unsafe_contract.ts +0 -19
- package/src/deployment/broadcast_function.ts +0 -148
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B,MAAM,iCAAiC,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAC5B,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,2BAA2B,EAAqC,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAoB,KAAK,YAAY,EAA6B,MAAM,uBAAuB,CAAC;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,OAAO,EACP,YAAY,EACZ,MAAM,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wallet.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionCall } from '@aztec/stdlib/abi';
|
|
2
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
|
-
import {
|
|
4
|
+
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
4
5
|
import { Gas } from '@aztec/stdlib/gas';
|
|
5
|
-
import { AbiDecodedSchema, optional, schemas } from '@aztec/stdlib/schemas';
|
|
6
|
-
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult,
|
|
6
|
+
import { AbiDecodedSchema, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
|
|
7
|
+
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilityExecutionResult, inTxSchema } from '@aztec/stdlib/tx';
|
|
7
8
|
import { z } from 'zod';
|
|
8
|
-
|
|
9
|
-
name: z.string(),
|
|
10
|
-
to: schemas.AztecAddress,
|
|
11
|
-
selector: schemas.FunctionSelector,
|
|
12
|
-
type: z.nativeEnum(FunctionType),
|
|
13
|
-
isStatic: z.boolean(),
|
|
14
|
-
hideMsgSender: z.boolean(),
|
|
15
|
-
args: z.array(schemas.Fr),
|
|
16
|
-
returnTypes: z.array(AbiTypeSchema)
|
|
17
|
-
});
|
|
9
|
+
import { NO_WAIT } from '../contract/interaction_options.js';
|
|
18
10
|
export const ExecutionPayloadSchema = z.object({
|
|
19
|
-
calls: z.array(
|
|
11
|
+
calls: z.array(FunctionCall.schema),
|
|
20
12
|
authWitnesses: z.array(AuthWitness.schema),
|
|
21
13
|
capsules: z.array(Capsule.schema),
|
|
22
14
|
extraHashedArgs: z.array(HashedValues.schema),
|
|
@@ -40,11 +32,22 @@ export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
|
|
|
40
32
|
estimatedGasPadding: optional(z.number()),
|
|
41
33
|
estimateGas: optional(z.boolean())
|
|
42
34
|
});
|
|
35
|
+
export const WaitOptsSchema = z.object({
|
|
36
|
+
ignoreDroppedReceiptsFor: optional(z.number()),
|
|
37
|
+
timeout: optional(z.number()),
|
|
38
|
+
interval: optional(z.number()),
|
|
39
|
+
dontThrowOnRevert: optional(z.boolean())
|
|
40
|
+
});
|
|
43
41
|
export const SendOptionsSchema = z.object({
|
|
44
42
|
from: schemas.AztecAddress,
|
|
45
43
|
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
46
44
|
capsules: optional(z.array(Capsule.schema)),
|
|
47
|
-
fee: optional(GasSettingsOptionSchema)
|
|
45
|
+
fee: optional(GasSettingsOptionSchema),
|
|
46
|
+
wait: optional(z.union([
|
|
47
|
+
z.literal(NO_WAIT),
|
|
48
|
+
WaitOptsSchema
|
|
49
|
+
])),
|
|
50
|
+
additionalScopes: optional(z.array(schemas.AztecAddress))
|
|
48
51
|
});
|
|
49
52
|
export const SimulateOptionsSchema = z.object({
|
|
50
53
|
from: schemas.AztecAddress,
|
|
@@ -53,7 +56,8 @@ export const SimulateOptionsSchema = z.object({
|
|
|
53
56
|
fee: optional(WalletSimulationFeeOptionSchema),
|
|
54
57
|
skipTxValidation: optional(z.boolean()),
|
|
55
58
|
skipFeeEnforcement: optional(z.boolean()),
|
|
56
|
-
includeMetadata: optional(z.boolean())
|
|
59
|
+
includeMetadata: optional(z.boolean()),
|
|
60
|
+
additionalScopes: optional(z.array(schemas.AztecAddress))
|
|
57
61
|
});
|
|
58
62
|
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
59
63
|
profileMode: z.enum([
|
|
@@ -64,87 +68,186 @@ export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
|
64
68
|
skipProofGeneration: optional(z.boolean())
|
|
65
69
|
});
|
|
66
70
|
export const MessageHashOrIntentSchema = z.union([
|
|
67
|
-
schemas.Fr,
|
|
68
71
|
z.object({
|
|
69
72
|
consumer: schemas.AztecAddress,
|
|
70
73
|
innerHash: schemas.Fr
|
|
71
74
|
}),
|
|
72
75
|
z.object({
|
|
73
76
|
caller: schemas.AztecAddress,
|
|
74
|
-
call:
|
|
75
|
-
})
|
|
76
|
-
]);
|
|
77
|
-
export const BatchedMethodSchema = z.union([
|
|
78
|
-
z.object({
|
|
79
|
-
name: z.literal('registerSender'),
|
|
80
|
-
args: z.tuple([
|
|
81
|
-
schemas.AztecAddress,
|
|
82
|
-
optional(z.string())
|
|
83
|
-
])
|
|
84
|
-
}),
|
|
85
|
-
z.object({
|
|
86
|
-
name: z.literal('registerContract'),
|
|
87
|
-
args: z.tuple([
|
|
88
|
-
ContractInstanceWithAddressSchema,
|
|
89
|
-
optional(ContractArtifactSchema),
|
|
90
|
-
optional(schemas.Fr)
|
|
91
|
-
])
|
|
92
|
-
}),
|
|
93
|
-
z.object({
|
|
94
|
-
name: z.literal('sendTx'),
|
|
95
|
-
args: z.tuple([
|
|
96
|
-
ExecutionPayloadSchema,
|
|
97
|
-
SendOptionsSchema
|
|
98
|
-
])
|
|
99
|
-
}),
|
|
100
|
-
z.object({
|
|
101
|
-
name: z.literal('simulateUtility'),
|
|
102
|
-
args: z.tuple([
|
|
103
|
-
FunctionCallSchema,
|
|
104
|
-
optional(z.array(AuthWitness.schema))
|
|
105
|
-
])
|
|
106
|
-
}),
|
|
107
|
-
z.object({
|
|
108
|
-
name: z.literal('simulateTx'),
|
|
109
|
-
args: z.tuple([
|
|
110
|
-
ExecutionPayloadSchema,
|
|
111
|
-
SimulateOptionsSchema
|
|
112
|
-
])
|
|
77
|
+
call: FunctionCall.schema
|
|
113
78
|
})
|
|
114
79
|
]);
|
|
80
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
81
|
+
eventSelector: schemas.EventSelector,
|
|
82
|
+
abiType: AbiTypeSchema,
|
|
83
|
+
fieldNames: z.array(z.string())
|
|
84
|
+
});
|
|
85
|
+
const EventFilterBaseSchema = z.object({
|
|
86
|
+
txHash: optional(TxHash.schema),
|
|
87
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
88
|
+
toBlock: optional(BlockNumberPositiveSchema)
|
|
89
|
+
});
|
|
90
|
+
export const PrivateEventFilterSchema = EventFilterBaseSchema.extend({
|
|
91
|
+
contractAddress: schemas.AztecAddress,
|
|
92
|
+
scopes: z.array(schemas.AztecAddress)
|
|
93
|
+
});
|
|
94
|
+
export const PublicEventFilterSchema = EventFilterBaseSchema.extend({
|
|
95
|
+
contractAddress: optional(schemas.AztecAddress)
|
|
96
|
+
});
|
|
97
|
+
export const PrivateEventSchema = zodFor()(z.object({
|
|
98
|
+
event: AbiDecodedSchema,
|
|
99
|
+
metadata: inTxSchema()
|
|
100
|
+
}));
|
|
101
|
+
export const PublicEventSchema = zodFor()(z.object({
|
|
102
|
+
event: AbiDecodedSchema,
|
|
103
|
+
metadata: z.intersection(inTxSchema(), z.object({
|
|
104
|
+
contractAddress: schemas.AztecAddress
|
|
105
|
+
}))
|
|
106
|
+
}));
|
|
115
107
|
export const ContractMetadataSchema = z.object({
|
|
116
|
-
|
|
117
|
-
ContractInstanceWithAddressSchema,
|
|
118
|
-
z.undefined()
|
|
119
|
-
]),
|
|
108
|
+
instance: optional(ContractInstanceWithAddressSchema),
|
|
120
109
|
isContractInitialized: z.boolean(),
|
|
121
|
-
isContractPublished: z.boolean()
|
|
110
|
+
isContractPublished: z.boolean(),
|
|
111
|
+
isContractUpdated: z.boolean(),
|
|
112
|
+
updatedContractClassId: optional(schemas.Fr)
|
|
122
113
|
});
|
|
123
114
|
export const ContractClassMetadataSchema = z.object({
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
isArtifactRegistered: z.boolean(),
|
|
116
|
+
isContractClassPubliclyRegistered: z.boolean()
|
|
117
|
+
});
|
|
118
|
+
export const ContractFunctionPatternSchema = z.object({
|
|
119
|
+
contract: z.union([
|
|
120
|
+
schemas.AztecAddress,
|
|
121
|
+
z.literal('*')
|
|
122
|
+
]),
|
|
123
|
+
function: z.union([
|
|
124
|
+
z.string(),
|
|
125
|
+
z.literal('*')
|
|
127
126
|
]),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
additionalScopes: optional(z.union([
|
|
128
|
+
z.array(schemas.AztecAddress),
|
|
129
|
+
z.literal('*')
|
|
130
|
+
]))
|
|
131
|
+
});
|
|
132
|
+
export const AccountsCapabilitySchema = z.object({
|
|
133
|
+
type: z.literal('accounts'),
|
|
134
|
+
canGet: optional(z.boolean()),
|
|
135
|
+
canCreateAuthWit: optional(z.boolean())
|
|
136
|
+
});
|
|
137
|
+
export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
|
|
138
|
+
accounts: z.array(z.object({
|
|
139
|
+
alias: z.string(),
|
|
140
|
+
item: schemas.AztecAddress
|
|
141
|
+
}))
|
|
142
|
+
});
|
|
143
|
+
export const ContractsCapabilitySchema = z.object({
|
|
144
|
+
type: z.literal('contracts'),
|
|
145
|
+
contracts: z.union([
|
|
146
|
+
z.literal('*'),
|
|
147
|
+
z.array(schemas.AztecAddress)
|
|
148
|
+
]),
|
|
149
|
+
canRegister: optional(z.boolean()),
|
|
150
|
+
canGetMetadata: optional(z.boolean())
|
|
151
|
+
});
|
|
152
|
+
export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
|
|
153
|
+
export const ContractClassesCapabilitySchema = z.object({
|
|
154
|
+
type: z.literal('contractClasses'),
|
|
155
|
+
classes: z.union([
|
|
156
|
+
z.literal('*'),
|
|
157
|
+
z.array(schemas.Fr)
|
|
158
|
+
]),
|
|
159
|
+
canGetMetadata: z.boolean()
|
|
160
|
+
});
|
|
161
|
+
export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
|
|
162
|
+
export const SimulationCapabilitySchema = z.object({
|
|
163
|
+
type: z.literal('simulation'),
|
|
164
|
+
transactions: optional(z.object({
|
|
165
|
+
scope: z.union([
|
|
166
|
+
z.literal('*'),
|
|
167
|
+
z.array(ContractFunctionPatternSchema)
|
|
168
|
+
])
|
|
169
|
+
})),
|
|
170
|
+
utilities: optional(z.object({
|
|
171
|
+
scope: z.union([
|
|
172
|
+
z.literal('*'),
|
|
173
|
+
z.array(ContractFunctionPatternSchema)
|
|
174
|
+
])
|
|
175
|
+
}))
|
|
176
|
+
});
|
|
177
|
+
export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
|
|
178
|
+
export const TransactionCapabilitySchema = z.object({
|
|
179
|
+
type: z.literal('transaction'),
|
|
180
|
+
scope: z.union([
|
|
181
|
+
z.literal('*'),
|
|
182
|
+
z.array(ContractFunctionPatternSchema)
|
|
132
183
|
])
|
|
133
184
|
});
|
|
134
|
-
export const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
185
|
+
export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
|
|
186
|
+
export const DataCapabilitySchema = z.object({
|
|
187
|
+
type: z.literal('data'),
|
|
188
|
+
addressBook: optional(z.boolean()),
|
|
189
|
+
privateEvents: optional(z.object({
|
|
190
|
+
contracts: z.union([
|
|
191
|
+
z.literal('*'),
|
|
192
|
+
z.array(schemas.AztecAddress)
|
|
193
|
+
])
|
|
194
|
+
}))
|
|
138
195
|
});
|
|
139
|
-
export const
|
|
196
|
+
export const GrantedDataCapabilitySchema = DataCapabilitySchema;
|
|
197
|
+
export const CapabilitySchema = z.discriminatedUnion('type', [
|
|
198
|
+
AccountsCapabilitySchema,
|
|
199
|
+
ContractsCapabilitySchema,
|
|
200
|
+
ContractClassesCapabilitySchema,
|
|
201
|
+
SimulationCapabilitySchema,
|
|
202
|
+
TransactionCapabilitySchema,
|
|
203
|
+
DataCapabilitySchema
|
|
204
|
+
]);
|
|
205
|
+
export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
|
|
206
|
+
GrantedAccountsCapabilitySchema,
|
|
207
|
+
GrantedContractsCapabilitySchema,
|
|
208
|
+
GrantedContractClassesCapabilitySchema,
|
|
209
|
+
GrantedSimulationCapabilitySchema,
|
|
210
|
+
GrantedTransactionCapabilitySchema,
|
|
211
|
+
GrantedDataCapabilitySchema
|
|
212
|
+
]);
|
|
213
|
+
export const AppCapabilitiesSchema = z.object({
|
|
214
|
+
version: z.literal('1.0'),
|
|
215
|
+
metadata: z.object({
|
|
216
|
+
name: z.string(),
|
|
217
|
+
version: z.string(),
|
|
218
|
+
description: optional(z.string()),
|
|
219
|
+
url: optional(z.string()),
|
|
220
|
+
icon: optional(z.string())
|
|
221
|
+
}),
|
|
222
|
+
capabilities: z.array(CapabilitySchema),
|
|
223
|
+
behavior: optional(z.object({
|
|
224
|
+
mode: optional(z.enum([
|
|
225
|
+
'strict',
|
|
226
|
+
'permissive'
|
|
227
|
+
])),
|
|
228
|
+
expiration: optional(z.number())
|
|
229
|
+
}))
|
|
230
|
+
});
|
|
231
|
+
export const WalletCapabilitiesSchema = z.object({
|
|
232
|
+
version: z.literal('1.0'),
|
|
233
|
+
granted: z.array(GrantedCapabilitySchema),
|
|
234
|
+
wallet: z.object({
|
|
235
|
+
name: z.string(),
|
|
236
|
+
version: z.string()
|
|
237
|
+
}),
|
|
238
|
+
expiresAt: optional(z.number())
|
|
239
|
+
});
|
|
240
|
+
/**
|
|
241
|
+
* Record of all wallet method schemas (excluding batch).
|
|
242
|
+
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
243
|
+
*/ const WalletMethodSchemas = {
|
|
140
244
|
getChainInfo: z.function().args().returns(z.object({
|
|
141
245
|
chainId: schemas.Fr,
|
|
142
246
|
version: schemas.Fr
|
|
143
247
|
})),
|
|
144
|
-
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
145
248
|
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
146
|
-
|
|
147
|
-
getPrivateEvents: z.function().args(
|
|
249
|
+
getContractClassMetadata: z.function().args(schemas.Fr).returns(ContractClassMetadataSchema),
|
|
250
|
+
getPrivateEvents: z.function().args(EventMetadataDefinitionSchema, PrivateEventFilterSchema).returns(z.array(PrivateEventSchema)),
|
|
148
251
|
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
149
252
|
getAddressBook: z.function().args().returns(z.array(z.object({
|
|
150
253
|
alias: z.string(),
|
|
@@ -156,31 +259,43 @@ export const WalletSchema = {
|
|
|
156
259
|
}))),
|
|
157
260
|
registerContract: z.function().args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
|
|
158
261
|
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
159
|
-
|
|
262
|
+
executeUtility: z.function().args(FunctionCall.schema, z.object({
|
|
263
|
+
scope: schemas.AztecAddress,
|
|
264
|
+
authWitnesses: optional(z.array(AuthWitness.schema))
|
|
265
|
+
})).returns(UtilityExecutionResult.schema),
|
|
160
266
|
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
161
|
-
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(
|
|
267
|
+
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(z.union([
|
|
268
|
+
TxHash.schema,
|
|
269
|
+
TxReceipt.schema
|
|
270
|
+
])),
|
|
162
271
|
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
272
|
+
requestCapabilities: z.function().args(AppCapabilitiesSchema).returns(WalletCapabilitiesSchema)
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Creates batch schemas from the individual wallet methods.
|
|
276
|
+
* This allows us to define them once and derive batch schemas automatically,
|
|
277
|
+
* reducing duplication and ensuring consistency.
|
|
278
|
+
*/ function createBatchSchemas(methodSchemas) {
|
|
279
|
+
const names = Object.keys(methodSchemas);
|
|
280
|
+
const namesAndArgs = names.map((name)=>z.object({
|
|
281
|
+
name: z.literal(name),
|
|
282
|
+
args: methodSchemas[name].parameters()
|
|
283
|
+
}));
|
|
284
|
+
const namesAndReturns = names.map((name)=>z.object({
|
|
285
|
+
name: z.literal(name),
|
|
286
|
+
result: methodSchemas[name].returnType()
|
|
287
|
+
}));
|
|
288
|
+
// Type assertion needed because discriminatedUnion expects a tuple type [T, T, ...T[]]
|
|
289
|
+
// but we're building the array dynamically. The runtime behavior is correct.
|
|
290
|
+
return {
|
|
291
|
+
input: z.discriminatedUnion('name', namesAndArgs),
|
|
292
|
+
output: z.discriminatedUnion('name', namesAndReturns)
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const { input: BatchedMethodSchema, output: BatchedResultSchema } = createBatchSchemas(WalletMethodSchemas);
|
|
296
|
+
export { BatchedMethodSchema, BatchedResultSchema };
|
|
297
|
+
export const WalletSchema = {
|
|
298
|
+
...WalletMethodSchemas,
|
|
163
299
|
// @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
|
|
164
|
-
batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(
|
|
165
|
-
z.object({
|
|
166
|
-
name: z.literal('registerSender'),
|
|
167
|
-
result: schemas.AztecAddress
|
|
168
|
-
}),
|
|
169
|
-
z.object({
|
|
170
|
-
name: z.literal('registerContract'),
|
|
171
|
-
result: ContractInstanceWithAddressSchema
|
|
172
|
-
}),
|
|
173
|
-
z.object({
|
|
174
|
-
name: z.literal('sendTx'),
|
|
175
|
-
result: TxHash.schema
|
|
176
|
-
}),
|
|
177
|
-
z.object({
|
|
178
|
-
name: z.literal('simulateUtility'),
|
|
179
|
-
result: UtilitySimulationResult.schema
|
|
180
|
-
}),
|
|
181
|
-
z.object({
|
|
182
|
-
name: z.literal('simulateTx'),
|
|
183
|
-
result: TxSimulationResult.schema
|
|
184
|
-
})
|
|
185
|
-
])))
|
|
300
|
+
batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(BatchedResultSchema))
|
|
186
301
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec.js",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
-
"version": "0.0.1-commit.
|
|
4
|
+
"version": "0.0.1-commit.ff7989d6c",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./abi": "./dest/api/abi.js",
|
|
@@ -30,16 +30,26 @@
|
|
|
30
30
|
},
|
|
31
31
|
"typedocOptions": {
|
|
32
32
|
"entryPoints": [
|
|
33
|
-
"./src/
|
|
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"
|
|
34
43
|
],
|
|
35
44
|
"name": "Aztec.js",
|
|
36
45
|
"tsconfig": "./tsconfig.json"
|
|
37
46
|
},
|
|
38
47
|
"scripts": {
|
|
39
|
-
"build": "yarn clean &&
|
|
40
|
-
"build:dev": "
|
|
41
|
-
"build:ts": "
|
|
42
|
-
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
|
|
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",
|
|
43
53
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
44
54
|
},
|
|
45
55
|
"inherits": [
|
|
@@ -84,23 +94,24 @@
|
|
|
84
94
|
]
|
|
85
95
|
},
|
|
86
96
|
"dependencies": {
|
|
87
|
-
"@aztec/constants": "0.0.1-commit.
|
|
88
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
89
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
90
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
91
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
92
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
93
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
97
|
+
"@aztec/constants": "0.0.1-commit.ff7989d6c",
|
|
98
|
+
"@aztec/entrypoints": "0.0.1-commit.ff7989d6c",
|
|
99
|
+
"@aztec/ethereum": "0.0.1-commit.ff7989d6c",
|
|
100
|
+
"@aztec/foundation": "0.0.1-commit.ff7989d6c",
|
|
101
|
+
"@aztec/l1-artifacts": "0.0.1-commit.ff7989d6c",
|
|
102
|
+
"@aztec/protocol-contracts": "0.0.1-commit.ff7989d6c",
|
|
103
|
+
"@aztec/stdlib": "0.0.1-commit.ff7989d6c",
|
|
94
104
|
"axios": "^1.12.0",
|
|
95
105
|
"tslib": "^2.4.0",
|
|
96
106
|
"viem": "npm:@aztec/viem@2.38.2",
|
|
97
107
|
"zod": "^3.23.8"
|
|
98
108
|
},
|
|
99
109
|
"devDependencies": {
|
|
110
|
+
"@aztec/builder": "0.0.1-commit.ff7989d6c",
|
|
100
111
|
"@jest/globals": "^30.0.0",
|
|
101
112
|
"@types/jest": "^30.0.0",
|
|
102
113
|
"@types/node": "^22.15.17",
|
|
103
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
114
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
104
115
|
"buffer": "^6.0.3",
|
|
105
116
|
"crypto-browserify": "^3.12.1",
|
|
106
117
|
"jest": "^30.0.0",
|
package/src/account/account.ts
CHANGED
|
@@ -1,96 +1,72 @@
|
|
|
1
1
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
2
|
-
import {
|
|
2
|
+
import type { AuthWitnessProvider, ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
3
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
6
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
5
7
|
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
6
8
|
|
|
7
9
|
import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
8
|
-
import type { AccountInterface } from './interface.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* with an intent as input, as opposed to just a precomputed inner hash
|
|
12
|
+
* Provides authorization for actions via the AuthWitness mechanism.
|
|
13
13
|
*/
|
|
14
|
-
interface
|
|
14
|
+
export interface AuthorizationProvider {
|
|
15
15
|
/**
|
|
16
|
-
* Creates
|
|
17
|
-
* during function execution
|
|
16
|
+
* Creates an authentication witness from an inner hash with consumer, or a call intent
|
|
18
17
|
* @param intent - The action (or inner hash) to authorize
|
|
18
|
+
* @param chainInfo - Chain information needed for message hash computation
|
|
19
19
|
*/
|
|
20
|
-
createAuthWit(intent: IntentInnerHash | CallIntent
|
|
20
|
+
createAuthWit(intent: IntentInnerHash | CallIntent, chainInfo: ChainInfo): Promise<AuthWitness>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// docs:start:account-interface
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
-
* to authenticate transaction execution requests.
|
|
25
|
+
* Minimal interface for transaction execution and authorization.
|
|
26
26
|
*/
|
|
27
|
-
export type Account =
|
|
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
|
|
28
35
|
|
|
29
36
|
/**
|
|
30
37
|
* An account implementation that uses authwits as an authentication mechanism
|
|
31
38
|
* and can assemble transaction execution requests for an entrypoint.
|
|
32
39
|
*/
|
|
33
40
|
export class BaseAccount implements Account {
|
|
34
|
-
constructor(
|
|
41
|
+
constructor(
|
|
42
|
+
private entrypoint: EntrypointInterface,
|
|
43
|
+
private authWitnessProvider: AuthWitnessProvider,
|
|
44
|
+
private completeAddress: CompleteAddress,
|
|
45
|
+
) {}
|
|
35
46
|
|
|
36
47
|
createTxExecutionRequest(
|
|
37
48
|
exec: ExecutionPayload,
|
|
38
49
|
gasSettings: GasSettings,
|
|
50
|
+
chainInfo: ChainInfo,
|
|
39
51
|
options: DefaultAccountEntrypointOptions,
|
|
40
52
|
): Promise<TxExecutionRequest> {
|
|
41
|
-
return this.
|
|
53
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, chainInfo, options);
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
|
|
45
|
-
return this.
|
|
56
|
+
wrapExecutionPayload(exec: ExecutionPayload, options?: any): Promise<ExecutionPayload> {
|
|
57
|
+
return this.entrypoint.wrapExecutionPayload(exec, options);
|
|
46
58
|
}
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
async createAuthWit(messageHashOrIntent: CallIntent | IntentInnerHash, chainInfo: ChainInfo): Promise<AuthWitness> {
|
|
61
|
+
const messageHash = await computeAuthWitMessageHash(messageHashOrIntent, chainInfo);
|
|
62
|
+
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return this.account.getCompleteAddress();
|
|
65
|
+
getCompleteAddress(): CompleteAddress {
|
|
66
|
+
return this.completeAddress;
|
|
55
67
|
}
|
|
56
68
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return this.getCompleteAddress().address;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Computes an authentication witness from either a message hash or an intent.
|
|
64
|
-
*
|
|
65
|
-
* If a message hash is provided, it will create a witness for the hash directly.
|
|
66
|
-
* Otherwise, it will compute the message hash using the intent, along with the
|
|
67
|
-
* chain id and the version values provided by the wallet.
|
|
68
|
-
*
|
|
69
|
-
* @param messageHashOrIntent - The message hash of the intent to approve
|
|
70
|
-
* @returns The authentication witness
|
|
71
|
-
*/
|
|
72
|
-
async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness> {
|
|
73
|
-
let messageHash: Fr;
|
|
74
|
-
if (Buffer.isBuffer(messageHashOrIntent)) {
|
|
75
|
-
messageHash = Fr.fromBuffer(messageHashOrIntent);
|
|
76
|
-
} else if (messageHashOrIntent instanceof Fr) {
|
|
77
|
-
messageHash = messageHashOrIntent;
|
|
78
|
-
} else {
|
|
79
|
-
messageHash = await this.getMessageHash(messageHashOrIntent);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return this.account.createAuthWit(messageHash);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Returns the message hash for the given intent
|
|
87
|
-
*
|
|
88
|
-
* @param intent - A tuple of (consumer and inner hash) or (caller and action)
|
|
89
|
-
* @returns The message hash
|
|
90
|
-
*/
|
|
91
|
-
private getMessageHash(intent: IntentInnerHash | CallIntent): Promise<Fr> {
|
|
92
|
-
const chainId = this.getChainId();
|
|
93
|
-
const version = this.getVersion();
|
|
94
|
-
return computeAuthWitMessageHash(intent, { chainId, version });
|
|
69
|
+
getAddress(): AztecAddress {
|
|
70
|
+
return this.completeAddress.address;
|
|
95
71
|
}
|
|
96
72
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { AuthWitnessProvider
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
6
6
|
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { Account } from './account.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An account contract instance. Knows its artifact, deployment arguments, how to create
|
|
@@ -31,14 +31,13 @@ export interface AccountContract {
|
|
|
31
31
|
>;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Returns the account
|
|
35
|
-
* The account
|
|
34
|
+
* Returns the account implementation for this account contract given an instance at the provided address.
|
|
35
|
+
* The account is responsible for assembling tx requests given requested function calls, and
|
|
36
36
|
* for creating signed auth witnesses given action identifiers (message hashes).
|
|
37
37
|
* @param address - Address of this account contract.
|
|
38
|
-
* @
|
|
39
|
-
* @returns An account interface instance for creating tx requests and authorizing actions.
|
|
38
|
+
* @returns An account instance for creating tx requests and authorizing actions.
|
|
40
39
|
*/
|
|
41
|
-
|
|
40
|
+
getAccount(address: CompleteAddress): Account;
|
|
42
41
|
|
|
43
42
|
/**
|
|
44
43
|
* Returns the auth witness provider for the given address.
|