shibaswap-dump 1.0.0 → 1.0.3

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.
@@ -0,0 +1,60 @@
1
+ name: Update dump binary files and publish to NPM
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ schedule:
8
+ - cron: '0 * * * *'
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ update-data:
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write # Required for OIDC
20
+
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v6
26
+
27
+ - name: Setup Node.js
28
+ uses: actions/setup-node@v6
29
+ with:
30
+ node-version: '24'
31
+ registry-url: 'https://registry.npmjs.org'
32
+
33
+ - name: Update npm
34
+ run: npm install -g npm@latest
35
+
36
+ - name: Install dependencies
37
+ run: npm install
38
+
39
+ - name: Run update
40
+ run: npm start
41
+
42
+ - name: Commit and push changes
43
+ id: commit
44
+ run: |
45
+ git config --global user.name "github-actions[bot]"
46
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
47
+ git add dump_pairs.bin dump_tokens.bin dump_p2tt.bin
48
+ if ! git diff --cached --quiet; then
49
+ npm version patch --force -m "chore: update dump_*.bin to %s [skip ci]"
50
+ git push --follow-tags
51
+ echo "can_publish=true" >> $GITHUB_OUTPUT
52
+ elif [ "${{ github.event_name }}" != "schedule" ]; then
53
+ echo "can_publish=true" >> $GITHUB_OUTPUT
54
+ else
55
+ echo "No changes"
56
+ fi
57
+
58
+ - name: Publish to NPM
59
+ if: steps.commit.outputs.can_publish == 'true'
60
+ run: npm publish
package/README.md CHANGED
@@ -6,15 +6,24 @@ Static set of addresses (ShibaSwap Ethereum mainnet).<br>
6
6
  New pairs updates happen every hour at GitHub Action [update.yml](https://github.com/calp-pro/uniswap-v2-dump/actions/workflows/update.yml)<br>
7
7
  via [uniswap-v2-loader](https://github.com/calp-pro/uniswap-v2-loader)
8
8
 
9
- Data: `dump.csv` 135Kb+
9
+ Data:
10
+ - `dump_pairs.bin` 21 Kb+
11
+ - `dump_tokens.bin` 17 Kb+
12
+ - `dump_p2tt.bin` 6 Kb+
10
13
 
11
- CSV schema: `id,pair,token0,token1`
12
-
13
- ## Example:
14
- ```
15
- ...
16
- 10,0x4200b824d4b1118e290767a9f255d53af21fabca,0x6b175474e89094c44da98b954eedeac495271d0f,0x9813037ee2218799597d83d4a5b6f3b6778218d9
17
- ...
14
+ ## Output format
15
+ `load` and subscribe` methods return collection of pools/pairs.
16
+ ```js
17
+ [
18
+ ...
19
+ {
20
+ id: 10,
21
+ pair: '0x4200b824d4b1118e290767a9f255d53af21fabca',
22
+ token0: '0x6b175474e89094c44da98b954eedeac495271d0f',
23
+ token1: '0x9813037ee2218799597d83d4a5b6f3b6778218d9'
24
+ },
25
+ ...
26
+ ]
18
27
  ```
19
28
  where:
20
29
  - `10`
package/dump_p2tt.bin ADDED
Binary file
package/dump_pairs.bin ADDED
Binary file
Binary file
package/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. */
@@ -56,4 +58,4 @@ export function load(params?: load_params): Promise<pair[]>
56
58
  export function subscribe(
57
59
  callback: (pairs: pair[]) => void,
58
60
  params?: load_params
59
- ): () => void
61
+ ): () => void
package/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  const loader = require('uniswap-v2-loader')
2
- const dump_csv = require('path').join(__dirname, 'dump.csv')
2
+ const dump = require('path').join(__dirname, 'dump')
3
3
 
4
4
  module.exports.load = (params = {}) => loader.load({
5
5
  factory: '0x115934131916c8b277dd010ee02de363c09d037c',
6
- filename: dump_csv,
6
+ filename: dump,
7
+ csv: false,
7
8
  ...params
8
9
  })
9
10
 
@@ -11,7 +12,8 @@ module.exports.subscribe = (callback, params = {}) => loader.subscribe(
11
12
  callback,
12
13
  {
13
14
  factory: '0x115934131916c8b277dd010ee02de363c09d037c',
14
- filename: dump_csv,
15
+ filename: dump,
16
+ csv: false,
15
17
  ...params
16
18
  }
17
- )
19
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shibaswap-dump",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Static set of addresses (ShibaSwap Ethereum mainnet)",
5
5
  "keywords": [
6
6
  "ShibaSwap",
@@ -22,6 +22,9 @@
22
22
  "start": "node -e \"require('./index.js').load({workers: 0})\""
23
23
  },
24
24
  "dependencies": {
25
- "uniswap-v2-loader": "^5.0.20"
25
+ "uniswap-v2-loader": "^6.1.3"
26
+ },
27
+ "publishConfig": {
28
+ "provenance": true
26
29
  }
27
30
  }
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- dump.csv filter=lfs diff=lfs merge=lfs -text