Socket
Socket
Sign inDemoInstall

@zoralabs/nft-components

Package Overview
Dependencies
Maintainers
10
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zoralabs/nft-components - npm Package Compare versions

Comparing version 0.0.4-pre to 0.0.5-pre

17

dist/components/getAuctionState.d.ts
import { NFTDataType } from "@zoralabs/nft-hooks";
declare enum AuctionStateInfo {
SALE_LOADING = 0,
SALE_NONE = 1,
SALE_PERPETUAL = 2,
SALE_PERPETUAL_RESERVE = 3,
SALE_RESERVE_AUCTION_ACTIVE = 4,
SALE_RESERVE_LAST_15 = 5,
SALE_RESERVE_AUCTION_FINISHED = 6,
SALE_RESERVE_AUCTION_PENDING = 7
LOADING = "LOADING",
NO_PRICING = "NO_PRICING",
PERPETUAL_BID = "PERPETUAL_BID",
PERPETUAL_ASK = "PERPETUAL_ASK",
RESERVE_AUCTION_PENDING = "RESERVE_AUCTION_PENDING",
RESERVE_AUCTION_ACTIVE = "RESERVE_AUCTION_ACTIVE",
RESERVE_AUCTION_LAST_15 = "RESERVE_AUCTION_LAST_15",
RESERVE_AUCTION_ENDED = "RESERVE_AUCTION_ENDED",
RESERVE_AUCTION_FINISHED = "RESERVE_AUCTION_FINISHED"
}
export declare function getAuctionState(data?: NFTDataType): AuctionStateInfo;
export {};

@@ -6,10 +6,11 @@ "use strict";

(function (AuctionStateInfo) {
AuctionStateInfo[AuctionStateInfo["SALE_LOADING"] = 0] = "SALE_LOADING";
AuctionStateInfo[AuctionStateInfo["SALE_NONE"] = 1] = "SALE_NONE";
AuctionStateInfo[AuctionStateInfo["SALE_PERPETUAL"] = 2] = "SALE_PERPETUAL";
AuctionStateInfo[AuctionStateInfo["SALE_PERPETUAL_RESERVE"] = 3] = "SALE_PERPETUAL_RESERVE";
AuctionStateInfo[AuctionStateInfo["SALE_RESERVE_AUCTION_ACTIVE"] = 4] = "SALE_RESERVE_AUCTION_ACTIVE";
AuctionStateInfo[AuctionStateInfo["SALE_RESERVE_LAST_15"] = 5] = "SALE_RESERVE_LAST_15";
AuctionStateInfo[AuctionStateInfo["SALE_RESERVE_AUCTION_FINISHED"] = 6] = "SALE_RESERVE_AUCTION_FINISHED";
AuctionStateInfo[AuctionStateInfo["SALE_RESERVE_AUCTION_PENDING"] = 7] = "SALE_RESERVE_AUCTION_PENDING";
AuctionStateInfo["LOADING"] = "LOADING";
AuctionStateInfo["NO_PRICING"] = "NO_PRICING";
AuctionStateInfo["PERPETUAL_BID"] = "PERPETUAL_BID";
AuctionStateInfo["PERPETUAL_ASK"] = "PERPETUAL_ASK";
AuctionStateInfo["RESERVE_AUCTION_PENDING"] = "RESERVE_AUCTION_PENDING";
AuctionStateInfo["RESERVE_AUCTION_ACTIVE"] = "RESERVE_AUCTION_ACTIVE";
AuctionStateInfo["RESERVE_AUCTION_LAST_15"] = "RESERVE_AUCTION_LAST_15";
AuctionStateInfo["RESERVE_AUCTION_ENDED"] = "RESERVE_AUCTION_ENDED";
AuctionStateInfo["RESERVE_AUCTION_FINISHED"] = "RESERVE_AUCTION_FINISHED";
})(AuctionStateInfo || (AuctionStateInfo = {}));

