@quicknode/sdk 0.4.0 → 0.5.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
CHANGED
|
@@ -193,12 +193,38 @@ const client = new QuickNodeSDK();
|
|
|
193
193
|
client.nft
|
|
194
194
|
.getContractEventLogs({
|
|
195
195
|
address: '0x60E4d786628Fea6478F785A6d7e704777c86a7c6',
|
|
196
|
-
tokenId: '100',
|
|
197
196
|
types: ['TRANSFER', 'ORDER'],
|
|
198
197
|
})
|
|
199
198
|
.then((response) => console.log(response));
|
|
200
199
|
```
|
|
201
200
|
|
|
201
|
+
### nft.getNFTsByWalletAndContracts
|
|
202
|
+
|
|
203
|
+
Gets NFTs from specified collections held by a wallet
|
|
204
|
+
|
|
205
|
+
| Argument | Values | Optional | Description | Example |
|
|
206
|
+
| --------- | ---------------- | -------- | ------------------------------- | ---------------------------------------------- |
|
|
207
|
+
| address | string | ❌ | Wallet address | 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 |
|
|
208
|
+
| contracts | array of strings | ❌ | NFT contract addresses | ['0xba30e5f9bb24caa003e9f2f0497ad287fdf95623'] |
|
|
209
|
+
| first | number | ✅ | Number of results to return | 10 |
|
|
210
|
+
| after | string | ✅ | Return results after end cursor | YXJyYXljb25uZWN0aW9uOjUwNQ= |
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
import { QuickNodeSDK } from '@quicknode/sdk';
|
|
214
|
+
|
|
215
|
+
const client = new QuickNodeSDK();
|
|
216
|
+
|
|
217
|
+
client.nft
|
|
218
|
+
.getNFTsByWalletAndContracts({
|
|
219
|
+
address: '0x13928eb9a86c8278a45b6ff2935c7730b58ac675',
|
|
220
|
+
contracts: [
|
|
221
|
+
'0xba30e5f9bb24caa003e9f2f0497ad287fdf95623',
|
|
222
|
+
'0xbce3781ae7ca1a5e050bd9c4c77369867ebc307e',
|
|
223
|
+
],
|
|
224
|
+
})
|
|
225
|
+
.then((response) => console.log(response));
|
|
226
|
+
```
|
|
227
|
+
|
|
202
228
|
## Pagination
|
|
203
229
|
|
|
204
230
|
For functions that support pagination, use the `first` property to specify the amount of results to return.
|
package/package.json
CHANGED
package/src/index.esm.js
CHANGED
|
@@ -8158,6 +8158,43 @@ const getContractEventLogsRawQuery = gql `
|
|
|
8158
8158
|
}
|
|
8159
8159
|
`;
|
|
8160
8160
|
|
|
8161
|
+
const getNFTsWalletAndContractsRawQuery = gql `
|
|
8162
|
+
query NFTsWalletAndContract(
|
|
8163
|
+
$filter: TokensFilterInputType
|
|
8164
|
+
$address: String
|
|
8165
|
+
$first: Int
|
|
8166
|
+
$after: String
|
|
8167
|
+
) {
|
|
8168
|
+
wallet(address: $address) {
|
|
8169
|
+
ensName
|
|
8170
|
+
address
|
|
8171
|
+
tokens(filter: $filter, first: $first, after: $after) {
|
|
8172
|
+
pageInfo {
|
|
8173
|
+
hasNextPage
|
|
8174
|
+
endCursor
|
|
8175
|
+
}
|
|
8176
|
+
edges {
|
|
8177
|
+
node {
|
|
8178
|
+
tokenId
|
|
8179
|
+
images {
|
|
8180
|
+
url
|
|
8181
|
+
}
|
|
8182
|
+
... on ERC721Token {
|
|
8183
|
+
contract {
|
|
8184
|
+
address
|
|
8185
|
+
... on ERC721Contract {
|
|
8186
|
+
symbol
|
|
8187
|
+
name
|
|
8188
|
+
}
|
|
8189
|
+
}
|
|
8190
|
+
}
|
|
8191
|
+
}
|
|
8192
|
+
}
|
|
8193
|
+
}
|
|
8194
|
+
}
|
|
8195
|
+
}
|
|
8196
|
+
`;
|
|
8197
|
+
|
|
8161
8198
|
const DEFAULT_LOG_FILTER_TYPES = ['TRANSFER', 'ORDER', 'MINT'];
|
|
8162
8199
|
class NFTQueries {
|
|
8163
8200
|
constructor(client) {
|
|
@@ -8225,6 +8262,16 @@ class NFTQueries {
|
|
|
8225
8262
|
});
|
|
8226
8263
|
});
|
|
8227
8264
|
}
|
|
8265
|
+
getNFTsByWalletAndContracts(variables) {
|
|
8266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8267
|
+
const { contracts } = variables, otherVariables = __rest(variables, ["contracts"]);
|
|
8268
|
+
const response = yield this.client.query({
|
|
8269
|
+
query: getNFTsWalletAndContractsRawQuery,
|
|
8270
|
+
variables: Object.assign(Object.assign({}, otherVariables), { filter: { contractAddressIn: contracts } }),
|
|
8271
|
+
});
|
|
8272
|
+
return response;
|
|
8273
|
+
});
|
|
8274
|
+
}
|
|
8228
8275
|
}
|
|
8229
8276
|
|
|
8230
8277
|
/**
|
package/src/index.js
CHANGED
|
@@ -8166,6 +8166,43 @@ const getContractEventLogsRawQuery = gql `
|
|
|
8166
8166
|
}
|
|
8167
8167
|
`;
|
|
8168
8168
|
|
|
8169
|
+
const getNFTsWalletAndContractsRawQuery = gql `
|
|
8170
|
+
query NFTsWalletAndContract(
|
|
8171
|
+
$filter: TokensFilterInputType
|
|
8172
|
+
$address: String
|
|
8173
|
+
$first: Int
|
|
8174
|
+
$after: String
|
|
8175
|
+
) {
|
|
8176
|
+
wallet(address: $address) {
|
|
8177
|
+
ensName
|
|
8178
|
+
address
|
|
8179
|
+
tokens(filter: $filter, first: $first, after: $after) {
|
|
8180
|
+
pageInfo {
|
|
8181
|
+
hasNextPage
|
|
8182
|
+
endCursor
|
|
8183
|
+
}
|
|
8184
|
+
edges {
|
|
8185
|
+
node {
|
|
8186
|
+
tokenId
|
|
8187
|
+
images {
|
|
8188
|
+
url
|
|
8189
|
+
}
|
|
8190
|
+
... on ERC721Token {
|
|
8191
|
+
contract {
|
|
8192
|
+
address
|
|
8193
|
+
... on ERC721Contract {
|
|
8194
|
+
symbol
|
|
8195
|
+
name
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
}
|
|
8199
|
+
}
|
|
8200
|
+
}
|
|
8201
|
+
}
|
|
8202
|
+
}
|
|
8203
|
+
}
|
|
8204
|
+
`;
|
|
8205
|
+
|
|
8169
8206
|
const DEFAULT_LOG_FILTER_TYPES = ['TRANSFER', 'ORDER', 'MINT'];
|
|
8170
8207
|
class NFTQueries {
|
|
8171
8208
|
constructor(client) {
|
|
@@ -8233,6 +8270,16 @@ class NFTQueries {
|
|
|
8233
8270
|
});
|
|
8234
8271
|
});
|
|
8235
8272
|
}
|
|
8273
|
+
getNFTsByWalletAndContracts(variables) {
|
|
8274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8275
|
+
const { contracts } = variables, otherVariables = __rest(variables, ["contracts"]);
|
|
8276
|
+
const response = yield this.client.query({
|
|
8277
|
+
query: getNFTsWalletAndContractsRawQuery,
|
|
8278
|
+
variables: Object.assign(Object.assign({}, otherVariables), { filter: { contractAddressIn: contracts } }),
|
|
8279
|
+
});
|
|
8280
|
+
return response;
|
|
8281
|
+
});
|
|
8282
|
+
}
|
|
8236
8283
|
}
|
|
8237
8284
|
|
|
8238
8285
|
/**
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PaginationArgs } from '../../../types';
|
|
2
|
+
export declare const getNFTsWalletAndContractsRawQuery: import("graphql/language/ast").DocumentNode;
|
|
3
|
+
export interface NFTWalletAndContractQueryVariables extends PaginationArgs {
|
|
4
|
+
address: string;
|
|
5
|
+
contracts: string[];
|
|
6
|
+
}
|
|
@@ -7,6 +7,7 @@ import { CollectionDetailsQueryVariables } from './getCollectionDetails/getColle
|
|
|
7
7
|
import { EventLogsQueryVariables } from './getNFTEventLogs/getNFTEventLogs';
|
|
8
8
|
import { NFTDetailsQueryVariables } from './getNFTDetails/getNFTDetails';
|
|
9
9
|
import { ContractEventLogQueryVariables } from './getContractEventLogs/getContractEventLogs';
|
|
10
|
+
import { NFTWalletAndContractQueryVariables } from './getNFTsByWalletAndContracts/getNFTsByWalletAndContracts';
|
|
10
11
|
import { ContractNFTsQueryResponse, WalletNFTsQueryResponse, CollectionDetailsQueryResponse, EventLogsQueryResponse, NFTDetailsQueryResponse, ContractEventLogsQueryResponse } from './sharedTypes';
|
|
11
12
|
export declare class NFTQueries {
|
|
12
13
|
private client;
|
|
@@ -18,4 +19,5 @@ export declare class NFTQueries {
|
|
|
18
19
|
getNFTEventLogs(variables: EventLogsQueryVariables): Promise<ApolloQueryResult<EventLogsQueryResponse>>;
|
|
19
20
|
getNFTDetails(variables: NFTDetailsQueryVariables): Promise<ApolloQueryResult<NFTDetailsQueryResponse>>;
|
|
20
21
|
getContractEventLogs(variables: ContractEventLogQueryVariables): Promise<ApolloQueryResult<ContractEventLogsQueryResponse>>;
|
|
22
|
+
getNFTsByWalletAndContracts(variables: NFTWalletAndContractQueryVariables): Promise<ApolloQueryResult<WalletNFTsQueryResponse>>;
|
|
21
23
|
}
|