@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/src/index.esm.js
CHANGED
|
@@ -7804,6 +7804,7 @@ var extras = {
|
|
|
7804
7804
|
gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;
|
|
7805
7805
|
})(gql || (gql = {}));
|
|
7806
7806
|
gql["default"] = gql;
|
|
7807
|
+
var gql$1 = gql;
|
|
7807
7808
|
|
|
7808
7809
|
function setContext(setter) {
|
|
7809
7810
|
return new ApolloLink(function (operation, forward) {
|
|
@@ -7912,38 +7913,6 @@ function onError(errorHandler) {
|
|
|
7912
7913
|
return ErrorLink;
|
|
7913
7914
|
})(ApolloLink));
|
|
7914
7915
|
|
|
7915
|
-
const getWalletAddressNFTsRawQuery = gql `
|
|
7916
|
-
query WalletNFTs($address: String, $first: Int, $after: String) {
|
|
7917
|
-
wallet(address: $address) {
|
|
7918
|
-
ensName
|
|
7919
|
-
address
|
|
7920
|
-
tokens(first: $first, after: $after) {
|
|
7921
|
-
pageInfo {
|
|
7922
|
-
hasNextPage
|
|
7923
|
-
endCursor
|
|
7924
|
-
}
|
|
7925
|
-
edges {
|
|
7926
|
-
node {
|
|
7927
|
-
tokenId
|
|
7928
|
-
images {
|
|
7929
|
-
url
|
|
7930
|
-
}
|
|
7931
|
-
... on ERC721Token {
|
|
7932
|
-
contract {
|
|
7933
|
-
address
|
|
7934
|
-
... on ERC721Contract {
|
|
7935
|
-
symbol
|
|
7936
|
-
name
|
|
7937
|
-
}
|
|
7938
|
-
}
|
|
7939
|
-
}
|
|
7940
|
-
}
|
|
7941
|
-
}
|
|
7942
|
-
}
|
|
7943
|
-
}
|
|
7944
|
-
}
|
|
7945
|
-
`;
|
|
7946
|
-
|
|
7947
7916
|
const getWalletENSNFTsRawQuery = gql `
|
|
7948
7917
|
query WalletNFTs($ensName: String, $first: Int, $after: String) {
|
|
7949
7918
|
wallet(ensName: $ensName) {
|
|
@@ -8038,45 +8007,6 @@ const getCollectionDetailsRawQuery = gql `
|
|
|
8038
8007
|
}
|
|
8039
8008
|
`;
|
|
8040
8009
|
|
|
8041
|
-
const getNFTEventLogsRawQuery = gql `
|
|
8042
|
-
query NFTEvents(
|
|
8043
|
-
$address: String!
|
|
8044
|
-
$tokenId: String!
|
|
8045
|
-
$filter: LogsFilterInputType
|
|
8046
|
-
$first: Int
|
|
8047
|
-
$after: String
|
|
8048
|
-
) {
|
|
8049
|
-
token(contractAddress: $address, tokenId: $tokenId) {
|
|
8050
|
-
... on ERC721Token {
|
|
8051
|
-
tokenId
|
|
8052
|
-
contract {
|
|
8053
|
-
address # Included key field for caching
|
|
8054
|
-
}
|
|
8055
|
-
logs(filter: $filter, first: $first, after: $after) {
|
|
8056
|
-
edges {
|
|
8057
|
-
node {
|
|
8058
|
-
blockNumber
|
|
8059
|
-
type
|
|
8060
|
-
fromAddress
|
|
8061
|
-
toAddress
|
|
8062
|
-
estimatedConfirmedAt
|
|
8063
|
-
transactionHash
|
|
8064
|
-
... on OrderLog {
|
|
8065
|
-
marketplace
|
|
8066
|
-
priceInEth
|
|
8067
|
-
}
|
|
8068
|
-
}
|
|
8069
|
-
}
|
|
8070
|
-
pageInfo {
|
|
8071
|
-
hasNextPage
|
|
8072
|
-
endCursor
|
|
8073
|
-
}
|
|
8074
|
-
}
|
|
8075
|
-
}
|
|
8076
|
-
}
|
|
8077
|
-
}
|
|
8078
|
-
`;
|
|
8079
|
-
|
|
8080
8010
|
const getNFTDetailsRawQuery = gql `
|
|
8081
8011
|
query Token($contractAddress: String!, $tokenId: String!) {
|
|
8082
8012
|
token(contractAddress: $contractAddress, tokenId: $tokenId) {
|
|
@@ -8117,20 +8047,215 @@ const getNFTDetailsRawQuery = gql `
|
|
|
8117
8047
|
}
|
|
8118
8048
|
`;
|
|
8119
8049
|
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8050
|
+
var ContractsOrderByEnum;
|
|
8051
|
+
(function (ContractsOrderByEnum) {
|
|
8052
|
+
/**
|
|
8053
|
+
* Sort contracts by average sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
|
|
8054
|
+
* @deprecated Use the trendingCollections query instead.
|
|
8055
|
+
*/
|
|
8056
|
+
ContractsOrderByEnum["Average"] = "AVERAGE";
|
|
8057
|
+
/**
|
|
8058
|
+
* Sort contracts by max sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
|
|
8059
|
+
* @deprecated Use the trendingCollections query instead.
|
|
8060
|
+
*/
|
|
8061
|
+
ContractsOrderByEnum["Ceiling"] = "CEILING";
|
|
8062
|
+
/**
|
|
8063
|
+
* Sort contracts by min sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
|
|
8064
|
+
* @deprecated Use the trendingCollections query instead.
|
|
8065
|
+
*/
|
|
8066
|
+
ContractsOrderByEnum["Floor"] = "FLOOR";
|
|
8067
|
+
/** Sort contracts alphabetically by name */
|
|
8068
|
+
ContractsOrderByEnum["Name"] = "NAME";
|
|
8069
|
+
/**
|
|
8070
|
+
* Sort contracts by number of sales. Defaults to within last hour, use timeframe on "stats" to further filter.
|
|
8071
|
+
* @deprecated Use the trendingCollections query instead.
|
|
8072
|
+
*/
|
|
8073
|
+
ContractsOrderByEnum["Sales"] = "SALES";
|
|
8074
|
+
/** Sort contracts alphabetically by symbol */
|
|
8075
|
+
ContractsOrderByEnum["Symbol"] = "SYMBOL";
|
|
8076
|
+
/**
|
|
8077
|
+
* Sort contracts by volume. Defaults to within last hour, use timeframe on "stats" to further filter.
|
|
8078
|
+
* @deprecated Use the trendingCollections query instead.
|
|
8079
|
+
*/
|
|
8080
|
+
ContractsOrderByEnum["Volume"] = "VOLUME";
|
|
8081
|
+
})(ContractsOrderByEnum || (ContractsOrderByEnum = {}));
|
|
8082
|
+
var HeldCollectionsOrderByEnum;
|
|
8083
|
+
(function (HeldCollectionsOrderByEnum) {
|
|
8084
|
+
/** The timestamp of when the wallet acquired a token in this collection. */
|
|
8085
|
+
HeldCollectionsOrderByEnum["DateAcquired"] = "DATE_ACQUIRED";
|
|
8086
|
+
/** The name of the collection */
|
|
8087
|
+
HeldCollectionsOrderByEnum["Name"] = "NAME";
|
|
8088
|
+
})(HeldCollectionsOrderByEnum || (HeldCollectionsOrderByEnum = {}));
|
|
8089
|
+
var HeldTokensOrderByEnum;
|
|
8090
|
+
(function (HeldTokensOrderByEnum) {
|
|
8091
|
+
/** The timestamp of when the wallet acquired this token. */
|
|
8092
|
+
HeldTokensOrderByEnum["DateAcquired"] = "DATE_ACQUIRED";
|
|
8093
|
+
/** The name of the token */
|
|
8094
|
+
HeldTokensOrderByEnum["Name"] = "NAME";
|
|
8095
|
+
})(HeldTokensOrderByEnum || (HeldTokensOrderByEnum = {}));
|
|
8096
|
+
var LogOrderMarketplace;
|
|
8097
|
+
(function (LogOrderMarketplace) {
|
|
8098
|
+
LogOrderMarketplace["Blur"] = "BLUR";
|
|
8099
|
+
LogOrderMarketplace["Cryptopunks"] = "CRYPTOPUNKS";
|
|
8100
|
+
LogOrderMarketplace["Gem"] = "GEM";
|
|
8101
|
+
LogOrderMarketplace["Genie"] = "GENIE";
|
|
8102
|
+
LogOrderMarketplace["Looksrare"] = "LOOKSRARE";
|
|
8103
|
+
LogOrderMarketplace["Niftygateway"] = "NIFTYGATEWAY";
|
|
8104
|
+
LogOrderMarketplace["Opensea"] = "OPENSEA";
|
|
8105
|
+
LogOrderMarketplace["X2Y2"] = "X2Y2";
|
|
8106
|
+
LogOrderMarketplace["Zerox"] = "ZEROX";
|
|
8107
|
+
})(LogOrderMarketplace || (LogOrderMarketplace = {}));
|
|
8108
|
+
var LogType;
|
|
8109
|
+
(function (LogType) {
|
|
8110
|
+
LogType["Mint"] = "MINT";
|
|
8111
|
+
LogType["Order"] = "ORDER";
|
|
8112
|
+
LogType["Transfer"] = "TRANSFER";
|
|
8113
|
+
})(LogType || (LogType = {}));
|
|
8114
|
+
var OrderDirectionEnum;
|
|
8115
|
+
(function (OrderDirectionEnum) {
|
|
8116
|
+
/** Sort ascending (A-Z) */
|
|
8117
|
+
OrderDirectionEnum["Asc"] = "ASC";
|
|
8118
|
+
/** Sort descending (Z-A) */
|
|
8119
|
+
OrderDirectionEnum["Desc"] = "DESC";
|
|
8120
|
+
})(OrderDirectionEnum || (OrderDirectionEnum = {}));
|
|
8121
|
+
var RefreshMetadataStatusMessage;
|
|
8122
|
+
(function (RefreshMetadataStatusMessage) {
|
|
8123
|
+
RefreshMetadataStatusMessage["Completed"] = "COMPLETED";
|
|
8124
|
+
RefreshMetadataStatusMessage["CompletedToken"] = "COMPLETED_TOKEN";
|
|
8125
|
+
RefreshMetadataStatusMessage["Error"] = "ERROR";
|
|
8126
|
+
RefreshMetadataStatusMessage["ErrorToken"] = "ERROR_TOKEN";
|
|
8127
|
+
RefreshMetadataStatusMessage["Queued"] = "QUEUED";
|
|
8128
|
+
RefreshMetadataStatusMessage["QueuedToken"] = "QUEUED_TOKEN";
|
|
8129
|
+
})(RefreshMetadataStatusMessage || (RefreshMetadataStatusMessage = {}));
|
|
8130
|
+
var TokenStandard;
|
|
8131
|
+
(function (TokenStandard) {
|
|
8132
|
+
TokenStandard["Erc721"] = "ERC721";
|
|
8133
|
+
TokenStandard["Erc1155"] = "ERC1155";
|
|
8134
|
+
})(TokenStandard || (TokenStandard = {}));
|
|
8135
|
+
var TrendingCollectionsOrderByEnum;
|
|
8136
|
+
(function (TrendingCollectionsOrderByEnum) {
|
|
8137
|
+
/** Sort contracts by average sale price within a given time range. Defaults to within last hour. */
|
|
8138
|
+
TrendingCollectionsOrderByEnum["Average"] = "AVERAGE";
|
|
8139
|
+
/** Sort contracts by number of sales. Defaults to within last hour. */
|
|
8140
|
+
TrendingCollectionsOrderByEnum["Sales"] = "SALES";
|
|
8141
|
+
/** Sort contracts by volume. Defaults to within last hour. */
|
|
8142
|
+
TrendingCollectionsOrderByEnum["Volume"] = "VOLUME";
|
|
8143
|
+
})(TrendingCollectionsOrderByEnum || (TrendingCollectionsOrderByEnum = {}));
|
|
8144
|
+
var TrendingCollectionsTimePeriodEnum;
|
|
8145
|
+
(function (TrendingCollectionsTimePeriodEnum) {
|
|
8146
|
+
/** Last 24 hours */
|
|
8147
|
+
TrendingCollectionsTimePeriodEnum["OneDay"] = "ONE_DAY";
|
|
8148
|
+
/** Last hour */
|
|
8149
|
+
TrendingCollectionsTimePeriodEnum["OneHour"] = "ONE_HOUR";
|
|
8150
|
+
/** Last 7 days */
|
|
8151
|
+
TrendingCollectionsTimePeriodEnum["SevenDays"] = "SEVEN_DAYS";
|
|
8152
|
+
/** Last 12 hours */
|
|
8153
|
+
TrendingCollectionsTimePeriodEnum["TwelveHours"] = "TWELVE_HOURS";
|
|
8154
|
+
})(TrendingCollectionsTimePeriodEnum || (TrendingCollectionsTimePeriodEnum = {}));
|
|
8155
|
+
const NftCollection = gql$1 `
|
|
8156
|
+
fragment NftCollection on Contract {
|
|
8157
|
+
... on ERC721Contract {
|
|
8158
|
+
address
|
|
8159
|
+
isVerified
|
|
8160
|
+
circulatingSupply
|
|
8161
|
+
name
|
|
8162
|
+
symbol
|
|
8163
|
+
stats {
|
|
8164
|
+
average
|
|
8165
|
+
ceiling
|
|
8166
|
+
floor
|
|
8167
|
+
totalSales
|
|
8168
|
+
volume
|
|
8169
|
+
}
|
|
8170
|
+
}
|
|
8171
|
+
}
|
|
8172
|
+
`;
|
|
8173
|
+
const Nft = gql$1 `
|
|
8174
|
+
fragment Nft on Token {
|
|
8175
|
+
... on ERC721Token {
|
|
8176
|
+
tokenId
|
|
8177
|
+
attributes {
|
|
8178
|
+
name
|
|
8179
|
+
value
|
|
8180
|
+
}
|
|
8181
|
+
contract {
|
|
8128
8182
|
address
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8183
|
+
isVerified
|
|
8184
|
+
tokenStandard
|
|
8185
|
+
... on ERC721Contract {
|
|
8186
|
+
name
|
|
8187
|
+
}
|
|
8188
|
+
}
|
|
8189
|
+
images {
|
|
8190
|
+
height
|
|
8191
|
+
mimeType
|
|
8192
|
+
url
|
|
8193
|
+
width
|
|
8194
|
+
}
|
|
8195
|
+
name
|
|
8196
|
+
symbol
|
|
8197
|
+
metadata {
|
|
8198
|
+
animation_url
|
|
8199
|
+
background_color
|
|
8200
|
+
description
|
|
8201
|
+
external_url
|
|
8202
|
+
image
|
|
8203
|
+
image_data
|
|
8204
|
+
name
|
|
8205
|
+
youtube_url
|
|
8206
|
+
}
|
|
8207
|
+
}
|
|
8208
|
+
}
|
|
8209
|
+
`;
|
|
8210
|
+
const ContractEventLog = gql$1 `
|
|
8211
|
+
fragment ContractEventLog on Log {
|
|
8212
|
+
blockNumber
|
|
8213
|
+
type
|
|
8214
|
+
fromAddress
|
|
8215
|
+
toAddress
|
|
8216
|
+
estimatedConfirmedAt
|
|
8217
|
+
transactionHash
|
|
8218
|
+
token {
|
|
8219
|
+
contract {
|
|
8220
|
+
address
|
|
8221
|
+
}
|
|
8222
|
+
... on ERC721Token {
|
|
8223
|
+
tokenId
|
|
8224
|
+
}
|
|
8225
|
+
}
|
|
8226
|
+
... on OrderLog {
|
|
8227
|
+
marketplace
|
|
8228
|
+
priceInEth
|
|
8229
|
+
}
|
|
8230
|
+
}
|
|
8231
|
+
`;
|
|
8232
|
+
const ContractEventsLogs = gql$1 `
|
|
8233
|
+
query ContractEventsLogs($address: String!, $filter: LogsFilterInputType, $first: Int, $after: String) {
|
|
8234
|
+
contract(address: $address) {
|
|
8235
|
+
address
|
|
8236
|
+
logs(filter: $filter, first: $first, after: $after) {
|
|
8237
|
+
pageInfo {
|
|
8238
|
+
hasNextPage
|
|
8239
|
+
endCursor
|
|
8240
|
+
}
|
|
8241
|
+
edges {
|
|
8242
|
+
node {
|
|
8243
|
+
...ContractEventLog
|
|
8133
8244
|
}
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
}
|
|
8248
|
+
}
|
|
8249
|
+
${ContractEventLog}`;
|
|
8250
|
+
const NftEventsLogs = gql$1 `
|
|
8251
|
+
query NFTEventsLogs($address: String!, $tokenId: String!, $filter: LogsFilterInputType, $first: Int, $after: String) {
|
|
8252
|
+
token(contractAddress: $address, tokenId: $tokenId) {
|
|
8253
|
+
... on ERC721Token {
|
|
8254
|
+
tokenId
|
|
8255
|
+
contract {
|
|
8256
|
+
address
|
|
8257
|
+
}
|
|
8258
|
+
logs(filter: $filter, first: $first, after: $after) {
|
|
8134
8259
|
edges {
|
|
8135
8260
|
node {
|
|
8136
8261
|
blockNumber
|
|
@@ -8139,53 +8264,74 @@ const getContractEventLogsRawQuery = gql `
|
|
|
8139
8264
|
toAddress
|
|
8140
8265
|
estimatedConfirmedAt
|
|
8141
8266
|
transactionHash
|
|
8142
|
-
token {
|
|
8143
|
-
contract {
|
|
8144
|
-
address
|
|
8145
|
-
}
|
|
8146
|
-
... on ERC721Token {
|
|
8147
|
-
tokenId
|
|
8148
|
-
}
|
|
8149
|
-
}
|
|
8150
8267
|
... on OrderLog {
|
|
8151
8268
|
marketplace
|
|
8152
8269
|
priceInEth
|
|
8153
8270
|
}
|
|
8154
8271
|
}
|
|
8155
8272
|
}
|
|
8156
|
-
}
|
|
8157
|
-
}
|
|
8158
|
-
}
|
|
8159
|
-
`;
|
|
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
8273
|
pageInfo {
|
|
8173
8274
|
hasNextPage
|
|
8174
8275
|
endCursor
|
|
8175
8276
|
}
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8277
|
+
}
|
|
8278
|
+
}
|
|
8279
|
+
}
|
|
8280
|
+
}
|
|
8281
|
+
`;
|
|
8282
|
+
const WalletNfTs = gql$1 `
|
|
8283
|
+
query WalletNFTs($address: String!, $first: Int, $after: String) {
|
|
8284
|
+
wallet(address: $address) {
|
|
8285
|
+
ensName
|
|
8286
|
+
address
|
|
8287
|
+
tokens(first: $first, after: $after) {
|
|
8288
|
+
pageInfo {
|
|
8289
|
+
hasNextPage
|
|
8290
|
+
endCursor
|
|
8291
|
+
}
|
|
8292
|
+
edges {
|
|
8293
|
+
node {
|
|
8294
|
+
tokenId
|
|
8295
|
+
images {
|
|
8296
|
+
url
|
|
8297
|
+
}
|
|
8298
|
+
... on ERC721Token {
|
|
8299
|
+
contract {
|
|
8300
|
+
address
|
|
8301
|
+
... on ERC721Contract {
|
|
8302
|
+
symbol
|
|
8303
|
+
name
|
|
8304
|
+
}
|
|
8181
8305
|
}
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8306
|
+
}
|
|
8307
|
+
}
|
|
8308
|
+
}
|
|
8309
|
+
}
|
|
8310
|
+
}
|
|
8311
|
+
}
|
|
8312
|
+
`;
|
|
8313
|
+
const NfTsWalletAndContract = gql$1 `
|
|
8314
|
+
query NFTsWalletAndContract($filter: TokensFilterInputType, $address: String, $first: Int, $after: String) {
|
|
8315
|
+
wallet(address: $address) {
|
|
8316
|
+
ensName
|
|
8317
|
+
address
|
|
8318
|
+
tokens(filter: $filter, first: $first, after: $after) {
|
|
8319
|
+
pageInfo {
|
|
8320
|
+
hasNextPage
|
|
8321
|
+
endCursor
|
|
8322
|
+
}
|
|
8323
|
+
edges {
|
|
8324
|
+
node {
|
|
8325
|
+
tokenId
|
|
8326
|
+
images {
|
|
8327
|
+
url
|
|
8328
|
+
}
|
|
8329
|
+
... on ERC721Token {
|
|
8330
|
+
contract {
|
|
8331
|
+
address
|
|
8332
|
+
... on ERC721Contract {
|
|
8333
|
+
symbol
|
|
8334
|
+
name
|
|
8189
8335
|
}
|
|
8190
8336
|
}
|
|
8191
8337
|
}
|
|
@@ -8193,24 +8339,53 @@ const getNFTsWalletAndContractsRawQuery = gql `
|
|
|
8193
8339
|
}
|
|
8194
8340
|
}
|
|
8195
8341
|
}
|
|
8196
|
-
|
|
8342
|
+
}
|
|
8343
|
+
`;
|
|
8344
|
+
const TrendingNftCollections = gql$1 `
|
|
8345
|
+
query TrendingNFTCollections($after: String, $first: Int, $orderBy: TrendingCollectionsOrderByEnum, $orderDirection: OrderDirectionEnum, $timePeriod: TrendingCollectionsTimePeriodEnum, $timeRange: DateInputType) {
|
|
8346
|
+
trendingCollections(
|
|
8347
|
+
after: $after
|
|
8348
|
+
first: $first
|
|
8349
|
+
orderBy: $orderBy
|
|
8350
|
+
orderDirection: $orderDirection
|
|
8351
|
+
timePeriod: $timePeriod
|
|
8352
|
+
timeRange: $timeRange
|
|
8353
|
+
) {
|
|
8354
|
+
edges {
|
|
8355
|
+
cursor
|
|
8356
|
+
node {
|
|
8357
|
+
...NftCollection
|
|
8358
|
+
}
|
|
8359
|
+
}
|
|
8360
|
+
pageInfo {
|
|
8361
|
+
endCursor
|
|
8362
|
+
hasNextPage
|
|
8363
|
+
}
|
|
8364
|
+
}
|
|
8365
|
+
}
|
|
8366
|
+
${NftCollection}`;
|
|
8197
8367
|
|
|
8198
|
-
const DEFAULT_LOG_FILTER_TYPES = [
|
|
8368
|
+
const DEFAULT_LOG_FILTER_TYPES = [
|
|
8369
|
+
LogType.Transfer,
|
|
8370
|
+
LogType.Order,
|
|
8371
|
+
LogType.Mint,
|
|
8372
|
+
];
|
|
8199
8373
|
class NFTQueries {
|
|
8200
8374
|
constructor(client) {
|
|
8201
8375
|
this.client = client;
|
|
8202
8376
|
}
|
|
8203
8377
|
getNFTsByWalletAddress(variables) {
|
|
8204
8378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8379
|
+
const { address } = variables, otherVariables = __rest(variables, ["address"]);
|
|
8380
|
+
return this.client.query({
|
|
8381
|
+
query: WalletNfTs,
|
|
8382
|
+
variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
|
|
8208
8383
|
});
|
|
8209
8384
|
});
|
|
8210
8385
|
}
|
|
8211
8386
|
getNFTsByWalletENS(variables) {
|
|
8212
8387
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8213
|
-
return
|
|
8388
|
+
return this.client.query({
|
|
8214
8389
|
query: getWalletENSNFTsRawQuery,
|
|
8215
8390
|
variables,
|
|
8216
8391
|
});
|
|
@@ -8218,26 +8393,28 @@ class NFTQueries {
|
|
|
8218
8393
|
}
|
|
8219
8394
|
getNFTsByContractAddress(variables) {
|
|
8220
8395
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8221
|
-
|
|
8396
|
+
const { address } = variables, otherVariables = __rest(variables, ["address"]);
|
|
8397
|
+
return this.client.query({
|
|
8222
8398
|
query: getContractAddressNFTsRawQuery,
|
|
8223
|
-
variables,
|
|
8399
|
+
variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
|
|
8224
8400
|
});
|
|
8225
8401
|
});
|
|
8226
8402
|
}
|
|
8227
8403
|
getCollectionDetails(variables) {
|
|
8228
8404
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8229
|
-
|
|
8405
|
+
const { address } = variables, otherVariables = __rest(variables, ["address"]);
|
|
8406
|
+
return this.client.query({
|
|
8230
8407
|
query: getCollectionDetailsRawQuery,
|
|
8231
|
-
variables,
|
|
8408
|
+
variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
|
|
8232
8409
|
});
|
|
8233
8410
|
});
|
|
8234
8411
|
}
|
|
8235
8412
|
getNFTEventLogs(variables) {
|
|
8236
8413
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8237
|
-
const { types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["types"]);
|
|
8238
|
-
return
|
|
8239
|
-
query:
|
|
8240
|
-
variables: Object.assign(Object.assign({}, otherVariables), { filter: {
|
|
8414
|
+
const { address, types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["address", "types"]);
|
|
8415
|
+
return this.client.query({
|
|
8416
|
+
query: NftEventsLogs,
|
|
8417
|
+
variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: {
|
|
8241
8418
|
typeIn: types,
|
|
8242
8419
|
} }),
|
|
8243
8420
|
});
|
|
@@ -8245,18 +8422,19 @@ class NFTQueries {
|
|
|
8245
8422
|
}
|
|
8246
8423
|
getNFTDetails(variables) {
|
|
8247
8424
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8248
|
-
|
|
8425
|
+
const { contractAddress } = variables, otherVariables = __rest(variables, ["contractAddress"]);
|
|
8426
|
+
return this.client.query({
|
|
8249
8427
|
query: getNFTDetailsRawQuery,
|
|
8250
|
-
variables,
|
|
8428
|
+
variables: Object.assign({ contractAddress: contractAddress.toLowerCase() }, otherVariables),
|
|
8251
8429
|
});
|
|
8252
8430
|
});
|
|
8253
8431
|
}
|
|
8254
8432
|
getContractEventLogs(variables) {
|
|
8255
8433
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8256
|
-
const { types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["types"]);
|
|
8257
|
-
return
|
|
8258
|
-
query:
|
|
8259
|
-
variables: Object.assign(Object.assign({}, otherVariables), { filter: {
|
|
8434
|
+
const { address, types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["address", "types"]);
|
|
8435
|
+
return this.client.query({
|
|
8436
|
+
query: ContractEventsLogs,
|
|
8437
|
+
variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: {
|
|
8260
8438
|
typeIn: types,
|
|
8261
8439
|
} }),
|
|
8262
8440
|
});
|
|
@@ -8264,37 +8442,51 @@ class NFTQueries {
|
|
|
8264
8442
|
}
|
|
8265
8443
|
getNFTsByWalletAndContracts(variables) {
|
|
8266
8444
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8267
|
-
const { contracts } = variables, otherVariables = __rest(variables, ["contracts"]);
|
|
8268
|
-
const
|
|
8269
|
-
|
|
8270
|
-
|
|
8445
|
+
const { address, contracts } = variables, otherVariables = __rest(variables, ["address", "contracts"]);
|
|
8446
|
+
const normalizedContracts = contracts.map((contract) => contract.toLowerCase());
|
|
8447
|
+
return this.client.query({
|
|
8448
|
+
query: NfTsWalletAndContract,
|
|
8449
|
+
variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: { contractAddressIn: normalizedContracts } }),
|
|
8450
|
+
});
|
|
8451
|
+
});
|
|
8452
|
+
}
|
|
8453
|
+
getTrendingNFTCollections(variables) {
|
|
8454
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8455
|
+
return this.client.query({
|
|
8456
|
+
query: TrendingNftCollections,
|
|
8457
|
+
variables,
|
|
8271
8458
|
});
|
|
8272
|
-
return response;
|
|
8273
8459
|
});
|
|
8274
8460
|
}
|
|
8275
8461
|
}
|
|
8276
8462
|
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8463
|
+
function isConnection(object) {
|
|
8464
|
+
return (typeof object === 'object' &&
|
|
8465
|
+
!!object &&
|
|
8466
|
+
('edges' in object ||
|
|
8467
|
+
'total' in object ||
|
|
8468
|
+
'pageInfo' in object ||
|
|
8469
|
+
'breadcrumbs' in object));
|
|
8470
|
+
}
|
|
8471
|
+
function removeNodesAndEdges(data) {
|
|
8281
8472
|
const keys = Object.keys(data);
|
|
8282
8473
|
const output = {};
|
|
8283
8474
|
keys
|
|
8284
8475
|
.filter((key) => key !== '__typename')
|
|
8285
8476
|
.forEach((key) => {
|
|
8477
|
+
var _a;
|
|
8286
8478
|
const value = data[key];
|
|
8287
8479
|
if (typeof value === 'string' ||
|
|
8288
8480
|
typeof value === 'boolean' ||
|
|
8289
8481
|
typeof value === 'number' ||
|
|
8290
|
-
value === null
|
|
8482
|
+
value === null ||
|
|
8483
|
+
value === undefined) {
|
|
8291
8484
|
return (output[key] = value);
|
|
8292
8485
|
}
|
|
8293
8486
|
if (Array.isArray(value)) {
|
|
8294
8487
|
return (output[key] = value.map((item) => removeNodesAndEdges(item)));
|
|
8295
8488
|
}
|
|
8296
|
-
if (value
|
|
8297
|
-
(value.edges || value.total || value.pageInfo || value.breadcrumbs)) {
|
|
8489
|
+
if (isConnection(value)) {
|
|
8298
8490
|
if (value.breadcrumbs)
|
|
8299
8491
|
output[`${key}Breadcrumbs`] = value.breadcrumbs;
|
|
8300
8492
|
if (value.total)
|
|
@@ -8302,41 +8494,53 @@ const removeNodesAndEdges = (data) => {
|
|
|
8302
8494
|
if (value.viewport)
|
|
8303
8495
|
output[`${key}Viewport`] = value.viewport;
|
|
8304
8496
|
if (value.pageInfo) {
|
|
8305
|
-
const
|
|
8497
|
+
const _b = value.pageInfo, pageInfoRest = __rest(_b, ["__typename"]);
|
|
8306
8498
|
output[`${key}PageInfo`] = pageInfoRest;
|
|
8307
8499
|
}
|
|
8308
|
-
output[key] = value.edges.map((item) => {
|
|
8500
|
+
return (output[key] = (_a = value.edges) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
8309
8501
|
if (item.node) {
|
|
8310
8502
|
return removeNodesAndEdges(item.node);
|
|
8311
8503
|
}
|
|
8312
8504
|
return item;
|
|
8313
|
-
});
|
|
8314
|
-
}
|
|
8315
|
-
else {
|
|
8316
|
-
output[key] = value === null ? null : removeNodesAndEdges(value);
|
|
8505
|
+
}));
|
|
8317
8506
|
}
|
|
8507
|
+
return (output[key] = removeNodesAndEdges(value));
|
|
8318
8508
|
});
|
|
8319
8509
|
return output;
|
|
8320
|
-
}
|
|
8510
|
+
}
|
|
8321
8511
|
|
|
8322
8512
|
class CustomApolloClient {
|
|
8323
8513
|
constructor(apolloClient) {
|
|
8324
8514
|
this.apolloClient = apolloClient;
|
|
8325
8515
|
}
|
|
8326
|
-
/**
|
|
8327
|
-
* @todo improve typing here
|
|
8328
|
-
*/
|
|
8329
8516
|
query(options) {
|
|
8330
8517
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8331
8518
|
const result = yield this.apolloClient.query(options);
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
}
|
|
8335
|
-
return result;
|
|
8519
|
+
return Object.assign(Object.assign({}, result), { data: (result === null || result === void 0 ? void 0 : result.data) &&
|
|
8520
|
+
removeNodesAndEdges(result.data) });
|
|
8336
8521
|
});
|
|
8337
8522
|
}
|
|
8338
8523
|
}
|
|
8339
8524
|
|
|
8525
|
+
const result = {
|
|
8526
|
+
"possibleTypes": {
|
|
8527
|
+
"Contract": [
|
|
8528
|
+
"BaseContract",
|
|
8529
|
+
"ERC721Contract"
|
|
8530
|
+
],
|
|
8531
|
+
"Log": [
|
|
8532
|
+
"BaseLog",
|
|
8533
|
+
"MintLog",
|
|
8534
|
+
"OrderLog",
|
|
8535
|
+
"TransferLog"
|
|
8536
|
+
],
|
|
8537
|
+
"Token": [
|
|
8538
|
+
"BaseToken",
|
|
8539
|
+
"ERC721Token"
|
|
8540
|
+
]
|
|
8541
|
+
}
|
|
8542
|
+
};
|
|
8543
|
+
|
|
8340
8544
|
const QUICKNODE_GRAPHQL_CLIENT_SUPPRESS_WARNINGS =
|
|
8341
8545
|
/**
|
|
8342
8546
|
* @todo set unified config util
|
|
@@ -8377,6 +8581,7 @@ class QuickNodeSDK {
|
|
|
8377
8581
|
};
|
|
8378
8582
|
}));
|
|
8379
8583
|
const cacheStructure = new InMemoryCache({
|
|
8584
|
+
possibleTypes: result.possibleTypes,
|
|
8380
8585
|
typePolicies: {
|
|
8381
8586
|
ERC721Token: {
|
|
8382
8587
|
keyFields: ['tokenId', 'contract', ['address']],
|
|
@@ -8397,4 +8602,4 @@ class QuickNodeSDK {
|
|
|
8397
8602
|
}
|
|
8398
8603
|
}
|
|
8399
8604
|
|
|
8400
|
-
export { QuickNodeSDK, QuickNodeSDK as default, getContractAddressNFTsRawQuery,
|
|
8605
|
+
export { ContractEventLog, ContractEventsLogs, ContractsOrderByEnum, HeldCollectionsOrderByEnum, HeldTokensOrderByEnum, LogOrderMarketplace, LogType, NfTsWalletAndContract, Nft, NftCollection, NftEventsLogs, OrderDirectionEnum, QuickNodeSDK, RefreshMetadataStatusMessage, TokenStandard, TrendingCollectionsOrderByEnum, TrendingCollectionsTimePeriodEnum, TrendingNftCollections, WalletNfTs, QuickNodeSDK as default, getContractAddressNFTsRawQuery, getWalletENSNFTsRawQuery };
|