@aztec/aztec.js 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/api/abi.d.ts +2 -0
- package/dest/api/abi.d.ts.map +1 -0
- package/dest/api/abi.js +2 -0
- package/dest/api/aztec_address.d.ts +2 -0
- package/dest/api/aztec_address.d.ts.map +1 -0
- package/dest/api/aztec_address.js +2 -0
- package/dest/api/eth_address.d.ts +2 -0
- package/dest/api/eth_address.d.ts.map +1 -0
- package/dest/api/eth_address.js +2 -0
- package/dest/api/ethereum.d.ts +2 -0
- package/dest/api/ethereum.d.ts.map +1 -0
- package/dest/api/ethereum.js +2 -0
- package/dest/api/fields.d.ts +2 -0
- package/dest/api/fields.d.ts.map +1 -0
- package/dest/api/fields.js +2 -0
- package/dest/api/init.d.ts +2 -0
- package/dest/api/init.d.ts.map +1 -0
- package/dest/api/init.js +2 -0
- package/dest/api/interfaces/pxe.d.ts +2 -0
- package/dest/api/interfaces/pxe.d.ts.map +1 -0
- package/dest/api/interfaces/pxe.js +2 -0
- package/dest/api/log_id.d.ts +2 -0
- package/dest/api/log_id.d.ts.map +1 -0
- package/dest/api/log_id.js +2 -0
- package/dest/api/tx_hash.d.ts +2 -0
- package/dest/api/tx_hash.d.ts.map +1 -0
- package/dest/api/tx_hash.js +2 -0
- package/dest/contract_deployer/index.d.ts +1 -0
- package/dest/contract_deployer/index.d.ts.map +1 -1
- package/dest/contract_deployer/index.js +2 -1
- package/dest/index.d.ts +31 -12
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +34 -12
- package/package.json +19 -8
- package/src/api/README.md +7 -0
- package/src/api/abi.ts +1 -0
- package/src/api/aztec_address.ts +1 -0
- package/src/api/eth_address.ts +1 -0
- package/src/api/ethereum.ts +6 -0
- package/src/api/fields.ts +1 -0
- package/src/api/init.ts +1 -0
- package/src/api/interfaces/pxe.ts +1 -0
- package/src/api/log_id.ts +1 -0
- package/src/api/tx_hash.ts +1 -0
- package/src/contract_deployer/index.ts +1 -0
- package/src/index.ts +73 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dest/api/abi.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { FunctionSelector } from '@aztec/foundation/abi';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FwaS9hYmkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFzQyxnQkFBZ0IsRUFBRSxNQUFNLHVCQUF1QixDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aztec_address.d.ts","sourceRoot":"","sources":["../../src/api/aztec_address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcGkvYXp0ZWNfYWRkcmVzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUNBQWlDLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eth_address.d.ts","sourceRoot":"","sources":["../../src/api/eth_address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXRoX2FkZHJlc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXBpL2V0aF9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../src/api/ethereum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { deployL1Contract, deployL1Contracts, } from '@aztec/ethereum';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXRoZXJldW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXBpL2V0aGVyZXVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxnQkFBZ0IsRUFDaEIsaUJBQWlCLEdBR2xCLE1BQU0saUJBQWlCLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/api/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Point, Fr, Fq, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FwaS9maWVsZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLGNBQWMsRUFBRSxNQUFNLDBCQUEwQixDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/api/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dest/api/init.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { init as initAztecJs } from '@aztec/foundation/crypto';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcGkvaW5pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxJQUFJLFdBQVcsRUFBRSxNQUFNLDBCQUEwQixDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../../src/api/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log_id.d.ts","sourceRoot":"","sources":["../../src/api/log_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { LogId } from '@aztec/types/log_id';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nX2lkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FwaS9sb2dfaWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHFCQUFxQixDQUFDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx_hash.d.ts","sourceRoot":"","sources":["../../src/api/tx_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { TxHash } from '@aztec/types/tx_hash';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfaGFzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcGkvdHhfaGFzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sc0JBQXNCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract_deployer/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract_deployer/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './contract_deployer.js';
|
|
2
2
|
export * from './deploy_sent_tx.js';
|
|
3
|
-
|
|
3
|
+
export * from './deploy_method.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3RfZGVwbG95ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsb0JBQW9CLENBQUMifQ==
|
package/dest/index.d.ts
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is our public api.
|
|
3
|
+
* Do NOT "export * from ..." here.
|
|
4
|
+
* Everything here should be explicit, to ensure we can clearly see everything we're exposing to the world.
|
|
5
|
+
* If it's exposed, people will use it, and then we can't remove/change the api without breaking client code.
|
|
6
|
+
* At the time of writing we overexpose things that should only be internal.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Review and narrow scope of public api.
|
|
9
|
+
* We should also consider exposing subsections of the api via package.json exports, like we do with foundation.
|
|
10
|
+
* This can allow consumers to import much smaller parts of the library to incur less overhead.
|
|
11
|
+
* It will also allow web bundlers do perform intelligent chunking of bundles etc.
|
|
12
|
+
* Some work as been done on this within the api folder, providing the alternative import style of e.g.:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { TxHash } from '@aztec.js/tx_hash'
|
|
15
|
+
* import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
|
|
16
|
+
* import { AztecAddress } from '@aztec/aztec.js/aztec_address';
|
|
17
|
+
* import { EthAddress } from '@aztec/aztec.js/eth_address';
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export { WaitOpts, ContractFunctionInteraction, Contract, ContractBase, ContractMethod, SentTx, BatchCall, } from './contract/index.js';
|
|
21
|
+
export { ContractDeployer, DeployMethod, DeploySentTx } from './contract_deployer/index.js';
|
|
22
|
+
export { generatePublicKey, FieldLike, EthAddressLike, computeMessageSecretHash, CheatCodes, AztecAddressLike, isContractDeployed, EthCheatCodes, computeAuthWitMessageHash, } from './utils/index.js';
|
|
23
|
+
export { createPXEClient } from './pxe_client.js';
|
|
24
|
+
export { CompleteAddress, getSchnorrAccount, AccountContract, AccountManager, getUnsafeSchnorrAccount, EcdsaAccountContract, createAccounts, SchnorrAccountContract, SingleKeyAccountContract, createAccount, AuthWitnessProvider, BaseAccountContract, } from './account/index.js';
|
|
25
|
+
export { waitForSandbox, getSandboxAccountsWallets, deployInitialSandboxAccounts } from './sandbox/index.js';
|
|
26
|
+
export { AccountWalletWithPrivateKey, AccountWallet, Wallet, SignerlessWallet } from './wallet/index.js';
|
|
27
|
+
export { AztecAddress, EthAddress, Point, Fr, Fq, FunctionSelector, GlobalVariables, GrumpkinScalar, getContractDeploymentInfo, } from '@aztec/circuits.js';
|
|
10
28
|
export { Grumpkin, Schnorr } from '@aztec/circuits.js/barretenberg';
|
|
11
|
-
export { AuthWitness, AztecNode, ContractData, DeployedContract, ExtendedContractData, ExtendedNote, FunctionCall, INITIAL_L2_BLOCK_NUM, GrumpkinPrivateKey, L2Actor, L2Block, L2BlockL2Logs, LogFilter, LogType, MerkleTreeId, NodeInfo, Note, PackedArguments, PartialAddress, PublicKey, PXE, SyncStatus, Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, UnencryptedL2Log, emptyFunctionCall, createAztecNodeClient, merkleTreeIds, mockTx, } from '@aztec/types';
|
|
12
|
-
export { ContractArtifact } from '@aztec/foundation/abi';
|
|
29
|
+
export { AuthWitness, AztecNode, ContractData, DeployedContract, ExtendedContractData, ExtendedNote, FunctionCall, INITIAL_L2_BLOCK_NUM, GrumpkinPrivateKey, L2Actor, L2Block, L2BlockL2Logs, LogFilter, LogId, LogType, MerkleTreeId, NodeInfo, Note, PackedArguments, PartialAddress, PublicKey, PXE, SyncStatus, Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, UnencryptedL2Log, emptyFunctionCall, createAztecNodeClient, merkleTreeIds, mockTx, } from '@aztec/types';
|
|
30
|
+
export { ContractArtifact, FunctionArtifact } from '@aztec/foundation/abi';
|
|
13
31
|
export { DebugLogger, createDebugLogger, onLog } from '@aztec/foundation/log';
|
|
14
32
|
export { fileURLToPath } from '@aztec/foundation/url';
|
|
15
33
|
export { sleep } from '@aztec/foundation/sleep';
|
|
16
34
|
export { elapsed } from '@aztec/foundation/timer';
|
|
17
35
|
export { retry, retryUntil } from '@aztec/foundation/retry';
|
|
18
|
-
export
|
|
36
|
+
export { sha256, init } from '@aztec/foundation/crypto';
|
|
19
37
|
export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
|
|
20
38
|
export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
39
|
+
export { makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
21
40
|
export { deployL1Contract, deployL1Contracts, DeployL1Contracts, L1ContractArtifactsForDeployment, } from '@aztec/ethereum';
|
|
22
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EACL,QAAQ,EACR,2BAA2B,EAC3B,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,MAAM,EACN,SAAS,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EA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,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK3E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,iBAAiB,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is our public api.
|
|
3
|
+
* Do NOT "export * from ..." here.
|
|
4
|
+
* Everything here should be explicit, to ensure we can clearly see everything we're exposing to the world.
|
|
5
|
+
* If it's exposed, people will use it, and then we can't remove/change the api without breaking client code.
|
|
6
|
+
* At the time of writing we overexpose things that should only be internal.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Review and narrow scope of public api.
|
|
9
|
+
* We should also consider exposing subsections of the api via package.json exports, like we do with foundation.
|
|
10
|
+
* This can allow consumers to import much smaller parts of the library to incur less overhead.
|
|
11
|
+
* It will also allow web bundlers do perform intelligent chunking of bundles etc.
|
|
12
|
+
* Some work as been done on this within the api folder, providing the alternative import style of e.g.:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { TxHash } from '@aztec.js/tx_hash'
|
|
15
|
+
* import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
|
|
16
|
+
* import { AztecAddress } from '@aztec/aztec.js/aztec_address';
|
|
17
|
+
* import { EthAddress } from '@aztec/aztec.js/eth_address';
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export { ContractFunctionInteraction, Contract, ContractBase, SentTx, BatchCall, } from './contract/index.js';
|
|
21
|
+
export { ContractDeployer, DeployMethod, DeploySentTx } from './contract_deployer/index.js';
|
|
22
|
+
export { generatePublicKey, computeMessageSecretHash, CheatCodes, isContractDeployed, EthCheatCodes, computeAuthWitMessageHash, } from './utils/index.js';
|
|
23
|
+
export { createPXEClient } from './pxe_client.js';
|
|
24
|
+
export { CompleteAddress, getSchnorrAccount, AccountManager, getUnsafeSchnorrAccount, EcdsaAccountContract, createAccounts, SchnorrAccountContract, SingleKeyAccountContract, createAccount, BaseAccountContract, } from './account/index.js';
|
|
25
|
+
export { waitForSandbox, getSandboxAccountsWallets, deployInitialSandboxAccounts } from './sandbox/index.js';
|
|
26
|
+
export { AccountWalletWithPrivateKey, AccountWallet, SignerlessWallet } from './wallet/index.js';
|
|
9
27
|
// TODO https://github.com/AztecProtocol/aztec-packages/issues/2632 --> FunctionSelector might not need to be exposed
|
|
10
28
|
// here once the issue is resolved.
|
|
11
|
-
export { AztecAddress, EthAddress, Point, Fr, FunctionSelector, GlobalVariables, GrumpkinScalar, getContractDeploymentInfo, } from '@aztec/circuits.js';
|
|
29
|
+
export { AztecAddress, EthAddress, Point, Fr, Fq, FunctionSelector, GlobalVariables, GrumpkinScalar, getContractDeploymentInfo, } from '@aztec/circuits.js';
|
|
12
30
|
export { Grumpkin, Schnorr } from '@aztec/circuits.js/barretenberg';
|
|
13
|
-
export { AuthWitness, ContractData, ExtendedContractData, ExtendedNote, INITIAL_L2_BLOCK_NUM, L2Actor, L2Block, L2BlockL2Logs, LogType, MerkleTreeId, Note, PackedArguments, Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, UnencryptedL2Log, emptyFunctionCall, createAztecNodeClient, merkleTreeIds, mockTx, } from '@aztec/types';
|
|
31
|
+
export { AuthWitness, ContractData, ExtendedContractData, ExtendedNote, INITIAL_L2_BLOCK_NUM, L2Actor, L2Block, L2BlockL2Logs, LogId, LogType, MerkleTreeId, Note, PackedArguments, Tx, TxExecutionRequest, TxHash, TxReceipt, TxStatus, UnencryptedL2Log, emptyFunctionCall, createAztecNodeClient, merkleTreeIds, mockTx, } from '@aztec/types';
|
|
32
|
+
// TODO: These kinds of things have no place on our public api.
|
|
33
|
+
// External devs will almost certainly have their own methods of doing these things.
|
|
34
|
+
// If we want to use them in our own "aztec.js consuming code", import them from foundation as needed.
|
|
14
35
|
export { createDebugLogger, onLog } from '@aztec/foundation/log';
|
|
15
36
|
export { fileURLToPath } from '@aztec/foundation/url';
|
|
16
37
|
export { sleep } from '@aztec/foundation/sleep';
|
|
17
38
|
export { elapsed } from '@aztec/foundation/timer';
|
|
18
39
|
export { retry, retryUntil } from '@aztec/foundation/retry';
|
|
19
|
-
export
|
|
40
|
+
export { sha256, init } from '@aztec/foundation/crypto';
|
|
20
41
|
export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
|
|
21
42
|
export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
43
|
+
export { makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
22
44
|
export { deployL1Contract, deployL1Contracts, } from '@aztec/ethereum';
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHM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VMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBRTlELE9BQU8sRUFDTCxnQkFBZ0IsRUFDaEIsaUJBQWlCLEdBR2xCLE1BQU0saUJBQWlCLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec.js",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
".": {
|
|
8
|
+
"node": "./dest/index.js",
|
|
9
|
+
"import": "./dest/index.js",
|
|
10
|
+
"default": "./dest/main.js"
|
|
11
|
+
},
|
|
12
|
+
"./interfaces/pxe": "./dest/api/interfaces/pxe.js",
|
|
13
|
+
"./abi": "./dest/api/abi.js",
|
|
14
|
+
"./aztec_address": "./dest/api/aztec_address.js",
|
|
15
|
+
"./eth_address": "./dest/api/eth_address.js",
|
|
16
|
+
"./ethereum": "./dest/api/ethereum.js",
|
|
17
|
+
"./fields": "./dest/api/fields.js",
|
|
18
|
+
"./init": "./dest/api/init.js",
|
|
19
|
+
"./log_id": "./dest/api/log_id.js",
|
|
20
|
+
"./tx_hash": "./dest/api/tx_hash.js"
|
|
10
21
|
},
|
|
11
22
|
"typedocOptions": {
|
|
12
23
|
"entryPoints": [
|
|
@@ -38,10 +49,10 @@
|
|
|
38
49
|
"rootDir": "./src"
|
|
39
50
|
},
|
|
40
51
|
"dependencies": {
|
|
41
|
-
"@aztec/circuits.js": "0.16.
|
|
42
|
-
"@aztec/ethereum": "0.16.
|
|
43
|
-
"@aztec/foundation": "0.16.
|
|
44
|
-
"@aztec/types": "0.16.
|
|
52
|
+
"@aztec/circuits.js": "0.16.3",
|
|
53
|
+
"@aztec/ethereum": "0.16.3",
|
|
54
|
+
"@aztec/foundation": "0.16.3",
|
|
55
|
+
"@aztec/types": "0.16.3",
|
|
45
56
|
"lodash.every": "^4.6.0",
|
|
46
57
|
"lodash.partition": "^4.6.0",
|
|
47
58
|
"lodash.zip": "^4.2.0",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
This provides a more modular api for importing parts of the library as needed.
|
|
4
|
+
The root `index.js` just exposes everything, which can have consequences for startup times and optimizations.
|
|
5
|
+
Here we can gradually build up a much more granular api to allow importing precisely what's needed.
|
|
6
|
+
This should adopt the opposite philosophy to "export all my child exports".
|
|
7
|
+
Every file should (usually) export one thing, and the file/directory structure should be reflected in package.json exports.
|
package/src/api/abi.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContractArtifact, FunctionArtifact, FunctionSelector } from '@aztec/foundation/abi';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Point, Fr, Fq, GrumpkinScalar } from '@aztec/foundation/fields';
|
package/src/api/init.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { init as initAztecJs } from '@aztec/foundation/crypto';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PXE } from '@aztec/types/interfaces';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogId } from '@aztec/types/log_id';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TxHash } from '@aztec/types/tx_hash';
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is our public api.
|
|
3
|
+
* Do NOT "export * from ..." here.
|
|
4
|
+
* Everything here should be explicit, to ensure we can clearly see everything we're exposing to the world.
|
|
5
|
+
* If it's exposed, people will use it, and then we can't remove/change the api without breaking client code.
|
|
6
|
+
* At the time of writing we overexpose things that should only be internal.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Review and narrow scope of public api.
|
|
9
|
+
* We should also consider exposing subsections of the api via package.json exports, like we do with foundation.
|
|
10
|
+
* This can allow consumers to import much smaller parts of the library to incur less overhead.
|
|
11
|
+
* It will also allow web bundlers do perform intelligent chunking of bundles etc.
|
|
12
|
+
* Some work as been done on this within the api folder, providing the alternative import style of e.g.:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { TxHash } from '@aztec.js/tx_hash'
|
|
15
|
+
* import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/aztec.js/abi';
|
|
16
|
+
* import { AztecAddress } from '@aztec/aztec.js/aztec_address';
|
|
17
|
+
* import { EthAddress } from '@aztec/aztec.js/eth_address';
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export {
|
|
21
|
+
WaitOpts,
|
|
22
|
+
ContractFunctionInteraction,
|
|
23
|
+
Contract,
|
|
24
|
+
ContractBase,
|
|
25
|
+
ContractMethod,
|
|
26
|
+
SentTx,
|
|
27
|
+
BatchCall,
|
|
28
|
+
} from './contract/index.js';
|
|
29
|
+
|
|
30
|
+
export { ContractDeployer, DeployMethod, DeploySentTx } from './contract_deployer/index.js';
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
generatePublicKey,
|
|
34
|
+
FieldLike,
|
|
35
|
+
EthAddressLike,
|
|
36
|
+
computeMessageSecretHash,
|
|
37
|
+
CheatCodes,
|
|
38
|
+
AztecAddressLike,
|
|
39
|
+
isContractDeployed,
|
|
40
|
+
EthCheatCodes,
|
|
41
|
+
computeAuthWitMessageHash,
|
|
42
|
+
} from './utils/index.js';
|
|
43
|
+
|
|
44
|
+
export { createPXEClient } from './pxe_client.js';
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
CompleteAddress,
|
|
48
|
+
getSchnorrAccount,
|
|
49
|
+
AccountContract,
|
|
50
|
+
AccountManager,
|
|
51
|
+
getUnsafeSchnorrAccount,
|
|
52
|
+
EcdsaAccountContract,
|
|
53
|
+
createAccounts,
|
|
54
|
+
SchnorrAccountContract,
|
|
55
|
+
SingleKeyAccountContract,
|
|
56
|
+
createAccount,
|
|
57
|
+
AuthWitnessProvider,
|
|
58
|
+
BaseAccountContract,
|
|
59
|
+
} from './account/index.js';
|
|
60
|
+
|
|
61
|
+
export { waitForSandbox, getSandboxAccountsWallets, deployInitialSandboxAccounts } from './sandbox/index.js';
|
|
62
|
+
|
|
63
|
+
export { AccountWalletWithPrivateKey, AccountWallet, Wallet, SignerlessWallet } from './wallet/index.js';
|
|
9
64
|
|
|
10
65
|
// TODO https://github.com/AztecProtocol/aztec-packages/issues/2632 --> FunctionSelector might not need to be exposed
|
|
11
66
|
// here once the issue is resolved.
|
|
@@ -14,11 +69,13 @@ export {
|
|
|
14
69
|
EthAddress,
|
|
15
70
|
Point,
|
|
16
71
|
Fr,
|
|
72
|
+
Fq,
|
|
17
73
|
FunctionSelector,
|
|
18
74
|
GlobalVariables,
|
|
19
75
|
GrumpkinScalar,
|
|
20
76
|
getContractDeploymentInfo,
|
|
21
77
|
} from '@aztec/circuits.js';
|
|
78
|
+
|
|
22
79
|
export { Grumpkin, Schnorr } from '@aztec/circuits.js/barretenberg';
|
|
23
80
|
|
|
24
81
|
export {
|
|
@@ -35,6 +92,7 @@ export {
|
|
|
35
92
|
L2Block,
|
|
36
93
|
L2BlockL2Logs,
|
|
37
94
|
LogFilter,
|
|
95
|
+
LogId,
|
|
38
96
|
LogType,
|
|
39
97
|
MerkleTreeId,
|
|
40
98
|
NodeInfo,
|
|
@@ -56,15 +114,20 @@ export {
|
|
|
56
114
|
mockTx,
|
|
57
115
|
} from '@aztec/types';
|
|
58
116
|
|
|
59
|
-
export { ContractArtifact } from '@aztec/foundation/abi';
|
|
117
|
+
export { ContractArtifact, FunctionArtifact } from '@aztec/foundation/abi';
|
|
118
|
+
|
|
119
|
+
// TODO: These kinds of things have no place on our public api.
|
|
120
|
+
// External devs will almost certainly have their own methods of doing these things.
|
|
121
|
+
// If we want to use them in our own "aztec.js consuming code", import them from foundation as needed.
|
|
60
122
|
export { DebugLogger, createDebugLogger, onLog } from '@aztec/foundation/log';
|
|
61
123
|
export { fileURLToPath } from '@aztec/foundation/url';
|
|
62
124
|
export { sleep } from '@aztec/foundation/sleep';
|
|
63
125
|
export { elapsed } from '@aztec/foundation/timer';
|
|
64
126
|
export { retry, retryUntil } from '@aztec/foundation/retry';
|
|
65
|
-
export
|
|
127
|
+
export { sha256, init } from '@aztec/foundation/crypto';
|
|
66
128
|
export { to2Fields, toBigInt } from '@aztec/foundation/serialize';
|
|
67
129
|
export { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
130
|
+
export { makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
68
131
|
|
|
69
132
|
export {
|
|
70
133
|
deployL1Contract,
|