@aztec/aztec.js 0.1.0-alpha22 → 0.1.0-alpha23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.tsbuildinfo +1 -1
  2. package/README.md +1 -1
  3. package/dest/account_impl/account_contract.d.ts +3 -4
  4. package/dest/account_impl/account_contract.d.ts.map +1 -1
  5. package/dest/account_impl/account_contract.js +3 -4
  6. package/dest/auth/schnorr.d.ts +1 -1
  7. package/dest/auth/schnorr.d.ts.map +1 -1
  8. package/dest/auth/schnorr.js +1 -1
  9. package/dest/aztec_rpc_client/aztec_rpc_client.d.ts +1 -1
  10. package/dest/aztec_rpc_client/aztec_rpc_client.d.ts.map +1 -1
  11. package/dest/aztec_rpc_client/aztec_rpc_client.js +3 -3
  12. package/dest/aztec_rpc_client/wallet.d.ts +2 -3
  13. package/dest/aztec_rpc_client/wallet.d.ts.map +1 -1
  14. package/dest/aztec_rpc_client/wallet.js +1 -1
  15. package/dest/contract/contract.d.ts +1 -1
  16. package/dest/contract/contract.d.ts.map +1 -1
  17. package/dest/contract/contract.js +2 -2
  18. package/dest/contract/contract.test.js +4 -4
  19. package/dest/contract/contract_function_interaction.d.ts +2 -3
  20. package/dest/contract/contract_function_interaction.d.ts.map +1 -1
  21. package/dest/contract/contract_function_interaction.js +3 -5
  22. package/dest/contract/sent_tx.d.ts +1 -1
  23. package/dest/contract/sent_tx.d.ts.map +1 -1
  24. package/dest/contract/sent_tx.js +2 -2
  25. package/dest/contract_deployer/contract_deployer.d.ts +2 -1
  26. package/dest/contract_deployer/contract_deployer.d.ts.map +1 -1
  27. package/dest/contract_deployer/contract_deployer.js +2 -2
  28. package/dest/contract_deployer/contract_deployer.test.js +4 -4
  29. package/dest/contract_deployer/deploy_method.d.ts +2 -3
  30. package/dest/contract_deployer/deploy_method.d.ts.map +1 -1
  31. package/dest/contract_deployer/deploy_method.js +2 -3
  32. package/dest/index.d.ts +2 -1
  33. package/dest/index.d.ts.map +1 -1
  34. package/dest/index.js +3 -2
  35. package/dest/utils/account.d.ts +1 -1
  36. package/dest/utils/account.d.ts.map +1 -1
  37. package/dest/utils/account.js +4 -4
  38. package/dest/utils/pub_key.d.ts.map +1 -1
  39. package/dest/utils/pub_key.js +1 -1
  40. package/package.json +5 -6
  41. package/src/account_impl/account_contract.ts +5 -7
  42. package/src/auth/schnorr.ts +2 -1
  43. package/src/aztec_rpc_client/aztec_rpc_client.ts +10 -2
  44. package/src/aztec_rpc_client/wallet.ts +15 -3
  45. package/src/contract/contract.test.ts +4 -4
  46. package/src/contract/contract.ts +2 -2
  47. package/src/contract/contract_function_interaction.ts +5 -6
  48. package/src/contract/sent_tx.ts +1 -1
  49. package/src/contract_deployer/contract_deployer.test.ts +5 -5
  50. package/src/contract_deployer/contract_deployer.ts +3 -2
  51. package/src/contract_deployer/deploy_method.ts +9 -4
  52. package/src/index.ts +4 -1
  53. package/src/utils/account.ts +4 -3
  54. package/src/utils/pub_key.ts +1 -0
  55. package/tsconfig.json +2 -5
