sushiswap-dump 1.0.0 → 1.0.2

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/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": "sushiswap-dump",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Static set of addresses (SushiSwap Ethereum mainnet)",
5
5
  "keywords": [
6
6
  "SushiSwap",