@aztec/wallets 0.0.1-commit.3e3d0c9cd → 0.0.1-commit.3f5453c7b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/embedded/account-contract-providers/bundle.d.ts +4 -3
- package/dest/embedded/account-contract-providers/bundle.d.ts.map +1 -1
- package/dest/embedded/account-contract-providers/bundle.js +6 -5
- package/dest/embedded/account-contract-providers/lazy.d.ts +4 -3
- package/dest/embedded/account-contract-providers/lazy.d.ts.map +1 -1
- package/dest/embedded/account-contract-providers/lazy.js +16 -6
- package/dest/embedded/account-contract-providers/types.d.ts +4 -3
- package/dest/embedded/account-contract-providers/types.d.ts.map +1 -1
- package/dest/embedded/embedded_wallet.d.ts +38 -10
- package/dest/embedded/embedded_wallet.d.ts.map +1 -1
- package/dest/embedded/embedded_wallet.js +156 -53
- package/dest/embedded/entrypoints/browser.d.ts +2 -2
- package/dest/embedded/entrypoints/browser.d.ts.map +1 -1
- package/dest/embedded/entrypoints/browser.js +15 -5
- package/dest/embedded/entrypoints/node.d.ts +2 -2
- package/dest/embedded/entrypoints/node.d.ts.map +1 -1
- package/dest/embedded/entrypoints/node.js +15 -5
- package/dest/testing.d.ts +1 -1
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +2 -2
- package/package.json +10 -10
- package/src/embedded/account-contract-providers/bundle.ts +7 -5
- package/src/embedded/account-contract-providers/lazy.ts +17 -6
- package/src/embedded/account-contract-providers/types.ts +4 -2
- package/src/embedded/embedded_wallet.ts +192 -63
- package/src/embedded/entrypoints/browser.ts +11 -6
- package/src/embedded/entrypoints/node.ts +11 -6
- package/src/testing.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/embedded/entrypoints/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,KAAK,GAAG,EAAsC,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/embedded/entrypoints/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,KAAK,GAAG,EAAsC,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAmB,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAa,MAAM,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACnE,IAAI,EAAE,KACJ,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,wBAAwB,EAC1C,GAAG,CAAC,EAAE,MAAM,KACT,CAAC,EACN,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,CAAC,CAAC,CAsDZ;CACF;AAED,OAAO,EAAE,kBAAkB,IAAI,cAAc,EAAE,CAAC;AAChD,YAAY,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -4,28 +4,38 @@ import { createStore, openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
|
4
4
|
import { getPXEConfig } from '@aztec/pxe/config';
|
|
5
5
|
import { createPXE } from '@aztec/pxe/server';
|
|
6
6
|
import { BundleAccountContractsProvider } from '../account-contract-providers/bundle.js';
|
|
7
|
-
import { EmbeddedWallet } from '../embedded_wallet.js';
|
|
7
|
+
import { EmbeddedWallet, splitPxeOptions } from '../embedded_wallet.js';
|
|
8
8
|
import { WalletDB } from '../wallet_db.js';
|
|
9
9
|
export class NodeEmbeddedWallet extends EmbeddedWallet {
|
|
10
10
|
static async create(nodeOrUrl, options = {}) {
|
|
11
11
|
const rootLogger = options.logger ?? createLogger('embedded-wallet');
|
|
12
12
|
const aztecNode = typeof nodeOrUrl === 'string' ? createAztecNodeClient(nodeOrUrl) : nodeOrUrl;
|
|
13
13
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
14
|
+
// Support both the new unified `pxe` option and the deprecated `pxeConfig`/`pxeOptions`.
|
|
15
|
+
const { config: pxeConfigFromPxe, creation: pxeCreationFromPxe } = splitPxeOptions(options.pxe);
|
|
16
|
+
const mergedConfigOverrides = {
|
|
17
|
+
...options.pxeConfig,
|
|
18
|
+
...pxeConfigFromPxe
|
|
19
|
+
};
|
|
20
|
+
const mergedCreationOverrides = {
|
|
21
|
+
...options.pxeOptions,
|
|
22
|
+
...pxeCreationFromPxe
|
|
23
|
+
};
|
|
14
24
|
const pxeConfig = Object.assign(getPXEConfig(), {
|
|
15
|
-
proverEnabled:
|
|
25
|
+
proverEnabled: mergedConfigOverrides.proverEnabled ?? false,
|
|
16
26
|
dataDirectory: `pxe_data_${l1Contracts.rollupAddress}`,
|
|
17
|
-
...
|
|
27
|
+
...mergedConfigOverrides
|
|
18
28
|
});
|
|
19
29
|
if (options.ephemeral) {
|
|
20
30
|
delete pxeConfig.dataDirectory;
|
|
21
31
|
}
|
|
22
32
|
const pxeOptions = {
|
|
23
|
-
...
|
|
33
|
+
...mergedCreationOverrides,
|
|
24
34
|
loggers: {
|
|
25
35
|
store: rootLogger.createChild('pxe:data'),
|
|
26
36
|
pxe: rootLogger.createChild('pxe:service'),
|
|
27
37
|
prover: rootLogger.createChild('pxe:prover'),
|
|
28
|
-
...
|
|
38
|
+
...mergedCreationOverrides.loggers
|
|
29
39
|
}
|
|
30
40
|
};
|
|
31
41
|
const pxe = await createPXE(aztecNode, pxeConfig, pxeOptions);
|
package/dest/testing.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ interface WalletWithSchnorrAccounts {
|
|
|
9
9
|
export declare function deployFundedSchnorrAccounts(wallet: WalletWithSchnorrAccounts, accountsData: InitialAccountData[], waitOptions?: WaitOpts): Promise<AccountManager[]>;
|
|
10
10
|
export declare function registerInitialLocalNetworkAccountsInWallet(wallet: WalletWithSchnorrAccounts): Promise<AztecAddress[]>;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3Rlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUdsRSxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM3RCxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDN0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRTNELFVBQVUseUJBQXlCO0lBQ2pDLG9CQUFvQixDQUFDLE1BQU0sRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLEVBQUUsRUFBRSxVQUFVLENBQUMsRUFBRSxFQUFFLEVBQUUsS0FBSyxDQUFDLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FBQztDQUN0RztBQUVELHdCQUFzQiwyQkFBMkIsQ0FDL0MsTUFBTSxFQUFFLHlCQUF5QixFQUNqQyxZQUFZLEVBQUUsa0JBQWtCLEVBQUUsRUFDbEMsV0FBVyxDQUFDLEVBQUUsUUFBUSw2QkFnQnZCO0FBRUQsd0JBQXNCLDJDQUEyQyxDQUMvRCxNQUFNLEVBQUUseUJBQXlCLEdBQ2hDLE9BQU8sQ0FBQyxZQUFZLEVBQUUsQ0FBQyxDQU96QiJ9
|
package/dest/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,UAAU,yBAAyB;IACjC,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACtG;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,yBAAyB,EACjC,YAAY,EAAE,kBAAkB,EAAE,EAClC,WAAW,CAAC,EAAE,QAAQ,6BAgBvB;AAED,wBAAsB,2CAA2C,CAC/D,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,YAAY,EAAE,CAAC,CAOzB"}
|
package/dest/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing/lazy';
|
|
2
|
-
import {
|
|
2
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
3
3
|
export async function deployFundedSchnorrAccounts(wallet, accountsData, waitOptions) {
|
|
4
4
|
const accountManagers = [];
|
|
5
5
|
// Serial due to https://github.com/AztecProtocol/aztec-packages/issues/12045
|
|
@@ -8,7 +8,7 @@ export async function deployFundedSchnorrAccounts(wallet, accountsData, waitOpti
|
|
|
8
8
|
const accountManager = await wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
9
9
|
const deployMethod = await accountManager.getDeployMethod();
|
|
10
10
|
await deployMethod.send({
|
|
11
|
-
from:
|
|
11
|
+
from: NO_FROM,
|
|
12
12
|
skipClassPublication: i !== 0,
|
|
13
13
|
wait: waitOptions
|
|
14
14
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/wallets",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/wallets",
|
|
4
|
-
"version": "0.0.1-commit.
|
|
4
|
+
"version": "0.0.1-commit.3f5453c7b",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./embedded": {
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"../package.common.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
32
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
33
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
34
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
35
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
36
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
37
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
38
|
-
"@aztec/wallet-sdk": "0.0.1-commit.
|
|
30
|
+
"@aztec/accounts": "0.0.1-commit.3f5453c7b",
|
|
31
|
+
"@aztec/aztec.js": "0.0.1-commit.3f5453c7b",
|
|
32
|
+
"@aztec/entrypoints": "0.0.1-commit.3f5453c7b",
|
|
33
|
+
"@aztec/foundation": "0.0.1-commit.3f5453c7b",
|
|
34
|
+
"@aztec/kv-store": "0.0.1-commit.3f5453c7b",
|
|
35
|
+
"@aztec/protocol-contracts": "0.0.1-commit.3f5453c7b",
|
|
36
|
+
"@aztec/pxe": "0.0.1-commit.3f5453c7b",
|
|
37
|
+
"@aztec/stdlib": "0.0.1-commit.3f5453c7b",
|
|
38
|
+
"@aztec/wallet-sdk": "0.0.1-commit.3f5453c7b"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@jest/globals": "^30.0.0",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
|
|
2
2
|
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
3
|
-
import {
|
|
3
|
+
import { StubEcdsaAccountContractArtifact, createStubEcdsaAccount } from '@aztec/accounts/stub/ecdsa';
|
|
4
|
+
import { StubSchnorrAccountContractArtifact, createStubSchnorrAccount } from '@aztec/accounts/stub/schnorr';
|
|
4
5
|
import type { Account, AccountContract } from '@aztec/aztec.js/account';
|
|
5
6
|
import type { Fq } from '@aztec/foundation/curves/bn254';
|
|
6
7
|
import { getCanonicalMultiCallEntrypoint } from '@aztec/protocol-contracts/multi-call-entrypoint';
|
|
7
8
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
8
9
|
import type { CompleteAddress, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
9
10
|
|
|
11
|
+
import type { AccountType } from '../wallet_db.js';
|
|
10
12
|
import type { AccountContractsProvider } from './types.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -26,12 +28,12 @@ export class BundleAccountContractsProvider implements AccountContractsProvider
|
|
|
26
28
|
return Promise.resolve(new EcdsaKAccountContract(signingKey));
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
getStubAccountContractArtifact(): Promise<ContractArtifact> {
|
|
30
|
-
return Promise.resolve(
|
|
31
|
+
getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact> {
|
|
32
|
+
return Promise.resolve(type === 'schnorr' ? StubSchnorrAccountContractArtifact : StubEcdsaAccountContractArtifact);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
createStubAccount(address: CompleteAddress): Promise<Account> {
|
|
34
|
-
return Promise.resolve(
|
|
35
|
+
createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account> {
|
|
36
|
+
return Promise.resolve(type === 'schnorr' ? createStubSchnorrAccount(address) : createStubEcdsaAccount(address));
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
getMulticallContract(): Promise<{ instance: ContractInstanceWithAddress; artifact: ContractArtifact }> {
|
|
@@ -4,6 +4,7 @@ import { getCanonicalMultiCallEntrypoint } from '@aztec/protocol-contracts/multi
|
|
|
4
4
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
5
5
|
import type { CompleteAddress, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
6
|
|
|
7
|
+
import type { AccountType } from '../wallet_db.js';
|
|
7
8
|
import type { AccountContractsProvider } from './types.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -26,14 +27,24 @@ export class LazyAccountContractsProvider implements AccountContractsProvider {
|
|
|
26
27
|
return new EcdsaKAccountContract(signingKey);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
async getStubAccountContractArtifact(): Promise<ContractArtifact> {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
async getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact> {
|
|
31
|
+
if (type === 'schnorr') {
|
|
32
|
+
const { getStubSchnorrAccountContractArtifact } = await import('@aztec/accounts/stub/schnorr/lazy');
|
|
33
|
+
return getStubSchnorrAccountContractArtifact();
|
|
34
|
+
} else {
|
|
35
|
+
const { getStubEcdsaAccountContractArtifact } = await import('@aztec/accounts/stub/ecdsa/lazy');
|
|
36
|
+
return getStubEcdsaAccountContractArtifact();
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
|
|
34
|
-
async createStubAccount(address: CompleteAddress): Promise<Account> {
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
async createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account> {
|
|
41
|
+
if (type === 'schnorr') {
|
|
42
|
+
const { createStubSchnorrAccount } = await import('@aztec/accounts/stub/schnorr/lazy');
|
|
43
|
+
return createStubSchnorrAccount(address);
|
|
44
|
+
} else {
|
|
45
|
+
const { createStubEcdsaAccount } = await import('@aztec/accounts/stub/ecdsa/lazy');
|
|
46
|
+
return createStubEcdsaAccount(address);
|
|
47
|
+
}
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
getMulticallContract(): Promise<{ instance: ContractInstanceWithAddress; artifact: ContractArtifact }> {
|
|
@@ -3,6 +3,8 @@ import type { Fq } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import type { CompleteAddress, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
|
|
6
|
+
import type { AccountType } from '../wallet_db.js';
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* Provides account contract implementations and stub accounts for the EmbeddedWallet.
|
|
8
10
|
* Two implementations exist:
|
|
@@ -13,7 +15,7 @@ export interface AccountContractsProvider {
|
|
|
13
15
|
getSchnorrAccountContract(signingKey: Fq): Promise<AccountContract>;
|
|
14
16
|
getEcdsaRAccountContract(signingKey: Buffer): Promise<AccountContract>;
|
|
15
17
|
getEcdsaKAccountContract(signingKey: Buffer): Promise<AccountContract>;
|
|
16
|
-
getStubAccountContractArtifact(): Promise<ContractArtifact>;
|
|
18
|
+
getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact>;
|
|
17
19
|
getMulticallContract(): Promise<{ instance: ContractInstanceWithAddress; artifact: ContractArtifact }>;
|
|
18
|
-
createStubAccount(address: CompleteAddress): Promise<Account>;
|
|
20
|
+
createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account>;
|
|
19
21
|
}
|
|
@@ -1,38 +1,72 @@
|
|
|
1
|
-
import { type Account,
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { type Account, NO_FROM } from '@aztec/aztec.js/account';
|
|
2
|
+
import { CallAuthorizationRequest } from '@aztec/aztec.js/authorization';
|
|
3
|
+
import { type InteractionWaitOptions, type SendReturn, type WaitOpts, getGasLimits } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import type { Aliased, SendOptions } from '@aztec/aztec.js/wallet';
|
|
5
|
+
import { AccountManager, TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
|
|
4
6
|
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
7
|
+
import { DefaultEntrypoint } from '@aztec/entrypoints/default';
|
|
5
8
|
import { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
6
9
|
import type { Logger } from '@aztec/foundation/log';
|
|
7
|
-
import type {
|
|
10
|
+
import type { PXEConfig, PXECreationOptions } from '@aztec/pxe/client/lazy';
|
|
8
11
|
import type { PXE } from '@aztec/pxe/server';
|
|
9
12
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
13
|
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
14
|
+
import { GasSettings } from '@aztec/stdlib/gas';
|
|
11
15
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
12
16
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
13
17
|
import {
|
|
18
|
+
type ContractOverrides,
|
|
14
19
|
ExecutionPayload,
|
|
15
20
|
SimulationOverrides,
|
|
16
|
-
type
|
|
21
|
+
type TxExecutionRequest,
|
|
22
|
+
TxStatus,
|
|
23
|
+
collectOffchainEffects,
|
|
17
24
|
mergeExecutionPayloads,
|
|
18
25
|
} from '@aztec/stdlib/tx';
|
|
19
|
-
import { BaseWallet, type
|
|
26
|
+
import { BaseWallet, type SimulateViaEntrypointOptions } from '@aztec/wallet-sdk/base-wallet';
|
|
20
27
|
|
|
21
28
|
import type { AccountContractsProvider } from './account-contract-providers/types.js';
|
|
22
29
|
import { type AccountType, WalletDB } from './wallet_db.js';
|
|
23
30
|
|
|
31
|
+
/** Options for the PXE instance created by the EmbeddedWallet. */
|
|
32
|
+
export type EmbeddedWalletPXEOptions = Partial<PXEConfig> & PXECreationOptions;
|
|
33
|
+
|
|
34
|
+
/** Splits a unified EmbeddedWalletPXEOptions into PXEConfig overrides and PXECreationOptions. */
|
|
35
|
+
export function splitPxeOptions(pxe?: EmbeddedWalletPXEOptions): {
|
|
36
|
+
config: Partial<PXEConfig>;
|
|
37
|
+
creation: PXECreationOptions;
|
|
38
|
+
} {
|
|
39
|
+
if (!pxe) {
|
|
40
|
+
return { config: {}, creation: {} };
|
|
41
|
+
}
|
|
42
|
+
const { loggers, loggerActorLabel, proverOrOptions, store, simulator, ...config } = pxe;
|
|
43
|
+
return { config, creation: { loggers, loggerActorLabel, proverOrOptions, store, simulator } };
|
|
44
|
+
}
|
|
45
|
+
|
|
24
46
|
export type EmbeddedWalletOptions = {
|
|
25
47
|
/** Parent logger. Child loggers are derived via createChild() for each subsystem. */
|
|
26
48
|
logger?: Logger;
|
|
27
49
|
/** Use ephemeral (in-memory) stores. Data will not persist across sessions. */
|
|
28
50
|
ephemeral?: boolean;
|
|
29
|
-
/**
|
|
51
|
+
/** PXE configuration and dependency overrides (custom store, prover, simulator). */
|
|
52
|
+
pxe?: EmbeddedWalletPXEOptions;
|
|
53
|
+
/**
|
|
54
|
+
* Override PXE configuration.
|
|
55
|
+
* @deprecated Use `pxe` instead.
|
|
56
|
+
*/
|
|
30
57
|
pxeConfig?: Partial<PXEConfig>;
|
|
31
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Advanced PXE creation options (custom store, prover, simulator).
|
|
60
|
+
* @deprecated Use `pxe` instead.
|
|
61
|
+
*/
|
|
32
62
|
pxeOptions?: PXECreationOptions;
|
|
33
63
|
};
|
|
34
64
|
|
|
65
|
+
const DEFAULT_ESTIMATED_GAS_PADDING = 0.1;
|
|
66
|
+
|
|
35
67
|
export class EmbeddedWallet extends BaseWallet {
|
|
68
|
+
protected estimatedGasPadding = DEFAULT_ESTIMATED_GAS_PADDING;
|
|
69
|
+
|
|
36
70
|
constructor(
|
|
37
71
|
pxe: PXE,
|
|
38
72
|
aztecNode: AztecNode,
|
|
@@ -44,10 +78,6 @@ export class EmbeddedWallet extends BaseWallet {
|
|
|
44
78
|
}
|
|
45
79
|
|
|
46
80
|
protected async getAccountFromAddress(address: AztecAddress): Promise<Account> {
|
|
47
|
-
if (address.equals(AztecAddress.ZERO)) {
|
|
48
|
-
return new SignerlessAccount();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
81
|
const { secretKey, salt, signingKey, type } = await this.walletDB.retrieveAccount(address);
|
|
52
82
|
const accountManager = await this.createAccountInternal(type, secretKey, salt, signingKey);
|
|
53
83
|
const account = await accountManager.getAccount();
|
|
@@ -79,6 +109,118 @@ export class EmbeddedWallet extends BaseWallet {
|
|
|
79
109
|
return storedSenders;
|
|
80
110
|
}
|
|
81
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Overrides the base sendTx to add a pre-simulation step before the actual send. The simulation
|
|
114
|
+
* estimates actual gas usage and captures call authorization requests to generate
|
|
115
|
+
* the necessary authwitnesses.
|
|
116
|
+
*/
|
|
117
|
+
public override async sendTx<W extends InteractionWaitOptions = undefined>(
|
|
118
|
+
executionPayload: ExecutionPayload,
|
|
119
|
+
opts: SendOptions<W>,
|
|
120
|
+
): Promise<SendReturn<W>> {
|
|
121
|
+
const feeOptions = await this.completeFeeOptions({
|
|
122
|
+
from: opts.from,
|
|
123
|
+
feePayer: executionPayload.feePayer,
|
|
124
|
+
gasSettings: opts.fee?.gasSettings,
|
|
125
|
+
forEstimation: true,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// Simulate the transaction first to estimate gas and capture required
|
|
129
|
+
// private authwitnesses based on offchain effects.
|
|
130
|
+
const simulationResult = await this.simulateViaEntrypoint(executionPayload, {
|
|
131
|
+
from: opts.from,
|
|
132
|
+
feeOptions,
|
|
133
|
+
additionalScopes: opts.additionalScopes,
|
|
134
|
+
skipTxValidation: true,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const offchainEffects = collectOffchainEffects(simulationResult.privateExecutionResult);
|
|
138
|
+
const authWitnesses = await Promise.all(
|
|
139
|
+
offchainEffects.map(async effect => {
|
|
140
|
+
try {
|
|
141
|
+
const authRequest = await CallAuthorizationRequest.fromFields(effect.data);
|
|
142
|
+
return this.createAuthWit(authRequest.onBehalfOf, {
|
|
143
|
+
consumer: effect.contractAddress,
|
|
144
|
+
innerHash: authRequest.innerHash,
|
|
145
|
+
});
|
|
146
|
+
} catch {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
151
|
+
for (const authwit of authWitnesses) {
|
|
152
|
+
if (authwit) {
|
|
153
|
+
executionPayload.authWitnesses.push(authwit);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const estimated = getGasLimits(simulationResult, this.estimatedGasPadding);
|
|
157
|
+
this.log.verbose(
|
|
158
|
+
`Estimated gas limits for tx: DA=${estimated.gasLimits.daGas} L2=${estimated.gasLimits.l2Gas} teardownDA=${estimated.teardownGasLimits.daGas} teardownL2=${estimated.teardownGasLimits.l2Gas}`,
|
|
159
|
+
);
|
|
160
|
+
const gasSettings = GasSettings.from({
|
|
161
|
+
...opts.fee?.gasSettings,
|
|
162
|
+
maxFeesPerGas: feeOptions.gasSettings.maxFeesPerGas,
|
|
163
|
+
maxPriorityFeesPerGas: feeOptions.gasSettings.maxPriorityFeesPerGas,
|
|
164
|
+
gasLimits: opts.fee?.gasSettings?.gasLimits ?? estimated.gasLimits,
|
|
165
|
+
teardownGasLimits: opts.fee?.gasSettings?.teardownGasLimits ?? estimated.teardownGasLimits,
|
|
166
|
+
});
|
|
167
|
+
const waitOpts: WaitOpts = typeof opts.wait === 'object' ? opts.wait : {};
|
|
168
|
+
|
|
169
|
+
if (!waitOpts?.waitForStatus) {
|
|
170
|
+
// Default to PROPOSED so the wait returns as soon as the tx lands in a proposed L2 block,
|
|
171
|
+
// rather than waiting until the end of the slot for the checkpoint to be published to L1.
|
|
172
|
+
// This is what makes MBPS (Multiple Blocks Per Slot) actually improve UX: with CHECKPOINTED
|
|
173
|
+
// we'd block until L1 inclusion regardless of how early in the slot the tx was sequenced.
|
|
174
|
+
// The tradeoff is a weaker guarantee — a proposed block only becomes canonical once it (or
|
|
175
|
+
// a later block in the same slot) is checkpointed, so a tx could be re-orged out if the
|
|
176
|
+
// proposer fails to publish to L1 (which should be rare, since they'd get slashed for it).
|
|
177
|
+
waitOpts!.waitForStatus = TxStatus.PROPOSED;
|
|
178
|
+
}
|
|
179
|
+
return super.sendTx(executionPayload, {
|
|
180
|
+
...opts,
|
|
181
|
+
fee: { ...opts.fee, gasSettings },
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
|
|
187
|
+
* Uses a type-specific stub artifact so that the stub's constructor selector matches the real account's constructor.
|
|
188
|
+
*/
|
|
189
|
+
protected async buildAccountOverrides(addresses: AztecAddress[]): Promise<ContractOverrides> {
|
|
190
|
+
const accounts = await this.getAccounts();
|
|
191
|
+
const contracts: ContractOverrides = {};
|
|
192
|
+
|
|
193
|
+
const filtered = accounts.filter(acc => addresses.some(addr => addr.equals(acc.item)));
|
|
194
|
+
|
|
195
|
+
for (const account of filtered) {
|
|
196
|
+
const address = account.item;
|
|
197
|
+
const { type } = await this.walletDB.retrieveAccount(address);
|
|
198
|
+
const stubArtifact = await this.accountContracts.getStubAccountContractArtifact(type);
|
|
199
|
+
|
|
200
|
+
const originalAccount = await this.getAccountFromAddress(address);
|
|
201
|
+
const completeAddress = originalAccount.getCompleteAddress();
|
|
202
|
+
const contractInstance = await this.pxe.getContractInstance(completeAddress.address);
|
|
203
|
+
if (!contractInstance) {
|
|
204
|
+
throw new Error(
|
|
205
|
+
`No contract instance found for address: ${completeAddress.address} during account override building. This is a bug!`,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const stubConstructorArgs = type === 'schnorr' ? [Fr.ZERO, Fr.ZERO] : [Buffer.alloc(32), Buffer.alloc(32)];
|
|
210
|
+
const stubInstance = await getContractInstanceFromInstantiationParams(stubArtifact, {
|
|
211
|
+
salt: Fr.random(),
|
|
212
|
+
constructorArgs: stubConstructorArgs,
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
contracts[address.toString()] = {
|
|
216
|
+
instance: stubInstance,
|
|
217
|
+
artifact: stubArtifact,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return contracts;
|
|
222
|
+
}
|
|
223
|
+
|
|
82
224
|
/**
|
|
83
225
|
* Simulates calls via a stub account entrypoint, bypassing real account authorization.
|
|
84
226
|
* This allows kernelless simulation with contract overrides, skipping expensive
|
|
@@ -86,69 +228,52 @@ export class EmbeddedWallet extends BaseWallet {
|
|
|
86
228
|
*/
|
|
87
229
|
protected override async simulateViaEntrypoint(
|
|
88
230
|
executionPayload: ExecutionPayload,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
skipFeeEnforcement?: boolean,
|
|
94
|
-
): Promise<TxSimulationResult> {
|
|
95
|
-
let overrides: SimulationOverrides | undefined;
|
|
96
|
-
let fromAccount: Account;
|
|
97
|
-
if (!from.equals(AztecAddress.ZERO)) {
|
|
98
|
-
const { account, instance, artifact } = await this.getFakeAccountDataFor(from);
|
|
99
|
-
fromAccount = account;
|
|
100
|
-
overrides = {
|
|
101
|
-
contracts: { [from.toString()]: { instance, artifact } },
|
|
102
|
-
};
|
|
103
|
-
} else {
|
|
104
|
-
fromAccount = await this.getAccountFromAddress(from);
|
|
105
|
-
}
|
|
231
|
+
opts: SimulateViaEntrypointOptions,
|
|
232
|
+
): Promise<TxSimulationResultWithAppOffset> {
|
|
233
|
+
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement } = opts;
|
|
234
|
+
const scopes = this.scopesFrom(from, additionalScopes);
|
|
106
235
|
|
|
107
236
|
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
108
|
-
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
109
|
-
txNonce: Fr.random(),
|
|
110
|
-
cancellable: this.cancellableTransactions,
|
|
111
|
-
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
|
|
112
|
-
};
|
|
113
237
|
const finalExecutionPayload = feeExecutionPayload
|
|
114
238
|
? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
|
|
115
239
|
: executionPayload;
|
|
116
240
|
const chainInfo = await this.getChainInfo();
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)
|
|
123
|
-
|
|
241
|
+
|
|
242
|
+
const accountOverrides = await this.buildAccountOverrides(scopes);
|
|
243
|
+
const overrides = new SimulationOverrides(accountOverrides);
|
|
244
|
+
|
|
245
|
+
let txRequest: TxExecutionRequest;
|
|
246
|
+
if (from === NO_FROM) {
|
|
247
|
+
const entrypoint = new DefaultEntrypoint();
|
|
248
|
+
txRequest = await entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
|
|
249
|
+
} else {
|
|
250
|
+
const { type } = await this.walletDB.retrieveAccount(from);
|
|
251
|
+
const originalAccount = await this.getAccountFromAddress(from);
|
|
252
|
+
const completeAddress = originalAccount.getCompleteAddress();
|
|
253
|
+
const account = await this.accountContracts.createStubAccount(completeAddress, type);
|
|
254
|
+
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
255
|
+
txNonce: Fr.random(),
|
|
256
|
+
cancellable: this.cancellableTransactions,
|
|
257
|
+
// If from is an address, feeOptions include the way the account contract should handle the fee payment
|
|
258
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions!,
|
|
259
|
+
};
|
|
260
|
+
txRequest = await account.createTxExecutionRequest(
|
|
261
|
+
finalExecutionPayload,
|
|
262
|
+
feeOptions.gasSettings,
|
|
263
|
+
chainInfo,
|
|
264
|
+
executionOptions,
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const result = await this.pxe.simulateTx(txRequest, {
|
|
124
269
|
simulatePublic: true,
|
|
125
270
|
skipFeeEnforcement,
|
|
126
271
|
skipTxValidation,
|
|
127
272
|
overrides,
|
|
128
273
|
scopes,
|
|
129
274
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
private async getFakeAccountDataFor(address: AztecAddress) {
|
|
133
|
-
const originalAccount = await this.getAccountFromAddress(address);
|
|
134
|
-
if (originalAccount instanceof SignerlessAccount) {
|
|
135
|
-
throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
|
|
136
|
-
}
|
|
137
|
-
const originalAddress = (originalAccount as Account).getCompleteAddress();
|
|
138
|
-
const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
|
|
139
|
-
if (!contractInstance) {
|
|
140
|
-
throw new Error(`No contract instance found for address: ${originalAddress.address}`);
|
|
141
|
-
}
|
|
142
|
-
const stubAccount = await this.accountContracts.createStubAccount(originalAddress);
|
|
143
|
-
const stubArtifact = await this.accountContracts.getStubAccountContractArtifact();
|
|
144
|
-
const instance = await getContractInstanceFromInstantiationParams(stubArtifact, {
|
|
145
|
-
salt: Fr.random(),
|
|
146
|
-
});
|
|
147
|
-
return {
|
|
148
|
-
account: stubAccount,
|
|
149
|
-
instance,
|
|
150
|
-
artifact: stubArtifact,
|
|
151
|
-
};
|
|
275
|
+
const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
|
|
276
|
+
return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
|
|
152
277
|
}
|
|
153
278
|
|
|
154
279
|
protected async createAccountInternal(
|
|
@@ -220,6 +345,10 @@ export class EmbeddedWallet extends BaseWallet {
|
|
|
220
345
|
this.minFeePadding = value ?? 0.5;
|
|
221
346
|
}
|
|
222
347
|
|
|
348
|
+
setEstimatedGasPadding(value?: number) {
|
|
349
|
+
this.estimatedGasPadding = value ?? DEFAULT_ESTIMATED_GAS_PADDING;
|
|
350
|
+
}
|
|
351
|
+
|
|
223
352
|
stop() {
|
|
224
353
|
return this.pxe.stop();
|
|
225
354
|
}
|
|
@@ -6,7 +6,7 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/config';
|
|
|
6
6
|
|
|
7
7
|
import { LazyAccountContractsProvider } from '../account-contract-providers/lazy.js';
|
|
8
8
|
import type { AccountContractsProvider } from '../account-contract-providers/types.js';
|
|
9
|
-
import { EmbeddedWallet, type EmbeddedWalletOptions } from '../embedded_wallet.js';
|
|
9
|
+
import { EmbeddedWallet, type EmbeddedWalletOptions, splitPxeOptions } from '../embedded_wallet.js';
|
|
10
10
|
import { WalletDB } from '../wallet_db.js';
|
|
11
11
|
|
|
12
12
|
export class BrowserEmbeddedWallet extends EmbeddedWallet {
|
|
@@ -26,10 +26,15 @@ export class BrowserEmbeddedWallet extends EmbeddedWallet {
|
|
|
26
26
|
const aztecNode = typeof nodeOrUrl === 'string' ? createAztecNodeClient(nodeOrUrl) : nodeOrUrl;
|
|
27
27
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
28
28
|
|
|
29
|
+
// Support both the new unified `pxe` option and the deprecated `pxeConfig`/`pxeOptions`.
|
|
30
|
+
const { config: pxeConfigFromPxe, creation: pxeCreationFromPxe } = splitPxeOptions(options.pxe);
|
|
31
|
+
const mergedConfigOverrides = { ...options.pxeConfig, ...pxeConfigFromPxe };
|
|
32
|
+
const mergedCreationOverrides: PXECreationOptions = { ...options.pxeOptions, ...pxeCreationFromPxe };
|
|
33
|
+
|
|
29
34
|
const pxeConfig: PXEConfig = Object.assign(getPXEConfig(), {
|
|
30
|
-
proverEnabled:
|
|
35
|
+
proverEnabled: mergedConfigOverrides.proverEnabled ?? false,
|
|
31
36
|
dataDirectory: `pxe_data_${l1Contracts.rollupAddress}`,
|
|
32
|
-
...
|
|
37
|
+
...mergedConfigOverrides,
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
if (options.ephemeral) {
|
|
@@ -37,12 +42,12 @@ export class BrowserEmbeddedWallet extends EmbeddedWallet {
|
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
const pxeOptions: PXECreationOptions = {
|
|
40
|
-
...
|
|
45
|
+
...mergedCreationOverrides,
|
|
41
46
|
loggers: {
|
|
42
47
|
store: rootLogger.createChild('pxe:data'),
|
|
43
48
|
pxe: rootLogger.createChild('pxe:service'),
|
|
44
49
|
prover: rootLogger.createChild('pxe:prover'),
|
|
45
|
-
...
|
|
50
|
+
...mergedCreationOverrides.loggers,
|
|
46
51
|
},
|
|
47
52
|
};
|
|
48
53
|
|
|
@@ -67,6 +72,6 @@ export class BrowserEmbeddedWallet extends EmbeddedWallet {
|
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
export { BrowserEmbeddedWallet as EmbeddedWallet };
|
|
70
|
-
export type { EmbeddedWalletOptions } from '../embedded_wallet.js';
|
|
75
|
+
export type { EmbeddedWalletOptions, EmbeddedWalletPXEOptions } from '../embedded_wallet.js';
|
|
71
76
|
export { WalletDB } from '../wallet_db.js';
|
|
72
77
|
export type { AccountType } from '../wallet_db.js';
|
|
@@ -7,7 +7,7 @@ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
|
7
7
|
|
|
8
8
|
import { BundleAccountContractsProvider } from '../account-contract-providers/bundle.js';
|
|
9
9
|
import type { AccountContractsProvider } from '../account-contract-providers/types.js';
|
|
10
|
-
import { EmbeddedWallet, type EmbeddedWalletOptions } from '../embedded_wallet.js';
|
|
10
|
+
import { EmbeddedWallet, type EmbeddedWalletOptions, splitPxeOptions } from '../embedded_wallet.js';
|
|
11
11
|
import { WalletDB } from '../wallet_db.js';
|
|
12
12
|
|
|
13
13
|
export class NodeEmbeddedWallet extends EmbeddedWallet {
|
|
@@ -27,10 +27,15 @@ export class NodeEmbeddedWallet extends EmbeddedWallet {
|
|
|
27
27
|
const aztecNode = typeof nodeOrUrl === 'string' ? createAztecNodeClient(nodeOrUrl) : nodeOrUrl;
|
|
28
28
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
29
29
|
|
|
30
|
+
// Support both the new unified `pxe` option and the deprecated `pxeConfig`/`pxeOptions`.
|
|
31
|
+
const { config: pxeConfigFromPxe, creation: pxeCreationFromPxe } = splitPxeOptions(options.pxe);
|
|
32
|
+
const mergedConfigOverrides = { ...options.pxeConfig, ...pxeConfigFromPxe };
|
|
33
|
+
const mergedCreationOverrides: PXECreationOptions = { ...options.pxeOptions, ...pxeCreationFromPxe };
|
|
34
|
+
|
|
30
35
|
const pxeConfig: PXEConfig = Object.assign(getPXEConfig(), {
|
|
31
|
-
proverEnabled:
|
|
36
|
+
proverEnabled: mergedConfigOverrides.proverEnabled ?? false,
|
|
32
37
|
dataDirectory: `pxe_data_${l1Contracts.rollupAddress}`,
|
|
33
|
-
...
|
|
38
|
+
...mergedConfigOverrides,
|
|
34
39
|
});
|
|
35
40
|
|
|
36
41
|
if (options.ephemeral) {
|
|
@@ -38,12 +43,12 @@ export class NodeEmbeddedWallet extends EmbeddedWallet {
|
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
const pxeOptions: PXECreationOptions = {
|
|
41
|
-
...
|
|
46
|
+
...mergedCreationOverrides,
|
|
42
47
|
loggers: {
|
|
43
48
|
store: rootLogger.createChild('pxe:data'),
|
|
44
49
|
pxe: rootLogger.createChild('pxe:service'),
|
|
45
50
|
prover: rootLogger.createChild('pxe:prover'),
|
|
46
|
-
...
|
|
51
|
+
...mergedCreationOverrides.loggers,
|
|
47
52
|
},
|
|
48
53
|
};
|
|
49
54
|
|
|
@@ -74,6 +79,6 @@ export class NodeEmbeddedWallet extends EmbeddedWallet {
|
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
export { NodeEmbeddedWallet as EmbeddedWallet };
|
|
77
|
-
export type { EmbeddedWalletOptions } from '../embedded_wallet.js';
|
|
82
|
+
export type { EmbeddedWalletOptions, EmbeddedWalletPXEOptions } from '../embedded_wallet.js';
|
|
78
83
|
export { WalletDB } from '../wallet_db.js';
|
|
79
84
|
export type { AccountType } from '../wallet_db.js';
|
package/src/testing.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import { getInitialTestAccountsData } from '@aztec/accounts/testing/lazy';
|
|
3
|
+
import { NO_FROM } from '@aztec/aztec.js/account';
|
|
3
4
|
import type { WaitOpts } from '@aztec/aztec.js/contracts';
|
|
4
5
|
import type { AccountManager } from '@aztec/aztec.js/wallet';
|
|
5
6
|
import type { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -21,7 +22,7 @@ export async function deployFundedSchnorrAccounts(
|
|
|
21
22
|
const accountManager = await wallet.createSchnorrAccount(secret, salt, signingKey);
|
|
22
23
|
const deployMethod = await accountManager.getDeployMethod();
|
|
23
24
|
await deployMethod.send({
|
|
24
|
-
from:
|
|
25
|
+
from: NO_FROM,
|
|
25
26
|
skipClassPublication: i !== 0,
|
|
26
27
|
wait: waitOptions,
|
|
27
28
|
});
|