uniswap-v2-dump 1.0.21 → 1.0.22

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 (3) hide show
  1. package/dump.csv +3 -0
  2. package/index.d.ts +59 -0
  3. package/package.json +2 -1
package/dump.csv CHANGED
@@ -490161,3 +490161,6 @@
490161
490161
  490160,0xfa36fd4c0b8adcbfa52f95dec894943e857b0781,0xaab7686fe2bd54b48b8050f5284f9220c322424c,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
490162
490162
  490161,0xbc1355ff45a2e5dc37c70e7c18c8e756508b053e,0x464e3e12c5740acc5bdc5acefc2da2e2552bc393,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
490163
490163
  490162,0x77fd578cf62e7071f8db025f9775f37abaccc76e,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0xf653c6b0a9862fa717482f6816534cb73cfb9c53
490164
+ 490163,0xd2826a629bdde37138f645ff9c9e6508fa338129,0x7d1275fbcbd174e9b746d849acd952f6471468f6,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
490165
+ 490164,0x24cd00010ea7c958df471be061022ce88033e71c,0xbd56c289fe52317bf94fe23b321fb8ef22e4ccbd,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
490166
+ 490165,0xb7588f00797e8d2b0f2f98d5be9e65dba51faae5,0x4687d5b824ca511376d1642f9ccb5f2a1f2c1559,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
package/index.d.ts ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Represents a pair from a Uniswap V2-compatible protocol.
3
+ */
4
+ export interface pair {
5
+ /** The index of the pair in the factory. */
6
+ id: number
7
+ /** The address of the pair contract. */
8
+ pair: string
9
+ /** The address of token0. */
10
+ token0: string
11
+ /** The address of token1. */
12
+ token1: string
13
+ }
14
+
15
+ /**
16
+ * Parameters for the load function.
17
+ */
18
+ export interface load_params {
19
+ /** Alchemy/Infura API key. */
20
+ key?: string
21
+ /** The address of a Uniswap V2-compatible factory (e.g., Uniswap, PancakeSwap, SushiSwap). */
22
+ factory?: string
23
+ /** Path to the cache file. Set to null to disable caching. */
24
+ filename?: string | null
25
+ /** Number of pairs to fetch in a single multicall. */
26
+ multicall_size?: number
27
+ /** Start loading from this index. */
28
+ from?: number
29
+ /** Load up to this index (inclusive). */
30
+ to?: number
31
+ /** Progress callback. */
32
+ progress?: (current: number, total: number) => void
33
+ /** Number of worker threads to use. Set to 0 to run in the main thread. */
34
+ workers?: number
35
+ /** Existing pairs to start with (used for updates). */
36
+ pairs?: pair[]
37
+ /** Timeout between updates in milliseconds. */
38
+ update_timeout?: number
39
+ /** Signal to abort the loading process. */
40
+ abort_signal?: AbortSignal
41
+ }
42
+
43
+ /**
44
+ * Loads pairs from a Uniswap V2-compatible factory.
45
+ * @param params Loading configuration.
46
+ * @returns A promise that resolves to an array of pairs.
47
+ */
48
+ export function load(params?: load_params): Promise<pair[]>
49
+
50
+ /**
51
+ * Subscribes to new pairs being added to the factory.
52
+ * @param callback Called with total available data first and then whenever new pairs added to factory.
53
+ * @param params Loading configuration.
54
+ * @returns An unsubscribe function.
55
+ */
56
+ export function subscribe(
57
+ callback: (pairs: pair[]) => void,
58
+ params?: load_params
59
+ ): () => void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniswap-v2-dump",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Static set of addresses (uniswap-v2)",
5
5
  "keywords": [
6
6
  "Uniswap-v2",
@@ -17,6 +17,7 @@
17
17
  "license": "MIT",
18
18
  "author": "Vladimir Spirin (spirin.vladimir@gmail.com)",
19
19
  "type": "commonjs",
20
+ "types": "index.d.ts",
20
21
  "main": "index.js",
21
22
  "scripts": {
22
23
  "start": "node -e \"require('./index.js').load({workers: 0})\""