-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dashboard: List on-chain groups starting from the most recently created #433
Comments
Hi, I would like to take on this issue :) |
Hey @waddaboo! Great, thanks. Do you want me to assign you this issue? |
Yes, please. I have completed it, just that currently I'm unable to setup my local api key to test it out. |
Hey @waddaboo great, thanks. What is the error you are getting? |
I have been trying to sign in to my local bandada with Coinbase Wallet but it didn't prompt the QR code for most of the time, and even for the times that it did, it always ends with "error signing message". |
Managed to login in bandada.pse.dev, but only on mobile. Thought it was error on my machine haha.
Tried Metamask but nothing popup after clicking as well. |
Hey @vplasencia, I found out in order for on-chain groups to sort by most recent created, some changes must be made at const config: AxiosRequestConfig = {
method: "post",
data: JSON.stringify({
query: `{
groups ${filtersQuery} {
id
merkleTree {
root
depth
size
}
admin
${
members === true
? `members(orderBy: index) {
identityCommitment
}`
: ""
}
${
validatedProofs === true
? `validatedProofs(orderBy: timestamp) {
message
merkleTreeRoot
merkleTreeDepth
scope
nullifier
points
timestamp
}`
: ""
}
}
}`
})
} Any suggestion on how should this proceed? |
Hey @waddaboo! There are some ways to solve this without modifying the Semaphore package. Here are two options: 1- Recreate the same that function is doing under the hood. This way you have full control of the code and can modify what you want. 2- Run The change would be adding:
After running the second command to save the changes, you should see a new file inside the Let us know if you have more questions. |
The 2nd idea should be faster. Steps: 1- Go inside 2- Open the folder linked in the console. You can now edit the following folder: ... 3- Modify the files:
4- Save changes by running the command specified in the console: yarn patch-commit -s ... You will see a new file inside diff --git a/dist/index.mjs b/dist/index.mjs
index 614a9093f82e9ae8e9219b65af0a8e93ea992560..2e432b004bd8718bb16c84ef7c53cdda14808ef5 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -1137,7 +1137,7 @@ var SemaphoreSubgraph = /** @class */ (function () {
filterFragments.push("timestamp_lte: \"".concat(jsDateToGraphqlDate(timestampLte), "\""));
}
if (filterFragments.length > 0) {
- filtersQuery = "(where: {".concat(filterFragments.join(", "), "})");
+ filtersQuery = "(orderBy:timestamp, orderDirection:desc, where: {".concat(filterFragments.join(", "), "})");
}
}
config = {
diff --git a/dist/index.node.js b/dist/index.node.js
index 29640ebef31511af5ee5ff7e970c74e1fa0bc98e..6ae2e5f15d47f1be7b90cd347adfd3b35d1ce7e8 100644
--- a/dist/index.node.js
+++ b/dist/index.node.js
@@ -1145,7 +1145,7 @@ var SemaphoreSubgraph = /** @class */ (function () {
filterFragments.push("timestamp_lte: \"".concat(jsDateToGraphqlDate(timestampLte), "\""));
}
if (filterFragments.length > 0) {
- filtersQuery = "(where: {".concat(filterFragments.join(", "), "})");
+ filtersQuery = "(orderBy:timestamp, orderDirection:desc, where: {".concat(filterFragments.join(", "), "})");
}
}
config = {
5- Inside the bandada project, in the root project folder, run |
Hey @vplasencia thanks for the detailed step-by-step guide! It's very helpful! |
More context:
#344
The text was updated successfully, but these errors were encountered: