🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@yoroi/api

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yoroi/api - npm Package Compare versions

Comparing version

to
2.0.0

@@ -11,2 +11,3 @@ "use strict";

var _bestBlock = require("./best-block");
var _utxoData = require("./utxo-data");
var _config = require("./config");

@@ -19,7 +20,10 @@ const cardanoApiMaker = _ref => {

const baseUrl = _config.API_ENDPOINTS[network].root;
const legacyBaseUrl = _config.API_ENDPOINTS[network].legacy;
const getProtocolParams = (0, _protocolParams.getProtocolParams)(baseUrl, request);
const getBestBlock = (0, _bestBlock.getBestBlock)(baseUrl, request);
const getUtxoData = (0, _utxoData.getUtxoData)(legacyBaseUrl, request);
return (0, _immer.freeze)({
getProtocolParams,
getBestBlock
getBestBlock,
getUtxoData
});

@@ -26,0 +30,0 @@ };

@@ -9,2 +9,3 @@ "use strict";

var _bestBlock = require("./best-block.mocks");
var _utxoData = require("./utxo-data.mocks");
/* istanbul ignore file */

@@ -47,7 +48,20 @@

};
const getUtxoData = {
success: () => Promise.resolve(_utxoData.mockUtxoData),
delayed: timeout => delayedResponse({
data: _utxoData.mockUtxoData,
timeout
}),
empty: () => Promise.resolve({}),
loading,
error: {
unknown: unknownError
}
};
const mockCardanoApi = {
getProtocolParams: getProtocolParams.success,
getBestBlock: getBestBlock.success
getBestBlock: getBestBlock.success,
getUtxoData: getUtxoData.success
};
exports.mockCardanoApi = mockCardanoApi;
//# sourceMappingURL=cardano-api-maker.mocks.js.map

@@ -11,9 +11,12 @@ "use strict";

[_types.Chain.Network.Mainnet]: {
root: 'https://zero.yoroiwallet.com'
root: 'https://zero.yoroiwallet.com',
legacy: 'https://api.yoroiwallet.com'
},
[_types.Chain.Network.Preprod]: {
root: 'https://yoroi-backend-zero-preprod.emurgornd.com'
root: 'https://yoroi-backend-zero-preprod.emurgornd.com',
legacy: 'https://preprod-backend.yoroiwallet.com'
},
[_types.Chain.Network.Preview]: {
root: 'https://yoroi-backend-zero-preview.emurgornd.com'
root: 'https://yoroi-backend-zero-preview.emurgornd.com',
legacy: 'https://preview-backend.emurgornd.com'
}

@@ -20,0 +23,0 @@ });

@@ -11,2 +11,3 @@ "use strict";

var _protocolParams = require("./cardano/api/protocol-params");
var _utxoData = require("./cardano/api/utxo-data");
var _frontendFees2 = require("./app/api/frontend-fees.mocks");

@@ -43,2 +44,3 @@ var _parsers = require("./cardano/api/parsers");

getProtocolParams: _protocolParams.getProtocolParams,
getUtxoData: _utxoData.getUtxoData,
mockGetOnChainMetadatas: _tokenOnchainMetadata2.mockGetOnChainMetadatas,

@@ -45,0 +47,0 @@ isNftMetadata: _parsers.isNftMetadata,

@@ -5,2 +5,3 @@ import { fetcher } from '@yoroi/common';

import { getBestBlock as getBestBlockWrapper } from './best-block';
import { getUtxoData as getUtxoDataWapper } from './utxo-data';
import { API_ENDPOINTS } from './config';

@@ -13,9 +14,12 @@ export const cardanoApiMaker = _ref => {

const baseUrl = API_ENDPOINTS[network].root;
const legacyBaseUrl = API_ENDPOINTS[network].legacy;
const getProtocolParams = getProtocolParamsWrapper(baseUrl, request);
const getBestBlock = getBestBlockWrapper(baseUrl, request);
const getUtxoData = getUtxoDataWapper(legacyBaseUrl, request);
return freeze({
getProtocolParams,
getBestBlock
getBestBlock,
getUtxoData
});
};
//# sourceMappingURL=cardano-api-maker.js.map

@@ -5,2 +5,3 @@ /* istanbul ignore file */

import { bestBlockMockResponse } from './best-block.mocks';
import { mockUtxoData } from './utxo-data.mocks';
const loading = () => new Promise(() => {});

@@ -41,6 +42,19 @@ const unknownError = () => Promise.reject(new Error('Unknown error'));

};
const getUtxoData = {
success: () => Promise.resolve(mockUtxoData),
delayed: timeout => delayedResponse({
data: mockUtxoData,
timeout
}),
empty: () => Promise.resolve({}),
loading,
error: {
unknown: unknownError
}
};
export const mockCardanoApi = {
getProtocolParams: getProtocolParams.success,
getBestBlock: getBestBlock.success
getBestBlock: getBestBlock.success,
getUtxoData: getUtxoData.success
};
//# sourceMappingURL=cardano-api-maker.mocks.js.map

@@ -5,11 +5,14 @@ import { Chain } from '@yoroi/types';

