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

@emurgo/yoroi-lib

Package Overview
Dependencies
Maintainers
0
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emurgo/yoroi-lib - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

3

dist/pools.d.ts

@@ -69,5 +69,6 @@ import { WasmFactory } from "./internals/utils/crypto";

private readonly apiUrl;
private readonly wasmFactory;
private readonly requestSize;
private transitionSaturationThreshold;
constructor(apiUrl: string);
constructor(apiUrl: string, wasmFactory?: WasmFactory | null);
/**

@@ -74,0 +75,0 @@ * @param hash HEX key-hash

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

const crypto_1 = require("./internals/utils/crypto");
const url_1 = require("url");
const js_1 = require("./internals/utils/js");

@@ -77,6 +76,7 @@ const explorerApi = 'https://a.cexplorer.io/yoroi-api/';

class PoolInfoApi {
constructor(apiUrl) {
constructor(apiUrl, wasmFactory = null) {
this.requestSize = 50;
this.transitionSaturationThreshold = null;
this.apiUrl = apiUrl;
this.wasmFactory = wasmFactory;
}

@@ -126,4 +126,4 @@ /**

return __awaiter(this, void 0, void 0, function* () {
const url = new url_1.URL('/pool/info', this.apiUrl).href;
const { data } = yield axios_1.default.post(url, {
const url = addPathToUrl(this.apiUrl, '/pool/info');
const { data } = yield axios_1.default.post(url.href, {
poolIds: hashes

@@ -159,3 +159,6 @@ });

return __awaiter(this, void 0, void 0, function* () {
const params = new URLSearchParams({ search: hash });
const { id } = this.wasmFactory ? yield normalisePoolIdentifierOrKey(hash, this.wasmFactory) : { id: null };
if (id == null)
throw new Error('getSingleExplorerPoolInfo: not possible to get pool id');
const params = new URLSearchParams({ search: id });
const { data } = yield axios_1.default.post(explorerApi, params.toString(), {

@@ -247,1 +250,8 @@ headers: {

exports.PoolInfoApi = PoolInfoApi;
function addPathToUrl(apiURL, path) {
const url = new URL(apiURL);
const basePath = url.pathname.replace(/\/$/, '');
const sanitizedPath = path.startsWith('/') ? path.slice(1) : path;
url.pathname = `${basePath}/${sanitizedPath}`;
return url;
}
{
"name": "@emurgo/yoroi-lib",
"version": "2.0.0",
"version": "2.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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