Socket
Socket
Sign inDemoInstall

@zoralabs/zdk-alpha

Package Overview
Dependencies
Maintainers
21
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zoralabs/zdk-alpha - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

37

dist/index.d.ts

@@ -1,2 +0,2 @@

import { getSdk, Chain, Network, NetworkInput, TokenInput, TokensQueryInput, TokensQueryFilter, CollectionsQueryInput, CollectionSortKeySortInput, TokenSortInput, AggregateAttributesQueryVariables, OwnersByCountQueryVariables, SalesVolumeQueryVariables, EventsQueryInput, EventsQueryFilter, EventSortKeySortInput, MarketSortKeySortInput, MarketsQueryFilter, MarketsQueryInput, MintsQueryFilter, MintsQueryInput, MintSortKeySortInput, FloorPriceQueryVariables, NftCountQueryVariables, FullTextSearchQueryVariables, TokenQueryVariables, SalesQueryInput, SaleSortKeySortInput, SalesQueryFilter } from './queries/queries-sdk';
import { getSdk, Chain, Network, NetworkInput, TokenInput, TokensQueryInput, TokensQueryFilter, CollectionsQueryInput, CollectionSortKeySortInput, TokenSortInput, AggregateAttributesQueryVariables, OwnersByCountQueryVariables, SalesVolumeQueryVariables, EventsQueryInput, EventsQueryFilter, EventSortKeySortInput, MarketSortKeySortInput, MarketsQueryFilter, MarketsQueryInput, MintsQueryFilter, MintsQueryInput, MintSortKeySortInput, FloorPriceQueryVariables, NftCountQueryVariables, FullTextSearchQueryVariables, TokenQueryVariables, SalesQueryInput, SaleSortKeySortInput, SalesQueryFilter, OwnerCountQueryVariables } from './queries/queries-sdk';
export { Chain as ZDKChain, Network as ZDKNetwork };

