Skip to content

Commit

Permalink
feat: contract ts interface to use only aztec.js imports (#2876)
Browse files Browse the repository at this point in the history
Currently we expect users to have `@aztec/foundation` npm package
imported when everything except `ContractArtifact` is also exported from
aztec.js

Seems nice to just use 1 package! 

Also lint it!
  • Loading branch information
rahul-kothari authored Oct 17, 2023
1 parent b0915a8 commit 6952a1a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export {
TxStatus,
emptyFunctionCall,
} from '@aztec/types';

export { ContractArtifact } from '@aztec/foundation/abi';
export { createDebugLogger, DebugLogger } from '@aztec/foundation/log';
export { fileURLToPath } from '@aztec/foundation/url';
export { sleep } from '@aztec/foundation/sleep';
23 changes: 19 additions & 4 deletions yarn-project/noir-compiler/src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,25 @@ exports[`noir-compiler using nargo binary generates typescript interface 1`] = `
/* Autogenerated file, do not edit! */
/* eslint-disable */
import { AztecAddress, CompleteAddress, Contract, ContractBase, ContractFunctionInteraction, ContractMethod, DeployMethod, EthAddress, FieldLike, AztecAddressLike, EthAddressLike, Wallet } from '@aztec/aztec.js';
import { Fr, Point } from '@aztec/foundation/fields';
import { PXE, PublicKey } from '@aztec/types';
import { ContractArtifact } from '@aztec/foundation/abi';
import {
AztecAddress,
AztecAddressLike,
CompleteAddress,
Contract,
ContractArtifact,
ContractBase,
ContractFunctionInteraction,
ContractMethod,
DeployMethod,
EthAddress,
EthAddressLike,
FieldLike,
Fr,
PXE,
Point,
PublicKey,
Wallet,
} from '@aztec/aztec.js';
import TestContractContractArtifactJson from '../target/test.json' assert { type: 'json' };
export const TestContractContractArtifact = TestContractContractArtifactJson as ContractArtifact;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,25 @@ export function generateTypescriptContractInterface(input: ContractArtifact, art
/* Autogenerated file, do not edit! */
/* eslint-disable */
import { AztecAddress, CompleteAddress, Contract, ContractBase, ContractFunctionInteraction, ContractMethod, DeployMethod, EthAddress, FieldLike, AztecAddressLike, EthAddressLike, Wallet } from '@aztec/aztec.js';
import { Fr, Point } from '@aztec/foundation/fields';
import { PXE, PublicKey } from '@aztec/types';
import { ContractArtifact } from '@aztec/foundation/abi';
import {
AztecAddress,
AztecAddressLike,
CompleteAddress,
Contract,
ContractArtifact,
ContractBase,
ContractFunctionInteraction,
ContractMethod,
DeployMethod,
EthAddress,
EthAddressLike,
FieldLike,
Fr,
PXE,
Point,
PublicKey,
Wallet,
} from '@aztec/aztec.js';
${artifactStatement}
/**
Expand Down

0 comments on commit 6952a1a

Please sign in to comment.