envio 2.7.4 → 2.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envio",
3
- "version": "v2.7.4",
3
+ "version": "v2.8.0",
4
4
  "description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
5
5
  "bin": "./bin.js",
6
6
  "repository": {
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "homepage": "https://envio.dev",
25
25
  "optionalDependencies": {
26
- "envio-linux-x64": "v2.7.4",
27
- "envio-linux-arm64": "v2.7.4",
28
- "envio-darwin-x64": "v2.7.4",
29
- "envio-darwin-arm64": "v2.7.4"
26
+ "envio-linux-x64": "v2.8.0",
27
+ "envio-linux-arm64": "v2.8.0",
28
+ "envio-darwin-x64": "v2.8.0",
29
+ "envio-darwin-arm64": "v2.8.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "@envio-dev/hypersync-client": "0.6.2",
@@ -39,6 +39,7 @@
39
39
  "evm.schema.json",
40
40
  "fuel.schema.json",
41
41
  "rescript.json",
42
- "src/**/*.res"
42
+ "src",
43
+ "!src/**/*.bs.js"
43
44
  ]
44
45
  }
@@ -0,0 +1,8 @@
1
+ /* TypeScript file generated from Address.res by genType. */
2
+
3
+ /* eslint-disable */
4
+ /* tslint:disable */
5
+
6
+ import type {Address as $$t} from './bindings/OpaqueTypes.ts';
7
+
8
+ export type t = $$t;
@@ -0,0 +1,22 @@
1
+ module Chain: {
2
+ type t
3
+
4
+ external toChainId: t => int = "%identity"
5
+
6
+ let toString: t => string
7
+
8
+ let makeUnsafe: (~chainId: int) => t
9
+ }
10
+
11
+ type t<'a>
12
+ let fromArrayUnsafe: array<(Chain.t, 'a)> => t<'a>
13
+ let get: (t<'a>, Chain.t) => 'a
14
+ let set: (t<'a>, Chain.t, 'a) => t<'a>
15
+ let values: t<'a> => array<'a>
16
+ let keys: t<'a> => array<Chain.t>
17
+ let entries: t<'a> => array<(Chain.t, 'a)>
18
+ let has: (t<'a>, Chain.t) => bool
19
+ let map: (t<'a>, 'a => 'b) => t<'b>
20
+ let mapWithKey: (t<'a>, (Chain.t, 'a) => 'b) => t<'b>
21
+ let size: t<'a> => int
22
+ let update: (t<'a>, Chain.t, 'a => 'a) => t<'a>
@@ -0,0 +1,26 @@
1
+ /**
2
+ Throttles a scheduled function to run at a minimum given interval
3
+
4
+ Does NOT queue scheduled functions but rather overwrites them
5
+ on each schedule call.
6
+ */
7
+ type t
8
+
9
+ /**
10
+ Creates a throttler that throttles scheduled functions to run at a minimum
11
+ given interval in milliseconds.
12
+
13
+ Does NOT queue scheduled functions but rather overwrites them
14
+
15
+ The logger will be used to log any errors that occur in the scheduled
16
+ functions.
17
+ */
18
+ let make: (~intervalMillis: int, ~logger: Pino.t) => t
19
+
20
+ /**
21
+ Schedules a function to be run on a throttler, overwriting any
22
+ previously scheduled functions. Should only be used for functions
23
+ that do not need to be executed if there is a more up to date scheduled
24
+ function available.
25
+ */
26
+ let schedule: (t, unit => promise<unit>) => unit
package/src/Utils.res CHANGED
@@ -154,7 +154,7 @@ Helper to check if a value exists in an array
154
154
  } else {
155
155
  let head = array->Js.Array2.slice(~start=0, ~end_=index)
156
156
  let tail = array->Belt.Array.sliceToEnd(index + 1)
157
- [...head, ...tail]
157
+ Belt.Array.concat(head, tail)
158
158
  }
159
159
  }
160
160
 
@@ -182,6 +182,22 @@ Helper to check if a value exists in an array
182
182
  */
183
183
  @send
184
184
  external spliceInPlace: (array<'a>, ~pos: int, ~remove: int) => array<'a> = "splice"
185
+
186
+ /**
187
+ Interleaves an array with a separator
188
+
189
+ interleave([1, 2, 3], 0) -> [1, 0, 2, 0, 3]
190
+ */
191
+ let interleave = (arr: array<'a>, separator: 'a) => {
192
+ let interleaved = []
193
+ arr->Js.Array2.forEachi((v, i) => {
194
+ interleaved->Js.Array2.push(v)->ignore
195
+ if i < arr->Array.length - 1 {
196
+ interleaved->Js.Array2.push(separator)->ignore
197
+ }
198
+ })
199
+ interleaved
200
+ }
185
201
  }
186
202
 
187
203
  module String = {
@@ -0,0 +1 @@
1
+ export type Address = string;
@@ -0,0 +1,17 @@
1
+ /* TypeScript file generated from Pino.res by genType. */
2
+
3
+ /* eslint-disable */
4
+ /* tslint:disable */
5
+
6
+ export type logLevelUser = "udebug" | "uinfo" | "uwarn" | "uerror";
7
+
8
+ export abstract class pinoMessageBlob { protected opaque!: any }; /* simulate opaque types */
9
+
10
+ export type t = {
11
+ readonly trace: (_1:pinoMessageBlob) => void;
12
+ readonly debug: (_1:pinoMessageBlob) => void;
13
+ readonly info: (_1:pinoMessageBlob) => void;
14
+ readonly warn: (_1:pinoMessageBlob) => void;
15
+ readonly error: (_1:pinoMessageBlob) => void;
16
+ readonly fatal: (_1:pinoMessageBlob) => void
17
+ };