@quicknode/sdk 0.5.1 → 1.0.0-beta.0
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 +662 -135
- package/cjs/index.js +765 -0
- package/cjs/package.json +3 -0
- package/esm/index.js +753 -0
- package/esm/package.json +3 -0
- package/index.d.ts +826 -0
- package/package.json +30 -10
- package/src/client/client.d.ts +0 -13
- package/src/client/customApolloClient.d.ts +0 -9
- package/src/client/index.d.ts +0 -1
- package/src/index.d.ts +0 -3
- package/src/index.esm.js +0 -8405
- package/src/index.js +0 -8417
- package/src/queries/index.d.ts +0 -1
- package/src/queries/nft/getCollectionDetails/getCollectionDetails.d.ts +0 -4
- package/src/queries/nft/getContractEventLogs/getContractEventLogs.d.ts +0 -6
- package/src/queries/nft/getNFTDetails/getNFTDetails.d.ts +0 -5
- package/src/queries/nft/getNFTEventLogs/getNFTEventLogs.d.ts +0 -7
- package/src/queries/nft/getNFTsByContractAddress/getNFTsByContractAddress.d.ts +0 -5
- package/src/queries/nft/getNFTsByWalletAddress/getNFTsByWalletAddress.d.ts +0 -5
- package/src/queries/nft/getNFTsByWalletAndContracts/getNFTsByWalletAndContracts.d.ts +0 -6
- package/src/queries/nft/getNFTsByWalletENS/getNFTsByWalletENS.d.ts +0 -5
- package/src/queries/nft/index.d.ts +0 -3
- package/src/queries/nft/nftQueries.d.ts +0 -23
- package/src/utils/removeNodesAndEdges.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,230 +1,724 @@
|
|
|
1
|
-

|
|
2
|
-

