@aztec/aztec.js 3.0.0-canary.a9708bd → 3.0.0-devnet.2
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 +60 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +59 -0
- package/dest/account/account_contract.d.ts +5 -5
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_contract.js +0 -1
- package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
- package/dest/account/account_with_secret_key.d.ts.map +1 -0
- package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
- package/dest/account/index.d.ts +1 -4
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +1 -4
- package/dest/account/signerless_account.d.ts +24 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +27 -0
- package/dest/api/abi.d.ts +1 -0
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/account.d.ts +4 -2
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +3 -1
- package/dest/api/addresses.d.ts +1 -0
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +2 -0
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +2 -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 +4 -5
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +3 -3
- 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/ethereum.d.ts +0 -1
- package/dest/api/ethereum.d.ts.map +1 -1
- package/dest/api/ethereum.js +0 -1
- package/dest/api/events.d.ts +12 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +30 -0
- package/dest/api/fee.d.ts +1 -2
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +0 -1
- 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 +1 -0
- package/dest/api/log.d.ts.map +1 -1
- package/dest/api/log.js +1 -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 +21 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +18 -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 +3 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +2 -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 +2 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +10 -6
- package/dest/api/utils.d.ts.map +1 -1
- package/dest/api/utils.js +10 -5
- package/dest/api/wallet.d.ts +4 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +4 -1
- package/dest/contract/base_contract_interaction.d.ts +6 -48
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +6 -106
- package/dest/contract/batch_call.d.ts +6 -14
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +42 -52
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +2 -12
- package/dest/contract/contract_base.d.ts +1 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +29 -40
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +41 -53
- package/dest/contract/deploy_method.d.ts +63 -56
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +68 -86
- package/dest/contract/deploy_sent_tx.d.ts +0 -1
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +7 -10
- package/dest/contract/interaction_options.d.ts +74 -19
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +51 -3
- package/dest/contract/sent_tx.d.ts +3 -3
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +5 -5
- package/dest/contract/wait_for_proven.d.ts +3 -3
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +2 -2
- package/dest/deployment/publish_instance.d.ts +1 -1
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +2 -5
- package/dest/ethereum/portal_manager.d.ts +3 -4
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +3 -5
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +12 -7
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +21 -12
- 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 +22 -5
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +34 -13
- package/dest/fee/public_fee_payment_method.d.ts +22 -5
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +37 -14
- package/dest/fee/sponsored_fee_payment.d.ts +2 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +4 -0
- package/dest/utils/authwit.d.ts +77 -25
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +219 -24
- package/dest/utils/cross_chain.d.ts +24 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +30 -0
- package/dest/utils/fee_juice.d.ts +3 -2
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +3 -2
- package/dest/{fee → wallet}/account_entrypoint_meta_payment_method.d.ts +13 -10
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
- package/dest/wallet/account_manager.d.ts +69 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +113 -0
- package/dest/wallet/base_wallet.d.ts +78 -35
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +216 -48
- package/dest/wallet/deploy_account_method.d.ts +52 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +77 -0
- package/dest/wallet/index.d.ts +2 -15
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -19
- package/dest/wallet/wallet.d.ts +2473 -6
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +202 -3
- package/package.json +25 -21
- package/src/account/account.ts +97 -0
- package/src/account/account_contract.ts +4 -6
- package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
- package/src/account/index.ts +1 -4
- package/src/account/signerless_account.ts +46 -0
- package/src/api/abi.ts +11 -0
- package/src/api/account.ts +4 -2
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +11 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +16 -8
- package/src/api/crypto.ts +1 -0
- package/src/api/ethereum.ts +0 -1
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -2
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +1 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +20 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +2 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +11 -0
- package/src/api/utils.ts +12 -19
- package/src/api/wallet.ts +33 -5
- package/src/contract/base_contract_interaction.ts +9 -138
- package/src/contract/batch_call.ts +52 -61
- package/src/contract/contract.ts +2 -12
- package/src/contract/contract_function_interaction.ts +65 -97
- package/src/contract/deploy_method.ts +117 -99
- package/src/contract/deploy_sent_tx.ts +4 -10
- package/src/contract/interaction_options.ts +126 -24
- package/src/contract/sent_tx.ts +4 -4
- package/src/contract/wait_for_proven.ts +4 -4
- package/src/deployment/publish_instance.ts +3 -8
- package/src/ethereum/portal_manager.ts +4 -12
- package/src/fee/fee_juice_payment_method_with_claim.ts +26 -17
- package/src/fee/fee_payment_method.ts +26 -0
- package/src/fee/private_fee_payment_method.ts +60 -41
- package/src/fee/public_fee_payment_method.ts +73 -49
- package/src/fee/sponsored_fee_payment.ts +6 -0
- package/src/utils/authwit.ts +250 -38
- package/src/utils/cross_chain.ts +53 -0
- package/src/utils/fee_juice.ts +4 -3
- package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
- package/src/wallet/account_manager.ts +154 -0
- package/src/wallet/base_wallet.ts +287 -78
- package/src/wallet/deploy_account_method.ts +125 -0
- package/src/wallet/index.ts +2 -32
- package/src/wallet/wallet.ts +357 -29
- package/dest/account_manager/account_manager.d.ts +0 -119
- package/dest/account_manager/account_manager.d.ts.map +0 -1
- package/dest/account_manager/account_manager.js +0 -202
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.js +0 -29
- package/dest/account_manager/index.d.ts +0 -3
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -2
- package/dest/api/interfaces.d.ts +0 -2
- package/dest/api/interfaces.d.ts.map +0 -1
- package/dest/api/interfaces.js +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/log_id.js +0 -1
- package/dest/api/rpc.d.ts +0 -3
- package/dest/api/rpc.d.ts.map +0 -1
- package/dest/api/rpc.js +0 -2
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -21
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.js +0 -21
- package/dest/contract/proven_tx.d.ts +0 -21
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -23
- package/dest/ethereum/l1_contracts.d.ts +0 -3
- package/dest/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/ethereum/l1_contracts.js +0 -13
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
- package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.js +0 -21
- package/dest/fee/utils.d.ts +0 -13
- package/dest/fee/utils.d.ts.map +0 -1
- package/dest/fee/utils.js +0 -32
- package/dest/index.d.ts +0 -59
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -62
- package/dest/rpc_clients/node/index.d.ts +0 -12
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.js +0 -72
- package/dest/rpc_clients/pxe_client.d.ts +0 -10
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.js +0 -23
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/utils/pxe.js +0 -14
- package/dest/wallet/account_wallet.d.ts +0 -74
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -232
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.d.ts +0 -23
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -33
- package/src/account_manager/account_manager.ts +0 -276
- package/src/account_manager/deploy_account_sent_tx.ts +0 -46
- package/src/account_manager/index.ts +0 -2
- package/src/api/interfaces.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/rpc.ts +0 -2
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -45
- package/src/contract/proven_tx.ts +0 -36
- package/src/ethereum/l1_contracts.ts +0 -21
- package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
- package/src/fee/fee_juice_payment_method.ts +0 -25
- package/src/fee/utils.ts +0 -39
- package/src/index.ts +0 -85
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -246
- package/src/wallet/signerless_wallet.ts +0 -56
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
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,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAE5B,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiB9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIE,CAAC;AAEtC,eAAO,MAAM,2BAA2B;;;;;;;;;;;;oBA7IM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiBG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAD,CAAC;;;EAgIT,CAAC;AAE3C,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CA+C7C,CAAC"}
|
package/dest/wallet/wallet.js
CHANGED
|
@@ -1,3 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionAbiSchema, FunctionType } from '@aztec/stdlib/abi';
|
|
2
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
|
+
import { ContractClassWithIdSchema, ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
4
|
+
import { Gas } from '@aztec/stdlib/gas';
|
|
5
|
+
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
6
|
+
import { AbiDecodedSchema, optional, schemas } from '@aztec/stdlib/schemas';
|
|
7
|
+
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export const ContractInstantiationDataSchema = z.object({
|
|
10
|
+
constructorArtifact: optional(z.union([
|
|
11
|
+
FunctionAbiSchema,
|
|
12
|
+
z.string()
|
|
13
|
+
])),
|
|
14
|
+
constructorArgs: optional(z.array(z.any())),
|
|
15
|
+
skipArgsDecoding: optional(z.boolean()),
|
|
16
|
+
salt: schemas.Fr,
|
|
17
|
+
publicKeys: optional(PublicKeys.schema),
|
|
18
|
+
deployer: optional(schemas.AztecAddress)
|
|
19
|
+
});
|
|
20
|
+
export const FunctionCallSchema = z.object({
|
|
21
|
+
name: z.string(),
|
|
22
|
+
to: schemas.AztecAddress,
|
|
23
|
+
selector: schemas.FunctionSelector,
|
|
24
|
+
type: z.nativeEnum(FunctionType),
|
|
25
|
+
isStatic: z.boolean(),
|
|
26
|
+
hideMsgSender: z.boolean(),
|
|
27
|
+
args: z.array(schemas.Fr),
|
|
28
|
+
returnTypes: z.array(AbiTypeSchema)
|
|
29
|
+
});
|
|
30
|
+
export const ExecutionPayloadSchema = z.object({
|
|
31
|
+
calls: z.array(FunctionCallSchema),
|
|
32
|
+
authWitnesses: z.array(AuthWitness.schema),
|
|
33
|
+
capsules: z.array(Capsule.schema),
|
|
34
|
+
extraHashedArgs: z.array(HashedValues.schema)
|
|
35
|
+
});
|
|
36
|
+
export const UserFeeOptionsSchema = z.object({
|
|
37
|
+
gasSettings: optional(z.object({
|
|
38
|
+
gasLimits: optional(Gas.schema),
|
|
39
|
+
teardownGasLimits: optional(Gas.schema),
|
|
40
|
+
maxFeePerGas: optional(z.object({
|
|
41
|
+
feePerDaGas: schemas.BigInt,
|
|
42
|
+
feePerL2Gas: schemas.BigInt
|
|
43
|
+
})),
|
|
44
|
+
maxPriorityFeePerGas: optional(z.object({
|
|
45
|
+
feePerDaGas: schemas.BigInt,
|
|
46
|
+
feePerL2Gas: schemas.BigInt
|
|
47
|
+
}))
|
|
48
|
+
})),
|
|
49
|
+
embeddedPaymentMethodFeePayer: optional(schemas.AztecAddress)
|
|
50
|
+
});
|
|
51
|
+
export const WalletSimulationFeeOptionSchema = UserFeeOptionsSchema.extend({
|
|
52
|
+
estimatedGasPadding: optional(z.number()),
|
|
53
|
+
estimateGas: optional(z.boolean())
|
|
54
|
+
});
|
|
55
|
+
export const SendOptionsSchema = z.object({
|
|
56
|
+
from: schemas.AztecAddress,
|
|
57
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
58
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
59
|
+
fee: optional(UserFeeOptionsSchema)
|
|
60
|
+
});
|
|
61
|
+
export const SimulateOptionsSchema = z.object({
|
|
62
|
+
from: schemas.AztecAddress,
|
|
63
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
64
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
65
|
+
fee: optional(WalletSimulationFeeOptionSchema),
|
|
66
|
+
skipTxValidation: optional(z.boolean()),
|
|
67
|
+
skipFeeEnforcement: optional(z.boolean()),
|
|
68
|
+
includeMetadata: optional(z.boolean())
|
|
69
|
+
});
|
|
70
|
+
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
71
|
+
profileMode: z.enum([
|
|
72
|
+
'gates',
|
|
73
|
+
'execution-steps',
|
|
74
|
+
'full'
|
|
75
|
+
]),
|
|
76
|
+
skipProofGeneration: optional(z.boolean())
|
|
77
|
+
});
|
|
78
|
+
export const InstanceDataSchema = z.union([
|
|
79
|
+
schemas.AztecAddress,
|
|
80
|
+
ContractInstanceWithAddressSchema,
|
|
81
|
+
ContractInstantiationDataSchema,
|
|
82
|
+
z.object({
|
|
83
|
+
instance: ContractInstanceWithAddressSchema,
|
|
84
|
+
artifact: ContractArtifactSchema
|
|
85
|
+
})
|
|
86
|
+
]);
|
|
87
|
+
export const MessageHashOrIntentSchema = z.union([
|
|
88
|
+
schemas.Fr,
|
|
89
|
+
schemas.Buffer,
|
|
90
|
+
z.object({
|
|
91
|
+
consumer: schemas.AztecAddress,
|
|
92
|
+
innerHash: z.union([
|
|
93
|
+
schemas.Buffer,
|
|
94
|
+
schemas.Fr
|
|
95
|
+
])
|
|
96
|
+
}),
|
|
97
|
+
z.object({
|
|
98
|
+
caller: schemas.AztecAddress,
|
|
99
|
+
call: FunctionCallSchema
|
|
100
|
+
})
|
|
101
|
+
]);
|
|
102
|
+
export const BatchedMethodSchema = z.union([
|
|
103
|
+
z.object({
|
|
104
|
+
name: z.literal('registerSender'),
|
|
105
|
+
args: z.tuple([
|
|
106
|
+
schemas.AztecAddress,
|
|
107
|
+
optional(z.string())
|
|
108
|
+
])
|
|
109
|
+
}),
|
|
110
|
+
z.object({
|
|
111
|
+
name: z.literal('registerContract'),
|
|
112
|
+
args: z.tuple([
|
|
113
|
+
InstanceDataSchema,
|
|
114
|
+
optional(ContractArtifactSchema),
|
|
115
|
+
optional(schemas.Fr)
|
|
116
|
+
])
|
|
117
|
+
}),
|
|
118
|
+
z.object({
|
|
119
|
+
name: z.literal('sendTx'),
|
|
120
|
+
args: z.tuple([
|
|
121
|
+
ExecutionPayloadSchema,
|
|
122
|
+
SendOptionsSchema
|
|
123
|
+
])
|
|
124
|
+
}),
|
|
125
|
+
z.object({
|
|
126
|
+
name: z.literal('simulateUtility'),
|
|
127
|
+
args: z.tuple([
|
|
128
|
+
z.string(),
|
|
129
|
+
z.array(z.any()),
|
|
130
|
+
schemas.AztecAddress,
|
|
131
|
+
optional(z.array(AuthWitness.schema))
|
|
132
|
+
])
|
|
133
|
+
})
|
|
134
|
+
]);
|
|
135
|
+
export const ContractMetadataSchema = z.object({
|
|
136
|
+
contractInstance: z.union([
|
|
137
|
+
ContractInstanceWithAddressSchema,
|
|
138
|
+
z.undefined()
|
|
139
|
+
]),
|
|
140
|
+
isContractInitialized: z.boolean(),
|
|
141
|
+
isContractPublished: z.boolean()
|
|
142
|
+
});
|
|
143
|
+
export const ContractClassMetadataSchema = z.object({
|
|
144
|
+
contractClass: z.union([
|
|
145
|
+
ContractClassWithIdSchema,
|
|
146
|
+
z.undefined()
|
|
147
|
+
]),
|
|
148
|
+
isContractClassPubliclyRegistered: z.boolean(),
|
|
149
|
+
artifact: z.union([
|
|
150
|
+
ContractArtifactSchema,
|
|
151
|
+
z.undefined()
|
|
152
|
+
])
|
|
153
|
+
});
|
|
154
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
155
|
+
eventSelector: schemas.EventSelector,
|
|
156
|
+
abiType: AbiTypeSchema,
|
|
157
|
+
fieldNames: z.array(z.string())
|
|
158
|
+
});
|
|
159
|
+
export const WalletSchema = {
|
|
160
|
+
getChainInfo: z.function().args().returns(z.object({
|
|
161
|
+
chainId: schemas.Fr,
|
|
162
|
+
version: schemas.Fr
|
|
163
|
+
})),
|
|
164
|
+
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
165
|
+
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
166
|
+
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
167
|
+
getPrivateEvents: z.function().args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress)).returns(z.array(AbiDecodedSchema)),
|
|
168
|
+
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
169
|
+
getAddressBook: z.function().args().returns(z.array(z.object({
|
|
170
|
+
alias: z.string(),
|
|
171
|
+
item: schemas.AztecAddress
|
|
172
|
+
}))),
|
|
173
|
+
getAccounts: z.function().args().returns(z.array(z.object({
|
|
174
|
+
alias: z.string(),
|
|
175
|
+
item: schemas.AztecAddress
|
|
176
|
+
}))),
|
|
177
|
+
registerContract: z.function().args(InstanceDataSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
|
|
178
|
+
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
179
|
+
simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
|
|
180
|
+
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
181
|
+
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(TxHash.schema),
|
|
182
|
+
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
183
|
+
// @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
|
|
184
|
+
batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(z.discriminatedUnion('name', [
|
|
185
|
+
z.object({
|
|
186
|
+
name: z.literal('registerSender'),
|
|
187
|
+
result: schemas.AztecAddress
|
|
188
|
+
}),
|
|
189
|
+
z.object({
|
|
190
|
+
name: z.literal('registerContract'),
|
|
191
|
+
result: ContractInstanceWithAddressSchema
|
|
192
|
+
}),
|
|
193
|
+
z.object({
|
|
194
|
+
name: z.literal('sendTx'),
|
|
195
|
+
result: TxHash.schema
|
|
196
|
+
}),
|
|
197
|
+
z.object({
|
|
198
|
+
name: z.literal('simulateUtility'),
|
|
199
|
+
result: UtilitySimulationResult.schema
|
|
200
|
+
})
|
|
201
|
+
])))
|
|
202
|
+
};
|
package/package.json
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
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": "3.0.0-
|
|
4
|
+
"version": "3.0.0-devnet.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
".": "./dest/index.js",
|
|
8
|
-
"./interfaces": "./dest/api/interfaces.js",
|
|
9
7
|
"./abi": "./dest/api/abi.js",
|
|
10
8
|
"./account": "./dest/api/account.js",
|
|
11
9
|
"./addresses": "./dest/api/addresses.js",
|
|
12
|
-
"./
|
|
10
|
+
"./authorization": "./dest/api/authorization.js",
|
|
11
|
+
"./block": "./dest/api/block.js",
|
|
13
12
|
"./contracts": "./dest/api/contract.js",
|
|
13
|
+
"./crypto": "./dest/api/crypto.js",
|
|
14
14
|
"./deployment": "./dest/api/deployment.js",
|
|
15
|
-
"./entrypoint": "./dest/api/entrypoint.js",
|
|
16
|
-
"./eth_address": "./dest/api/eth_address.js",
|
|
17
15
|
"./ethereum": "./dest/api/ethereum.js",
|
|
16
|
+
"./events": "./dest/api/events.js",
|
|
18
17
|
"./fee": "./dest/api/fee.js",
|
|
18
|
+
"./fee/testing": "./dest/api/fee_testing.js",
|
|
19
19
|
"./fields": "./dest/api/fields.js",
|
|
20
|
+
"./keys": "./dest/api/keys.js",
|
|
20
21
|
"./log": "./dest/api/log.js",
|
|
21
|
-
"./
|
|
22
|
-
"./
|
|
23
|
-
"./
|
|
24
|
-
"./
|
|
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",
|
|
25
28
|
"./utils": "./dest/api/utils.js",
|
|
26
|
-
"./
|
|
29
|
+
"./wallet": "./dest/api/wallet.js"
|
|
27
30
|
},
|
|
28
31
|
"typedocOptions": {
|
|
29
32
|
"entryPoints": [
|
|
@@ -81,16 +84,17 @@
|
|
|
81
84
|
]
|
|
82
85
|
},
|
|
83
86
|
"dependencies": {
|
|
84
|
-
"@aztec/constants": "3.0.0-
|
|
85
|
-
"@aztec/entrypoints": "3.0.0-
|
|
86
|
-
"@aztec/ethereum": "3.0.0-
|
|
87
|
-
"@aztec/foundation": "3.0.0-
|
|
88
|
-
"@aztec/l1-artifacts": "3.0.0-
|
|
89
|
-
"@aztec/protocol-contracts": "3.0.0-
|
|
90
|
-
"@aztec/stdlib": "3.0.0-
|
|
91
|
-
"axios": "^1.
|
|
87
|
+
"@aztec/constants": "3.0.0-devnet.2",
|
|
88
|
+
"@aztec/entrypoints": "3.0.0-devnet.2",
|
|
89
|
+
"@aztec/ethereum": "3.0.0-devnet.2",
|
|
90
|
+
"@aztec/foundation": "3.0.0-devnet.2",
|
|
91
|
+
"@aztec/l1-artifacts": "3.0.0-devnet.2",
|
|
92
|
+
"@aztec/protocol-contracts": "3.0.0-devnet.2",
|
|
93
|
+
"@aztec/stdlib": "3.0.0-devnet.2",
|
|
94
|
+
"axios": "^1.12.0",
|
|
92
95
|
"tslib": "^2.4.0",
|
|
93
|
-
"viem": "2.
|
|
96
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
|
|
97
|
+
"zod": "^3.23.8"
|
|
94
98
|
},
|
|
95
99
|
"devDependencies": {
|
|
96
100
|
"@jest/globals": "^30.0.0",
|
|
@@ -103,7 +107,7 @@
|
|
|
103
107
|
"process": "^0.11.10",
|
|
104
108
|
"resolve-typescript-plugin": "^2.0.1",
|
|
105
109
|
"stream-browserify": "^3.0.0",
|
|
106
|
-
"ts-loader": "^9.
|
|
110
|
+
"ts-loader": "^9.5.4",
|
|
107
111
|
"ts-node": "^10.9.1",
|
|
108
112
|
"typescript": "^5.3.3",
|
|
109
113
|
"util": "^0.12.5"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
2
|
+
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
|
+
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
7
|
+
|
|
8
|
+
import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
9
|
+
import type { AccountInterface } from './interface.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* An authwit provider that can create both private and public authwits
|
|
13
|
+
* with an intent as input, as opposed to just a precomputed inner hash
|
|
14
|
+
*/
|
|
15
|
+
interface AuthwitnessIntentProvider {
|
|
16
|
+
/**
|
|
17
|
+
* Creates a private authwit from an intent or inner hash, to be provided
|
|
18
|
+
* during function execution
|
|
19
|
+
* @param intent - The action (or inner hash) to authorize
|
|
20
|
+
*/
|
|
21
|
+
createAuthWit(intent: IntentInnerHash | CallIntent | Buffer | Fr): Promise<AuthWitness>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A type defining an account, capable of both creating authwits and using them
|
|
26
|
+
* to authenticate transaction execution requests.
|
|
27
|
+
*/
|
|
28
|
+
export type Account = AccountInterface & AuthwitnessIntentProvider;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An account implementation that uses authwits as an authentication mechanism
|
|
32
|
+
* and can assemble transaction execution requests for an entrypoint.
|
|
33
|
+
*/
|
|
34
|
+
export class BaseAccount implements Account {
|
|
35
|
+
constructor(protected account: AccountInterface) {}
|
|
36
|
+
|
|
37
|
+
createTxExecutionRequest(
|
|
38
|
+
exec: ExecutionPayload,
|
|
39
|
+
gasSettings: GasSettings,
|
|
40
|
+
options: DefaultAccountEntrypointOptions,
|
|
41
|
+
): Promise<TxExecutionRequest> {
|
|
42
|
+
return this.account.createTxExecutionRequest(exec, gasSettings, options);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
getChainId(): Fr {
|
|
46
|
+
return this.account.getChainId();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getVersion(): Fr {
|
|
50
|
+
return this.account.getVersion();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Returns the complete address of the account that implements this wallet. */
|
|
54
|
+
public getCompleteAddress() {
|
|
55
|
+
return this.account.getCompleteAddress();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Returns the address of the account that implements this wallet. */
|
|
59
|
+
public getAddress() {
|
|
60
|
+
return this.getCompleteAddress().address;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Computes an authentication witness from either a message hash or an intent.
|
|
65
|
+
*
|
|
66
|
+
* If a message hash is provided, it will create a witness for the hash directly.
|
|
67
|
+
* Otherwise, it will compute the message hash using the intent, along with the
|
|
68
|
+
* chain id and the version values provided by the wallet.
|
|
69
|
+
*
|
|
70
|
+
* @param messageHashOrIntent - The message hash of the intent to approve
|
|
71
|
+
* @returns The authentication witness
|
|
72
|
+
*/
|
|
73
|
+
async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness> {
|
|
74
|
+
let messageHash: Fr;
|
|
75
|
+
if (Buffer.isBuffer(messageHashOrIntent)) {
|
|
76
|
+
messageHash = Fr.fromBuffer(messageHashOrIntent);
|
|
77
|
+
} else if (messageHashOrIntent instanceof Fr) {
|
|
78
|
+
messageHash = messageHashOrIntent;
|
|
79
|
+
} else {
|
|
80
|
+
messageHash = await this.getMessageHash(messageHashOrIntent);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return this.account.createAuthWit(messageHash);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns the message hash for the given intent
|
|
88
|
+
*
|
|
89
|
+
* @param intent - A tuple of (consumer and inner hash) or (caller and action)
|
|
90
|
+
* @returns The message hash
|
|
91
|
+
*/
|
|
92
|
+
private getMessageHash(intent: IntentInnerHash | CallIntent): Promise<Fr> {
|
|
93
|
+
const chainId = this.getChainId();
|
|
94
|
+
const version = this.getVersion();
|
|
95
|
+
return computeAuthWitMessageHash(intent, { chainId, version });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
1
|
+
import type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
|
-
import type { CompleteAddress
|
|
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
8
|
import type { AccountInterface } from './interface.js';
|
|
9
9
|
|
|
10
|
-
// docs:start:account-contract-interface
|
|
11
10
|
/**
|
|
12
11
|
* An account contract instance. Knows its artifact, deployment arguments, how to create
|
|
13
12
|
* transaction execution requests out of function calls, and how to authorize actions.
|
|
@@ -36,10 +35,10 @@ export interface AccountContract {
|
|
|
36
35
|
* The account interface is responsible for assembling tx requests given requested function calls, and
|
|
37
36
|
* for creating signed auth witnesses given action identifiers (message hashes).
|
|
38
37
|
* @param address - Address of this account contract.
|
|
39
|
-
* @param
|
|
38
|
+
* @param chainInfo - Chain id and version of the rollup where the account contract is initialized / published.
|
|
40
39
|
* @returns An account interface instance for creating tx requests and authorizing actions.
|
|
41
40
|
*/
|
|
42
|
-
getInterface(address: CompleteAddress,
|
|
41
|
+
getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* Returns the auth witness provider for the given address.
|
|
@@ -47,7 +46,6 @@ export interface AccountContract {
|
|
|
47
46
|
*/
|
|
48
47
|
getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
|
|
49
48
|
}
|
|
50
|
-
// docs:end:account-contract-interface
|
|
51
49
|
|
|
52
50
|
/**
|
|
53
51
|
* Compute the address of an account contract from secret and salt.
|
package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts}
RENAMED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
2
|
import { computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
4
3
|
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
4
|
+
import { BaseAccount } from './account.js';
|
|
5
|
+
import type { Salt } from './index.js';
|
|
6
|
+
import type { AccountInterface } from './interface.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
|
-
* Extends {@link
|
|
9
|
+
* Extends {@link Account} with the encryption private key. Not required for
|
|
11
10
|
* implementing the wallet interface but useful for testing purposes or exporting
|
|
12
11
|
* an account to another pxe.
|
|
13
12
|
*/
|
|
14
|
-
export class
|
|
13
|
+
export class AccountWithSecretKey extends BaseAccount {
|
|
15
14
|
constructor(
|
|
16
|
-
pxe: PXE,
|
|
17
15
|
account: AccountInterface,
|
|
18
16
|
private secretKey: Fr,
|
|
19
17
|
/** Deployment salt for this account contract. */
|
|
20
18
|
public readonly salt: Salt,
|
|
21
19
|
) {
|
|
22
|
-
super(
|
|
20
|
+
super(account);
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
/** Returns the encryption private key associated with this account. */
|
package/src/account/index.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `account` module provides utilities for managing accounts.
|
|
3
|
-
* allows to instantiate, initialize and publish a fresh account, or to obtain a `Wallet` instance out of an
|
|
4
|
-
* already-deployed account. Use the `@aztec/accounts` package to load default account implementations that rely
|
|
5
|
-
* on ECDSA or Schnorr signatures.
|
|
2
|
+
* The `account` module provides utilities for managing accounts.
|
|
6
3
|
*
|
|
7
4
|
* @packageDocumentation
|
|
8
5
|
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
3
|
+
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
4
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
5
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
8
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
9
|
+
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
10
|
+
|
|
11
|
+
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
12
|
+
import type { Account } from './account.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
|
|
16
|
+
*/
|
|
17
|
+
export class SignerlessAccount implements Account {
|
|
18
|
+
private entrypoint: EntrypointInterface;
|
|
19
|
+
constructor(chainInfo: ChainInfo) {
|
|
20
|
+
this.entrypoint = new DefaultMultiCallEntrypoint(chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest> {
|
|
24
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getChainId(): Fr {
|
|
28
|
+
throw new Error('SignerlessAccount: Method getChainId not implemented.');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getVersion(): Fr {
|
|
32
|
+
throw new Error('SignerlessAccount: Method getVersion not implemented.');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getCompleteAddress(): CompleteAddress {
|
|
36
|
+
throw new Error('SignerlessAccount: Method getCompleteAddress not implemented.');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getAddress(): AztecAddress {
|
|
40
|
+
throw new Error('SignerlessAccount: Method getAddress not implemented.');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness> {
|
|
44
|
+
throw new Error('SignerlessAccount: Method createAuthWit not implemented.');
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/api/abi.ts
CHANGED
|
@@ -23,3 +23,14 @@ export {
|
|
|
23
23
|
contractArtifactFromBuffer,
|
|
24
24
|
} from '@aztec/stdlib/abi';
|
|
25
25
|
export { type NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
26
|
+
|
|
27
|
+
// Type converters for flexible parameter types in contract calls
|
|
28
|
+
export {
|
|
29
|
+
type AztecAddressLike,
|
|
30
|
+
type EthAddressLike,
|
|
31
|
+
type EventSelectorLike,
|
|
32
|
+
type FieldLike,
|
|
33
|
+
type FunctionSelectorLike,
|
|
34
|
+
type U128Like,
|
|
35
|
+
type WrappedFieldLike,
|
|
36
|
+
} from '../utils/abi_types.js';
|
package/src/api/account.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { type AccountContract, type AccountInterface, type Salt, getAccountContractAddress } from '../account/index.js';
|
|
2
|
-
export type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
export type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { AccountWithSecretKey } from '../account/account_with_secret_key.js';
|
|
5
|
+
export { type Account, BaseAccount } from '../account/account.js';
|
|
6
|
+
export { SignerlessAccount } from '../account/signerless_account.js';
|
package/src/api/addresses.ts
CHANGED
package/src/api/authorization.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
export { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
2
|
+
export {
|
|
3
|
+
SetPublicAuthwitContractInteraction,
|
|
4
|
+
type ContractFunctionInteractionCallIntent,
|
|
5
|
+
getMessageHashFromIntent,
|
|
6
|
+
computeAuthWitMessageHash,
|
|
7
|
+
computeInnerAuthWitHashFromAction,
|
|
8
|
+
lookupValidity,
|
|
9
|
+
type CallIntent,
|
|
10
|
+
type IntentInnerHash,
|
|
11
|
+
} from '../utils/authwit.js';
|
|
12
|
+
export { computeInnerAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
2
13
|
|
|
3
14
|
export { CallAuthorizationRequest } from '../authorization/call_authorization_request.js';
|
package/src/api/block.ts
ADDED
package/src/api/contract.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* or obtaining the `request` for aggregating into a {@link BatchCall}.
|
|
27
27
|
*
|
|
28
28
|
* The result of `send`ing a transaction is a {@link SentTx} object, from which you can get the
|
|
29
|
-
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
29
|
+
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
30
30
|
* has synchronized its changes.
|
|
31
31
|
*
|
|
32
32
|
* @remarks If you are using typescript, consider using the
|
|
@@ -39,20 +39,28 @@ export { Contract } from '../contract/contract.js';
|
|
|
39
39
|
export { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
40
40
|
|
|
41
41
|
export {
|
|
42
|
-
type
|
|
43
|
-
type
|
|
44
|
-
type
|
|
45
|
-
type
|
|
42
|
+
type RequestInteractionOptions,
|
|
43
|
+
type SendInteractionOptions,
|
|
44
|
+
type ProfileInteractionOptions,
|
|
45
|
+
type SimulateInteractionOptions,
|
|
46
|
+
type InteractionFeeOptions,
|
|
47
|
+
toProfileOptions,
|
|
48
|
+
toSendOptions,
|
|
49
|
+
toSimulateOptions,
|
|
46
50
|
} from '../contract/interaction_options.js';
|
|
47
51
|
|
|
48
|
-
export { TxProfileResult } from '@aztec/stdlib/tx';
|
|
49
52
|
export { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js';
|
|
50
|
-
export { ProvenTx } from '../contract/proven_tx.js';
|
|
51
53
|
export { ContractBase, type ContractMethod, type ContractStorageLayout } from '../contract/contract_base.js';
|
|
52
54
|
export { BatchCall } from '../contract/batch_call.js';
|
|
53
|
-
export {
|
|
55
|
+
export {
|
|
56
|
+
type DeployOptions,
|
|
57
|
+
DeployMethod,
|
|
58
|
+
type RequestDeployOptions,
|
|
59
|
+
type SimulateDeployOptions,
|
|
60
|
+
} from '../contract/deploy_method.js';
|
|
54
61
|
export { DeploySentTx } from '../contract/deploy_sent_tx.js';
|
|
55
62
|
export { waitForProven, type WaitForProvenOpts, DefaultWaitForProvenOpts } from '../contract/wait_for_proven.js';
|
|
63
|
+
export { getGasLimits } from '../contract/get_gas_limits.js';
|
|
56
64
|
|
|
57
65
|
export {
|
|
58
66
|
type PartialAddress,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { computeSecretHash } from '@aztec/stdlib/hash';
|
package/src/api/ethereum.ts
CHANGED