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

@nimiq/fastspot-api

Package Overview
Dependencies
Maintainers
8
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nimiq/fastspot-api - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

4

dist/helpers.d.ts

@@ -1,3 +0,3 @@

import { RequestAsset, SwapAsset, PriceData, FastspotPrice, FastspotContract, FastspotPreSwap, FastspotSwap, FastspotLimits, Contract, PreSwap, Swap, Limits } from './types';
export declare function coinsToUnits(asset: SwapAsset, value: string | number, roundUp?: boolean): number;
import { RequestAsset, SwapAsset, ReferenceAsset, PriceData, FastspotPrice, FastspotContract, FastspotPreSwap, FastspotSwap, FastspotLimits, Contract, PreSwap, Swap, Limits } from './types';
export declare function coinsToUnits(asset: SwapAsset | ReferenceAsset, value: string | number, roundUp?: boolean): number;
export declare function convertFromData(from: FastspotPrice): PriceData;

@@ -4,0 +4,0 @@ export declare function convertToData(to: FastspotPrice): PriceData;

@@ -1,2 +0,2 @@

import { SwapAsset, } from './types';
import { SwapAsset, ReferenceAsset, } from './types';
export function coinsToUnits(asset, value, roundUp = false) {

@@ -14,2 +14,5 @@ let decimals;

break;
case ReferenceAsset.USD:
decimals = 2;
break;
default: throw new Error(`Invalid asset ${asset}`);

@@ -119,2 +122,6 @@ }

monthly: coinsToUnits(limits.asset, limits.monthly),
referenceAsset: limits.referenceAsset,
referenceCurrent: coinsToUnits(limits.referenceAsset, limits.referenceCurrent),
referenceDaily: coinsToUnits(limits.referenceAsset, limits.referenceDaily),
referenceMonthly: coinsToUnits(limits.referenceAsset, limits.referenceMonthly),
};

@@ -121,0 +128,0 @@ }

@@ -6,2 +6,5 @@ export declare enum SwapAsset {

}
export declare enum ReferenceAsset {
USD = "USD"
}
export declare type FastspotAsset = {

@@ -96,2 +99,6 @@ symbol: SwapAsset;

monthly: string;
referenceAsset: ReferenceAsset;
referenceCurrent: string;
referenceDaily: string;
referenceMonthly: string;
};

@@ -176,2 +183,6 @@ export declare type FastspotResult = FastspotAsset[] | FastspotEstimate[] | FastspotSwap | FastspotContractWithEstimate<SwapAsset> | FastspotLimits<SwapAsset>;

monthly: number;
referenceAsset: ReferenceAsset;
referenceCurrent: number;
referenceDaily: number;
referenceMonthly: number;
};

@@ -7,1 +7,5 @@ export var SwapAsset;

})(SwapAsset || (SwapAsset = {}));
export var ReferenceAsset;
(function (ReferenceAsset) {
ReferenceAsset["USD"] = "USD";
})(ReferenceAsset || (ReferenceAsset = {}));
{
"name": "@nimiq/fastspot-api",
"version": "1.2.1",
"version": "1.3.0",
"description": "Typescript library to interact with the Fastspot API",

@@ -5,0 +5,0 @@ "repository": "git@github.com:nimiq/fastspot-api.git",

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