@quicknode/sdk 0.5.0 → 0.5.2
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/README.md +41 -8
- package/package.json +12 -4
- package/src/client/customApolloClient.d.ts +10 -5
- package/src/graphql/fragmentMatcher.d.ts +7 -0
- package/src/graphql/types.d.ts +1305 -0
- package/src/index.d.ts +1 -0
- package/src/index.esm.js +371 -166
- package/src/index.js +378 -166
- package/src/queries/nft/getContractEventLogs/getContractEventLogs.d.ts +6 -5
- package/src/queries/nft/getNFTEventLogs/getNFTEventLogs.d.ts +3 -3
- package/src/queries/nft/getNFTsByContractAddress/getNFTsByContractAddress.d.ts +1 -1
- package/src/queries/nft/getNFTsByWalletAndContracts/getNFTsByWalletAndContracts.d.ts +2 -3
- package/src/queries/nft/getNFTsByWalletENS/getNFTsByWalletENS.d.ts +1 -1
- package/src/queries/nft/getTrendingNFTCollections/getTrendingNFTCollections.d.ts +5 -0
- package/src/queries/nft/index.d.ts +0 -1
- package/src/queries/nft/nftQueries.d.ts +80 -13
- package/src/queries/nft/sharedTypes.d.ts +151 -0
- package/src/utils/removeNodesAndEdges.d.ts +19 -4
- package/src/queries/nft/getNFTsByWalletAddress/getNFTsByWalletAddress.d.ts +0 -5
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-

|
|
2
|
-