@@ -1 +1 @@
1
- {"version":3,"file":"pub_key.d.ts","sourceRoot":"","sources":["../../src/utils/pub_key.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAG1E"}
1
+ {"version":3,"file":"pub_key.d.ts","sourceRoot":"","sources":["../../src/utils/pub_key.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAG1E"}
@@ -9,4 +9,4 @@ export async function generatePublicKey(privateKey) {
9
9
  const grumpkin = await Grumpkin.new();
10
10
  return Point.fromBuffer(grumpkin.mul(grumpkin.generator(), privateKey));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UFDLFVBQVUsQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxTQUFTLEVBQUUsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQzFFLENBQUMifQ==
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@aztec/aztec.js",
3
- "version": "0.1.0-alpha22",
3
+ "version": "0.1.0-alpha23",
4
4
  "exports": "./dest/index.js",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@aztec/aztec-rpc": "0.1.0-alpha22",
8
- "@aztec/circuits.js": "0.1.0-alpha22",
9
- "@aztec/foundation": "0.1.0-alpha22",
10
- "@aztec/key-store": "0.1.0-alpha22",
11
- "@aztec/noir-contracts": "0.1.0-alpha22",
7
+ "@aztec/circuits.js": "0.1.0-alpha23",
8
+ "@aztec/foundation": "0.1.0-alpha23",
9
+ "@aztec/noir-contracts": "0.1.0-alpha23",
10
+ "@aztec/types": "0.1.0-alpha23",
12
11
  "tslib": "^2.4.0"
13
12
  }
14
13
  }
@@ -1,13 +1,11 @@
1
- import { encodeArguments } from '@aztec/acir-simulator';
2
- import { AztecAddress, CircuitsWasm, Fr, FunctionData, TxContext } from '@aztec/circuits.js';
1
+ import partition from 'lodash.partition';
2
+ import { AztecAddress, CircuitsWasm, Fr, FunctionData, PartialContractAddress, TxContext } from '@aztec/circuits.js';
3
3
  import { padArrayEnd } from '@aztec/foundation/collection';
4
4
  import { sha256 } from '@aztec/foundation/crypto';
5
- import { PublicKey } from '@aztec/key-store';
6
- import { ExecutionRequest, PackedArguments, PartialContractAddress, TxExecutionRequest } from '@aztec/types';
7
- import partition from 'lodash.partition';
8
- import { generateFunctionSelector } from '../index.js';
5
+ import { ExecutionRequest, PackedArguments, PublicKey, TxExecutionRequest } from '@aztec/types';
6
+ import { ContractAbi, encodeArguments, generateFunctionSelector } from '@aztec/foundation/abi';
7
+
9
8
  import { AccountImplementation } from './index.js';
10
- import { ContractAbi } from '@aztec/foundation/abi';
11
9
  import { EcdsaAuthProvider, SchnorrAuthProvider } from '../auth/index.js';
12
10
 
13
11
  /**
@@ -1,5 +1,6 @@
1
1
  import { Schnorr } from '@aztec/circuits.js/barretenberg';
2
- import { AuthPayload, AztecAddress, EntrypointPayload } from '@aztec/aztec.js';
2
+
3
+ import { AuthPayload, AztecAddress, EntrypointPayload } from '../index.js';
3
4
 
4
5
  /**
5
6
  * Implementation of a schnorr signature provider
@@ -1,6 +1,14 @@
1
- import { AztecAddress, AztecRPC, EthAddress, Fr, Point, Tx } from '@aztec/aztec-rpc';
1
+ import { AztecAddress, EthAddress, Fr, Point } from '@aztec/circuits.js';
2
2
  import { createJsonRpcClient } from '@aztec/foundation/json-rpc';
3
- import { ContractData, ContractDeploymentTx, ContractPublicData, TxExecutionRequest, TxHash } from '@aztec/types';
3
+ import {
4
+ AztecRPC,
5
+ ContractData,
6
+ ContractDeploymentTx,
7
+ ContractPublicData,
8
+ TxExecutionRequest,
9
+ TxHash,
10
+ Tx,
11
+ } from '@aztec/types';
4
12
 
5
13
  export const createAztecRpcClient = (url: string): AztecRPC =>
6
14
  createJsonRpcClient<AztecRPC>(
@@ -1,7 +1,19 @@
1
- import { AztecAddress, AztecRPC, DeployedContract, Fr, NodeInfo, Point, Tx, TxHash, TxReceipt } from '@aztec/aztec-rpc';
2
- import { TxContext } from '@aztec/circuits.js';
1
+ import { AztecAddress, Fr, Point, TxContext } from '@aztec/circuits.js';
3
2
  import { ContractAbi } from '@aztec/foundation/abi';
4
- import { ContractData, ContractPublicData, ExecutionRequest, L2BlockL2Logs, TxExecutionRequest } from '@aztec/types';
3
+ import {
4
+ AztecRPC,
5
+ ContractData,
6
+ ContractPublicData,
7
+ DeployedContract,
8
+ ExecutionRequest,
9
+ L2BlockL2Logs,
10
+ NodeInfo,
11
+ Tx,
12
+ TxExecutionRequest,
13
+ TxHash,
14
+ TxReceipt,
15
+ } from '@aztec/types';
16
+
5
17
  import { AccountImplementation } from '../account_impl/index.js';
6
18
 
7
19
  /**
@@ -1,11 +1,11 @@
1
- import { AztecAddress, DeployedContract, EthAddress, NodeInfo, Tx, TxHash, TxReceipt } from '@aztec/aztec-rpc';
2
1
  import { MockProxy, mock } from 'jest-mock-extended';
3
-
2
+ import { DeployedContract, NodeInfo, Tx, TxHash, TxReceipt } from '@aztec/types';
4
3
  import { ABIParameterVisibility, ContractAbi, FunctionType } from '@aztec/foundation/abi';
5
4
  import { randomBytes } from '@aztec/foundation/crypto';
6
5
  import { TxExecutionRequest } from '@aztec/types';
7
6
  import { Wallet } from '../aztec_rpc_client/wallet.js';
8
7
  import { Contract } from './contract.js';
8
+ import { AztecAddress, EthAddress } from '@aztec/circuits.js';
9
9
 
10
10
  describe('Contract Class', () => {
11
11
  let wallet: MockProxy<Wallet>;
@@ -102,7 +102,7 @@ describe('Contract Class', () => {
102
102
  const param0 = 12;
103
103
  const param1 = 345n;
104
104
  const sentTx = fooContract.methods.bar(param0, param1).send({
105
- from: account,
105
+ origin: account,
106
106
  });
107
107
  const txHash = await sentTx.getTxHash();
108
108
  const receipt = await sentTx.getReceipt();
@@ -128,7 +128,7 @@ describe('Contract Class', () => {
128
128
  const fooContract = new Contract(contractAddress, defaultAbi, wallet);
129
129
  expect(() =>
130
130
  fooContract.methods.qux().send({
131
- from: account,
131
+ origin: account,
132
132
  }),
133
133
  ).toThrow();
134
134
  });
@@ -1,9 +1,9 @@
1
- import { DeployedContract, generateFunctionSelector } from '@aztec/aztec-rpc';
2
- import { ContractAbi, FunctionAbi } from '@aztec/foundation/abi';
1
+ import { ContractAbi, FunctionAbi, generateFunctionSelector } from '@aztec/foundation/abi';
3
2
  import { AztecAddress } from '@aztec/foundation/aztec-address';
4
3
  import { EthAddress } from '@aztec/foundation/eth-address';
5
4
  import { Wallet } from '../aztec_rpc_client/wallet.js';
6
5
  import { ContractFunctionInteraction } from './contract_function_interaction.js';
6
+ import { DeployedContract } from '@aztec/types';
7
7
 
8
8
  /**
9
9
  * Type representing a contract method that returns a ContractFunctionInteraction instance
@@ -1,8 +1,7 @@
1
- import { encodeArguments } from '@aztec/acir-simulator';
2
- import { generateFunctionSelector, Tx } from '@aztec/aztec-rpc';
3
1
  import { AztecAddress, Fr, FunctionData, TxContext } from '@aztec/circuits.js';
4
- import { FunctionAbi, FunctionType } from '@aztec/foundation/abi';
5
- import { ExecutionRequest, TxExecutionRequest } from '@aztec/types';
2
+ import { FunctionAbi, FunctionType, encodeArguments, generateFunctionSelector } from '@aztec/foundation/abi';
3
+ import { ExecutionRequest, Tx, TxExecutionRequest } from '@aztec/types';
4
+
6
5
  import { Wallet } from '../aztec_rpc_client/wallet.js';
7
6
  import { SentTx } from './sent_tx.js';
8
7
 
@@ -14,7 +13,7 @@ export interface SendMethodOptions {
14
13
  /**
15
14
  * Sender's address initiating the transaction.
16
15
  */
17
- from?: AztecAddress;
16
+ origin?: AztecAddress;
18
17
  /**
19
18
  * The nonce representing the order of transactions sent by the address.
20
19
  */
@@ -61,7 +60,7 @@ export class ContractFunctionInteraction {
61
60
  throw new Error("Can't call `create` on an unconstrained function.");
62
61
  }
63
62
  if (!this.txRequest) {
64
- const executionRequest = this.getExecutionRequest(this.contractAddress, options.from);
63
+ const executionRequest = this.getExecutionRequest(this.contractAddress, options.origin);
65
64
  const nodeInfo = await this.wallet.getNodeInfo();
66
65
  const txContext = TxContext.empty(new Fr(nodeInfo.chainId), new Fr(nodeInfo.version));
67
66
  const txRequest = await this.wallet.createAuthenticatedTxRequest([executionRequest], txContext);
@@ -1,5 +1,5 @@
1
- import { AztecRPC, TxReceipt, TxHash, TxStatus } from '@aztec/aztec-rpc';
2
1
  import { retryUntil } from '@aztec/foundation/retry';
2
+ import { AztecRPC, TxHash, TxReceipt, TxStatus } from '@aztec/types';
3
3
 
4
4
  /**
5
5
  * The SentTx class represents a sent transaction through the AztecRPCClient, providing methods to fetch
@@ -1,9 +1,9 @@
1
- import { AztecRPC, Tx, TxHash, TxReceipt } from '@aztec/aztec-rpc';
2
- import { AztecAddress, EthAddress, Fr, Point } from '@aztec/circuits.js';
3
- import { ContractAbi, FunctionType } from '@aztec/foundation/abi';
4
- import { PublicKey } from '@aztec/key-store';
5
1
  import { randomBytes } from 'crypto';
6
2
  import { MockProxy, mock } from 'jest-mock-extended';
3
+ import { AztecAddress, EthAddress, Fr, Point } from '@aztec/circuits.js';
4
+ import { ContractAbi, FunctionType } from '@aztec/foundation/abi';
5
+ import { AztecRPC, Tx, TxHash, TxReceipt, PublicKey } from '@aztec/types';
6
+
7
7
  import { ContractDeployer } from './contract_deployer.js';
8
8
 
9
9
  describe.skip('Contract Deployer', () => {
@@ -43,7 +43,7 @@ describe.skip('Contract Deployer', () => {
43
43
  const sentTx = deployer.deploy(args[0], args[1]).send({
44
44
  portalContract,
45
45
  contractAddressSalt,
46
- from: account,
46
+ origin: account,
47
47
  });
48
48
  const txHash = await sentTx.getTxHash();
49
49
  const receipt = await sentTx.getReceipt();
@@ -1,7 +1,8 @@
1
- import { AztecRPC, Point } from '@aztec/aztec-rpc';
1
+ import { Point } from '@aztec/circuits.js';
2
2
  import { ContractAbi } from '@aztec/foundation/abi';
3
+ import { AztecRPC, PublicKey } from '@aztec/types';
4
+
3
5
  import { DeployMethod } from './deploy_method.js';
4
- import { PublicKey } from '@aztec/key-store';
5
6
 
6
7
  /**
7
8
  * A class for deploying contract.
@@ -1,11 +1,16 @@
1
- import { AztecRPC, getContractDeploymentInfo } from '@aztec/aztec-rpc';
2
- import { CircuitsWasm, ContractDeploymentData, TxContext } from '@aztec/circuits.js';
1
+ import {
2
+ CircuitsWasm,
3
+ ContractDeploymentData,
4
+ PartialContractAddress,
5
+ TxContext,
6
+ getContractDeploymentInfo,
7
+ } from '@aztec/circuits.js';
3
8
  import { ContractAbi } from '@aztec/foundation/abi';
4
9
  import { AztecAddress } from '@aztec/foundation/aztec-address';
5
10
  import { EthAddress } from '@aztec/foundation/eth-address';
6
11
  import { Fr } from '@aztec/foundation/fields';
7
- import { PublicKey } from '@aztec/key-store';
8
- import { ExecutionRequest, PackedArguments, PartialContractAddress, Tx, TxExecutionRequest } from '@aztec/types';
12
+ import { AztecRPC, ExecutionRequest, PackedArguments, PublicKey, Tx, TxExecutionRequest } from '@aztec/types';
13
+
9
14
  import { BaseWallet, Wallet } from '../aztec_rpc_client/wallet.js';
10
15
  import { Contract, ContractFunctionInteraction, SendMethodOptions } from '../contract/index.js';
11
16
 
package/src/index.ts CHANGED
@@ -6,4 +6,7 @@ export * from './auth/index.js';
6
6
  export * from './account_impl/index.js';
7
7
 
8
8
  // TODO - only export necessary stuffs
9
- export * from '@aztec/aztec-rpc';
9
+ // export * from '@aztec/aztec-rpc';
10
+
11
+ export { AztecAddress, EthAddress, Point, Fr } from '@aztec/circuits.js';
12
+ export { AztecRPC } from '@aztec/types';
@@ -1,8 +1,10 @@
1
- import { AztecRPC, TxStatus, getContractDeploymentInfo } from '@aztec/aztec-rpc';
2
- import { CircuitsWasm, Fr } from '@aztec/circuits.js';
1
+ import { CircuitsWasm, Fr, getContractDeploymentInfo } from '@aztec/circuits.js';
3
2
  import { randomBytes } from '@aztec/foundation/crypto';
4
3
  import { createDebugLogger } from '@aztec/foundation/log';
4
+ import { AztecRPC, TxStatus } from '@aztec/types';
5
5
  import { SchnorrAccountContractAbi } from '@aztec/noir-contracts/examples';
6
+ import { Schnorr } from '@aztec/circuits.js/barretenberg';
7
+
6
8
  import { AccountWallet, Wallet } from '../aztec_rpc_client/wallet.js';
7
9
  import {
8
10
  AccountCollection,
@@ -11,7 +13,6 @@ import {
11
13
  SchnorrAuthProvider,
12
14
  generatePublicKey,
13
15
  } from '../index.js';
14
- import { Schnorr } from '@aztec/circuits.js/barretenberg';
15
16
 
16
17
  /**
17
18
  * Creates an Aztec Account.
@@ -1,4 +1,5 @@
1
1
  import { Grumpkin } from '@aztec/circuits.js/barretenberg';
2
+
2
3
  import { Point } from '../index.js';
3
4
 
4
5
  /**
package/tsconfig.json CHANGED
@@ -6,9 +6,6 @@
6
6
  "tsBuildInfoFile": ".tsbuildinfo"
7
7
  },
8
8
  "references": [
9
- {
10
- "path": "../aztec-rpc"
11
- },
12
9
  {
13
10
  "path": "../circuits.js"
14
11
  },
@@ -16,10 +13,10 @@
16
13
  "path": "../foundation"
17
14
  },
18
15
  {
19
- "path": "../key-store"
16
+ "path": "../noir-contracts"
20
17
  },
21
18
  {
22
- "path": "../noir-contracts"
19
+ "path": "../types"
23
20
  }
24
21
  ],
25
22
  "include": ["src"]