@snapshot-labs/snapshot.js 0.12.6 → 0.12.8
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/dist/snapshot.cjs.js +19 -2
- package/dist/snapshot.esm.js +19 -2
- package/dist/snapshot.min.js +1 -1
- package/dist/src/utils/delegation.d.ts +1 -1
- package/package.json +1 -1
- package/src/networks.json +14 -0
- package/src/utils/delegation.ts +7 -4
package/dist/snapshot.cjs.js
CHANGED
|
@@ -2842,6 +2842,21 @@ var networks = {
|
|
|
2842
2842
|
},
|
|
2843
2843
|
start: 27458402,
|
|
2844
2844
|
logo: "ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"
|
|
2845
|
+
},
|
|
2846
|
+
"33111": {
|
|
2847
|
+
key: "33111",
|
|
2848
|
+
name: "Curtis",
|
|
2849
|
+
shortName: "apechain",
|
|
2850
|
+
chainId: 33111,
|
|
2851
|
+
network: "mainnet",
|
|
2852
|
+
multicall: "0xc454132B017b55b427f45078E335549A7124f5f7",
|
|
2853
|
+
rpc: [
|
|
2854
|
+
],
|
|
2855
|
+
explorer: {
|
|
2856
|
+
url: "https://explorer.curtis.apechain.com"
|
|
2857
|
+
},
|
|
2858
|
+
start: 6661339,
|
|
2859
|
+
logo: "ipfs://bafkreicljxttjq2xkgfwwpii5xegirgq2ctrnsjnzelxudjj33qzq65apu"
|
|
2845
2860
|
},
|
|
2846
2861
|
"42161": {
|
|
2847
2862
|
key: "42161",
|
|
@@ -3610,7 +3625,7 @@ function getDelegatesBySpace(network_1, space_1) {
|
|
|
3610
3625
|
}
|
|
3611
3626
|
let pivot = 0;
|
|
3612
3627
|
const result = new Map();
|
|
3613
|
-
const spaceIn = buildSpaceIn(space);
|
|
3628
|
+
const spaceIn = space ? buildSpaceIn(space) : null;
|
|
3614
3629
|
while (true) {
|
|
3615
3630
|
const newResults = yield fetchData({
|
|
3616
3631
|
url: subgraphUrl,
|
|
@@ -3656,7 +3671,6 @@ function fetchData(_a) {
|
|
|
3656
3671
|
delegations: {
|
|
3657
3672
|
__args: {
|
|
3658
3673
|
where: {
|
|
3659
|
-
space_in: spaces,
|
|
3660
3674
|
timestamp_gte: pivot
|
|
3661
3675
|
},
|
|
3662
3676
|
first: PAGE_SIZE,
|
|
@@ -3673,6 +3687,9 @@ function fetchData(_a) {
|
|
|
3673
3687
|
if (snapshot !== 'latest') {
|
|
3674
3688
|
params.delegations.__args.block = { number: snapshot };
|
|
3675
3689
|
}
|
|
3690
|
+
if (spaces !== null) {
|
|
3691
|
+
params.delegations.__args.where.space_in = spaces;
|
|
3692
|
+
}
|
|
3676
3693
|
return (yield subgraphRequest(url, params)).delegations || [];
|
|
3677
3694
|
});
|
|
3678
3695
|
}
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -2832,6 +2832,21 @@ var networks = {
|
|
|
2832
2832
|
},
|
|
2833
2833
|
start: 27458402,
|
|
2834
2834
|
logo: "ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"
|
|
2835
|
+
},
|
|
2836
|
+
"33111": {
|
|
2837
|
+
key: "33111",
|
|
2838
|
+
name: "Curtis",
|
|
2839
|
+
shortName: "apechain",
|
|
2840
|
+
chainId: 33111,
|
|
2841
|
+
network: "mainnet",
|
|
2842
|
+
multicall: "0xc454132B017b55b427f45078E335549A7124f5f7",
|
|
2843
|
+
rpc: [
|
|
2844
|
+
],
|
|
2845
|
+
explorer: {
|
|
2846
|
+
url: "https://explorer.curtis.apechain.com"
|
|
2847
|
+
},
|
|
2848
|
+
start: 6661339,
|
|
2849
|
+
logo: "ipfs://bafkreicljxttjq2xkgfwwpii5xegirgq2ctrnsjnzelxudjj33qzq65apu"
|
|
2835
2850
|
},
|
|
2836
2851
|
"42161": {
|
|
2837
2852
|
key: "42161",
|
|
@@ -3600,7 +3615,7 @@ function getDelegatesBySpace(network_1, space_1) {
|
|
|
3600
3615
|
}
|
|
3601
3616
|
let pivot = 0;
|
|
3602
3617
|
const result = new Map();
|
|
3603
|
-
const spaceIn = buildSpaceIn(space);
|
|
3618
|
+
const spaceIn = space ? buildSpaceIn(space) : null;
|
|
3604
3619
|
while (true) {
|
|
3605
3620
|
const newResults = yield fetchData({
|
|
3606
3621
|
url: subgraphUrl,
|
|
@@ -3646,7 +3661,6 @@ function fetchData(_a) {
|
|
|
3646
3661
|
delegations: {
|
|
3647
3662
|
__args: {
|
|
3648
3663
|
where: {
|
|
3649
|
-
space_in: spaces,
|
|
3650
3664
|
timestamp_gte: pivot
|
|
3651
3665
|
},
|
|
3652
3666
|
first: PAGE_SIZE,
|
|
@@ -3663,6 +3677,9 @@ function fetchData(_a) {
|
|
|
3663
3677
|
if (snapshot !== 'latest') {
|
|
3664
3678
|
params.delegations.__args.block = { number: snapshot };
|
|
3665
3679
|
}
|
|
3680
|
+
if (spaces !== null) {
|
|
3681
|
+
params.delegations.__args.where.space_in = spaces;
|
|
3682
|
+
}
|
|
3666
3683
|
return (yield subgraphRequest(url, params)).delegations || [];
|
|
3667
3684
|
});
|
|
3668
3685
|
}
|