From 3b9927ab7ef2e7e50193bbfcb6ab4db66734e481 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Mon, 29 Jan 2024 21:34:30 +0600 Subject: [PATCH] chore(docs): Fix autogen docs (#4261) --- .../developers/apis/accounts/_category_.yml | 1 - .../apis/accounts/classes/_category_.yml | 2 - .../defaults.DefaultAccountContract.md | 112 ---- .../defaults.DefaultAccountEntrypoint.md | 88 --- .../defaults.DefaultAccountInterface.md | 105 ---- .../classes/ecdsa.EcdsaAccountContract.md | 112 ---- .../classes/schnorr.SchnorrAccountContract.md | 112 ---- .../single_key.SingleKeyAccountContract.md | 112 ---- docs/docs/developers/apis/accounts/index.md | 46 -- docs/docs/developers/apis/accounts/modules.md | 16 - .../apis/accounts/modules/_category_.yml | 2 - .../apis/accounts/modules/defaults.md | 89 --- .../developers/apis/accounts/modules/ecdsa.md | 63 -- .../apis/accounts/modules/schnorr.md | 63 -- .../apis/accounts/modules/single_key.md | 74 --- .../apis/accounts/modules/testing.md | 131 ---- .../developers/apis/aztec-js/_category_.yml | 1 - .../apis/aztec-js/classes/_category_.yml | 2 - .../aztec-js/classes/contract.BatchCall.md | 149 ----- .../aztec-js/classes/contract.Contract.md | 210 ------- .../aztec-js/classes/contract.ContractBase.md | 127 ---- .../contract.ContractFunctionInteraction.md | 201 ------ .../aztec-js/classes/contract.DeployMethod.md | 215 ------- .../aztec-js/classes/contract.DeploySentTx.md | 264 -------- .../apis/aztec-js/classes/contract.SentTx.md | 149 ----- docs/docs/developers/apis/aztec-js/index.md | 50 -- .../apis/aztec-js/interfaces/_category_.yml | 2 - .../interfaces/account.AccountContract.md | 58 -- .../interfaces/account.AccountInterface.md | 77 --- .../interfaces/account.AuthWitnessProvider.md | 34 - .../interfaces/account.EntrypointInterface.md | 36 -- docs/docs/developers/apis/aztec-js/modules.md | 13 - .../apis/aztec-js/modules/_category_.yml | 2 - .../apis/aztec-js/modules/account.md | 35 -- .../apis/aztec-js/modules/contract.md | 146 ----- docs/docs/developers/apis/pxe/_category_.yml | 1 - docs/docs/developers/apis/pxe/index.md | 10 - .../developers/apis/pxe/interfaces/PXE.md | 582 ------------------ .../apis/pxe/interfaces/_category_.yml | 2 - docs/docs/developers/apis/pxe/modules.md | 11 - .../developers/debugging/aztecnr-errors.md | 2 +- .../developers/getting_started/quickstart.md | 2 +- .../learn/about_aztec/technical_overview.md | 2 +- docs/docs/learn/concepts/pxe/main.md | 2 +- docs/sidebars.js | 2 +- 45 files changed, 5 insertions(+), 3510 deletions(-) delete mode 100644 docs/docs/developers/apis/accounts/_category_.yml delete mode 100644 docs/docs/developers/apis/accounts/classes/_category_.yml delete mode 100644 docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountContract.md delete mode 100644 docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountEntrypoint.md delete mode 100644 docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountInterface.md delete mode 100644 docs/docs/developers/apis/accounts/classes/ecdsa.EcdsaAccountContract.md delete mode 100644 docs/docs/developers/apis/accounts/classes/schnorr.SchnorrAccountContract.md delete mode 100644 docs/docs/developers/apis/accounts/classes/single_key.SingleKeyAccountContract.md delete mode 100644 docs/docs/developers/apis/accounts/index.md delete mode 100644 docs/docs/developers/apis/accounts/modules.md delete mode 100644 docs/docs/developers/apis/accounts/modules/_category_.yml delete mode 100644 docs/docs/developers/apis/accounts/modules/defaults.md delete mode 100644 docs/docs/developers/apis/accounts/modules/ecdsa.md delete mode 100644 docs/docs/developers/apis/accounts/modules/schnorr.md delete mode 100644 docs/docs/developers/apis/accounts/modules/single_key.md delete mode 100644 docs/docs/developers/apis/accounts/modules/testing.md delete mode 100644 docs/docs/developers/apis/aztec-js/_category_.yml delete mode 100644 docs/docs/developers/apis/aztec-js/classes/_category_.yml delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.BatchCall.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.Contract.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.ContractBase.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.ContractFunctionInteraction.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.DeployMethod.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.DeploySentTx.md delete mode 100644 docs/docs/developers/apis/aztec-js/classes/contract.SentTx.md delete mode 100644 docs/docs/developers/apis/aztec-js/index.md delete mode 100644 docs/docs/developers/apis/aztec-js/interfaces/_category_.yml delete mode 100644 docs/docs/developers/apis/aztec-js/interfaces/account.AccountContract.md delete mode 100644 docs/docs/developers/apis/aztec-js/interfaces/account.AccountInterface.md delete mode 100644 docs/docs/developers/apis/aztec-js/interfaces/account.AuthWitnessProvider.md delete mode 100644 docs/docs/developers/apis/aztec-js/interfaces/account.EntrypointInterface.md delete mode 100644 docs/docs/developers/apis/aztec-js/modules.md delete mode 100644 docs/docs/developers/apis/aztec-js/modules/_category_.yml delete mode 100644 docs/docs/developers/apis/aztec-js/modules/account.md delete mode 100644 docs/docs/developers/apis/aztec-js/modules/contract.md delete mode 100644 docs/docs/developers/apis/pxe/_category_.yml delete mode 100644 docs/docs/developers/apis/pxe/index.md delete mode 100644 docs/docs/developers/apis/pxe/interfaces/PXE.md delete mode 100644 docs/docs/developers/apis/pxe/interfaces/_category_.yml delete mode 100644 docs/docs/developers/apis/pxe/modules.md diff --git a/docs/docs/developers/apis/accounts/_category_.yml b/docs/docs/developers/apis/accounts/_category_.yml deleted file mode 100644 index 24a46026174..00000000000 --- a/docs/docs/developers/apis/accounts/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: "API" \ No newline at end of file diff --git a/docs/docs/developers/apis/accounts/classes/_category_.yml b/docs/docs/developers/apis/accounts/classes/_category_.yml deleted file mode 100644 index 55c7980a464..00000000000 --- a/docs/docs/developers/apis/accounts/classes/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Classes" -position: 3 \ No newline at end of file diff --git a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountContract.md b/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountContract.md deleted file mode 100644 index 3e9090fbdbf..00000000000 --- a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountContract.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -id: "defaults.DefaultAccountContract" -title: "Class: DefaultAccountContract" -sidebar_label: "DefaultAccountContract" -custom_edit_url: null ---- - -[defaults](../modules/defaults.md).DefaultAccountContract - -Base class for implementing an account contract. Requires that the account uses the -default entrypoint method signature. - -## Hierarchy - -- **`DefaultAccountContract`** - - ↳ [`EcdsaAccountContract`](ecdsa.EcdsaAccountContract.md) - - ↳ [`SchnorrAccountContract`](schnorr.SchnorrAccountContract.md) - - ↳ [`SingleKeyAccountContract`](single_key.SingleKeyAccountContract.md) - -## Implements - -- `AccountContract` - -## Constructors - -### constructor - -• **new DefaultAccountContract**(`artifact`): [`DefaultAccountContract`](defaults.DefaultAccountContract.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `artifact` | `ContractArtifact` | - -#### Returns - -[`DefaultAccountContract`](defaults.DefaultAccountContract.md) - -## Properties - -### artifact - -• `Private` **artifact**: `ContractArtifact` - -## Methods - -### getAuthWitnessProvider - -▸ **getAuthWitnessProvider**(`address`): `AuthWitnessProvider` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `CompleteAddress` | - -#### Returns - -`AuthWitnessProvider` - -___ - -### getContractArtifact - -▸ **getContractArtifact**(): `ContractArtifact` - -#### Returns - -`ContractArtifact` - -#### Implementation of - -AccountContract.getContractArtifact - -___ - -### getDeploymentArgs - -▸ **getDeploymentArgs**(): `any`[] - -#### Returns - -`any`[] - -#### Implementation of - -AccountContract.getDeploymentArgs - -___ - -### getInterface - -▸ **getInterface**(`address`, `nodeInfo`): `AccountInterface` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `CompleteAddress` | -| `nodeInfo` | `NodeInfo` | - -#### Returns - -`AccountInterface` - -#### Implementation of - -AccountContract.getInterface diff --git a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountEntrypoint.md b/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountEntrypoint.md deleted file mode 100644 index 9829fd098b0..00000000000 --- a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountEntrypoint.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: "defaults.DefaultAccountEntrypoint" -title: "Class: DefaultAccountEntrypoint" -sidebar_label: "DefaultAccountEntrypoint" -custom_edit_url: null ---- - -[defaults](../modules/defaults.md).DefaultAccountEntrypoint - -Implementation for an entrypoint interface that follows the default entrypoint signature -for an account, which accepts an EntrypointPayload as defined in noir-libs/aztec-noir/src/entrypoint.nr. - -## Implements - -- `EntrypointInterface` - -## Constructors - -### constructor - -• **new DefaultAccountEntrypoint**(`address`, `auth`, `chainId?`, `version?`): [`DefaultAccountEntrypoint`](defaults.DefaultAccountEntrypoint.md) - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `address` | `AztecAddress` | `undefined` | -| `auth` | `AuthWitnessProvider` | `undefined` | -| `chainId` | `number` | `DEFAULT_CHAIN_ID` | -| `version` | `number` | `DEFAULT_VERSION` | - -#### Returns - -[`DefaultAccountEntrypoint`](defaults.DefaultAccountEntrypoint.md) - -## Properties - -### address - -• `Private` **address**: `AztecAddress` - -___ - -### auth - -• `Private` **auth**: `AuthWitnessProvider` - -___ - -### chainId - -• `Private` **chainId**: `number` = `DEFAULT_CHAIN_ID` - -___ - -### version - -• `Private` **version**: `number` = `DEFAULT_VERSION` - -## Methods - -### createTxExecutionRequest - -▸ **createTxExecutionRequest**(`executions`): `Promise`\<`TxExecutionRequest`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `executions` | `FunctionCall`[] | - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -#### Implementation of - -EntrypointInterface.createTxExecutionRequest - -___ - -### getEntrypointAbi - -▸ **getEntrypointAbi**(): `FunctionAbi` - -#### Returns - -`FunctionAbi` diff --git a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountInterface.md b/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountInterface.md deleted file mode 100644 index 3da53df033e..00000000000 --- a/docs/docs/developers/apis/accounts/classes/defaults.DefaultAccountInterface.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -id: "defaults.DefaultAccountInterface" -title: "Class: DefaultAccountInterface" -sidebar_label: "DefaultAccountInterface" -custom_edit_url: null ---- - -[defaults](../modules/defaults.md).DefaultAccountInterface - -Default implementation for an account interface. Requires that the account uses the default -entrypoint signature, which accepts an EntrypointPayload as defined in noir-libs/aztec-noir/src/entrypoint.nr. - -## Implements - -- `AccountInterface` - -## Constructors - -### constructor - -• **new DefaultAccountInterface**(`authWitnessProvider`, `address`, `nodeInfo`): [`DefaultAccountInterface`](defaults.DefaultAccountInterface.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `authWitnessProvider` | `AuthWitnessProvider` | -| `address` | `CompleteAddress` | -| `nodeInfo` | `Pick`\<`NodeInfo`, ``"chainId"`` \| ``"protocolVersion"``\> | - -#### Returns - -[`DefaultAccountInterface`](defaults.DefaultAccountInterface.md) - -## Properties - -### address - -• `Private` **address**: `CompleteAddress` - -___ - -### authWitnessProvider - -• `Private` **authWitnessProvider**: `AuthWitnessProvider` - -___ - -### entrypoint - -• `Private` **entrypoint**: `EntrypointInterface` - -## Methods - -### createAuthWitness - -▸ **createAuthWitness**(`message`): `Promise`\<`AuthWitness`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `message` | `Fr` | - -#### Returns - -`Promise`\<`AuthWitness`\> - -#### Implementation of - -AccountInterface.createAuthWitness - -___ - -### createTxExecutionRequest - -▸ **createTxExecutionRequest**(`executions`): `Promise`\<`TxExecutionRequest`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `executions` | `FunctionCall`[] | - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -#### Implementation of - -AccountInterface.createTxExecutionRequest - -___ - -### getCompleteAddress - -▸ **getCompleteAddress**(): `CompleteAddress` - -#### Returns - -`CompleteAddress` - -#### Implementation of - -AccountInterface.getCompleteAddress diff --git a/docs/docs/developers/apis/accounts/classes/ecdsa.EcdsaAccountContract.md b/docs/docs/developers/apis/accounts/classes/ecdsa.EcdsaAccountContract.md deleted file mode 100644 index 18ef35288d9..00000000000 --- a/docs/docs/developers/apis/accounts/classes/ecdsa.EcdsaAccountContract.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -id: "ecdsa.EcdsaAccountContract" -title: "Class: EcdsaAccountContract" -sidebar_label: "EcdsaAccountContract" -custom_edit_url: null ---- - -[ecdsa](../modules/ecdsa.md).EcdsaAccountContract - -Account contract that authenticates transactions using ECDSA signatures -verified against a secp256k1 public key stored in an immutable encrypted note. - -## Hierarchy - -- [`DefaultAccountContract`](defaults.DefaultAccountContract.md) - - ↳ **`EcdsaAccountContract`** - -## Constructors - -### constructor - -• **new EcdsaAccountContract**(`signingPrivateKey`): [`EcdsaAccountContract`](ecdsa.EcdsaAccountContract.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `signingPrivateKey` | `Buffer` | - -#### Returns - -[`EcdsaAccountContract`](ecdsa.EcdsaAccountContract.md) - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[constructor](defaults.DefaultAccountContract.md#constructor) - -## Properties - -### signingPrivateKey - -• `Private` **signingPrivateKey**: `Buffer` - -## Methods - -### getAuthWitnessProvider - -▸ **getAuthWitnessProvider**(`_address`): `AuthWitnessProvider` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_address` | `CompleteAddress` | - -#### Returns - -`AuthWitnessProvider` - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getAuthWitnessProvider](defaults.DefaultAccountContract.md#getauthwitnessprovider) - -___ - -### getContractArtifact - -▸ **getContractArtifact**(): `ContractArtifact` - -#### Returns - -`ContractArtifact` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getContractArtifact](defaults.DefaultAccountContract.md#getcontractartifact) - -___ - -### getDeploymentArgs - -▸ **getDeploymentArgs**(): `Buffer`[] - -#### Returns - -`Buffer`[] - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getDeploymentArgs](defaults.DefaultAccountContract.md#getdeploymentargs) - -___ - -### getInterface - -▸ **getInterface**(`address`, `nodeInfo`): `AccountInterface` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `CompleteAddress` | -| `nodeInfo` | `NodeInfo` | - -#### Returns - -`AccountInterface` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getInterface](defaults.DefaultAccountContract.md#getinterface) diff --git a/docs/docs/developers/apis/accounts/classes/schnorr.SchnorrAccountContract.md b/docs/docs/developers/apis/accounts/classes/schnorr.SchnorrAccountContract.md deleted file mode 100644 index 94b5837367d..00000000000 --- a/docs/docs/developers/apis/accounts/classes/schnorr.SchnorrAccountContract.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -id: "schnorr.SchnorrAccountContract" -title: "Class: SchnorrAccountContract" -sidebar_label: "SchnorrAccountContract" -custom_edit_url: null ---- - -[schnorr](../modules/schnorr.md).SchnorrAccountContract - -Account contract that authenticates transactions using Schnorr signatures -verified against a Grumpkin public key stored in an immutable encrypted note. - -## Hierarchy - -- [`DefaultAccountContract`](defaults.DefaultAccountContract.md) - - ↳ **`SchnorrAccountContract`** - -## Constructors - -### constructor - -• **new SchnorrAccountContract**(`signingPrivateKey`): [`SchnorrAccountContract`](schnorr.SchnorrAccountContract.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `signingPrivateKey` | `Fq` | - -#### Returns - -[`SchnorrAccountContract`](schnorr.SchnorrAccountContract.md) - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[constructor](defaults.DefaultAccountContract.md#constructor) - -## Properties - -### signingPrivateKey - -• `Private` **signingPrivateKey**: `Fq` - -## Methods - -### getAuthWitnessProvider - -▸ **getAuthWitnessProvider**(`_address`): `AuthWitnessProvider` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_address` | `CompleteAddress` | - -#### Returns - -`AuthWitnessProvider` - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getAuthWitnessProvider](defaults.DefaultAccountContract.md#getauthwitnessprovider) - -___ - -### getContractArtifact - -▸ **getContractArtifact**(): `ContractArtifact` - -#### Returns - -`ContractArtifact` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getContractArtifact](defaults.DefaultAccountContract.md#getcontractartifact) - -___ - -### getDeploymentArgs - -▸ **getDeploymentArgs**(): `Fr`[] - -#### Returns - -`Fr`[] - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getDeploymentArgs](defaults.DefaultAccountContract.md#getdeploymentargs) - -___ - -### getInterface - -▸ **getInterface**(`address`, `nodeInfo`): `AccountInterface` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `CompleteAddress` | -| `nodeInfo` | `NodeInfo` | - -#### Returns - -`AccountInterface` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getInterface](defaults.DefaultAccountContract.md#getinterface) diff --git a/docs/docs/developers/apis/accounts/classes/single_key.SingleKeyAccountContract.md b/docs/docs/developers/apis/accounts/classes/single_key.SingleKeyAccountContract.md deleted file mode 100644 index 992c29757e3..00000000000 --- a/docs/docs/developers/apis/accounts/classes/single_key.SingleKeyAccountContract.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -id: "single_key.SingleKeyAccountContract" -title: "Class: SingleKeyAccountContract" -sidebar_label: "SingleKeyAccountContract" -custom_edit_url: null ---- - -[single\_key](../modules/single_key.md).SingleKeyAccountContract - -Account contract that authenticates transactions using Schnorr signatures verified against -the note encryption key, relying on a single private key for both encryption and authentication. - -## Hierarchy - -- [`DefaultAccountContract`](defaults.DefaultAccountContract.md) - - ↳ **`SingleKeyAccountContract`** - -## Constructors - -### constructor - -• **new SingleKeyAccountContract**(`encryptionPrivateKey`): [`SingleKeyAccountContract`](single_key.SingleKeyAccountContract.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `encryptionPrivateKey` | `Fq` | - -#### Returns - -[`SingleKeyAccountContract`](single_key.SingleKeyAccountContract.md) - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[constructor](defaults.DefaultAccountContract.md#constructor) - -## Properties - -### encryptionPrivateKey - -• `Private` **encryptionPrivateKey**: `Fq` - -## Methods - -### getAuthWitnessProvider - -▸ **getAuthWitnessProvider**(`«destructured»`): `AuthWitnessProvider` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `«destructured»` | `CompleteAddress` | - -#### Returns - -`AuthWitnessProvider` - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getAuthWitnessProvider](defaults.DefaultAccountContract.md#getauthwitnessprovider) - -___ - -### getContractArtifact - -▸ **getContractArtifact**(): `ContractArtifact` - -#### Returns - -`ContractArtifact` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getContractArtifact](defaults.DefaultAccountContract.md#getcontractartifact) - -___ - -### getDeploymentArgs - -▸ **getDeploymentArgs**(): `any`[] - -#### Returns - -`any`[] - -#### Overrides - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getDeploymentArgs](defaults.DefaultAccountContract.md#getdeploymentargs) - -___ - -### getInterface - -▸ **getInterface**(`address`, `nodeInfo`): `AccountInterface` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `CompleteAddress` | -| `nodeInfo` | `NodeInfo` | - -#### Returns - -`AccountInterface` - -#### Inherited from - -[DefaultAccountContract](defaults.DefaultAccountContract.md).[getInterface](defaults.DefaultAccountContract.md#getinterface) diff --git a/docs/docs/developers/apis/accounts/index.md b/docs/docs/developers/apis/accounts/index.md deleted file mode 100644 index 6f9aaa9d9f8..00000000000 --- a/docs/docs/developers/apis/accounts/index.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: "index" -title: "@aztec/accounts" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Accounts - -Accounts is a client library that provides implementations for some common account flavors. Use it to acquire a `Wallet` object that corresponds to an account, and use that together with `@aztec/aztec.js` to interact with the network. - -## Installing - -``` -npm install @aztec/accounts -``` - -## Account types - -- **Schnorr**: Uses an Grumpkin private key with Schnorr signatures for authentication, and a separate Grumpkin private key for encryption. Recommended for most use cases. -- **ECDSA**: Uses an ECDSA private key for authentication, and a Grumpkin private key for encryption. Recommended for building integrations with Ethereum wallets. -- **SingleKey**: Uses a single Grumpkin private key for both authentication and encryption. Recommended for testing purposes only. - -## Usage - -### Deploy a new account - -```typescript -import { getSchnorrAccount } from '@aztec/accounts/schnorr'; -import { GrumpkinPrivateKey } from '@aztec/circuit-types'; - -const encryptionPrivateKey = GrumpkinPrivateKey.random(); -const signingPrivateKey = GrumpkinPrivateKey.random(); -const wallet = getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitDeploy(); -console.log(`New account deployed at ${wallet.getAddress()}`); -``` - -### Create a wallet object from an already deployed account - -```typescript -import { getSchnorrAccount } from '@aztec/accounts/schnorr'; - -const wallet = getSchnorrWallet(pxe, encryptionPrivateKey); -console.log(`Wallet for ${wallet.getAddress()} ready`); -``` diff --git a/docs/docs/developers/apis/accounts/modules.md b/docs/docs/developers/apis/accounts/modules.md deleted file mode 100644 index 4bdc3605574..00000000000 --- a/docs/docs/developers/apis/accounts/modules.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: "modules" -title: "@aztec/accounts" -sidebar_label: "Table of Contents" -sidebar_position: 0.5 -hide_table_of_contents: true -custom_edit_url: null ---- - -## Modules - -- [defaults](modules/defaults.md) -- [ecdsa](modules/ecdsa.md) -- [schnorr](modules/schnorr.md) -- [single\_key](modules/single_key.md) -- [testing](modules/testing.md) diff --git a/docs/docs/developers/apis/accounts/modules/_category_.yml b/docs/docs/developers/apis/accounts/modules/_category_.yml deleted file mode 100644 index 63f9c4e4016..00000000000 --- a/docs/docs/developers/apis/accounts/modules/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Modules" -position: 1 \ No newline at end of file diff --git a/docs/docs/developers/apis/accounts/modules/defaults.md b/docs/docs/developers/apis/accounts/modules/defaults.md deleted file mode 100644 index aca98bc5d4c..00000000000 --- a/docs/docs/developers/apis/accounts/modules/defaults.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -id: "defaults" -title: "Module: defaults" -sidebar_label: "defaults" -sidebar_position: 0 -custom_edit_url: null ---- - -The `@aztec/accounts/defaults` export provides the base class [DefaultAccountContract](../classes/defaults.DefaultAccountContract.md) for implementing account contracts that use the default entrypoint payload module. - -Read more in [Writing an account contract](https://docs.aztec.network/developers/wallets/writing_an_account_contract). - -## Classes - -- [DefaultAccountContract](../classes/defaults.DefaultAccountContract.md) -- [DefaultAccountEntrypoint](../classes/defaults.DefaultAccountEntrypoint.md) -- [DefaultAccountInterface](../classes/defaults.DefaultAccountInterface.md) - -## Type Aliases - -### EntrypointPayload - -Ƭ **EntrypointPayload**: `Object` - -Encoded payload for the account contract entrypoint - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `function_calls` | `EntrypointFunctionCall`[] | Encoded function calls to execute | -| `nonce` | `Fr` | A nonce for replay protection | - -## Variables - -### DEFAULT\_CHAIN\_ID - -• `Const` **DEFAULT\_CHAIN\_ID**: ``31337`` - -Default L1 chain ID to use when constructing txs (matches hardhat and anvil's default). - -___ - -### DEFAULT\_VERSION - -• `Const` **DEFAULT\_VERSION**: ``1`` - -Default protocol version to use. - -## Functions - -### buildPayload - -▸ **buildPayload**(`calls`): `Object` - -Assembles an entrypoint payload from a set of private and public function calls - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `calls` | `FunctionCall`[] | - -#### Returns - -`Object` - -| Name | Type | Description | -| :------ | :------ | :------ | -| `packedArguments` | `PackedArguments`[] | The packed arguments of functions called | -| `payload` | [`EntrypointPayload`](defaults.md#entrypointpayload) | The payload for the entrypoint function | - -___ - -### hashPayload - -▸ **hashPayload**(`payload`): `Buffer` - -Hashes an entrypoint payload to a 32-byte buffer (useful for signing) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `payload` | [`EntrypointPayload`](defaults.md#entrypointpayload) | - -#### Returns - -`Buffer` diff --git a/docs/docs/developers/apis/accounts/modules/ecdsa.md b/docs/docs/developers/apis/accounts/modules/ecdsa.md deleted file mode 100644 index 1ae21355e8e..00000000000 --- a/docs/docs/developers/apis/accounts/modules/ecdsa.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: "ecdsa" -title: "Module: ecdsa" -sidebar_label: "ecdsa" -sidebar_position: 0 -custom_edit_url: null ---- - -The `@aztec/accounts/ecdsa` export provides an ECDSA account contract implementation, that uses an ECDSA private key for authentication, and a Grumpkin key for encryption. -Consider using this account type when working with integrations with Ethereum wallets. - -## Classes - -- [EcdsaAccountContract](../classes/ecdsa.EcdsaAccountContract.md) - -## Variables - -### EcdsaAccountContractArtifact - -• `Const` **EcdsaAccountContractArtifact**: `ContractArtifact` - -## Functions - -### getEcdsaAccount - -▸ **getEcdsaAccount**(`pxe`, `encryptionPrivateKey`, `signingPrivateKey`, `saltOrAddress?`): `AccountManager` - -Creates an Account that relies on an ECDSA signing key for authentication. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `encryptionPrivateKey` | `Fq` | Grumpkin key used for note encryption. | -| `signingPrivateKey` | `Buffer` | Secp256k1 key used for signing transactions. | -| `saltOrAddress?` | `CompleteAddress` \| `Salt` | Deployment salt or complete address if account contract is already deployed. | - -#### Returns - -`AccountManager` - -___ - -### getEcdsaWallet - -▸ **getEcdsaWallet**(`pxe`, `address`, `signingPrivateKey`): `Promise`\<`AccountWallet`\> - -Gets a wallet for an already registered account using ECDSA signatures. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `address` | `AztecAddress` | Address for the account. | -| `signingPrivateKey` | `Buffer` | ECDSA key used for signing transactions. | - -#### Returns - -`Promise`\<`AccountWallet`\> - -A wallet for this account that can be used to interact with a contract instance. diff --git a/docs/docs/developers/apis/accounts/modules/schnorr.md b/docs/docs/developers/apis/accounts/modules/schnorr.md deleted file mode 100644 index e9a101daaf1..00000000000 --- a/docs/docs/developers/apis/accounts/modules/schnorr.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: "schnorr" -title: "Module: schnorr" -sidebar_label: "schnorr" -sidebar_position: 0 -custom_edit_url: null ---- - -The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption. -This is the suggested account contract type for most use cases within Aztec. - -## Classes - -- [SchnorrAccountContract](../classes/schnorr.SchnorrAccountContract.md) - -## Variables - -### SchnorrAccountContractArtifact - -• `Const` **SchnorrAccountContractArtifact**: `ContractArtifact` - -## Functions - -### getSchnorrAccount - -▸ **getSchnorrAccount**(`pxe`, `encryptionPrivateKey`, `signingPrivateKey`, `saltOrAddress?`): `AccountManager` - -Creates an Account Manager that relies on a Grumpkin signing key for authentication. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `encryptionPrivateKey` | `Fq` | Grumpkin key used for note encryption. | -| `signingPrivateKey` | `Fq` | Grumpkin key used for signing transactions. | -| `saltOrAddress?` | `CompleteAddress` \| `Salt` | Deployment salt or complete address if account contract is already deployed. | - -#### Returns - -`AccountManager` - -___ - -### getSchnorrWallet - -▸ **getSchnorrWallet**(`pxe`, `address`, `signingPrivateKey`): `Promise`\<`AccountWallet`\> - -Gets a wallet for an already registered account using Schnorr signatures. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `address` | `AztecAddress` | Address for the account. | -| `signingPrivateKey` | `Fq` | Grumpkin key used for signing transactions. | - -#### Returns - -`Promise`\<`AccountWallet`\> - -A wallet for this account that can be used to interact with a contract instance. diff --git a/docs/docs/developers/apis/accounts/modules/single_key.md b/docs/docs/developers/apis/accounts/modules/single_key.md deleted file mode 100644 index 64978494f18..00000000000 --- a/docs/docs/developers/apis/accounts/modules/single_key.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: "single_key" -title: "Module: single_key" -sidebar_label: "single_key" -sidebar_position: 0 -custom_edit_url: null ---- - -The `@aztec/accounts/single_key` export provides a testing account contract implementation that uses a single Grumpkin key for both authentication and encryption. -It is not recommended to use this account type in production. - -## Classes - -- [SingleKeyAccountContract](../classes/single_key.SingleKeyAccountContract.md) - -## References - -### getUnsafeSchnorrAccount - -Renames and re-exports [getSingleKeyAccount](single_key.md#getsinglekeyaccount) - -___ - -### getUnsafeSchnorrWallet - -Renames and re-exports [getSingleKeyWallet](single_key.md#getsinglekeywallet) - -## Variables - -### SingleKeyAccountContractArtifact - -• `Const` **SingleKeyAccountContractArtifact**: `ContractArtifact` - -## Functions - -### getSingleKeyAccount - -▸ **getSingleKeyAccount**(`pxe`, `encryptionAndSigningPrivateKey`, `saltOrAddress?`): `AccountManager` - -Creates an Account that uses the same Grumpkin key for encryption and authentication. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `encryptionAndSigningPrivateKey` | `Fq` | Grumpkin key used for note encryption and signing transactions. | -| `saltOrAddress?` | `CompleteAddress` \| `Salt` | Deployment salt or complete address if account contract is already deployed. | - -#### Returns - -`AccountManager` - -___ - -### getSingleKeyWallet - -▸ **getSingleKeyWallet**(`pxe`, `address`, `signingKey`): `Promise`\<`AccountWallet`\> - -Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | An PXE server instance. | -| `address` | `AztecAddress` | Address for the account. | -| `signingKey` | `Fq` | - | - -#### Returns - -`Promise`\<`AccountWallet`\> - -A wallet for this account that can be used to interact with a contract instance. diff --git a/docs/docs/developers/apis/accounts/modules/testing.md b/docs/docs/developers/apis/accounts/modules/testing.md deleted file mode 100644 index 517df21339c..00000000000 --- a/docs/docs/developers/apis/accounts/modules/testing.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -id: "testing" -title: "Module: testing" -sidebar_label: "testing" -sidebar_position: 0 -custom_edit_url: null ---- - -The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment. - -Use the [createAccount](testing.md#createaccount) and [createAccounts](testing.md#createaccounts) methods to create new sample accounts for testing, -or use [getInitialTestAccountsWallets](testing.md#getinitialtestaccountswallets) to obtain a list of wallets for the Sandbox pre-seeded accounts. - -## Variables - -### INITIAL\_TEST\_ACCOUNT\_SALTS - -• `Const` **INITIAL\_TEST\_ACCOUNT\_SALTS**: `Fr`[] - -___ - -### INITIAL\_TEST\_ENCRYPTION\_KEYS - -• `Const` **INITIAL\_TEST\_ENCRYPTION\_KEYS**: `Fq`[] - -___ - -### INITIAL\_TEST\_SIGNING\_KEYS - -• `Const` **INITIAL\_TEST\_SIGNING\_KEYS**: `Fq`[] = `INITIAL_TEST_ENCRYPTION_KEYS` - -## Functions - -### createAccount - -▸ **createAccount**(`pxe`): `Promise`\<`AccountWalletWithPrivateKey`\> - -Deploys and registers a new account using random private keys and returns the associated Schnorr account wallet. Useful for testing. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | PXE. | - -#### Returns - -`Promise`\<`AccountWalletWithPrivateKey`\> - -- A wallet for a fresh account. - -___ - -### createAccounts - -▸ **createAccounts**(`pxe`, `numberOfAccounts?`): `Promise`\<`AccountWalletWithPrivateKey`[]\> - -Creates a given number of random accounts using the Schnorr account wallet. - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `pxe` | `PXE` | `undefined` | PXE. | -| `numberOfAccounts` | `number` | `1` | How many accounts to create. | - -#### Returns - -`Promise`\<`AccountWalletWithPrivateKey`[]\> - -The created account wallets. - -___ - -### deployInitialTestAccounts - -▸ **deployInitialTestAccounts**(`pxe`): `Promise`\<\{ `account`: `AccountManager` ; `privateKey`: `Fq` }[]\> - -Deploys the initial set of schnorr signature accounts to the test environment - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | PXE instance. | - -#### Returns - -`Promise`\<\{ `account`: `AccountManager` ; `privateKey`: `Fq` }[]\> - -The set of deployed Account objects and associated private encryption keys - -___ - -### getDeployedTestAccountsWallets - -▸ **getDeployedTestAccountsWallets**(`pxe`): `Promise`\<`AccountWalletWithPrivateKey`[]\> - -Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | PXE instance. | - -#### Returns - -`Promise`\<`AccountWalletWithPrivateKey`[]\> - -A set of AccountWallet implementations for each of the initial accounts. - -___ - -### getInitialTestAccountsWallets - -▸ **getInitialTestAccountsWallets**(`pxe`): `Promise`\<`AccountWalletWithPrivateKey`[]\> - -Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pxe` | `PXE` | PXE instance. | - -#### Returns - -`Promise`\<`AccountWalletWithPrivateKey`[]\> - -A set of AccountWallet implementations for each of the initial accounts. diff --git a/docs/docs/developers/apis/aztec-js/_category_.yml b/docs/docs/developers/apis/aztec-js/_category_.yml deleted file mode 100644 index 24a46026174..00000000000 --- a/docs/docs/developers/apis/aztec-js/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: "API" \ No newline at end of file diff --git a/docs/docs/developers/apis/aztec-js/classes/_category_.yml b/docs/docs/developers/apis/aztec-js/classes/_category_.yml deleted file mode 100644 index 55c7980a464..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Classes" -position: 3 \ No newline at end of file diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.BatchCall.md b/docs/docs/developers/apis/aztec-js/classes/contract.BatchCall.md deleted file mode 100644 index be9fb269a3c..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.BatchCall.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -id: "contract.BatchCall" -title: "Class: BatchCall" -sidebar_label: "BatchCall" -custom_edit_url: null ---- - -[contract](../modules/contract.md).BatchCall - -A batch of function calls to be sent as a single transaction through a wallet. - -## Hierarchy - -- `BaseContractInteraction` - - ↳ **`BatchCall`** - -## Constructors - -### constructor - -• **new BatchCall**(`wallet`, `calls`): [`BatchCall`](contract.BatchCall.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | -| `calls` | `FunctionCall`[] | - -#### Returns - -[`BatchCall`](contract.BatchCall.md) - -#### Overrides - -BaseContractInteraction.constructor - -## Properties - -### calls - -• `Protected` **calls**: `FunctionCall`[] - -___ - -### pxe - -• `Protected` **pxe**: `PXE` - -#### Inherited from - -BaseContractInteraction.pxe - -___ - -### tx - -• `Protected` `Optional` **tx**: `Tx` - -#### Inherited from - -BaseContractInteraction.tx - -___ - -### txRequest - -• `Protected` `Optional` **txRequest**: `TxExecutionRequest` - -#### Inherited from - -BaseContractInteraction.txRequest - -___ - -### wallet - -• `Protected` **wallet**: [`Wallet`](../modules/account.md#wallet) - -## Methods - -### create - -▸ **create**(): `Promise`\<`TxExecutionRequest`\> - -Create a transaction execution request that represents this batch, encoded and authenticated by the -user's wallet, ready to be simulated. - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -A Promise that resolves to a transaction instance. - -#### Overrides - -BaseContractInteraction.create - -___ - -### send - -▸ **send**(`options?`): [`SentTx`](contract.SentTx.md) - -Sends a transaction to the contract function with the specified options. -This function throws an error if called on an unconstrained function. -It creates and signs the transaction if necessary, and returns a SentTx instance, -which can be used to track the transaction status, receipt, and events. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`SendMethodOptions`](../modules/contract.md#sendmethodoptions) | An optional object containing 'from' property representing the AztecAddress of the sender. If not provided, the default address is used. | - -#### Returns - -[`SentTx`](contract.SentTx.md) - -A SentTx instance for tracking the transaction status and information. - -#### Inherited from - -BaseContractInteraction.send - -___ - -### simulate - -▸ **simulate**(`options?`): `Promise`\<`Tx`\> - -Simulates a transaction execution request and returns a tx object ready to be sent. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`SendMethodOptions`](../modules/contract.md#sendmethodoptions) | optional arguments to be used in the creation of the transaction | - -#### Returns - -`Promise`\<`Tx`\> - -The resulting transaction - -#### Inherited from - -BaseContractInteraction.simulate diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.Contract.md b/docs/docs/developers/apis/aztec-js/classes/contract.Contract.md deleted file mode 100644 index b958283dd17..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.Contract.md +++ /dev/null @@ -1,210 +0,0 @@ ---- -id: "contract.Contract" -title: "Class: Contract" -sidebar_label: "Contract" -custom_edit_url: null ---- - -[contract](../modules/contract.md).Contract - -The Contract class represents a contract and provides utility methods for interacting with it. -It enables the creation of ContractFunctionInteraction instances for each function in the contract's ABI, -allowing users to call or send transactions to these functions. Additionally, the Contract class can be used -to attach the contract instance to a deployed contract on-chain through the PXE, which facilitates -interaction with Aztec's privacy protocol. - -## Hierarchy - -- [`ContractBase`](contract.ContractBase.md) - - ↳ **`Contract`** - -## Constructors - -### constructor - -• **new Contract**(`completeAddress`, `artifact`, `wallet`, `portalContract`): [`Contract`](contract.Contract.md) - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `completeAddress` | `CompleteAddress` | The deployed contract's complete address. | -| `artifact` | `ContractArtifact` | The Application Binary Interface for the contract. | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | The wallet used for interacting with this contract. | -| `portalContract` | `EthAddress` | The portal contract address on L1, if any. | - -#### Returns - -[`Contract`](contract.Contract.md) - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[constructor](contract.ContractBase.md#constructor) - -## Properties - -### artifact - -• `Readonly` **artifact**: `ContractArtifact` - -The Application Binary Interface for the contract. - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[artifact](contract.ContractBase.md#artifact) - -___ - -### completeAddress - -• `Readonly` **completeAddress**: `CompleteAddress` - -The deployed contract's complete address. - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[completeAddress](contract.ContractBase.md#completeaddress) - -___ - -### methods - -• **methods**: `Object` = `{}` - -An object containing contract methods mapped to their respective names. - -#### Index signature - -▪ [name: `string`]: [`ContractMethod`](../modules/contract.md#contractmethod) - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[methods](contract.ContractBase.md#methods) - -___ - -### portalContract - -• `Readonly` **portalContract**: `EthAddress` - -The portal contract address on L1, if any. - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[portalContract](contract.ContractBase.md#portalcontract) - -___ - -### wallet - -• `Protected` **wallet**: [`Wallet`](../modules/account.md#wallet) - -The wallet used for interacting with this contract. - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[wallet](contract.ContractBase.md#wallet) - -## Accessors - -### address - -• `get` **address**(): `AztecAddress` - -Address of the contract. - -#### Returns - -`AztecAddress` - -#### Inherited from - -ContractBase.address - -## Methods - -### withWallet - -▸ **withWallet**(`wallet`): `this` - -Creates a new instance of the contract wrapper attached to a different wallet. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | Wallet to use for sending txs. | - -#### Returns - -`this` - -A new contract instance. - -#### Inherited from - -[ContractBase](contract.ContractBase.md).[withWallet](contract.ContractBase.md#withwallet) - -___ - -### at - -▸ **at**(`address`, `artifact`, `wallet`): `Promise`\<[`Contract`](contract.Contract.md)\> - -Creates a contract instance. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `address` | `AztecAddress` | The deployed contract's address. | -| `artifact` | `ContractArtifact` | Build artifact of the contract. | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | The wallet to use when interacting with the contract. | - -#### Returns - -`Promise`\<[`Contract`](contract.Contract.md)\> - -A promise that resolves to a new Contract instance. - -___ - -### deploy - -▸ **deploy**(`wallet`, `artifact`, `args`): [`DeployMethod`](contract.DeployMethod.md)\<[`Contract`](contract.Contract.md)\> - -Creates a tx to deploy a new instance of a contract. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | The wallet for executing the deployment. | -| `artifact` | `ContractArtifact` | Build artifact of the contract to deploy | -| `args` | `any`[] | Arguments for the constructor. | - -#### Returns - -[`DeployMethod`](contract.DeployMethod.md)\<[`Contract`](contract.Contract.md)\> - -___ - -### deployWithPublicKey - -▸ **deployWithPublicKey**(`publicKey`, `wallet`, `artifact`, `args`): [`DeployMethod`](contract.DeployMethod.md)\<[`Contract`](contract.Contract.md)\> - -Creates a tx to deploy a new instance of a contract using the specified public key to derive the address. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `publicKey` | `Point` | Public key for deriving the address. | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | The wallet for executing the deployment. | -| `artifact` | `ContractArtifact` | Build artifact of the contract. | -| `args` | `any`[] | Arguments for the constructor. | - -#### Returns - -[`DeployMethod`](contract.DeployMethod.md)\<[`Contract`](contract.Contract.md)\> diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.ContractBase.md b/docs/docs/developers/apis/aztec-js/classes/contract.ContractBase.md deleted file mode 100644 index 23fcaf83923..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.ContractBase.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -id: "contract.ContractBase" -title: "Class: ContractBase" -sidebar_label: "ContractBase" -custom_edit_url: null ---- - -[contract](../modules/contract.md).ContractBase - -Abstract implementation of a contract extended by the Contract class and generated contract types. - -## Hierarchy - -- **`ContractBase`** - - ↳ [`Contract`](contract.Contract.md) - -## Implements - -- `DeployedContract` - -## Constructors - -### constructor - -• **new ContractBase**(`completeAddress`, `artifact`, `wallet`, `portalContract`): [`ContractBase`](contract.ContractBase.md) - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `completeAddress` | `CompleteAddress` | The deployed contract's complete address. | -| `artifact` | `ContractArtifact` | The Application Binary Interface for the contract. | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | The wallet used for interacting with this contract. | -| `portalContract` | `EthAddress` | The portal contract address on L1, if any. | - -#### Returns - -[`ContractBase`](contract.ContractBase.md) - -## Properties - -### artifact - -• `Readonly` **artifact**: `ContractArtifact` - -The Application Binary Interface for the contract. - -#### Implementation of - -DeployedContract.artifact - -___ - -### completeAddress - -• `Readonly` **completeAddress**: `CompleteAddress` - -The deployed contract's complete address. - -#### Implementation of - -DeployedContract.completeAddress - -___ - -### methods - -• **methods**: `Object` = `{}` - -An object containing contract methods mapped to their respective names. - -#### Index signature - -▪ [name: `string`]: [`ContractMethod`](../modules/contract.md#contractmethod) - -___ - -### portalContract - -• `Readonly` **portalContract**: `EthAddress` - -The portal contract address on L1, if any. - -#### Implementation of - -DeployedContract.portalContract - -___ - -### wallet - -• `Protected` **wallet**: [`Wallet`](../modules/account.md#wallet) - -The wallet used for interacting with this contract. - -## Accessors - -### address - -• `get` **address**(): `AztecAddress` - -Address of the contract. - -#### Returns - -`AztecAddress` - -## Methods - -### withWallet - -▸ **withWallet**(`wallet`): `this` - -Creates a new instance of the contract wrapper attached to a different wallet. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | Wallet to use for sending txs. | - -#### Returns - -`this` - -A new contract instance. diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.ContractFunctionInteraction.md b/docs/docs/developers/apis/aztec-js/classes/contract.ContractFunctionInteraction.md deleted file mode 100644 index 298ee397492..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.ContractFunctionInteraction.md +++ /dev/null @@ -1,201 +0,0 @@ ---- -id: "contract.ContractFunctionInteraction" -title: "Class: ContractFunctionInteraction" -sidebar_label: "ContractFunctionInteraction" -custom_edit_url: null ---- - -[contract](../modules/contract.md).ContractFunctionInteraction - -This is the class that is returned when calling e.g. `contract.methods.myMethod(arg0, arg1)`. -It contains available interactions one can call on a method, including view. - -## Hierarchy - -- `BaseContractInteraction` - - ↳ **`ContractFunctionInteraction`** - -## Constructors - -### constructor - -• **new ContractFunctionInteraction**(`wallet`, `contractAddress`, `functionDao`, `args`): [`ContractFunctionInteraction`](contract.ContractFunctionInteraction.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | -| `contractAddress` | `AztecAddress` | -| `functionDao` | `FunctionAbi` | -| `args` | `any`[] | - -#### Returns - -[`ContractFunctionInteraction`](contract.ContractFunctionInteraction.md) - -#### Overrides - -BaseContractInteraction.constructor - -## Properties - -### args - -• `Protected` **args**: `any`[] - -___ - -### contractAddress - -• `Protected` **contractAddress**: `AztecAddress` - -___ - -### functionDao - -• `Protected` **functionDao**: `FunctionAbi` - -___ - -### pxe - -• `Protected` **pxe**: `PXE` - -#### Inherited from - -BaseContractInteraction.pxe - -___ - -### tx - -• `Protected` `Optional` **tx**: `Tx` - -#### Inherited from - -BaseContractInteraction.tx - -___ - -### txRequest - -• `Protected` `Optional` **txRequest**: `TxExecutionRequest` - -#### Inherited from - -BaseContractInteraction.txRequest - -___ - -### wallet - -• `Protected` **wallet**: [`Wallet`](../modules/account.md#wallet) - -## Methods - -### create - -▸ **create**(): `Promise`\<`TxExecutionRequest`\> - -Create a transaction execution request that represents this call, encoded and authenticated by the -user's wallet, ready to be simulated. - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -A Promise that resolves to a transaction instance. - -#### Overrides - -BaseContractInteraction.create - -___ - -### request - -▸ **request**(): `FunctionCall` - -Returns an execution request that represents this operation. Useful as a building -block for constructing batch requests. - -#### Returns - -`FunctionCall` - -An execution request wrapped in promise. - -___ - -### send - -▸ **send**(`options?`): [`SentTx`](contract.SentTx.md) - -Sends a transaction to the contract function with the specified options. -This function throws an error if called on an unconstrained function. -It creates and signs the transaction if necessary, and returns a SentTx instance, -which can be used to track the transaction status, receipt, and events. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`SendMethodOptions`](../modules/contract.md#sendmethodoptions) | An optional object containing 'from' property representing the AztecAddress of the sender. If not provided, the default address is used. | - -#### Returns - -[`SentTx`](contract.SentTx.md) - -A SentTx instance for tracking the transaction status and information. - -#### Inherited from - -BaseContractInteraction.send - -___ - -### simulate - -▸ **simulate**(`options?`): `Promise`\<`Tx`\> - -Simulates a transaction execution request and returns a tx object ready to be sent. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`SendMethodOptions`](../modules/contract.md#sendmethodoptions) | optional arguments to be used in the creation of the transaction | - -#### Returns - -`Promise`\<`Tx`\> - -The resulting transaction - -#### Inherited from - -BaseContractInteraction.simulate - -___ - -### view - -▸ **view**(`options?`): `Promise`\<`any`\> - -Execute a view (read-only) transaction on an unconstrained function. -This method is used to call functions that do not modify the contract state and only return data. -Throws an error if called on a non-unconstrained function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`ViewMethodOptions`](../modules/contract.md#viewmethodoptions) | An optional object containing additional configuration for the transaction. | - -#### Returns - -`Promise`\<`any`\> - -The result of the view transaction as returned by the contract function. diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.DeployMethod.md b/docs/docs/developers/apis/aztec-js/classes/contract.DeployMethod.md deleted file mode 100644 index 62e599ab5fd..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.DeployMethod.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -id: "contract.DeployMethod" -title: "Class: DeployMethod" -sidebar_label: "DeployMethod" -custom_edit_url: null ---- - -[contract](../modules/contract.md).DeployMethod - -Creates a TxRequest from a contract ABI, for contract deployment. -Extends the ContractFunctionInteraction class. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `TContract` | extends [`ContractBase`](contract.ContractBase.md) = [`Contract`](contract.Contract.md) | - -## Hierarchy - -- `BaseContractInteraction` - - ↳ **`DeployMethod`** - -## Constructors - -### constructor - -• **new DeployMethod**\<`TContract`\>(`publicKey`, `pxe`, `artifact`, `postDeployCtor`, `args?`): [`DeployMethod`](contract.DeployMethod.md)\<`TContract`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `TContract` | extends [`ContractBase`](contract.ContractBase.md) = [`Contract`](contract.Contract.md) | - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `publicKey` | `Point` | `undefined` | -| `pxe` | `PXE` | `undefined` | -| `artifact` | `ContractArtifact` | `undefined` | -| `postDeployCtor` | (`address`: `AztecAddress`, `wallet`: [`Wallet`](../modules/account.md#wallet)) => `Promise`\<`TContract`\> | `undefined` | -| `args` | `any`[] | `[]` | - -#### Returns - -[`DeployMethod`](contract.DeployMethod.md)\<`TContract`\> - -#### Overrides - -BaseContractInteraction.constructor - -## Properties - -### args - -• `Private` **args**: `any`[] = `[]` - -___ - -### artifact - -• `Private` **artifact**: `ContractArtifact` - -___ - -### completeAddress - -• `Optional` **completeAddress**: `CompleteAddress` = `undefined` - -The complete address of the contract. - -___ - -### constructorArtifact - -• `Private` **constructorArtifact**: `FunctionArtifact` - -Constructor function to call. - -___ - -### postDeployCtor - -• `Private` **postDeployCtor**: (`address`: `AztecAddress`, `wallet`: [`Wallet`](../modules/account.md#wallet)) => `Promise`\<`TContract`\> - -#### Type declaration - -▸ (`address`, `wallet`): `Promise`\<`TContract`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `AztecAddress` | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | - -##### Returns - -`Promise`\<`TContract`\> - -___ - -### publicKey - -• `Private` **publicKey**: `Point` - -___ - -### pxe - -• `Protected` **pxe**: `PXE` - -#### Inherited from - -BaseContractInteraction.pxe - -___ - -### tx - -• `Protected` `Optional` **tx**: `Tx` - -#### Inherited from - -BaseContractInteraction.tx - -___ - -### txRequest - -• `Protected` `Optional` **txRequest**: `TxExecutionRequest` - -#### Inherited from - -BaseContractInteraction.txRequest - -## Methods - -### create - -▸ **create**(`options?`): `Promise`\<`TxExecutionRequest`\> - -Create a contract deployment transaction, given the deployment options. -This function internally calls `request()` and `sign()` methods to prepare -the transaction for deployment. The resulting signed transaction can be -later sent using the `send()` method. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`DeployOptions`](../modules/contract.md#deployoptions) | An object containing optional deployment settings, including portalContract, contractAddressSalt, and from. | - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -A Promise resolving to an object containing the signed transaction data and other relevant information. - -#### Overrides - -BaseContractInteraction.create - -___ - -### send - -▸ **send**(`options?`): [`DeploySentTx`](contract.DeploySentTx.md)\<`TContract`\> - -Send the contract deployment transaction using the provided options. -This function extends the 'send' method from the ContractFunctionInteraction class, -allowing us to send a transaction specifically for contract deployment. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`DeployOptions`](../modules/contract.md#deployoptions) | An object containing various deployment options such as portalContract, contractAddressSalt, and from. | - -#### Returns - -[`DeploySentTx`](contract.DeploySentTx.md)\<`TContract`\> - -A SentTx object that returns the receipt and the deployed contract instance. - -#### Overrides - -BaseContractInteraction.send - -___ - -### simulate - -▸ **simulate**(`options`): `Promise`\<`Tx`\> - -Simulate the request. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | [`DeployOptions`](../modules/contract.md#deployoptions) | Deployment options. | - -#### Returns - -`Promise`\<`Tx`\> - -The simulated tx. - -#### Overrides - -BaseContractInteraction.simulate diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.DeploySentTx.md b/docs/docs/developers/apis/aztec-js/classes/contract.DeploySentTx.md deleted file mode 100644 index daac2a1461b..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.DeploySentTx.md +++ /dev/null @@ -1,264 +0,0 @@ ---- -id: "contract.DeploySentTx" -title: "Class: DeploySentTx" -sidebar_label: "DeploySentTx" -custom_edit_url: null ---- - -[contract](../modules/contract.md).DeploySentTx - -A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `TContract` | extends [`Contract`](contract.Contract.md) = [`Contract`](contract.Contract.md) | - -## Hierarchy - -- [`SentTx`](contract.SentTx.md) - - ↳ **`DeploySentTx`** - -## Constructors - -### constructor - -• **new DeploySentTx**\<`TContract`\>(`wallet`, `txHashPromise`, `postDeployCtor`, `completeContractAddress?`): [`DeploySentTx`](contract.DeploySentTx.md)\<`TContract`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `TContract` | extends [`Contract`](contract.Contract.md) = [`Contract`](contract.Contract.md) | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `wallet` | `PXE` \| [`Wallet`](../modules/account.md#wallet) | - | -| `txHashPromise` | `Promise`\<`TxHash`\> | - | -| `postDeployCtor` | (`address`: `AztecAddress`, `wallet`: [`Wallet`](../modules/account.md#wallet)) => `Promise`\<`TContract`\> | - | -| `completeContractAddress?` | `CompleteAddress` | The complete address of the deployed contract | - -#### Returns - -[`DeploySentTx`](contract.DeploySentTx.md)\<`TContract`\> - -#### Overrides - -[SentTx](contract.SentTx.md).[constructor](contract.SentTx.md#constructor) - -## Properties - -### completeContractAddress - -• `Optional` **completeContractAddress**: `CompleteAddress` - -The complete address of the deployed contract - -___ - -### postDeployCtor - -• `Private` **postDeployCtor**: (`address`: `AztecAddress`, `wallet`: [`Wallet`](../modules/account.md#wallet)) => `Promise`\<`TContract`\> - -#### Type declaration - -▸ (`address`, `wallet`): `Promise`\<`TContract`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `address` | `AztecAddress` | -| `wallet` | [`Wallet`](../modules/account.md#wallet) | - -##### Returns - -`Promise`\<`TContract`\> - -___ - -### pxe - -• `Protected` **pxe**: `PXE` - -#### Inherited from - -[SentTx](contract.SentTx.md).[pxe](contract.SentTx.md#pxe) - -___ - -### txHashPromise - -• `Protected` **txHashPromise**: `Promise`\<`TxHash`\> - -#### Inherited from - -[SentTx](contract.SentTx.md).[txHashPromise](contract.SentTx.md#txhashpromise) - -## Methods - -### deployed - -▸ **deployed**(`opts?`): `Promise`\<`TContract`\> - -Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `opts?` | [`DeployedWaitOpts`](../modules/contract.md#deployedwaitopts) | Options for configuring the waiting for the tx to be mined. | - -#### Returns - -`Promise`\<`TContract`\> - -The deployed contract instance. - -___ - -### getContractInstance - -▸ **getContractInstance**(`wallet?`, `address?`): `Promise`\<`TContract`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `wallet?` | [`Wallet`](../modules/account.md#wallet) | -| `address?` | `AztecAddress` | - -#### Returns - -`Promise`\<`TContract`\> - -___ - -### getReceipt - -▸ **getReceipt**(): `Promise`\<`TxReceipt`\> - -Retrieve the transaction receipt associated with the current SentTx instance. -The function fetches the transaction hash using 'getTxHash' and then queries -the PXE to get the corresponding transaction receipt. - -#### Returns - -`Promise`\<`TxReceipt`\> - -A promise that resolves to a TxReceipt object representing the fetched transaction receipt. - -#### Inherited from - -[SentTx](contract.SentTx.md).[getReceipt](contract.SentTx.md#getreceipt) - -___ - -### getTxHash - -▸ **getTxHash**(): `Promise`\<`TxHash`\> - -Retrieves the transaction hash of the SentTx instance. -The function internally awaits for the 'txHashPromise' to resolve, and then returns the resolved transaction hash. - -#### Returns - -`Promise`\<`TxHash`\> - -A promise that resolves to the transaction hash of the SentTx instance. - -#### Inherited from - -[SentTx](contract.SentTx.md).[getTxHash](contract.SentTx.md#gettxhash) - -___ - -### getUnencryptedLogs - -▸ **getUnencryptedLogs**(): `Promise`\<`GetUnencryptedLogsResponse`\> - -Gets unencrypted logs emitted by this tx. - -#### Returns - -`Promise`\<`GetUnencryptedLogsResponse`\> - -The requested logs. - -**`Remarks`** - -This function will wait for the tx to be mined if it hasn't been already. - -#### Inherited from - -[SentTx](contract.SentTx.md).[getUnencryptedLogs](contract.SentTx.md#getunencryptedlogs) - -___ - -### getVisibleNotes - -▸ **getVisibleNotes**(): `Promise`\<`ExtendedNote`[]\> - -Get notes of accounts registered in the provided PXE/Wallet created in this tx. - -#### Returns - -`Promise`\<`ExtendedNote`[]\> - -The requested notes. - -**`Remarks`** - -This function will wait for the tx to be mined if it hasn't been already. - -#### Inherited from - -[SentTx](contract.SentTx.md).[getVisibleNotes](contract.SentTx.md#getvisiblenotes) - -___ - -### wait - -▸ **wait**(`opts?`): `Promise`\<[`DeployTxReceipt`](../modules/contract.md#deploytxreceipt)\<`TContract`\>\> - -Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `opts?` | [`DeployedWaitOpts`](../modules/contract.md#deployedwaitopts) | Options for configuring the waiting for the tx to be mined. | - -#### Returns - -`Promise`\<[`DeployTxReceipt`](../modules/contract.md#deploytxreceipt)\<`TContract`\>\> - -The transaction receipt with the deployed contract instance. - -#### Overrides - -[SentTx](contract.SentTx.md).[wait](contract.SentTx.md#wait) - -___ - -### waitForReceipt - -▸ **waitForReceipt**(`opts?`): `Promise`\<`TxReceipt`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `opts?` | [`WaitOpts`](../modules/contract.md#waitopts) | - -#### Returns - -`Promise`\<`TxReceipt`\> - -#### Inherited from - -[SentTx](contract.SentTx.md).[waitForReceipt](contract.SentTx.md#waitforreceipt) diff --git a/docs/docs/developers/apis/aztec-js/classes/contract.SentTx.md b/docs/docs/developers/apis/aztec-js/classes/contract.SentTx.md deleted file mode 100644 index accede6ccfb..00000000000 --- a/docs/docs/developers/apis/aztec-js/classes/contract.SentTx.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -id: "contract.SentTx" -title: "Class: SentTx" -sidebar_label: "SentTx" -custom_edit_url: null ---- - -[contract](../modules/contract.md).SentTx - -The SentTx class represents a sent transaction through the PXE, providing methods to fetch -its hash, receipt, and mining status. - -## Hierarchy - -- **`SentTx`** - - ↳ [`DeploySentTx`](contract.DeploySentTx.md) - -## Constructors - -### constructor - -• **new SentTx**(`pxe`, `txHashPromise`): [`SentTx`](contract.SentTx.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `pxe` | `PXE` | -| `txHashPromise` | `Promise`\<`TxHash`\> | - -#### Returns - -[`SentTx`](contract.SentTx.md) - -## Properties - -### pxe - -• `Protected` **pxe**: `PXE` - -___ - -### txHashPromise - -• `Protected` **txHashPromise**: `Promise`\<`TxHash`\> - -## Methods - -### getReceipt - -▸ **getReceipt**(): `Promise`\<`TxReceipt`\> - -Retrieve the transaction receipt associated with the current SentTx instance. -The function fetches the transaction hash using 'getTxHash' and then queries -the PXE to get the corresponding transaction receipt. - -#### Returns - -`Promise`\<`TxReceipt`\> - -A promise that resolves to a TxReceipt object representing the fetched transaction receipt. - -___ - -### getTxHash - -▸ **getTxHash**(): `Promise`\<`TxHash`\> - -Retrieves the transaction hash of the SentTx instance. -The function internally awaits for the 'txHashPromise' to resolve, and then returns the resolved transaction hash. - -#### Returns - -`Promise`\<`TxHash`\> - -A promise that resolves to the transaction hash of the SentTx instance. - -___ - -### getUnencryptedLogs - -▸ **getUnencryptedLogs**(): `Promise`\<`GetUnencryptedLogsResponse`\> - -Gets unencrypted logs emitted by this tx. - -#### Returns - -`Promise`\<`GetUnencryptedLogsResponse`\> - -The requested logs. - -**`Remarks`** - -This function will wait for the tx to be mined if it hasn't been already. - -___ - -### getVisibleNotes - -▸ **getVisibleNotes**(): `Promise`\<`ExtendedNote`[]\> - -Get notes of accounts registered in the provided PXE/Wallet created in this tx. - -#### Returns - -`Promise`\<`ExtendedNote`[]\> - -The requested notes. - -**`Remarks`** - -This function will wait for the tx to be mined if it hasn't been already. - -___ - -### wait - -▸ **wait**(`opts?`): `Promise`\<`FieldsOf`\<`TxReceipt`\>\> - -Awaits for a tx to be mined and returns the receipt. Throws if tx is not mined. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `opts?` | [`WaitOpts`](../modules/contract.md#waitopts) | Options for configuring the waiting for the tx to be mined. | - -#### Returns - -`Promise`\<`FieldsOf`\<`TxReceipt`\>\> - -The transaction receipt. - -___ - -### waitForReceipt - -▸ **waitForReceipt**(`opts?`): `Promise`\<`TxReceipt`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `opts?` | [`WaitOpts`](../modules/contract.md#waitopts) | - -#### Returns - -`Promise`\<`TxReceipt`\> diff --git a/docs/docs/developers/apis/aztec-js/index.md b/docs/docs/developers/apis/aztec-js/index.md deleted file mode 100644 index 388fadecb3d..00000000000 --- a/docs/docs/developers/apis/aztec-js/index.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: "index" -title: "@aztec/aztec.js" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Aztec.js - -Aztec.js is a library that provides APIs for managing accounts and interacting with contracts on the Aztec network. It communicates with the [Private eXecution Environment (PXE)](https://docs.aztec.network/apis/pxe/interfaces/PXE) through a `PXE` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions. - -## Installing - -``` -npm install @aztec/aztec.js -``` - -## Usage - -Use the `@aztec/accounts` package in order to create and manage accounts, and acquire a `Wallet` object needed to send transactions and interact with the network. - -### Deploy a contract - -```typescript -import { Contract } from '@aztec/aztec.js'; - -const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send().deployed(); -console.log(`Contract deployed at ${contract.address}`); -``` - -### Send a transaction - -```typescript -import { Contract } from '@aztec/aztec.js'; - -const contract = await Contract.at(contractAddress, MyContractArtifact, wallet); -const tx = await contract.methods.transfer(amount, recipientAddress).send().wait(); -console.log(`Transferred ${amount} to ${recipientAddress} on block ${tx.blockNumber}`); -``` - -### Call a view function - -```typescript -import { Contract } from '@aztec/aztec.js'; - -const contract = await Contract.at(contractAddress, MyContractArtifact, wallet); -const balance = await contract.methods.getBalance(wallet.getAddress()).view(); -console.log(`Account balance is ${balance}`); -``` diff --git a/docs/docs/developers/apis/aztec-js/interfaces/_category_.yml b/docs/docs/developers/apis/aztec-js/interfaces/_category_.yml deleted file mode 100644 index 43bec88cfa0..00000000000 --- a/docs/docs/developers/apis/aztec-js/interfaces/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Interfaces" -position: 4 \ No newline at end of file diff --git a/docs/docs/developers/apis/aztec-js/interfaces/account.AccountContract.md b/docs/docs/developers/apis/aztec-js/interfaces/account.AccountContract.md deleted file mode 100644 index cc78bca8da5..00000000000 --- a/docs/docs/developers/apis/aztec-js/interfaces/account.AccountContract.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: "account.AccountContract" -title: "Interface: AccountContract" -sidebar_label: "AccountContract" -custom_edit_url: null ---- - -[account](../modules/account.md).AccountContract - -An account contract instance. Knows its artifact, deployment arguments, how to create -transaction execution requests out of function calls, and how to authorize actions. - -## Methods - -### getContractArtifact - -▸ **getContractArtifact**(): `ContractArtifact` - -Returns the artifact of this account contract. - -#### Returns - -`ContractArtifact` - -___ - -### getDeploymentArgs - -▸ **getDeploymentArgs**(): `any`[] - -Returns the deployment arguments for this instance. - -#### Returns - -`any`[] - -___ - -### getInterface - -▸ **getInterface**(`address`, `nodeInfo`): [`AccountInterface`](account.AccountInterface.md) - -Returns the account interface for this account contract given a deployment at the provided address. -The account interface is responsible for assembling tx requests given requested function calls, and -for creating signed auth witnesses given action identifiers (message hashes). - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `address` | `CompleteAddress` | Address where this account contract is deployed. | -| `nodeInfo` | `NodeInfo` | Info on the chain where it is deployed. | - -#### Returns - -[`AccountInterface`](account.AccountInterface.md) - -An account interface instance for creating tx requests and authorizing actions. diff --git a/docs/docs/developers/apis/aztec-js/interfaces/account.AccountInterface.md b/docs/docs/developers/apis/aztec-js/interfaces/account.AccountInterface.md deleted file mode 100644 index 491e09fbbb1..00000000000 --- a/docs/docs/developers/apis/aztec-js/interfaces/account.AccountInterface.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -id: "account.AccountInterface" -title: "Interface: AccountInterface" -sidebar_label: "AccountInterface" -custom_edit_url: null ---- - -[account](../modules/account.md).AccountInterface - -Handler for interfacing with an account. Knows how to create transaction execution -requests and authorize actions for its corresponding account. - -## Hierarchy - -- [`AuthWitnessProvider`](account.AuthWitnessProvider.md) - -- [`EntrypointInterface`](account.EntrypointInterface.md) - - ↳ **`AccountInterface`** - -## Methods - -### createAuthWitness - -▸ **createAuthWitness**(`message`): `Promise`\<`AuthWitness`\> - -Create an authorization witness for the given message. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `message` | `Fr` | Message to authorize. | - -#### Returns - -`Promise`\<`AuthWitness`\> - -#### Inherited from - -[AuthWitnessProvider](account.AuthWitnessProvider.md).[createAuthWitness](account.AuthWitnessProvider.md#createauthwitness) - -___ - -### createTxExecutionRequest - -▸ **createTxExecutionRequest**(`executions`): `Promise`\<`TxExecutionRequest`\> - -Generates an authenticated request out of set of function calls. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `executions` | `FunctionCall`[] | The execution intents to be run. | - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -The authenticated transaction execution request. - -#### Inherited from - -[EntrypointInterface](account.EntrypointInterface.md).[createTxExecutionRequest](account.EntrypointInterface.md#createtxexecutionrequest) - -___ - -### getCompleteAddress - -▸ **getCompleteAddress**(): `CompleteAddress` - -Returns the complete address for this account. - -#### Returns - -`CompleteAddress` diff --git a/docs/docs/developers/apis/aztec-js/interfaces/account.AuthWitnessProvider.md b/docs/docs/developers/apis/aztec-js/interfaces/account.AuthWitnessProvider.md deleted file mode 100644 index 6775118d095..00000000000 --- a/docs/docs/developers/apis/aztec-js/interfaces/account.AuthWitnessProvider.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: "account.AuthWitnessProvider" -title: "Interface: AuthWitnessProvider" -sidebar_label: "AuthWitnessProvider" -custom_edit_url: null ---- - -[account](../modules/account.md).AuthWitnessProvider - -Creates authorization witnesses. - -## Hierarchy - -- **`AuthWitnessProvider`** - - ↳ [`AccountInterface`](account.AccountInterface.md) - -## Methods - -### createAuthWitness - -▸ **createAuthWitness**(`message`): `Promise`\<`AuthWitness`\> - -Create an authorization witness for the given message. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `message` | `Fr` | Message to authorize. | - -#### Returns - -`Promise`\<`AuthWitness`\> diff --git a/docs/docs/developers/apis/aztec-js/interfaces/account.EntrypointInterface.md b/docs/docs/developers/apis/aztec-js/interfaces/account.EntrypointInterface.md deleted file mode 100644 index a8b660029a6..00000000000 --- a/docs/docs/developers/apis/aztec-js/interfaces/account.EntrypointInterface.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: "account.EntrypointInterface" -title: "Interface: EntrypointInterface" -sidebar_label: "EntrypointInterface" -custom_edit_url: null ---- - -[account](../modules/account.md).EntrypointInterface - -Creates transaction execution requests out of a set of function calls. - -## Hierarchy - -- **`EntrypointInterface`** - - ↳ [`AccountInterface`](account.AccountInterface.md) - -## Methods - -### createTxExecutionRequest - -▸ **createTxExecutionRequest**(`executions`): `Promise`\<`TxExecutionRequest`\> - -Generates an authenticated request out of set of function calls. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `executions` | `FunctionCall`[] | The execution intents to be run. | - -#### Returns - -`Promise`\<`TxExecutionRequest`\> - -The authenticated transaction execution request. diff --git a/docs/docs/developers/apis/aztec-js/modules.md b/docs/docs/developers/apis/aztec-js/modules.md deleted file mode 100644 index f7beffd6eb3..00000000000 --- a/docs/docs/developers/apis/aztec-js/modules.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: "modules" -title: "@aztec/aztec.js" -sidebar_label: "Table of Contents" -sidebar_position: 0.5 -hide_table_of_contents: true -custom_edit_url: null ---- - -## Modules - -- [account](modules/account.md) -- [contract](modules/contract.md) diff --git a/docs/docs/developers/apis/aztec-js/modules/_category_.yml b/docs/docs/developers/apis/aztec-js/modules/_category_.yml deleted file mode 100644 index 63f9c4e4016..00000000000 --- a/docs/docs/developers/apis/aztec-js/modules/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Modules" -position: 1 \ No newline at end of file diff --git a/docs/docs/developers/apis/aztec-js/modules/account.md b/docs/docs/developers/apis/aztec-js/modules/account.md deleted file mode 100644 index 7668eddf0ec..00000000000 --- a/docs/docs/developers/apis/aztec-js/modules/account.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -id: "account" -title: "Module: account" -sidebar_label: "account" -sidebar_position: 0 -custom_edit_url: null ---- - -The `account` module provides utilities for managing accounts. The AccountManager class -allows to deploy and register a fresh account, or to obtain a `Wallet` instance out of an account -already deployed. Use the `@aztec/accounts` package to load default account implementations that rely -on ECDSA or Schnorr signatures. - -## Interfaces - -- [AccountContract](../interfaces/account.AccountContract.md) -- [AccountInterface](../interfaces/account.AccountInterface.md) -- [AuthWitnessProvider](../interfaces/account.AuthWitnessProvider.md) -- [EntrypointInterface](../interfaces/account.EntrypointInterface.md) - -## Type Aliases - -### Salt - -Ƭ **Salt**: `Fr` \| `number` \| `bigint` - -A contract deployment salt. - -___ - -### Wallet - -Ƭ **Wallet**: [`AccountInterface`](../interfaces/account.AccountInterface.md) & `PXE` - -The wallet interface. diff --git a/docs/docs/developers/apis/aztec-js/modules/contract.md b/docs/docs/developers/apis/aztec-js/modules/contract.md deleted file mode 100644 index d39d055e09d..00000000000 --- a/docs/docs/developers/apis/aztec-js/modules/contract.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: "contract" -title: "Module: contract" -sidebar_label: "contract" -sidebar_position: 0 -custom_edit_url: null ---- - -The `contract` module provides utilities for deploying and interacting with contracts, based on a -`Wallet` instance and a compiled artifact. Refer to the [account](account.md) module for how to obtain a valid -`Wallet` instance, and to the [Compiling contracts](https://docs.aztec.network/developers/contracts/compiling) -section of the documentation for how to generate an artifact out of your Noir source code. - -The [Contract](../classes/contract.Contract.md) class is the main class in this module, and provides static methods for deploying -a contract or interacting with an already deployed one. The `methods` property of the contract instance -provides access to private, public, and view methods, that can be invoked in a transaction via `send()`, -or can be queried via `view()`. - -```ts -const contract = await Contract.deploy(wallet, MyContractArtifact, [...constructorArgs]).send().deployed(); -console.log(`Contract deployed at ${contract.address}`); -``` - -```ts -const contract = await Contract.at(address, MyContractArtifact, wallet); -await contract.methods.mint(1000, owner).send().wait(); -console.log(`Total supply is now ${await contract.methods.totalSupply().view()}`); -``` - -The result of calling a method in a contract instance, such as `contract.methods.mint(1000, owner)` -in the example, is a [ContractFunctionInteraction](../classes/contract.ContractFunctionInteraction.md) instance. Usually this will be just sent as -a transaction to the network via the `send` method, but you can also `simulate` it without sending, -or obtaining the `request` for aggregating into a [BatchCall](../classes/contract.BatchCall.md). - -The result of `send`ing a transaction is a [SentTx](../classes/contract.SentTx.md) object, from which you can get the -transaction hash, or simply `wait` until the transaction is mined and the local PXE Service -has synchronized its changes. - -**`Remarks`** - -If you are using typescript, consider using the -[autogenerated type-safe interfaces](https://docs.aztec.network/developers/contracts/compiling#typescript-interfaces) -for interacting with your contracts. - -## Classes - -- [BatchCall](../classes/contract.BatchCall.md) -- [Contract](../classes/contract.Contract.md) -- [ContractBase](../classes/contract.ContractBase.md) -- [ContractFunctionInteraction](../classes/contract.ContractFunctionInteraction.md) -- [DeployMethod](../classes/contract.DeployMethod.md) -- [DeploySentTx](../classes/contract.DeploySentTx.md) -- [SentTx](../classes/contract.SentTx.md) - -## Type Aliases - -### ContractMethod - -Ƭ **ContractMethod**: (...`args`: `any`[]) => [`ContractFunctionInteraction`](../classes/contract.ContractFunctionInteraction.md) & \{ `selector`: `FunctionSelector` } - -Type representing a contract method that returns a ContractFunctionInteraction instance -and has a readonly 'selector' property of type Buffer. Takes any number of arguments. - -___ - -### DeployOptions - -Ƭ **DeployOptions**: \{ `contractAddressSalt?`: `Fr` ; `portalContract?`: `EthAddress` } & [`SendMethodOptions`](contract.md#sendmethodoptions) - -Options for deploying a contract on the Aztec network. -Allows specifying a portal contract, contract address salt, and additional send method options. - -___ - -### DeployTxReceipt - -Ƭ **DeployTxReceipt**\<`TContract`\>: `FieldsOf`\<`TxReceipt`\> & \{ `contract`: `TContract` } - -Extends a transaction receipt with a contract instance that represents the newly deployed contract. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `TContract` | extends [`ContractBase`](../classes/contract.ContractBase.md) = [`Contract`](../classes/contract.Contract.md) | - -___ - -### DeployedWaitOpts - -Ƭ **DeployedWaitOpts**: [`WaitOpts`](contract.md#waitopts) & \{ `wallet?`: [`Wallet`](account.md#wallet) } - -Options related to waiting for a deployment tx. - -___ - -### SendMethodOptions - -Ƭ **SendMethodOptions**: `Object` - -Represents options for calling a (constrained) function in a contract. -Allows the user to specify the sender address and nonce for a transaction. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `skipPublicSimulation?` | `boolean` | Wether to skip the simulation of the public part of the transaction. | - -___ - -### ViewMethodOptions - -Ƭ **ViewMethodOptions**: `Object` - -Represents the options for a view method in a contract function interaction. -Allows specifying the address from which the view method should be called. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `from?` | `AztecAddress` | The sender's Aztec address. | - -___ - -### WaitOpts - -Ƭ **WaitOpts**: `Object` - -Options related to waiting for a tx. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `debug?` | `boolean` | Whether to include information useful for debugging/testing in the receipt. | -| `interval?` | `number` | The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. | -| `timeout?` | `number` | The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60. | -| `waitForNotesSync?` | `boolean` | Whether to wait for the PXE Service to sync all notes up to the block in which this tx was mined. If false, then any queries that depend on state set by this transaction may return stale data. Defaults to true. | - -## Variables - -### DefaultWaitOpts - -• `Const` **DefaultWaitOpts**: [`WaitOpts`](contract.md#waitopts) diff --git a/docs/docs/developers/apis/pxe/_category_.yml b/docs/docs/developers/apis/pxe/_category_.yml deleted file mode 100644 index 24a46026174..00000000000 --- a/docs/docs/developers/apis/pxe/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: "API" \ No newline at end of file diff --git a/docs/docs/developers/apis/pxe/index.md b/docs/docs/developers/apis/pxe/index.md deleted file mode 100644 index f3862305aeb..00000000000 --- a/docs/docs/developers/apis/pxe/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: "index" -title: "@aztec/circuit-types" -sidebar_label: "Private Execution Environment (PXE)" -sidebar_position: 0 -custom_edit_url: null ---- - -# Circuit Types -A package containing circuit dependent types which are relevant through all the Aztec Typescript codebase. diff --git a/docs/docs/developers/apis/pxe/interfaces/PXE.md b/docs/docs/developers/apis/pxe/interfaces/PXE.md deleted file mode 100644 index 3d3d7e33cda..00000000000 --- a/docs/docs/developers/apis/pxe/interfaces/PXE.md +++ /dev/null @@ -1,582 +0,0 @@ ---- -id: "PXE" -title: "Interface: PXE" -sidebar_label: "Private Execution Environment (PXE)" -sidebar_position: 0 -custom_edit_url: null ---- - -Private eXecution Environment (PXE) runs locally for each user, providing functionality for all the operations -needed to interact with the Aztec network, including account management, private data management, -transaction local simulation, and access to an Aztec node. This interface, as part of a Wallet, -is exposed to dapps for interacting with the network on behalf of the user. - -## Methods - -### addAuthWitness - -▸ **addAuthWitness**(`authWitness`): `Promise`\<`void`\> - -Insert an auth witness for a given message hash. Auth witnesses are used to authorize actions on -behalf of a user. For instance, a token transfer initiated by a different address may request -authorization from the user to move their tokens. This authorization is granted by the user -account contract by verifying an auth witness requested to the execution oracle. Witnesses are -usually a signature over a hash of the action to be authorized, but their actual contents depend -on the account contract that consumes them. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `authWitness` | `AuthWitness` | The auth witness to insert. Composed of an identifier, which is the hash of the action to be authorized, and the actual witness as an array of fields, which are to be deserialized and processed by the account contract. | - -#### Returns - -`Promise`\<`void`\> - -___ - -### addCapsule - -▸ **addCapsule**(`capsule`): `Promise`\<`void`\> - -Adding a capsule to the capsule dispenser. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `capsule` | `Fr`[] | An array of field elements representing the capsule. | - -#### Returns - -`Promise`\<`void`\> - -**`Remarks`** - -A capsule is a "blob" of data that is passed to the contract through an oracle. - -___ - -### addContracts - -▸ **addContracts**(`contracts`): `Promise`\<`void`\> - -Adds deployed contracts to the PXE Service. Deployed contract information is used to access the -contract code when simulating local transactions. This is automatically called by aztec.js when -deploying a contract. Dapps that wish to interact with contracts already deployed should register -these contracts in their users' PXE Service through this method. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `contracts` | `DeployedContract`[] | An array of DeployedContract objects containing contract ABI, address, and portal contract. | - -#### Returns - -`Promise`\<`void`\> - -___ - -### addNote - -▸ **addNote**(`note`): `Promise`\<`void`\> - -Adds a note to the database. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `note` | `ExtendedNote` | The note to add. | - -#### Returns - -`Promise`\<`void`\> - -**`Throws`** - -If the note hash of the note doesn't exist in the tree. - -___ - -### getBlock - -▸ **getBlock**(`number`): `Promise`\<`undefined` \| `L2Block`\> - -Get the given block. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `number` | `number` | The block number being requested. | - -#### Returns - -`Promise`\<`undefined` \| `L2Block`\> - -The blocks requested. - -___ - -### getBlockNumber - -▸ **getBlockNumber**(): `Promise`\<`number`\> - -Fetches the current block number. - -#### Returns - -`Promise`\<`number`\> - -The block number. - -___ - -### getContractData - -▸ **getContractData**(`contractAddress`): `Promise`\<`undefined` \| `ContractData`\> - -Gets the portal contract address on L1 for the given contract. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `contractAddress` | `AztecAddress` | The contract's address. | - -#### Returns - -`Promise`\<`undefined` \| `ContractData`\> - -The contract's portal address if found. - -___ - -### getContracts - -▸ **getContracts**(): `Promise`\<`AztecAddress`[]\> - -Retrieves the addresses of contracts added to this PXE Service. - -#### Returns - -`Promise`\<`AztecAddress`[]\> - -An array of contracts addresses registered on this PXE Service. - -___ - -### getExtendedContractData - -▸ **getExtendedContractData**(`contractAddress`): `Promise`\<`undefined` \| `ExtendedContractData`\> - -Gets the extended contract data for this contract. Extended contract data includes the address, -portal contract address on L1, public functions, partial address, and encryption public key. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `contractAddress` | `AztecAddress` | The contract's address. | - -#### Returns - -`Promise`\<`undefined` \| `ExtendedContractData`\> - -The extended contract data if found. - -___ - -### getNodeInfo - -▸ **getNodeInfo**(): `Promise`\<`NodeInfo`\> - -Returns the information about the server's node. Includes current Node version, compatible Noir version, -L1 chain identifier, protocol version, and L1 address of the rollup contract. - -#### Returns - -`Promise`\<`NodeInfo`\> - -- The node information. - -___ - -### getNotes - -▸ **getNotes**(`filter`): `Promise`\<`ExtendedNote`[]\> - -Gets notes of accounts registered in this PXE based on the provided filter. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `filter` | `NoteFilter` | The filter to apply to the notes. | - -#### Returns - -`Promise`\<`ExtendedNote`[]\> - -The requested notes. - -___ - -### getPublicStorageAt - -▸ **getPublicStorageAt**(`contract`, `slot`): `Promise`\<`Fr`\> - -Gets the storage value at the given contract storage slot. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `contract` | `AztecAddress` | Address of the contract to query. | -| `slot` | `Fr` | Slot to query. | - -#### Returns - -`Promise`\<`Fr`\> - -Storage value at the given contract slot. - -**`Remarks`** - -The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree. -Aztec's version of `eth_getStorageAt`. - -**`Throws`** - -If the contract is not deployed. - -___ - -### getRecipient - -▸ **getRecipient**(`address`): `Promise`\<`undefined` \| `CompleteAddress`\> - -Retrieves the complete address of the recipient corresponding to the provided aztec address. -Complete addresses include the address, the partial address, and the encryption public key. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `address` | `AztecAddress` | The aztec address of the recipient. | - -#### Returns - -`Promise`\<`undefined` \| `CompleteAddress`\> - -The complete address of the requested recipient. - -___ - -### getRecipients - -▸ **getRecipients**(): `Promise`\<`CompleteAddress`[]\> - -Retrieves the recipients added to this PXE Service. - -#### Returns - -`Promise`\<`CompleteAddress`[]\> - -An array of recipients registered on this PXE Service. - -___ - -### getRegisteredAccount - -▸ **getRegisteredAccount**(`address`): `Promise`\<`undefined` \| `CompleteAddress`\> - -Retrieves the complete address of the account corresponding to the provided aztec address. -Complete addresses include the address, the partial address, and the encryption public key. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `address` | `AztecAddress` | The address of account. | - -#### Returns - -`Promise`\<`undefined` \| `CompleteAddress`\> - -The complete address of the requested account if found. - -___ - -### getRegisteredAccounts - -▸ **getRegisteredAccounts**(): `Promise`\<`CompleteAddress`[]\> - -Retrieves the user accounts registered on this PXE Service. - -#### Returns - -`Promise`\<`CompleteAddress`[]\> - -An array of the accounts registered on this PXE Service. - -___ - -### getSyncStatus - -▸ **getSyncStatus**(): `Promise`\<`SyncStatus`\> - -Returns the latest block that has been synchronized globally and for each account. The global block number -indicates whether global state has been updated up to that block, whereas each address indicates up to which -block the private state has been synced for that account. - -#### Returns - -`Promise`\<`SyncStatus`\> - -The latest block synchronized for blocks, and the latest block synched for notes for each public key being tracked. - -___ - -### getTx - -▸ **getTx**(`txHash`): `Promise`\<`undefined` \| `L2Tx`\> - -Fetches a transaction by its hash. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `txHash` | `TxHash` | The transaction hash | - -#### Returns - -`Promise`\<`undefined` \| `L2Tx`\> - -A transaction object or undefined if the transaction hasn't been mined yet - -___ - -### getTxReceipt - -▸ **getTxReceipt**(`txHash`): `Promise`\<`TxReceipt`\> - -Fetches a transaction receipt for a given transaction hash. Returns a mined receipt if it was added -to the chain, a pending receipt if it's still in the mempool of the connected Aztec node, or a dropped -receipt if not found in the connected Aztec node. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `txHash` | `TxHash` | The transaction hash. | - -#### Returns - -`Promise`\<`TxReceipt`\> - -A receipt of the transaction. - -___ - -### getUnencryptedLogs - -▸ **getUnencryptedLogs**(`filter`): `Promise`\<`GetUnencryptedLogsResponse`\> - -Gets unencrypted logs based on the provided filter. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `filter` | `LogFilter` | The filter to apply to the logs. | - -#### Returns - -`Promise`\<`GetUnencryptedLogsResponse`\> - -The requested logs. - -___ - -### isAccountStateSynchronized - -▸ **isAccountStateSynchronized**(`account`): `Promise`\<`boolean`\> - -Checks if the specified account is synchronized. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `account` | `AztecAddress` | The aztec address for which to query the sync status. | - -#### Returns - -`Promise`\<`boolean`\> - -True if the account is fully synched, false otherwise. - -**`Deprecated`** - -Use `getSyncStatus` instead. - -**`Remarks`** - -Checks whether all the notes from all the blocks have been processed. If it is not the case, the -retrieved information from contracts might be old/stale (e.g. old token balance). - -**`Throws`** - -If checking a sync status of account which is not registered. - -___ - -### isGlobalStateSynchronized - -▸ **isGlobalStateSynchronized**(): `Promise`\<`boolean`\> - -Checks whether all the blocks were processed (tree roots updated, txs updated with block info, etc.). - -#### Returns - -`Promise`\<`boolean`\> - -True if there are no outstanding blocks to be synched. - -**`Remarks`** - -This indicates that blocks and transactions are synched even if notes are not. Compares local block number with the block number from aztec node. - -**`Deprecated`** - -Use `getSyncStatus` instead. - -___ - -### registerAccount - -▸ **registerAccount**(`privKey`, `partialAddress`): `Promise`\<`CompleteAddress`\> - -Registers a user account in PXE given its master encryption private key. -Once a new account is registered, the PXE Service will trial-decrypt all published notes on -the chain and store those that correspond to the registered account. Will do nothing if the -account is already registered. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `privKey` | `Fq` | Private key of the corresponding user master public key. | -| `partialAddress` | `Fr` | The partial address of the account contract corresponding to the account being registered. | - -#### Returns - -`Promise`\<`CompleteAddress`\> - -The complete address of the account. - -___ - -### registerRecipient - -▸ **registerRecipient**(`recipient`): `Promise`\<`void`\> - -Registers a recipient in PXE. This is required when sending encrypted notes to -a user who hasn't deployed their account contract yet. Since their account is not deployed, their -encryption public key has not been broadcasted, so we need to manually register it on the PXE Service -in order to be able to encrypt data for this recipient. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `recipient` | `CompleteAddress` | The complete address of the recipient | - -#### Returns - -`Promise`\<`void`\> - -**`Remarks`** - -Called recipient because we can only send notes to this account and not receive them via this PXE Service. -This is because we don't have the associated private key and for this reason we can't decrypt -the recipient's notes. We can send notes to this account because we can encrypt them with the recipient's -public key. - -___ - -### sendTx - -▸ **sendTx**(`tx`): `Promise`\<`TxHash`\> - -Sends a transaction to an Aztec node to be broadcasted to the network and mined. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `tx` | `Tx` | The transaction as created via `simulateTx`. | - -#### Returns - -`Promise`\<`TxHash`\> - -A hash of the transaction, used to identify it. - -___ - -### simulateTx - -▸ **simulateTx**(`txRequest`, `simulatePublic`): `Promise`\<`Tx`\> - -Creates a transaction based on the provided preauthenticated execution request. This will -run a local simulation of the private execution (and optionally of public as well), assemble -the zero-knowledge proof for the private execution, and return the transaction object. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `txRequest` | `TxExecutionRequest` | An authenticated tx request ready for simulation | -| `simulatePublic` | `boolean` | Whether to simulate the public part of the transaction. | - -#### Returns - -`Promise`\<`Tx`\> - -A transaction ready to be sent to the network for execution. - -**`Throws`** - -If the code for the functions executed in this transaction has not been made available via `addContracts`. - -___ - -### viewTx - -▸ **viewTx**(`functionName`, `args`, `to`, `from?`): `Promise`\<`any`\> - -Simulate the execution of a view (read-only) function on a deployed contract without actually modifying state. -This is useful to inspect contract state, for example fetching a variable value or calling a getter function. -The function takes function name and arguments as parameters, along with the contract address -and optionally the sender's address. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `functionName` | `string` | The name of the function to be called in the contract. | -| `args` | `any`[] | The arguments to be provided to the function. | -| `to` | `AztecAddress` | The address of the contract to be called. | -| `from?` | `AztecAddress` | (Optional) The msg sender to set for the call. | - -#### Returns - -`Promise`\<`any`\> - -The result of the view function call, structured based on the function ABI. diff --git a/docs/docs/developers/apis/pxe/interfaces/_category_.yml b/docs/docs/developers/apis/pxe/interfaces/_category_.yml deleted file mode 100644 index 43bec88cfa0..00000000000 --- a/docs/docs/developers/apis/pxe/interfaces/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Interfaces" -position: 4 \ No newline at end of file diff --git a/docs/docs/developers/apis/pxe/modules.md b/docs/docs/developers/apis/pxe/modules.md deleted file mode 100644 index 0b801ef4fe2..00000000000 --- a/docs/docs/developers/apis/pxe/modules.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -id: "modules" -title: "@aztec/circuit-types" -sidebar_label: "Private Execution Environment (PXE)" -sidebar_position: 0.5 -custom_edit_url: null ---- - -## Interfaces - -- [PXE](interfaces/PXE.md) diff --git a/docs/docs/developers/debugging/aztecnr-errors.md b/docs/docs/developers/debugging/aztecnr-errors.md index 5d7e14aea2a..9e2e8236702 100644 --- a/docs/docs/developers/debugging/aztecnr-errors.md +++ b/docs/docs/developers/debugging/aztecnr-errors.md @@ -57,7 +57,7 @@ This error occurs when you are trying to interact with a smart contract via an P To execute a transaction, the PXE needs to know the complete address of a contract, portal address (if portal is used) and contract artifacts. -To address the error, add the contract to the PXE by calling [`pxe.addContracts(...)`](../../apis/pxe/interfaces/PXE#addcontracts). +To address the error, add the contract to the PXE by calling [`pxe.addContracts(...)`](../../apis/pxe/interfaces/PXE.md#addcontracts). #### `Simulation error: No public key registered for address 0x0. Register it by calling pxe.registerRecipient(...) or pxe.registerAccount(...)` diff --git a/docs/docs/developers/getting_started/quickstart.md b/docs/docs/developers/getting_started/quickstart.md index 62b56e10afe..822cf85f5a7 100644 --- a/docs/docs/developers/getting_started/quickstart.md +++ b/docs/docs/developers/getting_started/quickstart.md @@ -77,7 +77,7 @@ Note that the deployed contract address is exported, so we can use it as `$CONTR Alice is set up as the contract admin and token minter in the `_initialize` function. Let's get Alice some private tokens. -We need to export the `SECRET` and `SECRET_HASH` values in order to privately mint tokens. Private tokens are claimable by anyone with the pre-image to a provided hash, see more about how the token contract works in the [token contract tutorial](../tutorials/writing_token_contract.md). After the tokens have been minted, the notes will have to added to the [Private Execution Environment](../../apis/pxe/interfaces/PXE) (PXE) to be consumed by private functions. Once added, Alice can claim them with the `redeem_shield` function. After this, Alice should have 1000 tokens in their private balance. +We need to export the `SECRET` and `SECRET_HASH` values in order to privately mint tokens. Private tokens are claimable by anyone with the pre-image to a provided hash, see more about how the token contract works in the [token contract tutorial](../tutorials/writing_token_contract.md). After the tokens have been minted, the notes will have to added to the [Private Execution Environment](../../apis/pxe/interfaces/PXE.md) (PXE) to be consumed by private functions. Once added, Alice can claim them with the `redeem_shield` function. After this, Alice should have 1000 tokens in their private balance. #include_code mint-private yarn-project/end-to-end/src/guides/up_quick_start.sh bash diff --git a/docs/docs/learn/about_aztec/technical_overview.md b/docs/docs/learn/about_aztec/technical_overview.md index 8a5e3ac8638..7192e34d316 100644 --- a/docs/docs/learn/about_aztec/technical_overview.md +++ b/docs/docs/learn/about_aztec/technical_overview.md @@ -36,7 +36,7 @@ An overview of the Aztec network architecture will help contextualize the concep ### Aztec.js -A user of the Aztec network will interact with the network through Aztec.js. Aztec.js is a library that provides APIs for managing accounts and interacting with smart contracts (including account contracts) on the Aztec network. It communicates with the [Private eXecution Environment (PXE)](../../apis/pxe/interfaces/PXE) through a `PXE` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions. +A user of the Aztec network will interact with the network through Aztec.js. Aztec.js is a library that provides APIs for managing accounts and interacting with smart contracts (including account contracts) on the Aztec network. It communicates with the [Private eXecution Environment (PXE)](../../apis/pxe/index.md) through a `PXE` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions. ### Private Execution Environment diff --git a/docs/docs/learn/concepts/pxe/main.md b/docs/docs/learn/concepts/pxe/main.md index effb02a1072..e8182ab218b 100644 --- a/docs/docs/learn/concepts/pxe/main.md +++ b/docs/docs/learn/concepts/pxe/main.md @@ -31,7 +31,7 @@ graph TD; ## PXE Service -The PXE is a client-side interface of the PXE Service, which is a set of server-side APIs for interacting with the network. It provides functions for account management, contract and transaction interactions, note management, and more. For a more extensive list of operations, refer to the [PXE reference](../../../developers/apis/pxe/index.md). +The PXE is a client-side interface of the PXE Service, which is a set of server-side APIs for interacting with the network. It provides functions for account management, contract and transaction interactions, note management, and more. For a more extensive list of operations, refer to the [PXE reference](../../../apis/pxe/index.md). ## Components diff --git a/docs/sidebars.js b/docs/sidebars.js index fc66890cf55..28f41753eaf 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -438,7 +438,7 @@ const sidebars = { { label: "Private Execution Environment (PXE)", type: "doc", - id: "developers/apis/pxe/interfaces/PXE", + id: "apis/pxe/interfaces/PXE", }, { label: "Aztec.js",