sushiswap-dump 1.0.3 → 1.0.6
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/.gitattributes +0 -1
- package/.github/workflows/update.yml +8 -8
- package/README.md +19 -9
- package/dump_p2tt.bin +0 -0
- package/dump_pairs.bin +0 -0
- package/dump_tokens.bin +0 -0
- package/index.d.ts +3 -1
- package/index.js +5 -3
- package/package.json +2 -2
- package/dump.csv +0 -4558
package/.gitattributes
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dump.csv filter=lfs diff=lfs merge=lfs -text
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: Update dump
|
|
1
|
+
name: Update dump binary files and publish to NPM
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
@@ -22,14 +22,12 @@ jobs:
|
|
|
22
22
|
|
|
23
23
|
steps:
|
|
24
24
|
- name: Checkout repository
|
|
25
|
-
uses: actions/checkout@
|
|
26
|
-
with:
|
|
27
|
-
lfs: true
|
|
25
|
+
uses: actions/checkout@v6
|
|
28
26
|
|
|
29
27
|
- name: Setup Node.js
|
|
30
|
-
uses: actions/setup-node@
|
|
28
|
+
uses: actions/setup-node@v6
|
|
31
29
|
with:
|
|
32
|
-
node-version: '
|
|
30
|
+
node-version: '24'
|
|
33
31
|
registry-url: 'https://registry.npmjs.org'
|
|
34
32
|
|
|
35
33
|
- name: Update npm
|
|
@@ -46,11 +44,13 @@ jobs:
|
|
|
46
44
|
run: |
|
|
47
45
|
git config --global user.name "github-actions[bot]"
|
|
48
46
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
49
|
-
git add
|
|
47
|
+
git add dump_pairs.bin dump_tokens.bin dump_p2tt.bin
|
|
50
48
|
if ! git diff --cached --quiet; then
|
|
51
|
-
npm version patch --force -m "chore: update
|
|
49
|
+
npm version patch --force -m "chore: update dump_*.bin to %s [skip ci]"
|
|
52
50
|
git push --follow-tags
|
|
53
51
|
echo "can_publish=true" >> $GITHUB_OUTPUT
|
|
52
|
+
elif [ "${{ github.event_name }}" != "schedule" ]; then
|
|
53
|
+
echo "can_publish=true" >> $GITHUB_OUTPUT
|
|
54
54
|
else
|
|
55
55
|
echo "No changes"
|
|
56
56
|
fi
|
package/README.md
CHANGED
|
@@ -3,18 +3,28 @@
|
|
|
3
3
|
<br>
|
|
4
4
|
|
|
5
5
|
Static set of addresses (SushiSwap Ethereum mainnet).<br>
|
|
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>
|
|
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:
|
|
9
|
+
Data:
|
|
10
|
+
- `dump_pairs.bin` 90 Kb+
|
|
11
|
+
- `dump_tokens.bin` 76 Kb+
|
|
12
|
+
- `dump_p2tt.bin` 27 Kb+
|
|
10
13
|
|
|
11
|
-
CSV schema: `id,pair,token0,token1`
|
|
12
14
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
15
|
+
## Output format
|
|
16
|
+
`load` and subscribe` methods return collection of pools/pairs.
|
|
17
|
+
```js
|
|
18
|
+
[
|
|
19
|
+
...
|
|
20
|
+
{
|
|
21
|
+
id: 1,
|
|
22
|
+
pair: '0x06da0fd433c1a5d7a4faa01111c044910a184553',
|
|
23
|
+
token0: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
24
|
+
token1: '0xdac17f958d2ee523a2206206994597c13d831ec7'
|
|
25
|
+
},
|
|
26
|
+
...
|
|
27
|
+
]
|
|
18
28
|
```
|
|
19
29
|
where:
|
|
20
30
|
- `1`
|
|
@@ -29,7 +39,7 @@ where:
|
|
|
29
39
|
## API
|
|
30
40
|
Same implementation as other Uniswap v2 based protocols.<br>
|
|
31
41
|
Base API reference: [uniswap-v2-loader](https://github.com/calp-pro/uniswap-v2-loader?tab=readme-ov-file#api-reference).<br>
|
|
32
|
-
Predefined `filename` with value `dump
|
|
42
|
+
Predefined `filename` with value `dump` & `csv: false`.
|
|
33
43
|
|
|
34
44
|
## Usage CLI/API:
|
|
35
45
|
```bash
|
package/dump_p2tt.bin
ADDED
|
Binary file
|
package/dump_pairs.bin
ADDED
|
Binary file
|
package/dump_tokens.bin
ADDED
|
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
|
|
2
|
+
const dump = require('path').join(__dirname, 'dump')
|
|
3
3
|
|
|
4
4
|
module.exports.load = (params = {}) => loader.load({
|
|
5
5
|
factory: '0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac',
|
|
6
|
-
filename:
|
|
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: '0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac',
|
|
14
|
-
filename:
|
|
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": "sushiswap-dump",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Static set of addresses (SushiSwap Ethereum mainnet)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"SushiSwap",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"start": "node -e \"require('./index.js').load({workers: 0})\""
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"uniswap-v2-loader": "^
|
|
25
|
+
"uniswap-v2-loader": "^6.1.3"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"provenance": true
|