@aztec/txe 3.0.0-nightly.20250925 → 3.0.0-nightly.20250927

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.
Files changed (33) hide show
  1. package/dest/oracle/interfaces.d.ts +51 -0
  2. package/dest/oracle/interfaces.d.ts.map +1 -0
  3. package/dest/oracle/interfaces.js +3 -0
  4. package/dest/oracle/txe_oracle_public_context.d.ts +5 -3
  5. package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
  6. package/dest/oracle/txe_oracle_public_context.js +14 -3
  7. package/dest/oracle/txe_oracle_top_level_context.d.ts +9 -7
  8. package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
  9. package/dest/oracle/txe_oracle_top_level_context.js +24 -24
  10. package/dest/rpc_translator.d.ts +13 -4
  11. package/dest/rpc_translator.d.ts.map +1 -1
  12. package/dest/rpc_translator.js +101 -66
  13. package/dest/txe_session.d.ts +15 -15
  14. package/dest/txe_session.d.ts.map +1 -1
  15. package/dest/txe_session.js +141 -99
  16. package/dest/utils/tx_effect_creation.d.ts +5 -0
  17. package/dest/utils/tx_effect_creation.d.ts.map +1 -0
  18. package/dest/utils/tx_effect_creation.js +16 -0
  19. package/package.json +15 -15
  20. package/src/oracle/interfaces.ts +80 -0
  21. package/src/oracle/txe_oracle_public_context.ts +20 -15
  22. package/src/oracle/txe_oracle_top_level_context.ts +26 -43
  23. package/src/rpc_translator.ts +125 -69
  24. package/src/txe_session.ts +196 -120
  25. package/src/utils/tx_effect_creation.ts +37 -0
  26. package/dest/oracle/txe_oracle.d.ts +0 -64
  27. package/dest/oracle/txe_oracle.d.ts.map +0 -1
  28. package/dest/oracle/txe_oracle.js +0 -263
  29. package/dest/oracle/txe_typed_oracle.d.ts +0 -41
  30. package/dest/oracle/txe_typed_oracle.d.ts.map +0 -1
  31. package/dest/oracle/txe_typed_oracle.js +0 -89
  32. package/src/oracle/txe_oracle.ts +0 -419
  33. package/src/oracle/txe_typed_oracle.ts +0 -147