|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
1
|
# QuickNode SDK
|
|
9
2
|
|
|
10
|
-
|
|
3
|
+
> :warning: **This is an beta release** This release is not production-ready yet and only meant as a technical preview. The API could break in subsequent beta releases until the 1.0.0 release is finalized.
|
|
4
|
+
|
|
5
|
+
A SDK from [QuickNode](https://www.quicknode.com/) making it easy for developers to interact with QuickNode's services.
|
|
6
|
+
|
|
7
|
+
QuickNode's SDK is a JavaScript and TypeScript framework-agnostic library that supports both CommonJS and ES module systems.
|
|
8
|
+
|
|
9
|
+
Currently the SDK makes it even easier to use the [QuickNode Graph API](https://www.quicknode.com/graph-api) to query market insights, trading data, transactions by wallets and contracts, cached NFT images, and more!
|
|
10
|
+
|
|
11
|
+
> :grey_question: We want to hear from you! Please take a few minutes to fill out our [QuickNode SDK feedback form](https://forms.gle/vWFXDDjEUySjWUof6) and let us know what you currently think about the SDK. This helps us further improve the SDK.
|
|
12
|
+
|
|
13
|
+
[](https://coveralls.io/github/quiknode-labs/qn-oss?branch=main)
|
|
14
|
+
[](https://www.npmjs.com/package/@quicknode/sdk)
|
|
15
|
+
[](https://www.npmjs.com/package/@quicknode/sdk)
|
|
16
|
+

|
|
17
|
+
[](https://github.com/quiknode-labs/qn-oss/blob/main/LICENSE.txt)
|
|
18
|
+
[](https://github.com/quiknode-labs/qn-oss/issues)
|
|
19
|
+
[](https://discord.gg/DkdgEqE)
|
|
20
|
+
|
|
21
|
+
<br>
|
|
11
22
|
|
|
12
|
-
|
|
23
|
+
- [QuickNode SDK](#quicknode-sdk)
|
|
24
|
+
- [Getting Started](#getting-started)
|
|
25
|
+
- [Installation](#installation)
|
|
26
|
+
- [Quickstart](#quickstart)
|
|
27
|
+
- [API functions](#api-functions)
|
|
28
|
+
- [Configuration](#configuration)
|
|
29
|
+
- [Configuration Arguments](#configuration-arguments)
|
|
30
|
+
- [nfts.getByWallet](#nftsgetbywallet)
|
|
31
|
+
- [nfts.getTrendingCollections](#nftsgettrendingcollections)
|
|
32
|
+
- [nfts.getByContractAddress](#nftsgetbycontractaddress)
|
|
33
|
+
- [nfts.getNFTDetails](#nftsgetnftdetails)
|
|
34
|
+
- [nfts.getCollectionDetails](#nftsgetcollectiondetails)
|
|
35
|
+
- [tokens.getBalancesByWallet](#tokensgetbalancesbywallet)
|
|
36
|
+
- [contracts.getDetails](#contractsgetdetails)
|
|
37
|
+
- [transactions.getByWallet](#transactionsgetbywallet)
|
|
38
|
+
- [transactions.getAll](#transactionsgetall)
|
|
39
|
+
- [transactions.getByHash](#transactionsgetbyhash)
|
|
40
|
+
- [events.getByContract](#eventsgetbycontract)
|
|
41
|
+
- [events.getByNFTCollection](#eventsgetbynftcollection)
|
|
42
|
+
- [events.getByNFT](#eventsgetbynft)
|
|
43
|
+
- [events.getAll](#eventsgetall)
|
|
44
|
+
- [utils.getGasPrices](#utilsgetgasprices)
|
|
45
|
+
- [graphApiClient.query](#graphapiclientquery)
|
|
46
|
+
- [Filters](#filters)
|
|
47
|
+
- [Token Event Filters](#token-event-filters)
|
|
48
|
+
- [Pagination](#pagination)
|
|
49
|
+
- [Contributing corner](#contributing-corner)
|
|
50
|
+
- [Issues](#issues)
|
|
51
|
+
- [Development](#development)
|
|
52
|
+
- [Running tests](#running-tests)
|
|
53
|
+
- [Running linting](#running-linting)
|
|
54
|
+
- [Generate graphql codegen typings](#generate-graphql-codegen-typings)
|
|
55
|
+
|
|
56
|
+
<br>
|
|
57
|
+
|
|
58
|
+
## Getting Started
|
|
59
|
+
|
|
60
|
+
### Installation
|
|
61
|
+
|
|
62
|
+
- Requires Node.js v16 or higher
|
|
63
|
+
- `npm install @quicknode/sdk` or `yarn add @quicknode/sdk`
|
|
64
|
+
|
|
65
|
+
<br>
|
|
66
|
+
|
|
67
|
+
### Quickstart
|
|
13
68
|
|
|
14
69
|
```ts
|
|
15
|
-
import
|
|
70
|
+
import QuickNode from '@quicknode/sdk';
|
|
16
71
|
|
|
17
|
-
const
|
|
72
|
+
const qn = new QuickNode.API({ graphApiKey: 'my-api-key' });
|
|
18
73
|
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
74
|
+
qn.nfts
|
|
75
|
+
.getByWallet({
|
|
76
|
+
address: 'quicknode.eth',
|
|
22
77
|
first: 5,
|
|
23
78
|
})
|
|
24
79
|
.then((response) => console.log(response));
|
|
25
80
|
```
|
|
26
81
|
|
|
27
|
-
Full example implementation [here](https://github.com/quiknode-labs/qn-oss/tree/main/packages/apps/examples/
|
|
82
|
+
Full example app implementation [here](https://github.com/quiknode-labs/qn-oss/tree/main/packages/apps/examples/sdk-api)
|
|
83
|
+
|
|
84
|
+
<br>
|
|
85
|
+
|
|
86
|
+
## API functions
|
|
87
|
+
|
|
88
|
+
These functions return data from the powerful [QuickNode Graph API](https://www.quicknode.com/graph-api), making it even easier to use.
|
|
89
|
+
|
|
90
|
+
<br>
|
|
28
91
|
|
|
29
|
-
|
|
92
|
+
### Configuration
|
|
30
93
|
|
|
31
|
-
|
|
94
|
+
Sign up for a [QuickNode](https://www.quicknode.com/) account to use the multi-chain [QuickNode GraphQL API](https://www.quicknode.com/graph-api) API key in the SDK.
|
|
32
95
|
|
|
33
96
|
```ts
|
|
34
|
-
import
|
|
97
|
+
import QuickNode from '@quicknode/sdk';
|
|
35
98
|
|
|
36
|
-
const
|
|
37
|
-
|
|
99
|
+
const qn = new QuickNode.API({
|
|
100
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
101
|
+
defaultChain: 'ethereum',
|
|
38
102
|
});
|
|
39
103
|
```
|
|
40
104
|
|
|
41
|
-
|
|
105
|
+
A `defaultChain` can be set to set the chain for all calls. Currently we support:
|
|
106
|
+
|
|
107
|
+
- `ethereum` Ethereum Mainnet
|
|
108
|
+
- `ethereumSepolia` Ethereum Sepolia
|
|
109
|
+
- `polygon` Polygon Mainnet
|
|
110
|
+
|
|
111
|
+
The `defaultChain` in the initializer can be overridden with the `chain` argument in functions.
|
|
112
|
+
|
|
113
|
+
If no `defaultChain` is passed into the initializer or a `chain` argument to a function,`ethereum` is used by default.
|
|
114
|
+
|
|
115
|
+
<br>
|
|
116
|
+
|
|
117
|
+
### Configuration Arguments
|
|
118
|
+
|
|
119
|
+
| Property | Values | Required | Description | Example |
|
|
120
|
+
| ------------ | ------ | -------- | ------------------------------------------------------------------- | -------- |
|
|
121
|
+
| graphApiKey | string | ❌ | The QuickNode GraphQL API Key | abcd1234 |
|
|
122
|
+
| defaultChain | string | ❌ | The default chain to use for all functions (defaults to `ethereum`) | polygon |
|
|
42
123
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
124
|
+
<br>
|
|
125
|
+
|
|
126
|
+
### nfts.getByWallet
|
|
127
|
+
|
|
128
|
+
Returns NFTs owned by a wallet
|
|
129
|
+
|
|
130
|
+
| Argument | Values | Required | Description | Example |
|
|
131
|
+
| -------- | ------ | -------- | --------------------------------------------------- | ---------------------------------- |
|
|
132
|
+
| address | string | ✅ | Wallet address or ENS domain | quicknode.eth |
|
|
133
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
134
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
135
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
136
|
+
| filter | object | ❌ | An object with the optional filters for the request | { contractAddressIn: ["0x00..."] } |
|
|
137
|
+
|
|
138
|
+
`filter` Parameters
|
|
139
|
+
|
|
140
|
+
| Argument | Values | Description | Example |
|
|
141
|
+
| ----------------- | ------ | ---------------------------------- | ---------------------------------------------- |
|
|
142
|
+
| contractAddressIn | Array | An array of NFT contract addresses | ["0x2106C00Ac7dA0A3430aE667879139E832307AeAa"] |
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import QuickNode from '@quicknode/sdk';
|
|
146
|
+
|
|
147
|
+
const qn = new QuickNode.API({
|
|
148
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
qn.nfts
|
|
152
|
+
.getByWallet({
|
|
153
|
+
address: '0x51ABa267A6e8e1E76B44183a73E881D73A102F26',
|
|
154
|
+
first: 5,
|
|
155
|
+
})
|
|
156
|
+
.then((response) => console.log(response));
|
|
157
|
+
|
|
158
|
+
// can pass in ENS domain
|
|
159
|
+
qn.nfts
|
|
160
|
+
.getByWallet({
|
|
161
|
+
address: 'quicknode.eth',
|
|
162
|
+
first: 5,
|
|
163
|
+
})
|
|
164
|
+
.then((response) => console.log(response));
|
|
165
|
+
```
|
|
46
166
|
|
|
47
167
|
<br>
|
|
48
168
|
|
|
49
|
-
|
|
169
|
+
### nfts.getTrendingCollections
|
|
50
170
|
|
|
51
|
-
|
|
171
|
+
Returns trending NFT Collections
|
|
52
172
|
|
|
53
|
-
| Argument | Values |
|
|
173
|
+
| Argument | Values | Required | Description | Example |
|
|
54
174
|
| -------- | ------ | -------- | ------------------------------- | --------------------------- |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
175
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
176
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
177
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
import QuickNode from '@quicknode/sdk';
|
|
181
|
+
|
|
182
|
+
const qn = new QuickNode({
|
|
183
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
qn.nfts
|
|
187
|
+
.getTrendingCollections({
|
|
188
|
+
first: 5,
|
|
189
|
+
})
|
|
190
|
+
.then((response) => console.log(response));
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
<br>
|
|
194
|
+
|
|
195
|
+
### nfts.getByContractAddress
|
|
196
|
+
|
|
197
|
+
Returns NFTs by contract address. The response differs based on if they are an ERC721 or ERC1155 standard.
|
|
198
|
+
|
|
199
|
+
| Argument | Values | Required | Description | Example |
|
|
200
|
+
| --------------- | ------ | -------- | ------------------------------- | ------------------------------------------ |
|
|
201
|
+
| contractAddress | string | ✅ | NFT contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
202
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
203
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
204
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
58
205
|
|
|
59
206
|
```ts
|
|
60
|
-
import
|
|
207
|
+
import QuickNode from '@quicknode/sdk';
|
|
61
208
|
|
|
62
|
-
const
|
|
209
|
+
const qn = new QuickNode.API({
|
|
210
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
211
|
+
});
|
|
63
212
|
|
|
64
|
-
|
|
65
|
-
.
|
|
66
|
-
|
|
213
|
+
qn.nfts
|
|
214
|
+
.getByContractAddress({
|
|
215
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
67
216
|
first: 5,
|
|
68
217
|
})
|
|
69
218
|
.then((response) => console.log(response));
|
|
70
219
|
```
|
|
71
220
|
|
|
72
|
-
|
|
221
|
+
<br>
|
|
222
|
+
|
|
223
|
+
### nfts.getNFTDetails
|
|
224
|
+
|
|
225
|
+
Returns the details for a specified NFT
|
|
226
|
+
|
|
227
|
+
| Argument | Values | Required | Description | Example |
|
|
228
|
+
| --------------- | ------ | -------- | -------------------- | ------------------------------------------ |
|
|
229
|
+
| contractAddress | string | ✅ | NFT contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
230
|
+
| tokenId | string | ✅ | NFT Token ID | 1 |
|
|
231
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import QuickNode from '@quicknode/sdk';
|
|
235
|
+
|
|
236
|
+
const qn = new QuickNode.API({
|
|
237
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
qn.nfts
|
|
241
|
+
.getNFTDetails({
|
|
242
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
243
|
+
tokenId: '1',
|
|
244
|
+
})
|
|
245
|
+
.then((response) => console.log(response));
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
<br>
|
|
249
|
+
|
|
250
|
+
### nfts.getCollectionDetails
|
|
251
|
+
|
|
252
|
+
Returns the details for an NFT Collection
|
|
253
|
+
|
|
254
|
+
| Argument | Values | Required | Description | Example |
|
|
255
|
+
| --------------- | ------ | -------- | -------------------- | ------------------------------------------ |
|
|
256
|
+
| contractAddress | string | ✅ | NFT contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
257
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
import QuickNode from '@quicknode/sdk';
|
|
261
|
+
|
|
262
|
+
const qn = new QuickNode.API({
|
|
263
|
+
gqlApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
qn.nfts
|
|
267
|
+
.getCollectionDetails({
|
|
268
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
269
|
+
})
|
|
270
|
+
.then((response) => console.log(response));
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
<br>
|
|
274
|
+
|
|
275
|
+
### tokens.getBalancesByWallet
|
|
73
276
|
|
|
74
|
-
|
|
277
|
+
Returns ERC20 token balances for a wallet
|
|
278
|
+
|
|
279
|
+
| Argument | Values | Required | Description | Example |
|
|
75
280
|
| -------- | ------ | -------- | ------------------------------- | ------------------------------------------ |
|
|
76
|
-
| address | string |
|
|
77
|
-
| first | number |
|
|
78
|
-
| after | string |
|
|
281
|
+
| address | string | ✅ | Wallet address or ENS domain | 0x3C6aEFF92b4B35C2e1b196B57d0f8FFB56884A17 |
|
|
282
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
283
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
284
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
79
285
|
|
|
80
286
|
```ts
|
|
81
|
-
import
|
|
287
|
+
import QuickNode from '@quicknode/sdk';
|
|
82
288
|
|
|
83
|
-
const
|
|
289
|
+
const qn = new QuickNode.API({
|
|
290
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
291
|
+
});
|
|
84
292
|
|
|
85
|
-
|
|
86
|
-
.
|
|
87
|
-
address: '
|
|
293
|
+
qn.tokens
|
|
294
|
+
.getBalancesByWallet({
|
|
295
|
+
address: '0xd10e24685c7cdd3cd3baaa86b09c92be28c834b6',
|
|
296
|
+
first: 5,
|
|
297
|
+
})
|
|
298
|
+
.then((response) => console.log(response));
|
|
299
|
+
|
|
300
|
+
// Can pass in ENS domain
|
|
301
|
+
qn.tokens
|
|
302
|
+
.getBalancesByWallet({
|
|
303
|
+
address: 'quicknode.eth',
|
|
88
304
|
first: 5,
|
|
89
305
|
})
|
|
90
306
|
.then((response) => console.log(response));
|
|
91
307
|
```
|
|
92
308
|
|
|
93
|
-
|
|
309
|
+
<br>
|
|
310
|
+
|
|
311
|
+
### contracts.getDetails
|
|
312
|
+
|
|
313
|
+
Get the details and ABI for a contract address
|
|
94
314
|
|
|
95
|
-
| Argument
|
|
315
|
+
| Argument | Values | Required | Description | Example |
|
|
316
|
+
| --------------- | ------ | -------- | ---------------- | ------------------------------------------ |
|
|
317
|
+
| contractAddress | string | ✅ | contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
318
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
import QuickNode, { gql } from '@quicknode/sdk';
|
|
322
|
+
|
|
323
|
+
const qn = new QuickNode.API({
|
|
324
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
qn.contracts
|
|
328
|
+
.getDetails({
|
|
329
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
330
|
+
})
|
|
331
|
+
.then((response) => console.log(response));
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
<br>
|
|
335
|
+
|
|
336
|
+
### transactions.getByWallet
|
|
337
|
+
|
|
338
|
+
Returns transactions for a wallet
|
|
339
|
+
|
|
340
|
+
| Argument | Values | Required | Description | Example |
|
|
96
341
|
| -------- | ------ | -------- | ------------------------------- | ------------------------------------------ |
|
|
97
|
-
| address | string |
|
|
98
|
-
| first | number |
|
|
99
|
-
| after | string |
|
|
342
|
+
| address | string | ✅ | Wallet address or ENS domain | 0x3C6aEFF92b4B35C2e1b196B57d0f8FFB56884A17 |
|
|
343
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
344
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
345
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
100
346
|
|
|
101
347
|
```ts
|
|
102
|
-
import
|
|
348
|
+
import QuickNode from '@quicknode/sdk';
|
|
349
|
+
|
|
350
|
+
const qn = new QuickNode.API({
|
|
351
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
352
|
+
});
|
|
103
353
|
|
|
104
|
-
|
|
354
|
+
qn.transactions
|
|
355
|
+
.getByWallet({
|
|
356
|
+
address: '0xd10e24685c7cdd3cd3baaa86b09c92be28c834b6',
|
|
357
|
+
first: 5,
|
|
358
|
+
})
|
|
359
|
+
.then((response) => console.log(response));
|
|
105
360
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
361
|
+
// Can pass in ENS domain
|
|
362
|
+
qn.transactions
|
|
363
|
+
.getByWallet({
|
|
364
|
+
address: 'quicknode.eth',
|
|
109
365
|
first: 5,
|
|
110
366
|
})
|
|
111
367
|
.then((response) => console.log(response));
|
|
112
368
|
```
|
|
113
369
|
|
|
114
|
-
|
|
370
|
+
<br>
|
|
371
|
+
|
|
372
|
+
### transactions.getAll
|
|
373
|
+
|
|
374
|
+
Returns transactions filtered by search parameters
|
|
375
|
+
|
|
376
|
+
| Argument | Values | Required | Description | Example |
|
|
377
|
+
| -------- | ------ | -------- | --------------------------------------------------- | ------------------------------- |
|
|
378
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
379
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
380
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
381
|
+
| filter | object | ✅ | An object with the optional filters for the request | { blockNumber: { eq: 123456 } } |
|
|
115
382
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
|
383
|
+
`filter` Parameters
|
|
384
|
+
|
|
385
|
+
| Argument | Values | Description | Example |
|
|
386
|
+
| ----------- | ------ | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
|
|
387
|
+
| fromAddress | string | Filter transactions sent from address | fromAddress: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6" |
|
|
388
|
+
| toAddress | string | Filter transactions sent to address | toAddress: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6" |
|
|
389
|
+
| blockNumber | object | An object with any combination of `eq`, `gt`, `gte`, `in`, `lt`, or `lte` | { lt: 17343891, gt: 17343881 } |
|
|
390
|
+
| timestamp | object | An object with any combination of `eq`, `gt`, `gte`, `in`, `lt`, or `lte` with a valid timestamp | { lt: "2022-12-03T10:15:30Z" } |
|
|
391
|
+
|
|
392
|
+
_timestamp can be a date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the date-time format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar._
|
|
119
393
|
|
|
120
394
|
```ts
|
|
121
|
-
import
|
|
395
|
+
import QuickNode from '@quicknode/sdk';
|
|
122
396
|
|
|
123
|
-
const
|
|
397
|
+
const qn = new QuickNode.API({
|
|
398
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
399
|
+
});
|
|
124
400
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
401
|
+
// Use the filters
|
|
402
|
+
qn.transactions
|
|
403
|
+
.getAll({
|
|
404
|
+
filter: {
|
|
405
|
+
blockNumber: {
|
|
406
|
+
eq: 17372310,
|
|
407
|
+
},
|
|
408
|
+
fromAddress: '0x41407a3c41da7970d30a0343cda8b9db70c145fb',
|
|
409
|
+
},
|
|
128
410
|
})
|
|
129
411
|
.then((response) => console.log(response));
|
|
412
|
+
|
|
413
|
+
// Filters can be left blank to get the latest data
|
|
414
|
+
qn.transactions.getAll({ filter: {}, first: 5 }).then((response) => console.log(response));
|
|
130
415
|
```
|
|
131
416
|
|
|
132
|
-
|
|
417
|
+
<br>
|
|
418
|
+
|
|
419
|
+
### transactions.getByHash
|
|
133
420
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
| first | number | ✅ | Number of results to return | 10 |
|
|
140
|
-
| after | string | ✅ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
421
|
+
Returns transaction information by transaction hash
|
|
422
|
+
|
|
423
|
+
| Argument | Values | Required | Description | Example |
|
|
424
|
+
| -------- | ------ | -------- | ----------------------- | ------------------------------------------------------------------ |
|
|
425
|
+
| hash | string | ✅ | Hash of the transaction | 0x1aa26d1d542b414dd2e2d1aa6f8d8e128e2a45bc4a04c24232207221914389bf |
|
|
141
426
|
|
|
142
427
|
```ts
|
|
143
|
-
import
|
|
428
|
+
import QuickNode from '@quicknode/sdk';
|
|
429
|
+
|
|
430
|
+
const qn = new QuickNode.API({
|
|
431
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
qn.transactions
|
|
435
|
+
.getByHash({
|
|
436
|
+
hash: '0x1aa26d1d542b414dd2e2d1aa6f8d8e128e2a45bc4a04c24232207221914389bf',
|
|
437
|
+
})
|
|
438
|
+
.then((response) => console.log(response));
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
<br>
|
|
442
|
+
|
|
443
|
+
### events.getByContract
|
|
444
|
+
|
|
445
|
+
Returns events by contract address
|
|
446
|
+
|
|
447
|
+
| Argument | Values | Required | Description | Example |
|
|
448
|
+
| -------- | ------ | -------- | --------------------------------------------------- | ------------------------------- |
|
|
449
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
450
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
451
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
452
|
+
| filter | object | ❌ | An object with the optional filters for the request | { blockNumber: { eq: 123456 } } |
|
|
453
|
+
|
|
454
|
+
`filter` Parameters
|
|
455
|
+
|
|
456
|
+
Please see the [Token Event Filters section](#token-event-filters) for all options
|
|
144
457
|
|
|
145
|
-
|
|
458
|
+
```typescript
|
|
459
|
+
import QuickNode from '@quicknode/sdk';
|
|
460
|
+
|
|
461
|
+
const qn = new QuickNode.API({
|
|
462
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
qn.events
|
|
466
|
+
.getByContract({
|
|
467
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
468
|
+
})
|
|
469
|
+
.then((response) => console.log(response));
|
|
146
470
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
471
|
+
// Using filters
|
|
472
|
+
qn.events
|
|
473
|
+
.getByContract({
|
|
474
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
475
|
+
filter: {
|
|
476
|
+
fromAddress: {
|
|
477
|
+
eq: '0x10fa1c188eca954419a85112f975155f717ad8ea',
|
|
478
|
+
},
|
|
479
|
+
type: {
|
|
480
|
+
in: ['TRANSFER'],
|
|
481
|
+
},
|
|
482
|
+
}
|
|
152
483
|
})
|
|
153
484
|
.then((response) => console.log(response));
|
|
485
|
+
`
|
|
154
486
|
```
|
|
155
487
|
|
|
156
|
-
|
|
488
|
+
<br>
|
|
489
|
+
|
|
490
|
+
### events.getByNFTCollection
|
|
157
491
|
|
|
158
|
-
Returns the
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
492
|
+
Returns the events for an NFT Collection
|
|
493
|
+
|
|
494
|
+
| Argument | Values | Required | Description | Example |
|
|
495
|
+
| --------------- | ------ | -------- | --------------------------------------------------- | ------------------------------------------ |
|
|
496
|
+
| contractAddress | string | ✅ | NFT contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
497
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
498
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
499
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
500
|
+
| filter | object | ❌ | An object with the optional filters for the request | { blockNumber: { eq: 123456 } } |
|
|
501
|
+
|
|
502
|
+
`filter` Parameters
|
|
503
|
+
|
|
504
|
+
Please see the [Token Event Filters section](#token-event-filters) for all options
|
|
163
505
|
|
|
164
506
|
```ts
|
|
165
|
-
import
|
|
507
|
+
import QuickNode from '@quicknode/sdk';
|
|
166
508
|
|
|
167
|
-
const
|
|
509
|
+
const qn = new QuickNode.API({
|
|
510
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
511
|
+
});
|
|
168
512
|
|
|
169
|
-
|
|
170
|
-
.
|
|
171
|
-
contractAddress: '
|
|
172
|
-
|
|
513
|
+
qn.events
|
|
514
|
+
.getByNFTCollection({
|
|
515
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
516
|
+
first: 5,
|
|
517
|
+
})
|
|
518
|
+
.then((response) => console.log(response));
|
|
519
|
+
|
|
520
|
+
// Can pass in filters
|
|
521
|
+
qn.events
|
|
522
|
+
.getByNftCollection({
|
|
523
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
524
|
+
first: 5,
|
|
525
|
+
filter: {
|
|
526
|
+
type: {
|
|
527
|
+
eq: 'TRANSFER',
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
})
|
|
531
|
+
.then((response) => console.log(response));
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
<br>
|
|
535
|
+
|
|
536
|
+
### events.getByNFT
|
|
537
|
+
|
|
538
|
+
Returns the events for a specific NFT
|
|
539
|
+
|
|
540
|
+
| Argument | Values | Required | Description | Example |
|
|
541
|
+
| --------------- | ------ | -------- | --------------------------------------------------- | ------------------------------------------ |
|
|
542
|
+
| contractAddress | string | ✅ | NFT contract address | 0x2106C00Ac7dA0A3430aE667879139E832307AeAa |
|
|
543
|
+
| tokenId | string | ✅ | NFT Token ID | 1 |
|
|
544
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
545
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
546
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
547
|
+
| filter | object | ❌ | An object with the optional filters for the request | { blockNumber: { eq: 123456 } } |
|
|
548
|
+
|
|
549
|
+
`filter` Parameters
|
|
550
|
+
|
|
551
|
+
Please see the [Token Event Filters section](#token-event-filters) for all options
|
|
552
|
+
|
|
553
|
+
```ts
|
|
554
|
+
import QuickNode from '@quicknode/sdk';
|
|
555
|
+
|
|
556
|
+
const qn = new QuickNode.API({
|
|
557
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
qn.events
|
|
561
|
+
.getByNFT({
|
|
562
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
563
|
+
tokenId: '1',
|
|
564
|
+
})
|
|
565
|
+
.then((response) => console.log(response));
|
|
566
|
+
|
|
567
|
+
qn.events
|
|
568
|
+
.getByNFT({
|
|
569
|
+
contractAddress: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
|
|
570
|
+
tokenId: '1',
|
|
571
|
+
filter: {
|
|
572
|
+
type: {
|
|
573
|
+
eq: 'TRANSFER',
|
|
574
|
+
},
|
|
575
|
+
},
|
|
173
576
|
})
|
|
174
577
|
.then((response) => console.log(response));
|
|
175
578
|
```
|
|
176
579
|
|
|
177
|
-
|
|
580
|
+
<br>
|
|
178
581
|
|
|
179
|
-
|
|
582
|
+
### events.getAll
|
|
180
583
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
584
|
+
Returns events filtered by search parameters
|
|
585
|
+
|
|
586
|
+
| Argument | Values | Required | Description | Example |
|
|
587
|
+
| -------- | ------ | -------- | --------------------------------------------------- | ------------------------------- |
|
|
588
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
589
|
+
| first | number | ❌ | Number of results to return | 10 |
|
|
590
|
+
| after | string | ❌ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
591
|
+
| filter | object | ❌ | An object with the optional filters for the request | { blockNumber: { eq: 123456 } } |
|
|
592
|
+
|
|
593
|
+
`filter` Parameters
|
|
594
|
+
|
|
595
|
+
Please see the [Token Event Filters section](#token-event-filters) for all options
|
|
187
596
|
|
|
188
597
|
```ts
|
|
189
|
-
import
|
|
598
|
+
import QuickNode from '@quicknode/sdk';
|
|
190
599
|
|
|
191
|
-
const
|
|
600
|
+
const qn = new QuickNode.API({
|
|
601
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
602
|
+
});
|
|
192
603
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
604
|
+
// Use filters to get specific events
|
|
605
|
+
qn.events
|
|
606
|
+
.getAll({
|
|
607
|
+
first: 2,
|
|
608
|
+
filter: {
|
|
609
|
+
blockNumber: {
|
|
610
|
+
eq: 17414768,
|
|
611
|
+
},
|
|
612
|
+
toAddress: {
|
|
613
|
+
eq: '0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b',
|
|
614
|
+
},
|
|
615
|
+
},
|
|
197
616
|
})
|
|
198
617
|
.then((response) => console.log(response));
|
|
618
|
+
|
|
619
|
+
// Filters can be left blank to get the latest data
|
|
620
|
+
qn.events.getAll({}).then((response) => console.log(response));
|
|
199
621
|
```
|
|
200
622
|
|
|
201
|
-
|
|
623
|
+
<br>
|
|
624
|
+
|
|
625
|
+
### utils.getGasPrices
|
|
202
626
|
|
|
203
|
-
|
|
627
|
+
Returns historical gas prices by block number. Defaults to returning values in wei.
|
|
204
628
|
|
|
205
|
-
| Argument
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
629
|
+
| Argument | Values | Required | Description | Example |
|
|
630
|
+
| ------------ | ------- | -------- | --------------------------------------------------- | --------------------------------- |
|
|
631
|
+
| chain | string | ❌ | Blockchain name | polygon |
|
|
632
|
+
| returnInGwei | boolean | ❌ | Return gas values in Gwei | true |
|
|
633
|
+
| filter | object | ❌ | An object with the optional filters for the request | { blockNumber: { eq: 17343891 } } |
|
|
634
|
+
|
|
635
|
+
`filter` Parameters
|
|
636
|
+
|
|
637
|
+
| Argument | Values | Description | Example |
|
|
638
|
+
| ----------- | ------ | ------------------------------------------------------------------------- | ------------------------------ |
|
|
639
|
+
| blockNumber | object | An object with any combination of `eq`, `gt`, `gte`, `in`, `lt`, or `lte` | { lt: 17343891, gt: 17343881 } |
|
|
211
640
|
|
|
212
641
|
```ts
|
|
213
|
-
import
|
|
642
|
+
import QuickNode from '@quicknode/sdk';
|
|
214
643
|
|
|
215
|
-
const
|
|
644
|
+
const qn = new QuickNode.API({
|
|
645
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
646
|
+
});
|
|
216
647
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
648
|
+
// Get the latest data
|
|
649
|
+
qn.utils.getGasPrices({}).then((response) => console.log(response));
|
|
650
|
+
|
|
651
|
+
// Get filtered data
|
|
652
|
+
qn.utils
|
|
653
|
+
.getGasPrices({
|
|
654
|
+
filter: {
|
|
655
|
+
blockNumber: {
|
|
656
|
+
eq: 17343891,
|
|
657
|
+
},
|
|
658
|
+
},
|
|
224
659
|
})
|
|
225
660
|
.then((response) => console.log(response));
|
|
226
661
|
```
|
|
227
662
|
|
|
663
|
+
<br>
|
|
664
|
+
|
|
665
|
+
### graphApiClient.query
|
|
666
|
+
|
|
667
|
+
A way to send GraphQL queries directly to the [QuickNode GraphQL API](https://www.quicknode.com/graph-api). `graphApiClient` is an [Urql client](https://formidable.com/open-source/urql/docs/api/core/#client) instance configured to use QuickNode's Graph API. For more information about the query structure, see the [Graph API documentation](https://docs.quicknode.com/docs/graphql/getting-started/)
|
|
668
|
+
|
|
669
|
+
```ts
|
|
670
|
+
import QuickNode, { gql } from '@quicknode/sdk';
|
|
671
|
+
|
|
672
|
+
const qn = new QuickNode.API({
|
|
673
|
+
graphApiKey: 'my-api-key', // which is obtained by signing up on https://www.quicknode.com/signup
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
const query = gql`
|
|
677
|
+
query ($contractAddress: String!) {
|
|
678
|
+
ethereum {
|
|
679
|
+
collection(contractAddress: $contractAddress) {
|
|
680
|
+
address
|
|
681
|
+
name
|
|
682
|
+
symbol
|
|
683
|
+
totalSupply
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
`;
|
|
688
|
+
const variables = {
|
|
689
|
+
contractAddress: '0x2106c00ac7da0a3430ae667879139e832307aeaa',
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
qn.graphApiClient.query({ query, variables }).then(({ data }) => console.log(data));
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
<br>
|
|
696
|
+
|
|
697
|
+
## Filters
|
|
698
|
+
|
|
699
|
+
Some filters are shared between queries
|
|
700
|
+
|
|
701
|
+
<br>
|
|
702
|
+
|
|
703
|
+
### Token Event Filters
|
|
704
|
+
|
|
705
|
+
| Argument | Values | Description | Example |
|
|
706
|
+
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
707
|
+
| blockNumber | object | An object with any combination of `eq`, `gt`, `gte`, `in`, `lt`, or `lte` | { lt: 17343891, gt: 17343881 } |
|
|
708
|
+
| contractAddress | object | A contract address with `eq`, `in`, or `notIn` | { eq: "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" } |
|
|
709
|
+
| contractStandard | object | A valid contract standard `ERC20`, `ERC721`, `ERC1155` with `eq`, `in`, or `notIn` | { eq: "ERC20" } |
|
|
710
|
+
| fromAddress | object | Filter events sent from address with `eq`, `in`, or `notIn` | { eq: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6" } |
|
|
711
|
+
| marketplace | object | `BLUR`, `CRYPTOPUNKS`, `LOOKSRARE`, `NIFTY_GATEWAY`, `OPENSEA`, `SEAPORT`, `X2Y2`, `ZEROX` with with `eq`, `in`, or `notIn` | { eq: "OPENSEA" } |
|
|
712
|
+
| timestamp | object | An object with any combination of `eq`, `gt`, `gte`, `in`, `lt`, or `lte` with a valid timestamp | { lt: "2022-12-03T10:15:30Z" } |
|
|
713
|
+
| toAddress | object | Filter events sent to address with `eq`, `in`, or `notIn` | { eq: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6" } |
|
|
714
|
+
| transactionHash | object | A transaction hash with with `eq`, `in`, or `notIn` | { eq: "0xdd652cfd936f7a22ab217a69c1f4356a6d15a4c8d61e30d87a4cd8abca30046f" } |
|
|
715
|
+
| type | object | `TRANSFER`, `MINT`, `SALE`, `SWAP`, or `BURN` with `eq`, `in`, or `notIn` | { in: ["TRANSFER", "MINT"] } |
|
|
716
|
+
| walletAddress | object | A valid wallet address with `eq`, `in`, or `notIn` | { eq: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6" } |
|
|
717
|
+
|
|
718
|
+
_timestamp can be a date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the date-time format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar._
|
|
719
|
+
|
|
720
|
+
<br>
|
|
721
|
+
|
|
228
722
|
## Pagination
|
|
229
723
|
|
|
230
724
|
For functions that support pagination, use the `first` property to specify the amount of results to return.
|
|
@@ -236,10 +730,13 @@ The returned `data.tokensPageInfo.endCursor` property in the response can be use
|
|
|
236
730
|
For example, if a response contains:
|
|
237
731
|
|
|
238
732
|
```json
|
|
239
|
-
|
|
240
|
-
"
|
|
733
|
+
{
|
|
734
|
+
"results": [],
|
|
735
|
+
"pageInfo": {
|
|
736
|
+
"endCursor": "T2Zmc2V0Q29ubmVjdGlvbjox",
|
|
241
737
|
"hasNextPage": true,
|
|
242
|
-
"
|
|
738
|
+
"hasPreviousPage": false,
|
|
739
|
+
"startCursor": "T2Zmc2V0Q29ubmVjdGlvbjow"
|
|
243
740
|
}
|
|
244
741
|
}
|
|
245
742
|
```
|
|
@@ -247,23 +744,53 @@ For example, if a response contains:
|
|
|
247
744
|
calling the following will get the next page of results
|
|
248
745
|
|
|
249
746
|
```typescript
|
|
250
|
-
|
|
251
|
-
|
|
747
|
+
qn.nfts.getByWallet({
|
|
748
|
+
address: 'quicknode.eth',
|
|
252
749
|
first: 5,
|
|
253
|
-
after: '
|
|
750
|
+
after: 'T2Zmc2V0Q29ubmVjdGlvbjox',
|
|
254
751
|
});
|
|
255
752
|
```
|
|
256
753
|
|
|
257
|
-
|
|
754
|
+
<br>
|
|
755
|
+
|
|
756
|
+
## Contributing corner
|
|
258
757
|
|
|
259
|
-
|
|
758
|
+
### Issues
|
|
260
759
|
|
|
261
|
-
|
|
760
|
+
Please submit any issues or feature requests as an [issue in Github](https://github.com/quiknode-labs/qn-oss/issues).
|
|
262
761
|
|
|
263
|
-
|
|
762
|
+
<br>
|
|
763
|
+
|
|
764
|
+
### Development
|
|
765
|
+
|
|
766
|
+
We recommend using the example application to develop
|
|
767
|
+
|
|
768
|
+
1. In `qn-oss` monorepo root directory, run `yarn install`
|
|
769
|
+
1. cd `packages/apps/examples/sdk-api` from `qn-oss` monorepo root
|
|
770
|
+
1. `cp .env.example .env` and add api key
|
|
771
|
+
1. `nx serve apps-examples-sdk-api`
|
|
772
|
+
1. Then you can send requests to the API, for example: `curl http://localhost:3333/api/nftsByAddress/0xbc08dadccc79c00587d7e6a75bb68ff5fd30f9e0`
|
|
773
|
+
|
|
774
|
+
<br>
|
|
775
|
+
|
|
776
|
+
### Running tests
|
|
777
|
+
|
|
778
|
+
Run `nx test libs-sdk` to execute the tests via [Jest](https://jestjs.io).
|
|
779
|
+
|
|
780
|
+
API responses are recorded using [polly.js](https://github.com/Netflix/pollyjs). You can re-record live requests by passing in an API key, copy `.env.test.example` to `.env.test` and fill out with your API key.
|
|
781
|
+
|
|
782
|
+
<br>
|
|
783
|
+
|
|
784
|
+
### Running linting
|
|
785
|
+
|
|
786
|
+
Run `nx lint libs-sdk` to execute the lint via [ESLint](https://eslint.org/).
|
|
787
|
+
|
|
788
|
+
<br>
|
|
264
789
|
|
|
265
|
-
|
|
790
|
+
### Generate graphql codegen typings
|
|
266
791
|
|
|
267
|
-
|
|
792
|
+
Generate graphql typings via [Codegen](https://www.the-guild.dev/graphql/codegen).
|
|
268
793
|
|
|
269
|
-
|
|
794
|
+
1. navigate to `packages/libs/sdk` from `qn-oss` monorepo root
|
|
795
|
+
1. `cp .env.example .env` and add api key
|
|
796
|
+
1. run `yarn run codegen`
|