Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nft-react

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nft-react - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

6

dist/cjs/components/Asset.d.ts
import React from 'react';
declare type RenderCompleteHandlerProps = {
duration: number;
};
declare type RenderCompleteHandler = (props: RenderCompleteHandlerProps) => Promise<any> | any | void;
/**

@@ -17,2 +21,4 @@ *

network: Network;
onRenderComplete?: RenderCompleteHandler;
}>;
export {};

16

dist/cjs/components/Asset.js

@@ -23,3 +23,3 @@ "use strict";

var Asset = function (_a) {
var address = _a.address, tokenId = _a.tokenId, _b = _a.preset, preset = _b === void 0 ? 'medium' : _b, _c = _a.network, network = _c === void 0 ? CenterProvider_1.DEFAULT_NETWORK : _c;
var address = _a.address, tokenId = _a.tokenId, _b = _a.preset, preset = _b === void 0 ? 'medium' : _b, _c = _a.network, network = _c === void 0 ? CenterProvider_1.DEFAULT_NETWORK : _c, onRenderComplete = _a.onRenderComplete;
if (Number.isInteger(tokenId)) {

@@ -36,2 +36,3 @@ tokenId = tokenId.toString();

react_1.default.useEffect(function () {
var startedAt = performance.now();
client

@@ -45,2 +46,3 @@ .renderAssetPreset({

.then(function (resp) {
var completedAt = performance.now();
var contentType = resp.data.contentType;

@@ -63,2 +65,7 @@ if (contentType) {

setMediaUrl(resp.data.mediaUrl);
if (onRenderComplete && typeof onRenderComplete === 'function') {
onRenderComplete({
duration: completedAt - startedAt,
});
}
})

@@ -71,4 +78,7 @@ .catch(function (err) {

if (mediaUrl === undefined) {
return react_1.default.createElement("div", null);
return react_1.default.createElement("div", null, "no media url");
}
else {
console.info(mediaUrl);
}
if (mediaType === 'image') {

@@ -88,4 +98,4 @@ return react_1.default.createElement("img", { src: mediaUrl });

}, [mediaUrl, mediaType, mimeType, address, tokenId]);
return react_1.default.createElement("div", null, mediaElement);
return mediaElement;
};
exports.Asset = Asset;
import React from 'react';
declare type RenderCompleteHandlerProps = {
duration: number;
};
declare type RenderCompleteHandler = (props: RenderCompleteHandlerProps) => Promise<any> | any | void;
/**

@@ -17,2 +21,4 @@ *

network: Network;
onRenderComplete?: RenderCompleteHandler;
}>;
export {};

@@ -17,3 +17,3 @@ import React from 'react';

export var Asset = function (_a) {
var address = _a.address, tokenId = _a.tokenId, _b = _a.preset, preset = _b === void 0 ? 'medium' : _b, _c = _a.network, network = _c === void 0 ? DEFAULT_NETWORK : _c;
var address = _a.address, tokenId = _a.tokenId, _b = _a.preset, preset = _b === void 0 ? 'medium' : _b, _c = _a.network, network = _c === void 0 ? DEFAULT_NETWORK : _c, onRenderComplete = _a.onRenderComplete;
if (Number.isInteger(tokenId)) {

@@ -30,2 +30,3 @@ tokenId = tokenId.toString();

React.useEffect(function () {
var startedAt = performance.now();
client

@@ -39,2 +40,3 @@ .renderAssetPreset({

.then(function (resp) {
var completedAt = performance.now();
var contentType = resp.data.contentType;

@@ -57,2 +59,7 @@ if (contentType) {

setMediaUrl(resp.data.mediaUrl);
if (onRenderComplete && typeof onRenderComplete === 'function') {
onRenderComplete({
duration: completedAt - startedAt,
});
}
})

@@ -84,3 +91,3 @@ .catch(function (err) {

}, [mediaUrl, mediaType, mimeType, address, tokenId]);
return React.createElement("div", null, mediaElement);
return mediaElement;
};

4

package.json
{
"name": "nft-react",
"version": "0.4.0",
"version": "0.4.1",
"description": "React components for interacting with NFTs",

@@ -48,3 +48,3 @@ "main": "./dist/cjs/index.js",

"dependencies": {
"@center-inc/api-client": "^0.4.0",
"@center-inc/api-client": "^0.4.1",
"@center-inc/corp-vars": "^1.0.23",

@@ -51,0 +51,0 @@ "axios": "^0.26.1",

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