Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@leather.io/utils

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leather.io/utils - npm Package Compare versions

Comparing version
0.44.1
to
0.45.0
+6
-6
.turbo/turbo-build.log
> @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 @@

ESM Build start
ESM dist/index.js 72.48 KB
ESM dist/index.js.map 137.40 KB
ESM ⚡️ Build success in 32ms
ESM dist/index.js 72.96 KB
ESM dist/index.js.map 138.38 KB
ESM ⚡️ Build success in 49ms
DTS Build start
DTS ⚡️ Build success in 1847ms
DTS dist/index.d.ts 14.39 KB
DTS ⚡️ Build success in 2203ms
DTS dist/index.d.ts 14.69 KB

@@ -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 @@

@@ -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 };

@@ -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