envio 3.3.0-alpha.4 → 3.3.0-alpha.5

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.
@@ -1,52 +1,11 @@
1
- type eventLog = {
2
- abi: EvmTypes.Abi.t,
3
- data: string,
4
- topics: array<EvmTypes.Hex.t>,
5
- }
6
-
7
- type decodedEvent<'a> = {
8
- eventName: string,
9
- args: 'a,
10
- }
11
-
12
- @module("viem") external decodeEventLogOrThrow: eventLog => decodedEvent<'a> = "decodeEventLog"
13
-
14
1
  type hex = EvmTypes.Hex.t
15
2
  @module("viem") external toHex: 'a => hex = "toHex"
16
3
  @module("viem") external keccak256: hex => hex = "keccak256"
17
- @module("viem") external keccak256Bytes: Uint8Array.t => hex = "keccak256"
18
4
  @module("viem") external pad: hex => hex = "pad"
19
- @module("viem")
20
- external encodePacked: (~types: array<string>, ~values: array<'a>) => hex = "encodePacked"
21
5
 
22
6
  type sizeOptions = {size: int}
23
- @module("viem") external intToHex: (int, ~options: sizeOptions=?) => hex = "numberToHex"
24
7
  @module("viem") external bigintToHex: (bigint, ~options: sizeOptions=?) => hex = "numberToHex"
25
8
  @module("viem") external stringToHex: (string, ~options: sizeOptions=?) => hex = "stringToHex"
26
9
  @module("viem") external boolToHex: (bool, ~options: sizeOptions=?) => hex = "boolToHex"
27
10
  @module("viem") external bytesToHex: (Uint8Array.t, ~options: sizeOptions=?) => hex = "bytesToHex"
28
11
  @module("viem") external concat: array<hex> => hex = "concat"
29
-
30
- exception ParseError(exn)
31
- exception UnknownContractName({contractName: string})
32
-
33
- let parseLogOrThrow = (
34
- contractNameAbiMapping: dict<EvmTypes.Abi.t>,
35
- ~contractName,
36
- ~topics,
37
- ~data,
38
- ) => {
39
- switch contractNameAbiMapping->Utils.Dict.dangerouslyGetNonOption(contractName) {
40
- | None => throw(UnknownContractName({contractName: contractName}))
41
- | Some(abi) =>
42
- let viemLog: eventLog = {
43
- abi,
44
- data,
45
- topics,
46
- }
47
-
48
- try viemLog->decodeEventLogOrThrow catch {
49
- | exn => throw(ParseError(exn))
50
- }
51
- }
52
- }
@@ -1,44 +1,2 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Viem from "viem";
4
- import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
5
- import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
6
-
7
- let ParseError = /* @__PURE__ */Primitive_exceptions.create("Viem.ParseError");
8
-
9
- let UnknownContractName = /* @__PURE__ */Primitive_exceptions.create("Viem.UnknownContractName");
10
-
11
- function parseLogOrThrow(contractNameAbiMapping, contractName, topics, data) {
12
- let abi = contractNameAbiMapping[contractName];
13
- if (abi !== undefined) {
14
- let viemLog_abi = Primitive_option.valFromOption(abi);
15
- let viemLog = {
16
- abi: viemLog_abi,
17
- data: data,
18
- topics: topics
19
- };
20
- try {
21
- return Viem.decodeEventLog(viemLog);
22
- } catch (raw_exn) {
23
- let exn = Primitive_exceptions.internalToException(raw_exn);
24
- throw {
25
- RE_EXN_ID: ParseError,
26
- _1: exn,
27
- Error: new Error()
28
- };
29
- }
30
- } else {
31
- throw {
32
- RE_EXN_ID: UnknownContractName,
33
- contractName: contractName,
34
- Error: new Error()
35
- };
36
- }
37
- }
38
-
39
- export {
40
- ParseError,
41
- UnknownContractName,
42
- parseLogOrThrow,
43
- }
44
- /* viem Not a pure module */
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
@@ -15,42 +15,13 @@ type payload = {
15
15
  external fromPayload: payload => Internal.eventPayload = "%identity"
16
16
  external toPayload: Internal.eventPayload => payload = "%identity"
17
17
 
18
- // Ordered transaction field names. The index of each is the field code shared
19
- // with the Rust store (`EvmTxField`) keep this order in sync.
20
- let transactionFields = [
21
- "transactionIndex",
22
- "hash",
23
- "from",
24
- "to",
25
- "gas",
26
- "gasPrice",
27
- "maxPriorityFeePerGas",
28
- "maxFeePerGas",
29
- "cumulativeGasUsed",
30
- "effectiveGasPrice",
31
- "gasUsed",
32
- "input",
33
- "nonce",
34
- "value",
35
- "v",
36
- "r",
37
- "s",
38
- "contractAddress",
39
- "logsBloom",
40
- "root",
41
- "status",
42
- "yParity",
43
- "maxFeePerBlobGas",
44
- "blobVersionedHashes",
45
- "type",
46
- "l1Fee",
47
- "l1GasPrice",
48
- "l1GasUsed",
49
- "l1FeeScalar",
50
- "gasUsedForL1",
51
- "accessList",
52
- "authorizationList",
53
- ]
18
+ // Ordered transaction field names, the field codes shared with the Rust store
19
+ // (`EvmTxField`). Derived from the typed field list so the two can't drift;
20
+ // `Internal.allEvmTransactionFields` is pinned to the Rust ordinal order by a test.
21
+ let transactionFields =
22
+ Internal.allEvmTransactionFields->(
23
+ Utils.magic: array<Internal.evmTransactionField> => array<string>
24
+ )
54
25
 
55
26
  // One event's selected transaction fields → store selection bitmask. Computed
56
27
  // per event at config build and cached on the event config.
@@ -1,46 +1,12 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Logging from "../Logging.res.mjs";
4
+ import * as Internal from "../Internal.res.mjs";
4
5
  import * as RawEvent from "../RawEvent.res.mjs";
5
6
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
6
7
  import * as TransactionStore from "./TransactionStore.res.mjs";
7
8
 
8
- let transactionFields = [
9
- "transactionIndex",
10
- "hash",
11
- "from",
12
- "to",
13
- "gas",
14
- "gasPrice",
15
- "maxPriorityFeePerGas",
16
- "maxFeePerGas",
17
- "cumulativeGasUsed",
18
- "effectiveGasPrice",
19
- "gasUsed",
20
- "input",
21
- "nonce",
22
- "value",
23
- "v",
24
- "r",
25
- "s",
26
- "contractAddress",
27
- "logsBloom",
28
- "root",
29
- "status",
30
- "yParity",
31
- "maxFeePerBlobGas",
32
- "blobVersionedHashes",
33
- "type",
34
- "l1Fee",
35
- "l1GasPrice",
36
- "l1GasUsed",
37
- "l1FeeScalar",
38
- "gasUsedForL1",
39
- "accessList",
40
- "authorizationList"
41
- ];
42
-
43
- let eventTransactionFieldMask = TransactionStore.makeMaskFn(transactionFields);
9
+ let eventTransactionFieldMask = TransactionStore.makeMaskFn(Internal.allEvmTransactionFields);
44
10
 
45
11
  let cleanUpRawEventFieldsInPlace = (fields => {
46
12
  delete fields.hash
@@ -76,6 +42,8 @@ function make(logger) {
76
42
  };
77
43
  }
78
44
 
45
+ let transactionFields = Internal.allEvmTransactionFields;
46
+
79
47
  export {
80
48
  transactionFields,
81
49
  eventTransactionFieldMask,
@@ -3,6 +3,7 @@ type rpc = {
3
3
  sourceFor: Source.sourceFor,
4
4
  syncConfig?: Config.sourceSyncOptions,
5
5
  ws?: string,
6
+ headers?: dict<string>,
6
7
  }
7
8
 
8
9
  let getSyncConfig = (
@@ -89,7 +90,7 @@ let makeSources = (
89
90
  ]
90
91
  | _ => []
91
92
  }
92
- rpcs->Array.forEach(({?syncConfig, url, sourceFor, ?ws}) => {
93
+ rpcs->Array.forEach(({?syncConfig, url, sourceFor, ?ws, ?headers}) => {
93
94
  let source = RpcSource.make({
94
95
  chain,
95
96
  sourceFor,
@@ -99,6 +100,7 @@ let makeSources = (
99
100
  allEventParams,
100
101
  lowercaseAddresses,
101
102
  ?ws,
103
+ ?headers,
102
104
  })
103
105
  let _ = sources->Array.push(source)
104
106
  })
@@ -60,7 +60,8 @@ function makeSources(chain, contracts, hyperSync, rpcs, lowercaseAddresses) {
60
60
  eventRouter: eventRouter,
61
61
  allEventParams: allEventParams,
62
62
  lowercaseAddresses: lowercaseAddresses,
63
- ws: param.ws
63
+ ws: param.ws,
64
+ headers: param.headers
64
65
  });
65
66
  sources.push(source);
66
67
  });
@@ -1,9 +1,34 @@
1
- type cfg = {url: string, httpReqTimeoutMillis?: int}
1
+ type cfg = {url: string, httpReqTimeoutMillis?: int, headers?: dict<string>}
2
2
 
3
- type t = {getHeight: unit => promise<int>}
3
+ // `addresses` omitted matches any address (a wildcard selection). Each `topics`
4
+ // position is `null` (match any) or a list of accepted topic hashes; the
5
+ // single-match case is a one-element list.
6
+ type getLogsParams = {
7
+ fromBlock: int,
8
+ toBlock: int,
9
+ addresses?: array<Address.t>,
10
+ topics: array<Nullable.t<array<string>>>,
11
+ }
12
+
13
+ // Decoded `params` keyed by contract name, matching the HyperSync decoder's
14
+ // shape so the caller routes by address then picks its contract's params.
15
+ type rpcEventItem = {
16
+ log: Rpc.GetLogs.log,
17
+ params: Nullable.t<dict<Internal.eventParams>>,
18
+ }
19
+
20
+ type t = {
21
+ getHeight: unit => promise<int>,
22
+ getLogs: getLogsParams => promise<array<rpcEventItem>>,
23
+ }
4
24
 
5
25
  @send
6
- external classNew: (Core.evmRpcClientCtor, cfg) => t = "new"
26
+ external classNew: (
27
+ Core.evmRpcClientCtor,
28
+ cfg,
29
+ array<HyperSyncClient.Decoder.eventParamsInput>,
30
+ ~checksumAddresses: bool,
31
+ ) => t = "new"
7
32
 
8
33
  // Rust encodes JSON-RPC errors as a JSON payload in the napi error's
9
34
  // message: `{"kind":"JsonRpcError","code":-32005,"message":"..."}`.
@@ -34,9 +59,15 @@ let coerceErrorOrThrow = exn =>
34
59
  | None => exn->throw
35
60
  }
36
61
 
37
- let make = (~url, ~httpReqTimeoutMillis=?) => {
38
- let client = Core.getAddon().evmRpcClient->classNew({url, ?httpReqTimeoutMillis})
62
+ let make = (~url, ~checksumAddresses, ~httpReqTimeoutMillis=?, ~headers=?, ~allEventParams=[]) => {
63
+ let client =
64
+ Core.getAddon().evmRpcClient->classNew(
65
+ {url, ?httpReqTimeoutMillis, ?headers},
66
+ allEventParams,
67
+ ~checksumAddresses,
68
+ )
39
69
  {
40
70
  getHeight: () => client.getHeight()->Promise.catch(coerceErrorOrThrow),
71
+ getLogs: params => client.getLogs(params)->Promise.catch(coerceErrorOrThrow),
41
72
  }
42
73
  }
@@ -46,13 +46,16 @@ function coerceErrorOrThrow(exn) {
46
46
  throw exn;
47
47
  }
48
48
 
49
- function make(url, httpReqTimeoutMillis) {
49
+ function make(url, checksumAddresses, httpReqTimeoutMillis, headers, allEventParamsOpt) {
50
+ let allEventParams = allEventParamsOpt !== undefined ? allEventParamsOpt : [];
50
51
  let client = Core.getAddon().EvmRpcClient.new({
51
52
  url: url,
52
- httpReqTimeoutMillis: httpReqTimeoutMillis
53
- });
53
+ httpReqTimeoutMillis: httpReqTimeoutMillis,
54
+ headers: headers
55
+ }, allEventParams, checksumAddresses);
54
56
  return {
55
- getHeight: () => Stdlib_Promise.$$catch(client.getHeight(), coerceErrorOrThrow)
57
+ getHeight: () => Stdlib_Promise.$$catch(client.getHeight(), coerceErrorOrThrow),
58
+ getLogs: params => Stdlib_Promise.$$catch(client.getLogs(params), coerceErrorOrThrow)
56
59
  };
57
60
  }
58
61
 
@@ -208,22 +208,6 @@ module ResponseTypes = {
208
208
  mixHash?: string,
209
209
  }
210
210
 
211
- type log = {
212
- removed?: bool,
213
- @as("logIndex") index?: int,
214
- transactionIndex?: int,
215
- transactionHash?: string,
216
- blockHash?: string,
217
- blockNumber?: int,
218
- address?: Address.t,
219
- data?: string,
220
- topics?: array<Nullable.t<EvmTypes.Hex.t>>,
221
- }
222
-
223
- // Only the log is needed for decoding; the transaction/block are served from
224
- // the store (event items) or unused (block-hash query).
225
- type event = {log: log}
226
-
227
211
  type rollbackGuard = {
228
212
  blockNumber: int,
229
213
  timestamp: int,
@@ -253,25 +237,6 @@ module Decoder = {
253
237
  contractName: string,
254
238
  params: array<Internal.paramMeta>,
255
239
  }
256
-
257
- // Decoded params keyed by contract name. Contracts that emit the same-signature
258
- // event share one decode but get their own param names, so the caller picks the
259
- // entry for the contract its router resolved the log to.
260
- type tWithParams = {
261
- decodeLogs: array<ResponseTypes.event> => promise<
262
- array<Nullable.t<dict<Internal.eventParams>>>,
263
- >,
264
- }
265
-
266
- @send
267
- external classFromParams: (
268
- Core.evmDecoderCtor,
269
- array<eventParamsInput>,
270
- ~checksumAddresses: bool=?,
271
- ) => tWithParams = "fromParams"
272
-
273
- let fromParams = (eventParams, ~checksumAddresses=?) =>
274
- Core.getAddon().evmDecoder->classFromParams(eventParams, ~checksumAddresses?)
275
240
  }
276
241
 
277
242
  module EventItems = {
@@ -2,7 +2,6 @@
2
2
 
3
3
  import * as Core from "../Core.res.mjs";
4
4
  import * as Utils from "../Utils.res.mjs";
5
- import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
6
5
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
7
6
 
8
7
  let serializationFormatSchema = S$RescriptSchema.$$enum([
@@ -37,13 +36,7 @@ let QueryTypes = {
37
36
 
38
37
  let ResponseTypes = {};
39
38
 
40
- function fromParams(eventParams, checksumAddresses) {
41
- return Core.getAddon().EvmDecoder.fromParams(eventParams, checksumAddresses !== undefined ? Primitive_option.valFromOption(checksumAddresses) : undefined);
42
- }
43
-
44
- let Decoder = {
45
- fromParams: fromParams
46
- };
39
+ let Decoder = {};
47
40
 
48
41
  let EventItems = {};
49
42
 
@@ -38,7 +38,21 @@ let jsonRpcFetcher: Rest.ApiFetcher.t = async args => {
38
38
  }
39
39
  }
40
40
 
41
- let makeClient = url => Rest.client(url, ~fetcher=jsonRpcFetcher)
41
+ let makeClient = (url, ~headers=?) => {
42
+ let fetcher: Rest.ApiFetcher.t = switch headers {
43
+ | None => jsonRpcFetcher
44
+ | Some(customHeaders) =>
45
+ async args => {
46
+ let headers = switch args.headers {
47
+ | Some(headers) => headers
48
+ | None => Dict.make()
49
+ }
50
+ customHeaders->Dict.forEachWithKey((value, key) => headers->Dict.set(key, value->Obj.magic))
51
+ await jsonRpcFetcher({...args, headers: Some(headers)})
52
+ }
53
+ }
54
+ Rest.client(url, ~fetcher)
55
+ }
42
56
 
43
57
  type hex = string
44
58
  let makeHexSchema = fromStr =>
@@ -70,13 +84,7 @@ let decimalFloatSchema: S.schema<float> = S.string->S.transform(s => {
70
84
  module GetLogs = {
71
85
  @unboxed
72
86
  type topicFilter = Single(hex) | Multiple(array<hex>) | @as(null) Null
73
- let topicFilterSchema = S.union([
74
- S.literal(Null),
75
- S.schema(s => Multiple(s.matches(S.array(S.string)))),
76
- S.schema(s => Single(s.matches(S.string))),
77
- ])
78
87
  type topicQuery = array<topicFilter>
79
- let topicQuerySchema = S.array(topicFilterSchema)
80
88
 
81
89
  let makeTopicQuery = (~topic0=[], ~topic1=[], ~topic2=[], ~topic3=[]) => {
82
90
  let topics = [topic0, topic1, topic2, topic3]
@@ -106,51 +114,15 @@ module GetLogs = {
106
114
  let mapTopicQuery = ({topic0, topic1, topic2, topic3}: Internal.topicSelection): topicQuery =>
107
115
  makeTopicQuery(~topic0, ~topic1, ~topic2, ~topic3)
108
116
 
109
- type param = {
110
- fromBlock: int,
111
- toBlock: int,
112
- address?: array<Address.t>,
113
- topics: topicQuery,
114
- // blockHash?: string,
115
- }
116
-
117
- let paramsSchema = S.object((s): param => {
118
- fromBlock: s.field("fromBlock", hexIntSchema),
119
- toBlock: s.field("toBlock", hexIntSchema),
120
- address: ?s.field("address", S.option(S.array(Address.schema))),
121
- topics: s.field("topics", topicQuerySchema),
122
- // blockHash: ?s.field("blockHash", S.option(S.string)),
123
- })
124
-
125
- let fullParamsSchema = S.tuple1(paramsSchema)
126
-
127
117
  type log = {
128
118
  address: Address.t,
129
119
  topics: array<hex>,
130
- data: hex,
131
120
  blockNumber: int,
132
121
  transactionHash: hex,
133
122
  transactionIndex: int,
134
123
  blockHash: hex,
135
124
  logIndex: int,
136
- removed: bool,
137
125
  }
138
-
139
- let logSchema = S.object((s): log => {
140
- address: s.field("address", Address.schema),
141
- topics: s.field("topics", S.array(S.string)),
142
- data: s.field("data", S.string),
143
- blockNumber: s.field("blockNumber", hexIntSchema),
144
- transactionHash: s.field("transactionHash", S.string),
145
- transactionIndex: s.field("transactionIndex", hexIntSchema),
146
- blockHash: s.field("blockHash", S.string),
147
- logIndex: s.field("logIndex", hexIntSchema),
148
- removed: s.field("removed", S.bool),
149
- })
150
-
151
- let resultSchema = S.array(logSchema)
152
-
153
- let route = makeRpcRoute("eth_getLogs", fullParamsSchema, resultSchema)
154
126
  }
155
127
 
156
128
  module GetBlockByNumber = {
@@ -230,10 +202,6 @@ module GetTransactionReceipt = {
230
202
  )
231
203
  }
232
204
 
233
- let getLogs = async (~client: Rest.client, ~param: GetLogs.param) => {
234
- await GetLogs.route->Rest.fetch(param, ~client)
235
- }
236
-
237
205
  let getBlock = async (~client: Rest.client, ~blockNumber: int) => {
238
206
  await GetBlockByNumber.route->Rest.fetch(
239
207
  {"blockNumber": blockNumber, "includeTransactions": false},
@@ -4,6 +4,7 @@ import * as Rest from "../vendored/Rest.res.mjs";
4
4
  import * as Viem from "viem";
5
5
  import * as Utils from "../Utils.res.mjs";
6
6
  import * as Address from "../Address.res.mjs";
7
+ import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
7
8
  import * as Stdlib_BigInt from "@rescript/runtime/lib/es6/Stdlib_BigInt.js";
8
9
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
9
10
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
@@ -48,8 +49,21 @@ async function jsonRpcFetcher(args) {
48
49
  return response;
49
50
  }
50
51
 
51
- function makeClient(url) {
52
- return Rest.client(url, jsonRpcFetcher);
52
+ function makeClient(url, headers) {
53
+ let fetcher = headers !== undefined ? async args => {
54
+ let headers$1 = args.headers;
55
+ let headers$2 = headers$1 !== undefined ? headers$1 : ({});
56
+ Stdlib_Dict.forEachWithKey(headers, (value, key) => {
57
+ headers$2[key] = value;
58
+ });
59
+ return await jsonRpcFetcher({
60
+ body: args.body,
61
+ headers: headers$2,
62
+ method: args.method,
63
+ path: args.path
64
+ });
65
+ } : jsonRpcFetcher;
66
+ return Rest.client(url, fetcher);
53
67
  }
54
68
 
55
69
  function makeHexSchema(fromStr) {
@@ -81,14 +95,6 @@ let decimalFloatSchema = S$RescriptSchema.transform(S$RescriptSchema.string, s =
81
95
  }
82
96
  }));
83
97
 
84
- let topicFilterSchema = S$RescriptSchema.union([
85
- S$RescriptSchema.literal(null),
86
- S$RescriptSchema.schema(s => (s.m(S$RescriptSchema.array(S$RescriptSchema.string)))),
87
- S$RescriptSchema.schema(s => (s.m(S$RescriptSchema.string)))
88
- ]);
89
-
90
- let topicQuerySchema = S$RescriptSchema.array(topicFilterSchema);
91
-
92
98
  function makeTopicQuery(topic0Opt, topic1Opt, topic2Opt, topic3Opt) {
93
99
  let topic0 = topic0Opt !== undefined ? topic0Opt : [];
94
100
  let topic1 = topic1Opt !== undefined ? topic1Opt : [];
@@ -130,41 +136,9 @@ function mapTopicQuery(param) {
130
136
  return makeTopicQuery(param.topic0, param.topic1, param.topic2, param.topic3);
131
137
  }
132
138
 
133
- let paramsSchema = S$RescriptSchema.object(s => ({
134
- fromBlock: s.f("fromBlock", hexIntSchema),
135
- toBlock: s.f("toBlock", hexIntSchema),
136
- address: s.f("address", S$RescriptSchema.option(S$RescriptSchema.array(Address.schema))),
137
- topics: s.f("topics", topicQuerySchema)
138
- }));
139
-
140
- let fullParamsSchema = S$RescriptSchema.tuple1(paramsSchema);
141
-
142
- let logSchema = S$RescriptSchema.object(s => ({
143
- address: s.f("address", Address.schema),
144
- topics: s.f("topics", S$RescriptSchema.array(S$RescriptSchema.string)),
145
- data: s.f("data", S$RescriptSchema.string),
146
- blockNumber: s.f("blockNumber", hexIntSchema),
147
- transactionHash: s.f("transactionHash", S$RescriptSchema.string),
148
- transactionIndex: s.f("transactionIndex", hexIntSchema),
149
- blockHash: s.f("blockHash", S$RescriptSchema.string),
150
- logIndex: s.f("logIndex", hexIntSchema),
151
- removed: s.f("removed", S$RescriptSchema.bool)
152
- }));
153
-
154
- let resultSchema = S$RescriptSchema.array(logSchema);
155
-
156
- let route = makeRpcRoute("eth_getLogs", fullParamsSchema, resultSchema);
157
-
158
139
  let GetLogs = {
159
- topicFilterSchema: topicFilterSchema,
160
- topicQuerySchema: topicQuerySchema,
161
140
  makeTopicQuery: makeTopicQuery,
162
- mapTopicQuery: mapTopicQuery,
163
- paramsSchema: paramsSchema,
164
- fullParamsSchema: fullParamsSchema,
165
- logSchema: logSchema,
166
- resultSchema: resultSchema,
167
- route: route
141
+ mapTopicQuery: mapTopicQuery
168
142
  };
169
143
 
170
144
  let blockSchema = S$RescriptSchema.object(s => ({
@@ -190,22 +164,22 @@ let blockSchema = S$RescriptSchema.object(s => ({
190
164
  uncles: s.f("uncles", S$RescriptSchema.$$null(S$RescriptSchema.array(S$RescriptSchema.string)))
191
165
  }));
192
166
 
193
- let paramsSchema$1 = S$RescriptSchema.tuple(s => ({
167
+ let paramsSchema = S$RescriptSchema.tuple(s => ({
194
168
  blockNumber: s.item(0, hexIntSchema),
195
169
  includeTransactions: s.item(1, S$RescriptSchema.bool)
196
170
  }));
197
171
 
198
- let resultSchema$1 = S$RescriptSchema.$$null(blockSchema);
172
+ let resultSchema = S$RescriptSchema.$$null(blockSchema);
199
173
 
200
- let route$1 = makeRpcRoute("eth_getBlockByNumber", paramsSchema$1, resultSchema$1);
174
+ let route = makeRpcRoute("eth_getBlockByNumber", paramsSchema, resultSchema);
201
175
 
202
- let rawRoute = makeRpcRoute("eth_getBlockByNumber", paramsSchema$1, S$RescriptSchema.$$null(S$RescriptSchema.json(false)));
176
+ let rawRoute = makeRpcRoute("eth_getBlockByNumber", paramsSchema, S$RescriptSchema.$$null(S$RescriptSchema.json(false)));
203
177
 
204
178
  let GetBlockByNumber = {
205
179
  blockSchema: blockSchema,
206
- paramsSchema: paramsSchema$1,
207
- resultSchema: resultSchema$1,
208
- route: route$1,
180
+ paramsSchema: paramsSchema,
181
+ resultSchema: resultSchema,
182
+ route: route,
209
183
  rawRoute: rawRoute
210
184
  };
211
185
 
@@ -221,12 +195,8 @@ let GetTransactionReceipt = {
221
195
  rawRoute: rawRoute$2
222
196
  };
223
197
 
224
- async function getLogs(client, param) {
225
- return await Rest.fetch(route, param, client);
226
- }
227
-
228
198
  async function getBlock(client, blockNumber) {
229
- return await Rest.fetch(route$1, {
199
+ return await Rest.fetch(route, {
230
200
  blockNumber: blockNumber,
231
201
  includeTransactions: false
232
202
  }, client);
@@ -252,7 +222,6 @@ export {
252
222
  GetBlockByNumber,
253
223
  GetTransactionByHash,
254
224
  GetTransactionReceipt,
255
- getLogs,
256
225
  getBlock,
257
226
  getRawBlock,
258
227
  }