envio 3.10.0-subgraph → 3.11.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.
Files changed (76) hide show
  1. package/evm.schema.json +21 -4
  2. package/fuel.schema.json +21 -4
  3. package/index.d.ts +1 -1
  4. package/package.json +6 -6
  5. package/src/ChainState.res +9 -73
  6. package/src/ChainState.res.mjs +6 -58
  7. package/src/Config.res +73 -27
  8. package/src/Config.res.mjs +71 -21
  9. package/src/Core.res +0 -15
  10. package/src/Core.res.mjs +0 -11
  11. package/src/EventConfigBuilder.res +14 -10
  12. package/src/EventConfigBuilder.res.mjs +6 -4
  13. package/src/EventProcessing.res +6 -6
  14. package/src/EventProcessing.res.mjs +6 -8
  15. package/src/HandlerLoader.res +8 -20
  16. package/src/HandlerLoader.res.mjs +2 -11
  17. package/src/HandlerRegister.res +12 -11
  18. package/src/HandlerRegister.res.mjs +6 -5
  19. package/src/Internal.res +20 -4
  20. package/src/Internal.res.mjs +9 -0
  21. package/src/Main.res +8 -1
  22. package/src/Main.res.mjs +3 -3
  23. package/src/Persistence.res +11 -1
  24. package/src/Persistence.res.mjs +6 -2
  25. package/src/PgStorage.res +1 -1
  26. package/src/PgStorage.res.mjs +1 -1
  27. package/src/SimulateItems.res +13 -6
  28. package/src/SimulateItems.res.mjs +7 -6
  29. package/src/TestIndexer.res +6 -5
  30. package/src/TestIndexer.res.mjs +5 -4
  31. package/src/UserContext.res +51 -358
  32. package/src/UserContext.res.mjs +35 -271
  33. package/src/db/InternalTable.res +1 -1
  34. package/src/db/InternalTable.res.mjs +2 -1
  35. package/src/sources/ChainSources.res +72 -0
  36. package/src/sources/ChainSources.res.mjs +55 -0
  37. package/src/sources/EvmHyperSyncSource.res +10 -22
  38. package/src/sources/EvmHyperSyncSource.res.mjs +9 -41
  39. package/src/sources/FuelHyperSyncSource.res +10 -18
  40. package/src/sources/FuelHyperSyncSource.res.mjs +8 -38
  41. package/src/sources/HyperSync.res +31 -0
  42. package/src/sources/HyperSync.res.mjs +31 -0
  43. package/src/sources/HyperSync.resi +16 -0
  44. package/src/sources/StartBlockResolver.res +173 -0
  45. package/src/sources/StartBlockResolver.res.mjs +134 -0
  46. package/src/sources/Svm.res +0 -51
  47. package/src/sources/Svm.res.mjs +0 -46
  48. package/src/sources/SvmHyperSyncSource.res +20 -9
  49. package/src/sources/SvmHyperSyncSource.res.mjs +34 -12
  50. package/svm.schema.json +78 -63
  51. package/src/subgraph/blocks.ts +0 -176
  52. package/src/subgraph/calls.ts +0 -217
  53. package/src/subgraph/conformance.ts +0 -102
  54. package/src/subgraph/division.ts +0 -133
  55. package/src/subgraph/errors.ts +0 -90
  56. package/src/subgraph/graph-ts-types/VERSION +0 -2
  57. package/src/subgraph/graph-ts-types/chain/arweave.d.ts +0 -70
  58. package/src/subgraph/graph-ts-types/chain/cosmos.d.ts +0 -327
  59. package/src/subgraph/graph-ts-types/chain/ethereum.d.ts +0 -233
  60. package/src/subgraph/graph-ts-types/chain/near.d.ts +0 -253
  61. package/src/subgraph/graph-ts-types/chain/starknet.d.ts +0 -32
  62. package/src/subgraph/graph-ts-types/common/collections.d.ts +0 -136
  63. package/src/subgraph/graph-ts-types/common/conversion.d.ts +0 -11
  64. package/src/subgraph/graph-ts-types/common/datasource.d.ts +0 -30
  65. package/src/subgraph/graph-ts-types/common/eager-offset.d.ts +0 -0
  66. package/src/subgraph/graph-ts-types/common/json.d.ts +0 -17
  67. package/src/subgraph/graph-ts-types/common/numbers.d.ts +0 -120
  68. package/src/subgraph/graph-ts-types/common/value.d.ts +0 -120
  69. package/src/subgraph/graph-ts-types/common/yaml.d.ts +0 -90
  70. package/src/subgraph/graph-ts-types/global/global.d.ts +0 -194
  71. package/src/subgraph/graph-ts-types/helper-functions.d.ts +0 -22
  72. package/src/subgraph/graph-ts-types/index.d.ts +0 -102
  73. package/src/subgraph/graph-ts.ts +0 -1948
  74. package/src/subgraph/hosts.ts +0 -148
  75. package/src/subgraph/runtime.ts +0 -863
  76. package/src/subgraph/scope.ts +0 -66
