-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathlistEnglishAuctions.js
47 lines (43 loc) · 1.02 KB
/
listEnglishAuctions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const { GraphQLClient, gql } = require("graphql-request");
const ListLast10EnglishAuctions = gql`
query ListLast10EnglishAuctions {
tokens {
liveAuctions(last: 10) {
nodes {
slug
currentPrice
endDate
bestBid {
amounts {
wei
}
bidder {
... on User {
nickname
}
}
}
minNextBid
anyCards {
slug
name
rarity
}
}
}
}
}
`;
async function main() {
const graphQLClient = new GraphQLClient("https://api.sorare.com/graphql", {
headers: {
// 'Authorization': `Bearer <YourJWTorOAuthToken>`,
// 'APIKEY': '<YourOptionalAPIKey>'
},
});
const data = await graphQLClient.request(ListLast10EnglishAuctions);
data["transferMarket"]["englishAuctions"]["nodes"].forEach((auction) => {
console.log(auction);
});
}
main().catch((error) => console.error(error));