@@ -19,24 +20,30 @@ function getAuctionState(data) {

if (!data) {
return AuctionStateInfo.SALE_LOADING;
return AuctionStateInfo.LOADING;
}
if (data.auction.current.auctionType === "perpetual") {
if (data.auction.current.reservePrice) {
return AuctionStateInfo.SALE_PERPETUAL_RESERVE;
return AuctionStateInfo.PERPETUAL_ASK;
}
if (!data.auction.highestBid && ((_a = data.pricing.reserve) === null || _a === void 0 ? void 0 : _a.previousBids.length)) {
return AuctionStateInfo.SALE_RESERVE_AUCTION_FINISHED;
return AuctionStateInfo.RESERVE_AUCTION_FINISHED;
}
return AuctionStateInfo.SALE_PERPETUAL;
if (data.auction.highestBid) {
return AuctionStateInfo.PERPETUAL_BID;
}
return AuctionStateInfo.NO_PRICING;
}
if (data.auction.current.auctionType === "reserve") {
if (data.auction.current.likelyHasEnded) {
return AuctionStateInfo.SALE_RESERVE_AUCTION_FINISHED;
return AuctionStateInfo.RESERVE_AUCTION_FINISHED;
}
if (data.auction.current.reserveMet) {
return AuctionStateInfo.SALE_RESERVE_AUCTION_ACTIVE;
if (data.auction.current.endingAt && Math.floor(new Date().getTime() / 1000) - 15 * 60 > parseInt(data.auction.current.endingAt, 10)) {
return AuctionStateInfo.RESERVE_AUCTION_LAST_15;
}
return AuctionStateInfo.RESERVE_AUCTION_ACTIVE;
}
return AuctionStateInfo.SALE_RESERVE_AUCTION_PENDING;
return AuctionStateInfo.RESERVE_AUCTION_PENDING;
}
return AuctionStateInfo.SALE_NONE;
return AuctionStateInfo.NO_PRICING;
}
exports.getAuctionState = getAuctionState;
/// <reference types="react" />
export declare type NFTPageWrapperProps = {
id: string;
children: React.ReactNode;
};
export declare const NFTPageWrapper: ({ id, children }: NFTPageWrapperProps) => JSX.Element;
import { NFTDataProviderProps } from "../context/NFTDataProvider";
export declare type NFTPageWrapperProps = NFTDataProviderProps;
export declare const NFTPageWrapper: ({ id, initialData, children, }: NFTDataProviderProps) => JSX.Element;

@@ -6,5 +6,5 @@ "use strict";

const NFTDataProvider_1 = require("../context/NFTDataProvider");
const NFTPageWrapper = ({ id, children }) => {
return jsx_runtime_1.jsx(NFTDataProvider_1.NFTDataProvider, Object.assign({ id: id }, { children: children }), void 0);
const NFTPageWrapper = ({ id, initialData, children, }) => {
return (jsx_runtime_1.jsx(NFTDataProvider_1.NFTDataProvider, Object.assign({ id: id, initialData: initialData }, { children: children }), void 0));
};
exports.NFTPageWrapper = NFTPageWrapper;

@@ -17,11 +17,11 @@ "use strict";

bodyFont: `
font-family: Inter;
font-family: Inter, Helvetica;
font-weight: 400;
`,
titleFont: `
font-family: Inter;
font-family: Inter, Helvetica;
font-weight: 500;
`,
headerFont: `
font-family: Inter;
font-family: Inter, Helvetica;
font-weight: 500;

@@ -28,0 +28,0 @@ `,

import React from "react";
import { useNFTType, useNFTMetadataType } from "@zoralabs/nft-hooks";
declare type NFTDataProviderProps = {
export declare type NFTDataProviderProps = {
id: string;

@@ -5,0 +5,0 @@ children: React.ReactNode;

@@ -6,2 +6,3 @@ import { Networks } from '@zoralabs/nft-hooks';

import { MediaConfiguration } from './context/MediaContext';
export { Networks, MediaConfiguration, AuctionHouseList, NFTPreview, PreviewComponents, NFTFullPage, FullComponents, };
import { NFTPageWrapper } from './components/NFTPageWrapper';
export { Networks, MediaConfiguration, AuctionHouseList, NFTPreview, PreviewComponents, NFTFullPage, FullComponents, NFTPageWrapper, };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullComponents = exports.NFTFullPage = exports.PreviewComponents = exports.NFTPreview = exports.AuctionHouseList = exports.MediaConfiguration = exports.Networks = void 0;
exports.NFTPageWrapper = exports.FullComponents = exports.NFTFullPage = exports.PreviewComponents = exports.NFTPreview = exports.AuctionHouseList = exports.MediaConfiguration = exports.Networks = void 0;
const nft_hooks_1 = require("@zoralabs/nft-hooks");

@@ -16,1 +16,3 @@ Object.defineProperty(exports, "Networks", { enumerable: true, get: function () { return nft_hooks_1.Networks; } });

Object.defineProperty(exports, "MediaConfiguration", { enumerable: true, get: function () { return MediaContext_1.MediaConfiguration; } });
const NFTPageWrapper_1 = require("./components/NFTPageWrapper");
Object.defineProperty(exports, "NFTPageWrapper", { enumerable: true, get: function () { return NFTPageWrapper_1.NFTPageWrapper; } });
{
"name": "@zoralabs/nft-components",
"version": "0.0.4-pre",
"version": "0.0.5-pre",
"description": "NFT Media Rendering Components",

@@ -18,3 +18,3 @@ "typings": "dist/index.d.ts",

"@types/react": "^17.0.5",
"@zoralabs/nft-hooks": "^0.1.7",
"@zoralabs/nft-hooks": "^0.1.8",
"merge-anything": "^4.0.1",

@@ -21,0 +21,0 @@ "react": "^17.0.2",

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