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

@secux/utility

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@secux/utility - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

1

lib/utility.d.ts

@@ -12,2 +12,3 @@ /// <reference types="node" />

export declare const ow_xpubString: import("ow").StringPredicate;
export declare const ow_base58String: import("ow").StringPredicate;
export declare function ow_strictPath(coinType: number | Array<number>, purpose?: number | Array<number>): import("ow").StringPredicate;

@@ -14,0 +15,0 @@ export declare function ow_accountPath(coinType: number | Array<number>, purpose?: number | Array<number>): import("ow").StringPredicate;

2

lib/utility.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isSupportedCoin=exports.supported_coin=exports.BigIntToBuffer=exports.ow_checkBufferLength=exports.ow_accountPath=exports.ow_strictPath=exports.ow_xpubString=exports.ow_numberString=exports.ow_hashString=exports.ow_prefixedhexString=exports.ow_hexString=exports.ow_bip32String=exports.Logger=exports.Signature=exports.toExtenededPublicKey=exports.splitPath=exports.decodePathBuffer=exports.buildPathBuffer=void 0;const e=require("bignumber.js"),t=require("ow"),r=require("./BIP32Path");var o=require("./BIP32Path");Object.defineProperty(exports,"buildPathBuffer",{enumerable:!0,get:function(){return o.buildPathBuffer}}),Object.defineProperty(exports,"decodePathBuffer",{enumerable:!0,get:function(){return o.decodePathBuffer}}),Object.defineProperty(exports,"splitPath",{enumerable:!0,get:function(){return o.splitPath}});var n=require("./xpub");Object.defineProperty(exports,"toExtenededPublicKey",{enumerable:!0,get:function(){return n.toExtenededPublicKey}});var p=require("./signature");function u(e){let t="";return e.map((e=>t+=`${e.toString()}|`)),t=`(${t.substr(0,t.length-1)})`,t}Object.defineProperty(exports,"Signature",{enumerable:!0,get:function(){return p.Signature}}),exports.Logger=process.env.SECUX_LOGGER,exports.ow_bip32String=t.default.string.matches(/^m(\/\d+'){3}((\/\d+){2})?$/),exports.ow_hexString=t.default.string.matches(/^[0-9A-F-a-f]+$/),exports.ow_prefixedhexString=t.default.string.matches(/^0x[0-9A-F-a-f]+$/),exports.ow_hashString=t.default.string.matches(/^[0-9A-Z-a-z]+$/),exports.ow_numberString=t.default.string.matches(/^[0-9]+$/),exports.ow_xpubString=t.default.string.matches(/^[1-9A-NP-Za-km-z]{111}$/),exports.ow_strictPath=function(e,r){const o=u("number"==typeof e?[e]:e);if(r){const e=u("number"==typeof r?[r]:r);return t.default.string.matches(new RegExp(`^m/${e}'/${o}'/[0-9]+'/[0-9]+/[0-9]+$`))}return t.default.string.matches(new RegExp(`^m/[0-9]+'/${o}'/[0-9]+'/[0-9]+/[0-9]+$`))},exports.ow_accountPath=function(e,r){const o=u("number"==typeof e?[e]:e);if(r){const e=u("number"==typeof r?[r]:r);return t.default.string.matches(new RegExp(`^m/${e}'/${o}'/[0-9]+'`))}return t.default.string.matches(new RegExp(`^m/[0-9]+'/${o}'/[0-9]+'`))},exports.ow_checkBufferLength=function(e){return t.default.buffer.validate((t=>({validator:t.length===e,message:r=>`ArgumentError: Expected length of ${r} is ${e}, got ${t.length}`})))},exports.BigIntToBuffer=function(t,r,o=!0){let n="";"number"==typeof t?n=t.toString(16):"string"==typeof t&&(n=new e.BigNumber(t).toString(16)),n.length%2!=0&&(n="0"+n);const p=Buffer.from(n,"hex");if(p.length>r)throw Error("value is too large");const u=Buffer.concat([Buffer.alloc(r-p.length),p]);return o?u.reverse():u},exports.supported_coin=Object.freeze([{purpose:[44,49,84,86],cointype:0,name:"bitcoin mainnet",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49,84,86],cointype:1,name:"bitcoin testnet",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:2,name:"litecoin",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:3,name:"dogecoin",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:5,name:"dash",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:17,name:"groestl",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:20,name:"digibyte",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:60,name:"ethereum",module:"SecuxETH",npm:"@secux/app-eth"},{purpose:[44],cointype:144,name:"ripple",module:"SecuxXRP",npm:"@secux/app-xrp"},{purpose:[44],cointype:145,name:"bitcoincash",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:148,name:"stellar",module:"SecuxXLM",npm:"@secux/app-xlm"},{purpose:[44],cointype:195,name:"tron",module:"SecuxTRX",npm:"@secux/app-trx"},{purpose:[44],cointype:714,name:"binance",module:"SecuxBNB",npm:"@secux/app-bnb"},{purpose:[1852],cointype:1815,name:"cardano",module:"SecuxADA",npm:"@secux/app-ada"}]),exports.isSupportedCoin=function(e){const t=(0,r.splitPath)(e);for(const e of exports.supported_coin)if(e.purpose.includes(t.purpose.value)&&e.cointype===t.coinType.value)return!0;return!1},process.env.SECUX_LOGGER||Object.defineProperty(process.env,"SECUX_LOGGER",{enumerable:!1,configurable:!1,writable:!1,value:void 0});
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isSupportedCoin=exports.supported_coin=exports.BigIntToBuffer=exports.ow_checkBufferLength=exports.ow_accountPath=exports.ow_strictPath=exports.ow_base58String=exports.ow_xpubString=exports.ow_numberString=exports.ow_hashString=exports.ow_prefixedhexString=exports.ow_hexString=exports.ow_bip32String=exports.Logger=exports.Signature=exports.toExtenededPublicKey=exports.splitPath=exports.decodePathBuffer=exports.buildPathBuffer=void 0;const e=require("bignumber.js"),t=require("ow"),r=require("./BIP32Path"),o=require("./bs58");var n=require("./BIP32Path");Object.defineProperty(exports,"buildPathBuffer",{enumerable:!0,get:function(){return n.buildPathBuffer}}),Object.defineProperty(exports,"decodePathBuffer",{enumerable:!0,get:function(){return n.decodePathBuffer}}),Object.defineProperty(exports,"splitPath",{enumerable:!0,get:function(){return n.splitPath}});var p=require("./xpub");Object.defineProperty(exports,"toExtenededPublicKey",{enumerable:!0,get:function(){return p.toExtenededPublicKey}});var u=require("./signature");function s(e){let t="";return e.map((e=>t+=`${e.toString()}|`)),t=`(${t.substr(0,t.length-1)})`,t}Object.defineProperty(exports,"Signature",{enumerable:!0,get:function(){return u.Signature}}),exports.Logger=process.env.SECUX_LOGGER,exports.ow_bip32String=t.default.string.matches(/^m(\/\d+')+(\/\d+)*$/),exports.ow_hexString=t.default.string.matches(/^[0-9A-F-a-f]+$/),exports.ow_prefixedhexString=t.default.string.matches(/^0x[0-9A-F-a-f]+$/),exports.ow_hashString=t.default.string.matches(/^[0-9A-Z-a-z]+$/),exports.ow_numberString=t.default.string.matches(/^[0-9]+$/),exports.ow_xpubString=t.default.string.matches(/^[1-9A-NP-Za-km-z]{111}$/),exports.ow_base58String=t.default.string.is((e=>!!o.Base58.decodeUnsafe(e))),exports.ow_strictPath=function(e,r){const o=s("number"==typeof e?[e]:e);if(r){const e=s("number"==typeof r?[r]:r);return t.default.string.matches(new RegExp(`^m/${e}'/${o}'/[0-9]+'/[0-9]+/[0-9]+$`))}return t.default.string.matches(new RegExp(`^m/[0-9]+'/${o}'/[0-9]+'/[0-9]+/[0-9]+$`))},exports.ow_accountPath=function(e,r){const o=s("number"==typeof e?[e]:e);if(r){const e=s("number"==typeof r?[r]:r);return t.default.string.matches(new RegExp(`^m/${e}'/${o}'/[0-9]+'`))}return t.default.string.matches(new RegExp(`^m/[0-9]+'/${o}'/[0-9]+'`))},exports.ow_checkBufferLength=function(e){return t.default.buffer.validate((t=>({validator:t.length===e,message:r=>`ArgumentError: Expected length of ${r} is ${e}, got ${t.length}`})))},exports.BigIntToBuffer=function(t,r,o=!0){let n="";"number"==typeof t?n=t.toString(16):"string"==typeof t&&(n=new e.BigNumber(t).toString(16)),n.length%2!=0&&(n="0"+n);const p=Buffer.from(n,"hex");if(p.length>r)throw Error("value is too large");const u=Buffer.concat([Buffer.alloc(r-p.length),p]);return o?u.reverse():u},exports.supported_coin=Object.freeze([{purpose:[44,49,84,86],cointype:0,name:"bitcoin mainnet",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49,84,86],cointype:1,name:"bitcoin testnet",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:2,name:"litecoin",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:3,name:"dogecoin",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:5,name:"dash",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:17,name:"groestl",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44,49],cointype:20,name:"digibyte",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:60,name:"ethereum",module:"SecuxETH",npm:"@secux/app-eth"},{purpose:[44],cointype:144,name:"ripple",module:"SecuxXRP",npm:"@secux/app-xrp"},{purpose:[44],cointype:145,name:"bitcoincash",module:"SecuxBTC",npm:"@secux/app-btc"},{purpose:[44],cointype:148,name:"stellar",module:"SecuxXLM",npm:"@secux/app-xlm"},{purpose:[44],cointype:195,name:"tron",module:"SecuxTRX",npm:"@secux/app-trx"},{purpose:[44],cointype:714,name:"binance",module:"SecuxBNB",npm:"@secux/app-bnb"},{purpose:[1852],cointype:1815,name:"cardano",module:"SecuxADA",npm:"@secux/app-ada"},{purpose:[44],cointype:501,name:"solana",module:"SecuxSOL",npm:"@secux/app-sol"}]),exports.isSupportedCoin=function(e){const t=(0,r.splitPath)(e);for(const e of exports.supported_coin)if(e.purpose.includes(t.purpose.value)&&e.cointype===t.coinType.value)return!0;return!1},process.env.SECUX_LOGGER||Object.defineProperty(process.env,"SECUX_LOGGER",{enumerable:!1,configurable:!1,writable:!1,value:void 0});
{
"name": "@secux/utility",
"version": "3.0.2",
"version": "3.0.3",
"description": "SecuX Hardware Wallet internal tools for SDK",

@@ -5,0 +5,0 @@ "keywords": [

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