From 98efed75a7ec6b6279a8040dc0893a0c947181bc Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 31 Oct 2023 09:22:53 +0000 Subject: [PATCH] fix --- .../src/aztec_node_client.ts} | 5 +---- yarn-project/aztec.js/src/index.ts | 1 + yarn-project/aztec.js/src/pxe_client.ts | 6 ++++++ yarn-project/aztec.js/src/wallet/base_wallet.ts | 4 ++++ yarn-project/pxe/src/bin/index.ts | 1 - yarn-project/types/src/aztec_node/rpc/index.ts | 1 - yarn-project/types/src/index.ts | 1 - 7 files changed, 12 insertions(+), 7 deletions(-) rename yarn-project/{types/src/aztec_node/rpc/http_rpc_client.ts => aztec.js/src/aztec_node_client.ts} (80%) delete mode 100644 yarn-project/types/src/aztec_node/rpc/index.ts diff --git a/yarn-project/types/src/aztec_node/rpc/http_rpc_client.ts b/yarn-project/aztec.js/src/aztec_node_client.ts similarity index 80% rename from yarn-project/types/src/aztec_node/rpc/http_rpc_client.ts rename to yarn-project/aztec.js/src/aztec_node_client.ts index 1c3123023575..d9a747341a70 100644 --- a/yarn-project/types/src/aztec_node/rpc/http_rpc_client.ts +++ b/yarn-project/aztec.js/src/aztec_node_client.ts @@ -1,7 +1,4 @@ -import { FunctionSelector, HistoricBlockData } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { Fr } from '@aztec/foundation/fields'; +import { AztecAddress, EthAddress, Fr, FunctionSelector, HistoricBlockData } from '@aztec/circuits.js'; import { createJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client'; import { AztecNode, diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 4f315d036fb7..d6416d2632b8 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -2,6 +2,7 @@ export * from './contract/index.js'; export * from './contract_deployer/index.js'; export * from './utils/index.js'; export * from './pxe_client.js'; +export * from './aztec_node_client.js'; export * from './account/index.js'; export * from './contract_deployer/deploy_method.js'; export * from './sandbox/index.js'; diff --git a/yarn-project/aztec.js/src/pxe_client.ts b/yarn-project/aztec.js/src/pxe_client.ts index c50cdc848de3..9ac83f8c2397 100644 --- a/yarn-project/aztec.js/src/pxe_client.ts +++ b/yarn-project/aztec.js/src/pxe_client.ts @@ -27,6 +27,12 @@ import { export { makeFetch } from '@aztec/foundation/json-rpc/client'; +/** + * Creates a JSON-RPC client to remotely talk to PXE. + * @param url - The URL of the PXE. + * @param fetch - The fetch implementation to use. + * @returns A JSON-RPC client of PXE. + */ export const createPXEClient = (url: string, fetch = makeFetch([1, 2, 3], true)): PXE => createJsonRpcClient( url, diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index 6003bdb24968..2a1f5235b4e9 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -7,6 +7,7 @@ import { ExtendedNote, FunctionCall, GetUnencryptedLogsResponse, + L2Block, L2Tx, LogFilter, NodeInfo, @@ -82,6 +83,9 @@ export abstract class BaseWallet implements Wallet { getNoteNonces(note: ExtendedNote): Promise { return this.pxe.getNoteNonces(note); } + getBlock(number: number): Promise { + return this.pxe.getBlock(number); + } viewTx(functionName: string, args: any[], to: AztecAddress, from?: AztecAddress | undefined): Promise { return this.pxe.viewTx(functionName, args, to, from); } diff --git a/yarn-project/pxe/src/bin/index.ts b/yarn-project/pxe/src/bin/index.ts index de9e3684ed21..6fefdee777e4 100644 --- a/yarn-project/pxe/src/bin/index.ts +++ b/yarn-project/pxe/src/bin/index.ts @@ -1,6 +1,5 @@ #!/usr/bin/env -S node --no-warnings import { createDebugLogger } from '@aztec/foundation/log'; -import { createAztecNodeClient } from '@aztec/types'; import { getPXEServiceConfig } from '../config/index.js'; import { startPXEHttpServer } from '../pxe_http/index.js'; diff --git a/yarn-project/types/src/aztec_node/rpc/index.ts b/yarn-project/types/src/aztec_node/rpc/index.ts deleted file mode 100644 index e8ecf164fef7..000000000000 --- a/yarn-project/types/src/aztec_node/rpc/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './http_rpc_client.js'; diff --git a/yarn-project/types/src/index.ts b/yarn-project/types/src/index.ts index 3ffc81251033..40a6906e88fb 100644 --- a/yarn-project/types/src/index.ts +++ b/yarn-project/types/src/index.ts @@ -22,6 +22,5 @@ export * from './packed_arguments.js'; export * from './interfaces/index.js'; export * from './sibling_path.js'; export * from './auth_witness.js'; -export * from './aztec_node/rpc/index.js'; export * from '@aztec/circuits.js/types'; export { CompleteAddress } from '@aztec/circuits.js';