[Chain.Network.Mainnet]: {
root: 'https://zero.yoroiwallet.com'
root: 'https://zero.yoroiwallet.com',
legacy: 'https://api.yoroiwallet.com'
},
[Chain.Network.Preprod]: {
root: 'https://yoroi-backend-zero-preprod.emurgornd.com'
root: 'https://yoroi-backend-zero-preprod.emurgornd.com',
legacy: 'https://preprod-backend.yoroiwallet.com'
},
[Chain.Network.Preview]: {
root: 'https://yoroi-backend-zero-preview.emurgornd.com'
root: 'https://yoroi-backend-zero-preview.emurgornd.com',
legacy: 'https://preview-backend.emurgornd.com'
}
});
//# sourceMappingURL=config.js.map

@@ -5,2 +5,3 @@ import { appApiMaker } from './app/api/app-api-maker';

import { getProtocolParams } from './cardano/api/protocol-params';
import { getUtxoData } from './cardano/api/utxo-data';
import { mockGetFrontendFees } from './app/api/frontend-fees.mocks';

@@ -35,2 +36,3 @@ import { isFtMetadata, isMetadataFile, isNftMetadata } from './cardano/api/parsers';

getProtocolParams,
getUtxoData,
mockGetOnChainMetadatas,

@@ -37,0 +39,0 @@ isNftMetadata,

import { Chain } from '@yoroi/types';
export declare const API_ENDPOINTS: Readonly<Record<Chain.SupportedNetworks, {
root: string;
legacy: string;
}>>;
//# sourceMappingURL=config.d.ts.map

@@ -168,2 +168,3 @@ import { isFtMetadata, isMetadataFile, isNftMetadata } from './cardano/api/parsers';

}>>;
readonly getUtxoData: (baseUrl: string, request?: import("@yoroi/common").Fetcher) => ({ txHash, txIndex, }: import("@yoroi/types").ApiUtxoDataRequest) => Promise<import("@yoroi/types").ApiUtxoData>;
readonly mockGetOnChainMetadatas: {

@@ -170,0 +171,0 @@ withMultipleMints: {

{
"name": "@yoroi/api",
"version": "1.5.3",
"version": "2.0.0",
"description": "The API package of Yoroi SDK",

@@ -116,2 +116,3 @@ "keywords": [

"text-summary",
"lcov",
"html"

@@ -152,3 +153,4 @@ ],

"@types/react-test-renderer": "^18.0.7",
"@yoroi/types": "1.5.9",
"@yoroi/common": "2.0.0",
"@yoroi/types": "2.0.0",
"axios": "^1.5.0",

@@ -177,3 +179,3 @@ "axios-mock-adapter": "^1.21.5",

"peerDependencies": {
"@yoroi/common": "^1.5.4",
"@yoroi/common": "^2.0.0",
"axios": "^1.5.0",

@@ -180,0 +182,0 @@ "immer": "^10.0.3",

@@ -5,2 +5,3 @@ /* istanbul ignore file */

import {bestBlockMockResponse} from './best-block.mocks'
import {mockUtxoData} from './utxo-data.mocks'

@@ -42,5 +43,16 @@ const loading = () => new Promise(() => {})

const getUtxoData = {
success: () => Promise.resolve(mockUtxoData),
delayed: (timeout?: number) => delayedResponse({data: mockUtxoData, timeout}),
empty: () => Promise.resolve({}),
loading,
error: {
unknown: unknownError,
},
}
export const mockCardanoApi: Api.Cardano.Api = {
getProtocolParams: getProtocolParams.success,
getBestBlock: getBestBlock.success,
getUtxoData: getUtxoData.success,
} as const

@@ -7,2 +7,3 @@ import {Fetcher, fetcher} from '@yoroi/common'

import {getBestBlock as getBestBlockWrapper} from './best-block'
import {getUtxoData as getUtxoDataWapper} from './utxo-data'
import {API_ENDPOINTS} from './config'

@@ -18,4 +19,6 @@

const baseUrl = API_ENDPOINTS[network].root
const legacyBaseUrl = API_ENDPOINTS[network].legacy
const getProtocolParams = getProtocolParamsWrapper(baseUrl, request)
const getBestBlock = getBestBlockWrapper(baseUrl, request)
const getUtxoData = getUtxoDataWapper(legacyBaseUrl, request)

@@ -25,3 +28,4 @@ return freeze({

getBestBlock,
getUtxoData,
} as const)
}

@@ -5,13 +5,16 @@ import {Chain} from '@yoroi/types'

export const API_ENDPOINTS: Readonly<
Record<Chain.SupportedNetworks, {root: string}>
Record<Chain.SupportedNetworks, {root: string; legacy: string}>
> = freeze({
[Chain.Network.Mainnet]: {
root: 'https://zero.yoroiwallet.com',
legacy: 'https://api.yoroiwallet.com',
},
[Chain.Network.Preprod]: {
root: 'https://yoroi-backend-zero-preprod.emurgornd.com',
legacy: 'https://preprod-backend.yoroiwallet.com',
},
[Chain.Network.Preview]: {
root: 'https://yoroi-backend-zero-preview.emurgornd.com',
legacy: 'https://preview-backend.emurgornd.com',
},
} as const)

@@ -5,2 +5,3 @@ import {appApiMaker} from './app/api/app-api-maker'

import {getProtocolParams} from './cardano/api/protocol-params'
import {getUtxoData} from './cardano/api/utxo-data'
import {mockGetFrontendFees} from './app/api/frontend-fees.mocks'

@@ -45,2 +46,3 @@

getProtocolParams,
getUtxoData,
mockGetOnChainMetadatas,

@@ -47,0 +49,0 @@ isNftMetadata,

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet