@aztec/accounts 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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 +3200 -3634
- package/artifacts/EcdsaRAccount.json +3200 -3634
- package/artifacts/SchnorrAccount.json +3215 -3822
- package/artifacts/SchnorrSingleKeyAccount.json +2555 -2634
- package/artifacts/SimulatedAccount.json +2108 -2330
- package/dest/defaults/account_contract.d.ts +4 -4
- package/dest/defaults/account_contract.d.ts.map +1 -1
- package/dest/defaults/account_contract.js +2 -2
- package/dest/defaults/account_interface.d.ts +8 -8
- package/dest/defaults/account_interface.d.ts.map +1 -1
- package/dest/defaults/account_interface.js +6 -7
- package/dest/defaults/index.d.ts +2 -2
- package/dest/defaults/index.js +1 -1
- 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 -23
- package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/index.js +1 -22
- package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -23
- package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/lazy.js +5 -26
- 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 -23
- package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/index.js +1 -22
- package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -23
- package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/lazy.js +5 -26
- 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 +2 -24
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/index.js +3 -24
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +2 -24
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/lazy.js +3 -24
- 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 +4 -38
- package/dest/schnorr/index.d.ts.map +1 -1
- package/dest/schnorr/index.js +1 -32
- package/dest/schnorr/lazy.d.ts +4 -38
- package/dest/schnorr/lazy.d.ts.map +1 -1
- package/dest/schnorr/lazy.js +5 -36
- 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 +2 -21
- package/dest/single_key/index.d.ts.map +1 -1
- package/dest/single_key/index.js +1 -23
- package/dest/single_key/lazy.d.ts +2 -21
- package/dest/single_key/lazy.d.ts.map +1 -1
- package/dest/single_key/lazy.js +5 -27
- package/dest/stub/account_contract.d.ts +29 -0
- package/dest/stub/account_contract.d.ts.map +1 -0
- package/dest/stub/account_contract.js +30 -0
- package/dest/stub/index.d.ts +21 -0
- package/dest/stub/index.d.ts.map +1 -0
- package/dest/stub/index.js +29 -0
- package/dest/stub/lazy.d.ts +23 -0
- package/dest/stub/lazy.d.ts.map +1 -0
- package/dest/stub/lazy.js +35 -0
- 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 +6 -36
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +19 -35
- package/dest/testing/lazy.d.ts +5 -28
- package/dest/testing/lazy.d.ts.map +1 -1
- package/dest/testing/lazy.js +19 -30
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/ssh_agent.d.ts +1 -1
- package/package.json +13 -10
- package/src/defaults/account_contract.ts +4 -4
- package/src/defaults/account_interface.ts +13 -14
- package/src/defaults/index.ts +1 -1
- package/src/ecdsa/ecdsa_k/account_contract.ts +2 -2
- package/src/ecdsa/ecdsa_k/index.ts +0 -32
- package/src/ecdsa/ecdsa_k/lazy.ts +4 -36
- package/src/ecdsa/ecdsa_r/account_contract.ts +2 -2
- package/src/ecdsa/ecdsa_r/index.ts +0 -32
- package/src/ecdsa/ecdsa_r/lazy.ts +4 -36
- package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +2 -2
- package/src/ecdsa/ssh_ecdsa_r/index.ts +2 -35
- package/src/ecdsa/ssh_ecdsa_r/lazy.ts +2 -35
- package/src/schnorr/account_contract.ts +3 -2
- package/src/schnorr/index.ts +9 -56
- package/src/schnorr/lazy.ts +13 -60
- package/src/single_key/account_contract.ts +3 -2
- package/src/single_key/index.ts +1 -32
- package/src/single_key/lazy.ts +5 -36
- package/src/stub/account_contract.ts +39 -0
- package/src/stub/index.ts +41 -0
- package/src/stub/lazy.ts +49 -0
- package/src/testing/configuration.ts +2 -1
- package/src/testing/index.ts +20 -57
- package/src/testing/lazy.ts +18 -50
- package/dest/copy_cat/base.d.ts +0 -18
- package/dest/copy_cat/base.d.ts.map +0 -1
- package/dest/copy_cat/base.js +0 -28
- package/dest/copy_cat/index.d.ts +0 -10
- package/dest/copy_cat/index.d.ts.map +0 -1
- package/dest/copy_cat/index.js +0 -31
- package/dest/copy_cat/lazy.d.ts +0 -9
- package/dest/copy_cat/lazy.d.ts.map +0 -1
- package/dest/copy_cat/lazy.js +0 -29
- package/dest/testing/create_account.d.ts +0 -43
- package/dest/testing/create_account.d.ts.map +0 -1
- package/dest/testing/create_account.js +0 -61
- package/src/copy_cat/base.ts +0 -47
- package/src/copy_cat/index.ts +0 -44
- package/src/copy_cat/lazy.ts +0 -40
- package/src/testing/create_account.ts +0 -111
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* Consider using this account type when working with integrations with Ethereum wallets.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { EcdsaRAccountContractArtifact } from '../ecdsa_r/index.js';
|
|
6
|
+
*/ import { EcdsaRAccountContractArtifact } from '../ecdsa_r/index.js';
|
|
9
7
|
import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
10
8
|
/**
|
|
11
9
|
* Account contract that authenticates transactions using ECDSA signatures
|
|
@@ -15,29 +13,10 @@ import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
|
15
13
|
* that will be used to sign authwitnesses.
|
|
16
14
|
* Eagerly loads the contract artifact
|
|
17
15
|
*/ export class EcdsaRSSHAccountContract extends EcdsaRSSHBaseAccountContract {
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
16
|
+
constructor(signingPublicKey){
|
|
17
|
+
super(signingPublicKey);
|
|
20
18
|
}
|
|
21
19
|
getContractArtifact() {
|
|
22
20
|
return Promise.resolve(EcdsaRAccountContractArtifact);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
27
|
-
* @param pxe - An PXE server instance.
|
|
28
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
29
|
-
* @param signingPublicKey - Secp2561 key used to identify its corresponding private key in the SSH Agent.
|
|
30
|
-
* @param salt - Deployment salt.
|
|
31
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
32
|
-
*/ export function getEcdsaRSSHAccount(pxe, secretKey, signingPublicKey, salt) {
|
|
33
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRSSHAccountContract(signingPublicKey), salt);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param address - Address for the account.
|
|
39
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
40
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
41
|
-
*/ export function getEcdsaRSSHWallet(pxe, address, signingPublicKey) {
|
|
42
|
-
return getWallet(pxe, address, new EcdsaRSSHAccountContract(signingPublicKey));
|
|
43
|
-
}
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
13
8
|
import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
14
9
|
/**
|
|
15
10
|
* Account contract that authenticates transactions using ECDSA signatures
|
|
@@ -20,24 +15,7 @@ import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
|
20
15
|
* Lazily loads the contract artifact
|
|
21
16
|
*/
|
|
22
17
|
export declare class EcdsaRSSHAccountContract extends EcdsaRSSHBaseAccountContract {
|
|
23
|
-
constructor(
|
|
18
|
+
constructor(signingPublicKey: Buffer);
|
|
24
19
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
28
|
-
* @param pxe - An PXE server instance.
|
|
29
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
30
|
-
* @param signingPublicKey - Secp2561 key used to identify its corresponding private key in the SSH Agent.
|
|
31
|
-
* @param salt - Deployment salt.
|
|
32
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
33
|
-
*/
|
|
34
|
-
export declare function getEcdsaRSSHAccount(pxe: PXE, secretKey: Fr, signingPublicKey: Buffer, salt?: Salt): Promise<AccountManager>;
|
|
35
|
-
/**
|
|
36
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param address - Address for the account.
|
|
39
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
40
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPublicKey: Buffer): Promise<AccountWallet>;
|
|
43
|
-
//# sourceMappingURL=lazy.d.ts.map
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2VjZHNhL3NzaF9lY2RzYV9yL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0dBS0c7QUFDSCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRzFELE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRXJFOzs7Ozs7O0dBT0c7QUFDSCxxQkFBYSx3QkFBeUIsU0FBUSw0QkFBNEI7SUFDeEUsWUFBWSxnQkFBZ0IsRUFBRSxNQUFNLEVBRW5DO0lBRVEsbUJBQW1CLElBQUksT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBRXhEO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/ecdsa/ssh_ecdsa_r/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/ecdsa/ssh_ecdsa_r/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;;GAOG;AACH,qBAAa,wBAAyB,SAAQ,4BAA4B;IACxE,YAAY,gBAAgB,EAAE,MAAM,EAEnC;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* Consider using this account type when working with integrations with Ethereum wallets.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { getEcdsaRAccountContractArtifact } from '../ecdsa_r/lazy.js';
|
|
6
|
+
*/ import { getEcdsaRAccountContractArtifact } from '../ecdsa_r/lazy.js';
|
|
9
7
|
import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
10
8
|
/**
|
|
11
9
|
* Account contract that authenticates transactions using ECDSA signatures
|
|
@@ -15,29 +13,10 @@ import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
|
15
13
|
* that will be used to sign authwitnesses.
|
|
16
14
|
* Lazily loads the contract artifact
|
|
17
15
|
*/ export class EcdsaRSSHAccountContract extends EcdsaRSSHBaseAccountContract {
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
16
|
+
constructor(signingPublicKey){
|
|
17
|
+
super(signingPublicKey);
|
|
20
18
|
}
|
|
21
19
|
getContractArtifact() {
|
|
22
20
|
return getEcdsaRAccountContractArtifact();
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
27
|
-
* @param pxe - An PXE server instance.
|
|
28
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
29
|
-
* @param signingPublicKey - Secp2561 key used to identify its corresponding private key in the SSH Agent.
|
|
30
|
-
* @param salt - Deployment salt.
|
|
31
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
32
|
-
*/ export function getEcdsaRSSHAccount(pxe, secretKey, signingPublicKey, salt) {
|
|
33
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRSSHAccountContract(signingPublicKey), salt);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param address - Address for the account.
|
|
39
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
40
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
41
|
-
*/ export function getEcdsaRSSHWallet(pxe, address, signingPublicKey) {
|
|
42
|
-
return getWallet(pxe, address, new EcdsaRSSHAccountContract(signingPublicKey));
|
|
43
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { Fr
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
3
4
|
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
5
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
6
|
import { DefaultAccountContract } from '../defaults/account_contract.js';
|
|
@@ -24,4 +25,4 @@ export declare class SchnorrAuthWitnessProvider implements AuthWitnessProvider {
|
|
|
24
25
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
25
26
|
createAuthWit(messageHash: Fr): Promise<AuthWitness>;
|
|
26
27
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjaG5vcnIvYWNjb3VudF9jb250cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRW5FLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDbkUsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3pELE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUV6RCxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUV6RTs7Ozs7R0FLRztBQUNILDhCQUFzQiwwQkFBMkIsU0FBUSxzQkFBc0I7SUFDakUsT0FBTyxDQUFDLGlCQUFpQjtJQUFyQyxZQUFvQixpQkFBaUIsRUFBRSxjQUFjLEVBRXBEO0lBRUssZ0NBQWdDOzs7T0FHckM7SUFFRCxzQkFBc0IsQ0FBQyxRQUFRLEVBQUUsZUFBZSxHQUFHLG1CQUFtQixDQUVyRTtDQUNGO0FBRUQsdURBQXVEO0FBQ3ZELHFCQUFhLDBCQUEyQixZQUFXLG1CQUFtQjtJQUN4RCxPQUFPLENBQUMsaUJBQWlCO0lBQXJDLFlBQW9CLGlCQUFpQixFQUFFLGNBQWMsRUFBSTtJQUVuRCxhQUFhLENBQUMsV0FBVyxFQUFFLEVBQUUsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBSXpEO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/schnorr/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/schnorr/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE;;;;;GAKG;AACH,8BAAsB,0BAA2B,SAAQ,sBAAsB;IACjE,OAAO,CAAC,iBAAiB;IAArC,YAAoB,iBAAiB,EAAE,cAAc,EAEpD;IAEK,gCAAgC;;;OAGrC;IAED,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB,CAErE;CACF;AAED,uDAAuD;AACvD,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,iBAAiB;IAArC,YAAoB,iBAAiB,EAAE,cAAc,EAAI;IAEnD,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAIzD;CACF"}
|
package/dest/schnorr/index.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
10
4
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
13
5
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
14
6
|
export declare const SchnorrAccountContractArtifact: ContractArtifact;
|
|
15
7
|
/**
|
|
@@ -21,32 +13,6 @@ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
|
|
|
21
13
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
22
14
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
23
15
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
26
|
-
* @param pxe - An PXE server instance.
|
|
27
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
28
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
29
|
-
* @param salt - Deployment salt.
|
|
30
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
31
|
-
*/
|
|
32
|
-
export declare function getSchnorrAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt?: Salt): Promise<AccountManager>;
|
|
33
|
-
/**
|
|
34
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
35
|
-
* @param pxe - An PXE server instance.
|
|
36
|
-
* @param address - Address for the account.
|
|
37
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
38
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
39
|
-
*/
|
|
40
|
-
export declare function getSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
41
|
-
/**
|
|
42
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
43
|
-
* @param pxe - An PXE server instance.
|
|
44
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
45
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
46
|
-
* @param salt - Deployment salt.
|
|
47
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
48
|
-
*/
|
|
49
|
-
export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt: Salt): Promise<AccountWalletWithSecretKey>;
|
|
50
16
|
/**
|
|
51
17
|
* Compute the address of a schnorr account contract.
|
|
52
18
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -54,4 +20,4 @@ export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, s
|
|
|
54
20
|
* @param signingPrivateKey - A specific signing private key that's not derived from the secret.
|
|
55
21
|
*/
|
|
56
22
|
export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
|
|
57
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hub3JyL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDbkUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQU0xRCxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVuRSxlQUFPLE1BQU0sOEJBQThCLGtCQUEyRSxDQUFDO0FBRXZIOzs7O0dBSUc7QUFDSCxxQkFBYSxzQkFBdUIsU0FBUSwwQkFBMEI7SUFDcEUsWUFBWSxpQkFBaUIsRUFBRSxjQUFjLEVBRTVDO0lBRVEsbUJBQW1CLElBQUksT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBRXhEO0NBQ0Y7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFzQixnQ0FBZ0MsQ0FDcEQsTUFBTSxFQUFFLEVBQUUsRUFDVixJQUFJLEVBQUUsRUFBRSxFQUNSLGlCQUFpQixDQUFDLEVBQUUsY0FBYyxHQUNqQyxPQUFPLENBQUMsWUFBWSxDQUFDLENBSXZCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schnorr/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schnorr/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAO,MAAM,8BAA8B,kBAA2E,CAAC;AAEvH;;;;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/index.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
6
|
+
*/ import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
7
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
8
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
10
9
|
import SchnorrAccountContractJson from '../../artifacts/SchnorrAccount.json' with {
|
|
@@ -24,36 +23,6 @@ export const SchnorrAccountContractArtifact = loadContractArtifact(SchnorrAccoun
|
|
|
24
23
|
return Promise.resolve(SchnorrAccountContractArtifact);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
31
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
32
|
-
* @param salt - Deployment salt.
|
|
33
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
34
|
-
*/ export function getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt) {
|
|
35
|
-
return AccountManager.create(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/ export function getSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
44
|
-
return getWallet(pxe, address, new SchnorrAccountContract(signingPrivateKey));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
48
|
-
* @param pxe - An PXE server instance.
|
|
49
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
50
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
51
|
-
* @param salt - Deployment salt.
|
|
52
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
53
|
-
*/ export async function getSchnorrWalletWithSecretKey(pxe, secretKey, signingPrivateKey, salt) {
|
|
54
|
-
const account = await getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt);
|
|
55
|
-
return account.getWallet();
|
|
56
|
-
}
|
|
57
26
|
/**
|
|
58
27
|
* Compute the address of a schnorr account contract.
|
|
59
28
|
* @param secret - A seed for deriving the signing key and public keys.
|
package/dest/schnorr/lazy.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
10
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
5
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
14
6
|
/**
|
|
15
7
|
* Lazily loads the contract artifact
|
|
@@ -25,32 +17,6 @@ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
|
|
|
25
17
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
26
18
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
27
19
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
30
|
-
* @param pxe - An PXE server instance.
|
|
31
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
32
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
33
|
-
* @param salt - Deployment salt.
|
|
34
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
35
|
-
*/
|
|
36
|
-
export declare function getSchnorrAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt?: Salt): Promise<AccountManager>;
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/
|
|
44
|
-
export declare function getSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
50
|
-
* @param salt - Deployment salt.
|
|
51
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
52
|
-
*/
|
|
53
|
-
export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt: Salt): Promise<AccountWalletWithSecretKey>;
|
|
54
20
|
/**
|
|
55
21
|
* Compute the address of a schnorr account contract.
|
|
56
22
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -58,4 +24,4 @@ export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, s
|
|
|
58
24
|
* @param signingPrivateKey - A specific signing private key that's not derived from the secret.
|
|
59
25
|
*/
|
|
60
26
|
export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
|
|
61
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjaG5vcnIvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFHaEUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFbkU7OztHQUdHO0FBQ0gsd0JBQXNCLGlDQUFpQyw4QkFRdEQ7QUFFRDs7OztHQUlHO0FBQ0gscUJBQWEsc0JBQXVCLFNBQVEsMEJBQTBCO0lBQ3BFLFlBQVksaUJBQWlCLEVBQUUsY0FBYyxFQUU1QztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBc0IsZ0NBQWdDLENBQ3BELE1BQU0sRUFBRSxFQUFFLEVBQ1YsSUFBSSxFQUFFLEVBQUUsRUFDUixpQkFBaUIsQ0FBQyxFQUFFLGNBQWMsR0FDakMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUl2QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"
|
|
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
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
6
|
+
*/ import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
7
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
8
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
10
9
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
@@ -12,10 +11,10 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
12
11
|
* Lazily loads the contract artifact
|
|
13
12
|
* @returns The contract artifact for the schnorr account contract
|
|
14
13
|
*/ export async function getSchnorrAccountContractArtifact() {
|
|
15
|
-
// Cannot assert this import as it's incompatible with
|
|
16
|
-
// https://
|
|
17
|
-
//
|
|
18
|
-
//
|
|
14
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
17
|
+
// "text/javascript"
|
|
19
18
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
19
|
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
21
20
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
@@ -32,36 +31,6 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
32
31
|
return getSchnorrAccountContractArtifact();
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
39
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
40
|
-
* @param salt - Deployment salt.
|
|
41
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
42
|
-
*/ export function getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt) {
|
|
43
|
-
return AccountManager.create(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param address - Address for the account.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
50
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
51
|
-
*/ export function getSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
52
|
-
return getWallet(pxe, address, new SchnorrAccountContract(signingPrivateKey));
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
56
|
-
* @param pxe - An PXE server instance.
|
|
57
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
58
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
59
|
-
* @param salt - Deployment salt.
|
|
60
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
61
|
-
*/ export async function getSchnorrWalletWithSecretKey(pxe, secretKey, signingPrivateKey, salt) {
|
|
62
|
-
const account = await getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt);
|
|
63
|
-
return account.getWallet();
|
|
64
|
-
}
|
|
65
34
|
/**
|
|
66
35
|
* Compute the address of a schnorr account contract.
|
|
67
36
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { GrumpkinScalar } from '@aztec/foundation/
|
|
2
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
3
3
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
4
|
import { DefaultAccountContract } from '../defaults/account_contract.js';
|
|
5
5
|
/**
|
|
@@ -14,4 +14,4 @@ export declare abstract class SingleKeyBaseAccountContract extends DefaultAccoun
|
|
|
14
14
|
getInitializationFunctionAndArgs(): Promise<undefined>;
|
|
15
15
|
getAuthWitnessProvider(account: CompleteAddress): AuthWitnessProvider;
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NpbmdsZV9rZXkvYWNjb3VudF9jb250cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBR25FLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUVuRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFekQsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFekU7Ozs7O0dBS0c7QUFDSCw4QkFBc0IsNEJBQTZCLFNBQVEsc0JBQXNCO0lBQ25FLE9BQU8sQ0FBQyxvQkFBb0I7SUFBeEMsWUFBb0Isb0JBQW9CLEVBQUUsY0FBYyxFQUV2RDtJQUVELGdDQUFnQyx1QkFFL0I7SUFFRCxzQkFBc0IsQ0FBQyxPQUFPLEVBQUUsZUFBZSxHQUFHLG1CQUFtQixDQUVwRTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/single_key/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/single_key/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE;;;;;GAKG;AACH,8BAAsB,4BAA6B,SAAQ,sBAAsB;IACnE,OAAO,CAAC,oBAAoB;IAAxC,YAAoB,oBAAoB,EAAE,cAAc,EAEvD;IAED,gCAAgC,uBAE/B;IAED,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAEpE;CACF"}
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
9
|
-
import { type AccountWallet } from '@aztec/aztec.js/wallet';
|
|
7
|
+
import type { GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
10
8
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
12
9
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
13
10
|
export declare const SchnorrSingleKeyAccountContractArtifact: ContractArtifact;
|
|
14
11
|
/**
|
|
@@ -20,20 +17,4 @@ export declare class SingleKeyAccountContract extends SingleKeyBaseAccountContra
|
|
|
20
17
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
21
18
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
25
|
-
* @param pxe - An PXE server instance.
|
|
26
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
27
|
-
* @param salt - Deployment salt.
|
|
28
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
29
|
-
*/
|
|
30
|
-
export declare function getUnsafeSchnorrAccount(pxe: PXE, secretKey: Fr, salt?: Salt): Promise<AccountManager>;
|
|
31
|
-
/**
|
|
32
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
33
|
-
* @param pxe - An PXE server instance.
|
|
34
|
-
* @param address - Address for the account.
|
|
35
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
36
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
37
|
-
*/
|
|
38
|
-
export declare function getUnsafeSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
39
|
-
//# sourceMappingURL=index.d.ts.map
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaW5nbGVfa2V5L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7OztHQUtHO0FBQ0gsT0FBTyxLQUFLLEVBQUUsY0FBYyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDN0QsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUsxRCxPQUFPLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVyRSxlQUFPLE1BQU0sdUNBQXVDLGtCQUVuRCxDQUFDO0FBRUY7Ozs7R0FJRztBQUNILHFCQUFhLHdCQUF5QixTQUFRLDRCQUE0QjtJQUN4RSxZQUFZLGlCQUFpQixFQUFFLGNBQWMsRUFFNUM7SUFFUSxtQkFBbUIsSUFBSSxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FFeEQ7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/single_key/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/single_key/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,eAAO,MAAM,uCAAuC,kBAEnD,CAAC;AAEF;;;;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/index.js
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* It is not recommended to use this account type in production.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
|
-
import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
6
|
+
*/ import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
10
7
|
import SchnorrSingleKeyAccountContractJson from '../../artifacts/SchnorrSingleKeyAccount.json' with {
|
|
11
8
|
type: 'json'
|
|
12
9
|
};
|
|
@@ -24,22 +21,3 @@ export const SchnorrSingleKeyAccountContractArtifact = loadContractArtifact(Schn
|
|
|
24
21
|
return Promise.resolve(SchnorrSingleKeyAccountContractArtifact);
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
31
|
-
* @param salt - Deployment salt.
|
|
32
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
33
|
-
*/ export function getUnsafeSchnorrAccount(pxe, secretKey, salt) {
|
|
34
|
-
const encryptionPrivateKey = deriveMasterIncomingViewingSecretKey(secretKey);
|
|
35
|
-
return AccountManager.create(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/ export function getUnsafeSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
44
|
-
return getWallet(pxe, address, new SingleKeyAccountContract(signingPrivateKey));
|
|
45
|
-
}
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
9
|
-
import { type AccountWallet } from '@aztec/aztec.js/wallet';
|
|
7
|
+
import type { GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
10
8
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
12
9
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
13
10
|
/**
|
|
14
11
|
* Lazily loads the contract artifact
|
|
@@ -24,20 +21,4 @@ export declare class SingleKeyAccountContract extends SingleKeyBaseAccountContra
|
|
|
24
21
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
25
22
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
31
|
-
* @param salt - Deployment salt.
|
|
32
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
33
|
-
*/
|
|
34
|
-
export declare function getUnsafeSchnorrAccount(pxe: PXE, secretKey: Fr, salt?: Salt): Promise<AccountManager>;
|
|
35
|
-
/**
|
|
36
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param address - Address for the account.
|
|
39
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
40
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getUnsafeSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
43
|
-
//# sourceMappingURL=lazy.d.ts.map
|
|
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,
|
|
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
|
@@ -3,19 +3,16 @@
|
|
|
3
3
|
* It is not recommended to use this account type in production.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
|
-
import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
6
|
+
*/ import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
10
7
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
11
8
|
/**
|
|
12
9
|
* Lazily loads the contract artifact
|
|
13
10
|
* @returns The contract artifact for the single key account contract
|
|
14
11
|
*/ export async function getSingleKeyAccountContractArtifact() {
|
|
15
|
-
// Cannot assert this import as it's incompatible with
|
|
16
|
-
// https://
|
|
17
|
-
//
|
|
18
|
-
//
|
|
12
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
13
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
14
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
15
|
+
// "text/javascript"
|
|
19
16
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
17
|
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
21
18
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
@@ -32,22 +29,3 @@ import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
|
32
29
|
return getSingleKeyAccountContractArtifact();
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
39
|
-
* @param salt - Deployment salt.
|
|
40
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
41
|
-
*/ export function getUnsafeSchnorrAccount(pxe, secretKey, salt) {
|
|
42
|
-
const encryptionPrivateKey = deriveMasterIncomingViewingSecretKey(secretKey);
|
|
43
|
-
return AccountManager.create(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param address - Address for the account.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
50
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
51
|
-
*/ export function getUnsafeSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
52
|
-
return getWallet(pxe, address, new SingleKeyAccountContract(signingPrivateKey));
|
|
53
|
-
}
|