@leather.io/utils
Advanced tools
| > @leather.io/utils@0.44.1 build /home/runner/work/mono/mono/packages/utils | ||
| > @leather.io/utils@0.45.0 build /home/runner/work/mono/mono/packages/utils | ||
| > tsup | ||
@@ -11,7 +11,7 @@ | ||
| [34mESM[39m Build start | ||
| [32mESM[39m [1mdist/index.js [22m[32m72.48 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m137.40 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 32ms | ||
| [32mESM[39m [1mdist/index.js [22m[32m72.96 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m138.38 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 49ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 1847ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m14.39 KB[39m | ||
| [32mDTS[39m ⚡️ Build success in 2203ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m14.69 KB[39m |
+7
-0
@@ -342,2 +342,9 @@ # Changelog | ||
| ## [0.45.0](https://github.com/leather-io/mono/compare/@leather.io/utils-v0.44.1...@leather.io/utils-v0.45.0) (2025-09-10) | ||
| ### Features | ||
| * token management ([6681d94](https://github.com/leather-io/mono/commit/6681d949130379907e3aab5e454668aa2159e69e)) | ||
| ## [0.44.0](https://github.com/leather-io/mono/compare/@leather.io/utils-v0.43.0...@leather.io/utils-v0.44.0) (2025-08-27) | ||
@@ -344,0 +351,0 @@ |
+4
-1
@@ -103,2 +103,5 @@ import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js'; | ||
| declare function getAssetId(asset: CryptoAsset): CryptoAssetId; | ||
| type SerializedCryptoAssetId = `${string}|${string}`; | ||
| declare function serializeAssetId(assetId: CryptoAssetId): SerializedCryptoAssetId; | ||
| declare function deserializeAssetId(serializedAssetId: SerializedCryptoAssetId): CryptoAssetId; | ||
@@ -284,2 +287,2 @@ declare function truncateMiddle(input: string, offset?: number): string; | ||
| export { type CreateInscriptionData, type FormatAmountOptions, aggregateBaseCryptoAssetBalances, aggregateBtcBalances, aggregateStxBalances, assertExistence, assertIsTruthy, assertUnreachable, baseCurrencyAmountInQuote, baseCurrencyAmountInQuoteWithFallback, btcToSat, calculateMeanAverage, capitalize, convertAmountToBaseUnit, convertAmountToFractionalUnit, convertToMoneyTypeWithDefaultOfZero, countDecimals, createAccountAddresses, createBaseCryptoAssetBalance, createBtcBalance, createCounter, createCurrencyFormatter, createInscriptionAsset, createMoney, createMoneyFromDecimal, createNullArrayOfLength, createNumArrayOfRange, createStxBalance, dateToUnixTimestamp, daysInMs, daysInSec, defaultWalletKeyId, delay, ensureArray, extractPhraseFromString, fibonacciGenerator, fiveMinInMs, flattenObject, getAssetDisplayName, getAssetId, getTicker, hasBitcoinAddress, hasStacksAddress, hexToNumber, hoursInMs, hoursInSec, increaseValueByOneMicroStx, initBigNumber, invertExchangeRate, isBigInt, isBoolean, isDefined, isEmpty, isEmptyArray, isEmptyString, isError, isEven, isFiatCurrencyCode, isFulfilled, isFunction, isHexString, isMoney, isMoneyGreaterThanZero, isNumber, isNumberOrNumberList, isObject, isRejected, isString, isTypedArray, isUndefined, isValidPrecision, makeNumberRange, makeStacksTxExplorerLink, mapObject, match, matchesAssetId, maxMoney, microStxToStx, migratePositiveAssetBalancesToTop, minMoney, minutesInMs, minutesInSec, moneyToBaseUnit, noop, oneDayInMs, oneMinInMs, oneWeekInMs, propIfDefined, pxStringToNumber, quoteCurrencyAmountToBase, rebaseMarketData, removeTrailingNullCharacters, reverseBytes, safelyFormatHexTxid, sanitizeContent, satToBtc, scaleValue, secondsInMs, sortAssetsByName, spamFilter, stxToMicroStx, subtractMoney, sumMoney, sumNumbers, toHexString, truncateMiddle, undefinedIfLengthZero, uniqueArray, unitToFractionalUnit, weeksInMs, weeksInSec, whenInscriptionMimeType, whenNetwork }; | ||
| export { type CreateInscriptionData, type FormatAmountOptions, type SerializedCryptoAssetId, aggregateBaseCryptoAssetBalances, aggregateBtcBalances, aggregateStxBalances, assertExistence, assertIsTruthy, assertUnreachable, baseCurrencyAmountInQuote, baseCurrencyAmountInQuoteWithFallback, btcToSat, calculateMeanAverage, capitalize, convertAmountToBaseUnit, convertAmountToFractionalUnit, convertToMoneyTypeWithDefaultOfZero, countDecimals, createAccountAddresses, createBaseCryptoAssetBalance, createBtcBalance, createCounter, createCurrencyFormatter, createInscriptionAsset, createMoney, createMoneyFromDecimal, createNullArrayOfLength, createNumArrayOfRange, createStxBalance, dateToUnixTimestamp, daysInMs, daysInSec, defaultWalletKeyId, delay, deserializeAssetId, ensureArray, extractPhraseFromString, fibonacciGenerator, fiveMinInMs, flattenObject, getAssetDisplayName, getAssetId, getTicker, hasBitcoinAddress, hasStacksAddress, hexToNumber, hoursInMs, hoursInSec, increaseValueByOneMicroStx, initBigNumber, invertExchangeRate, isBigInt, isBoolean, isDefined, isEmpty, isEmptyArray, isEmptyString, isError, isEven, isFiatCurrencyCode, isFulfilled, isFunction, isHexString, isMoney, isMoneyGreaterThanZero, isNumber, isNumberOrNumberList, isObject, isRejected, isString, isTypedArray, isUndefined, isValidPrecision, makeNumberRange, makeStacksTxExplorerLink, mapObject, match, matchesAssetId, maxMoney, microStxToStx, migratePositiveAssetBalancesToTop, minMoney, minutesInMs, minutesInSec, moneyToBaseUnit, noop, oneDayInMs, oneMinInMs, oneWeekInMs, propIfDefined, pxStringToNumber, quoteCurrencyAmountToBase, rebaseMarketData, removeTrailingNullCharacters, reverseBytes, safelyFormatHexTxid, sanitizeContent, satToBtc, scaleValue, secondsInMs, serializeAssetId, sortAssetsByName, spamFilter, stxToMicroStx, subtractMoney, sumMoney, sumNumbers, toHexString, truncateMiddle, undefinedIfLengthZero, uniqueArray, unitToFractionalUnit, weeksInMs, weeksInSec, whenInscriptionMimeType, whenNetwork }; |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "description": "Shared bitcoin utilities", | ||
| "version": "0.44.1", | ||
| "version": "0.45.0", | ||
| "license": "MIT", | ||
@@ -8,0 +8,0 @@ "homepage": "https://github.com/leather-io/mono/tree/dev/packages/utils", |
@@ -1,2 +0,8 @@ | ||
| import { CryptoAsset, CryptoAssetId, Sip9Asset } from '@leather.io/models'; | ||
| import { | ||
| CryptoAsset, | ||
| CryptoAssetId, | ||
| CryptoAssetProtocol, | ||
| CryptoAssetProtocols, | ||
| Sip9Asset, | ||
| } from '@leather.io/models'; | ||
@@ -69,1 +75,18 @@ import { assertUnreachable } from '../index'; | ||
| } | ||
| export type SerializedCryptoAssetId = `${string}|${string}`; | ||
| export function serializeAssetId(assetId: CryptoAssetId): SerializedCryptoAssetId { | ||
| return `${assetId.protocol}|${assetId.id}`; | ||
| } | ||
| export function deserializeAssetId(serializedAssetId: SerializedCryptoAssetId): CryptoAssetId { | ||
| const [protocol, id] = serializedAssetId.split('|'); | ||
| if (!Object.keys(CryptoAssetProtocols).includes(protocol)) { | ||
| throw new Error(`Unrecognized Asset Protocol: ${protocol}`); | ||
| } | ||
| return { | ||
| protocol: protocol as CryptoAssetProtocol, | ||
| id, | ||
| }; | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
416323
0.64%9188
0.45%