@walletmesh/aztec-rpc-wallet 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +6 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/aztecRemoteWallet.d.ts +7 -6
- package/dist/aztecRemoteWallet.d.ts.map +1 -1
- package/dist/aztecRemoteWallet.js +15 -9
- package/dist/handlers/aztecAccountWallet.d.ts.map +1 -1
- package/dist/handlers/aztecAccountWallet.js +22 -22
- package/dist/serializers/account.d.ts +4 -7
- package/dist/serializers/account.d.ts.map +1 -1
- package/dist/serializers/account.js +28 -29
- package/dist/serializers/contract.d.ts +4 -56
- package/dist/serializers/contract.d.ts.map +1 -1
- package/dist/serializers/contract.js +62 -148
- package/dist/serializers/index.d.ts +1 -4
- package/dist/serializers/index.d.ts.map +1 -1
- package/dist/serializers/index.js +12 -12
- package/dist/serializers/log.d.ts +36 -83
- package/dist/serializers/log.d.ts.map +1 -1
- package/dist/serializers/log.js +96 -107
- package/dist/serializers/note.d.ts +14 -17
- package/dist/serializers/note.d.ts.map +1 -1
- package/dist/serializers/note.js +52 -29
- package/dist/serializers/transaction-utils.d.ts +44 -100
- package/dist/serializers/transaction-utils.d.ts.map +1 -1
- package/dist/serializers/transaction-utils.js +82 -118
- package/dist/serializers/transaction.d.ts +3 -6
- package/dist/serializers/transaction.d.ts.map +1 -1
- package/dist/serializers/transaction.js +39 -50
- package/dist/types.d.ts +8 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +5 -5
- package/src/aztecRemoteWallet.test.ts +33 -29
- package/src/aztecRemoteWallet.ts +25 -14
- package/src/handlers/aztecAccountWallet.test.ts +78 -75
- package/src/handlers/aztecAccountWallet.ts +32 -35
- package/src/serializers/account.test.ts +18 -17
- package/src/serializers/account.ts +31 -49
- package/src/serializers/contract.test.ts +14 -16
- package/src/serializers/contract.ts +75 -164
- package/src/serializers/index.test.ts +20 -8
- package/src/serializers/index.ts +16 -20
- package/src/serializers/log.test.ts +201 -28
- package/src/serializers/log.ts +153 -146
- package/src/serializers/note.test.ts +26 -28
- package/src/serializers/note.ts +60 -36
- package/src/serializers/transaction-utils.ts +135 -211
- package/src/serializers/transaction.test.ts +190 -30
- package/src/serializers/transaction.ts +51 -72
- package/src/types.ts +9 -8
- package/vitest.config.ts +1 -1
- package/dist/serializers/contract-utils.d.ts +0 -40
- package/dist/serializers/contract-utils.d.ts.map +0 -1
- package/dist/serializers/contract-utils.js +0 -102
- package/dist/serializers/core.d.ts +0 -110
- package/dist/serializers/core.d.ts.map +0 -1
- package/dist/serializers/core.js +0 -130
- package/dist/serializers/types.d.ts +0 -49
- package/dist/serializers/types.d.ts.map +0 -1
- package/dist/serializers/types.js +0 -22
- package/src/serializers/contract-utils.ts +0 -104
- package/src/serializers/core.test.ts +0 -56
- package/src/serializers/core.ts +0 -141
- package/src/serializers/types.ts +0 -58
@@ -1,107 +1,51 @@
|
|
1
|
-
import { PrivateExecutionResult, TxProvingResult } from '@aztec/circuit-types';
|
2
|
-
import type { CountedContractClassLog, CountedPublicExecutionRequest, NoteAndSlot, PublicExecutionRequest } from '@aztec/circuit-types';
|
3
|
-
import type { ClientIvcProof, PrivateCircuitPublicInputs, PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js';
|
4
1
|
/**
|
5
|
-
*
|
6
|
-
*
|
2
|
+
* @module transaction-utils
|
3
|
+
* Utilities for serializing and deserializing Aztec transaction execution requests.
|
4
|
+
* These utilities handle the conversion between native Aztec types and JSON-RPC compatible formats.
|
7
5
|
*/
|
8
|
-
|
9
|
-
acir: string;
|
10
|
-
vk: string;
|
11
|
-
partialWitness: [number, string][];
|
12
|
-
publicInputs: PrivateCircuitPublicInputs;
|
13
|
-
noteHashLeafIndexMap: [string, string][];
|
14
|
-
newNotes: NoteAndSlot[];
|
15
|
-
noteHashNullifierCounterMap: [number, number][];
|
16
|
-
returnValues: string[];
|
17
|
-
nestedExecutions: SerializedPrivateExecutionResultData[];
|
18
|
-
enqueuedPublicFunctionCalls: CountedPublicExecutionRequest[];
|
19
|
-
publicTeardownFunctionCall: PublicExecutionRequest;
|
20
|
-
contractClassLogs: CountedContractClassLog[];
|
21
|
-
}
|
6
|
+
import type { ExecutionRequestInit } from '@aztec/aztec.js/entrypoint';
|
22
7
|
/**
|
23
|
-
*
|
24
|
-
*
|
8
|
+
* Serializes an ExecutionRequestInit object to a string for JSON-RPC transport.
|
9
|
+
* This function converts a native Aztec transaction execution request into a format
|
10
|
+
* that can be safely transmitted over JSON-RPC, handling the conversion of complex
|
11
|
+
* types like addresses, field elements, and function selectors to strings.
|
12
|
+
*
|
13
|
+
* Note: The fee payment method is not serialized as it contains async methods.
|
14
|
+
* The deserializer will use a default NoFeePaymentMethod which should be replaced
|
15
|
+
* by the caller with an appropriate implementation.
|
16
|
+
*
|
17
|
+
* @param init - The ExecutionRequestInit object to serialize, containing:
|
18
|
+
* - calls: Array of function calls to execute
|
19
|
+
* - fee: Gas settings and payment method
|
20
|
+
* - authWitnesses: Optional authentication proofs
|
21
|
+
* - hashedArguments: Optional pre-hashed arguments
|
22
|
+
* - nonce: Optional transaction nonce
|
23
|
+
* - cancellable: Optional cancellation flag
|
24
|
+
* @returns A JSON string representation of the serialized data, with all complex
|
25
|
+
* Aztec types converted to string representations
|
26
|
+
* @throws If any of the complex types cannot be serialized
|
25
27
|
*/
|
26
|
-
export declare
|
27
|
-
/**
|
28
|
-
* Creates a SerializablePrivateExecutionResult from a PrivateExecutionResult instance.
|
29
|
-
* @param result - The PrivateExecutionResult to convert
|
30
|
-
* @returns A new SerializablePrivateExecutionResult instance
|
31
|
-
*/
|
32
|
-
static from(result: PrivateExecutionResult): SerializablePrivateExecutionResult;
|
33
|
-
/**
|
34
|
-
* Converts the execution result to a JSON-serializable format.
|
35
|
-
* Handles conversion of complex types like Buffers, Maps, and nested execution results.
|
36
|
-
* @returns The serialized execution result data
|
37
|
-
*/
|
38
|
-
toJSON(): SerializedPrivateExecutionResultData;
|
39
|
-
/**
|
40
|
-
* Creates a SerializablePrivateExecutionResult from JSON data.
|
41
|
-
* @param json - JSON string or pre-parsed data object
|
42
|
-
* @returns A new SerializablePrivateExecutionResult instance
|
43
|
-
*/
|
44
|
-
static fromJSON(json: string | SerializedPrivateExecutionResultData): SerializablePrivateExecutionResult;
|
45
|
-
/**
|
46
|
-
* Compares this execution result with another for equality.
|
47
|
-
* @param other - The execution result to compare against
|
48
|
-
* @returns True if the execution results are equivalent
|
49
|
-
*/
|
50
|
-
equals(other: PrivateExecutionResult): boolean;
|
51
|
-
toComparable(): SerializedPrivateExecutionResultData;
|
52
|
-
}
|
28
|
+
export declare function serializeExecutionRequestInit(init: ExecutionRequestInit): string;
|
53
29
|
/**
|
54
|
-
*
|
55
|
-
*
|
30
|
+
* Deserializes a string into an ExecutionRequestInit object for use in the Aztec protocol.
|
31
|
+
* This function reconstructs a native Aztec transaction execution request from its
|
32
|
+
* JSON-RPC serialized form, converting string representations back into their
|
33
|
+
* appropriate Aztec types.
|
34
|
+
*
|
35
|
+
* Note: A default NoFeePaymentMethod is used for the fee payment method.
|
36
|
+
* The caller should override this with the appropriate implementation based on
|
37
|
+
* their fee payment requirements.
|
38
|
+
*
|
39
|
+
* @param data - The serialized string data containing:
|
40
|
+
* - calls: Array of serialized function calls
|
41
|
+
* - fee: Serialized gas settings
|
42
|
+
* - authWitnesses: Optional serialized authentication proofs
|
43
|
+
* - hashedArguments: Optional serialized hashed arguments
|
44
|
+
* - nonce: Optional serialized nonce
|
45
|
+
* - cancellable: Optional cancellation flag
|
46
|
+
* @returns The deserialized ExecutionRequestInit object with all string representations
|
47
|
+
* converted back to their native Aztec types
|
48
|
+
* @throws If any of the serialized data cannot be properly deserialized into valid Aztec types
|
56
49
|
*/
|
57
|
-
|
58
|
-
privateExecutionResult: ReturnType<SerializablePrivateExecutionResult['toJSON']>;
|
59
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
60
|
-
clientIvcProof: ClientIvcProof;
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* Extends TxProvingResult to add serialization capabilities.
|
64
|
-
* Provides methods to convert transaction proving results to/from JSON format for RPC transport.
|
65
|
-
*/
|
66
|
-
export declare class SerializableTxProvingResult extends TxProvingResult {
|
67
|
-
/**
|
68
|
-
* Creates a SerializableTxProvingResult from a TxProvingResult instance.
|
69
|
-
* @param result - The TxProvingResult to convert
|
70
|
-
* @returns A new SerializableTxProvingResult instance
|
71
|
-
*/
|
72
|
-
static from(result: TxProvingResult): SerializableTxProvingResult;
|
73
|
-
/**
|
74
|
-
* Converts the proving result to a JSON-serializable format.
|
75
|
-
* @returns The serialized proving result data
|
76
|
-
*/
|
77
|
-
toJSON(): SerializedTxProvingResultData;
|
78
|
-
/**
|
79
|
-
* Creates a SerializableTxProvingResult from JSON data.
|
80
|
-
* @param json - JSON string or pre-parsed data object
|
81
|
-
* @returns A new SerializableTxProvingResult instance
|
82
|
-
*/
|
83
|
-
static fromJSON(json: string | SerializedTxProvingResultData): SerializableTxProvingResult;
|
84
|
-
/**
|
85
|
-
* Compares this proving result with another for equality.
|
86
|
-
* @param other - The proving result to compare against
|
87
|
-
* @returns True if the proving results are equivalent
|
88
|
-
*/
|
89
|
-
equals(other: TxProvingResult): boolean;
|
90
|
-
toComparable(): SerializedTxProvingResultData;
|
91
|
-
}
|
92
|
-
/**
|
93
|
-
* Utility function to compare two PrivateExecutionResult instances for equality.
|
94
|
-
* @param a - First execution result
|
95
|
-
* @param b - Second execution result
|
96
|
-
* @returns True if the execution results are equivalent
|
97
|
-
*/
|
98
|
-
export declare function comparePrivateExecutionResults(a: PrivateExecutionResult, b: PrivateExecutionResult): boolean;
|
99
|
-
/**
|
100
|
-
* Utility function to compare two TxProvingResult instances for equality.
|
101
|
-
* @param a - First proving result
|
102
|
-
* @param b - Second proving result
|
103
|
-
* @returns True if the proving results are equivalent
|
104
|
-
*/
|
105
|
-
export declare function compareTxProvingResults(a: TxProvingResult, b: TxProvingResult): boolean;
|
106
|
-
export {};
|
50
|
+
export declare function deserializeExecutionRequestInit(data: string): ExecutionRequestInit;
|
107
51
|
//# sourceMappingURL=transaction-utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-utils.d.ts","sourceRoot":"","sources":["../../src/serializers/transaction-utils.ts"],"names":[],"mappings":"AAAA
|
1
|
+
{"version":3,"file":"transaction-utils.d.ts","sourceRoot":"","sources":["../../src/serializers/transaction-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAiDvE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAiChF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAyBlF"}
|
@@ -1,130 +1,94 @@
|
|
1
|
-
import { PrivateExecutionResult, TxProvingResult } from '@aztec/circuit-types';
|
2
|
-
import { Fr } from '@aztec/aztec.js';
|
3
1
|
/**
|
4
|
-
*
|
5
|
-
*
|
2
|
+
* @module transaction-utils
|
3
|
+
* Utilities for serializing and deserializing Aztec transaction execution requests.
|
4
|
+
* These utilities handle the conversion between native Aztec types and JSON-RPC compatible formats.
|
6
5
|
*/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
* @param result - The PrivateExecutionResult to convert
|
11
|
-
* @returns A new SerializablePrivateExecutionResult instance
|
12
|
-
*/
|
13
|
-
static from(result) {
|
14
|
-
return new SerializablePrivateExecutionResult(result.acir, result.vk, result.partialWitness, result.publicInputs, result.noteHashLeafIndexMap, result.newNotes, result.noteHashNullifierCounterMap, result.returnValues, result.nestedExecutions, result.enqueuedPublicFunctionCalls, result.publicTeardownFunctionCall, result.contractClassLogs);
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* Converts the execution result to a JSON-serializable format.
|
18
|
-
* Handles conversion of complex types like Buffers, Maps, and nested execution results.
|
19
|
-
* @returns The serialized execution result data
|
20
|
-
*/
|
21
|
-
toJSON() {
|
22
|
-
return {
|
23
|
-
acir: this.acir.toString('base64'),
|
24
|
-
vk: this.vk.toString('base64'),
|
25
|
-
partialWitness: Array.from(this.partialWitness.entries()),
|
26
|
-
publicInputs: this.publicInputs,
|
27
|
-
noteHashLeafIndexMap: Array.from(this.noteHashLeafIndexMap.entries()).map(([k, v]) => [
|
28
|
-
k.toString(),
|
29
|
-
v.toString(),
|
30
|
-
]),
|
31
|
-
newNotes: this.newNotes,
|
32
|
-
noteHashNullifierCounterMap: Array.from(this.noteHashNullifierCounterMap.entries()),
|
33
|
-
returnValues: this.returnValues.map((fr) => fr.toString()),
|
34
|
-
nestedExecutions: this.nestedExecutions.map((exec) => exec instanceof SerializablePrivateExecutionResult
|
35
|
-
? exec.toJSON()
|
36
|
-
: new SerializablePrivateExecutionResult(exec.acir, exec.vk, exec.partialWitness, exec.publicInputs, exec.noteHashLeafIndexMap, exec.newNotes, exec.noteHashNullifierCounterMap, exec.returnValues, exec.nestedExecutions, exec.enqueuedPublicFunctionCalls, exec.publicTeardownFunctionCall, exec.contractClassLogs).toJSON()),
|
37
|
-
enqueuedPublicFunctionCalls: this.enqueuedPublicFunctionCalls,
|
38
|
-
publicTeardownFunctionCall: this.publicTeardownFunctionCall,
|
39
|
-
contractClassLogs: this.contractClassLogs,
|
40
|
-
};
|
41
|
-
}
|
42
|
-
/**
|
43
|
-
* Creates a SerializablePrivateExecutionResult from JSON data.
|
44
|
-
* @param json - JSON string or pre-parsed data object
|
45
|
-
* @returns A new SerializablePrivateExecutionResult instance
|
46
|
-
*/
|
47
|
-
static fromJSON(json) {
|
48
|
-
const data = typeof json === 'string' ? JSON.parse(json) : json;
|
49
|
-
return new SerializablePrivateExecutionResult(Buffer.from(data.acir, 'base64'), Buffer.from(data.vk, 'base64'), new Map(data.partialWitness), data.publicInputs, new Map(data.noteHashLeafIndexMap.map(([k, v]) => [BigInt(k), BigInt(v)])), data.newNotes, new Map(data.noteHashNullifierCounterMap), data.returnValues.map((str) => Fr.fromString(str)), data.nestedExecutions.map((exec) => SerializablePrivateExecutionResult.fromJSON(exec)), data.enqueuedPublicFunctionCalls, data.publicTeardownFunctionCall, data.contractClassLogs);
|
50
|
-
}
|
51
|
-
/**
|
52
|
-
* Compares this execution result with another for equality.
|
53
|
-
* @param other - The execution result to compare against
|
54
|
-
* @returns True if the execution results are equivalent
|
55
|
-
*/
|
56
|
-
equals(other) {
|
57
|
-
const thisJson = JSON.stringify(SerializablePrivateExecutionResult.from(this).toJSON());
|
58
|
-
const otherJson = JSON.stringify(SerializablePrivateExecutionResult.from(other).toJSON());
|
59
|
-
return thisJson === otherJson;
|
60
|
-
}
|
61
|
-
toComparable() {
|
62
|
-
return JSON.parse(JSON.stringify(this.toJSON()));
|
63
|
-
}
|
64
|
-
}
|
6
|
+
import { HashedValues, FunctionCall, AuthWitness } from '@aztec/circuit-types';
|
7
|
+
import { AztecAddress, Fr, FunctionSelector, GasSettings } from '@aztec/circuits.js';
|
8
|
+
import { NoFeePaymentMethod } from '@aztec/aztec.js';
|
65
9
|
/**
|
66
|
-
*
|
67
|
-
*
|
10
|
+
* Serializes an ExecutionRequestInit object to a string for JSON-RPC transport.
|
11
|
+
* This function converts a native Aztec transaction execution request into a format
|
12
|
+
* that can be safely transmitted over JSON-RPC, handling the conversion of complex
|
13
|
+
* types like addresses, field elements, and function selectors to strings.
|
14
|
+
*
|
15
|
+
* Note: The fee payment method is not serialized as it contains async methods.
|
16
|
+
* The deserializer will use a default NoFeePaymentMethod which should be replaced
|
17
|
+
* by the caller with an appropriate implementation.
|
18
|
+
*
|
19
|
+
* @param init - The ExecutionRequestInit object to serialize, containing:
|
20
|
+
* - calls: Array of function calls to execute
|
21
|
+
* - fee: Gas settings and payment method
|
22
|
+
* - authWitnesses: Optional authentication proofs
|
23
|
+
* - hashedArguments: Optional pre-hashed arguments
|
24
|
+
* - nonce: Optional transaction nonce
|
25
|
+
* - cancellable: Optional cancellation flag
|
26
|
+
* @returns A JSON string representation of the serialized data, with all complex
|
27
|
+
* Aztec types converted to string representations
|
28
|
+
* @throws If any of the complex types cannot be serialized
|
68
29
|
*/
|
69
|
-
export
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
clientIvcProof: this.clientIvcProof,
|
87
|
-
};
|
30
|
+
export function serializeExecutionRequestInit(init) {
|
31
|
+
const serialized = {
|
32
|
+
calls: init.calls.map((call) => ({
|
33
|
+
name: call.name,
|
34
|
+
to: call.to.toString(),
|
35
|
+
selector: call.selector.toString(),
|
36
|
+
type: call.type,
|
37
|
+
isStatic: call.isStatic,
|
38
|
+
args: call.args.map((arg) => arg.toString()),
|
39
|
+
returnTypes: call.returnTypes,
|
40
|
+
})),
|
41
|
+
fee: {
|
42
|
+
gasSettings: init.fee.gasSettings.toBuffer().toString('base64'),
|
43
|
+
},
|
44
|
+
};
|
45
|
+
if (init.authWitnesses) {
|
46
|
+
serialized.authWitnesses = init.authWitnesses.map((w) => w.toString());
|
88
47
|
}
|
89
|
-
|
90
|
-
|
91
|
-
* @param json - JSON string or pre-parsed data object
|
92
|
-
* @returns A new SerializableTxProvingResult instance
|
93
|
-
*/
|
94
|
-
static fromJSON(json) {
|
95
|
-
const data = typeof json === 'string' ? JSON.parse(json) : json;
|
96
|
-
return new SerializableTxProvingResult(SerializablePrivateExecutionResult.fromJSON(data.privateExecutionResult), data.publicInputs, data.clientIvcProof);
|
48
|
+
if (init.hashedArguments) {
|
49
|
+
serialized.hashedArguments = init.hashedArguments.map((ha) => ha.toBuffer().toString('base64'));
|
97
50
|
}
|
98
|
-
|
99
|
-
|
100
|
-
* @param other - The proving result to compare against
|
101
|
-
* @returns True if the proving results are equivalent
|
102
|
-
*/
|
103
|
-
equals(other) {
|
104
|
-
const thisJson = JSON.stringify(SerializableTxProvingResult.from(this).toJSON());
|
105
|
-
const otherJson = JSON.stringify(SerializableTxProvingResult.from(other).toJSON());
|
106
|
-
return thisJson === otherJson;
|
51
|
+
if (init.nonce) {
|
52
|
+
serialized.nonce = init.nonce.toString();
|
107
53
|
}
|
108
|
-
|
109
|
-
|
54
|
+
if (init.cancellable !== undefined) {
|
55
|
+
serialized.cancellable = init.cancellable;
|
110
56
|
}
|
57
|
+
return JSON.stringify(serialized);
|
111
58
|
}
|
112
59
|
/**
|
113
|
-
*
|
114
|
-
*
|
115
|
-
*
|
116
|
-
*
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
*
|
123
|
-
*
|
124
|
-
*
|
125
|
-
*
|
60
|
+
* Deserializes a string into an ExecutionRequestInit object for use in the Aztec protocol.
|
61
|
+
* This function reconstructs a native Aztec transaction execution request from its
|
62
|
+
* JSON-RPC serialized form, converting string representations back into their
|
63
|
+
* appropriate Aztec types.
|
64
|
+
*
|
65
|
+
* Note: A default NoFeePaymentMethod is used for the fee payment method.
|
66
|
+
* The caller should override this with the appropriate implementation based on
|
67
|
+
* their fee payment requirements.
|
68
|
+
*
|
69
|
+
* @param data - The serialized string data containing:
|
70
|
+
* - calls: Array of serialized function calls
|
71
|
+
* - fee: Serialized gas settings
|
72
|
+
* - authWitnesses: Optional serialized authentication proofs
|
73
|
+
* - hashedArguments: Optional serialized hashed arguments
|
74
|
+
* - nonce: Optional serialized nonce
|
75
|
+
* - cancellable: Optional cancellation flag
|
76
|
+
* @returns The deserialized ExecutionRequestInit object with all string representations
|
77
|
+
* converted back to their native Aztec types
|
78
|
+
* @throws If any of the serialized data cannot be properly deserialized into valid Aztec types
|
126
79
|
*/
|
127
|
-
export function
|
128
|
-
|
80
|
+
export function deserializeExecutionRequestInit(data) {
|
81
|
+
const parsed = JSON.parse(data);
|
82
|
+
return {
|
83
|
+
calls: parsed.calls.map((call) => new FunctionCall(call.name, AztecAddress.fromString(call.to), FunctionSelector.fromString(call.selector), call.type, call.isStatic, call.args.map((arg) => Fr.fromString(arg)), call.returnTypes)),
|
84
|
+
fee: {
|
85
|
+
gasSettings: GasSettings.fromBuffer(Buffer.from(parsed.fee.gasSettings, 'base64')),
|
86
|
+
paymentMethod: new NoFeePaymentMethod(), // Default, caller should override
|
87
|
+
},
|
88
|
+
authWitnesses: parsed.authWitnesses?.map((w) => AuthWitness.fromString(w)),
|
89
|
+
hashedArguments: parsed.hashedArguments?.map((ha) => HashedValues.fromBuffer(Buffer.from(ha, 'base64'))),
|
90
|
+
nonce: parsed.nonce ? Fr.fromString(parsed.nonce) : undefined,
|
91
|
+
cancellable: parsed.cancellable,
|
92
|
+
};
|
129
93
|
}
|
130
|
-
//# sourceMappingURL=data:application/json;base64,
|
94
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24tdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VyaWFsaXplcnMvdHJhbnNhY3Rpb24tdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUVILE9BQU8sRUFBRSxZQUFZLEVBQUUsWUFBWSxFQUFFLFdBQVcsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQy9FLE9BQU8sRUFBRSxZQUFZLEVBQUUsRUFBRSxFQUFFLGdCQUFnQixFQUFFLFdBQVcsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR3JGLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBZ0RyRDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FvQkc7QUFDSCxNQUFNLFVBQVUsNkJBQTZCLENBQUMsSUFBMEI7SUFDdEUsTUFBTSxVQUFVLEdBQW1DO1FBQ2pELEtBQUssRUFBRSxJQUFJL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xJQUFJLENBQUMsV0FBVyxDQUNqQixDQUNKO1FBQ0QsR0FBRyxFQUFFO1lBQ0gsV0FBVyxFQUFFLFdBQVcsQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLFdBQVcsRUFBRSxRQUFRLENBQUMsQ0FBQztZQUNsRixhQUFhLEVBQUUsSUFBSSxrQkFBa0IsRUFBRSxFQUFFLGtDQUFrQztTQUM1RTtRQUNELGFBQWEsRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUMxRSxlQUFlLEVBQUUsTUFBTSxDQUFDLGVBQWUsRUFBRSxHQUFHLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLFlBQVksQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsUUFBUSxDQUFDLENBQUMsQ0FBQztRQUN4RyxLQUFLLEVBQUUsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLFNBQVM7UUFDN0QsV0FBVyxFQUFFLE1BQU0sQ0FBQyxXQUFXO0tBQ2hDLENBQUM7QUFDSixDQUFDIn0=
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { AztecWalletMethodMap } from '../types.js';
|
2
|
-
import type { JSONRPCSerializedData, JSONRPCSerializer } from '
|
3
|
-
import {
|
2
|
+
import type { JSONRPCSerializedData, JSONRPCSerializer } from '@walletmesh/jsonrpc';
|
3
|
+
import { TxProvingResult } from '@aztec/circuit-types';
|
4
|
+
import { TxSimulationResult } from '@aztec/circuit-types';
|
4
5
|
import { TxExecutionRequest, TxReceipt } from '@aztec/aztec.js';
|
5
6
|
/**
|
6
7
|
* Serializer for the aztec_createTxExecutionRequest RPC method.
|
@@ -19,7 +20,6 @@ export declare class AztecCreateTxExecutionRequestSerializer implements JSONRPCS
|
|
19
20
|
/**
|
20
21
|
* Serializer for the aztec_proveTx RPC method.
|
21
22
|
* Handles serialization of transaction proving requests and results between JSON-RPC format and native Aztec types.
|
22
|
-
* Includes handling of private execution results and proving outcomes.
|
23
23
|
*/
|
24
24
|
export declare class AztecProveTxSerializer implements JSONRPCSerializer<AztecWalletMethodMap['aztec_proveTx']['params'], AztecWalletMethodMap['aztec_proveTx']['result']> {
|
25
25
|
params: {
|
@@ -48,7 +48,6 @@ export declare class AztecSendTxSerializer implements JSONRPCSerializer<AztecWal
|
|
48
48
|
/**
|
49
49
|
* Serializer for the aztec_getTxEffect RPC method.
|
50
50
|
* Handles serialization of transaction effect queries and results between JSON-RPC format and native Aztec types.
|
51
|
-
* Transaction effects represent the outcome and state changes caused by a transaction.
|
52
51
|
*/
|
53
52
|
export declare class AztecGetTxEffectSerializer implements JSONRPCSerializer<AztecWalletMethodMap['aztec_getTxEffect']['params'], AztecWalletMethodMap['aztec_getTxEffect']['result']> {
|
54
53
|
params: {
|
@@ -63,7 +62,6 @@ export declare class AztecGetTxEffectSerializer implements JSONRPCSerializer<Azt
|
|
63
62
|
/**
|
64
63
|
* Serializer for the aztec_getTxReceipt RPC method.
|
65
64
|
* Handles serialization of transaction receipt queries and results between JSON-RPC format and native Aztec types.
|
66
|
-
* Transaction receipts contain detailed information about executed transactions.
|
67
65
|
*/
|
68
66
|
export declare class AztecGetTxReceiptSerializer implements JSONRPCSerializer<AztecWalletMethodMap['aztec_getTxReceipt']['params'], AztecWalletMethodMap['aztec_getTxReceipt']['result']> {
|
69
67
|
params: {
|
@@ -78,7 +76,6 @@ export declare class AztecGetTxReceiptSerializer implements JSONRPCSerializer<Az
|
|
78
76
|
/**
|
79
77
|
* Serializer for the aztec_simulateTx RPC method.
|
80
78
|
* Handles serialization of transaction simulation requests and results between JSON-RPC format and native Aztec types.
|
81
|
-
* Supports simulation configuration including public simulation, custom sender, validation options, and profiling.
|
82
79
|
*/
|
83
80
|
export declare class AztecSimulateTxSerializer implements JSONRPCSerializer<AztecWalletMethodMap['aztec_simulateTx']['params'], AztecWalletMethodMap['aztec_simulateTx']['result']> {
|
84
81
|
params: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/serializers/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/serializers/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAGL,kBAAkB,EAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAKtF;;;GAGG;AACH,qBAAa,uCACX,YACE,iBAAiB,CACf,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC,EAChE,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC,CACjE;IAEH,MAAM;4BAEM,MAAM,SACP,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC,KACtE,qBAAqB;8BAQd,MAAM,QACR,qBAAqB,KAC1B,oBAAoB,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC;MAInE;IAEF,MAAM;4BACgB,MAAM,SAAS,kBAAkB,KAAG,qBAAqB;8BAM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