@aztec/aztec.js 0.43.0 → 0.45.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/dest/account/interface.d.ts +5 -19
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/interface.js +1 -1
- package/dest/account/wallet.d.ts +5 -2
- package/dest/account/wallet.d.ts.map +1 -1
- package/dest/api/abi.d.ts +1 -1
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +2 -2
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +12 -11
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +15 -12
- package/dest/index.d.ts +3 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +4 -3
- package/dest/rpc_clients/pxe_client.d.ts.map +1 -1
- package/dest/rpc_clients/pxe_client.js +3 -1
- package/dest/utils/abi_types.d.ts +4 -2
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +45 -29
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +35 -17
- package/dest/wallet/account_wallet.d.ts +25 -72
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +65 -66
- package/dest/wallet/base_wallet.d.ts +4 -13
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +6 -3
- package/dest/wallet/signerless_wallet.d.ts +3 -1
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/dest/wallet/signerless_wallet.js +2 -2
- package/package.json +16 -9
- package/src/account/interface.ts +5 -24
- package/src/account/wallet.ts +7 -2
- package/src/api/abi.ts +1 -1
- package/src/fee/private_fee_payment_method.ts +4 -8
- package/src/fee/public_fee_payment_method.ts +17 -16
- package/src/index.ts +4 -1
- package/src/rpc_clients/pxe_client.ts +2 -0
- package/src/utils/abi_types.ts +11 -2
- package/src/utils/authwit.ts +66 -21
- package/src/wallet/account_wallet.ts +76 -154
- package/src/wallet/base_wallet.ts +11 -21
- package/src/wallet/signerless_wallet.ts +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type AuthWitness,
|
|
3
3
|
type EventMetadata,
|
|
4
|
+
type EventType,
|
|
4
5
|
type ExtendedNote,
|
|
5
|
-
type FunctionCall,
|
|
6
6
|
type GetUnencryptedLogsResponse,
|
|
7
7
|
type IncomingNotesFilter,
|
|
8
8
|
type L2Block,
|
|
@@ -32,8 +32,8 @@ import { type ContractClassWithId, type ContractInstanceWithAddress } from '@azt
|
|
|
32
32
|
import { type NodeInfo } from '@aztec/types/interfaces';
|
|
33
33
|
|
|
34
34
|
import { type Wallet } from '../account/wallet.js';
|
|
35
|
-
import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
36
35
|
import { type ExecutionRequestInit } from '../entrypoint/entrypoint.js';
|
|
36
|
+
import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js';
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* A base class for Wallet implementations
|
|
@@ -49,21 +49,7 @@ export abstract class BaseWallet implements Wallet {
|
|
|
49
49
|
|
|
50
50
|
abstract createTxExecutionRequest(exec: ExecutionRequestInit): Promise<TxExecutionRequest>;
|
|
51
51
|
|
|
52
|
-
abstract createAuthWit(
|
|
53
|
-
messageHashOrIntent:
|
|
54
|
-
| Fr
|
|
55
|
-
| Buffer
|
|
56
|
-
| {
|
|
57
|
-
/** The caller to approve */
|
|
58
|
-
caller: AztecAddress;
|
|
59
|
-
/** The action to approve */
|
|
60
|
-
action: ContractFunctionInteraction | FunctionCall;
|
|
61
|
-
/** The chain id to approve */
|
|
62
|
-
chainId?: Fr;
|
|
63
|
-
/** The version to approve */
|
|
64
|
-
version?: Fr;
|
|
65
|
-
},
|
|
66
|
-
): Promise<AuthWitness>;
|
|
52
|
+
abstract createAuthWit(intent: Fr | Buffer | IntentInnerHash | IntentAction): Promise<AuthWitness>;
|
|
67
53
|
|
|
68
54
|
abstract rotateNullifierKeys(newNskM: Fq): Promise<void>;
|
|
69
55
|
|
|
@@ -197,11 +183,15 @@ export abstract class BaseWallet implements Wallet {
|
|
|
197
183
|
return this.pxe.getPXEInfo();
|
|
198
184
|
}
|
|
199
185
|
getEvents<T>(
|
|
186
|
+
type: EventType,
|
|
187
|
+
eventMetadata: EventMetadata<T>,
|
|
200
188
|
from: number,
|
|
201
189
|
limit: number,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
190
|
+
vpks: Point[] = [
|
|
191
|
+
this.getCompleteAddress().publicKeys.masterIncomingViewingPublicKey,
|
|
192
|
+
this.getCompleteAddress().publicKeys.masterOutgoingViewingPublicKey,
|
|
193
|
+
],
|
|
194
|
+
) {
|
|
195
|
+
return this.pxe.getEvents(type, eventMetadata, from, limit, vpks);
|
|
206
196
|
}
|
|
207
197
|
}
|
|
@@ -3,6 +3,7 @@ import { type CompleteAddress, type Fq, type Fr } from '@aztec/circuits.js';
|
|
|
3
3
|
|
|
4
4
|
import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js';
|
|
5
5
|
import { type EntrypointInterface, type ExecutionRequestInit } from '../entrypoint/entrypoint.js';
|
|
6
|
+
import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js';
|
|
6
7
|
import { BaseWallet } from './base_wallet.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -12,7 +13,6 @@ export class SignerlessWallet extends BaseWallet {
|
|
|
12
13
|
constructor(pxe: PXE, private entrypoint?: EntrypointInterface) {
|
|
13
14
|
super(pxe);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
async createTxExecutionRequest(execution: ExecutionRequestInit): Promise<TxExecutionRequest> {
|
|
17
17
|
let entrypoint = this.entrypoint;
|
|
18
18
|
if (!entrypoint) {
|
|
@@ -39,7 +39,7 @@ export class SignerlessWallet extends BaseWallet {
|
|
|
39
39
|
throw new Error('SignerlessWallet: Method getCompleteAddress not implemented.');
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
createAuthWit(
|
|
42
|
+
createAuthWit(_intent: Fr | Buffer | IntentInnerHash | IntentAction): Promise<AuthWitness> {
|
|
43
43
|
throw new Error('SignerlessWallet: Method createAuthWit not implemented.');
|
|
44
44
|
}
|
|
45
45
|
|