|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
1
|
# QuickNode SDK
|
|
9
2
|
|
|
10
|
-
|
|
3
|
+
An SDK from [QuickNode](https://www.quicknode.com/) making it easy for developers to interact with the blockchain.
|
|
4
|
+
|
|
5
|
+
Currently supports getting started with [Icy Tools GraphQL API](https://developers.icy.tools/) in a blink!
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@quicknode/sdk)
|
|
8
|
+
[](https://www.npmjs.com/package/@quicknode/sdk)
|
|
9
|
+

|
|
10
|
+
[](https://github.com/quiknode-labs/qn-oss/blob/main/LICENSE.txt)
|
|
11
|
+
[](https://github.com/quiknode-labs/qn-oss/issues)
|
|
12
|
+
[](https://discord.gg/DkdgEqE)
|
|
11
13
|
|
|
12
14
|
## Quick Start
|
|
13
15
|
|
|
@@ -225,6 +227,29 @@ client.nft
|
|
|
225
227
|
.then((response) => console.log(response));
|
|
226
228
|
```
|
|
227
229
|
|
|
230
|
+
### nft.getTrendingNFTCollections
|
|
231
|
+
|
|
232
|
+
| Argument | Values | Optional | Description | Example |
|
|
233
|
+
| -------------- | --------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
|
|
234
|
+
| first | number | ✅ | Number of results to return | 10 |
|
|
235
|
+
| after | string | ✅ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
236
|
+
| orderBy | TrendingCollectionsOrderByEnum | ✅ | Sort contracts by average sale price ('AVERAGE'), number of sales ('SALES') or volume ('VOLUME') | 'AVERAGE' |
|
|
237
|
+
| orderDirection | OrderDirectionEnum | ✅ | Sort results ascending ('ASC') or descending ('DESC') | 'ASC' |
|
|
238
|
+
| timePeriod | TrendingCollectionsTimePeriodEnum | ✅ | Get results from last hour ('ONE_HOUR'), last 12 hours ('TWELVE_HOURS') results, last day ('ONE_DAY') or last 7 days ('SEVEN_DAYS') | 'ONE_HOUR' |
|
|
239
|
+
| timeRange | DateInputType | ✅ | Define the modifier in which `timePeriod` will take action to. It can be equal to ('eq'), greater than ('gt'), greater than or equal to ('gte'), less than ('lt') or less than or equal to ('lte') | 'gt' |
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
import { QuickNodeSDK } from '@quicknode/sdk';
|
|
243
|
+
|
|
244
|
+
const client = new QuickNodeSDK();
|
|
245
|
+
|
|
246
|
+
client.nft
|
|
247
|
+
.getTrendingNFTCollections({
|
|
248
|
+
first: 10,
|
|
249
|
+
})
|
|
250
|
+
.then((response) => console.log(response));
|
|
251
|
+
```
|
|
252
|
+
|
|
228
253
|
## Pagination
|
|
229
254
|
|
|
230
255
|
For functions that support pagination, use the `first` property to specify the amount of results to return.
|
|
@@ -256,6 +281,10 @@ client.nft.getNFTsByWalletENS({
|
|
|
256
281
|
|
|
257
282
|
# Contributing corner
|
|
258
283
|
|
|
284
|
+
## Issues
|
|
285
|
+
|
|
286
|
+
Please submit any questions, issues, or feedback as an [issue in Github](https://github.com/quiknode-labs/qn-oss/issues).
|
|
287
|
+
|
|
259
288
|
## Building
|
|
260
289
|
|
|
261
290
|
Run `nx build libs-api-sdk` to build the library.
|
|
@@ -267,3 +296,7 @@ Run `nx test libs-api-sdk` to execute the unit tests via [Jest](https://jestjs.i
|
|
|
267
296
|
## Running lint
|
|
268
297
|
|
|
269
298
|
Run `nx lint libs-api-sdk` to execute the lint via [ESLint](https://eslint.org/).
|
|
299
|
+
|
|
300
|
+
## Generate graphql
|
|
301
|
+
|
|
302
|
+
Run `yarn codegen` to generate graphql typings via [Codegen](https://www.the-guild.dev/graphql/codegen).
|
package/package.json
CHANGED
|
@@ -6,21 +6,29 @@
|
|
|
6
6
|
"directory": "packages/libs/api/sdk"
|
|
7
7
|
},
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"version": "0.5.
|
|
9
|
+
"version": "0.5.2",
|
|
10
10
|
"main": "./src/index.js",
|
|
11
11
|
"module": "./src/index.esm.js",
|
|
12
12
|
"types": "./src/index.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@apollo/client": "^3.6.9",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"cross-fetch": "^3.1.5",
|
|
16
|
+
"graphql": "^16.5.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
+
"@graphql-codegen/cli": "2.13.8",
|
|
20
|
+
"@graphql-codegen/fragment-matcher": "^3.3.1",
|
|
21
|
+
"@graphql-codegen/typescript": "2.8.0",
|
|
22
|
+
"@graphql-codegen/typescript-document-nodes": "^2.3.6",
|
|
23
|
+
"@graphql-codegen/typescript-operations": "^2.5.5",
|
|
19
24
|
"@pollyjs/adapter-node-http": "^6.0.5",
|
|
20
25
|
"@pollyjs/core": "^6.0.5",
|
|
21
26
|
"@pollyjs/persister-fs": "^6.0.5",
|
|
22
|
-
"@types/supertest": "^2.0.12",
|
|
23
27
|
"@types/node": "16.11.7",
|
|
28
|
+
"@types/supertest": "^2.0.12",
|
|
24
29
|
"supertest": "^6.2.4"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"codegen": "graphql-codegen --config codegen.yml"
|
|
25
33
|
}
|
|
26
34
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject, QueryOptions } from '@apollo/client';
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject, OperationVariables, QueryOptions } from '@apollo/client';
|
|
2
|
+
import { ResultOutput } from '../utils/removeNodesAndEdges';
|
|
2
3
|
export declare class CustomApolloClient {
|
|
3
4
|
apolloClient: ApolloClient<NormalizedCacheObject>;
|
|
4
5
|
constructor(apolloClient: ApolloClient<NormalizedCacheObject>);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
query<TVariables extends OperationVariables, KResults extends Record<string, any>, KResultsOutput extends ResultOutput>(options: QueryOptions<TVariables, KResults>): Promise<{
|
|
7
|
+
data: KResultsOutput;
|
|
8
|
+
errors?: readonly import("graphql").GraphQLError[] | undefined;
|
|
9
|
+
error?: import("@apollo/client").ApolloError | undefined;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
networkStatus: import("@apollo/client").NetworkStatus;
|
|
12
|
+
partial?: boolean | undefined;
|
|
13
|
+
}>;
|
|
9
14
|
}
|