Helloooo Hack Clubbers! Itโs ya boi rice back at it again with another HN ship :hn: :parrot:!
Before I lay out the new changes, I just wanted to thank the wonderful @caleb for testing out the bot authentication system yesterday (the UNO bot looks great), and @khushraj.rathod for volunteering to build out the exchange systemโforex is coming to Hack Club, everyone :parrot_love:!
Anyways, letโs get back to day 4 of my personal lil shipathon: changes to @undefined and the HN API!
The Teller now has one awesome new command for validating payments (/pay was there before, but Iโve added some new messages and interactivity with it), and a super great new dashboardโfeel free to head over to Home on @undefinedโs profile page to take a look.
The HN GraphQL API now supports advanced pagination and sorting! You can now query for as many transactions as you want, iterate through them, skip through tests, and even order by different fields!
For instance, to grab the 5 people with the most HN and two of their largest payments, you can do something like:
query Users {
users(options:{
sort:{
field:"balance",
order:"DESC"
},
take:5
}) {
id
balance
outgoingTransactions(options:{
sort:{
order:"DESC",
field:"balance"
},
take:2
}) {
id
balance
from {
id
}
to {
id
}
}
}
}
Iโm soooooo excited for what all of yall are going to be doing with thisโas always, if youโre interested in making a bot, feel free to DM me with the botโs username to get your very own token! You can find the source for HN over at: :githubparrot: ๐ z.rishi.cx/g/hn, and the Teller over at z.rishi.cx/g/teller :D
P.S. The next ship will be V1 of HNโthe production-ready, stable version of the API with documentation!