You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(aztec.js)!: Move accounts out of aztec.js into new package (AztecProtocol#3844)
Extracts account contract implementations and related classes, as well
as the default base classes, to a new `@aztec/accounts` package. Updates
docs to reference the new package, and includes it in the API ref.
This means that all scripts that relied on using accounts from the
Sandbox, creating new accounts, or using accounts already deployed, will
now need to import this package.
Since `accounts` is now needed along with `aztec.js` for most stuff,
including web, this PR also adds a new build step for end-to-end tests
to exercise web builds. Instead of building aztec.js via webpack as part
of aztec.js, we create a new "web application" as part of the end-to-end
tests, which includes both aztec.js and accounts, and test that. This
flow should be closer to how end-users will interact with aztec.js on
the web.
FixesAztecProtocol#3807
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/tutorials/testing.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Testing with Typescript
4
4
5
5
Testing is an integral part of any piece of software, and especially important for any blockchain application. In this page we will cover how to interact with your Noir contracts in a testing environment to write automated tests for your apps.
6
6
7
-
We will be using typescript to write our tests, and rely on the [`aztec.js`](https://www.npmjs.com/package/@aztec/aztec.js) client library to interact with a local Aztec network. We will use [`jest`](https://jestjs.io/) as a testing library, though feel free to use whatever you work with. Configuring the nodejs testing framework is out of scope for this guide.
7
+
We will be using typescript to write our tests, and rely on the [`aztec.js`](https://www.npmjs.com/package/@aztec/aztec.js) client library to interact with a local Aztec network, along with the [`accounts`](https://www.npmjs.com/package/@aztec/accounts) package for setting up test accounts. We will use [`jest`](https://jestjs.io/) as a testing library, though feel free to use whatever you work with. Configuring the nodejs testing framework is out of scope for this guide.
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/tutorials/writing_dapp/contract_interaction.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -45,21 +45,21 @@ Balance of 0x0e1f60e8566e2c6d32378bdcadb7c63696e853281be798c107266b8c3a88ea9b: 0
45
45
46
46
Now that we can see the balance for each user, let's transfer tokens from one account to another. To do this, we will first need access to a `Wallet` object. This wraps access to an PXE and also provides an interface to craft and sign transactions on behalf of one of the user accounts.
47
47
48
-
We can initialize a wallet using one of the `getAccount` methods from `aztec.js`, along with the corresponding signing and encryption keys:
48
+
We can initialize a wallet using one of the `getAccount` methods from the `accounts` package, along with the corresponding signing and encryption keys:
For ease of use, `aztec.js` also ships with a helper `getSandboxAccountsWallets` method that returns a wallet for each of the pre-initialized accounts in the Sandbox, so you can send transactions as any of them.
59
+
For ease of use, `accounts` also ships with a helper `getSandboxAccountsWallets` method that returns a wallet for each of the pre-initialized accounts in the Sandbox, so you can send transactions as any of them.
We'll use one of these wallets to initialize the `Contract` instance that represents our private token contract, so every transaction sent through it will be sent through that wallet.
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/wallets/writing_an_account_contract.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -59,11 +59,11 @@ For our account contract, we will take the hash of the action to authorize, requ
59
59
60
60
## The typescript side of things
61
61
62
-
Now that we have a valid account contract, we need to write the typescript glue code that will take care of formatting and authenticating transactions so they can be processed by our contract, as well as deploying the contract during account setup. This takes the form of implementing the `AccountContract` interface:
62
+
Now that we have a valid account contract, we need to write the typescript glue code that will take care of formatting and authenticating transactions so they can be processed by our contract, as well as deploying the contract during account setup. This takes the form of implementing the `AccountContract` interface from `@aztec/aztec.js`:
However, if you are using the default `AccountActions` module, then you can leverage the `BaseAccountContract` class and just implement the logic for generating an auth witness that matches the one you wrote in Noir:
66
+
However, if you are using the default `AccountActions` module, then you can leverage the `DefaultAccountContract` class from `@aztec/accounts` and just implement the logic for generating an auth witness that matches the one you wrote in Noir:
0 commit comments