@aztec/accounts 3.0.3 → 4.0.0-devnet.1-patch.0
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/artifacts/EcdsaKAccount.json +2937 -3256
- package/artifacts/EcdsaRAccount.json +2928 -3247
- package/artifacts/SchnorrAccount.json +2985 -3446
- package/artifacts/SchnorrSingleKeyAccount.json +2083 -2046
- package/artifacts/SimulatedAccount.json +1991 -2118
- 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/schnorr/lazy.d.ts +1 -1
- package/dest/schnorr/lazy.d.ts.map +1 -1
- package/dest/schnorr/lazy.js +3 -6
- package/dest/single_key/lazy.d.ts +1 -1
- package/dest/single_key/lazy.d.ts.map +1 -1
- package/dest/single_key/lazy.js +3 -6
- 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/package.json +8 -8
- package/src/defaults/account_contract.ts +9 -5
- package/src/defaults/index.ts +0 -1
- package/src/schnorr/lazy.ts +3 -4
- package/src/single_key/lazy.ts +3 -4
- package/src/stub/index.ts +7 -8
- package/src/stub/lazy.ts +10 -8
- package/dest/defaults/account_interface.d.ts +0 -28
- 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 -63
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Account, type AccountContract, type AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
4
|
/**
|
|
@@ -15,6 +15,6 @@ export declare abstract class DefaultAccountContract implements AccountContract
|
|
|
15
15
|
} | undefined>;
|
|
16
16
|
abstract getContractArtifact(): Promise<ContractArtifact>;
|
|
17
17
|
constructor();
|
|
18
|
-
|
|
18
|
+
getAccount(completeAddress: CompleteAddress): Account;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlZmF1bHRzL2FjY291bnRfY29udHJhY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFFLEtBQUssbUJBQW1CLEVBQWUsTUFBTSx5QkFBeUIsQ0FBQztBQUVwSCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzFELE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRTlEOzs7R0FHRztBQUNILDhCQUFzQixzQkFBdUIsWUFBVyxlQUFlO0lBQ3JFLFFBQVEsQ0FBQyxzQkFBc0IsQ0FBQyxPQUFPLEVBQUUsZUFBZSxHQUFHLG1CQUFtQixDQUFDO0lBQy9FLFFBQVEsQ0FBQyxnQ0FBZ0MsSUFBSSxPQUFPLENBQ2hEO1FBQ0UsK0RBQStEO1FBQy9ELGVBQWUsRUFBRSxNQUFNLENBQUM7UUFDeEIsK0RBQStEO1FBQy9ELGVBQWUsRUFBRSxHQUFHLEVBQUUsQ0FBQztLQUN4QixHQUNELFNBQVMsQ0FDWixDQUFDO0lBQ0YsUUFBUSxDQUFDLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0lBRTFELGNBQWdCO0lBRWhCLFVBQVUsQ0FBQyxlQUFlLEVBQUUsZUFBZSxHQUFHLE9BQU8sQ0FPcEQ7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/defaults/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/defaults/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAe,MAAM,yBAAyB,CAAC;AAEpH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,8BAAsB,sBAAuB,YAAW,eAAe;IACrE,QAAQ,CAAC,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC;IAC/E,QAAQ,CAAC,gCAAgC,IAAI,OAAO,CAChD;QACE,+DAA+D;QAC/D,eAAe,EAAE,MAAM,CAAC;QACxB,+DAA+D;QAC/D,eAAe,EAAE,GAAG,EAAE,CAAC;KACxB,GACD,SAAS,CACZ,CAAC;IACF,QAAQ,CAAC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE1D,cAAgB;IAEhB,UAAU,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAOpD;CACF"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
2
3
|
/**
|
|
3
4
|
* Base class for implementing an account contract. Requires that the account uses the
|
|
4
5
|
* default entrypoint method signature.
|
|
5
6
|
*/ export class DefaultAccountContract {
|
|
6
7
|
constructor(){}
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
getAccount(completeAddress) {
|
|
9
|
+
const authWitnessProvider = this.getAuthWitnessProvider(completeAddress);
|
|
10
|
+
return new BaseAccount(new DefaultAccountEntrypoint(completeAddress.address, authWitnessProvider), authWitnessProvider, completeAddress);
|
|
9
11
|
}
|
|
10
12
|
}
|
package/dest/defaults/index.d.ts
CHANGED
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
export * from './account_interface.js';
|
|
9
8
|
export * from './account_contract.js';
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWZhdWx0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxjQUFjLHVCQUF1QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/defaults/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/defaults/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,uBAAuB,CAAC"}
|
package/dest/defaults/index.js
CHANGED
|
@@ -4,5 +4,4 @@
|
|
|
4
4
|
* Read more in {@link https://docs.aztec.network/developers/tutorials/contract_tutorials/counter_contract | Writing an account contract}.
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
|
-
*/ export * from './
|
|
8
|
-
export * from './account_contract.js';
|
|
7
|
+
*/ export * from './account_contract.js';
|
package/dest/schnorr/lazy.d.ts
CHANGED
|
@@ -24,4 +24,4 @@ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
|
|
|
24
24
|
* @param signingPrivateKey - A specific signing private key that's not derived from the secret.
|
|
25
25
|
*/
|
|
26
26
|
export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjaG5vcnIvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFHaEUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFbkU7OztHQUdHO0FBQ0gsd0JBQXNCLGlDQUFpQyw4QkFRdEQ7QUFFRDs7OztHQUlHO0FBQ0gscUJBQWEsc0JBQXVCLFNBQVEsMEJBQTBCO0lBQ3BFLFlBQVksaUJBQWlCLEVBQUUsY0FBYyxFQUU1QztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBc0IsZ0NBQWdDLENBQ3BELE1BQU0sRUFBRSxFQUFFLEVBQ1YsSUFBSSxFQUFFLEVBQUUsRUFDUixpQkFBaUIsQ0FBQyxFQUFFLGNBQWMsR0FDakMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUl2QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iCAAiC,
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iCAAiC,8BAQtD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;IACpE,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
package/dest/schnorr/lazy.js
CHANGED
|
@@ -13,13 +13,10 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
13
13
|
*/ export async function getSchnorrAccountContractArtifact() {
|
|
14
14
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
15
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
-
// Even if now supported by
|
|
16
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
17
17
|
// "text/javascript"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type: 'json'
|
|
21
|
-
}
|
|
22
|
-
});
|
|
18
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
19
|
+
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
23
20
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
@@ -21,4 +21,4 @@ export declare class SingleKeyAccountContract extends SingleKeyBaseAccountContra
|
|
|
21
21
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
22
22
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NpbmdsZV9rZXkvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzdELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFHMUQsT0FBTyxFQUFFLDRCQUE0QixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFckU7OztHQUdHO0FBQ0gsd0JBQXNCLG1DQUFtQyw4QkFReEQ7QUFFRDs7OztHQUlHO0FBQ0gscUJBQWEsd0JBQXlCLFNBQVEsNEJBQTRCO0lBQ3hFLFlBQVksaUJBQWlCLEVBQUUsY0FBYyxFQUU1QztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/single_key/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;GAGG;AACH,wBAAsB,mCAAmC,
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/single_key/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;GAGG;AACH,wBAAsB,mCAAmC,8BAQxD;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,4BAA4B;IACxE,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF"}
|
package/dest/single_key/lazy.js
CHANGED
|
@@ -11,13 +11,10 @@ import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
|
11
11
|
*/ export async function getSingleKeyAccountContractArtifact() {
|
|
12
12
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
13
13
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
14
|
-
// Even if now supported by
|
|
14
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
15
15
|
// "text/javascript"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: 'json'
|
|
19
|
-
}
|
|
20
|
-
});
|
|
16
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
17
|
+
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
21
18
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
22
19
|
}
|
|
23
20
|
/**
|
package/dest/stub/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAccount
|
|
1
|
+
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
@@ -14,8 +14,7 @@ export declare class StubAccountContract extends StubBaseAccountContract {
|
|
|
14
14
|
/**
|
|
15
15
|
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
16
16
|
* @param originalAddress - The address of the account to stub
|
|
17
|
-
* @param chainInfo - The chain info that the account is connected to
|
|
18
17
|
* @returns A stub account that can be used for kernelless simulations
|
|
19
18
|
*/
|
|
20
|
-
export declare function createStubAccount(originalAddress: CompleteAddress
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
export declare function createStubAccount(originalAddress: CompleteAddress): BaseAccount;
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHViL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN0RCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBSzFELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRWhFLGVBQU8sTUFBTSwyQkFBMkIsa0JBQXlFLENBQUM7QUFFbEg7OztHQUdHO0FBQ0gscUJBQWEsbUJBQW9CLFNBQVEsdUJBQXVCO0lBQzlELGNBRUM7SUFFUSxtQkFBbUIsSUFBSSxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FFeEQ7Q0FDRjtBQUVEOzs7O0dBSUc7QUFDSCx3QkFBZ0IsaUJBQWlCLENBQUMsZUFBZSxFQUFFLGVBQWUsZUFRakUifQ==
|
package/dest/stub/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stub/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stub/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,eAAO,MAAM,2BAA2B,kBAAyE,CAAC;AAElH;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,cAEC;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,eAAe,eAQjE"}
|
package/dest/stub/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
2
3
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
3
4
|
import SimulatedAccountContract from '../../artifacts/SimulatedAccount.json' with {
|
|
4
5
|
type: 'json'
|
|
5
6
|
};
|
|
6
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
7
7
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
8
8
|
export const StubAccountContractArtifact = loadContractArtifact(SimulatedAccountContract);
|
|
9
9
|
/**
|
|
@@ -20,10 +20,9 @@ export const StubAccountContractArtifact = loadContractArtifact(SimulatedAccount
|
|
|
20
20
|
/**
|
|
21
21
|
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
22
22
|
* @param originalAddress - The address of the account to stub
|
|
23
|
-
* @param chainInfo - The chain info that the account is connected to
|
|
24
23
|
* @returns A stub account that can be used for kernelless simulations
|
|
25
|
-
*/ export function createStubAccount(originalAddress
|
|
24
|
+
*/ export function createStubAccount(originalAddress) {
|
|
26
25
|
const accountContract = new StubAccountContract();
|
|
27
|
-
const
|
|
28
|
-
return new BaseAccount(
|
|
26
|
+
const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
|
|
27
|
+
return new BaseAccount(new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider), authWitnessProvider, originalAddress);
|
|
29
28
|
}
|
package/dest/stub/lazy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseAccount
|
|
1
|
+
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
@@ -17,7 +17,9 @@ export declare class StubAccountContract extends StubBaseAccountContract {
|
|
|
17
17
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
21
|
+
* @param originalAddress - The address of the account to stub
|
|
22
|
+
* @returns A stub account that can be used for kernelless simulations
|
|
21
23
|
*/
|
|
22
|
-
export declare function createStubAccount(originalAddress: CompleteAddress
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
export declare function createStubAccount(originalAddress: CompleteAddress): BaseAccount;
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0dWIvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDdEQsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFakUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUcxRCxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVoRTs7O0dBR0c7QUFDSCx3QkFBc0IsOEJBQThCLDhCQVFuRDtBQUVEOzs7O0dBSUc7QUFDSCxxQkFBYSxtQkFBb0IsU0FBUSx1QkFBdUI7SUFDOUQsY0FFQztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7Ozs7R0FJRztBQUNILHdCQUFnQixpQkFBaUIsQ0FBQyxlQUFlLEVBQUUsZUFBZSxlQVFqRSJ9
|
package/dest/stub/lazy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/stub/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/stub/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;GAGG;AACH,wBAAsB,8BAA8B,8BAQnD;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,cAEC;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,eAAe,eAQjE"}
|
package/dest/stub/lazy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseAccount } from '@aztec/aztec.js/account';
|
|
2
|
+
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
2
3
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
3
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
4
4
|
import { StubBaseAccountContract } from './account_contract.js';
|
|
5
5
|
/**
|
|
6
6
|
* Lazily loads the contract artifact
|
|
@@ -27,9 +27,11 @@ import { StubBaseAccountContract } from './account_contract.js';
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
|
|
30
|
+
* Creates a stub account that impersonates the one with the provided originalAddress.
|
|
31
|
+
* @param originalAddress - The address of the account to stub
|
|
32
|
+
* @returns A stub account that can be used for kernelless simulations
|
|
33
|
+
*/ export function createStubAccount(originalAddress) {
|
|
32
34
|
const accountContract = new StubAccountContract();
|
|
33
|
-
const
|
|
34
|
-
return new BaseAccount(
|
|
35
|
+
const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
|
|
36
|
+
return new BaseAccount(new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider), authWitnessProvider, originalAddress);
|
|
35
37
|
}
|
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": "
|
|
5
|
+
"version": "4.0.0-devnet.1-patch.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
"./defaults": "./dest/defaults/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"generate": "yarn generate:noir-contracts",
|
|
37
37
|
"generate:noir-contracts": "./scripts/copy-contracts.sh",
|
|
38
38
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
39
|
-
"build:ts": "
|
|
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,18 +82,18 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@aztec/aztec.js": "
|
|
86
|
-
"@aztec/entrypoints": "
|
|
87
|
-
"@aztec/ethereum": "
|
|
88
|
-
"@aztec/foundation": "
|
|
89
|
-
"@aztec/stdlib": "
|
|
85
|
+
"@aztec/aztec.js": "4.0.0-devnet.1-patch.0",
|
|
86
|
+
"@aztec/entrypoints": "4.0.0-devnet.1-patch.0",
|
|
87
|
+
"@aztec/ethereum": "4.0.0-devnet.1-patch.0",
|
|
88
|
+
"@aztec/foundation": "4.0.0-devnet.1-patch.0",
|
|
89
|
+
"@aztec/stdlib": "4.0.0-devnet.1-patch.0",
|
|
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.
|
|
96
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
97
97
|
"jest": "^30.0.0",
|
|
98
98
|
"jest-mock-extended": "^4.0.0",
|
|
99
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
package/src/schnorr/lazy.ts
CHANGED
|
@@ -21,11 +21,10 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
21
21
|
export async function getSchnorrAccountContractArtifact() {
|
|
22
22
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
23
23
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
24
|
-
// Even if now supported by
|
|
24
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
25
25
|
// "text/javascript"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
26
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
27
|
+
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
29
28
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
30
29
|
}
|
|
31
30
|
|
package/src/single_key/lazy.ts
CHANGED
|
@@ -17,11 +17,10 @@ import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
|
17
17
|
export async function getSingleKeyAccountContractArtifact() {
|
|
18
18
|
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
19
19
|
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
20
|
-
// Even if now supported by
|
|
20
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
21
21
|
// "text/javascript"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
22
|
+
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
23
|
+
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
25
24
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
26
25
|
}
|
|
27
26
|
|
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,28 +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 { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
8
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
9
|
-
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
10
|
-
/**
|
|
11
|
-
* Default implementation for an account interface. Requires that the account uses the default
|
|
12
|
-
* entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
|
|
13
|
-
*/
|
|
14
|
-
export declare class DefaultAccountInterface implements AccountInterface {
|
|
15
|
-
private authWitnessProvider;
|
|
16
|
-
private address;
|
|
17
|
-
protected entrypoint: EntrypointInterface;
|
|
18
|
-
private chainId;
|
|
19
|
-
private version;
|
|
20
|
-
constructor(authWitnessProvider: AuthWitnessProvider, address: CompleteAddress, chainInfo: ChainInfo);
|
|
21
|
-
createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: DefaultAccountEntrypointOptions): Promise<TxExecutionRequest>;
|
|
22
|
-
createAuthWit(messageHash: Fr): Promise<AuthWitness>;
|
|
23
|
-
getCompleteAddress(): CompleteAddress;
|
|
24
|
-
getAddress(): AztecAddress;
|
|
25
|
-
getChainId(): Fr;
|
|
26
|
-
getVersion(): Fr;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9pbnRlcmZhY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWZhdWx0cy9hY2NvdW50X2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3JGLE9BQU8sRUFBNEIsS0FBSywrQkFBK0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQzVHLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ3BGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUM5RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU3RTs7O0dBR0c7QUFDSCxxQkFBYSx1QkFBd0IsWUFBVyxnQkFBZ0I7SUFPNUQsT0FBTyxDQUFDLG1CQUFtQjtJQUMzQixPQUFPLENBQUMsT0FBTztJQVBqQixTQUFTLENBQUMsVUFBVSxFQUFFLG1CQUFtQixDQUFDO0lBRTFDLE9BQU8sQ0FBQyxPQUFPLENBQUs7SUFDcEIsT0FBTyxDQUFDLE9BQU8sQ0FBSztJQUVwQixZQUNVLG1CQUFtQixFQUFFLG1CQUFtQixFQUN4QyxPQUFPLEVBQUUsZUFBZSxFQUNoQyxTQUFTLEVBQUUsU0FBUyxFQVVyQjtJQUVELHdCQUF3QixDQUN0QixJQUFJLEVBQUUsZ0JBQWdCLEVBQ3RCLFdBQVcsRUFBRSxXQUFXLEVBQ3hCLE9BQU8sRUFBRSwrQkFBK0IsR0FDdkMsT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBRTdCO0lBRUQsYUFBYSxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUVuRDtJQUVELGtCQUFrQixJQUFJLGVBQWUsQ0FFcEM7SUFFRCxVQUFVLElBQUksWUFBWSxDQUV6QjtJQUVELFVBQVUsSUFBSSxFQUFFLENBRWY7SUFFRCxVQUFVLElBQUksRUFBRSxDQUVmO0NBQ0YifQ==
|
|
@@ -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,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,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,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE7E;;;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;IAEpB,YACU,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EAUrB;IAED,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,kBAAkB,CAAC,CAE7B;IAED,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAEnD;IAED,kBAAkB,IAAI,eAAe,CAEpC;IAED,UAAU,IAAI,YAAY,CAEzB;IAED,UAAU,IAAI,EAAE,CAEf;IAED,UAAU,IAAI,EAAE,CAEf;CACF"}
|
|
@@ -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,63 +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 { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
6
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
8
|
-
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
9
|
-
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
10
|
-
|
|
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 class DefaultAccountInterface implements AccountInterface {
|
|
16
|
-
protected entrypoint: EntrypointInterface;
|
|
17
|
-
|
|
18
|
-
private chainId: Fr;
|
|
19
|
-
private version: Fr;
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
private authWitnessProvider: AuthWitnessProvider,
|
|
23
|
-
private address: CompleteAddress,
|
|
24
|
-
chainInfo: ChainInfo,
|
|
25
|
-
) {
|
|
26
|
-
this.entrypoint = new DefaultAccountEntrypoint(
|
|
27
|
-
address.address,
|
|
28
|
-
authWitnessProvider,
|
|
29
|
-
chainInfo.chainId.toNumber(),
|
|
30
|
-
chainInfo.version.toNumber(),
|
|
31
|
-
);
|
|
32
|
-
this.chainId = chainInfo.chainId;
|
|
33
|
-
this.version = chainInfo.version;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
createTxExecutionRequest(
|
|
37
|
-
exec: ExecutionPayload,
|
|
38
|
-
gasSettings: GasSettings,
|
|
39
|
-
options: DefaultAccountEntrypointOptions,
|
|
40
|
-
): Promise<TxExecutionRequest> {
|
|
41
|
-
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
createAuthWit(messageHash: Fr): Promise<AuthWitness> {
|
|
45
|
-
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
getCompleteAddress(): CompleteAddress {
|
|
49
|
-
return this.address;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
getAddress(): AztecAddress {
|
|
53
|
-
return this.address.address;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
getChainId(): Fr {
|
|
57
|
-
return this.chainId;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
getVersion(): Fr {
|
|
61
|
-
return this.version;
|
|
62
|
-
}
|
|
63
|
-
}
|