uniswap-v2-loader 6.1.0 → 6.1.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.
@@ -31,6 +31,9 @@ jobs:
31
31
  - name: Update npm
32
32
  run: npm install -g npm@latest
33
33
 
34
+ - name: Install dependencies
35
+ run: npm i
36
+
34
37
  - name: Global install package CLI version
35
38
  run: npm i -g .
36
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniswap-v2-loader",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "description": "Uniswap v2 protocol loader",
5
5
  "keywords": [
6
6
  "DEFI",
@@ -48,5 +48,8 @@
48
48
  },
49
49
  "publishConfig": {
50
50
  "provenance": true
51
+ },
52
+ "dependencies": {
53
+ "@calp-pro/dex-db": "^2.0.4"
51
54
  }
52
55
  }
package/src/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export interface load_params {
22
22
  factory?: string
23
23
  /** Path to the cache file. Set to null to disable caching. */
24
24
  filename?: string | null
25
+ /** Switch cache between CSV and binary mode. */
26
+ csv?: boolean
25
27
  /** Number of pairs to fetch in a single multicall. */
26
28
  multicall_size?: number
27
29
  /** Start loading from this index. */
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ const fs = require('fs')
3
3
  const os = require('os')
4
4
  const path = require('path')
5
5
  const default_cache_filename = require('./default_cache_filename')
6
- const dex_db = require('./dex_db')
6
+ const dex_db = require('@calp-pro/dex-db')
7
7
  const max_workers = os.cpus().length - 1
8
8
  const debug_key = process.env.KEY || 'FZBvlPrOxtgaKBBkry3SH0W1IqH4Y5tu'
9
9
  const uniswap_v2_factory = '0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f'
@@ -57,7 +57,7 @@ const load = (params = {}) => {
57
57
  ) {
58
58
  db.load(filename)
59
59
  db.get_all_pairs().forEach((pair, i) => {
60
- const tokens = db.get_tokens(pair)
60
+ const tokens = db.get_pair_tokens(pair)
61
61
  pairs[i] = {
62
62
  id: i,
63
63
  pair,