@@ -1,233 +0,0 @@
1
- import '../common/eager-offset';
2
- import { Bytes, Wrapped } from '../common/collections';
3
- import { Address, BigInt } from '../common/numbers';
4
- /** Host Ethereum interface */
5
- export declare namespace ethereum {
6
- function call(call: SmartContractCall): Array<Value> | null;
7
- function getBalance(address: Address): BigInt;
8
- function hasCode(address: Address): Wrapped<boolean>;
9
- function encode(token: Value): Bytes | null;
10
- function decode(types: string, data: Bytes): Value | null;
11
- }
12
- export declare namespace ethereum {
13
- /** Type hint for Ethereum values. */
14
- enum ValueKind {
15
- ADDRESS = 0,
16
- FIXED_BYTES = 1,
17
- BYTES = 2,
18
- INT = 3,
19
- UINT = 4,
20
- BOOL = 5,
21
- STRING = 6,
22
- FIXED_ARRAY = 7,
23
- ARRAY = 8,
24
- TUPLE = 9
25
- }
26
- /**
27
- * Pointer type for Ethereum value data.
28
- *
29
- * Big enough to fit any pointer or native `this.data`.
30
- */
31
- type ValuePayload = bigint;
32
- /**
33
- * A dynamically typed value used when accessing Ethereum data.
34
- */
35
- class Value {
36
- kind: ValueKind;
37
- data: ValuePayload;
38
- constructor(kind: ValueKind, data: ValuePayload);
39
- lt(_: Value): boolean;
40
- gt(_: Value): boolean;
41
- toAddress(): Address;
42
- toBoolean(): boolean;
43
- toBytes(): Bytes;
44
- toI32(): number;
45
- toBigInt(): BigInt;
46
- toString(): string;
47
- toArray(): Array<Value>;
48
- toTuple(): Tuple;
49
- toMatrix(): Array<Array<Value>>;
50
- toTupleArray<T extends Tuple>(): Array<T>;
51
- toTupleMatrix<T extends Tuple>(): Array<Array<T>>;
52
- toBooleanArray(): Array<boolean>;
53
- toBytesArray(): Array<Bytes>;
54
- toAddressArray(): Array<Address>;
55
- toStringArray(): Array<string>;
56
- toI32Array(): Array<number>;
57
- toBigIntArray(): Array<BigInt>;
58
- toBooleanMatrix(): Array<Array<boolean>>;
59
- toBytesMatrix(): Array<Array<Bytes>>;
60
- toAddressMatrix(): Array<Array<Address>>;
61
- toStringMatrix(): Array<Array<string>>;
62
- toI32Matrix(): Array<Array<number>>;
63
- toBigIntMatrix(): Array<Array<BigInt>>;
64
- static fromAddress(address: Address): Value;
65
- static fromBoolean(b: boolean): Value;
66
- static fromBytes(bytes: Bytes): Value;
67
- static fromFixedBytes(bytes: Bytes): Value;
68
- static fromI32(i: number): Value;
69
- static fromSignedBigInt(i: BigInt): Value;
70
- static fromUnsignedBigInt(i: BigInt): Value;
71
- static fromString(s: string): Value;
72
- static fromArray(values: Array<Value>): Value;
73
- static fromFixedSizedArray(values: Array<Value>): Value;
74
- static fromTuple(values: Tuple): Value;
75
- static fromMatrix(values: Array<Array<Value>>): Value;
76
- static fromTupleArray(values: Array<Tuple>): Value;
77
- static fromTupleMatrix(values: Array<Array<Tuple>>): Value;
78
- static fromBooleanArray(values: Array<boolean>): Value;
79
- static fromBytesArray(values: Array<Bytes>): Value;
80
- static fromFixedBytesArray(values: Array<Bytes>): Value;
81
- static fromAddressArray(values: Array<Address>): Value;
82
- static fromStringArray(values: Array<string>): Value;
83
- static fromI32Array(values: Array<number>): Value;
84
- static fromSignedBigIntArray(values: Array<BigInt>): Value;
85
- static fromUnsignedBigIntArray(values: Array<BigInt>): Value;
86
- static fromBooleanMatrix(values: Array<Array<boolean>>): Value;
87
- static fromBytesMatrix(values: Array<Array<Bytes>>): Value;
88
- static fromFixedBytesMatrix(values: Array<Array<Bytes>>): Value;
89
- static fromAddressMatrix(values: Array<Array<Address>>): Value;
90
- static fromStringMatrix(values: Array<Array<string>>): Value;
91
- static fromI32Matrix(values: Array<Array<number>>): Value;
92
- static fromSignedBigIntMatrix(values: Array<Array<BigInt>>): Value;
93
- static fromUnsignedBigIntMatrix(values: Array<Array<BigInt>>): Value;
94
- }
95
- /**
96
- * Common representation for Ethereum tuples / Solidity structs.
97
- *
98
- * This base class stores the tuple/struct values in an array. The Graph CLI
99
- * code generation then creates subclasses that provide named getters to
100
- * access the members by name.
101
- */
102
- class Tuple extends Array<Value> {
103
- }
104
- /**
105
- * An Ethereum block.
106
- */
107
- class Block {
108
- hash: Bytes;
109
- parentHash: Bytes;
110
- unclesHash: Bytes;
111
- author: Address;
112
- stateRoot: Bytes;
113
- transactionsRoot: Bytes;
114
- receiptsRoot: Bytes;
115
- number: BigInt;
116
- gasUsed: BigInt;
117
- gasLimit: BigInt;
118
- timestamp: BigInt;
119
- difficulty: BigInt;
120
- totalDifficulty: BigInt;
121
- size: BigInt | null;
122
- baseFeePerGas: BigInt | null;
123
- constructor(hash: Bytes, parentHash: Bytes, unclesHash: Bytes, author: Address, stateRoot: Bytes, transactionsRoot: Bytes, receiptsRoot: Bytes, number: BigInt, gasUsed: BigInt, gasLimit: BigInt, timestamp: BigInt, difficulty: BigInt, totalDifficulty: BigInt, size: BigInt | null, baseFeePerGas: BigInt | null);
124
- }
125
- /**
126
- * An Ethereum transaction.
127
- */
128
- class Transaction {
129
- hash: Bytes;
130
- index: BigInt;
131
- from: Address;
132
- to: Address | null;
133
- value: BigInt;
134
- gasLimit: BigInt;
135
- gasPrice: BigInt;
136
- input: Bytes;
137
- nonce: BigInt;
138
- constructor(hash: Bytes, index: BigInt, from: Address, to: Address | null, value: BigInt, gasLimit: BigInt, gasPrice: BigInt, input: Bytes, nonce: BigInt);
139
- }
140
- /**
141
- * An Ethereum transaction receipt.
142
- */
143
- class TransactionReceipt {
144
- transactionHash: Bytes;
145
- transactionIndex: BigInt;
146
- blockHash: Bytes;
147
- blockNumber: BigInt;
148
- cumulativeGasUsed: BigInt;
149
- gasUsed: BigInt;
150
- contractAddress: Address;
151
- logs: Array<Log>;
152
- status: BigInt;
153
- root: Bytes;
154
- logsBloom: Bytes;
155
- constructor(transactionHash: Bytes, transactionIndex: BigInt, blockHash: Bytes, blockNumber: BigInt, cumulativeGasUsed: BigInt, gasUsed: BigInt, contractAddress: Address, logs: Array<Log>, status: BigInt, root: Bytes, logsBloom: Bytes);
156
- }
157
- /**
158
- * An Ethereum event log.
159
- */
160
- class Log {
161
- address: Address;
162
- topics: Array<Bytes>;
163
- data: Bytes;
164
- blockHash: Bytes;
165
- blockNumber: Bytes;
166
- transactionHash: Bytes;
167
- transactionIndex: BigInt;
168
- logIndex: BigInt;
169
- transactionLogIndex: BigInt;
170
- logType: string;
171
- removed: Wrapped<boolean> | null;
172
- constructor(address: Address, topics: Array<Bytes>, data: Bytes, blockHash: Bytes, blockNumber: Bytes, transactionHash: Bytes, transactionIndex: BigInt, logIndex: BigInt, transactionLogIndex: BigInt, logType: string, removed: Wrapped<boolean> | null);
173
- }
174
- /**
175
- * Common representation for Ethereum smart contract calls.
176
- */
177
- class Call {
178
- to: Address;
179
- from: Address;
180
- block: Block;
181
- transaction: Transaction;
182
- inputValues: Array<EventParam>;
183
- outputValues: Array<EventParam>;
184
- constructor(to: Address, from: Address, block: Block, transaction: Transaction, inputValues: Array<EventParam>, outputValues: Array<EventParam>);
185
- }
186
- /**
187
- * Common representation for Ethereum smart contract events.
188
- */
189
- class Event {
190
- address: Address;
191
- logIndex: BigInt;
192
- transactionLogIndex: BigInt;
193
- logType: string | null;
194
- block: Block;
195
- transaction: Transaction;
196
- parameters: Array<EventParam>;
197
- receipt: TransactionReceipt | null;
198
- constructor(address: Address, logIndex: BigInt, transactionLogIndex: BigInt, logType: string | null, block: Block, transaction: Transaction, parameters: Array<EventParam>, receipt: TransactionReceipt | null);
199
- }
200
- /**
201
- * A dynamically-typed Ethereum event parameter.
202
- */
203
- class EventParam {
204
- name: string;
205
- value: Value;
206
- constructor(name: string, value: Value);
207
- }
208
- class SmartContractCall {
209
- contractName: string;
210
- contractAddress: Address;
211
- functionName: string;
212
- functionSignature: string;
213
- functionParams: Array<Value>;
214
- constructor(contractName: string, contractAddress: Address, functionName: string, functionSignature: string, functionParams: Array<Value>);
215
- }
216
- /**
217
- * Low-level interaction with Ethereum smart contracts
218
- */
219
- class SmartContract {
220
- _name: string;
221
- _address: Address;
222
- protected constructor(name: string, address: Address);
223
- call(name: string, signature: string, params: Array<Value>): Array<Value>;
224
- tryCall(name: string, signature: string, params: Array<Value>): CallResult<Array<Value>>;
225
- }
226
- class CallResult<T> {
227
- private _value;
228
- constructor();
229
- static fromValue<T>(value: T): CallResult<T>;
230
- get reverted(): boolean;
231
- get value(): T;
232
- }
233
- }
@@ -1,253 +0,0 @@
1
- import '../common/eager-offset';
2
- import { Bytes } from '../common/collections';
3
- import { BigInt } from '../common/numbers';
4
- export declare namespace near {
5
- type CryptoHash = Bytes;
6
- type Account = string;
7
- type BlockHeight = bigint;
8
- type Balance = BigInt;
9
- type Gas = bigint;
10
- type ShardId = bigint;
11
- type NumBlocks = bigint;
12
- type ProtocolVersion = number;
13
- type Payload = bigint;
14
- enum CurveKind {
15
- ED25519 = 0,
16
- SECP256K1 = 1
17
- }
18
- class Signature {
19
- kind: CurveKind;
20
- bytes: Bytes;
21
- constructor(kind: CurveKind, bytes: Bytes);
22
- }
23
- class PublicKey {
24
- kind: CurveKind;
25
- bytes: Bytes;
26
- constructor(kind: CurveKind, bytes: Bytes);
27
- }
28
- enum AccessKeyPermissionKind {
29
- FUNCTION_CALL = 0,
30
- FULL_ACCESS = 1
31
- }
32
- class FunctionCallPermission {
33
- allowance: BigInt;
34
- receiverId: string;
35
- methodNames: Array<string>;
36
- constructor(allowance: BigInt, receiverId: string, methodNames: Array<string>);
37
- }
38
- class FullAccessPermission {
39
- }
40
- class AccessKeyPermissionValue {
41
- kind: AccessKeyPermissionKind;
42
- data: Payload;
43
- constructor(kind: AccessKeyPermissionKind, data: Payload);
44
- toFunctionCall(): FunctionCallPermission;
45
- toFullAccess(): FullAccessPermission;
46
- static fromFunctionCall(input: FunctionCallPermission): AccessKeyPermissionValue;
47
- static fromFullAccess(input: FullAccessPermission): AccessKeyPermissionValue;
48
- }
49
- class AccessKey {
50
- nonce: bigint;
51
- permission: AccessKeyPermissionValue;
52
- constructor(nonce: bigint, permission: AccessKeyPermissionValue);
53
- }
54
- class DataReceiver {
55
- dataId: CryptoHash;
56
- receiverId: string;
57
- constructor(dataId: CryptoHash, receiverId: string);
58
- }
59
- enum ActionKind {
60
- CREATE_ACCOUNT = 0,
61
- DEPLOY_CONTRACT = 1,
62
- FUNCTION_CALL = 2,
63
- TRANSFER = 3,
64
- STAKE = 4,
65
- ADD_KEY = 5,
66
- DELETE_KEY = 6,
67
- DELETE_ACCOUNT = 7
68
- }
69
- class CreateAccountAction {
70
- }
71
- class DeployContractAction {
72
- codeHash: Bytes;
73
- constructor(codeHash: Bytes);
74
- }
75
- class FunctionCallAction {
76
- methodName: string;
77
- args: Bytes;
78
- gas: bigint;
79
- deposit: BigInt;
80
- constructor(methodName: string, args: Bytes, gas: bigint, deposit: BigInt);
81
- }
82
- class TransferAction {
83
- deposit: BigInt;
84
- constructor(deposit: BigInt);
85
- }
86
- class StakeAction {
87
- stake: Balance;
88
- publicKey: PublicKey;
89
- constructor(stake: Balance, publicKey: PublicKey);
90
- }
91
- class AddKeyAction {
92
- publicKey: PublicKey;
93
- accessKey: AccessKey;
94
- constructor(publicKey: PublicKey, accessKey: AccessKey);
95
- }
96
- class DeleteKeyAction {
97
- publicKey: PublicKey;
98
- constructor(publicKey: PublicKey);
99
- }
100
- class DeleteAccountAction {
101
- beneficiaryId: Account;
102
- constructor(beneficiaryId: Account);
103
- }
104
- class ActionValue {
105
- kind: ActionKind;
106
- data: Payload;
107
- constructor(kind: ActionKind, data: Payload);
108
- toCreateAccount(): CreateAccountAction;
109
- toDeployContract(): DeployContractAction;
110
- toFunctionCall(): FunctionCallAction;
111
- toTransfer(): TransferAction;
112
- toStake(): StakeAction;
113
- toAddKey(): AddKeyAction;
114
- toDeleteKey(): DeleteKeyAction;
115
- toDeleteAccount(): DeleteAccountAction;
116
- static fromCreateAccount(input: CreateAccountAction): ActionValue;
117
- static fromDeployContract(input: DeployContractAction): ActionValue;
118
- static fromFunctionCall(input: FunctionCallAction): ActionValue;
119
- static fromTransfer(input: TransferAction): ActionValue;
120
- static fromStake(input: StakeAction): ActionValue;
121
- static fromAddKey(input: AddKeyAction): ActionValue;
122
- static fromDeleteKey(input: DeleteKeyAction): ActionValue;
123
- static fromDeleteAccount(input: DeleteAccountAction): ActionValue;
124
- }
125
- class ActionReceipt {
126
- predecessorId: string;
127
- receiverId: string;
128
- id: CryptoHash;
129
- signerId: string;
130
- signerPublicKey: PublicKey;
131
- gasPrice: BigInt;
132
- outputDataReceivers: Array<DataReceiver>;
133
- inputDataIds: Array<CryptoHash>;
134
- actions: Array<ActionValue>;
135
- constructor(predecessorId: string, receiverId: string, id: CryptoHash, signerId: string, signerPublicKey: PublicKey, gasPrice: BigInt, outputDataReceivers: Array<DataReceiver>, inputDataIds: Array<CryptoHash>, actions: Array<ActionValue>);
136
- }
137
- enum SuccessStatusKind {
138
- VALUE = 0,
139
- RECEIPT_ID = 1
140
- }
141
- class SuccessStatus {
142
- kind: SuccessStatusKind;
143
- data: Payload;
144
- constructor(kind: SuccessStatusKind, data: Payload);
145
- toValue(): Bytes;
146
- toReceiptId(): CryptoHash;
147
- static fromValue(input: Bytes): SuccessStatus;
148
- static fromReceiptId(input: CryptoHash): SuccessStatus;
149
- }
150
- enum Direction {
151
- LEFT = 0,
152
- RIGHT = 1
153
- }
154
- class MerklePathItem {
155
- hash: CryptoHash;
156
- direction: Direction;
157
- constructor(hash: CryptoHash, direction: Direction);
158
- lt(_: MerklePathItem): boolean;
159
- gt(_: MerklePathItem): boolean;
160
- toString(): string;
161
- }
162
- class MerklePath extends Array<MerklePathItem> {
163
- }
164
- class ExecutionOutcome {
165
- gasBurnt: bigint;
166
- proof: MerklePath;
167
- blockHash: CryptoHash;
168
- id: CryptoHash;
169
- logs: Array<string>;
170
- receiptIds: Array<CryptoHash>;
171
- tokensBurnt: BigInt;
172
- executorId: string;
173
- status: SuccessStatus;
174
- constructor(gasBurnt: bigint, proof: MerklePath, blockHash: CryptoHash, id: CryptoHash, logs: Array<string>, receiptIds: Array<CryptoHash>, tokensBurnt: BigInt, executorId: string, status: SuccessStatus);
175
- }
176
- class SlashedValidator {
177
- account: Account;
178
- isDoubleSign: boolean;
179
- constructor(account: Account, isDoubleSign: boolean);
180
- }
181
- class BlockHeader {
182
- height: BlockHeight;
183
- prevHeight: BlockHeight;
184
- blockOrdinal: NumBlocks;
185
- epochId: CryptoHash;
186
- nextEpochId: CryptoHash;
187
- chunksIncluded: bigint;
188
- hash: CryptoHash;
189
- prevHash: CryptoHash;
190
- timestampNanosec: bigint;
191
- prevStateRoot: CryptoHash;
192
- chunkReceiptsRoot: CryptoHash;
193
- chunkHeadersRoot: CryptoHash;
194
- chunkTxRoot: CryptoHash;
195
- outcomeRoot: CryptoHash;
196
- challengesRoot: CryptoHash;
197
- randomValue: CryptoHash;
198
- validatorProposals: Array<ValidatorStake>;
199
- chunkMask: Array<boolean>;
200
- gasPrice: Balance;
201
- totalSupply: Balance;
202
- challengesResult: Array<SlashedValidator>;
203
- lastFinalBlock: CryptoHash;
204
- lastDsFinalBlock: CryptoHash;
205
- nextBpHash: CryptoHash;
206
- blockMerkleRoot: CryptoHash;
207
- epochSyncDataHash: CryptoHash;
208
- approvals: Array<Signature>;
209
- signature: Signature;
210
- latestProtocolVersion: ProtocolVersion;
211
- constructor(height: BlockHeight, prevHeight: BlockHeight, // Always zero when version < V3
212
- blockOrdinal: NumBlocks, // Always zero when version < V3
213
- epochId: CryptoHash, nextEpochId: CryptoHash, chunksIncluded: bigint, hash: CryptoHash, prevHash: CryptoHash, timestampNanosec: bigint, prevStateRoot: CryptoHash, chunkReceiptsRoot: CryptoHash, chunkHeadersRoot: CryptoHash, chunkTxRoot: CryptoHash, outcomeRoot: CryptoHash, challengesRoot: CryptoHash, randomValue: CryptoHash, validatorProposals: Array<ValidatorStake>, chunkMask: Array<boolean>, gasPrice: Balance, totalSupply: Balance, challengesResult: Array<SlashedValidator>, lastFinalBlock: CryptoHash, lastDsFinalBlock: CryptoHash, nextBpHash: CryptoHash, blockMerkleRoot: CryptoHash, epochSyncDataHash: CryptoHash, // Always empty when version < V3
214
- approvals: Array<Signature>, // Array<Option<Signature>>
215
- signature: Signature, latestProtocolVersion: ProtocolVersion);
216
- }
217
- class ValidatorStake {
218
- account: Account;
219
- publicKey: PublicKey;
220
- stake: Balance;
221
- constructor(account: Account, publicKey: PublicKey, stake: Balance);
222
- }
223
- class ChunkHeader {
224
- encodedLength: bigint;
225
- gasUsed: Gas;
226
- gasLimit: Gas;
227
- shardId: ShardId;
228
- heightCreated: BlockHeight;
229
- heightIncluded: BlockHeight;
230
- chunkHash: CryptoHash;
231
- signature: Signature;
232
- prevBlockHash: CryptoHash;
233
- prevStateRoot: CryptoHash;
234
- encodedMerkleRoot: CryptoHash;
235
- balanceBurnt: Balance;
236
- outgoingReceiptsRoot: CryptoHash;
237
- txRoot: CryptoHash;
238
- validatorProposals: Array<ValidatorStake>;
239
- constructor(encodedLength: bigint, gasUsed: Gas, gasLimit: Gas, shardId: ShardId, heightCreated: BlockHeight, heightIncluded: BlockHeight, chunkHash: CryptoHash, signature: Signature, prevBlockHash: CryptoHash, prevStateRoot: CryptoHash, encodedMerkleRoot: CryptoHash, balanceBurnt: Balance, outgoingReceiptsRoot: CryptoHash, txRoot: CryptoHash, validatorProposals: Array<ValidatorStake>);
240
- }
241
- class Block {
242
- author: Account;
243
- header: BlockHeader;
244
- chunks: Array<ChunkHeader>;
245
- constructor(author: Account, header: BlockHeader, chunks: Array<ChunkHeader>);
246
- }
247
- class ReceiptWithOutcome {
248
- outcome: ExecutionOutcome;
249
- receipt: ActionReceipt;
250
- block: Block;
251
- constructor(outcome: ExecutionOutcome, receipt: ActionReceipt, block: Block);
252
- }
253
- }
@@ -1,32 +0,0 @@
1
- import '../common/eager-offset';
2
- import { Bytes } from '../common/collections';
3
- import { BigInt } from '../common/numbers';
4
- export declare namespace starknet {
5
- class Block {
6
- number: BigInt;
7
- hash: Bytes;
8
- prevHash: Bytes;
9
- timestamp: BigInt;
10
- constructor(number: BigInt, hash: Bytes, prevHash: Bytes, timestamp: BigInt);
11
- }
12
- class Transaction {
13
- type: TransactionType;
14
- hash: Bytes;
15
- constructor(type: TransactionType, hash: Bytes);
16
- }
17
- enum TransactionType {
18
- DEPLOY = 0,
19
- INVOKE_FUNCTION = 1,
20
- DECLARE = 2,
21
- L1_HANDLER = 3,
22
- DEPLOY_ACCOUNT = 4
23
- }
24
- class Event {
25
- fromAddr: Bytes;
26
- keys: Array<Bytes>;
27
- data: Array<Bytes>;
28
- block: Block;
29
- transaction: Transaction;
30
- constructor(fromAddr: Bytes, keys: Array<Bytes>, data: Array<Bytes>, block: Block, transaction: Transaction);
31
- }
32
- }
@@ -1,136 +0,0 @@
1
- import { BigDecimal, BigInt } from './numbers';
2
- import { Value } from './value';
3
- /**
4
- * Byte array
5
- */
6
- export declare class ByteArray extends Uint8Array {
7
- /**
8
- * Returns bytes in little-endian order.
9
- */
10
- static fromI32(x: number): ByteArray;
11
- /**
12
- * Returns bytes in little-endian order.
13
- */
14
- static fromU32(x: number): ByteArray;
15
- /**
16
- * Returns bytes in little-endian order.
17
- */
18
- static fromI64(x: bigint): ByteArray;
19
- /**
20
- * Returns bytes in little-endian order.
21
- */
22
- static fromU64(x: bigint): ByteArray;
23
- static empty(): ByteArray;
24
- /**
25
- * Convert the string `hex` which must consist of an even number of
26
- * hexadecimal digits to a `ByteArray`. The string `hex` can optionally
27
- * start with '0x'
28
- */
29
- static fromHexString(hex: string): ByteArray;
30
- static fromUTF8(str: string): ByteArray;
31
- static fromBigInt(bigInt: BigInt): ByteArray;
32
- toHex(): string;
33
- toHexString(): string;
34
- toString(): string;
35
- toBase58(): string;
36
- /**
37
- * Interprets the byte array as a little-endian U32.
38
- * Throws in case of overflow.
39
- */
40
- toU32(): number;
41
- /**
42
- * Interprets the byte array as a little-endian I32.
43
- * Throws in case of overflow.
44
- */
45
- toI32(): number;
46
- /** Create a new `ByteArray` that consist of `this` directly followed by
47
- * the bytes from `other` */
48
- concat(other: ByteArray): ByteArray;
49
- /** Create a new `ByteArray` that consists of `this` directly followed by
50
- * the representation of `other` as bytes */
51
- concatI32(other: number): ByteArray;
52
- /**
53
- * Interprets the byte array as a little-endian I64.
54
- * Throws in case of overflow.
55
- */
56
- toI64(): bigint;
57
- /**
58
- * Interprets the byte array as a little-endian U64.
59
- * Throws in case of overflow.
60
- */
61
- toU64(): bigint;
62
- equals(other: ByteArray): boolean;
63
- notEqual(other: ByteArray): boolean;
64
- }
65
- /** A dynamically-sized byte array. */
66
- export declare class Bytes extends ByteArray {
67
- static fromByteArray(byteArray: ByteArray): Bytes;
68
- static fromUint8Array(uint8Array: Uint8Array): Bytes;
69
- /**
70
- * Convert the string `hex` which must consist of an even number of
71
- * hexadecimal digits to a `ByteArray`. The string `hex` can optionally
72
- * start with '0x'
73
- */
74
- static fromHexString(str: string): Bytes;
75
- static fromUTF8(str: string): Bytes;
76
- static fromI32(i: number): Bytes;
77
- static empty(): Bytes;
78
- concat(other: Bytes): Bytes;
79
- concatI32(other: number): Bytes;
80
- }
81
- /**
82
- * TypedMap entry.
83
- */
84
- export declare class TypedMapEntry<K, V> {
85
- key: K;
86
- value: V;
87
- constructor(key: K, value: V);
88
- }
89
- /** Typed map */
90
- export declare class TypedMap<K, V> {
91
- entries: Array<TypedMapEntry<K, V>>;
92
- constructor();
93
- set(key: K, value: V): void;
94
- getEntry(key: K): TypedMapEntry<K, V> | null;
95
- mustGetEntry(key: K): TypedMapEntry<K, V>;
96
- get(key: K): V | null;
97
- mustGet(key: K): V;
98
- isSet(key: K): boolean;
99
- }
100
- /**
101
- * Common representation for entity data, storing entity attributes
102
- * as `string` keys and the attribute values as dynamically-typed
103
- * `Value` objects.
104
- */
105
- export declare class Entity extends TypedMap<string, Value> {
106
- unset(key: string): void;
107
- /** Assigns properties from sources to this Entity in right-to-left order */
108
- merge(sources: Array<Entity>): Entity;
109
- setString(key: string, value: string): void;
110
- setI32(key: string, value: number): void;
111
- setBigInt(key: string, value: BigInt): void;
112
- setBytes(key: string, value: Bytes): void;
113
- setBoolean(key: string, value: boolean): void;
114
- setBigDecimal(key: string, value: BigDecimal): void;
115
- getString(key: string): string;
116
- getI32(key: string): number;
117
- getBigInt(key: string): BigInt;
118
- getBytes(key: string): Bytes;
119
- getBoolean(key: string): boolean;
120
- getBigDecimal(key: string): BigDecimal;
121
- }
122
- /**
123
- * The result of an operation, with a corresponding value and error type.
124
- */
125
- export declare class Result<V, E> {
126
- _value: Wrapped<V> | null;
127
- _error: Wrapped<E> | null;
128
- get isOk(): boolean;
129
- get isError(): boolean;
130
- get value(): V;
131
- get error(): E;
132
- }
133
- export declare class Wrapped<T> {
134
- inner: T;
135
- constructor(inner: T);
136
- }
@@ -1,11 +0,0 @@
1
- import './eager-offset';
2
- import { Bytes } from './collections';
3
- /** Host type conversion interface */
4
- export declare namespace typeConversion {
5
- function bytesToString(bytes: Uint8Array): string;
6
- function bytesToHex(bytes: Uint8Array): string;
7
- function bigIntToString(bigInt: Uint8Array): string;
8
- function bigIntToHex(bigInt: Uint8Array): string;
9
- function stringToH160(s: string): Bytes;
10
- function bytesToBase58(n: Uint8Array): string;
11
- }
@@ -1,30 +0,0 @@
1
- import './eager-offset';
2
- import { Entity } from './collections';
3
- import { Address } from './numbers';
4
- /** Host interface for managing data sources */
5
- export declare namespace dataSource {
6
- function create(name: string, params: Array<string>): void;
7
- function createWithContext(name: string, params: Array<string>, context: DataSourceContext): void;
8
- function address(): Address;
9
- function network(): string;
10
- function context(): DataSourceContext;
11
- }
12
- export declare namespace dataSource {
13
- function stringParam(): string;
14
- }
15
- /** Context for dynamic data sources */
16
- export declare class DataSourceContext extends Entity {
17
- }
18
- /**
19
- * Base class for data source templates. Allows to dynamically create
20
- * data sources from templates at runtime.
21
- */
22
- export declare class DataSourceTemplate {
23
- /**
24
- * Dynamically creates a data source from the template with the
25
- * given name, using the parameter strings to configure the new
26
- * data source.
27
- */
28
- static create(name: string, params: Array<string>): void;
29
- static createWithContext(name: string, params: Array<string>, context: DataSourceContext): void;
30
- }