@@ -47,2 +47,11 @@ export declare type OverrideNetworksOption = NetworkInput[];

} & SharedQueryParams;
declare type CollectionStatsAggregateQuery = {
collectionAddress: string;
network: NetworkInput;
};
export declare type CollectionQueryArgs = {
address: string;
network?: NetworkInput;
includeFullDetails?: boolean;
};
export interface ListOptions<SortInput> {

@@ -76,6 +85,30 @@ networks?: OverrideNetworksOption;

collections: ({ where, pagination, networks, sort, includeFullDetails, }: CollectionsQueryArgs) => Promise<import("./queries/queries-sdk").CollectionsQuery>;
collectionStatsAggregate: ({ collectionAddress, network, }: CollectionStatsAggregateQuery) => Promise<import("./queries/queries-sdk").CollectionStatsAggregateQuery>;
collection: ({ address, network, includeFullDetails, }: CollectionQueryArgs) => Promise<{
__typename?: "Collection" | undefined;
address: string;
description: string;
name?: string | null | undefined;
symbol?: string | null | undefined;
totalSupply?: number | null | undefined;
networkInfo: {
__typename?: "NetworkInfo" | undefined;
chain: Chain;
network: Network;
};
attributes?: {
__typename?: "CollectionAttribute" | undefined;
traitType?: string | null | undefined;
valueMetrics: {
__typename?: "CollectionAttributeValue" | undefined;
count: number;
percent: number;
value: string;
}[];
}[] | null | undefined;
}>;
ownersByCount: ({ where, pagination, networks, }: OptionalNetwork<OwnersByCountQueryVariables>) => Promise<import("./queries/queries-sdk").OwnersByCountQuery>;
aggregateAttributes: ({ where, networks, }: OptionalNetwork<AggregateAttributesQueryVariables>) => Promise<import("./queries/queries-sdk").AggregateAttributesQuery>;
salesVolume: ({ where, networks, timeFilter, }: OptionalNetwork<SalesVolumeQueryVariables>) => Promise<import("./queries/queries-sdk").SalesVolumeQuery>;
ownerCount: ({ where, networks, }: OptionalNetwork<OwnersByCountQueryVariables>) => Promise<import("./queries/queries-sdk").OwnerCountQuery>;
ownerCount: ({ where, networks, }: OptionalNetwork<OwnerCountQueryVariables>) => Promise<import("./queries/queries-sdk").OwnerCountQuery>;
floorPrice: ({ where, networks, }: OptionalNetwork<FloorPriceQueryVariables>) => Promise<import("./queries/queries-sdk").FloorPriceQuery>;

@@ -82,0 +115,0 @@ nftCount: ({ where, networks, }: OptionalNetwork<NftCountQueryVariables>) => Promise<import("./queries/queries-sdk").NftCountQuery>;

@@ -98,2 +98,31 @@ "use strict";

});
this.collectionStatsAggregate = async ({ collectionAddress, network, }) => this.sdk.collectionStatsAggregate({
collectionAddress,
...this.getNetworksOption(network ? [network] : undefined),
});
this.collection = async ({ address, network, includeFullDetails = true, }) => {
const collectionsResponse = await this.sdk.collections({
where: {
collectionAddresses: [address],
},
pagination: {
limit: 2,
offset: 0,
},
sort: {
sortKey: queries_sdk_1.CollectionSortKey.Created,
sortDirection: queries_sdk_1.SortDirection.Asc,
},
includeFullDetails,
...this.getNetworksOption(network ? [network] : undefined),
});
const items = collectionsResponse.collections.nodes;
if (items.length === 0) {
throw new Error('No collections found');
}
if (items.length === 2) {
throw new Error('Invariant: multiple collections found, expecting 1');
}
return items[0];
};
this.ownersByCount = async ({ where, pagination, networks = this.defaultNetworks, }) => this.sdk.ownersByCount({

@@ -100,0 +129,0 @@ where,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalesDocument = exports.CollectionsDocument = exports.MintsDocument = exports.MarketsDocument = exports.EventsDocument = exports.OwnerCountInfoFragmentDoc = exports.PageInfoDefaultFragmentDoc = exports.CollectionDetailsFragmentDoc = exports.CollectionInfoFragmentDoc = exports.TokenDetailsFragmentDoc = exports.EventInfoFragmentDoc = exports.V3AskEventPropertiesInfoFragmentDoc = exports.V2AuctionEventPropertiesInfoFragmentDoc = exports.V1MarketEventPropertiesInfoFragmentDoc = exports.TokenInfoFragmentDoc = exports.FullMediaFragmentDoc = exports.MintDetailsFragmentDoc = exports.TokenContractInfoFragmentDoc = exports.MarketDetailsFragmentDoc = exports.MarketPropertiesFullFragmentDoc = exports.V1AskPropertiesFragmentDoc = exports.V1OfferPropertiesFragmentDoc = exports.V3AskPropertiesFragmentDoc = exports.V2AuctionMarketPropertiesFragmentDoc = exports.MarketInfoFragmentDoc = exports.SaleInfoFragmentDoc = exports.PriceSummaryFragmentDoc = exports.TransactionDetailsFragmentDoc = exports.V3AskStatus = exports.V3AskEventType = exports.V2AuctionStatus = exports.V2AuctionEventType = exports.V1MarketEventType = exports.V1MarketEntityStatus = exports.TokenSortKey = exports.SortDirection = exports.SearchableEntity = exports.SaleType = exports.SaleSortKey = exports.Network = exports.MintSortKey = exports.MediaType = exports.MarketType = exports.MarketStatus = exports.MarketSortKey = exports.MarketCategory = exports.EventType = exports.EventSortKey = exports.CollectionSortKey = exports.Chain = void 0;
exports.getSdk = exports.FullTextSearchDocument = exports.FloorPriceDocument = exports.NftCountDocument = exports.OwnerCountDocument = exports.SalesVolumeDocument = exports.OwnersByCountDocument = exports.AggregateAttributesDocument = exports.TokenDocument = exports.TokensDocument = void 0;
exports.MintsDocument = exports.MarketsDocument = exports.EventsDocument = exports.OwnerCountInfoFragmentDoc = exports.PageInfoDefaultFragmentDoc = exports.CollectionDetailsFragmentDoc = exports.CollectionInfoSearchResultFragmentDoc = exports.CollectionInfoFragmentDoc = exports.TokenDetailsFragmentDoc = exports.EventInfoFragmentDoc = exports.V3AskEventPropertiesInfoFragmentDoc = exports.V2AuctionEventPropertiesInfoFragmentDoc = exports.V1MarketEventPropertiesInfoFragmentDoc = exports.TokenInfoFragmentDoc = exports.FullMediaFragmentDoc = exports.MintDetailsFragmentDoc = exports.TokenContractInfoFragmentDoc = exports.MarketDetailsFragmentDoc = exports.MarketPropertiesFullFragmentDoc = exports.V1AskPropertiesFragmentDoc = exports.V1OfferPropertiesFragmentDoc = exports.V3AskPropertiesFragmentDoc = exports.V2AuctionMarketPropertiesFragmentDoc = exports.MarketInfoFragmentDoc = exports.NetworkInfoDetailsFragmentDoc = exports.SaleInfoFragmentDoc = exports.PriceSummaryFragmentDoc = exports.TransactionDetailsFragmentDoc = exports.V3AskStatus = exports.V3AskEventType = exports.V2AuctionStatus = exports.V2AuctionEventType = exports.V1MarketEventType = exports.V1MarketEntityStatus = exports.TokenSortKey = exports.SortDirection = exports.SearchableEntity = exports.SaleType = exports.SaleSortKey = exports.Network = exports.MintSortKey = exports.MediaType = exports.MarketType = exports.MarketStatus = exports.MarketSortKey = exports.MarketCategory = exports.EventType = exports.EventSortKey = exports.CollectionSortKey = exports.Chain = void 0;
exports.getSdk = exports.FullTextSearchDocument = exports.CollectionStatsAggregateDocument = exports.FloorPriceDocument = exports.NftCountDocument = exports.OwnerCountDocument = exports.SalesVolumeDocument = exports.OwnersByCountDocument = exports.AggregateAttributesDocument = exports.TokenDocument = exports.TokensDocument = exports.SalesDocument = exports.CollectionsDocument = void 0;
const tslib_1 = require("tslib");

@@ -207,2 +207,8 @@ const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));