@@ -1,263 +0,0 @@
1
- import { Aes128 } from '@aztec/foundation/crypto';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { applyStringFormatting, createLogger } from '@aztec/foundation/log';
4
- import { ExecutionNoteCache, HashedValuesCache, UtilityContext, pickNotes } from '@aztec/pxe/simulator';
5
- import { Body, L2Block } from '@aztec/stdlib/block';
6
- import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
7
- import { Note } from '@aztec/stdlib/note';
8
- import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
9
- import { MerkleTreeId } from '@aztec/stdlib/trees';
10
- import { TxEffect, TxHash } from '@aztec/stdlib/tx';
11
- import { insertTxEffectIntoWorldTrees, makeTXEBlockHeader } from '../utils/block_creation.js';
12
- import { TXETypedOracle } from './txe_typed_oracle.js';
13
- export class TXE extends TXETypedOracle {
14
- contractAddress;
15
- pxeOracleInterface;
16
- forkedWorldTrees;
17
- anchorBlockGlobalVariables;
18
- nextBlockGlobalVariables;
19
- txRequestHash;
20
- logger;
21
- executionCache;
22
- senderForTags;
23
- noteCache;
24
- constructor(contractAddress, pxeOracleInterface, forkedWorldTrees, anchorBlockGlobalVariables, nextBlockGlobalVariables, txRequestHash){
25
- super('TXEOraclePrivateUtilityContext'), this.contractAddress = contractAddress, this.pxeOracleInterface = pxeOracleInterface, this.forkedWorldTrees = forkedWorldTrees, this.anchorBlockGlobalVariables = anchorBlockGlobalVariables, this.nextBlockGlobalVariables = nextBlockGlobalVariables, this.txRequestHash = txRequestHash, this.executionCache = new HashedValuesCache();
26
- this.logger = createLogger('txe:oracle');
27
- this.logger.debug('Entering Private/Utility context');
28
- this.noteCache = new ExecutionNoteCache(txRequestHash);
29
- }
30
- static async create(contractAddress, pxeOracleInterface, forkedWorldTrees, anchorBlockGlobalVariables, nextBlockGlobalVariables, txRequestHash) {
31
- // There is no automatic message discovery and contract-driven syncing process in inlined private or utility
32
- // contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
33
- // we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
34
- // be removed from the database.
35
- await pxeOracleInterface.removeNullifiedNotes(contractAddress);
36
- return new TXE(contractAddress, pxeOracleInterface, forkedWorldTrees, anchorBlockGlobalVariables, nextBlockGlobalVariables, txRequestHash);
37
- }
38
- // Utils
39
- async checkNullifiersNotInTree(contractAddress, nullifiers) {
40
- const siloedNullifiers = await Promise.all(nullifiers.map((nullifier)=>siloNullifier(contractAddress, nullifier)));
41
- const db = this.forkedWorldTrees;
42
- const nullifierIndexesInTree = await db.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, siloedNullifiers.map((n)=>n.toBuffer()));
43
- if (nullifierIndexesInTree.some((index)=>index !== undefined)) {
44
- throw new Error(`Rejecting tx for emitting duplicate nullifiers`);
45
- }
46
- }
47
- // TypedOracle
48
- utilityGetRandomField() {
49
- return Fr.random();
50
- }
51
- utilityGetUtilityContext() {
52
- return Promise.resolve(UtilityContext.from({
53
- blockNumber: this.anchorBlockGlobalVariables.blockNumber,
54
- timestamp: this.anchorBlockGlobalVariables.timestamp,
55
- contractAddress: this.contractAddress,
56
- version: this.anchorBlockGlobalVariables.version,
57
- chainId: this.anchorBlockGlobalVariables.chainId
58
- }));
59
- }
60
- privateStoreInExecutionCache(values, hash) {
61
- return this.executionCache.store(values, hash);
62
- }
63
- privateLoadFromExecutionCache(hash) {
64
- const preimage = this.executionCache.getPreimage(hash);
65
- if (!preimage) {
66
- throw new Error(`Preimage for hash ${hash.toString()} not found in cache`);
67
- }
68
- return Promise.resolve(preimage);
69
- }
70
- utilityGetKeyValidationRequest(pkMHash) {
71
- return this.pxeOracleInterface.getKeyValidationRequest(pkMHash, this.contractAddress);
72
- }
73
- utilityGetContractInstance(address) {
74
- return this.pxeOracleInterface.getContractInstance(address);
75
- }
76
- utilityGetMembershipWitness(blockNumber, treeId, leafValue) {
77
- return this.pxeOracleInterface.getMembershipWitness(blockNumber, treeId, leafValue);
78
- }
79
- utilityGetNullifierMembershipWitness(blockNumber, nullifier) {
80
- return this.pxeOracleInterface.getNullifierMembershipWitness(blockNumber, nullifier);
81
- }
82
- utilityGetPublicDataWitness(blockNumber, leafSlot) {
83
- return this.pxeOracleInterface.getPublicDataWitness(blockNumber, leafSlot);
84
- }
85
- utilityGetLowNullifierMembershipWitness(blockNumber, nullifier) {
86
- return this.pxeOracleInterface.getLowNullifierMembershipWitness(blockNumber, nullifier);
87
- }
88
- async utilityGetBlockHeader(blockNumber) {
89
- return (await this.pxeOracleInterface.getBlock(blockNumber))?.header.toBlockHeader();
90
- }
91
- utilityGetPublicKeysAndPartialAddress(account) {
92
- return this.pxeOracleInterface.getCompleteAddress(account);
93
- }
94
- async utilityGetNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
95
- // Nullified pending notes are already removed from the list.
96
- const pendingNotes = this.noteCache.getNotes(this.contractAddress, storageSlot);
97
- const pendingNullifiers = this.noteCache.getNullifiers(this.contractAddress);
98
- const dbNotes = await this.pxeOracleInterface.getNotes(this.contractAddress, storageSlot, status);
99
- const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
100
- const notes = pickNotes([
101
- ...dbNotesFiltered,
102
- ...pendingNotes
103
- ], {
104
- selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
105
- selector: {
106
- index,
107
- offset: selectByOffsets[i],
108
- length: selectByLengths[i]
109
- },
110
- value: selectValues[i],
111
- comparator: selectComparators[i]
112
- })),
113
- sorts: sortByIndexes.map((index, i)=>({
114
- selector: {
115
- index,
116
- offset: sortByOffsets[i],
117
- length: sortByLengths[i]
118
- },
119
- order: sortOrder[i]
120
- })),
121
- limit,
122
- offset
123
- });
124
- this.logger.debug(`Returning ${notes.length} notes for ${this.contractAddress} at ${storageSlot}: ${notes.map((n)=>`${n.noteNonce.toString()}:[${n.note.items.map((i)=>i.toString()).join(',')}]`).join(', ')}`);
125
- if (notes.length > 0) {
126
- const noteLength = notes[0].note.items.length;
127
- if (!notes.every(({ note })=>noteLength === note.items.length)) {
128
- throw new Error('Notes should all be the same length.');
129
- }
130
- }
131
- return notes;
132
- }
133
- privateNotifyCreatedNote(storageSlot, _noteTypeId, noteItems, noteHash, counter) {
134
- const note = new Note(noteItems);
135
- this.noteCache.addNewNote({
136
- contractAddress: this.contractAddress,
137
- storageSlot,
138
- noteNonce: Fr.ZERO,
139
- note,
140
- siloedNullifier: undefined,
141
- noteHash
142
- }, counter);
143
- }
144
- async privateNotifyNullifiedNote(innerNullifier, noteHash, _counter) {
145
- await this.checkNullifiersNotInTree(this.contractAddress, [
146
- innerNullifier
147
- ]);
148
- await this.noteCache.nullifyNote(this.contractAddress, innerNullifier, noteHash);
149
- }
150
- async privateNotifyCreatedNullifier(innerNullifier) {
151
- await this.checkNullifiersNotInTree(this.contractAddress, [
152
- innerNullifier
153
- ]);
154
- await this.noteCache.nullifierCreated(this.contractAddress, innerNullifier);
155
- }
156
- async utilityCheckNullifierExists(innerNullifier) {
157
- const nullifier = await siloNullifier(this.contractAddress, innerNullifier);
158
- const index = await this.pxeOracleInterface.getNullifierIndex(nullifier);
159
- return index !== undefined;
160
- }
161
- async utilityStorageRead(contractAddress, startStorageSlot, blockNumber, numberOfElements) {
162
- const values = [];
163
- for(let i = 0n; i < numberOfElements; i++){
164
- const storageSlot = startStorageSlot.add(new Fr(i));
165
- const value = await this.pxeOracleInterface.getPublicStorageAt(blockNumber, contractAddress, storageSlot);
166
- values.push(value);
167
- }
168
- return values;
169
- }
170
- utilityDebugLog(message, fields) {
171
- this.logger.verbose(`${applyStringFormatting(message, fields)}`, {
172
- module: `${this.logger.module}:debug_log`
173
- });
174
- }
175
- async privateIncrementAppTaggingSecretIndexAsSender(sender, recipient) {
176
- await this.pxeOracleInterface.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
177
- }
178
- async utilityGetIndexedTaggingSecretAsSender(sender, recipient) {
179
- return await this.pxeOracleInterface.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient);
180
- }
181
- async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
182
- await this.pxeOracleInterface.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot);
183
- await this.pxeOracleInterface.removeNullifiedNotes(this.contractAddress);
184
- return Promise.resolve();
185
- }
186
- async utilityValidateEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot) {
187
- await this.pxeOracleInterface.validateEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot);
188
- }
189
- async utilityBulkRetrieveLogs(contractAddress, logRetrievalRequestsArrayBaseSlot, logRetrievalResponsesArrayBaseSlot) {
190
- return await this.pxeOracleInterface.bulkRetrieveLogs(contractAddress, logRetrievalRequestsArrayBaseSlot, logRetrievalResponsesArrayBaseSlot);
191
- }
192
- utilityStoreCapsule(contractAddress, slot, capsule) {
193
- if (!contractAddress.equals(this.contractAddress)) {
194
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
195
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
196
- }
197
- return this.pxeOracleInterface.storeCapsule(this.contractAddress, slot, capsule);
198
- }
199
- utilityLoadCapsule(contractAddress, slot) {
200
- if (!contractAddress.equals(this.contractAddress)) {
201
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
202
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
203
- }
204
- return this.pxeOracleInterface.loadCapsule(this.contractAddress, slot);
205
- }
206
- utilityDeleteCapsule(contractAddress, slot) {
207
- if (!contractAddress.equals(this.contractAddress)) {
208
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
209
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
210
- }
211
- return this.pxeOracleInterface.deleteCapsule(this.contractAddress, slot);
212
- }
213
- utilityCopyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
214
- if (!contractAddress.equals(this.contractAddress)) {
215
- // TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
216
- throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
217
- }
218
- return this.pxeOracleInterface.copyCapsule(this.contractAddress, srcSlot, dstSlot, numEntries);
219
- }
220
- utilityAes128Decrypt(ciphertext, iv, symKey) {
221
- const aes128 = new Aes128();
222
- return aes128.decryptBufferCBC(ciphertext, iv, symKey);
223
- }
224
- utilityGetSharedSecret(address, ephPk) {
225
- return this.pxeOracleInterface.getSharedSecret(address, ephPk);
226
- }
227
- privateGetSenderForTags() {
228
- return Promise.resolve(this.senderForTags);
229
- }
230
- privateSetSenderForTags(senderForTags) {
231
- this.senderForTags = senderForTags;
232
- return Promise.resolve();
233
- }
234
- async close() {
235
- this.logger.debug('Exiting Private Context, building block with collected side effects', {
236
- blockNumber: this.nextBlockGlobalVariables.blockNumber
237
- });
238
- const txEffect = await this.makeTxEffect();
239
- await insertTxEffectIntoWorldTrees(txEffect, this.forkedWorldTrees);
240
- const block = new L2Block(makeAppendOnlyTreeSnapshot(), await makeTXEBlockHeader(this.forkedWorldTrees, this.nextBlockGlobalVariables), new Body([
241
- txEffect
242
- ]));
243
- await this.forkedWorldTrees.close();
244
- this.logger.debug('Exited PublicContext with built block', {
245
- blockNumber: block.number,
246
- txEffects: block.body.txEffects
247
- });
248
- return block;
249
- }
250
- async makeTxEffect() {
251
- const txEffect = TxEffect.empty();
252
- const { usedTxRequestHashForNonces } = this.noteCache.finish();
253
- const nonceGenerator = usedTxRequestHashForNonces ? this.txRequestHash : this.noteCache.getAllNullifiers()[0];
254
- txEffect.noteHashes = await Promise.all(this.noteCache.getAllNotes().map(async (pendingNote, i)=>computeUniqueNoteHash(await computeNoteHashNonce(nonceGenerator, i), await siloNoteHash(pendingNote.note.contractAddress, pendingNote.noteHashForConsumption))));
255
- // Nullifiers are already siloed
256
- txEffect.nullifiers = this.noteCache.getAllNullifiers();
257
- if (usedTxRequestHashForNonces) {
258
- txEffect.nullifiers.unshift(this.txRequestHash);
259
- }
260
- txEffect.txHash = new TxHash(new Fr(this.nextBlockGlobalVariables.blockNumber));
261
- return txEffect;
262
- }
263
- }
@@ -1,41 +0,0 @@
1
- import type { CompleteAddress, ContractArtifact, ContractInstanceWithAddress, TxHash } from '@aztec/aztec.js';
2
- import type { Fr } from '@aztec/foundation/fields';
3
- import { TypedOracle } from '@aztec/pxe/simulator';
4
- import type { FunctionSelector } from '@aztec/stdlib/abi';
5
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
6
- import type { PrivateContextInputs } from '@aztec/stdlib/kernel';
7
- import type { UInt32, UInt64 } from '@aztec/stdlib/types';
8
- export declare class TXETypedOracle extends TypedOracle {
9
- avmOpcodeAddress(): Promise<AztecAddress>;
10
- avmOpcodeBlockNumber(): Promise<UInt32>;
11
- avmOpcodeTimestamp(): Promise<bigint>;
12
- avmOpcodeIsStaticCall(): Promise<boolean>;
13
- avmOpcodeChainId(): Promise<Fr>;
14
- avmOpcodeVersion(): Promise<Fr>;
15
- avmOpcodeEmitNullifier(_nullifier: Fr): Promise<void>;
16
- avmOpcodeEmitNoteHash(_noteHash: Fr): Promise<void>;
17
- avmOpcodeNullifierExists(_innerNullifier: Fr, _targetAddress: AztecAddress): Promise<boolean>;
18
- avmOpcodeStorageWrite(_slot: Fr, _value: Fr): Promise<void>;
19
- avmOpcodeStorageRead(_slot: Fr): Promise<Fr>;
20
- txeGetPrivateContextInputs(_blockNumber?: number): Promise<PrivateContextInputs>;
21
- txeGetNextBlockNumber(): Promise<number>;
22
- txeGetNextBlockTimestamp(): Promise<UInt64>;
23
- txeAdvanceBlocksBy(_blocks: number): Promise<void>;
24
- txeAdvanceTimestampBy(_duration: UInt64): void;
25
- txeDeploy(_artifact: ContractArtifact, _instance: ContractInstanceWithAddress, _foreignSecret: Fr): Promise<void>;
26
- txeCreateAccount(_secret: Fr): Promise<CompleteAddress>;
27
- txeAddAccount(_artifact: ContractArtifact, _instance: ContractInstanceWithAddress, _secret: Fr): Promise<CompleteAddress>;
28
- txeAddAuthWitness(_address: AztecAddress, _messageHash: Fr): Promise<void>;
29
- txeGetLastBlockTimestamp(): Promise<bigint>;
30
- txeGetLastTxEffects(): Promise<{
31
- txHash: TxHash;
32
- noteHashes: Fr[];
33
- nullifiers: Fr[];
34
- }>;
35
- storageWrite(_startStorageSlot: Fr, _values: Fr[]): Promise<Fr[]>;
36
- getMsgSender(): AztecAddress;
37
- txePrivateCallNewFlow(_from: AztecAddress, _targetContractAddress: AztecAddress, _functionSelector: FunctionSelector, _args: Fr[], _argsHash: Fr, _isStaticCall: boolean): Promise<Fr[]>;
38
- txeSimulateUtilityFunction(_targetContractAddress: AztecAddress, _functionSelector: FunctionSelector, _args: Fr[]): Promise<Fr[]>;
39
- txePublicCallNewFlow(_from: AztecAddress, _targetContractAddress: AztecAddress, _calldata: Fr[], _isStaticCall: boolean): Promise<Fr[]>;
40
- }
41
- //# sourceMappingURL=txe_typed_oracle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"txe_typed_oracle.d.ts","sourceRoot":"","sources":["../../src/oracle/txe_typed_oracle.ts"],"names":[],"mappings":"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"}
@@ -1,89 +0,0 @@
1
- import { TypedOracle } from '@aztec/pxe/simulator';
2
- class OracleMethodNotAvailableError extends Error {
3
- constructor(className, methodName){
4
- super(`Oracle method ${methodName} is not implemented in handler ${className}.`);
5
- }
6
- }
7
- export class TXETypedOracle extends TypedOracle {
8
- avmOpcodeAddress() {
9
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeAddress');
10
- }
11
- avmOpcodeBlockNumber() {
12
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeBlockNumber');
13
- }
14
- avmOpcodeTimestamp() {
15
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeTimestamp');
16
- }
17
- avmOpcodeIsStaticCall() {
18
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeIsStaticCall');
19
- }
20
- avmOpcodeChainId() {
21
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeChainId');
22
- }
23
- avmOpcodeVersion() {
24
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeVersion');
25
- }
26
- avmOpcodeEmitNullifier(_nullifier) {
27
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeEmitNullifier');
28
- }
29
- avmOpcodeEmitNoteHash(_noteHash) {
30
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeEmitNoteHash');
31
- }
32
- avmOpcodeNullifierExists(_innerNullifier, _targetAddress) {
33
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeNullifierExists');
34
- }
35
- avmOpcodeStorageWrite(_slot, _value) {
36
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeStorageWrite');
37
- }
38
- avmOpcodeStorageRead(_slot) {
39
- throw new OracleMethodNotAvailableError(this.className, 'avmOpcodeStorageRead');
40
- }
41
- txeGetPrivateContextInputs(_blockNumber) {
42
- throw new OracleMethodNotAvailableError(this.className, 'txeGetPrivateContextInputs');
43
- }
44
- txeGetNextBlockNumber() {
45
- throw new OracleMethodNotAvailableError(this.className, 'txeGetNextBlockNumber');
46
- }
47
- txeGetNextBlockTimestamp() {
48
- throw new OracleMethodNotAvailableError(this.className, 'txeGetNextBlockTimestamp');
49
- }
50
- txeAdvanceBlocksBy(_blocks) {
51
- throw new OracleMethodNotAvailableError(this.className, 'txeAdvanceBlocksBy');
52
- }
53
- txeAdvanceTimestampBy(_duration) {
54
- throw new OracleMethodNotAvailableError(this.className, 'txeAdvanceTimestampBy');
55
- }
56
- txeDeploy(_artifact, _instance, _foreignSecret) {
57
- throw new OracleMethodNotAvailableError(this.className, 'txeDeploy');
58
- }
59
- txeCreateAccount(_secret) {
60
- throw new OracleMethodNotAvailableError(this.className, 'txeCreateAccount');
61
- }
62
- txeAddAccount(_artifact, _instance, _secret) {
63
- throw new OracleMethodNotAvailableError(this.className, 'txeAddAccount');
64
- }
65
- txeAddAuthWitness(_address, _messageHash) {
66
- throw new OracleMethodNotAvailableError(this.className, 'txeAddAuthWitness');
67
- }
68
- txeGetLastBlockTimestamp() {
69
- throw new OracleMethodNotAvailableError(this.className, 'txeGetLastBlockTimestamp');
70
- }
71
- txeGetLastTxEffects() {
72
- throw new OracleMethodNotAvailableError(this.className, 'txeGetLastTxEffects');
73
- }
74
- storageWrite(_startStorageSlot, _values) {
75
- throw new OracleMethodNotAvailableError(this.className, 'storageWrite');
76
- }
77
- getMsgSender() {
78
- throw new OracleMethodNotAvailableError(this.className, 'getMsgSender');
79
- }
80
- txePrivateCallNewFlow(_from, _targetContractAddress, _functionSelector, _args, _argsHash, _isStaticCall) {
81
- throw new OracleMethodNotAvailableError(this.className, 'txePrivateCallNewFlow');
82
- }
83
- txeSimulateUtilityFunction(_targetContractAddress, _functionSelector, _args) {
84
- throw new OracleMethodNotAvailableError(this.className, 'simulateUtilityFunction');
85
- }
86
- txePublicCallNewFlow(_from, _targetContractAddress, _calldata, _isStaticCall) {
87
- throw new OracleMethodNotAvailableError(this.className, 'txePublicCallNewFlow');
88
- }
89
- }