Socket
Socket
Sign inDemoInstall

@swapkit/helpers

Package Overview
Dependencies
Maintainers
1
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swapkit/helpers - npm Package Compare versions

Comparing version 1.0.0-rc.19 to 1.0.0-rc.21

10

dist/index.es.js

@@ -944,13 +944,13 @@ var gt = Object.defineProperty;

case o.BitcoinCash:
return t.add(10001);
return t.set(10001e-8);
case o.Dogecoin:
return t.add(100000001);
return t.set(1.00000001);
case o.Avalanche:
case o.Ethereum:
return t.add(10 * 10 ** 9);
return t.set(1e-8);
case o.THORChain:
case o.Maya:
return t.add(0);
return t.set(0);
default:
return t.add(1);
return t.set(1e-8);
}

@@ -957,0 +957,0 @@ }, z = (s) => {

@@ -11,5 +11,5 @@ {

"vitest": "0.34.4",
"@internal/config": "0.0.0-internal.0",
"@swapkit/tokens": "1.0.0-rc.7",
"@swapkit/types": "1.0.0-rc.7"
"@internal/config": "0.0.0-rc.1",
"@swapkit/tokens": "1.0.0-rc.8",
"@swapkit/types": "1.0.0-rc.8"
},

@@ -20,4 +20,4 @@ "eslintConfig": {

"peerDependencies": {
"@swapkit/tokens": "1.0.0-rc.7",
"@swapkit/types": "1.0.0-rc.7"
"@swapkit/tokens": "1.0.0-rc.8",
"@swapkit/types": "1.0.0-rc.8"
},

@@ -47,3 +47,3 @@ "exports": {

"types": "./dist/index.d.ts",
"version": "1.0.0-rc.19",
"version": "1.0.0-rc.21",
"scripts": {

@@ -50,0 +50,0 @@ "build": "vite build",

import { BaseDecimal, Chain } from '@swapkit/types';
import { describe, expect, test } from 'vitest';
import { AssetValue } from '../assetValue.ts';
import { AssetValue, getMinAmountByChain } from '../assetValue.ts';

@@ -312,1 +312,20 @@ describe('AssetValue', () => {

});
describe('getMinAmountByChain', () => {
test('returns min amount for chain', () => {
expect(getMinAmountByChain(Chain.THORChain).getValue('string')).toBe('0');
expect(getMinAmountByChain(Chain.Maya).getValue('string')).toBe('0');
expect(getMinAmountByChain(Chain.Cosmos).getValue('string')).toBe('0');
expect(getMinAmountByChain(Chain.Bitcoin).getValue('string')).toBe('0.00010001');
expect(getMinAmountByChain(Chain.Litecoin).getValue('string')).toBe('0.00010001');
expect(getMinAmountByChain(Chain.BitcoinCash).getValue('string')).toBe('0.00010001');
expect(getMinAmountByChain(Chain.Dogecoin).getValue('string')).toBe('1.00000001');
expect(getMinAmountByChain(Chain.BinanceSmartChain).getValue('string')).toBe('0.00000001');
expect(getMinAmountByChain(Chain.Ethereum).getValue('string')).toBe('0.00000001');
expect(getMinAmountByChain(Chain.Avalanche).getValue('string')).toBe('0.00000001');
expect(getMinAmountByChain(Chain.Arbitrum).getValue('string')).toBe('0.00000001');
expect(getMinAmountByChain(Chain.Optimism).getValue('string')).toBe('0.00000001');
});
});

@@ -206,17 +206,17 @@ import type {

case Chain.BitcoinCash:
return asset.add(10001);
return asset.set(0.00010001);
case Chain.Dogecoin:
return asset.add(100000001);
return asset.set(1.00000001);
case Chain.Avalanche:
case Chain.Ethereum:
return asset.add(10 * 10 ** 9);
return asset.set(0.00000001);
case Chain.THORChain:
case Chain.Maya:
return asset.add(0);
return asset.set(0);
default:
return asset.add(1);
return asset.set(0.00000001);
}

@@ -223,0 +223,0 @@ };

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