From c2ef10c3b6096f24197b83895722b3133a76ff35 Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 07:13:34 +0000 Subject: [PATCH 1/9] remove unnecessary code from aztec.js --- .../aztec.js/src/api/ethereum/anvil_test_watcher.ts | 2 +- yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts | 2 +- yarn-project/aztec.js/src/api/ethereum/index.ts | 6 ------ yarn-project/aztec.js/src/api/ethereum/portal_manager.ts | 5 ++++- .../src/composed/integration_proof_verification.test.ts | 4 ++-- .../src/e2e_epochs/epochs_empty_blocks.test.ts | 2 +- .../end-to-end/src/e2e_epochs/epochs_proof_fails.test.ts | 2 +- yarn-project/end-to-end/src/e2e_epochs/epochs_test.ts | 2 +- yarn-project/end-to-end/src/e2e_fees/fees_test.ts | 2 +- yarn-project/end-to-end/src/e2e_lending_contract.test.ts | 9 ++------- yarn-project/end-to-end/src/e2e_outbox.test.ts | 2 +- yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts | 2 +- .../src/e2e_p2p/upgrade_governance_proposer.test.ts | 3 ++- .../end-to-end/src/e2e_prover/e2e_prover_test.ts | 3 +-- .../end-to-end/src/fixtures/setup_l1_contracts.ts | 4 ++-- yarn-project/end-to-end/src/fixtures/snapshot_manager.ts | 9 +++++++-- yarn-project/end-to-end/src/fixtures/utils.ts | 4 ++-- .../end-to-end/src/shared/cross_chain_test_harness.ts | 8 ++++++-- yarn-project/ethereum/src/contracts/fee_juice.ts | 2 +- yarn-project/ethereum/src/contracts/forwarder.ts | 3 ++- yarn-project/ethereum/src/contracts/governance.ts | 2 +- .../ethereum/src/contracts/governance_proposer.ts | 2 +- yarn-project/ethereum/src/contracts/rollup.ts | 4 +++- yarn-project/ethereum/src/contracts/slashing_proposer.ts | 2 +- .../api/ethereum => ethereum/src/test}/chain_monitor.ts | 0 yarn-project/ethereum/src/test/index.ts | 1 + yarn-project/ethereum/src/test/upgrade_utils.ts | 2 +- yarn-project/ethereum/src/utils.ts | 2 +- 28 files changed, 48 insertions(+), 43 deletions(-) rename yarn-project/{aztec.js/src/api/ethereum => ethereum/src/test}/chain_monitor.ts (100%) diff --git a/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts b/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts index 5b06b45c1cff..35fbbd7d3291 100644 --- a/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts +++ b/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts @@ -4,7 +4,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; import type { TestDateProvider } from '@aztec/foundation/timer'; -import { RollupAbi } from '@aztec/l1-artifacts'; +import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi'; import { type GetContractReturnType, getAddress, getContract } from 'viem'; diff --git a/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts b/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts index ce646c4a6de8..2b5be7c29396 100644 --- a/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts +++ b/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts @@ -3,7 +3,7 @@ import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { EthAddress } from '@aztec/foundation/eth-address'; import { createLogger } from '@aztec/foundation/log'; -import { RollupAbi } from '@aztec/l1-artifacts'; +import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi'; import { type GetContractReturnType, type Hex, createPublicClient, fallback, getContract, http, keccak256 } from 'viem'; import { foundry } from 'viem/chains'; diff --git a/yarn-project/aztec.js/src/api/ethereum/index.ts b/yarn-project/aztec.js/src/api/ethereum/index.ts index f99e90e89197..0bc7b775c243 100644 --- a/yarn-project/aztec.js/src/api/ethereum/index.ts +++ b/yarn-project/aztec.js/src/api/ethereum/index.ts @@ -10,10 +10,4 @@ export { } from './portal_manager.js'; export { getL1ContractAddresses } from './l1_contracts.js'; export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js'; -export { ChainMonitor } from './chain_monitor.js'; export { AnvilTestWatcher } from './anvil_test_watcher.js'; -export { - deployL1Contract, - deployL1Contracts, - type DeployL1ContractsReturnType, -} from '@aztec/ethereum/deploy-l1-contracts'; diff --git a/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts index 368c7411165e..37ce8c50428a 100644 --- a/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts +++ b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts @@ -5,7 +5,10 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import type { Logger } from '@aztec/foundation/log'; import type { SiblingPath } from '@aztec/foundation/trees'; -import { FeeJuicePortalAbi, OutboxAbi, TestERC20Abi, TokenPortalAbi } from '@aztec/l1-artifacts'; +import { FeeJuicePortalAbi } from '@aztec/l1-artifacts/FeeJuicePortalAbi'; +import { OutboxAbi } from '@aztec/l1-artifacts/OutboxAbi'; +import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi'; +import { TokenPortalAbi } from '@aztec/l1-artifacts/TokenPortalAbi'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import { computeSecretHash } from '@aztec/stdlib/hash'; import type { PXE } from '@aztec/stdlib/interfaces/client'; diff --git a/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts b/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts index 0459b9a660bf..dd686e466254 100644 --- a/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts @@ -1,6 +1,6 @@ -import { deployL1Contract, fileURLToPath } from '@aztec/aztec.js'; +import { fileURLToPath } from '@aztec/aztec.js'; import { BBCircuitVerifier } from '@aztec/bb-prover'; -import { type ViemPublicClient, type ViemWalletClient, createL1Clients } from '@aztec/ethereum'; +import { type ViemPublicClient, type ViemWalletClient, createL1Clients, deployL1Contract } from '@aztec/ethereum'; import type { Logger } from '@aztec/foundation/log'; import { HonkVerifierAbi, HonkVerifierBytecode, IVerifierAbi } from '@aztec/l1-artifacts'; import { Proof } from '@aztec/stdlib/proofs'; diff --git a/yarn-project/end-to-end/src/e2e_epochs/epochs_empty_blocks.test.ts b/yarn-project/end-to-end/src/e2e_epochs/epochs_empty_blocks.test.ts index d9ff11859110..bf62fd820fc6 100644 --- a/yarn-project/end-to-end/src/e2e_epochs/epochs_empty_blocks.test.ts +++ b/yarn-project/end-to-end/src/e2e_epochs/epochs_empty_blocks.test.ts @@ -1,7 +1,7 @@ import { type Logger, sleep } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/ethereum'; // eslint-disable-next-line no-restricted-imports import { RollupContract } from '@aztec/ethereum/contracts'; +import { ChainMonitor } from '@aztec/ethereum/test'; import { jest } from '@jest/globals'; diff --git a/yarn-project/end-to-end/src/e2e_epochs/epochs_proof_fails.test.ts b/yarn-project/end-to-end/src/e2e_epochs/epochs_proof_fails.test.ts index a6ed4aa86543..9b407aee9cc2 100644 --- a/yarn-project/end-to-end/src/e2e_epochs/epochs_proof_fails.test.ts +++ b/yarn-project/end-to-end/src/e2e_epochs/epochs_proof_fails.test.ts @@ -1,6 +1,6 @@ import { type Logger, getTimestampRangeForEpoch, sleep } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/ethereum'; import { RollupContract } from '@aztec/ethereum/contracts'; +import { ChainMonitor } from '@aztec/ethereum/test'; import { type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import type { TestProverNode } from '@aztec/prover-node/test'; diff --git a/yarn-project/end-to-end/src/e2e_epochs/epochs_test.ts b/yarn-project/end-to-end/src/e2e_epochs/epochs_test.ts index 94ac185c9774..de75e0c097f1 100644 --- a/yarn-project/end-to-end/src/e2e_epochs/epochs_test.ts +++ b/yarn-project/end-to-end/src/e2e_epochs/epochs_test.ts @@ -1,7 +1,7 @@ import { AztecNodeService } from '@aztec/aztec-node'; import { Fr, type Logger, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/ethereum'; import { RollupContract } from '@aztec/ethereum/contracts'; +import { ChainMonitor } from '@aztec/ethereum/test'; import { DelayedTxUtils, type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test'; import { randomBytes } from '@aztec/foundation/crypto'; import { withLogNameSuffix } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts index e5a4880f3bab..16c54e865c12 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts @@ -3,7 +3,6 @@ import { type AccountWallet, type AztecAddress, type AztecNode, - ChainMonitor, CheatCodes, type Logger, type PXE, @@ -12,6 +11,7 @@ import { } from '@aztec/aztec.js'; import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { type DeployL1ContractsArgs, RollupContract, createL1Clients } from '@aztec/ethereum'; +import { ChainMonitor } from '@aztec/ethereum/test'; import { EthAddress } from '@aztec/foundation/eth-address'; import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription'; diff --git a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts index 9c5fdffbc31b..03149b538162 100644 --- a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts @@ -1,10 +1,5 @@ -import { - type AccountWallet, - type CheatCodes, - type DeployL1ContractsReturnType, - Fr, - type Logger, -} from '@aztec/aztec.js'; +import { type AccountWallet, type CheatCodes, Fr, type Logger } from '@aztec/aztec.js'; +import type { DeployL1ContractsReturnType } from '@aztec/ethereum'; import type { TestDateProvider } from '@aztec/foundation/timer'; import { RollupAbi } from '@aztec/l1-artifacts'; import { LendingContract } from '@aztec/noir-contracts.js/Lending'; diff --git a/yarn-project/end-to-end/src/e2e_outbox.test.ts b/yarn-project/end-to-end/src/e2e_outbox.test.ts index e08004df4765..780a479b465a 100644 --- a/yarn-project/end-to-end/src/e2e_outbox.test.ts +++ b/yarn-project/end-to-end/src/e2e_outbox.test.ts @@ -3,11 +3,11 @@ import { type AztecNode, BatchCall, type CheatCodes, - type DeployL1ContractsReturnType, EthAddress, Fr, type SiblingPath, } from '@aztec/aztec.js'; +import type { DeployL1ContractsReturnType } from '@aztec/ethereum'; import { sha256ToField } from '@aztec/foundation/crypto'; import { truncateAndPad } from '@aztec/foundation/serialize'; import { OutboxAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index 0b1c7579f13f..c8b9cd9aa296 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -2,9 +2,9 @@ import { getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr'; import type { InitialAccountData } from '@aztec/accounts/testing'; import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node'; import type { AccountWalletWithSecretKey } from '@aztec/aztec.js'; -import { ChainMonitor } from '@aztec/aztec.js/ethereum'; import { RollupContract, getExpectedAddress, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs'; +import { ChainMonitor } from '@aztec/ethereum/test'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { ForwarderAbi, ForwarderBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts index 922c37bb807a..0a53dd1fa529 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts @@ -1,5 +1,6 @@ import type { AztecNodeService } from '@aztec/aztec-node'; -import { deployL1Contract, sleep } from '@aztec/aztec.js'; +import { sleep } from '@aztec/aztec.js'; +import { deployL1Contract } from '@aztec/ethereum'; import { TestERC20Abi as FeeJuiceAbi, GovernanceAbi, diff --git a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts index 2dd3dcaf6e5a..f6167e7a9739 100644 --- a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts @@ -10,16 +10,15 @@ import { type AztecNode, type CheatCodes, type CompleteAddress, - type DeployL1ContractsReturnType, EthAddress, type Logger, type PXE, createLogger, - deployL1Contract, } from '@aztec/aztec.js'; import { BBCircuitVerifier, type ClientProtocolCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; import type { BlobSinkServer } from '@aztec/blob-sink/server'; +import { type DeployL1ContractsReturnType, deployL1Contract } from '@aztec/ethereum'; import { Buffer32 } from '@aztec/foundation/buffer'; import { HonkVerifierAbi, HonkVerifierBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts index e4489960ca48..dcf716d6fccd 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts @@ -1,5 +1,5 @@ -import { type Logger, deployL1Contracts } from '@aztec/aztec.js'; -import type { DeployL1ContractsArgs, L1ContractsConfig } from '@aztec/ethereum'; +import { type Logger } from '@aztec/aztec.js'; +import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree'; import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts'; diff --git a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts index d9ea3e2b42a2..b6131344cbe9 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -9,7 +9,6 @@ import { CheatCodes, type CompleteAddress, type ContractFunctionInteraction, - type DeployL1ContractsReturnType, type FunctionCall, type Logger, type PXE, @@ -18,7 +17,13 @@ import { } from '@aztec/aztec.js'; import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment'; import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server'; -import { type DeployL1ContractsArgs, createL1Clients, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum'; +import { + type DeployL1ContractsArgs, + type DeployL1ContractsReturnType, + createL1Clients, + getL1ContractsConfigEnvVars, + l1Artifacts, +} from '@aztec/ethereum'; import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test'; import { asyncMap } from '@aztec/foundation/async-map'; import { randomBytes } from '@aztec/foundation/crypto'; diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index 18edbcce1aac..abec582e2f09 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -16,7 +16,6 @@ import { BatchCall, CheatCodes, type ContractMethod, - type DeployL1ContractsReturnType, FeeJuicePaymentMethod, type Logger, type PXE, @@ -25,7 +24,6 @@ import { createAztecNodeClient, createLogger, createPXEClient, - deployL1Contracts, makeFetch, waitForPXE, } from '@aztec/aztec.js'; @@ -36,9 +34,11 @@ import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/serv import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants'; import { type DeployL1ContractsArgs, + type DeployL1ContractsReturnType, ForwarderContract, NULL_KEY, createL1Clients, + deployL1Contracts, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts, diff --git a/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts b/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts index e6cb8c017e86..d21b28d1efca 100644 --- a/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts +++ b/yarn-project/end-to-end/src/shared/cross_chain_test_harness.ts @@ -15,10 +15,14 @@ import { type SiblingPath, type TxReceipt, type Wallet, - deployL1Contract, retryUntil, } from '@aztec/aztec.js'; -import type { L1ContractAddresses, ViemPublicClient, ViemWalletClient } from '@aztec/ethereum'; +import { + type L1ContractAddresses, + type ViemPublicClient, + type ViemWalletClient, + deployL1Contract, +} from '@aztec/ethereum'; import { TestERC20Abi, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge'; diff --git a/yarn-project/ethereum/src/contracts/fee_juice.ts b/yarn-project/ethereum/src/contracts/fee_juice.ts index 388adb66278b..da6820f2883a 100644 --- a/yarn-project/ethereum/src/contracts/fee_juice.ts +++ b/yarn-project/ethereum/src/contracts/fee_juice.ts @@ -1,5 +1,5 @@ import { EthAddress } from '@aztec/foundation/eth-address'; -import { TestERC20Abi as FeeJuiceAbi } from '@aztec/l1-artifacts'; +import { TestERC20Abi as FeeJuiceAbi } from '@aztec/l1-artifacts/TestERC20Abi'; import { type GetContractReturnType, type Hex, getContract } from 'viem'; diff --git a/yarn-project/ethereum/src/contracts/forwarder.ts b/yarn-project/ethereum/src/contracts/forwarder.ts index ff7e300e5520..f988a0e7147c 100644 --- a/yarn-project/ethereum/src/contracts/forwarder.ts +++ b/yarn-project/ethereum/src/contracts/forwarder.ts @@ -1,6 +1,7 @@ import { toHex } from '@aztec/foundation/bigint-buffer'; import type { Logger } from '@aztec/foundation/log'; -import { ForwarderAbi, ForwarderBytecode } from '@aztec/l1-artifacts'; +import { ForwarderAbi } from '@aztec/l1-artifacts/ForwarderAbi'; +import { ForwarderBytecode } from '@aztec/l1-artifacts/ForwarderBytecode'; import { type EncodeFunctionDataParameters, diff --git a/yarn-project/ethereum/src/contracts/governance.ts b/yarn-project/ethereum/src/contracts/governance.ts index 2f4d3789aaf9..09d079b6dd4d 100644 --- a/yarn-project/ethereum/src/contracts/governance.ts +++ b/yarn-project/ethereum/src/contracts/governance.ts @@ -1,7 +1,7 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import type { Logger } from '@aztec/foundation/log'; import { sleep } from '@aztec/foundation/sleep'; -import { GovernanceAbi } from '@aztec/l1-artifacts'; +import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi'; import { type EncodeFunctionDataParameters, diff --git a/yarn-project/ethereum/src/contracts/governance_proposer.ts b/yarn-project/ethereum/src/contracts/governance_proposer.ts index 83d7578365c0..75985931815f 100644 --- a/yarn-project/ethereum/src/contracts/governance_proposer.ts +++ b/yarn-project/ethereum/src/contracts/governance_proposer.ts @@ -1,6 +1,6 @@ import { memoize } from '@aztec/foundation/decorators'; import { EthAddress } from '@aztec/foundation/eth-address'; -import { GovernanceProposerAbi } from '@aztec/l1-artifacts'; +import { GovernanceProposerAbi } from '@aztec/l1-artifacts/GovernanceProposerAbi'; import { type GetContractReturnType, type Hex, type TransactionReceipt, encodeFunctionData, getContract } from 'viem'; diff --git a/yarn-project/ethereum/src/contracts/rollup.ts b/yarn-project/ethereum/src/contracts/rollup.ts index 8c33ca146d41..be5062bf7080 100644 --- a/yarn-project/ethereum/src/contracts/rollup.ts +++ b/yarn-project/ethereum/src/contracts/rollup.ts @@ -1,7 +1,9 @@ import { memoize } from '@aztec/foundation/decorators'; import { EthAddress } from '@aztec/foundation/eth-address'; import type { ViemSignature } from '@aztec/foundation/eth-signature'; -import { RollupAbi, RollupStorage, SlasherAbi } from '@aztec/l1-artifacts'; +import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi'; +import { RollupStorage } from '@aztec/l1-artifacts/RollupStorage'; +import { SlasherAbi } from '@aztec/l1-artifacts/SlasherAbi'; import { type Account, type GetContractReturnType, type Hex, getAddress, getContract } from 'viem'; diff --git a/yarn-project/ethereum/src/contracts/slashing_proposer.ts b/yarn-project/ethereum/src/contracts/slashing_proposer.ts index 47d36efd84aa..fcef89a031a3 100644 --- a/yarn-project/ethereum/src/contracts/slashing_proposer.ts +++ b/yarn-project/ethereum/src/contracts/slashing_proposer.ts @@ -1,5 +1,5 @@ import { EthAddress } from '@aztec/foundation/eth-address'; -import { SlashingProposerAbi } from '@aztec/l1-artifacts'; +import { SlashingProposerAbi } from '@aztec/l1-artifacts/SlashingProposerAbi'; import { type GetContractReturnType, type Hex, getContract } from 'viem'; diff --git a/yarn-project/aztec.js/src/api/ethereum/chain_monitor.ts b/yarn-project/ethereum/src/test/chain_monitor.ts similarity index 100% rename from yarn-project/aztec.js/src/api/ethereum/chain_monitor.ts rename to yarn-project/ethereum/src/test/chain_monitor.ts diff --git a/yarn-project/ethereum/src/test/index.ts b/yarn-project/ethereum/src/test/index.ts index 345924d3695c..6b6e5807b512 100644 --- a/yarn-project/ethereum/src/test/index.ts +++ b/yarn-project/ethereum/src/test/index.ts @@ -3,3 +3,4 @@ export * from './eth_cheat_codes_with_state.js'; export * from './start_anvil.js'; export * from './tx_delayer.js'; export * from './upgrade_utils.js'; +export * from './chain_monitor.js'; diff --git a/yarn-project/ethereum/src/test/upgrade_utils.ts b/yarn-project/ethereum/src/test/upgrade_utils.ts index 652fd5bf00c4..3d84ed28afc2 100644 --- a/yarn-project/ethereum/src/test/upgrade_utils.ts +++ b/yarn-project/ethereum/src/test/upgrade_utils.ts @@ -1,6 +1,6 @@ import type { Logger } from '@aztec/foundation/log'; -import { TestERC20Abi as FeeJuiceAbi } from '@aztec/l1-artifacts'; import { GovernanceAbi } from '@aztec/l1-artifacts/GovernanceAbi'; +import { TestERC20Abi as FeeJuiceAbi } from '@aztec/l1-artifacts/TestERC20Abi'; import { type GetContractReturnType, type PrivateKeyAccount, getContract } from 'viem'; diff --git a/yarn-project/ethereum/src/utils.ts b/yarn-project/ethereum/src/utils.ts index 5f028d65ce1a..243f41ae9825 100644 --- a/yarn-project/ethereum/src/utils.ts +++ b/yarn-project/ethereum/src/utils.ts @@ -1,6 +1,6 @@ import type { Fr } from '@aztec/foundation/fields'; import type { Logger } from '@aztec/foundation/log'; -import { ErrorsAbi } from '@aztec/l1-artifacts'; +import { ErrorsAbi } from '@aztec/l1-artifacts/ErrorsAbi'; import { type Abi, From e1601722d24cdf215ce2309154de520cbd23a00a Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 08:33:22 +0000 Subject: [PATCH 2/9] more refactoring --- yarn-project/aztec.js/package.json | 5 +++-- yarn-project/aztec.js/src/account/wallet.ts | 2 +- .../aztec.js/src/account_manager/deploy_account_method.ts | 4 ++-- .../src/account_manager/deploy_account_sent_tx.ts | 2 +- yarn-project/aztec.js/src/account_manager/index.ts | 6 +++--- .../src/{ => api}/contract/base_contract_interaction.ts | 8 ++++---- .../aztec.js/src/{ => api}/contract/batch_call.ts | 2 +- .../aztec.js/src/{ => api}/contract/checker.test.ts | 0 yarn-project/aztec.js/src/{ => api}/contract/checker.ts | 0 .../aztec.js/src/{ => api}/contract/contract.test.ts | 2 +- yarn-project/aztec.js/src/{ => api}/contract/contract.ts | 2 +- .../aztec.js/src/{ => api}/contract/contract_base.ts | 2 +- .../{ => api}/contract/contract_function_interaction.ts | 4 ++-- .../aztec.js/src/{ => api}/contract/deploy_method.ts | 8 ++++---- .../aztec.js/src/{ => api}/contract/deploy_proven_tx.ts | 2 +- .../aztec.js/src/{ => api}/contract/deploy_sent_tx.ts | 2 +- .../src/{ => api}/contract/get_gas_limits.test.ts | 0 .../aztec.js/src/{ => api}/contract/get_gas_limits.ts | 0 yarn-project/aztec.js/src/{ => api}/contract/index.ts | 0 .../aztec.js/src/{ => api}/contract/protocol_contracts.ts | 2 +- yarn-project/aztec.js/src/{ => api}/contract/proven_tx.ts | 2 +- .../aztec.js/src/{ => api}/contract/sent_tx.test.ts | 0 yarn-project/aztec.js/src/{ => api}/contract/sent_tx.ts | 0 .../aztec.js/src/{ => api}/contract/unsafe_contract.ts | 2 +- yarn-project/aztec.js/src/api/ethereum/index.ts | 2 -- .../src/api/{ethereum => test}/anvil_test_watcher.ts | 2 +- .../aztec_cheatcodes.ts => api/test/aztec_cheat_codes.ts} | 0 yarn-project/aztec.js/src/api/{ => test}/cheat_codes.ts | 4 ++-- yarn-project/aztec.js/src/api/test/index.ts | 5 +++++ .../cheat_codes.ts => test/rollup_cheat_codes.ts} | 2 -- yarn-project/aztec.js/src/{ => api}/utils/abi_types.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/authwit.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/fee_juice.ts | 2 +- .../src/{ => api}/utils/field_compressed_string.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/index.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/node.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/pub_key.ts | 0 yarn-project/aztec.js/src/{ => api}/utils/pxe.ts | 0 .../aztec.js/src/deployment/broadcast_function.ts | 4 ++-- yarn-project/aztec.js/src/deployment/contract_deployer.ts | 4 ++-- yarn-project/aztec.js/src/deployment/deploy_instance.ts | 4 ++-- yarn-project/aztec.js/src/deployment/register_class.ts | 4 ++-- .../src/fee/fee_juice_payment_method_with_claim.ts | 2 +- .../aztec.js/src/fee/private_fee_payment_method.ts | 2 +- .../aztec.js/src/fee/public_fee_payment_method.ts | 2 +- yarn-project/aztec.js/src/index.ts | 6 ++---- yarn-project/aztec.js/src/wallet/account_wallet.ts | 6 +++--- yarn-project/aztec.js/src/wallet/base_wallet.ts | 2 +- yarn-project/aztec.js/src/wallet/signerless_wallet.ts | 2 +- yarn-project/aztec/src/sandbox/sandbox.ts | 3 ++- yarn-project/cli/src/cmds/l1/advance_epoch.ts | 3 ++- yarn-project/cli/src/cmds/l1/assume_proven_through.ts | 3 ++- yarn-project/end-to-end/src/e2e_block_building.test.ts | 3 +-- yarn-project/end-to-end/src/e2e_cheat_codes.test.ts | 3 ++- .../cross_chain_messaging_test.ts | 2 +- .../token_bridge_private.test.ts | 3 ++- .../end-to-end/src/e2e_crowdfunding_and_claim.test.ts | 2 +- yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts | 2 +- yarn-project/end-to-end/src/e2e_fees/fees_test.ts | 2 +- yarn-project/end-to-end/src/e2e_lending_contract.test.ts | 3 ++- yarn-project/end-to-end/src/e2e_outbox.test.ts | 2 +- yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts | 3 +-- yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts | 2 +- yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts | 2 +- .../end-to-end/src/e2e_sequencer/gov_proposal.test.ts | 3 ++- yarn-project/end-to-end/src/e2e_synching.test.ts | 2 +- .../end-to-end/src/fixtures/setup_l1_contracts.ts | 2 +- yarn-project/end-to-end/src/fixtures/snapshot_manager.ts | 3 +-- yarn-project/end-to-end/src/fixtures/utils.ts | 3 +-- yarn-project/end-to-end/src/guides/dapp_testing.test.ts | 3 ++- yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts | 2 +- .../end-to-end/src/simulators/lending_simulator.ts | 3 ++- yarn-project/end-to-end/src/spartan/4epochs.test.ts | 2 +- .../end-to-end/src/spartan/gating-passive.test.ts | 2 +- yarn-project/end-to-end/src/spartan/reorg.test.ts | 2 +- yarn-project/end-to-end/src/spartan/utils.ts | 2 +- 76 files changed, 92 insertions(+), 87 deletions(-) rename yarn-project/aztec.js/src/{ => api}/contract/base_contract_interaction.ts (96%) rename yarn-project/aztec.js/src/{ => api}/contract/batch_call.ts (98%) rename yarn-project/aztec.js/src/{ => api}/contract/checker.test.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/checker.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/contract.test.ts (99%) rename yarn-project/aztec.js/src/{ => api}/contract/contract.ts (98%) rename yarn-project/aztec.js/src/{ => api}/contract/contract_base.ts (98%) rename yarn-project/aztec.js/src/{ => api}/contract/contract_function_interaction.ts (98%) rename yarn-project/aztec.js/src/{ => api}/contract/deploy_method.ts (97%) rename yarn-project/aztec.js/src/{ => api}/contract/deploy_proven_tx.ts (95%) rename yarn-project/aztec.js/src/{ => api}/contract/deploy_sent_tx.ts (98%) rename yarn-project/aztec.js/src/{ => api}/contract/get_gas_limits.test.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/get_gas_limits.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/index.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/protocol_contracts.ts (96%) rename yarn-project/aztec.js/src/{ => api}/contract/proven_tx.ts (95%) rename yarn-project/aztec.js/src/{ => api}/contract/sent_tx.test.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/sent_tx.ts (100%) rename yarn-project/aztec.js/src/{ => api}/contract/unsafe_contract.ts (92%) rename yarn-project/aztec.js/src/api/{ethereum => test}/anvil_test_watcher.ts (98%) rename yarn-project/aztec.js/src/{utils/aztec_cheatcodes.ts => api/test/aztec_cheat_codes.ts} (100%) rename yarn-project/aztec.js/src/api/{ => test}/cheat_codes.ts (90%) create mode 100644 yarn-project/aztec.js/src/api/test/index.ts rename yarn-project/aztec.js/src/api/{ethereum/cheat_codes.ts => test/rollup_cheat_codes.ts} (99%) rename yarn-project/aztec.js/src/{ => api}/utils/abi_types.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/authwit.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/fee_juice.ts (90%) rename yarn-project/aztec.js/src/{ => api}/utils/field_compressed_string.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/index.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/node.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/pub_key.ts (100%) rename yarn-project/aztec.js/src/{ => api}/utils/pxe.ts (100%) diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index 89429fc99387..0d044991ecbd 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -10,7 +10,7 @@ "./account": "./dest/api/account.js", "./addresses": "./dest/api/addresses.js", "./cheatcodes": "./dest/api/cheatcodes.js", - "./contracts": "./dest/contract/index.js", + "./contracts": "./dest/api/contract/index.js", "./deployment": "./dest/api/deployment.js", "./entrypoint": "./dest/api/entrypoint.js", "./eth_address": "./dest/api/eth_address.js", @@ -22,7 +22,8 @@ "./rpc": "./dest/rpc_clients/index.js", "./tx_hash": "./dest/api/tx_hash.js", "./wallet": "./dest/api/wallet.js", - "./utils": "./dest/utils/index.js" + "./utils": "./dest/api/utils/index.js", + "./testing": "./dest/api/test/index.js" }, "typedocOptions": { "entryPoints": [ diff --git a/yarn-project/aztec.js/src/account/wallet.ts b/yarn-project/aztec.js/src/account/wallet.ts index baf7f6231962..9624871bf5d6 100644 --- a/yarn-project/aztec.js/src/account/wallet.ts +++ b/yarn-project/aztec.js/src/account/wallet.ts @@ -1,7 +1,7 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness'; import type { PXE } from '@aztec/stdlib/interfaces/client'; -import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; +import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; import type { AccountInterface } from './interface.js'; /** diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts index 76fb1701ce31..dbc9e8d77170 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts @@ -9,9 +9,9 @@ import type { PublicKeys } from '@aztec/stdlib/keys'; import type { AuthWitnessProvider } from '../account/interface.js'; import type { Wallet } from '../account/wallet.js'; +import { Contract } from '../api/contract/contract.js'; +import { DeployMethod, type DeployOptions } from '../api/contract/deploy_method.js'; import type { ExecutionRequestInit } from '../api/entrypoint.js'; -import { Contract } from '../contract/contract.js'; -import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js'; import { EntrypointPayload, computeCombinedPayloadHash } from '../entrypoint/payload.js'; /** diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts index 57a23ef929bf..606d89324245 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts @@ -3,7 +3,7 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxHash, TxReceipt } from '@aztec/stdlib/tx'; import type { Wallet } from '../account/index.js'; -import { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js'; +import { DefaultWaitOpts, SentTx, type WaitOpts } from '../api/contract/sent_tx.js'; /** Extends a transaction receipt with a wallet instance for the newly deployed contract. */ export type DeployAccountTxReceipt = FieldsOf & { diff --git a/yarn-project/aztec.js/src/account_manager/index.ts b/yarn-project/aztec.js/src/account_manager/index.ts index 5f52856fc10f..2c526776c612 100644 --- a/yarn-project/aztec.js/src/account_manager/index.ts +++ b/yarn-project/aztec.js/src/account_manager/index.ts @@ -7,9 +7,9 @@ import { deriveKeys } from '@aztec/stdlib/keys'; import type { AccountContract } from '../account/contract.js'; import type { Salt, Wallet } from '../account/index.js'; import type { AccountInterface } from '../account/interface.js'; -import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js'; -import { Contract } from '../contract/index.js'; -import { DefaultWaitOpts, type WaitOpts } from '../contract/sent_tx.js'; +import { Contract } from '../api/contract/contract.js'; +import { DeployMethod, type DeployOptions } from '../api/contract/deploy_method.js'; +import { DefaultWaitOpts, type WaitOpts } from '../api/contract/sent_tx.js'; import { DefaultMultiCallEntrypoint } from '../entrypoint/default_multi_call_entrypoint.js'; import { AccountWalletWithSecretKey, SignerlessWallet } from '../wallet/index.js'; import { DeployAccountMethod } from './deploy_account_method.js'; diff --git a/yarn-project/aztec.js/src/contract/base_contract_interaction.ts b/yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts similarity index 96% rename from yarn-project/aztec.js/src/contract/base_contract_interaction.ts rename to yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts index 1340329666b1..65e76e0055b3 100644 --- a/yarn-project/aztec.js/src/contract/base_contract_interaction.ts +++ b/yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts @@ -3,10 +3,10 @@ import { createLogger } from '@aztec/foundation/log'; import { GasSettings } from '@aztec/stdlib/gas'; import type { Capsule, TxExecutionRequest, TxProvingResult } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/wallet.js'; -import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; -import type { FeeOptions, UserFeeOptions } from '../entrypoint/payload.js'; -import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js'; +import type { Wallet } from '../../account/wallet.js'; +import type { ExecutionRequestInit } from '../../entrypoint/entrypoint.js'; +import type { FeeOptions, UserFeeOptions } from '../../entrypoint/payload.js'; +import { FeeJuicePaymentMethod } from '../../fee/fee_juice_payment_method.js'; import { getGasLimits } from './get_gas_limits.js'; import { ProvenTx } from './proven_tx.js'; import { SentTx } from './sent_tx.js'; diff --git a/yarn-project/aztec.js/src/contract/batch_call.ts b/yarn-project/aztec.js/src/api/contract/batch_call.ts similarity index 98% rename from yarn-project/aztec.js/src/contract/batch_call.ts rename to yarn-project/aztec.js/src/api/contract/batch_call.ts index e432418ab2e9..0e13666e23ce 100644 --- a/yarn-project/aztec.js/src/contract/batch_call.ts +++ b/yarn-project/aztec.js/src/api/contract/batch_call.ts @@ -1,7 +1,7 @@ import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; import type { SimulateMethodOptions } from './contract_function_interaction.js'; diff --git a/yarn-project/aztec.js/src/contract/checker.test.ts b/yarn-project/aztec.js/src/api/contract/checker.test.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/checker.test.ts rename to yarn-project/aztec.js/src/api/contract/checker.test.ts diff --git a/yarn-project/aztec.js/src/contract/checker.ts b/yarn-project/aztec.js/src/api/contract/checker.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/checker.ts rename to yarn-project/aztec.js/src/api/contract/checker.ts diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/api/contract/contract.test.ts similarity index 99% rename from yarn-project/aztec.js/src/contract/contract.test.ts rename to yarn-project/aztec.js/src/api/contract/contract.test.ts index 48d50f2b07f0..9d4c2021c260 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/api/contract/contract.test.ts @@ -13,7 +13,7 @@ import type { Tx, TxExecutionRequest, TxHash, TxProvingResult, TxReceipt, TxSimu import { type MockProxy, mock } from 'jest-mock-extended'; -import type { Wallet } from '../account/wallet.js'; +import type { Wallet } from '../../account/wallet.js'; import { Contract } from './contract.js'; describe('Contract Class', () => { diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/api/contract/contract.ts similarity index 98% rename from yarn-project/aztec.js/src/contract/contract.ts rename to yarn-project/aztec.js/src/api/contract/contract.ts index db1d2175d079..2e2804cb4238 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/api/contract/contract.ts @@ -3,7 +3,7 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import { getContractClassFromArtifact } from '@aztec/stdlib/contract'; import { PublicKeys } from '@aztec/stdlib/keys'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import { ContractBase } from './contract_base.js'; import { DeployMethod } from './deploy_method.js'; diff --git a/yarn-project/aztec.js/src/contract/contract_base.ts b/yarn-project/aztec.js/src/api/contract/contract_base.ts similarity index 98% rename from yarn-project/aztec.js/src/contract/contract_base.ts rename to yarn-project/aztec.js/src/api/contract/contract_base.ts index bc28318afba7..ba9bea299322 100644 --- a/yarn-project/aztec.js/src/contract/contract_base.ts +++ b/yarn-project/aztec.js/src/api/contract/contract_base.ts @@ -7,7 +7,7 @@ import { } from '@aztec/stdlib/abi'; import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/stdlib/contract'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import { ContractFunctionInteraction } from './contract_function_interaction.js'; /** diff --git a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts b/yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts similarity index 98% rename from yarn-project/aztec.js/src/contract/contract_function_interaction.ts rename to yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts index a3404e20f88b..d449eb9904c9 100644 --- a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts @@ -10,8 +10,8 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { PrivateKernelProverProfileResult } from '@aztec/stdlib/kernel'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/wallet.js'; -import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js'; +import type { Wallet } from '../../account/wallet.js'; +import { FeeJuicePaymentMethod } from '../../fee/fee_juice_payment_method.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; export type { SendMethodOptions }; diff --git a/yarn-project/aztec.js/src/contract/deploy_method.ts b/yarn-project/aztec.js/src/api/contract/deploy_method.ts similarity index 97% rename from yarn-project/aztec.js/src/contract/deploy_method.ts rename to yarn-project/aztec.js/src/api/contract/deploy_method.ts index 271dfdec819e..b72b36eeb895 100644 --- a/yarn-project/aztec.js/src/contract/deploy_method.ts +++ b/yarn-project/aztec.js/src/api/contract/deploy_method.ts @@ -11,10 +11,10 @@ import type { GasSettings } from '@aztec/stdlib/gas'; import type { PublicKeys } from '@aztec/stdlib/keys'; import type { Capsule, TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/index.js'; -import { deployInstance } from '../deployment/deploy_instance.js'; -import { registerContractClass } from '../deployment/register_class.js'; -import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +import type { Wallet } from '../../account/index.js'; +import { deployInstance } from '../../deployment/deploy_instance.js'; +import { registerContractClass } from '../../deployment/register_class.js'; +import type { ExecutionRequestInit } from '../../entrypoint/entrypoint.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; import type { Contract } from './contract.js'; import type { ContractBase } from './contract_base.js'; diff --git a/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts b/yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts similarity index 95% rename from yarn-project/aztec.js/src/contract/deploy_proven_tx.ts rename to yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts index 13d61a308cfa..659ab8cc82b3 100644 --- a/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts +++ b/yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts @@ -3,7 +3,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { Tx } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import type { Contract } from './contract.js'; import { DeploySentTx } from './deploy_sent_tx.js'; import { ProvenTx } from './proven_tx.js'; diff --git a/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts b/yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts similarity index 98% rename from yarn-project/aztec.js/src/contract/deploy_sent_tx.ts rename to yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts index e5992e06da53..1c092b72bbfc 100644 --- a/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts +++ b/yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts @@ -5,7 +5,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client'; import type { TxHash, TxReceipt } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import type { Contract } from './contract.js'; import type { ContractBase } from './contract_base.js'; import { SentTx, type WaitOpts } from './sent_tx.js'; diff --git a/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts b/yarn-project/aztec.js/src/api/contract/get_gas_limits.test.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/get_gas_limits.test.ts rename to yarn-project/aztec.js/src/api/contract/get_gas_limits.test.ts diff --git a/yarn-project/aztec.js/src/contract/get_gas_limits.ts b/yarn-project/aztec.js/src/api/contract/get_gas_limits.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/get_gas_limits.ts rename to yarn-project/aztec.js/src/api/contract/get_gas_limits.ts diff --git a/yarn-project/aztec.js/src/contract/index.ts b/yarn-project/aztec.js/src/api/contract/index.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/index.ts rename to yarn-project/aztec.js/src/api/contract/index.ts diff --git a/yarn-project/aztec.js/src/contract/protocol_contracts.ts b/yarn-project/aztec.js/src/api/contract/protocol_contracts.ts similarity index 96% rename from yarn-project/aztec.js/src/contract/protocol_contracts.ts rename to yarn-project/aztec.js/src/api/contract/protocol_contracts.ts index 0166d5e3f3c7..55fbadaf4e44 100644 --- a/yarn-project/aztec.js/src/contract/protocol_contracts.ts +++ b/yarn-project/aztec.js/src/api/contract/protocol_contracts.ts @@ -1,6 +1,6 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts'; -import type { Wallet } from '../wallet/index.js'; +import type { Wallet } from '../../wallet/index.js'; import { UnsafeContract } from './unsafe_contract.js'; /** Returns a Contract wrapper for the class registerer. */ diff --git a/yarn-project/aztec.js/src/contract/proven_tx.ts b/yarn-project/aztec.js/src/api/contract/proven_tx.ts similarity index 95% rename from yarn-project/aztec.js/src/contract/proven_tx.ts rename to yarn-project/aztec.js/src/api/contract/proven_tx.ts index cbe0a4c87a69..e6ea78f4f983 100644 --- a/yarn-project/aztec.js/src/contract/proven_tx.ts +++ b/yarn-project/aztec.js/src/api/contract/proven_tx.ts @@ -1,7 +1,7 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import { Tx } from '@aztec/stdlib/tx'; -import type { Wallet } from '../account/index.js'; +import type { Wallet } from '../../account/index.js'; import { SentTx } from './sent_tx.js'; /** diff --git a/yarn-project/aztec.js/src/contract/sent_tx.test.ts b/yarn-project/aztec.js/src/api/contract/sent_tx.test.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/sent_tx.test.ts rename to yarn-project/aztec.js/src/api/contract/sent_tx.test.ts diff --git a/yarn-project/aztec.js/src/contract/sent_tx.ts b/yarn-project/aztec.js/src/api/contract/sent_tx.ts similarity index 100% rename from yarn-project/aztec.js/src/contract/sent_tx.ts rename to yarn-project/aztec.js/src/api/contract/sent_tx.ts diff --git a/yarn-project/aztec.js/src/contract/unsafe_contract.ts b/yarn-project/aztec.js/src/api/contract/unsafe_contract.ts similarity index 92% rename from yarn-project/aztec.js/src/contract/unsafe_contract.ts rename to yarn-project/aztec.js/src/api/contract/unsafe_contract.ts index f45b7eb9ba30..7194a9544f73 100644 --- a/yarn-project/aztec.js/src/contract/unsafe_contract.ts +++ b/yarn-project/aztec.js/src/api/contract/unsafe_contract.ts @@ -1,7 +1,7 @@ import type { ContractArtifact } from '@aztec/stdlib/abi'; import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; -import type { Wallet } from '../wallet/index.js'; +import type { Wallet } from '../../wallet/index.js'; import { ContractBase } from './contract_base.js'; /** Unsafe constructor for ContractBase that bypasses the check that the instance is registered in the wallet. */ diff --git a/yarn-project/aztec.js/src/api/ethereum/index.ts b/yarn-project/aztec.js/src/api/ethereum/index.ts index 0bc7b775c243..20790abb1685 100644 --- a/yarn-project/aztec.js/src/api/ethereum/index.ts +++ b/yarn-project/aztec.js/src/api/ethereum/index.ts @@ -9,5 +9,3 @@ export { generateClaimSecret, } from './portal_manager.js'; export { getL1ContractAddresses } from './l1_contracts.js'; -export { RollupCheatCodes, EthCheatCodes } from './cheat_codes.js'; -export { AnvilTestWatcher } from './anvil_test_watcher.js'; diff --git a/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts b/yarn-project/aztec.js/src/api/test/anvil_test_watcher.ts similarity index 98% rename from yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts rename to yarn-project/aztec.js/src/api/test/anvil_test_watcher.ts index 35fbbd7d3291..f4f7aa4b3fb1 100644 --- a/yarn-project/aztec.js/src/api/ethereum/anvil_test_watcher.ts +++ b/yarn-project/aztec.js/src/api/test/anvil_test_watcher.ts @@ -8,7 +8,7 @@ import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi'; import { type GetContractReturnType, getAddress, getContract } from 'viem'; -import { RollupCheatCodes } from './cheat_codes.js'; +import { RollupCheatCodes } from './rollup_cheat_codes.js'; /** * Represents a watcher for a rollup contract. diff --git a/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts b/yarn-project/aztec.js/src/api/test/aztec_cheat_codes.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts rename to yarn-project/aztec.js/src/api/test/aztec_cheat_codes.ts diff --git a/yarn-project/aztec.js/src/api/cheat_codes.ts b/yarn-project/aztec.js/src/api/test/cheat_codes.ts similarity index 90% rename from yarn-project/aztec.js/src/api/cheat_codes.ts rename to yarn-project/aztec.js/src/api/test/cheat_codes.ts index eecb51dfba42..e4068d1a79e0 100644 --- a/yarn-project/aztec.js/src/api/cheat_codes.ts +++ b/yarn-project/aztec.js/src/api/test/cheat_codes.ts @@ -2,8 +2,8 @@ import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import type { PXE } from '@aztec/stdlib/interfaces/client'; -import { AztecCheatCodes } from '../utils/aztec_cheatcodes.js'; -import { RollupCheatCodes } from './ethereum/cheat_codes.js'; +import { AztecCheatCodes } from './aztec_cheat_codes.js'; +import { RollupCheatCodes } from './rollup_cheat_codes.js'; /** * A class that provides utility functions for interacting with the chain. diff --git a/yarn-project/aztec.js/src/api/test/index.ts b/yarn-project/aztec.js/src/api/test/index.ts new file mode 100644 index 000000000000..1b4028228fd1 --- /dev/null +++ b/yarn-project/aztec.js/src/api/test/index.ts @@ -0,0 +1,5 @@ +export { AnvilTestWatcher } from './anvil_test_watcher.js'; +export { RollupCheatCodes } from './rollup_cheat_codes.js'; +export { AztecCheatCodes } from './aztec_cheat_codes.js'; +export { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; +export { CheatCodes } from './cheat_codes.js'; diff --git a/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts b/yarn-project/aztec.js/src/api/test/rollup_cheat_codes.ts similarity index 99% rename from yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts rename to yarn-project/aztec.js/src/api/test/rollup_cheat_codes.ts index 2b5be7c29396..e098165dfd66 100644 --- a/yarn-project/aztec.js/src/api/ethereum/cheat_codes.ts +++ b/yarn-project/aztec.js/src/api/test/rollup_cheat_codes.ts @@ -8,8 +8,6 @@ import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi'; import { type GetContractReturnType, type Hex, createPublicClient, fallback, getContract, http, keccak256 } from 'viem'; import { foundry } from 'viem/chains'; -export { EthCheatCodes }; - /** Cheat codes for the L1 rollup contract. */ export class RollupCheatCodes { private client: ViemPublicClient; diff --git a/yarn-project/aztec.js/src/utils/abi_types.ts b/yarn-project/aztec.js/src/api/utils/abi_types.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/abi_types.ts rename to yarn-project/aztec.js/src/api/utils/abi_types.ts diff --git a/yarn-project/aztec.js/src/utils/authwit.ts b/yarn-project/aztec.js/src/api/utils/authwit.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/authwit.ts rename to yarn-project/aztec.js/src/api/utils/authwit.ts diff --git a/yarn-project/aztec.js/src/utils/fee_juice.ts b/yarn-project/aztec.js/src/api/utils/fee_juice.ts similarity index 90% rename from yarn-project/aztec.js/src/utils/fee_juice.ts rename to yarn-project/aztec.js/src/api/utils/fee_juice.ts index e9fd51fb52ab..603beabe822a 100644 --- a/yarn-project/aztec.js/src/utils/fee_juice.ts +++ b/yarn-project/aztec.js/src/api/utils/fee_juice.ts @@ -3,7 +3,7 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import { deriveStorageSlotInMap } from '@aztec/stdlib/hash'; -import type { PXE } from '../api/interfaces/pxe.js'; +import type { PXE } from '../../api/interfaces/pxe.js'; /** * Returns the owner's fee juice balance. diff --git a/yarn-project/aztec.js/src/utils/field_compressed_string.ts b/yarn-project/aztec.js/src/api/utils/field_compressed_string.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/field_compressed_string.ts rename to yarn-project/aztec.js/src/api/utils/field_compressed_string.ts diff --git a/yarn-project/aztec.js/src/utils/index.ts b/yarn-project/aztec.js/src/api/utils/index.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/index.ts rename to yarn-project/aztec.js/src/api/utils/index.ts diff --git a/yarn-project/aztec.js/src/utils/node.ts b/yarn-project/aztec.js/src/api/utils/node.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/node.ts rename to yarn-project/aztec.js/src/api/utils/node.ts diff --git a/yarn-project/aztec.js/src/utils/pub_key.ts b/yarn-project/aztec.js/src/api/utils/pub_key.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/pub_key.ts rename to yarn-project/aztec.js/src/api/utils/pub_key.ts diff --git a/yarn-project/aztec.js/src/utils/pxe.ts b/yarn-project/aztec.js/src/api/utils/pxe.ts similarity index 100% rename from yarn-project/aztec.js/src/utils/pxe.ts rename to yarn-project/aztec.js/src/api/utils/pxe.ts diff --git a/yarn-project/aztec.js/src/deployment/broadcast_function.ts b/yarn-project/aztec.js/src/deployment/broadcast_function.ts index 5cf1cdf39b99..ab422e25804c 100644 --- a/yarn-project/aztec.js/src/deployment/broadcast_function.ts +++ b/yarn-project/aztec.js/src/deployment/broadcast_function.ts @@ -15,8 +15,8 @@ import { } from '@aztec/stdlib/contract'; import { Capsule } from '@aztec/stdlib/tx'; -import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; -import { getRegistererContract } from '../contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { getRegistererContract } from '../api/contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; /** diff --git a/yarn-project/aztec.js/src/deployment/contract_deployer.ts b/yarn-project/aztec.js/src/deployment/contract_deployer.ts index 10567f04f0fc..88e1acd9c659 100644 --- a/yarn-project/aztec.js/src/deployment/contract_deployer.ts +++ b/yarn-project/aztec.js/src/deployment/contract_deployer.ts @@ -3,8 +3,8 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address'; import { PublicKeys } from '@aztec/stdlib/keys'; import type { Wallet } from '../account/wallet.js'; -import { Contract } from '../contract/contract.js'; -import { DeployMethod } from '../contract/deploy_method.js'; +import { Contract } from '../api/contract/contract.js'; +import { DeployMethod } from '../api/contract/deploy_method.js'; /** * A class for deploying contract. diff --git a/yarn-project/aztec.js/src/deployment/deploy_instance.ts b/yarn-project/aztec.js/src/deployment/deploy_instance.ts index e24fc43dc4b7..5f9d11cf9678 100644 --- a/yarn-project/aztec.js/src/deployment/deploy_instance.ts +++ b/yarn-project/aztec.js/src/deployment/deploy_instance.ts @@ -1,7 +1,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; -import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; -import { getDeployerContract } from '../contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { getDeployerContract } from '../api/contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; /** diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index 4cd770c00a1c..e9a07df25463 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -5,8 +5,8 @@ import { type ContractArtifact, bufferAsFields } from '@aztec/stdlib/abi'; import { getContractClassFromArtifact } from '@aztec/stdlib/contract'; import { Capsule } from '@aztec/stdlib/tx'; -import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; -import { getRegistererContract } from '../contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { getRegistererContract } from '../api/contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; const defaultEmitPublicBytecode = diff --git a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts index 89eae417ea06..ac3d3a808944 100644 --- a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts +++ b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts @@ -3,8 +3,8 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import type { FunctionCall } from '@aztec/stdlib/abi'; import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi'; +import { getFeeJuice } from '../api/contract/protocol_contracts.js'; import type { L2AmountClaim } from '../api/ethereum/portal_manager.js'; -import { getFeeJuice } from '../contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js'; diff --git a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts index a4d0d6752f2b..4d78cd97e91d 100644 --- a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts @@ -4,7 +4,7 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { GasSettings } from '@aztec/stdlib/gas'; import type { Wallet } from '../account/wallet.js'; -import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; import { SignerlessWallet } from '../wallet/signerless_wallet.js'; import type { FeePaymentMethod } from './fee_payment_method.js'; diff --git a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts index 8acae43925ac..a900e2b488cf 100644 --- a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts @@ -4,7 +4,7 @@ import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { GasSettings } from '@aztec/stdlib/gas'; -import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; import type { AccountWallet } from '../wallet/account_wallet.js'; import { SignerlessWallet } from '../wallet/signerless_wallet.js'; import type { FeePaymentMethod } from './fee_payment_method.js'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index db7b56ea4a15..2774a4238f65 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -97,10 +97,8 @@ export { fileURLToPath } from '@aztec/foundation/url'; export * from './api/abi.js'; export * from './api/account.js'; export * from './api/addresses.js'; -export * from './api/cheat_codes.js'; export * from './api/ethereum/index.js'; export * from './api/fee.js'; export * from './api/log.js'; -// Granular export, even if not in the api folder -export * from './contract/index.js'; -export * from './utils/index.js'; +export * from './api/contract/index.js'; +export * from './api/utils/index.js'; diff --git a/yarn-project/aztec.js/src/wallet/account_wallet.ts b/yarn-project/aztec.js/src/wallet/account_wallet.ts index 55983f9322ea..307358909379 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet.ts @@ -7,14 +7,14 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; import type { AccountInterface } from '../account/interface.js'; -import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; -import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; import { type IntentAction, type IntentInnerHash, computeAuthWitMessageHash, computeInnerAuthWitHashFromAction, -} from '../utils/authwit.js'; +} from '../api/utils/authwit.js'; +import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; import { BaseWallet } from './base_wallet.js'; /** diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index c6ef5b918609..ed9ec93bd99a 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -29,8 +29,8 @@ import type { } from '@aztec/stdlib/tx'; import type { Wallet } from '../account/wallet.js'; +import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; -import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; /** * A base class for Wallet implementations diff --git a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts index 022d2052604f..79bc47716438 100644 --- a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts @@ -4,9 +4,9 @@ import type { CompleteAddress } from '@aztec/stdlib/contract'; import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; +import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js'; import type { EntrypointInterface, ExecutionRequestInit } from '../entrypoint/entrypoint.js'; -import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; import { BaseWallet } from './base_wallet.js'; /** diff --git a/yarn-project/aztec/src/sandbox/sandbox.ts b/yarn-project/aztec/src/sandbox/sandbox.ts index b5b4990b2d04..9c7ae1cde522 100644 --- a/yarn-project/aztec/src/sandbox/sandbox.ts +++ b/yarn-project/aztec/src/sandbox/sandbox.ts @@ -2,7 +2,8 @@ import { getSchnorrWallet } from '@aztec/accounts/schnorr'; import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing'; import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; -import { AnvilTestWatcher, EthCheatCodes, SignerlessWallet } from '@aztec/aztec.js'; +import { SignerlessWallet } from '@aztec/aztec.js'; +import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing'; import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client'; import { setupCanonicalL2FeeJuice } from '@aztec/cli/setup-contracts'; import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants'; diff --git a/yarn-project/cli/src/cmds/l1/advance_epoch.ts b/yarn-project/cli/src/cmds/l1/advance_epoch.ts index 4fc5fbbc9c2f..a4003f922318 100644 --- a/yarn-project/cli/src/cmds/l1/advance_epoch.ts +++ b/yarn-project/cli/src/cmds/l1/advance_epoch.ts @@ -1,4 +1,5 @@ -import { CheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js'; +import { createPXEClient, makeFetch } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import type { LogFn } from '@aztec/foundation/log'; export async function advanceEpoch(l1RpcUrls: string[], rpcUrl: string, log: LogFn) { diff --git a/yarn-project/cli/src/cmds/l1/assume_proven_through.ts b/yarn-project/cli/src/cmds/l1/assume_proven_through.ts index 6217b05179ab..2d5aa03f664e 100644 --- a/yarn-project/cli/src/cmds/l1/assume_proven_through.ts +++ b/yarn-project/cli/src/cmds/l1/assume_proven_through.ts @@ -1,4 +1,5 @@ -import { EthCheatCodes, RollupCheatCodes, createPXEClient, makeFetch } from '@aztec/aztec.js'; +import { createPXEClient, makeFetch } from '@aztec/aztec.js'; +import { EthCheatCodes, RollupCheatCodes } from '@aztec/aztec.js/testing'; import type { LogFn } from '@aztec/foundation/log'; export async function assumeProvenThrough( diff --git a/yarn-project/end-to-end/src/e2e_block_building.test.ts b/yarn-project/end-to-end/src/e2e_block_building.test.ts index 2746bc74bd7f..82aa203dcf3b 100644 --- a/yarn-project/end-to-end/src/e2e_block_building.test.ts +++ b/yarn-project/end-to-end/src/e2e_block_building.test.ts @@ -3,10 +3,8 @@ import type { AztecNodeService } from '@aztec/aztec-node'; import { type AccountWallet, AccountWalletWithSecretKey, - AnvilTestWatcher, type AztecAddress, type AztecNode, - type CheatCodes, ContractDeployer, ContractFunctionInteraction, Fr, @@ -20,6 +18,7 @@ import { retryUntil, sleep, } from '@aztec/aztec.js'; +import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing'; import { getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { asyncMap } from '@aztec/foundation/async-map'; import { times, unique } from '@aztec/foundation/collection'; diff --git a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts index 807d35d7287b..ebdec0d7dabb 100644 --- a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts +++ b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts @@ -1,4 +1,5 @@ -import { AnvilTestWatcher, type AztecAddress, type CheatCodes, EthAddress, Fr, type Wallet } from '@aztec/aztec.js'; +import { type AztecAddress, EthAddress, Fr, type Wallet } from '@aztec/aztec.js'; +import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing'; import { EthCheatCodes, type ViemPublicClient, type ViemWalletClient, createL1Clients } from '@aztec/ethereum'; import { RollupContract } from '@aztec/ethereum/contracts'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts index ada71b14e577..83952263927a 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts @@ -4,13 +4,13 @@ import { type AccountWallet, AztecAddress, type AztecNode, - CheatCodes, type CompleteAddress, EthAddress, type Logger, type PXE, createLogger, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { type ViemPublicClient, createL1Clients, deployL1Contract } from '@aztec/ethereum'; import { InboxAbi, OutboxAbi, RollupAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts index db03704e637f..6c4158db185b 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging/token_bridge_private.test.ts @@ -1,4 +1,5 @@ -import { CheatCodes, Fr } from '@aztec/aztec.js'; +import { Fr } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { RollupAbi } from '@aztec/l1-artifacts'; import { getContract } from 'viem'; diff --git a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts index 442a4baa0abb..ab46a9f6ae57 100644 --- a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts +++ b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts @@ -1,6 +1,5 @@ import { type AccountWallet, - type CheatCodes, Fr, HashedValues, type Logger, @@ -9,6 +8,7 @@ import { type UniqueNote, deriveKeys, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { ClaimContract } from '@aztec/noir-contracts.js/Claim'; import { CrowdfundingContract } from '@aztec/noir-contracts.js/Crowdfunding'; import { TestContract } from '@aztec/noir-contracts.js/Test'; diff --git a/yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts b/yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts index b9c5b6f6a3a1..a3ca4d1407cb 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fee_settings.test.ts @@ -2,10 +2,10 @@ import { type AccountWallet, type AztecAddress, type AztecNode, - type CheatCodes, FeeJuicePaymentMethod, retryUntil, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { Fr } from '@aztec/foundation/fields'; import { TestContract } from '@aztec/noir-contracts.js/Test'; import type { GasSettings } from '@aztec/stdlib/gas'; diff --git a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts index 16c54e865c12..e66dab0362f2 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts @@ -3,12 +3,12 @@ import { type AccountWallet, type AztecAddress, type AztecNode, - CheatCodes, type Logger, type PXE, createLogger, sleep, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { type DeployL1ContractsArgs, RollupContract, createL1Clients } from '@aztec/ethereum'; import { ChainMonitor } from '@aztec/ethereum/test'; diff --git a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts index 03149b538162..d7740f51b5fa 100644 --- a/yarn-project/end-to-end/src/e2e_lending_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_lending_contract.test.ts @@ -1,4 +1,5 @@ -import { type AccountWallet, type CheatCodes, Fr, type Logger } from '@aztec/aztec.js'; +import { type AccountWallet, Fr, type Logger } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import type { DeployL1ContractsReturnType } from '@aztec/ethereum'; import type { TestDateProvider } from '@aztec/foundation/timer'; import { RollupAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/end-to-end/src/e2e_outbox.test.ts b/yarn-project/end-to-end/src/e2e_outbox.test.ts index 780a479b465a..c68895de639d 100644 --- a/yarn-project/end-to-end/src/e2e_outbox.test.ts +++ b/yarn-project/end-to-end/src/e2e_outbox.test.ts @@ -2,11 +2,11 @@ import { type AccountWalletWithSecretKey, type AztecNode, BatchCall, - type CheatCodes, EthAddress, Fr, type SiblingPath, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import type { DeployL1ContractsReturnType } from '@aztec/ethereum'; import { sha256ToField } from '@aztec/foundation/crypto'; import { truncateAndPad } from '@aztec/foundation/serialize'; diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index c8b9cd9aa296..e871b9eba2cc 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -4,8 +4,7 @@ import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node'; import type { AccountWalletWithSecretKey } from '@aztec/aztec.js'; import { RollupContract, getExpectedAddress, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs'; -import { ChainMonitor } from '@aztec/ethereum/test'; -import { EthCheatCodesWithState } from '@aztec/ethereum/test'; +import { ChainMonitor, EthCheatCodesWithState } from '@aztec/ethereum/test'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { ForwarderAbi, ForwarderBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; import { SpamContract } from '@aztec/noir-contracts.js/Spam'; diff --git a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts index f6167e7a9739..9bea56c2639a 100644 --- a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts @@ -8,13 +8,13 @@ import { type Archiver, createArchiver } from '@aztec/archiver'; import { type AccountWalletWithSecretKey, type AztecNode, - type CheatCodes, type CompleteAddress, EthAddress, type Logger, type PXE, createLogger, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { BBCircuitVerifier, type ClientProtocolCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; import type { BlobSinkServer } from '@aztec/blob-sink/server'; diff --git a/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts b/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts index 66f67cfb19c6..51c174e18512 100644 --- a/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts +++ b/yarn-project/end-to-end/src/e2e_pruned_blocks.test.ts @@ -2,12 +2,12 @@ import { type AccountWallet, type AztecAddress, type AztecNode, - type CheatCodes, type Logger, MerkleTreeId, type Wallet, retryUntil, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; import { setup } from './fixtures/utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_sequencer/gov_proposal.test.ts b/yarn-project/end-to-end/src/e2e_sequencer/gov_proposal.test.ts index 5979422dfb4c..5c3e5096fd8c 100644 --- a/yarn-project/end-to-end/src/e2e_sequencer/gov_proposal.test.ts +++ b/yarn-project/end-to-end/src/e2e_sequencer/gov_proposal.test.ts @@ -1,4 +1,5 @@ -import type { AztecNode, CheatCodes, Logger, PXE, Wallet } from '@aztec/aztec.js'; +import type { AztecNode, Logger, PXE, Wallet } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { type DeployL1ContractsReturnType, GovernanceProposerContract, diff --git a/yarn-project/end-to-end/src/e2e_synching.test.ts b/yarn-project/end-to-end/src/e2e_synching.test.ts index 89c4a858e582..4b40f5babdca 100644 --- a/yarn-project/end-to-end/src/e2e_synching.test.ts +++ b/yarn-project/end-to-end/src/e2e_synching.test.ts @@ -37,7 +37,6 @@ import { createArchiver } from '@aztec/archiver'; import { AztecNodeService } from '@aztec/aztec-node'; import { type AccountWalletWithSecretKey, - AnvilTestWatcher, BatchCall, type Contract, Fr, @@ -46,6 +45,7 @@ import { createLogger, sleep, } from '@aztec/aztec.js'; +import { AnvilTestWatcher } from '@aztec/aztec.js/testing'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; import { EpochCache } from '@aztec/epoch-cache'; import { diff --git a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts index dcf716d6fccd..a99e00069e95 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts @@ -1,4 +1,4 @@ -import { type Logger } from '@aztec/aztec.js'; +import type { Logger } from '@aztec/aztec.js'; import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree'; import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts'; diff --git a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts index b6131344cbe9..6875c947cec4 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -2,11 +2,9 @@ import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr'; import { type InitialAccountData, deployFundedSchnorrAccounts, generateSchnorrAccounts } from '@aztec/accounts/testing'; import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; import { - AnvilTestWatcher, type AztecAddress, BatchCall, type Capsule, - CheatCodes, type CompleteAddress, type ContractFunctionInteraction, type FunctionCall, @@ -16,6 +14,7 @@ import { getContractClassFromArtifact, } from '@aztec/aztec.js'; import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment'; +import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing'; import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server'; import { type DeployL1ContractsArgs, diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index abec582e2f09..981037dacbca 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -10,11 +10,9 @@ import { type Archiver, createArchiver } from '@aztec/archiver'; import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; import { type AccountWalletWithSecretKey, - AnvilTestWatcher, type AztecAddress, type AztecNode, BatchCall, - CheatCodes, type ContractMethod, FeeJuicePaymentMethod, type Logger, @@ -28,6 +26,7 @@ import { waitForPXE, } from '@aztec/aztec.js'; import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment'; +import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing'; import type { BBNativePrivateKernelProver } from '@aztec/bb-prover'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server'; diff --git a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts index 039fa607b46d..ccf87c7208c7 100644 --- a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts +++ b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts @@ -1,6 +1,7 @@ // docs:start:imports import { getDeployedTestAccountsWallets } from '@aztec/accounts/testing'; -import { type AccountWallet, CheatCodes, Fr, type PXE, TxStatus, createPXEClient, waitForPXE } from '@aztec/aztec.js'; +import { type AccountWallet, Fr, type PXE, TxStatus, createPXEClient, waitForPXE } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; // docs:end:imports // docs:start:import_contract import { TestContract } from '@aztec/noir-contracts.js/Test'; diff --git a/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts b/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts index e9019a2dedf1..708516525dc2 100644 --- a/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts +++ b/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts @@ -2,7 +2,6 @@ import { type AccountWallet, AztecAddress, type AztecNode, - type CheatCodes, EthAddress, Fr, type Logger, @@ -10,6 +9,7 @@ import { computeAuthWitMessageHash, generateClaimSecret, } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { type DeployL1ContractsReturnType, type ViemPublicClient, diff --git a/yarn-project/end-to-end/src/simulators/lending_simulator.ts b/yarn-project/end-to-end/src/simulators/lending_simulator.ts index c88f16a64b86..9d0723859a73 100644 --- a/yarn-project/end-to-end/src/simulators/lending_simulator.ts +++ b/yarn-project/end-to-end/src/simulators/lending_simulator.ts @@ -1,5 +1,6 @@ // Convenience struct to hold an account's address and secret that can easily be passed around. -import { AztecAddress, type CheatCodes, Fr } from '@aztec/aztec.js'; +import { AztecAddress, Fr } from '@aztec/aztec.js'; +import { CheatCodes } from '@aztec/aztec.js/testing'; import { pedersenHash } from '@aztec/foundation/crypto'; import type { TestDateProvider } from '@aztec/foundation/timer'; import type { RollupAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/end-to-end/src/spartan/4epochs.test.ts b/yarn-project/end-to-end/src/spartan/4epochs.test.ts index 8a59b9e36861..557c07d8c880 100644 --- a/yarn-project/end-to-end/src/spartan/4epochs.test.ts +++ b/yarn-project/end-to-end/src/spartan/4epochs.test.ts @@ -1,5 +1,5 @@ import { readFieldCompressedString } from '@aztec/aztec.js'; -import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; +import { RollupCheatCodes } from '@aztec/aztec.js/testing'; import { getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts index d9789d3512e9..1d141f36ab97 100644 --- a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts +++ b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts @@ -1,5 +1,5 @@ import { createCompatibleClient, sleep } from '@aztec/aztec.js'; -import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; +import { RollupCheatCodes } from '@aztec/aztec.js/testing'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/spartan/reorg.test.ts b/yarn-project/end-to-end/src/spartan/reorg.test.ts index 074f1d8bd68c..0802a875f52c 100644 --- a/yarn-project/end-to-end/src/spartan/reorg.test.ts +++ b/yarn-project/end-to-end/src/spartan/reorg.test.ts @@ -1,5 +1,5 @@ import { sleep } from '@aztec/aztec.js'; -import { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; +import { RollupCheatCodes } from '@aztec/aztec.js/testing'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/spartan/utils.ts b/yarn-project/end-to-end/src/spartan/utils.ts index 021e46ccb89b..cebf8c7e932b 100644 --- a/yarn-project/end-to-end/src/spartan/utils.ts +++ b/yarn-project/end-to-end/src/spartan/utils.ts @@ -1,5 +1,5 @@ import { createAztecNodeClient, createLogger, sleep } from '@aztec/aztec.js'; -import type { RollupCheatCodes } from '@aztec/aztec.js/ethereum'; +import type { RollupCheatCodes } from '@aztec/aztec.js/testing'; import type { Logger } from '@aztec/foundation/log'; import type { SequencerConfig } from '@aztec/sequencer-client'; From 36c3d2e817862a5dc18e096dfd3968153b2936dd Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 09:24:00 +0000 Subject: [PATCH 3/9] reorg aztec.js --- yarn-project/aztec.js/package.json | 12 ++++++------ yarn-project/aztec.js/src/account/wallet.ts | 2 +- .../account_manager/deploy_account_method.ts | 4 ++-- .../account_manager/deploy_account_sent_tx.ts | 2 +- .../aztec.js/src/account_manager/index.ts | 6 +++--- yarn-project/aztec.js/src/api/account.ts | 2 +- .../api/{contract/index.ts => contract.ts} | 19 ++++++++++++------- yarn-project/aztec.js/src/api/deployment.ts | 1 + .../api/{ethereum/index.ts => ethereum.ts} | 4 ++-- .../api/{interfaces/pxe.ts => interfaces.ts} | 0 yarn-project/aztec.js/src/api/rpc.ts | 2 ++ yarn-project/aztec.js/src/api/test/index.ts | 5 ----- yarn-project/aztec.js/src/api/testing.ts | 5 +++++ .../src/api/{utils/index.ts => utils.ts} | 14 +++++++------- .../contract/base_contract_interaction.ts | 8 ++++---- .../src/{api => }/contract/batch_call.ts | 2 +- .../src/{api => }/contract/checker.test.ts | 0 .../src/{api => }/contract/checker.ts | 0 .../src/{api => }/contract/contract.test.ts | 2 +- .../src/{api => }/contract/contract.ts | 2 +- .../src/{api => }/contract/contract_base.ts | 2 +- .../contract/contract_function_interaction.ts | 4 ++-- .../src/{api => }/contract/deploy_method.ts | 8 ++++---- .../{api => }/contract/deploy_proven_tx.ts | 2 +- .../src/{api => }/contract/deploy_sent_tx.ts | 2 +- .../{api => }/contract/get_gas_limits.test.ts | 0 .../src/{api => }/contract/get_gas_limits.ts | 0 .../{api => }/contract/protocol_contracts.ts | 2 +- .../src/{api => }/contract/proven_tx.ts | 2 +- .../src/{api => }/contract/sent_tx.test.ts | 0 .../src/{api => }/contract/sent_tx.ts | 0 .../src/{api => }/contract/unsafe_contract.ts | 2 +- .../src/deployment/broadcast_function.ts | 4 ++-- .../src/deployment/contract_deployer.ts | 4 ++-- .../src/deployment/deploy_instance.ts | 4 ++-- yarn-project/aztec.js/src/deployment/index.ts | 1 - .../aztec.js/src/deployment/register_class.ts | 4 ++-- .../src/{api => }/ethereum/l1_contracts.ts | 2 +- .../src/{api => }/ethereum/portal_manager.ts | 0 .../fee_juice_payment_method_with_claim.ts | 4 ++-- .../src/fee/private_fee_payment_method.ts | 2 +- .../src/fee/public_fee_payment_method.ts | 2 +- yarn-project/aztec.js/src/index.ts | 17 ++++++----------- .../aztec.js/src/rpc_clients/index.ts | 2 -- .../src/{api => }/test/anvil_test_watcher.ts | 0 .../src/{api => }/test/aztec_cheat_codes.ts | 0 .../src/{api => }/test/cheat_codes.ts | 0 .../src/{api => }/test/rollup_cheat_codes.ts | 0 .../aztec.js/src/{api => }/utils/abi_types.ts | 0 .../aztec.js/src/{api => }/utils/authwit.ts | 0 .../aztec.js/src/{api => }/utils/fee_juice.ts | 3 +-- .../utils/field_compressed_string.ts | 0 .../aztec.js/src/{api => }/utils/node.ts | 0 .../aztec.js/src/{api => }/utils/pub_key.ts | 0 .../aztec.js/src/{api => }/utils/pxe.ts | 0 .../aztec.js/src/wallet/account_wallet.ts | 6 +++--- .../aztec.js/src/wallet/base_wallet.ts | 2 +- .../aztec.js/src/wallet/signerless_wallet.ts | 2 +- 58 files changed, 87 insertions(+), 88 deletions(-) rename yarn-project/aztec.js/src/api/{contract/index.ts => contract.ts} (81%) rename yarn-project/aztec.js/src/api/{ethereum/index.ts => ethereum.ts} (64%) rename yarn-project/aztec.js/src/api/{interfaces/pxe.ts => interfaces.ts} (100%) create mode 100644 yarn-project/aztec.js/src/api/rpc.ts delete mode 100644 yarn-project/aztec.js/src/api/test/index.ts create mode 100644 yarn-project/aztec.js/src/api/testing.ts rename yarn-project/aztec.js/src/api/{utils/index.ts => utils.ts} (53%) rename yarn-project/aztec.js/src/{api => }/contract/base_contract_interaction.ts (96%) rename yarn-project/aztec.js/src/{api => }/contract/batch_call.ts (98%) rename yarn-project/aztec.js/src/{api => }/contract/checker.test.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/checker.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/contract.test.ts (99%) rename yarn-project/aztec.js/src/{api => }/contract/contract.ts (98%) rename yarn-project/aztec.js/src/{api => }/contract/contract_base.ts (98%) rename yarn-project/aztec.js/src/{api => }/contract/contract_function_interaction.ts (98%) rename yarn-project/aztec.js/src/{api => }/contract/deploy_method.ts (97%) rename yarn-project/aztec.js/src/{api => }/contract/deploy_proven_tx.ts (95%) rename yarn-project/aztec.js/src/{api => }/contract/deploy_sent_tx.ts (98%) rename yarn-project/aztec.js/src/{api => }/contract/get_gas_limits.test.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/get_gas_limits.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/protocol_contracts.ts (96%) rename yarn-project/aztec.js/src/{api => }/contract/proven_tx.ts (95%) rename yarn-project/aztec.js/src/{api => }/contract/sent_tx.test.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/sent_tx.ts (100%) rename yarn-project/aztec.js/src/{api => }/contract/unsafe_contract.ts (92%) delete mode 100644 yarn-project/aztec.js/src/deployment/index.ts rename yarn-project/aztec.js/src/{api => }/ethereum/l1_contracts.ts (89%) rename yarn-project/aztec.js/src/{api => }/ethereum/portal_manager.ts (100%) delete mode 100644 yarn-project/aztec.js/src/rpc_clients/index.ts rename yarn-project/aztec.js/src/{api => }/test/anvil_test_watcher.ts (100%) rename yarn-project/aztec.js/src/{api => }/test/aztec_cheat_codes.ts (100%) rename yarn-project/aztec.js/src/{api => }/test/cheat_codes.ts (100%) rename yarn-project/aztec.js/src/{api => }/test/rollup_cheat_codes.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/abi_types.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/authwit.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/fee_juice.ts (90%) rename yarn-project/aztec.js/src/{api => }/utils/field_compressed_string.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/node.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/pub_key.ts (100%) rename yarn-project/aztec.js/src/{api => }/utils/pxe.ts (100%) diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index 0d044991ecbd..8dc1143853ac 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -5,25 +5,25 @@ "type": "module", "exports": { ".": "./dest/index.js", - "./interfaces/pxe": "./dest/api/interfaces/pxe.js", + "./interfaces": "./dest/api/interfaces.js", "./abi": "./dest/api/abi.js", "./account": "./dest/api/account.js", "./addresses": "./dest/api/addresses.js", "./cheatcodes": "./dest/api/cheatcodes.js", - "./contracts": "./dest/api/contract/index.js", + "./contracts": "./dest/api/contract.js", "./deployment": "./dest/api/deployment.js", "./entrypoint": "./dest/api/entrypoint.js", "./eth_address": "./dest/api/eth_address.js", - "./ethereum": "./dest/api/ethereum/index.js", + "./ethereum": "./dest/api/ethereum.js", "./fee": "./dest/api/fee.js", "./fields": "./dest/api/fields.js", "./log": "./dest/api/log.js", "./log_id": "./dest/api/log_id.js", - "./rpc": "./dest/rpc_clients/index.js", + "./rpc": "./dest/api/rpc.js", "./tx_hash": "./dest/api/tx_hash.js", "./wallet": "./dest/api/wallet.js", - "./utils": "./dest/api/utils/index.js", - "./testing": "./dest/api/test/index.js" + "./utils": "./dest/api/utils.js", + "./testing": "./dest/api/testing.js" }, "typedocOptions": { "entryPoints": [ diff --git a/yarn-project/aztec.js/src/account/wallet.ts b/yarn-project/aztec.js/src/account/wallet.ts index 9624871bf5d6..baf7f6231962 100644 --- a/yarn-project/aztec.js/src/account/wallet.ts +++ b/yarn-project/aztec.js/src/account/wallet.ts @@ -1,7 +1,7 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness'; import type { PXE } from '@aztec/stdlib/interfaces/client'; -import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; +import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; import type { AccountInterface } from './interface.js'; /** diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts index dbc9e8d77170..76fb1701ce31 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts @@ -9,9 +9,9 @@ import type { PublicKeys } from '@aztec/stdlib/keys'; import type { AuthWitnessProvider } from '../account/interface.js'; import type { Wallet } from '../account/wallet.js'; -import { Contract } from '../api/contract/contract.js'; -import { DeployMethod, type DeployOptions } from '../api/contract/deploy_method.js'; import type { ExecutionRequestInit } from '../api/entrypoint.js'; +import { Contract } from '../contract/contract.js'; +import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js'; import { EntrypointPayload, computeCombinedPayloadHash } from '../entrypoint/payload.js'; /** diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts index 606d89324245..57a23ef929bf 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts @@ -3,7 +3,7 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxHash, TxReceipt } from '@aztec/stdlib/tx'; import type { Wallet } from '../account/index.js'; -import { DefaultWaitOpts, SentTx, type WaitOpts } from '../api/contract/sent_tx.js'; +import { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js'; /** Extends a transaction receipt with a wallet instance for the newly deployed contract. */ export type DeployAccountTxReceipt = FieldsOf & { diff --git a/yarn-project/aztec.js/src/account_manager/index.ts b/yarn-project/aztec.js/src/account_manager/index.ts index 2c526776c612..f642ea5d2264 100644 --- a/yarn-project/aztec.js/src/account_manager/index.ts +++ b/yarn-project/aztec.js/src/account_manager/index.ts @@ -7,9 +7,9 @@ import { deriveKeys } from '@aztec/stdlib/keys'; import type { AccountContract } from '../account/contract.js'; import type { Salt, Wallet } from '../account/index.js'; import type { AccountInterface } from '../account/interface.js'; -import { Contract } from '../api/contract/contract.js'; -import { DeployMethod, type DeployOptions } from '../api/contract/deploy_method.js'; -import { DefaultWaitOpts, type WaitOpts } from '../api/contract/sent_tx.js'; +import { Contract } from '../contract/contract.js'; +import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js'; +import { DefaultWaitOpts, type WaitOpts } from '../contract/sent_tx.js'; import { DefaultMultiCallEntrypoint } from '../entrypoint/default_multi_call_entrypoint.js'; import { AccountWalletWithSecretKey, SignerlessWallet } from '../wallet/index.js'; import { DeployAccountMethod } from './deploy_account_method.js'; diff --git a/yarn-project/aztec.js/src/api/account.ts b/yarn-project/aztec.js/src/api/account.ts index 9e745d3e9379..d064159f05b9 100644 --- a/yarn-project/aztec.js/src/api/account.ts +++ b/yarn-project/aztec.js/src/api/account.ts @@ -7,4 +7,4 @@ export { getAccountContractAddress, } from '../account/index.js'; -export { AccountManager } from '../account_manager/index.js'; +export { AccountManager, type DeployAccountOptions } from '../account_manager/index.js'; diff --git a/yarn-project/aztec.js/src/api/contract/index.ts b/yarn-project/aztec.js/src/api/contract.ts similarity index 81% rename from yarn-project/aztec.js/src/api/contract/index.ts rename to yarn-project/aztec.js/src/api/contract.ts index 265886aea9cc..f9c41522a263 100644 --- a/yarn-project/aztec.js/src/api/contract/index.ts +++ b/yarn-project/aztec.js/src/api/contract.ts @@ -35,14 +35,19 @@ * * @packageDocumentation */ -export { Contract } from './contract.js'; +export { Contract } from '../contract/contract.js'; export { ContractFunctionInteraction, type ProfileResult, type SendMethodOptions, -} from './contract_function_interaction.js'; -export { DefaultWaitOpts, SentTx, type WaitOpts } from './sent_tx.js'; -export { ContractBase, type ContractMethod, type ContractNotes, type ContractStorageLayout } from './contract_base.js'; -export { BatchCall } from './batch_call.js'; -export { type DeployOptions, DeployMethod } from './deploy_method.js'; -export { DeploySentTx } from './deploy_sent_tx.js'; +} from '../contract/contract_function_interaction.js'; +export { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js'; +export { + ContractBase, + type ContractMethod, + type ContractNotes, + type ContractStorageLayout, +} from '../contract/contract_base.js'; +export { BatchCall } from '../contract/batch_call.js'; +export { type DeployOptions, DeployMethod } from '../contract/deploy_method.js'; +export { DeploySentTx } from '../contract/deploy_sent_tx.js'; diff --git a/yarn-project/aztec.js/src/api/deployment.ts b/yarn-project/aztec.js/src/api/deployment.ts index e6e2ad245211..ed89873c5aa6 100644 --- a/yarn-project/aztec.js/src/api/deployment.ts +++ b/yarn-project/aztec.js/src/api/deployment.ts @@ -1,3 +1,4 @@ export { registerContractClass } from '../deployment/register_class.js'; export { broadcastPrivateFunction, broadcastUnconstrainedFunction } from '../deployment/broadcast_function.js'; export { deployInstance } from '../deployment/deploy_instance.js'; +export { ContractDeployer } from '../deployment/contract_deployer.js'; diff --git a/yarn-project/aztec.js/src/api/ethereum/index.ts b/yarn-project/aztec.js/src/api/ethereum.ts similarity index 64% rename from yarn-project/aztec.js/src/api/ethereum/index.ts rename to yarn-project/aztec.js/src/api/ethereum.ts index 20790abb1685..6c6a7d2058ed 100644 --- a/yarn-project/aztec.js/src/api/ethereum/index.ts +++ b/yarn-project/aztec.js/src/api/ethereum.ts @@ -7,5 +7,5 @@ export { type L2AmountClaimWithRecipient, type L2Claim, generateClaimSecret, -} from './portal_manager.js'; -export { getL1ContractAddresses } from './l1_contracts.js'; +} from '../ethereum/portal_manager.js'; +export { getL1ContractAddresses } from '../ethereum/l1_contracts.js'; diff --git a/yarn-project/aztec.js/src/api/interfaces/pxe.ts b/yarn-project/aztec.js/src/api/interfaces.ts similarity index 100% rename from yarn-project/aztec.js/src/api/interfaces/pxe.ts rename to yarn-project/aztec.js/src/api/interfaces.ts diff --git a/yarn-project/aztec.js/src/api/rpc.ts b/yarn-project/aztec.js/src/api/rpc.ts new file mode 100644 index 000000000000..7f12bc9cba0f --- /dev/null +++ b/yarn-project/aztec.js/src/api/rpc.ts @@ -0,0 +1,2 @@ +export { createPXEClient } from '../rpc_clients/pxe_client.js'; +export { createCompatibleClient } from '../rpc_clients/node/index.js'; diff --git a/yarn-project/aztec.js/src/api/test/index.ts b/yarn-project/aztec.js/src/api/test/index.ts deleted file mode 100644 index 1b4028228fd1..000000000000 --- a/yarn-project/aztec.js/src/api/test/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { AnvilTestWatcher } from './anvil_test_watcher.js'; -export { RollupCheatCodes } from './rollup_cheat_codes.js'; -export { AztecCheatCodes } from './aztec_cheat_codes.js'; -export { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; -export { CheatCodes } from './cheat_codes.js'; diff --git a/yarn-project/aztec.js/src/api/testing.ts b/yarn-project/aztec.js/src/api/testing.ts new file mode 100644 index 000000000000..c17d63bc0f70 --- /dev/null +++ b/yarn-project/aztec.js/src/api/testing.ts @@ -0,0 +1,5 @@ +export { AnvilTestWatcher } from '../test/anvil_test_watcher.js'; +export { RollupCheatCodes } from '../test/rollup_cheat_codes.js'; +export { AztecCheatCodes } from '../test/aztec_cheat_codes.js'; +export { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; +export { CheatCodes } from '../test/cheat_codes.js'; diff --git a/yarn-project/aztec.js/src/api/utils/index.ts b/yarn-project/aztec.js/src/api/utils.ts similarity index 53% rename from yarn-project/aztec.js/src/api/utils/index.ts rename to yarn-project/aztec.js/src/api/utils.ts index bd52ec8ea9c3..acc098ae5bee 100644 --- a/yarn-project/aztec.js/src/api/utils/index.ts +++ b/yarn-project/aztec.js/src/api/utils.ts @@ -1,4 +1,4 @@ -export { generatePublicKey } from './pub_key.js'; +export { generatePublicKey } from '../utils/pub_key.js'; export { type AztecAddressLike, type EthAddressLike, @@ -7,15 +7,15 @@ export { type FunctionSelectorLike, type U128Like, type WrappedFieldLike, -} from './abi_types.js'; +} from '../utils/abi_types.js'; export { computeAuthWitMessageHash, computeInnerAuthWitHash, computeInnerAuthWitHashFromAction, type IntentAction, type IntentInnerHash, -} from './authwit.js'; -export { waitForPXE } from './pxe.js'; -export { waitForNode, createAztecNodeClient, type AztecNode } from './node.js'; -export { getFeeJuiceBalance } from './fee_juice.js'; -export { readFieldCompressedString } from './field_compressed_string.js'; +} from '../utils/authwit.js'; +export { waitForPXE } from '../utils/pxe.js'; +export { waitForNode, createAztecNodeClient, type AztecNode } from '../utils/node.js'; +export { getFeeJuiceBalance } from '../utils/fee_juice.js'; +export { readFieldCompressedString } from '../utils/field_compressed_string.js'; diff --git a/yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts b/yarn-project/aztec.js/src/contract/base_contract_interaction.ts similarity index 96% rename from yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts rename to yarn-project/aztec.js/src/contract/base_contract_interaction.ts index 65e76e0055b3..1340329666b1 100644 --- a/yarn-project/aztec.js/src/api/contract/base_contract_interaction.ts +++ b/yarn-project/aztec.js/src/contract/base_contract_interaction.ts @@ -3,10 +3,10 @@ import { createLogger } from '@aztec/foundation/log'; import { GasSettings } from '@aztec/stdlib/gas'; import type { Capsule, TxExecutionRequest, TxProvingResult } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/wallet.js'; -import type { ExecutionRequestInit } from '../../entrypoint/entrypoint.js'; -import type { FeeOptions, UserFeeOptions } from '../../entrypoint/payload.js'; -import { FeeJuicePaymentMethod } from '../../fee/fee_juice_payment_method.js'; +import type { Wallet } from '../account/wallet.js'; +import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +import type { FeeOptions, UserFeeOptions } from '../entrypoint/payload.js'; +import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js'; import { getGasLimits } from './get_gas_limits.js'; import { ProvenTx } from './proven_tx.js'; import { SentTx } from './sent_tx.js'; diff --git a/yarn-project/aztec.js/src/api/contract/batch_call.ts b/yarn-project/aztec.js/src/contract/batch_call.ts similarity index 98% rename from yarn-project/aztec.js/src/api/contract/batch_call.ts rename to yarn-project/aztec.js/src/contract/batch_call.ts index 0e13666e23ce..5cc860556e0b 100644 --- a/yarn-project/aztec.js/src/api/contract/batch_call.ts +++ b/yarn-project/aztec.js/src/contract/batch_call.ts @@ -1,7 +1,7 @@ import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; import type { SimulateMethodOptions } from './contract_function_interaction.js'; diff --git a/yarn-project/aztec.js/src/api/contract/checker.test.ts b/yarn-project/aztec.js/src/contract/checker.test.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/checker.test.ts rename to yarn-project/aztec.js/src/contract/checker.test.ts diff --git a/yarn-project/aztec.js/src/api/contract/checker.ts b/yarn-project/aztec.js/src/contract/checker.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/checker.ts rename to yarn-project/aztec.js/src/contract/checker.ts diff --git a/yarn-project/aztec.js/src/api/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts similarity index 99% rename from yarn-project/aztec.js/src/api/contract/contract.test.ts rename to yarn-project/aztec.js/src/contract/contract.test.ts index 9d4c2021c260..48d50f2b07f0 100644 --- a/yarn-project/aztec.js/src/api/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -13,7 +13,7 @@ import type { Tx, TxExecutionRequest, TxHash, TxProvingResult, TxReceipt, TxSimu import { type MockProxy, mock } from 'jest-mock-extended'; -import type { Wallet } from '../../account/wallet.js'; +import type { Wallet } from '../account/wallet.js'; import { Contract } from './contract.js'; describe('Contract Class', () => { diff --git a/yarn-project/aztec.js/src/api/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts similarity index 98% rename from yarn-project/aztec.js/src/api/contract/contract.ts rename to yarn-project/aztec.js/src/contract/contract.ts index 2e2804cb4238..61caeae78aa2 100644 --- a/yarn-project/aztec.js/src/api/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -3,7 +3,7 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import { getContractClassFromArtifact } from '@aztec/stdlib/contract'; import { PublicKeys } from '@aztec/stdlib/keys'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import { ContractBase } from './contract_base.js'; import { DeployMethod } from './deploy_method.js'; diff --git a/yarn-project/aztec.js/src/api/contract/contract_base.ts b/yarn-project/aztec.js/src/contract/contract_base.ts similarity index 98% rename from yarn-project/aztec.js/src/api/contract/contract_base.ts rename to yarn-project/aztec.js/src/contract/contract_base.ts index ba9bea299322..84fd3ba018f2 100644 --- a/yarn-project/aztec.js/src/api/contract/contract_base.ts +++ b/yarn-project/aztec.js/src/contract/contract_base.ts @@ -7,7 +7,7 @@ import { } from '@aztec/stdlib/abi'; import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/stdlib/contract'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import { ContractFunctionInteraction } from './contract_function_interaction.js'; /** diff --git a/yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts similarity index 98% rename from yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts rename to yarn-project/aztec.js/src/contract/contract_function_interaction.ts index d449eb9904c9..a3404e20f88b 100644 --- a/yarn-project/aztec.js/src/api/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts @@ -10,8 +10,8 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { PrivateKernelProverProfileResult } from '@aztec/stdlib/kernel'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/wallet.js'; -import { FeeJuicePaymentMethod } from '../../fee/fee_juice_payment_method.js'; +import type { Wallet } from '../account/wallet.js'; +import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; export type { SendMethodOptions }; diff --git a/yarn-project/aztec.js/src/api/contract/deploy_method.ts b/yarn-project/aztec.js/src/contract/deploy_method.ts similarity index 97% rename from yarn-project/aztec.js/src/api/contract/deploy_method.ts rename to yarn-project/aztec.js/src/contract/deploy_method.ts index b72b36eeb895..0ecf3a7419fb 100644 --- a/yarn-project/aztec.js/src/api/contract/deploy_method.ts +++ b/yarn-project/aztec.js/src/contract/deploy_method.ts @@ -11,10 +11,10 @@ import type { GasSettings } from '@aztec/stdlib/gas'; import type { PublicKeys } from '@aztec/stdlib/keys'; import type { Capsule, TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/index.js'; -import { deployInstance } from '../../deployment/deploy_instance.js'; -import { registerContractClass } from '../../deployment/register_class.js'; -import type { ExecutionRequestInit } from '../../entrypoint/entrypoint.js'; +import type { Wallet } from '../account/wallet.js'; +import { deployInstance } from '../deployment/deploy_instance.js'; +import { registerContractClass } from '../deployment/register_class.js'; +import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; import type { Contract } from './contract.js'; import type { ContractBase } from './contract_base.js'; diff --git a/yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts b/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts similarity index 95% rename from yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts rename to yarn-project/aztec.js/src/contract/deploy_proven_tx.ts index 659ab8cc82b3..cf7151091524 100644 --- a/yarn-project/aztec.js/src/api/contract/deploy_proven_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts @@ -3,7 +3,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { Tx } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import type { Contract } from './contract.js'; import { DeploySentTx } from './deploy_sent_tx.js'; import { ProvenTx } from './proven_tx.js'; diff --git a/yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts similarity index 98% rename from yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts rename to yarn-project/aztec.js/src/contract/deploy_sent_tx.ts index 1c092b72bbfc..6ff89c1fb776 100644 --- a/yarn-project/aztec.js/src/api/contract/deploy_sent_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts @@ -5,7 +5,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client'; import type { TxHash, TxReceipt } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import type { Contract } from './contract.js'; import type { ContractBase } from './contract_base.js'; import { SentTx, type WaitOpts } from './sent_tx.js'; diff --git a/yarn-project/aztec.js/src/api/contract/get_gas_limits.test.ts b/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/get_gas_limits.test.ts rename to yarn-project/aztec.js/src/contract/get_gas_limits.test.ts diff --git a/yarn-project/aztec.js/src/api/contract/get_gas_limits.ts b/yarn-project/aztec.js/src/contract/get_gas_limits.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/get_gas_limits.ts rename to yarn-project/aztec.js/src/contract/get_gas_limits.ts diff --git a/yarn-project/aztec.js/src/api/contract/protocol_contracts.ts b/yarn-project/aztec.js/src/contract/protocol_contracts.ts similarity index 96% rename from yarn-project/aztec.js/src/api/contract/protocol_contracts.ts rename to yarn-project/aztec.js/src/contract/protocol_contracts.ts index 55fbadaf4e44..a72d22c45d41 100644 --- a/yarn-project/aztec.js/src/api/contract/protocol_contracts.ts +++ b/yarn-project/aztec.js/src/contract/protocol_contracts.ts @@ -1,6 +1,6 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts'; -import type { Wallet } from '../../wallet/index.js'; +import type { Wallet } from '../account/wallet.js'; import { UnsafeContract } from './unsafe_contract.js'; /** Returns a Contract wrapper for the class registerer. */ diff --git a/yarn-project/aztec.js/src/api/contract/proven_tx.ts b/yarn-project/aztec.js/src/contract/proven_tx.ts similarity index 95% rename from yarn-project/aztec.js/src/api/contract/proven_tx.ts rename to yarn-project/aztec.js/src/contract/proven_tx.ts index e6ea78f4f983..dd30bb060060 100644 --- a/yarn-project/aztec.js/src/api/contract/proven_tx.ts +++ b/yarn-project/aztec.js/src/contract/proven_tx.ts @@ -1,7 +1,7 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import { Tx } from '@aztec/stdlib/tx'; -import type { Wallet } from '../../account/index.js'; +import type { Wallet } from '../account/wallet.js'; import { SentTx } from './sent_tx.js'; /** diff --git a/yarn-project/aztec.js/src/api/contract/sent_tx.test.ts b/yarn-project/aztec.js/src/contract/sent_tx.test.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/sent_tx.test.ts rename to yarn-project/aztec.js/src/contract/sent_tx.test.ts diff --git a/yarn-project/aztec.js/src/api/contract/sent_tx.ts b/yarn-project/aztec.js/src/contract/sent_tx.ts similarity index 100% rename from yarn-project/aztec.js/src/api/contract/sent_tx.ts rename to yarn-project/aztec.js/src/contract/sent_tx.ts diff --git a/yarn-project/aztec.js/src/api/contract/unsafe_contract.ts b/yarn-project/aztec.js/src/contract/unsafe_contract.ts similarity index 92% rename from yarn-project/aztec.js/src/api/contract/unsafe_contract.ts rename to yarn-project/aztec.js/src/contract/unsafe_contract.ts index 7194a9544f73..05174da334d1 100644 --- a/yarn-project/aztec.js/src/api/contract/unsafe_contract.ts +++ b/yarn-project/aztec.js/src/contract/unsafe_contract.ts @@ -1,7 +1,7 @@ import type { ContractArtifact } from '@aztec/stdlib/abi'; import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; -import type { Wallet } from '../../wallet/index.js'; +import type { Wallet } from '../account/wallet.js'; import { ContractBase } from './contract_base.js'; /** Unsafe constructor for ContractBase that bypasses the check that the instance is registered in the wallet. */ diff --git a/yarn-project/aztec.js/src/deployment/broadcast_function.ts b/yarn-project/aztec.js/src/deployment/broadcast_function.ts index ab422e25804c..5cf1cdf39b99 100644 --- a/yarn-project/aztec.js/src/deployment/broadcast_function.ts +++ b/yarn-project/aztec.js/src/deployment/broadcast_function.ts @@ -15,8 +15,8 @@ import { } from '@aztec/stdlib/contract'; import { Capsule } from '@aztec/stdlib/tx'; -import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; -import { getRegistererContract } from '../api/contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import { getRegistererContract } from '../contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; /** diff --git a/yarn-project/aztec.js/src/deployment/contract_deployer.ts b/yarn-project/aztec.js/src/deployment/contract_deployer.ts index 88e1acd9c659..10567f04f0fc 100644 --- a/yarn-project/aztec.js/src/deployment/contract_deployer.ts +++ b/yarn-project/aztec.js/src/deployment/contract_deployer.ts @@ -3,8 +3,8 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address'; import { PublicKeys } from '@aztec/stdlib/keys'; import type { Wallet } from '../account/wallet.js'; -import { Contract } from '../api/contract/contract.js'; -import { DeployMethod } from '../api/contract/deploy_method.js'; +import { Contract } from '../contract/contract.js'; +import { DeployMethod } from '../contract/deploy_method.js'; /** * A class for deploying contract. diff --git a/yarn-project/aztec.js/src/deployment/deploy_instance.ts b/yarn-project/aztec.js/src/deployment/deploy_instance.ts index 5f9d11cf9678..e24fc43dc4b7 100644 --- a/yarn-project/aztec.js/src/deployment/deploy_instance.ts +++ b/yarn-project/aztec.js/src/deployment/deploy_instance.ts @@ -1,7 +1,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract'; -import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; -import { getDeployerContract } from '../api/contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import { getDeployerContract } from '../contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; /** diff --git a/yarn-project/aztec.js/src/deployment/index.ts b/yarn-project/aztec.js/src/deployment/index.ts deleted file mode 100644 index 587eeb108ce7..000000000000 --- a/yarn-project/aztec.js/src/deployment/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './contract_deployer.js'; diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index e9a07df25463..4cd770c00a1c 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -5,8 +5,8 @@ import { type ContractArtifact, bufferAsFields } from '@aztec/stdlib/abi'; import { getContractClassFromArtifact } from '@aztec/stdlib/contract'; import { Capsule } from '@aztec/stdlib/tx'; -import type { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; -import { getRegistererContract } from '../api/contract/protocol_contracts.js'; +import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import { getRegistererContract } from '../contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; const defaultEmitPublicBytecode = diff --git a/yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts b/yarn-project/aztec.js/src/ethereum/l1_contracts.ts similarity index 89% rename from yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts rename to yarn-project/aztec.js/src/ethereum/l1_contracts.ts index 7796ec1b5652..645f2ad49b6f 100644 --- a/yarn-project/aztec.js/src/api/ethereum/l1_contracts.ts +++ b/yarn-project/aztec.js/src/ethereum/l1_contracts.ts @@ -1,7 +1,7 @@ import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { retryUntil } from '@aztec/foundation/retry'; -import { createPXEClient } from '../../rpc_clients/index.js'; +import { createPXEClient } from '../rpc_clients/pxe_client.js'; export const getL1ContractAddresses = async (url: string): Promise => { const pxeClient = createPXEClient(url, {}); diff --git a/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts b/yarn-project/aztec.js/src/ethereum/portal_manager.ts similarity index 100% rename from yarn-project/aztec.js/src/api/ethereum/portal_manager.ts rename to yarn-project/aztec.js/src/ethereum/portal_manager.ts diff --git a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts index ac3d3a808944..28efae594188 100644 --- a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts +++ b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts @@ -3,8 +3,8 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import type { FunctionCall } from '@aztec/stdlib/abi'; import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi'; -import { getFeeJuice } from '../api/contract/protocol_contracts.js'; -import type { L2AmountClaim } from '../api/ethereum/portal_manager.js'; +import { getFeeJuice } from '../contract/protocol_contracts.js'; +import type { L2AmountClaim } from '../ethereum/portal_manager.js'; import type { Wallet } from '../wallet/index.js'; import { FeeJuicePaymentMethod } from './fee_juice_payment_method.js'; diff --git a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts index 4d78cd97e91d..a4d0d6752f2b 100644 --- a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts @@ -4,7 +4,7 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { GasSettings } from '@aztec/stdlib/gas'; import type { Wallet } from '../account/wallet.js'; -import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; import { SignerlessWallet } from '../wallet/signerless_wallet.js'; import type { FeePaymentMethod } from './fee_payment_method.js'; diff --git a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts index a900e2b488cf..8acae43925ac 100644 --- a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts @@ -4,7 +4,7 @@ import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import type { GasSettings } from '@aztec/stdlib/gas'; -import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; import type { AccountWallet } from '../wallet/account_wallet.js'; import { SignerlessWallet } from '../wallet/signerless_wallet.js'; import type { FeePaymentMethod } from './fee_payment_method.js'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 2774a4238f65..2da0faf02abf 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -20,16 +20,8 @@ * TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it). */ -export { ContractDeployer } from './deployment/index.js'; - export { NoteSelector } from '@aztec/stdlib/abi'; -export { createCompatibleClient, createPXEClient } from './rpc_clients/index.js'; - -export { type DeployAccountOptions } from './account_manager/index.js'; - -export { AccountWallet, AccountWalletWithSecretKey, SignerlessWallet } from './wallet/index.js'; - export { EthAddress } from '@aztec/foundation/eth-address'; export { Fq, Fr, Point, GrumpkinScalar } from '@aztec/foundation/fields'; @@ -97,8 +89,11 @@ export { fileURLToPath } from '@aztec/foundation/url'; export * from './api/abi.js'; export * from './api/account.js'; export * from './api/addresses.js'; -export * from './api/ethereum/index.js'; +export * from './api/deployment.js'; +export * from './api/ethereum.js'; export * from './api/fee.js'; export * from './api/log.js'; -export * from './api/contract/index.js'; -export * from './api/utils/index.js'; +export * from './api/contract.js'; +export * from './api/utils.js'; +export * from './api/rpc.js'; +export * from './api/wallet.js'; diff --git a/yarn-project/aztec.js/src/rpc_clients/index.ts b/yarn-project/aztec.js/src/rpc_clients/index.ts deleted file mode 100644 index 194614b56eeb..000000000000 --- a/yarn-project/aztec.js/src/rpc_clients/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './pxe_client.js'; -export * from './node/index.js'; diff --git a/yarn-project/aztec.js/src/api/test/anvil_test_watcher.ts b/yarn-project/aztec.js/src/test/anvil_test_watcher.ts similarity index 100% rename from yarn-project/aztec.js/src/api/test/anvil_test_watcher.ts rename to yarn-project/aztec.js/src/test/anvil_test_watcher.ts diff --git a/yarn-project/aztec.js/src/api/test/aztec_cheat_codes.ts b/yarn-project/aztec.js/src/test/aztec_cheat_codes.ts similarity index 100% rename from yarn-project/aztec.js/src/api/test/aztec_cheat_codes.ts rename to yarn-project/aztec.js/src/test/aztec_cheat_codes.ts diff --git a/yarn-project/aztec.js/src/api/test/cheat_codes.ts b/yarn-project/aztec.js/src/test/cheat_codes.ts similarity index 100% rename from yarn-project/aztec.js/src/api/test/cheat_codes.ts rename to yarn-project/aztec.js/src/test/cheat_codes.ts diff --git a/yarn-project/aztec.js/src/api/test/rollup_cheat_codes.ts b/yarn-project/aztec.js/src/test/rollup_cheat_codes.ts similarity index 100% rename from yarn-project/aztec.js/src/api/test/rollup_cheat_codes.ts rename to yarn-project/aztec.js/src/test/rollup_cheat_codes.ts diff --git a/yarn-project/aztec.js/src/api/utils/abi_types.ts b/yarn-project/aztec.js/src/utils/abi_types.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/abi_types.ts rename to yarn-project/aztec.js/src/utils/abi_types.ts diff --git a/yarn-project/aztec.js/src/api/utils/authwit.ts b/yarn-project/aztec.js/src/utils/authwit.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/authwit.ts rename to yarn-project/aztec.js/src/utils/authwit.ts diff --git a/yarn-project/aztec.js/src/api/utils/fee_juice.ts b/yarn-project/aztec.js/src/utils/fee_juice.ts similarity index 90% rename from yarn-project/aztec.js/src/api/utils/fee_juice.ts rename to yarn-project/aztec.js/src/utils/fee_juice.ts index 603beabe822a..81ddb58844a7 100644 --- a/yarn-project/aztec.js/src/api/utils/fee_juice.ts +++ b/yarn-project/aztec.js/src/utils/fee_juice.ts @@ -2,8 +2,7 @@ import { Fr } from '@aztec/foundation/fields'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import type { AztecAddress } from '@aztec/stdlib/aztec-address'; import { deriveStorageSlotInMap } from '@aztec/stdlib/hash'; - -import type { PXE } from '../../api/interfaces/pxe.js'; +import type { PXE } from '@aztec/stdlib/interfaces/client'; /** * Returns the owner's fee juice balance. diff --git a/yarn-project/aztec.js/src/api/utils/field_compressed_string.ts b/yarn-project/aztec.js/src/utils/field_compressed_string.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/field_compressed_string.ts rename to yarn-project/aztec.js/src/utils/field_compressed_string.ts diff --git a/yarn-project/aztec.js/src/api/utils/node.ts b/yarn-project/aztec.js/src/utils/node.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/node.ts rename to yarn-project/aztec.js/src/utils/node.ts diff --git a/yarn-project/aztec.js/src/api/utils/pub_key.ts b/yarn-project/aztec.js/src/utils/pub_key.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/pub_key.ts rename to yarn-project/aztec.js/src/utils/pub_key.ts diff --git a/yarn-project/aztec.js/src/api/utils/pxe.ts b/yarn-project/aztec.js/src/utils/pxe.ts similarity index 100% rename from yarn-project/aztec.js/src/api/utils/pxe.ts rename to yarn-project/aztec.js/src/utils/pxe.ts diff --git a/yarn-project/aztec.js/src/wallet/account_wallet.ts b/yarn-project/aztec.js/src/wallet/account_wallet.ts index 307358909379..55983f9322ea 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet.ts @@ -7,14 +7,14 @@ import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; import type { AccountInterface } from '../account/interface.js'; -import { ContractFunctionInteraction } from '../api/contract/contract_function_interaction.js'; +import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; +import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; import { type IntentAction, type IntentInnerHash, computeAuthWitMessageHash, computeInnerAuthWitHashFromAction, -} from '../api/utils/authwit.js'; -import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +} from '../utils/authwit.js'; import { BaseWallet } from './base_wallet.js'; /** diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index ed9ec93bd99a..c6ef5b918609 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -29,8 +29,8 @@ import type { } from '@aztec/stdlib/tx'; import type { Wallet } from '../account/wallet.js'; -import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; import type { ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; /** * A base class for Wallet implementations diff --git a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts index 79bc47716438..022d2052604f 100644 --- a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts @@ -4,9 +4,9 @@ import type { CompleteAddress } from '@aztec/stdlib/contract'; import type { PXE } from '@aztec/stdlib/interfaces/client'; import type { TxExecutionRequest } from '@aztec/stdlib/tx'; -import type { IntentAction, IntentInnerHash } from '../api/utils/authwit.js'; import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js'; import type { EntrypointInterface, ExecutionRequestInit } from '../entrypoint/entrypoint.js'; +import type { IntentAction, IntentInnerHash } from '../utils/authwit.js'; import { BaseWallet } from './base_wallet.js'; /** From 53912cbc12e5d298decc4a622445ec1ebdd54e11 Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 09:56:16 +0000 Subject: [PATCH 4/9] more cleanup --- playground/src/aztecEnv.ts | 18 +++++---- .../src/components/common/fnParameter.tsx | 2 +- playground/vite.config.ts | 39 +++++++++---------- yarn-project/aztec.js/src/api/abi.ts | 7 ++++ yarn-project/aztec.js/src/api/wallet.ts | 8 +--- yarn-project/aztec.js/src/index.ts | 5 +-- 6 files changed, 39 insertions(+), 40 deletions(-) diff --git a/playground/src/aztecEnv.ts b/playground/src/aztecEnv.ts index 5aceaff7e5a9..715220205ee5 100644 --- a/playground/src/aztecEnv.ts +++ b/playground/src/aztecEnv.ts @@ -1,15 +1,19 @@ -import { createAztecNodeClient, type AztecNode } from '@aztec/aztec.js/utils'; +import { + createAztecNodeClient, + type AztecNode, + AztecAddress, + AccountWalletWithSecretKey, + Contract, + type PXE, + type Logger, + createLogger, +} from '@aztec/aztec.js'; -import { AztecAddress } from '@aztec/aztec.js/addresses'; -import { AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet'; -import { Contract } from '@aztec/aztec.js/contracts'; -import { type PXE } from '@aztec/aztec.js/interfaces/pxe'; import { createPXEService, type PXEServiceConfig, getPXEServiceConfig } from '@aztec/pxe/client/lazy'; import { createStore } from '@aztec/kv-store/indexeddb'; import { createContext } from 'react'; import { NetworkDB, WalletDB } from './utils/storage'; import { type ContractFunctionInteractionTx } from './utils/txs'; -import { type Logger, createLogger } from '@aztec/aztec.js/log'; const logLevel = ['silent', 'fatal', 'error', 'warn', 'info', 'verbose', 'debug', 'trace'] as const; @@ -155,7 +159,7 @@ export class AztecEnv { store: WebLogger.getInstance().createLogger('pxe:data:indexeddb'), pxe: WebLogger.getInstance().createLogger('pxe:service'), prover: WebLogger.getInstance().createLogger('bb:wasm:lazy'), - } + }, }); return pxe; } diff --git a/playground/src/components/common/fnParameter.tsx b/playground/src/components/common/fnParameter.tsx index 30fb78571e08..3b0927df4d06 100644 --- a/playground/src/components/common/fnParameter.tsx +++ b/playground/src/components/common/fnParameter.tsx @@ -1,4 +1,4 @@ -import { type ABIParameter, type AbiType, isAddressStruct } from '@aztec/stdlib/abi'; +import { type ABIParameter, type AbiType, isAddressStruct } from '@aztec/aztec.js'; import { formatFrAsString, parseAliasedBuffersAsString } from '../../utils/conversion'; import { useContext, useState } from 'react'; import EditIcon from '@mui/icons-material/Edit'; diff --git a/playground/vite.config.ts b/playground/vite.config.ts index a497d614a445..25906edaeb52 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -1,7 +1,7 @@ -import { defineConfig, loadEnv, searchForWorkspaceRoot } from "vite"; -import react from "@vitejs/plugin-react-swc"; -import { PolyfillOptions, nodePolyfills } from "vite-plugin-node-polyfills"; -import bundlesize from "vite-plugin-bundlesize"; +import { defineConfig, loadEnv, searchForWorkspaceRoot } from 'vite'; +import react from '@vitejs/plugin-react-swc'; +import { PolyfillOptions, nodePolyfills } from 'vite-plugin-node-polyfills'; +import bundlesize from 'vite-plugin-bundlesize'; // Only required for alternative bb wasm file, left as reference // import { viteStaticCopy } from "vite-plugin-static-copy"; @@ -13,10 +13,7 @@ const nodePolyfillsFix = (options?: PolyfillOptions | undefined): Plugin => { ...nodePolyfills(options), /* @ts-ignore */ resolveId(source: string) { - const m = - /^vite-plugin-node-polyfills\/shims\/(buffer|global|process)$/.exec( - source - ); + const m = /^vite-plugin-node-polyfills\/shims\/(buffer|global|process)$/.exec(source); if (m) { return `./node_modules/vite-plugin-node-polyfills/shims/${m[1]}/dist/index.cjs`; } @@ -26,30 +23,30 @@ const nodePolyfillsFix = (options?: PolyfillOptions | undefined): Plugin => { // https://vite.dev/config/ export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ""); + const env = loadEnv(mode, process.cwd(), ''); return { - logLevel: "error", + logLevel: 'error', server: { // Headers needed for bb WASM to work in multithreaded mode headers: { - "Cross-Origin-Opener-Policy": "same-origin", - "Cross-Origin-Embedder-Policy": "require-corp", + 'Cross-Origin-Opener-Policy': 'same-origin', + 'Cross-Origin-Embedder-Policy': 'require-corp', }, // Allow vite to serve files from these directories, since they are symlinked // These are the protocol circuit artifacts, noir WASMs and bb WASMs. fs: { allow: [ searchForWorkspaceRoot(process.cwd()), - "../yarn-project/noir-protocol-circuits-types/artifacts", - "../noir/packages/noirc_abi/web", - "../noir/packages/acvm_js/web", - "../barretenberg/ts/dest/browser", + '../yarn-project/noir-protocol-circuits-types/artifacts', + '../noir/packages/noirc_abi/web', + '../noir/packages/acvm_js/web', + '../barretenberg/ts/dest/browser', ], }, }, plugins: [ - react({ jsxImportSource: "@emotion/react" }), - nodePolyfillsFix({ include: ["buffer", "path"] }), + react({ jsxImportSource: '@emotion/react' }), + nodePolyfillsFix({ include: ['buffer', 'path'] }), // This is unnecessary unless BB_WASM_PATH is defined (default would be /assets/barretenberg.wasm.gz) // Left as an example of how to use a different bb wasm file than the default lazily loaded one // viteStaticCopy({ @@ -61,11 +58,11 @@ export default defineConfig(({ mode }) => { // ], // }), bundlesize({ - limits: [{ name: "assets/index-*", limit: "1900kB" }], + limits: [{ name: 'assets/index-*', limit: '1600kB' }], }), ], define: { - "process.env": JSON.stringify({ + 'process.env': JSON.stringify({ LOG_LEVEL: env.LOG_LEVEL, // The path to a custom WASM file for bb.js. // Only the single-threaded file name is needed, the multithreaded file name will be inferred @@ -76,7 +73,7 @@ export default defineConfig(({ mode }) => { }, build: { // Required by vite-plugin-bundle-size - sourcemap: "hidden", + sourcemap: 'hidden', }, }; }); diff --git a/yarn-project/aztec.js/src/api/abi.ts b/yarn-project/aztec.js/src/api/abi.ts index 8291aabae1ea..ecbab2520815 100644 --- a/yarn-project/aztec.js/src/api/abi.ts +++ b/yarn-project/aztec.js/src/api/abi.ts @@ -3,6 +3,13 @@ export { type FunctionArtifact, EventSelector, FunctionSelector, + NoteSelector, + type ABIParameter, + isAddressStruct, + isAztecAddressStruct, + isEthAddressStruct, + isWrappedFieldStruct, + isFunctionSelectorStruct, loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer, diff --git a/yarn-project/aztec.js/src/api/wallet.ts b/yarn-project/aztec.js/src/api/wallet.ts index edcf1b0f6e15..e43a5bddb55d 100644 --- a/yarn-project/aztec.js/src/api/wallet.ts +++ b/yarn-project/aztec.js/src/api/wallet.ts @@ -1,7 +1 @@ -export { - AccountWallet, - AccountWalletWithSecretKey as AccountWalletWithSecretKey, - SignerlessWallet, - type Wallet, - getWallet, -} from '../wallet/index.js'; +export { AccountWallet, AccountWalletWithSecretKey, SignerlessWallet, getWallet } from '../wallet/index.js'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 2da0faf02abf..05c13053691a 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -20,10 +20,6 @@ * TODO: Ultimately reimplement this mega exporter by mega exporting a granular api (then deprecate it). */ -export { NoteSelector } from '@aztec/stdlib/abi'; - -export { EthAddress } from '@aztec/foundation/eth-address'; - export { Fq, Fr, Point, GrumpkinScalar } from '@aztec/foundation/fields'; export { SiblingPath } from '@aztec/foundation/trees'; @@ -91,6 +87,7 @@ export * from './api/account.js'; export * from './api/addresses.js'; export * from './api/deployment.js'; export * from './api/ethereum.js'; +export * from './api/eth_address.js'; export * from './api/fee.js'; export * from './api/log.js'; export * from './api/contract.js'; From 5ed100d1b69729c4c50523fc04e32c7537dd3b15 Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 10:12:40 +0000 Subject: [PATCH 5/9] fixed docs, renaming --- docs/docs/developers/guides/js_apps/pay_fees.md | 2 +- yarn-project/pxe/src/entrypoints/client/bundle/index.ts | 2 +- yarn-project/pxe/src/entrypoints/client/lazy/index.ts | 2 +- yarn-project/pxe/src/entrypoints/server/index.ts | 2 +- .../pxe/src/pxe_oracle_interface/pxe_oracle_interface.test.ts | 2 +- .../pxe_oracle_interface/{index.ts => pxe_oracle_interface.ts} | 0 yarn-project/pxe/src/pxe_service/pxe_service.ts | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename yarn-project/pxe/src/pxe_oracle_interface/{index.ts => pxe_oracle_interface.ts} (100%) diff --git a/docs/docs/developers/guides/js_apps/pay_fees.md b/docs/docs/developers/guides/js_apps/pay_fees.md index 53b846734ae7..920485bff762 100644 --- a/docs/docs/developers/guides/js_apps/pay_fees.md +++ b/docs/docs/developers/guides/js_apps/pay_fees.md @@ -79,7 +79,7 @@ After a user has sent fee juice from L1 to be bridged to L2, a transaction can b The claim object: -#include_code claim_type_amount yarn-project/aztec.js/src/api/ethereum/portal_manager.ts javascript +#include_code claim_type_amount yarn-project/aztec.js/src/ethereum/portal_manager.ts javascript Calling a function on an object (in this case checking the balance of the fee juice contract) diff --git a/yarn-project/pxe/src/entrypoints/client/bundle/index.ts b/yarn-project/pxe/src/entrypoints/client/bundle/index.ts index 3f4a339f0e71..46e26b7bd029 100644 --- a/yarn-project/pxe/src/entrypoints/client/bundle/index.ts +++ b/yarn-project/pxe/src/entrypoints/client/bundle/index.ts @@ -2,4 +2,4 @@ export * from '../../../pxe_service/index.js'; export * from '../../../config/index.js'; export * from '../../../storage/index.js'; export * from './utils.js'; -export { PXEOracleInterface } from '../../../pxe_oracle_interface/index.js'; +export { PXEOracleInterface } from '../../../pxe_oracle_interface/pxe_oracle_interface.js'; diff --git a/yarn-project/pxe/src/entrypoints/client/lazy/index.ts b/yarn-project/pxe/src/entrypoints/client/lazy/index.ts index 3f4a339f0e71..46e26b7bd029 100644 --- a/yarn-project/pxe/src/entrypoints/client/lazy/index.ts +++ b/yarn-project/pxe/src/entrypoints/client/lazy/index.ts @@ -2,4 +2,4 @@ export * from '../../../pxe_service/index.js'; export * from '../../../config/index.js'; export * from '../../../storage/index.js'; export * from './utils.js'; -export { PXEOracleInterface } from '../../../pxe_oracle_interface/index.js'; +export { PXEOracleInterface } from '../../../pxe_oracle_interface/pxe_oracle_interface.js'; diff --git a/yarn-project/pxe/src/entrypoints/server/index.ts b/yarn-project/pxe/src/entrypoints/server/index.ts index 05cc5088853b..aa939b193464 100644 --- a/yarn-project/pxe/src/entrypoints/server/index.ts +++ b/yarn-project/pxe/src/entrypoints/server/index.ts @@ -3,4 +3,4 @@ export * from '../../pxe_http/index.js'; export * from '../../config/index.js'; export * from '../../storage/index.js'; export * from './utils.js'; -export { PXEOracleInterface } from '../../pxe_oracle_interface/index.js'; +export { PXEOracleInterface } from '../../pxe_oracle_interface/pxe_oracle_interface.js'; diff --git a/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.test.ts b/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.test.ts index a1e5e180c0d1..75c70306eadb 100644 --- a/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.test.ts +++ b/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.test.ts @@ -26,7 +26,7 @@ import { ContractDataProvider } from '../storage/contract_data_provider/contract import { NoteDataProvider } from '../storage/note_data_provider/note_data_provider.js'; import { SyncDataProvider } from '../storage/sync_data_provider/sync_data_provider.js'; import { TaggingDataProvider } from '../storage/tagging_data_provider/tagging_data_provider.js'; -import { PXEOracleInterface } from './index.js'; +import { PXEOracleInterface } from './pxe_oracle_interface.js'; import { WINDOW_HALF_SIZE } from './tagging_utils.js'; const TXS_PER_BLOCK = 4; diff --git a/yarn-project/pxe/src/pxe_oracle_interface/index.ts b/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts similarity index 100% rename from yarn-project/pxe/src/pxe_oracle_interface/index.ts rename to yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index f10fb2300e1e..ad6b30382118 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -71,7 +71,7 @@ import type { PXEServiceConfig } from '../config/index.js'; import { getPackageInfo } from '../config/package_info.js'; import { KernelOracle } from '../kernel_oracle/index.js'; import { KernelProver, type ProvingConfig } from '../kernel_prover/kernel_prover.js'; -import { PXEOracleInterface } from '../pxe_oracle_interface/index.js'; +import { PXEOracleInterface } from '../pxe_oracle_interface/pxe_oracle_interface.js'; import { AddressDataProvider } from '../storage/address_data_provider/address_data_provider.js'; import { AuthWitnessDataProvider } from '../storage/auth_witness_data_provider/auth_witness_data_provider.js'; import { CapsuleDataProvider } from '../storage/capsule_data_provider/capsule_data_provider.js'; From b11999fc39b0aff09fa191e8bae225b4632ecec1 Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 10:49:40 +0000 Subject: [PATCH 6/9] updated CODEOWNERS --- CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index d0a03ed6eb87..fcdff07a0f8d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -37,3 +37,6 @@ # on changes to the AVM transpiler /avm-transpiler/src @fcarreiro @dbanks12 ##################################################### + +# Notify fairies of changes to playground bundler config +/playground/vite.config.ts @Thunkar From a2b69dd01329daa8d990d0f4963da2cc2ca0ab59 Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 13:58:35 +0000 Subject: [PATCH 7/9] cleaner --- yarn-project/aztec.js/src/api/abi.ts | 4 ++++ yarn-project/aztec.js/src/api/contract.ts | 9 +++++++++ yarn-project/aztec.js/src/index.ts | 2 -- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/yarn-project/aztec.js/src/api/abi.ts b/yarn-project/aztec.js/src/api/abi.ts index ecbab2520815..202228406304 100644 --- a/yarn-project/aztec.js/src/api/abi.ts +++ b/yarn-project/aztec.js/src/api/abi.ts @@ -3,8 +3,12 @@ export { type FunctionArtifact, EventSelector, FunctionSelector, + FunctionCall, NoteSelector, type ABIParameter, + decodeFromAbi, + encodeArguments, + type AbiType, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, diff --git a/yarn-project/aztec.js/src/api/contract.ts b/yarn-project/aztec.js/src/api/contract.ts index f9c41522a263..e128adf0e465 100644 --- a/yarn-project/aztec.js/src/api/contract.ts +++ b/yarn-project/aztec.js/src/api/contract.ts @@ -51,3 +51,12 @@ export { export { BatchCall } from '../contract/batch_call.js'; export { type DeployOptions, DeployMethod } from '../contract/deploy_method.js'; export { DeploySentTx } from '../contract/deploy_sent_tx.js'; + +export { + type PartialAddress, + type ContractClassWithId, + type ContractInstanceWithAddress, + getContractClassFromArtifact, + getContractInstanceFromDeployParams, + type NodeInfo, +} from '@aztec/stdlib/contract'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 05c13053691a..1b83e91b36b6 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -45,7 +45,6 @@ export { } from '@aztec/stdlib/keys'; export { AuthWitness } from '@aztec/stdlib/auth-witness'; export { getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers'; -export { FunctionCall } from '@aztec/stdlib/abi'; export { Tx, TxExecutionRequest, @@ -68,7 +67,6 @@ export { ProtocolContractAddress } from '@aztec/protocol-contracts'; // TODO: These kinds of things have no place on our public api. // External devs will almost certainly have their own methods of doing these things. // If we want to use them in our own "aztec.js consuming code", import them from foundation as needed. -export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/stdlib/abi'; export { toBigIntBE } from '@aztec/foundation/bigint-buffer'; export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto'; export { makeFetch } from '@aztec/foundation/json-rpc/client'; From 189439a9ce15221a9cbd846bbe172f99e7727a6d Mon Sep 17 00:00:00 2001 From: thunkar Date: Fri, 7 Mar 2025 14:16:39 +0000 Subject: [PATCH 8/9] save file --- yarn-project/aztec.js/src/index.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 1b83e91b36b6..6f51e88a49c3 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -26,14 +26,6 @@ export { SiblingPath } from '@aztec/foundation/trees'; export { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; -export { - type PartialAddress, - type ContractClassWithId, - type ContractInstanceWithAddress, - getContractClassFromArtifact, - getContractInstanceFromDeployParams, - type NodeInfo, -} from '@aztec/stdlib/contract'; export { MerkleTreeId, merkleTreeIds } from '@aztec/stdlib/trees'; export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys'; export { computeSecretHash } from '@aztec/stdlib/hash'; From 6a77e499ba31e625686f9e6f66b3cbfbc176d847 Mon Sep 17 00:00:00 2001 From: thunkar Date: Tue, 11 Mar 2025 09:24:20 +0000 Subject: [PATCH 9/9] fix --- .../aztec.js/src/account_manager/deploy_account_method.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts index debabd70bd7f..19d56d5c4316 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts @@ -4,8 +4,8 @@ import type { PublicKeys } from '@aztec/stdlib/keys'; import type { AuthWitnessProvider } from '../account/interface.js'; import type { Wallet } from '../account/wallet.js'; import { Contract } from '../contract/contract.js'; +import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js'; -import { ContractFunctionInteraction } from '../contract/index.js'; import { EntrypointPayload, computeCombinedPayloadHash } from '../entrypoint/payload.js'; /**