@apibara/evm 2.1.0-beta.23 → 2.1.0-beta.24
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/dist/index.cjs +386 -475
- package/dist/index.d.cts +1068 -2054
- package/dist/index.d.mts +1068 -2054
- package/dist/index.d.ts +1068 -2054
- package/dist/index.mjs +388 -466
- package/package.json +2 -4
- package/src/block.ts +312 -308
- package/src/common.ts +64 -101
- package/src/filter.ts +128 -138
- package/src/common.test.ts +0 -79
- package/src/filter.test.ts +0 -187
- package/src/helpers.ts +0 -8
package/dist/index.mjs
CHANGED
|
@@ -1,102 +1,73 @@
|
|
|
1
|
-
import { BytesFromUint8Array,
|
|
2
|
-
import {
|
|
3
|
-
import { hexToBytes, pad } from 'viem';
|
|
1
|
+
import { BytesFromUint8Array, StreamConfig } from '@apibara/protocol';
|
|
2
|
+
import { MessageCodec, RequiredCodec, BigIntCodec, DateCodec, OptionalCodec, ArrayCodec, NumberCodec, BooleanCodec, OneOfCodec, StringCodec } from '@apibara/protocol/codec';
|
|
4
3
|
import Long from 'long';
|
|
5
4
|
import _m0 from 'protobufjs/minimal.js';
|
|
6
5
|
|
|
7
6
|
const MAX_U64 = 0xffffffffffffffffn;
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const dv = new DataView(bytes.buffer);
|
|
24
|
-
const x0 = dv.getBigUint64(0);
|
|
25
|
-
const x1 = dv.getBigUint64(8);
|
|
26
|
-
const x2 = dv.getUint32(16);
|
|
27
|
-
return { x0, x1, x2 };
|
|
7
|
+
const MAX_U32 = 0xffffffffn;
|
|
8
|
+
const Address$1 = {
|
|
9
|
+
encode(x) {
|
|
10
|
+
const bn = BigInt(x);
|
|
11
|
+
const x2 = bn & MAX_U32;
|
|
12
|
+
const x1 = bn >> 32n & MAX_U64;
|
|
13
|
+
const x0 = bn >> 96n & MAX_U64;
|
|
14
|
+
return { x0, x1, x2: Number(x2) };
|
|
15
|
+
},
|
|
16
|
+
decode(p) {
|
|
17
|
+
const x0 = p.x0 ?? 0n;
|
|
18
|
+
const x1 = p.x1 ?? 0n;
|
|
19
|
+
const x2 = BigInt(p.x2 ?? 0);
|
|
20
|
+
const bn = x2 + (x1 << 32n) + (x0 << 96n);
|
|
21
|
+
return `0x${bn.toString(16).padStart(40, "0")}`;
|
|
28
22
|
}
|
|
29
|
-
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const B256$1 = Schema.transform(B256Proto, _B256, {
|
|
38
|
-
decode(value) {
|
|
39
|
-
const x0 = value.x0.toString(16).padStart(16, "0");
|
|
40
|
-
const x1 = value.x1.toString(16).padStart(16, "0");
|
|
41
|
-
const x2 = value.x2.toString(16).padStart(16, "0");
|
|
42
|
-
const x3 = value.x3.toString(16).padStart(16, "0");
|
|
43
|
-
return `0x${x0}${x1}${x2}${x3}`;
|
|
44
|
-
},
|
|
45
|
-
encode(value) {
|
|
46
|
-
const bytes = hexToBytes(pad(value, { size: 32, dir: "left" }));
|
|
47
|
-
const dv = new DataView(bytes.buffer);
|
|
48
|
-
const x0 = dv.getBigUint64(0);
|
|
49
|
-
const x1 = dv.getBigUint64(8);
|
|
50
|
-
const x2 = dv.getBigUint64(16);
|
|
51
|
-
const x3 = dv.getBigUint64(24);
|
|
23
|
+
};
|
|
24
|
+
const B256$1 = {
|
|
25
|
+
encode(x) {
|
|
26
|
+
const bn = BigInt(x);
|
|
27
|
+
const x3 = bn & MAX_U64;
|
|
28
|
+
const x2 = bn >> 64n & MAX_U64;
|
|
29
|
+
const x1 = bn >> 128n & MAX_U64;
|
|
30
|
+
const x0 = bn >> 192n & MAX_U64;
|
|
52
31
|
return { x0, x1, x2, x3 };
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const b256ToProto = Schema.encodeSync(B256$1);
|
|
56
|
-
const b256FromProto = Schema.decodeSync(B256$1);
|
|
57
|
-
const U256Proto = Schema.Struct({
|
|
58
|
-
x0: Schema.BigIntFromSelf,
|
|
59
|
-
x1: Schema.BigIntFromSelf,
|
|
60
|
-
x2: Schema.BigIntFromSelf,
|
|
61
|
-
x3: Schema.BigIntFromSelf
|
|
62
|
-
});
|
|
63
|
-
const U256$1 = Schema.transform(U256Proto, Schema.BigIntFromSelf, {
|
|
64
|
-
decode(value) {
|
|
65
|
-
return (value.x0 << 8n * 24n) + (value.x1 << 8n * 16n) + (value.x2 << 8n * 8n) + value.x3;
|
|
66
32
|
},
|
|
67
|
-
|
|
68
|
-
const x0 =
|
|
69
|
-
const x1 =
|
|
70
|
-
const x2 =
|
|
71
|
-
const x3 =
|
|
72
|
-
|
|
33
|
+
decode(p) {
|
|
34
|
+
const x0 = p.x0 ?? 0n;
|
|
35
|
+
const x1 = p.x1 ?? 0n;
|
|
36
|
+
const x2 = p.x2 ?? 0n;
|
|
37
|
+
const x3 = p.x3 ?? 0n;
|
|
38
|
+
const bn = x3 + (x2 << 64n) + (x1 << 128n) + (x0 << 192n);
|
|
39
|
+
return `0x${bn.toString(16).padStart(64, "0")}`;
|
|
73
40
|
}
|
|
74
|
-
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
return (value.x0 << 8n * 8n) + value.x1;
|
|
41
|
+
};
|
|
42
|
+
const U256$1 = {
|
|
43
|
+
encode(x) {
|
|
44
|
+
const bn = BigInt(x);
|
|
45
|
+
const x3 = bn & MAX_U64;
|
|
46
|
+
const x2 = bn >> 64n & MAX_U64;
|
|
47
|
+
const x1 = bn >> 128n & MAX_U64;
|
|
48
|
+
const x0 = bn >> 192n & MAX_U64;
|
|
49
|
+
return { x0, x1, x2, x3 };
|
|
84
50
|
},
|
|
85
|
-
|
|
86
|
-
const x0 =
|
|
87
|
-
const x1 =
|
|
51
|
+
decode(p) {
|
|
52
|
+
const x0 = p.x0 ?? 0n;
|
|
53
|
+
const x1 = p.x1 ?? 0n;
|
|
54
|
+
const x2 = p.x2 ?? 0n;
|
|
55
|
+
const x3 = p.x3 ?? 0n;
|
|
56
|
+
return x3 + (x2 << 64n) + (x1 << 128n) + (x0 << 192n);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const U128$1 = {
|
|
60
|
+
encode(x) {
|
|
61
|
+
const x1 = x & MAX_U64;
|
|
62
|
+
const x0 = x >> 64n & MAX_U64;
|
|
88
63
|
return { x0, x1 };
|
|
64
|
+
},
|
|
65
|
+
decode(p) {
|
|
66
|
+
const x0 = p.x0 ?? 0n;
|
|
67
|
+
const x1 = p.x1 ?? 0n;
|
|
68
|
+
return x1 + (x0 << 64n);
|
|
89
69
|
}
|
|
90
|
-
}
|
|
91
|
-
const u128ToProto = Schema.encodeSync(U128$1);
|
|
92
|
-
const u128FromProto = Schema.decodeSync(U128$1);
|
|
93
|
-
|
|
94
|
-
function tag(tag2) {
|
|
95
|
-
return Schema.Literal(tag2).pipe(
|
|
96
|
-
Schema.propertySignature,
|
|
97
|
-
Schema.fromKey("$case")
|
|
98
|
-
);
|
|
99
|
-
}
|
|
70
|
+
};
|
|
100
71
|
|
|
101
72
|
const protobufPackage$2 = "evm.v2";
|
|
102
73
|
function createBaseAddress() {
|
|
@@ -4061,417 +4032,368 @@ const index = {
|
|
|
4061
4032
|
filter: filter
|
|
4062
4033
|
};
|
|
4063
4034
|
|
|
4064
|
-
const Bloom =
|
|
4065
|
-
|
|
4066
|
-
value: BytesFromUint8Array
|
|
4067
|
-
}
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
strict: false,
|
|
4071
|
-
encode(value) {
|
|
4072
|
-
throw new Error("Not implemented");
|
|
4073
|
-
},
|
|
4074
|
-
decode({ value }) {
|
|
4075
|
-
return value;
|
|
4076
|
-
}
|
|
4035
|
+
const Bloom = {
|
|
4036
|
+
encode(x) {
|
|
4037
|
+
return { value: BytesFromUint8Array.encode(x) };
|
|
4038
|
+
},
|
|
4039
|
+
decode({ value }) {
|
|
4040
|
+
return BytesFromUint8Array.decode(value);
|
|
4077
4041
|
}
|
|
4078
|
-
|
|
4079
|
-
const TransactionStatus =
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
}
|
|
4042
|
+
};
|
|
4043
|
+
const TransactionStatus = {
|
|
4044
|
+
encode(x) {
|
|
4045
|
+
const enumMap = {
|
|
4046
|
+
unknown: TransactionStatus$1.UNSPECIFIED,
|
|
4047
|
+
succeeded: TransactionStatus$1.SUCCEEDED,
|
|
4048
|
+
reverted: TransactionStatus$1.REVERTED
|
|
4049
|
+
};
|
|
4050
|
+
return enumMap[x] ?? TransactionStatus$1.UNSPECIFIED;
|
|
4051
|
+
},
|
|
4052
|
+
decode(p) {
|
|
4053
|
+
const enumMap = {
|
|
4054
|
+
[TransactionStatus$1.SUCCEEDED]: "succeeded",
|
|
4055
|
+
[TransactionStatus$1.REVERTED]: "reverted",
|
|
4056
|
+
[TransactionStatus$1.UNSPECIFIED]: "unknown",
|
|
4057
|
+
[TransactionStatus$1.UNRECOGNIZED]: "unknown"
|
|
4058
|
+
};
|
|
4059
|
+
return enumMap[p] ?? "unknown";
|
|
4095
4060
|
}
|
|
4096
|
-
|
|
4097
|
-
const BlockHeader =
|
|
4098
|
-
blockNumber:
|
|
4099
|
-
blockHash: B256$1,
|
|
4100
|
-
parentBlockHash: B256$1,
|
|
4101
|
-
unclesHash: B256$1,
|
|
4102
|
-
miner: Address$1,
|
|
4103
|
-
stateRoot: B256$1,
|
|
4104
|
-
transactionsRoot: B256$1,
|
|
4105
|
-
receiptsRoot: B256$1,
|
|
4106
|
-
logsBloom: Bloom,
|
|
4107
|
-
difficulty: U256$1,
|
|
4108
|
-
gasLimit: U128$1,
|
|
4109
|
-
gasUsed: U128$1,
|
|
4110
|
-
timestamp:
|
|
4111
|
-
extraData: BytesFromUint8Array,
|
|
4112
|
-
mixHash:
|
|
4113
|
-
nonce:
|
|
4114
|
-
baseFeePerGas:
|
|
4115
|
-
withdrawalsRoot:
|
|
4116
|
-
totalDifficulty:
|
|
4117
|
-
blobGasUsed:
|
|
4118
|
-
excessBlobGas:
|
|
4119
|
-
parentBeaconBlockRoot:
|
|
4120
|
-
requestsHash:
|
|
4061
|
+
};
|
|
4062
|
+
const BlockHeader = MessageCodec({
|
|
4063
|
+
blockNumber: RequiredCodec(BigIntCodec),
|
|
4064
|
+
blockHash: RequiredCodec(B256$1),
|
|
4065
|
+
parentBlockHash: RequiredCodec(B256$1),
|
|
4066
|
+
unclesHash: RequiredCodec(B256$1),
|
|
4067
|
+
miner: RequiredCodec(Address$1),
|
|
4068
|
+
stateRoot: RequiredCodec(B256$1),
|
|
4069
|
+
transactionsRoot: RequiredCodec(B256$1),
|
|
4070
|
+
receiptsRoot: RequiredCodec(B256$1),
|
|
4071
|
+
logsBloom: RequiredCodec(Bloom),
|
|
4072
|
+
difficulty: RequiredCodec(U256$1),
|
|
4073
|
+
gasLimit: RequiredCodec(U128$1),
|
|
4074
|
+
gasUsed: RequiredCodec(U128$1),
|
|
4075
|
+
timestamp: RequiredCodec(DateCodec),
|
|
4076
|
+
extraData: RequiredCodec(BytesFromUint8Array),
|
|
4077
|
+
mixHash: OptionalCodec(B256$1),
|
|
4078
|
+
nonce: OptionalCodec(BigIntCodec),
|
|
4079
|
+
baseFeePerGas: OptionalCodec(U128$1),
|
|
4080
|
+
withdrawalsRoot: OptionalCodec(B256$1),
|
|
4081
|
+
totalDifficulty: OptionalCodec(U256$1),
|
|
4082
|
+
blobGasUsed: OptionalCodec(U128$1),
|
|
4083
|
+
excessBlobGas: OptionalCodec(U128$1),
|
|
4084
|
+
parentBeaconBlockRoot: OptionalCodec(B256$1),
|
|
4085
|
+
requestsHash: OptionalCodec(B256$1)
|
|
4121
4086
|
});
|
|
4122
|
-
const Withdrawal =
|
|
4123
|
-
filterIds:
|
|
4124
|
-
withdrawalIndex:
|
|
4125
|
-
index:
|
|
4126
|
-
validatorIndex:
|
|
4127
|
-
address: Address$1,
|
|
4128
|
-
amount:
|
|
4087
|
+
const Withdrawal = MessageCodec({
|
|
4088
|
+
filterIds: ArrayCodec(NumberCodec),
|
|
4089
|
+
withdrawalIndex: RequiredCodec(NumberCodec),
|
|
4090
|
+
index: RequiredCodec(BigIntCodec),
|
|
4091
|
+
validatorIndex: RequiredCodec(NumberCodec),
|
|
4092
|
+
address: RequiredCodec(Address$1),
|
|
4093
|
+
amount: RequiredCodec(BigIntCodec)
|
|
4129
4094
|
});
|
|
4130
|
-
const AccessListItem =
|
|
4131
|
-
address: Address$1,
|
|
4132
|
-
storageKeys:
|
|
4095
|
+
const AccessListItem = MessageCodec({
|
|
4096
|
+
address: RequiredCodec(Address$1),
|
|
4097
|
+
storageKeys: ArrayCodec(B256$1)
|
|
4133
4098
|
});
|
|
4134
|
-
const Signature =
|
|
4135
|
-
r: U256$1,
|
|
4136
|
-
s: U256$1,
|
|
4137
|
-
v:
|
|
4138
|
-
YParity:
|
|
4099
|
+
const Signature = MessageCodec({
|
|
4100
|
+
r: RequiredCodec(U256$1),
|
|
4101
|
+
s: RequiredCodec(U256$1),
|
|
4102
|
+
v: OptionalCodec(U256$1),
|
|
4103
|
+
YParity: OptionalCodec(BooleanCodec)
|
|
4139
4104
|
});
|
|
4140
|
-
const Transaction =
|
|
4141
|
-
filterIds:
|
|
4142
|
-
transactionIndex:
|
|
4143
|
-
transactionHash: B256$1,
|
|
4144
|
-
nonce:
|
|
4145
|
-
from: Address$1,
|
|
4146
|
-
to:
|
|
4147
|
-
value: U256$1,
|
|
4148
|
-
gasPrice:
|
|
4149
|
-
gas: U128$1,
|
|
4150
|
-
maxFeePerGas:
|
|
4151
|
-
maxPriorityFeePerGas:
|
|
4152
|
-
input: BytesFromUint8Array,
|
|
4153
|
-
signature:
|
|
4154
|
-
chainId:
|
|
4155
|
-
accessList:
|
|
4156
|
-
transactionType:
|
|
4157
|
-
maxFeePerBlobGas:
|
|
4158
|
-
blobVersionedHashes:
|
|
4159
|
-
transactionStatus: TransactionStatus
|
|
4105
|
+
const Transaction = MessageCodec({
|
|
4106
|
+
filterIds: ArrayCodec(NumberCodec),
|
|
4107
|
+
transactionIndex: RequiredCodec(NumberCodec),
|
|
4108
|
+
transactionHash: RequiredCodec(B256$1),
|
|
4109
|
+
nonce: RequiredCodec(BigIntCodec),
|
|
4110
|
+
from: RequiredCodec(Address$1),
|
|
4111
|
+
to: OptionalCodec(Address$1),
|
|
4112
|
+
value: RequiredCodec(U256$1),
|
|
4113
|
+
gasPrice: OptionalCodec(U128$1),
|
|
4114
|
+
gas: RequiredCodec(U128$1),
|
|
4115
|
+
maxFeePerGas: OptionalCodec(U128$1),
|
|
4116
|
+
maxPriorityFeePerGas: OptionalCodec(U128$1),
|
|
4117
|
+
input: RequiredCodec(BytesFromUint8Array),
|
|
4118
|
+
signature: OptionalCodec(Signature),
|
|
4119
|
+
chainId: OptionalCodec(BigIntCodec),
|
|
4120
|
+
accessList: ArrayCodec(AccessListItem),
|
|
4121
|
+
transactionType: RequiredCodec(BigIntCodec),
|
|
4122
|
+
maxFeePerBlobGas: OptionalCodec(U128$1),
|
|
4123
|
+
blobVersionedHashes: ArrayCodec(B256$1),
|
|
4124
|
+
transactionStatus: RequiredCodec(TransactionStatus)
|
|
4160
4125
|
});
|
|
4161
|
-
const TransactionReceipt =
|
|
4162
|
-
filterIds:
|
|
4163
|
-
transactionIndex:
|
|
4164
|
-
transactionHash: B256$1,
|
|
4165
|
-
cumulativeGasUsed: U128$1,
|
|
4166
|
-
gasUsed: U128$1,
|
|
4167
|
-
effectiveGasPrice: U128$1,
|
|
4168
|
-
from: Address$1,
|
|
4169
|
-
to:
|
|
4170
|
-
contractAddress:
|
|
4171
|
-
logsBloom: Bloom,
|
|
4172
|
-
transactionType:
|
|
4173
|
-
blobGasUsed:
|
|
4174
|
-
blobGasPrice:
|
|
4175
|
-
transactionStatus: TransactionStatus
|
|
4126
|
+
const TransactionReceipt = MessageCodec({
|
|
4127
|
+
filterIds: ArrayCodec(NumberCodec),
|
|
4128
|
+
transactionIndex: RequiredCodec(NumberCodec),
|
|
4129
|
+
transactionHash: RequiredCodec(B256$1),
|
|
4130
|
+
cumulativeGasUsed: RequiredCodec(U128$1),
|
|
4131
|
+
gasUsed: RequiredCodec(U128$1),
|
|
4132
|
+
effectiveGasPrice: RequiredCodec(U128$1),
|
|
4133
|
+
from: RequiredCodec(Address$1),
|
|
4134
|
+
to: OptionalCodec(Address$1),
|
|
4135
|
+
contractAddress: OptionalCodec(Address$1),
|
|
4136
|
+
logsBloom: RequiredCodec(Bloom),
|
|
4137
|
+
transactionType: RequiredCodec(BigIntCodec),
|
|
4138
|
+
blobGasUsed: OptionalCodec(U128$1),
|
|
4139
|
+
blobGasPrice: OptionalCodec(U128$1),
|
|
4140
|
+
transactionStatus: RequiredCodec(TransactionStatus)
|
|
4176
4141
|
});
|
|
4177
|
-
const Log =
|
|
4178
|
-
filterIds:
|
|
4179
|
-
address: Address$1,
|
|
4180
|
-
topics:
|
|
4181
|
-
data: BytesFromUint8Array,
|
|
4182
|
-
logIndex:
|
|
4183
|
-
logIndexInTransaction:
|
|
4184
|
-
transactionIndex:
|
|
4185
|
-
transactionHash: B256$1,
|
|
4186
|
-
transactionStatus: TransactionStatus
|
|
4142
|
+
const Log = MessageCodec({
|
|
4143
|
+
filterIds: ArrayCodec(NumberCodec),
|
|
4144
|
+
address: RequiredCodec(Address$1),
|
|
4145
|
+
topics: ArrayCodec(B256$1),
|
|
4146
|
+
data: RequiredCodec(BytesFromUint8Array),
|
|
4147
|
+
logIndex: RequiredCodec(NumberCodec),
|
|
4148
|
+
logIndexInTransaction: RequiredCodec(NumberCodec),
|
|
4149
|
+
transactionIndex: RequiredCodec(NumberCodec),
|
|
4150
|
+
transactionHash: RequiredCodec(B256$1),
|
|
4151
|
+
transactionStatus: RequiredCodec(TransactionStatus)
|
|
4187
4152
|
});
|
|
4188
|
-
const CallType =
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
},
|
|
4212
|
-
encode(value) {
|
|
4213
|
-
throw new Error("encode: not implemented");
|
|
4214
|
-
}
|
|
4153
|
+
const CallType = {
|
|
4154
|
+
encode(x) {
|
|
4155
|
+
const enumMap = {
|
|
4156
|
+
unknown: CallType$1.UNSPECIFIED,
|
|
4157
|
+
call: CallType$1.CALL,
|
|
4158
|
+
callCode: CallType$1.CALL_CODE,
|
|
4159
|
+
delegateCall: CallType$1.DELEGATE_CALL,
|
|
4160
|
+
staticCall: CallType$1.STATIC_CALL,
|
|
4161
|
+
authCall: CallType$1.AUTH_CALL
|
|
4162
|
+
};
|
|
4163
|
+
return enumMap[x] ?? CallType$1.UNSPECIFIED;
|
|
4164
|
+
},
|
|
4165
|
+
decode(p) {
|
|
4166
|
+
const enumMap = {
|
|
4167
|
+
[CallType$1.CALL]: "call",
|
|
4168
|
+
[CallType$1.CALL_CODE]: "callCode",
|
|
4169
|
+
[CallType$1.DELEGATE_CALL]: "delegateCall",
|
|
4170
|
+
[CallType$1.STATIC_CALL]: "staticCall",
|
|
4171
|
+
[CallType$1.AUTH_CALL]: "authCall",
|
|
4172
|
+
[CallType$1.UNSPECIFIED]: "unknown",
|
|
4173
|
+
[CallType$1.UNRECOGNIZED]: "unknown"
|
|
4174
|
+
};
|
|
4175
|
+
return enumMap[p] ?? "unknown";
|
|
4215
4176
|
}
|
|
4216
|
-
|
|
4217
|
-
const CreationMethod =
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4177
|
+
};
|
|
4178
|
+
const CreationMethod = {
|
|
4179
|
+
encode(x) {
|
|
4180
|
+
const enumMap = {
|
|
4181
|
+
unknown: CreationMethod$1.UNSPECIFIED,
|
|
4182
|
+
create: CreationMethod$1.CREATE,
|
|
4183
|
+
create2: CreationMethod$1.CREATE2,
|
|
4184
|
+
eofCreate: CreationMethod$1.EOF_CREATE
|
|
4185
|
+
};
|
|
4186
|
+
return enumMap[x] ?? CreationMethod$1.UNSPECIFIED;
|
|
4187
|
+
},
|
|
4188
|
+
decode(p) {
|
|
4189
|
+
const enumMap = {
|
|
4190
|
+
[CreationMethod$1.CREATE]: "create",
|
|
4191
|
+
[CreationMethod$1.CREATE2]: "create2",
|
|
4192
|
+
[CreationMethod$1.EOF_CREATE]: "eofCreate",
|
|
4193
|
+
[CreationMethod$1.UNSPECIFIED]: "unknown",
|
|
4194
|
+
[CreationMethod$1.UNRECOGNIZED]: "unknown"
|
|
4195
|
+
};
|
|
4196
|
+
return enumMap[p] ?? "unknown";
|
|
4234
4197
|
}
|
|
4235
|
-
|
|
4236
|
-
const CallAction =
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
toAddress: Address$1,
|
|
4244
|
-
value: U256$1
|
|
4245
|
-
})
|
|
4198
|
+
};
|
|
4199
|
+
const CallAction = MessageCodec({
|
|
4200
|
+
fromAddress: RequiredCodec(Address$1),
|
|
4201
|
+
type: RequiredCodec(CallType),
|
|
4202
|
+
gas: RequiredCodec(BigIntCodec),
|
|
4203
|
+
input: RequiredCodec(BytesFromUint8Array),
|
|
4204
|
+
toAddress: RequiredCodec(Address$1),
|
|
4205
|
+
value: RequiredCodec(U256$1)
|
|
4246
4206
|
});
|
|
4247
|
-
const CreateAction =
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
value: U256$1,
|
|
4254
|
-
creationMethod: CreationMethod
|
|
4255
|
-
})
|
|
4207
|
+
const CreateAction = MessageCodec({
|
|
4208
|
+
fromAddress: RequiredCodec(Address$1),
|
|
4209
|
+
gas: RequiredCodec(BigIntCodec),
|
|
4210
|
+
init: RequiredCodec(BytesFromUint8Array),
|
|
4211
|
+
value: RequiredCodec(U256$1),
|
|
4212
|
+
creationMethod: RequiredCodec(CreationMethod)
|
|
4256
4213
|
});
|
|
4257
|
-
const SelfDestructAction =
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
balance: U256$1,
|
|
4262
|
-
refundAddress: Address$1
|
|
4263
|
-
})
|
|
4214
|
+
const SelfDestructAction = MessageCodec({
|
|
4215
|
+
address: RequiredCodec(Address$1),
|
|
4216
|
+
balance: RequiredCodec(U256$1),
|
|
4217
|
+
refundAddress: RequiredCodec(Address$1)
|
|
4264
4218
|
});
|
|
4265
|
-
const RewardType =
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
}
|
|
4219
|
+
const RewardType = {
|
|
4220
|
+
encode(x) {
|
|
4221
|
+
const enumMap = {
|
|
4222
|
+
unknown: RewardType$1.UNSPECIFIED,
|
|
4223
|
+
block: RewardType$1.BLOCK,
|
|
4224
|
+
uncle: RewardType$1.UNCLE
|
|
4225
|
+
};
|
|
4226
|
+
return enumMap[x] ?? RewardType$1.UNSPECIFIED;
|
|
4227
|
+
},
|
|
4228
|
+
decode(p) {
|
|
4229
|
+
const enumMap = {
|
|
4230
|
+
[RewardType$1.BLOCK]: "block",
|
|
4231
|
+
[RewardType$1.UNCLE]: "uncle",
|
|
4232
|
+
[RewardType$1.UNSPECIFIED]: "unknown",
|
|
4233
|
+
[RewardType$1.UNRECOGNIZED]: "unknown"
|
|
4234
|
+
};
|
|
4235
|
+
return enumMap[p] ?? "unknown";
|
|
4281
4236
|
}
|
|
4282
|
-
|
|
4283
|
-
const RewardAction =
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
type: RewardType,
|
|
4288
|
-
value: U256$1
|
|
4289
|
-
})
|
|
4237
|
+
};
|
|
4238
|
+
const RewardAction = MessageCodec({
|
|
4239
|
+
author: RequiredCodec(Address$1),
|
|
4240
|
+
type: RequiredCodec(RewardType),
|
|
4241
|
+
value: RequiredCodec(U256$1)
|
|
4290
4242
|
});
|
|
4291
|
-
const CallOutput =
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
gasUsed: Schema.BigIntFromSelf,
|
|
4295
|
-
output: BytesFromUint8Array
|
|
4296
|
-
})
|
|
4243
|
+
const CallOutput = MessageCodec({
|
|
4244
|
+
gasUsed: RequiredCodec(BigIntCodec),
|
|
4245
|
+
output: RequiredCodec(BytesFromUint8Array)
|
|
4297
4246
|
});
|
|
4298
|
-
const CreateOutput =
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
code: BytesFromUint8Array,
|
|
4303
|
-
gasUsed: Schema.BigIntFromSelf
|
|
4304
|
-
})
|
|
4247
|
+
const CreateOutput = MessageCodec({
|
|
4248
|
+
address: RequiredCodec(Address$1),
|
|
4249
|
+
code: RequiredCodec(BytesFromUint8Array),
|
|
4250
|
+
gasUsed: RequiredCodec(BigIntCodec)
|
|
4305
4251
|
});
|
|
4306
|
-
const Trace =
|
|
4307
|
-
action:
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4252
|
+
const Trace = MessageCodec({
|
|
4253
|
+
action: RequiredCodec(
|
|
4254
|
+
OneOfCodec({
|
|
4255
|
+
call: CallAction,
|
|
4256
|
+
create: CreateAction,
|
|
4257
|
+
selfDestruct: SelfDestructAction,
|
|
4258
|
+
reward: RewardAction
|
|
4259
|
+
})
|
|
4312
4260
|
),
|
|
4313
|
-
error:
|
|
4314
|
-
output:
|
|
4315
|
-
|
|
4316
|
-
|
|
4261
|
+
error: OptionalCodec(StringCodec),
|
|
4262
|
+
output: OptionalCodec(
|
|
4263
|
+
OneOfCodec({
|
|
4264
|
+
callOutput: CallOutput,
|
|
4265
|
+
createOutput: CreateOutput
|
|
4266
|
+
})
|
|
4267
|
+
),
|
|
4268
|
+
subtraces: RequiredCodec(NumberCodec),
|
|
4269
|
+
traceAddress: ArrayCodec(NumberCodec)
|
|
4317
4270
|
});
|
|
4318
|
-
const TransactionTrace =
|
|
4319
|
-
filterIds:
|
|
4320
|
-
transactionIndex:
|
|
4321
|
-
transactionHash: B256$1,
|
|
4322
|
-
traces:
|
|
4271
|
+
const TransactionTrace = MessageCodec({
|
|
4272
|
+
filterIds: ArrayCodec(NumberCodec),
|
|
4273
|
+
transactionIndex: RequiredCodec(NumberCodec),
|
|
4274
|
+
transactionHash: RequiredCodec(B256$1),
|
|
4275
|
+
traces: ArrayCodec(Trace)
|
|
4323
4276
|
});
|
|
4324
|
-
const Block =
|
|
4325
|
-
header: BlockHeader,
|
|
4326
|
-
withdrawals:
|
|
4327
|
-
transactions:
|
|
4328
|
-
receipts:
|
|
4329
|
-
logs:
|
|
4330
|
-
traces:
|
|
4277
|
+
const Block = MessageCodec({
|
|
4278
|
+
header: RequiredCodec(BlockHeader),
|
|
4279
|
+
withdrawals: ArrayCodec(Withdrawal),
|
|
4280
|
+
transactions: ArrayCodec(Transaction),
|
|
4281
|
+
receipts: ArrayCodec(TransactionReceipt),
|
|
4282
|
+
logs: ArrayCodec(Log),
|
|
4283
|
+
traces: ArrayCodec(TransactionTrace)
|
|
4331
4284
|
});
|
|
4332
|
-
const BlockFromBytes =
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
}
|
|
4341
|
-
return Block$1.decode(value);
|
|
4342
|
-
},
|
|
4343
|
-
encode(value) {
|
|
4344
|
-
if (value === null) {
|
|
4345
|
-
return new Uint8Array();
|
|
4346
|
-
}
|
|
4347
|
-
return Block$1.encode(value).finish();
|
|
4348
|
-
}
|
|
4285
|
+
const BlockFromBytes = {
|
|
4286
|
+
encode(x) {
|
|
4287
|
+
const block = Block.encode(x);
|
|
4288
|
+
return Block$1.encode(block).finish();
|
|
4289
|
+
},
|
|
4290
|
+
decode(p) {
|
|
4291
|
+
const block = Block$1.decode(p);
|
|
4292
|
+
return Block.decode(block);
|
|
4349
4293
|
}
|
|
4350
|
-
|
|
4294
|
+
};
|
|
4351
4295
|
|
|
4352
|
-
const
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
|
|
4375
|
-
default:
|
|
4376
|
-
return HeaderFilter$1.UNSPECIFIED;
|
|
4377
|
-
}
|
|
4378
|
-
}
|
|
4296
|
+
const HeaderFilter = {
|
|
4297
|
+
encode(x) {
|
|
4298
|
+
switch (x) {
|
|
4299
|
+
case "always":
|
|
4300
|
+
return HeaderFilter$1.ALWAYS;
|
|
4301
|
+
case "on_data":
|
|
4302
|
+
return HeaderFilter$1.ON_DATA;
|
|
4303
|
+
case "on_data_or_on_new_block":
|
|
4304
|
+
return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
|
|
4305
|
+
default:
|
|
4306
|
+
return HeaderFilter$1.UNSPECIFIED;
|
|
4307
|
+
}
|
|
4308
|
+
},
|
|
4309
|
+
decode(p) {
|
|
4310
|
+
const enumMap = {
|
|
4311
|
+
[HeaderFilter$1.ALWAYS]: "always",
|
|
4312
|
+
[HeaderFilter$1.ON_DATA]: "on_data",
|
|
4313
|
+
[HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK]: "on_data_or_on_new_block",
|
|
4314
|
+
[HeaderFilter$1.UNSPECIFIED]: "unknown",
|
|
4315
|
+
[HeaderFilter$1.UNRECOGNIZED]: "unknown"
|
|
4316
|
+
};
|
|
4317
|
+
return enumMap[p] ?? "unknown";
|
|
4379
4318
|
}
|
|
4380
|
-
|
|
4381
|
-
const WithdrawalFilter =
|
|
4382
|
-
id:
|
|
4383
|
-
validatorIndex:
|
|
4384
|
-
address:
|
|
4319
|
+
};
|
|
4320
|
+
const WithdrawalFilter = MessageCodec({
|
|
4321
|
+
id: OptionalCodec(NumberCodec),
|
|
4322
|
+
validatorIndex: OptionalCodec(NumberCodec),
|
|
4323
|
+
address: OptionalCodec(Address$1)
|
|
4385
4324
|
});
|
|
4386
|
-
const TransactionStatusFilter =
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
return TransactionStatusFilter$1.ALL;
|
|
4408
|
-
default:
|
|
4409
|
-
return TransactionStatusFilter$1.UNSPECIFIED;
|
|
4410
|
-
}
|
|
4325
|
+
const TransactionStatusFilter = {
|
|
4326
|
+
decode(value) {
|
|
4327
|
+
const enumMap = {
|
|
4328
|
+
[TransactionStatusFilter$1.SUCCEEDED]: "succeeded",
|
|
4329
|
+
[TransactionStatusFilter$1.REVERTED]: "reverted",
|
|
4330
|
+
[TransactionStatusFilter$1.ALL]: "all",
|
|
4331
|
+
[TransactionStatusFilter$1.UNSPECIFIED]: "unknown",
|
|
4332
|
+
[TransactionStatusFilter$1.UNRECOGNIZED]: "unknown"
|
|
4333
|
+
};
|
|
4334
|
+
return enumMap[value] ?? "unknown";
|
|
4335
|
+
},
|
|
4336
|
+
encode(value) {
|
|
4337
|
+
switch (value) {
|
|
4338
|
+
case "succeeded":
|
|
4339
|
+
return TransactionStatusFilter$1.SUCCEEDED;
|
|
4340
|
+
case "reverted":
|
|
4341
|
+
return TransactionStatusFilter$1.REVERTED;
|
|
4342
|
+
case "all":
|
|
4343
|
+
return TransactionStatusFilter$1.ALL;
|
|
4344
|
+
default:
|
|
4345
|
+
return TransactionStatusFilter$1.UNSPECIFIED;
|
|
4411
4346
|
}
|
|
4412
4347
|
}
|
|
4413
|
-
|
|
4414
|
-
const Topic =
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
decode({ value }) {
|
|
4419
|
-
if (value === void 0) {
|
|
4420
|
-
return null;
|
|
4421
|
-
}
|
|
4422
|
-
return value;
|
|
4423
|
-
},
|
|
4424
|
-
encode(value) {
|
|
4425
|
-
if (value === null) {
|
|
4426
|
-
return { value: void 0 };
|
|
4427
|
-
}
|
|
4428
|
-
return { value };
|
|
4348
|
+
};
|
|
4349
|
+
const Topic = {
|
|
4350
|
+
encode(x) {
|
|
4351
|
+
if (x === null) {
|
|
4352
|
+
return { value: void 0 };
|
|
4429
4353
|
}
|
|
4354
|
+
return { value: B256$1.encode(x) };
|
|
4355
|
+
},
|
|
4356
|
+
decode({ value }) {
|
|
4357
|
+
if (value === void 0) {
|
|
4358
|
+
return null;
|
|
4359
|
+
}
|
|
4360
|
+
return B256$1.decode(value);
|
|
4430
4361
|
}
|
|
4431
|
-
|
|
4432
|
-
const LogFilter =
|
|
4433
|
-
id:
|
|
4434
|
-
address:
|
|
4435
|
-
topics:
|
|
4436
|
-
strict:
|
|
4437
|
-
transactionStatus:
|
|
4438
|
-
includeTransaction:
|
|
4439
|
-
includeReceipt:
|
|
4440
|
-
includeTransactionTrace:
|
|
4362
|
+
};
|
|
4363
|
+
const LogFilter = MessageCodec({
|
|
4364
|
+
id: OptionalCodec(NumberCodec),
|
|
4365
|
+
address: OptionalCodec(Address$1),
|
|
4366
|
+
topics: OptionalCodec(ArrayCodec(Topic)),
|
|
4367
|
+
strict: OptionalCodec(BooleanCodec),
|
|
4368
|
+
transactionStatus: OptionalCodec(TransactionStatusFilter),
|
|
4369
|
+
includeTransaction: OptionalCodec(BooleanCodec),
|
|
4370
|
+
includeReceipt: OptionalCodec(BooleanCodec),
|
|
4371
|
+
includeTransactionTrace: OptionalCodec(BooleanCodec)
|
|
4441
4372
|
});
|
|
4442
|
-
const TransactionFilter =
|
|
4443
|
-
id:
|
|
4444
|
-
from:
|
|
4445
|
-
to:
|
|
4446
|
-
create:
|
|
4447
|
-
transactionStatus:
|
|
4448
|
-
includeReceipt:
|
|
4449
|
-
includeLogs:
|
|
4450
|
-
includeTransactionTrace:
|
|
4373
|
+
const TransactionFilter = MessageCodec({
|
|
4374
|
+
id: OptionalCodec(NumberCodec),
|
|
4375
|
+
from: OptionalCodec(Address$1),
|
|
4376
|
+
to: OptionalCodec(Address$1),
|
|
4377
|
+
create: OptionalCodec(BooleanCodec),
|
|
4378
|
+
transactionStatus: OptionalCodec(TransactionStatusFilter),
|
|
4379
|
+
includeReceipt: OptionalCodec(BooleanCodec),
|
|
4380
|
+
includeLogs: OptionalCodec(BooleanCodec),
|
|
4381
|
+
includeTransactionTrace: OptionalCodec(BooleanCodec)
|
|
4451
4382
|
});
|
|
4452
|
-
const Filter =
|
|
4453
|
-
header:
|
|
4454
|
-
withdrawals:
|
|
4455
|
-
transactions:
|
|
4456
|
-
logs:
|
|
4383
|
+
const Filter = MessageCodec({
|
|
4384
|
+
header: OptionalCodec(HeaderFilter),
|
|
4385
|
+
withdrawals: OptionalCodec(ArrayCodec(WithdrawalFilter)),
|
|
4386
|
+
transactions: OptionalCodec(ArrayCodec(TransactionFilter)),
|
|
4387
|
+
logs: OptionalCodec(ArrayCodec(LogFilter))
|
|
4457
4388
|
});
|
|
4458
|
-
const
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
strict: false,
|
|
4465
|
-
decode(value) {
|
|
4466
|
-
return Filter$1.decode(value);
|
|
4467
|
-
},
|
|
4468
|
-
encode(value) {
|
|
4469
|
-
return Filter$1.encode(value).finish();
|
|
4470
|
-
}
|
|
4389
|
+
const FilterFromBytes = {
|
|
4390
|
+
encode(x) {
|
|
4391
|
+
return Filter$1.encode(Filter.encode(x)).finish();
|
|
4392
|
+
},
|
|
4393
|
+
decode(p) {
|
|
4394
|
+
return Filter.decode(Filter$1.decode(p));
|
|
4471
4395
|
}
|
|
4472
|
-
|
|
4473
|
-
const filterToBytes = Schema.encodeSync(FilterFromBytes);
|
|
4474
|
-
const filterFromBytes = Schema.decodeSync(FilterFromBytes);
|
|
4396
|
+
};
|
|
4475
4397
|
function mergeFilter(a, b) {
|
|
4476
4398
|
const header = mergeHeaderFilter(a.header, b.header);
|
|
4477
4399
|
return {
|
|
@@ -4503,4 +4425,4 @@ const EvmStream = new StreamConfig(
|
|
|
4503
4425
|
mergeFilter
|
|
4504
4426
|
);
|
|
4505
4427
|
|
|
4506
|
-
export { AccessListItem, Address$1 as Address, B256$1 as B256,
|
|
4428
|
+
export { AccessListItem, Address$1 as Address, B256$1 as B256, Block, BlockFromBytes, BlockHeader, Bloom, CallAction, CallOutput, CallType, CreateAction, CreateOutput, CreationMethod, EvmStream, Filter, FilterFromBytes, HeaderFilter, Log, LogFilter, RewardAction, RewardType, SelfDestructAction, Signature, Topic, Trace, Transaction, TransactionFilter, TransactionReceipt, TransactionStatus, TransactionStatusFilter, TransactionTrace, U128$1 as U128, U256$1 as U256, Withdrawal, WithdrawalFilter, mergeFilter, index as proto };
|