${exports.PriceSummaryFragmentDoc}`;
exports.NetworkInfoDetailsFragmentDoc = (0, graphql_tag_1.default) `
fragment NetworkInfoDetails on NetworkInfo {
chain
network
}
`;
exports.MarketInfoFragmentDoc = (0, graphql_tag_1.default) `

@@ -221,8 +227,8 @@ fragment MarketInfo on Market {

networkInfo {
chain
network
...NetworkInfoDetails
}
}
${exports.TransactionDetailsFragmentDoc}
${exports.PriceSummaryFragmentDoc}`;
${exports.PriceSummaryFragmentDoc}
${exports.NetworkInfoDetailsFragmentDoc}`;
exports.V2AuctionMarketPropertiesFragmentDoc = (0, graphql_tag_1.default) `

@@ -620,6 +626,21 @@ fragment V2AuctionMarketProperties on V2Auction {

totalSupply
networkInfo {
...NetworkInfoDetails
}
}
${exports.NetworkInfoDetailsFragmentDoc}`;
exports.CollectionInfoSearchResultFragmentDoc = (0, graphql_tag_1.default) `
fragment CollectionInfoSearchResult on Collection {
address
collectionDescription: description
name
symbol
totalSupply
}
`;
exports.CollectionDetailsFragmentDoc = (0, graphql_tag_1.default) `
fragment CollectionDetails on Collection {
networkInfo {
...NetworkInfoDetails
}
attributes {

@@ -634,3 +655,3 @@ traitType

}
`;
${exports.NetworkInfoDetailsFragmentDoc}`;
exports.PageInfoDefaultFragmentDoc = (0, graphql_tag_1.default) `

@@ -926,2 +947,28 @@ fragment PageInfoDefault on PageInfo {

`;
exports.CollectionStatsAggregateDocument = (0, graphql_tag_1.default) `
query collectionStatsAggregate($collectionAddress: String!, $networks: [NetworkInput!]!) {
aggregateStat {
floorPrice(
where: {collectionAddresses: [$collectionAddress]}
networks: $networks
)
ownerCount(
where: {collectionAddresses: [$collectionAddress]}
networks: $networks
)
nftCount(
where: {collectionAddresses: [$collectionAddress]}
networks: $networks
)
salesVolume(
where: {collectionAddresses: [$collectionAddress]}
networks: $networks
) {
ethPrice
usdcPrice
totalCount
}
}
}
`;
exports.FullTextSearchDocument = (0, graphql_tag_1.default) `

@@ -937,11 +984,25 @@ query fullTextSearch($pagination: SearchPaginationInput!, $query: SearchQueryInput!, $filter: SearchFilter) {

nodes {
address
name
description
entityType
name
collectionAddress
networkInfo {
chain
network
}
tokenId
entity {
__typename
... on Token {
...TokenInfo
}
... on Collection {
...CollectionInfoSearchResult
}
}
}
}
}
`;
${exports.TokenInfoFragmentDoc}
${exports.CollectionInfoSearchResultFragmentDoc}`;
const defaultWrapper = (action, _operationName) => action();

@@ -989,2 +1050,5 @@ function getSdk(client, withWrapper = defaultWrapper) {

},
collectionStatsAggregate(variables, requestHeaders) {
return withWrapper((wrappedRequestHeaders) => client.request(exports.CollectionStatsAggregateDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), 'collectionStatsAggregate');
},
fullTextSearch(variables, requestHeaders) {

@@ -991,0 +1055,0 @@ return withWrapper((wrappedRequestHeaders) => client.request(exports.FullTextSearchDocument, variables, { ...requestHeaders, ...wrappedRequestHeaders }), 'fullTextSearch');

4

package.json
{
"name": "@zoralabs/zdk-alpha",
"version": "0.0.35",
"version": "0.0.36",
"description": "ZDK alpha for fetching data from graphql api",

@@ -72,2 +72,2 @@ "repository": "https://github.com/ourzora/zdk-alpha",

}
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc