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

@mintbase-js/data

Package Overview
Dependencies
Maintainers
0
Versions
1320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mintbase-js/data - npm Package Compare versions

Comparing version 0.6.0-add-bitte-wallet-setup-f054e86.0 to 0.6.0-add-bitte-wallet-support-17d2a30.0

13

lib/api/dynamicNftMetadata/dynamicNftMetadata.mock.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicNftMetadataMockInactive = exports.dynamicNftMetadataMockActive = void 0;
const sdk_1 = require("@mintbase-js/sdk");
exports.dynamicNftMetadataMockActive = {
nft_metadata: [
{
metadataId: 'dynamic.mintbase2.near:deadbeef2',
metadataId: `dynamic.${sdk_1.mbjs.keys.mbContractV2}:deadbeef2`,
internalMetadataId: 0,
contractAddress: 'dynamic.mintbase2.near',
contractAddress: `dynamic.${sdk_1.mbjs.keys.mbContractV2}`,
reference: 'https://arweave.net/reference2',

@@ -30,4 +31,4 @@ referenceBlob: {

{
metadataId: 'dynamic.mintbase2.near:deadbeef0',
contractAddress: 'dynamic.mintbase2.near',
metadataId: `dynamic.${sdk_1.mbjs.keys.mbContractV2}:deadbeef0`,
contractAddress: `dynamic.${sdk_1.mbjs.keys.mbContractV2}`,
internalMetadataId: 0,

@@ -42,4 +43,4 @@ reference: 'https://arweave.net/reference0',

{
metadataId: 'dynamic.mintbase2.near:deadbeef1',
contractAddress: 'dynamic.mintbase2.near',
metadataId: `dynamic.${sdk_1.mbjs.keys.mbContractV2}:deadbeef1`,
contractAddress: `dynamic.${sdk_1.mbjs.keys.mbContractV2}`,
internalMetadataId: 0,

@@ -46,0 +47,0 @@ reference: 'https://arweave.net/reference1',

import { ParsedDataReturn } from '../../types';
import { NearPriceData } from './nearPrice.types';
export declare const fetchPriceFromCoinGecko: () => Promise<NearPriceData>;
export declare const fetchPriceFromBinance: () => Promise<NearPriceData>;
export declare const nearPrice: () => Promise<ParsedDataReturn<string>>;
//# sourceMappingURL=nearPrice.d.ts.map

@@ -15,24 +15,20 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.nearPrice = exports.fetchPriceFromBinance = exports.fetchPriceFromCoinGecko = void 0;
exports.nearPrice = void 0;
const cross_fetch_1 = __importDefault(require("cross-fetch"));
const constants_1 = require("../../constants");
const utils_1 = require("../../utils");
const fetchPriceFromCoinGecko = () => __awaiter(void 0, void 0, void 0, function* () {
const req = yield (0, cross_fetch_1.default)(constants_1.COIN_GECKO_API);
const data = yield req.json();
return { price: data.near.usd };
});
exports.fetchPriceFromCoinGecko = fetchPriceFromCoinGecko;
const fetchPriceFromBinance = () => __awaiter(void 0, void 0, void 0, function* () {
const req = yield (0, cross_fetch_1.default)(constants_1.BINANCE_API);
const data = yield req.json();
return data;
});
exports.fetchPriceFromBinance = fetchPriceFromBinance;
function fetchPrice(url, tokenPrice) {
return __awaiter(this, void 0, void 0, function* () {
const req = yield (0, cross_fetch_1.default)(url);
const data = yield req.json();
return tokenPrice(data);
});
}
const nearPrice = () => __awaiter(void 0, void 0, void 0, function* () {
try {
const res = yield Promise.any([
(0, exports.fetchPriceFromCoinGecko)(),
(0, exports.fetchPriceFromBinance)(),
]);
const res = yield fetchPrice(constants_1.BINANCE_API, data => data)
.catch((err) => __awaiter(void 0, void 0, void 0, function* () {
console.log('First API call failed, trying second API', err);
return yield fetchPrice(constants_1.COIN_GECKO_API, data => ({ price: data.near.usd }));
}));
return (0, utils_1.parseData)(res.price);

@@ -39,0 +35,0 @@ }

{
"name": "@mintbase-js/data",
"version": "0.6.0-add-bitte-wallet-setup-f054e86.0",
"version": "0.6.0-add-bitte-wallet-support-17d2a30.0",
"description": "Query wrappers for Mintbase JS SDK",

@@ -24,3 +24,3 @@ "main": "lib/index.js",

"dependencies": {
"@mintbase-js/sdk": "^0.5.2-beta.0",
"@mintbase-js/sdk": "=0.6.0-beta-prerelease.1",
"cross-fetch": "^4.0.0",

@@ -34,3 +34,3 @@ "graphql-request": "^5.2.0"

},
"gitHead": "653a658e1a70b9b18a0e751f0368894f10a91026"
"gitHead": "6570fcf0be86f0b66e12c254f7d6cad0b0ae6e4a"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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