@aztec/accounts 0.0.1-commit.24de95ac → 0.0.1-commit.2e2504e2
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/README.md +1 -1
- package/artifacts/EcdsaKAccount.json +3480 -3580
- package/artifacts/EcdsaRAccount.json +3482 -3582
- package/artifacts/SchnorrAccount.json +3188 -3454
- package/artifacts/SchnorrSingleKeyAccount.json +2331 -2173
- package/artifacts/SimulatedAccount.json +2233 -2231
- package/dest/defaults/account_contract.d.ts +3 -3
- package/dest/defaults/account_contract.d.ts.map +1 -1
- package/dest/defaults/account_contract.js +5 -3
- package/dest/defaults/index.d.ts +1 -2
- package/dest/defaults/index.d.ts.map +1 -1
- package/dest/defaults/index.js +1 -2
- package/dest/ecdsa/ecdsa_k/account_contract.d.ts +1 -1
- package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/account_contract.js +1 -1
- package/dest/ecdsa/ecdsa_k/index.d.ts +1 -1
- package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -1
- package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/account_contract.d.ts +1 -1
- package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/account_contract.js +1 -1
- package/dest/ecdsa/ecdsa_r/index.d.ts +1 -1
- package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -1
- package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/index.d.ts +1 -1
- package/dest/ecdsa/lazy.d.ts +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/schnorr/account_contract.d.ts +3 -2
- package/dest/schnorr/account_contract.d.ts.map +1 -1
- package/dest/schnorr/account_contract.js +1 -1
- package/dest/schnorr/index.d.ts +3 -2
- package/dest/schnorr/index.d.ts.map +1 -1
- package/dest/schnorr/lazy.d.ts +3 -2
- package/dest/schnorr/lazy.d.ts.map +1 -1
- package/dest/single_key/account_contract.d.ts +2 -2
- package/dest/single_key/account_contract.d.ts.map +1 -1
- package/dest/single_key/account_contract.js +1 -1
- package/dest/single_key/index.d.ts +1 -1
- package/dest/single_key/index.d.ts.map +1 -1
- package/dest/single_key/lazy.d.ts +1 -1
- package/dest/single_key/lazy.d.ts.map +1 -1
- package/dest/stub/account_contract.d.ts +2 -2
- package/dest/stub/account_contract.d.ts.map +1 -1
- package/dest/stub/index.d.ts +3 -4
- package/dest/stub/index.d.ts.map +1 -1
- package/dest/stub/index.js +4 -5
- package/dest/stub/lazy.d.ts +6 -4
- package/dest/stub/lazy.d.ts.map +1 -1
- package/dest/stub/lazy.js +7 -5
- package/dest/testing/configuration.d.ts +5 -4
- package/dest/testing/configuration.d.ts.map +1 -1
- package/dest/testing/configuration.js +1 -1
- package/dest/testing/index.d.ts +1 -1
- package/dest/testing/index.js +1 -1
- package/dest/testing/lazy.d.ts +1 -1
- package/dest/testing/lazy.js +1 -1
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/ssh_agent.d.ts +1 -1
- package/package.json +10 -9
- package/src/defaults/account_contract.ts +9 -5
- package/src/defaults/index.ts +0 -1
- package/src/ecdsa/ecdsa_k/account_contract.ts +2 -2
- package/src/ecdsa/ecdsa_r/account_contract.ts +2 -2
- package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +2 -2
- package/src/schnorr/account_contract.ts +3 -2
- package/src/schnorr/index.ts +2 -1
- package/src/schnorr/lazy.ts +2 -1
- package/src/single_key/account_contract.ts +3 -2
- package/src/stub/account_contract.ts +1 -1
- package/src/stub/index.ts +7 -8
- package/src/stub/lazy.ts +10 -8
- package/src/testing/configuration.ts +2 -1
- package/src/testing/index.ts +1 -1
- package/src/testing/lazy.ts +1 -1
- package/dest/defaults/account_interface.d.ts +0 -29
- package/dest/defaults/account_interface.d.ts.map +0 -1
- package/dest/defaults/account_interface.js +0 -36
- package/src/defaults/account_interface.ts +0 -64
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aztec/accounts",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/accounts",
|
|
4
4
|
"description": "Implementation of sample account contracts for Aztec Network",
|
|
5
|
-
"version": "0.0.1-commit.
|
|
5
|
+
"version": "0.0.1-commit.2e2504e2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
"./defaults": "./dest/defaults/index.js",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"tsconfig": "./tsconfig.json"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "yarn clean && yarn generate && tsc
|
|
35
|
+
"build": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
36
36
|
"generate": "yarn generate:noir-contracts",
|
|
37
37
|
"generate:noir-contracts": "./scripts/copy-contracts.sh",
|
|
38
|
-
"build:dev": "tsc
|
|
39
|
-
"build:ts": "tsc
|
|
38
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
39
|
+
"build:ts": "../scripts/tsc.sh",
|
|
40
40
|
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts",
|
|
41
41
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
42
42
|
},
|
|
@@ -82,17 +82,18 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
86
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
87
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
88
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
89
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
85
|
+
"@aztec/aztec.js": "0.0.1-commit.2e2504e2",
|
|
86
|
+
"@aztec/entrypoints": "0.0.1-commit.2e2504e2",
|
|
87
|
+
"@aztec/ethereum": "0.0.1-commit.2e2504e2",
|
|
88
|
+
"@aztec/foundation": "0.0.1-commit.2e2504e2",
|
|
89
|
+
"@aztec/stdlib": "0.0.1-commit.2e2504e2",
|
|
90
90
|
"tslib": "^2.4.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@jest/globals": "^30.0.0",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/node": "^22.15.17",
|
|
96
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
96
97
|
"jest": "^30.0.0",
|
|
97
98
|
"jest-mock-extended": "^4.0.0",
|
|
98
99
|
"ts-loader": "^9.5.4",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Account, type AccountContract, type AuthWitnessProvider, BaseAccount } from '@aztec/aztec.js/account';
|
|
2
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
2
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
4
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
5
|
|
|
5
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* Base class for implementing an account contract. Requires that the account uses the
|
|
9
8
|
* default entrypoint method signature.
|
|
@@ -23,7 +22,12 @@ export abstract class DefaultAccountContract implements AccountContract {
|
|
|
23
22
|
|
|
24
23
|
constructor() {}
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
getAccount(completeAddress: CompleteAddress): Account {
|
|
26
|
+
const authWitnessProvider = this.getAuthWitnessProvider(completeAddress);
|
|
27
|
+
return new BaseAccount(
|
|
28
|
+
new DefaultAccountEntrypoint(completeAddress.address, authWitnessProvider),
|
|
29
|
+
authWitnessProvider,
|
|
30
|
+
completeAddress,
|
|
31
|
+
);
|
|
28
32
|
}
|
|
29
33
|
}
|
package/src/defaults/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Ecdsa } from '@aztec/foundation/crypto';
|
|
3
|
-
import type { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Ecdsa } from '@aztec/foundation/crypto/ecdsa';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
5
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Ecdsa } from '@aztec/foundation/crypto';
|
|
3
|
-
import type { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Ecdsa } from '@aztec/foundation/crypto/ecdsa';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
5
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { EcdsaSignature } from '@aztec/foundation/crypto';
|
|
3
|
-
import type { Fr } from '@aztec/foundation/
|
|
2
|
+
import { EcdsaSignature } from '@aztec/foundation/crypto/ecdsa';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
5
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Schnorr } from '@aztec/foundation/crypto';
|
|
3
|
-
import { Fr
|
|
2
|
+
import { Schnorr } from '@aztec/foundation/crypto/schnorr';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
4
5
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
6
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
|
package/src/schnorr/index.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
8
|
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
9
|
-
import { Fr
|
|
9
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
10
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
10
11
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
12
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
12
13
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
package/src/schnorr/lazy.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
|
-
import { Fr
|
|
8
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
9
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
9
10
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
10
11
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
11
12
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Schnorr } from '@aztec/foundation/crypto';
|
|
3
|
-
import {
|
|
2
|
+
import { Schnorr } from '@aztec/foundation/crypto/schnorr';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
4
5
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
6
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
4
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
|
package/src/stub/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BaseAccount
|
|
1
|
+
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
3
4
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
5
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
5
6
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
6
7
|
|
|
7
8
|
import SimulatedAccountContract from '../../artifacts/SimulatedAccount.json' with { type: 'json' };
|
|
8
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
9
9
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
10
10
|
|
|
11
11
|
export const StubAccountContractArtifact = loadContractArtifact(SimulatedAccountContract as NoirCompiledContract);
|
|
@@ -27,15 +27,14 @@ export class StubAccountContract extends StubBaseAccountContract {
|
|
|
27
27
|
/**
|
|
28
28
|
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
29
29
|
* @param originalAddress - The address of the account to stub
|
|
30
|
-
* @param chainInfo - The chain info that the account is connected to
|
|
31
30
|
* @returns A stub account that can be used for kernelless simulations
|
|
32
31
|
*/
|
|
33
|
-
export function createStubAccount(originalAddress: CompleteAddress
|
|
32
|
+
export function createStubAccount(originalAddress: CompleteAddress) {
|
|
34
33
|
const accountContract = new StubAccountContract();
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
|
|
35
|
+
return new BaseAccount(
|
|
36
|
+
new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
|
|
37
|
+
authWitnessProvider,
|
|
37
38
|
originalAddress,
|
|
38
|
-
chainInfo,
|
|
39
39
|
);
|
|
40
|
-
return new BaseAccount(accountInterface);
|
|
41
40
|
}
|
package/src/stub/lazy.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseAccount
|
|
1
|
+
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
3
4
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
5
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
5
6
|
|
|
6
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
7
7
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -36,14 +36,16 @@ export class StubAccountContract extends StubBaseAccountContract {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
40
|
+
* @param originalAddress - The address of the account to stub
|
|
41
|
+
* @returns A stub account that can be used for kernelless simulations
|
|
40
42
|
*/
|
|
41
|
-
export function createStubAccount(originalAddress: CompleteAddress
|
|
43
|
+
export function createStubAccount(originalAddress: CompleteAddress) {
|
|
42
44
|
const accountContract = new StubAccountContract();
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
+
const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
|
|
46
|
+
return new BaseAccount(
|
|
47
|
+
new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
|
|
48
|
+
authWitnessProvider,
|
|
45
49
|
originalAddress,
|
|
46
|
-
chainInfo,
|
|
47
50
|
);
|
|
48
|
-
return new BaseAccount(accountInterface);
|
|
49
51
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Fr
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
2
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
4
5
|
|
package/src/testing/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a
|
|
2
|
+
* The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a local network environment.
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
package/src/testing/lazy.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a
|
|
2
|
+
* The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a local network environment.
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
3
|
-
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
4
|
-
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
7
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
9
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
10
|
-
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
11
|
-
/**
|
|
12
|
-
* Default implementation for an account interface. Requires that the account uses the default
|
|
13
|
-
* entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
|
|
14
|
-
*/
|
|
15
|
-
export declare class DefaultAccountInterface implements AccountInterface {
|
|
16
|
-
private authWitnessProvider;
|
|
17
|
-
private address;
|
|
18
|
-
protected entrypoint: EntrypointInterface;
|
|
19
|
-
private chainId;
|
|
20
|
-
private version;
|
|
21
|
-
constructor(authWitnessProvider: AuthWitnessProvider, address: CompleteAddress, chainInfo: ChainInfo);
|
|
22
|
-
createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: DefaultAccountEntrypointOptions): Promise<TxExecutionRequest>;
|
|
23
|
-
createAuthWit(messageHash: Fr): Promise<AuthWitness>;
|
|
24
|
-
getCompleteAddress(): CompleteAddress;
|
|
25
|
-
getAddress(): AztecAddress;
|
|
26
|
-
getChainId(): Fr;
|
|
27
|
-
getVersion(): Fr;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=account_interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account_interface.d.ts","sourceRoot":"","sources":["../../src/defaults/account_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAA4B,KAAK,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAO5D,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,OAAO;IAPjB,SAAS,CAAC,UAAU,EAAE,mBAAmB,CAAC;IAE1C,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;gBAGV,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS;IAYtB,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,kBAAkB,CAAC;IAI9B,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAIpD,kBAAkB,IAAI,eAAe;IAIrC,UAAU,IAAI,YAAY;IAI1B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;CAGjB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
2
|
-
/**
|
|
3
|
-
* Default implementation for an account interface. Requires that the account uses the default
|
|
4
|
-
* entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
|
|
5
|
-
*/ export class DefaultAccountInterface {
|
|
6
|
-
authWitnessProvider;
|
|
7
|
-
address;
|
|
8
|
-
entrypoint;
|
|
9
|
-
chainId;
|
|
10
|
-
version;
|
|
11
|
-
constructor(authWitnessProvider, address, chainInfo){
|
|
12
|
-
this.authWitnessProvider = authWitnessProvider;
|
|
13
|
-
this.address = address;
|
|
14
|
-
this.entrypoint = new DefaultAccountEntrypoint(address.address, authWitnessProvider, chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
|
|
15
|
-
this.chainId = chainInfo.chainId;
|
|
16
|
-
this.version = chainInfo.version;
|
|
17
|
-
}
|
|
18
|
-
createTxExecutionRequest(exec, gasSettings, options) {
|
|
19
|
-
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
|
|
20
|
-
}
|
|
21
|
-
createAuthWit(messageHash) {
|
|
22
|
-
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
23
|
-
}
|
|
24
|
-
getCompleteAddress() {
|
|
25
|
-
return this.address;
|
|
26
|
-
}
|
|
27
|
-
getAddress() {
|
|
28
|
-
return this.address.address;
|
|
29
|
-
}
|
|
30
|
-
getChainId() {
|
|
31
|
-
return this.chainId;
|
|
32
|
-
}
|
|
33
|
-
getVersion() {
|
|
34
|
-
return this.version;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { DefaultAccountEntrypoint, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
3
|
-
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
4
|
-
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
7
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
9
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
10
|
-
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Default implementation for an account interface. Requires that the account uses the default
|
|
14
|
-
* entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
|
|
15
|
-
*/
|
|
16
|
-
export class DefaultAccountInterface implements AccountInterface {
|
|
17
|
-
protected entrypoint: EntrypointInterface;
|
|
18
|
-
|
|
19
|
-
private chainId: Fr;
|
|
20
|
-
private version: Fr;
|
|
21
|
-
|
|
22
|
-
constructor(
|
|
23
|
-
private authWitnessProvider: AuthWitnessProvider,
|
|
24
|
-
private address: CompleteAddress,
|
|
25
|
-
chainInfo: ChainInfo,
|
|
26
|
-
) {
|
|
27
|
-
this.entrypoint = new DefaultAccountEntrypoint(
|
|
28
|
-
address.address,
|
|
29
|
-
authWitnessProvider,
|
|
30
|
-
chainInfo.chainId.toNumber(),
|
|
31
|
-
chainInfo.version.toNumber(),
|
|
32
|
-
);
|
|
33
|
-
this.chainId = chainInfo.chainId;
|
|
34
|
-
this.version = chainInfo.version;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
createTxExecutionRequest(
|
|
38
|
-
exec: ExecutionPayload,
|
|
39
|
-
gasSettings: GasSettings,
|
|
40
|
-
options: DefaultAccountEntrypointOptions,
|
|
41
|
-
): Promise<TxExecutionRequest> {
|
|
42
|
-
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
createAuthWit(messageHash: Fr): Promise<AuthWitness> {
|
|
46
|
-
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
getCompleteAddress(): CompleteAddress {
|
|
50
|
-
return this.address;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
getAddress(): AztecAddress {
|
|
54
|
-
return this.address.address;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
getChainId(): Fr {
|
|
58
|
-
return this.chainId;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
getVersion(): Fr {
|
|
62
|
-
return this.version;
|
|
63
|
-
}
|
|
64
|
-
}
|