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.48.2
to
0.48.3
+6
-6
.turbo/turbo-build.log
> @leather.io/utils@0.48.2 build /home/runner/work/mono/mono/packages/utils
> @leather.io/utils@0.48.3 build /home/runner/work/mono/mono/packages/utils
> tsup

@@ -11,7 +11,7 @@

ESM Build start
ESM dist/index.js 73.26 KB
ESM dist/index.js.map 138.80 KB
ESM ⚡️ Build success in 38ms
ESM dist/index.js 73.59 KB
ESM dist/index.js.map 139.33 KB
ESM ⚡️ Build success in 41ms
DTS Build start
DTS ⚡️ Build success in 2195ms
DTS dist/index.d.ts 14.75 KB
DTS ⚡️ Build success in 2258ms
DTS dist/index.d.ts 14.78 KB

@@ -371,2 +371,18 @@ # Changelog

## [0.48.3](https://github.com/leather-io/mono/compare/@leather.io/utils-v0.48.2...@leather.io/utils-v0.48.3) (2025-11-17)
### Bug Fixes
* **mobile:** favour ord.io for viewing inscriptions ([ee42dd6](https://github.com/leather-io/mono/commit/ee42dd66ae0074bc1662928755ce418d1da08297))
* **mobile:** ord.io preview for html and image, fix bug showing stamp-details ([716bf48](https://github.com/leather-io/mono/commit/716bf4802f94ca01d13ececa7ec323845539cbaf))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @leather.io/constants bumped to 0.27.5
* @leather.io/models bumped to 0.48.0
## [0.48.2](https://github.com/leather-io/mono/compare/@leather.io/utils-v0.48.1...@leather.io/utils-v0.48.2) (2025-11-14)

@@ -373,0 +389,0 @@

@@ -96,2 +96,3 @@ import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';

readonly outputValue: string;
readonly thumbnailSrc?: string;
}

@@ -98,0 +99,0 @@ declare function createInscriptionAsset(data: CreateInscriptionData): InscriptionAsset;

@@ -5,3 +5,3 @@ {

"description": "Shared bitcoin utilities",
"version": "0.48.2",
"version": "0.48.3",
"license": "MIT",

@@ -23,4 +23,4 @@ "homepage": "https://github.com/leather-io/mono/tree/dev/packages/utils",

"dompurify": "3.2.4",
"@leather.io/constants": "0.27.4",
"@leather.io/models": "0.47.0"
"@leather.io/constants": "0.27.5",
"@leather.io/models": "0.48.0"
},

@@ -33,4 +33,4 @@ "devDependencies": {

"vitest": "2.1.9",
"@leather.io/prettier-config": "0.9.0",
"@leather.io/tsconfig-config": "0.11.0"
"@leather.io/tsconfig-config": "0.11.0",
"@leather.io/prettier-config": "0.9.0"
},

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

@@ -17,2 +17,3 @@ import { CryptoAssetCategories, CryptoAssetChains, CryptoAssetProtocols } from '@leather.io/models';

outputValue: '1000',
thumbnailSrc: 'https://example.com/thumb.png',
};

@@ -39,3 +40,27 @@

expect(inscription.mimeType).toEqual('svg');
expect(inscription.thumbnailSrc).toEqual(mockCreateInscriptionData.thumbnailSrc);
});
it('falls back to ordinal preview when no content source is provided', () => {
const inscription = createInscriptionAsset({
...mockCreateInscriptionData,
contentSrc: '',
});
expect(inscription.src).toContain('https://ordinals.com/preview/');
});
it.each([
{ mimeType: 'text/html', expectedMimeType: 'html' },
{ mimeType: 'model/gltf+json', expectedMimeType: 'gltf' },
])('uses contentSrc for %s inscriptions', ({ mimeType, expectedMimeType }) => {
const inscription = createInscriptionAsset({
...mockCreateInscriptionData,
mimeType,
contentSrc: 'https://content.bestinslot.xyz/example',
});
expect(inscription.mimeType).toEqual(expectedMimeType);
expect(inscription.src).toEqual('https://content.bestinslot.xyz/example');
});
});

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

import { ORD_IO_URL } from '@leather.io/constants';
import {

@@ -52,6 +53,10 @@ CryptoAssetCategories,

readonly outputValue: string;
readonly thumbnailSrc?: string;
}
export function createInscriptionAsset(data: CreateInscriptionData): InscriptionAsset {
const iframeSrc = `https://ordinals.com/preview/${data.id}`;
const ordinalPreviewSrc = `https://ordinals.com/preview/${data.id}`;
const ordIoSrc = `${ORD_IO_URL}/content/${data.id}`;
const thumbnailSrc = data.thumbnailSrc ?? ordinalPreviewSrc;
const primarySrc = data.contentSrc || ordinalPreviewSrc;
const preview = `https://ordinals.hiro.so/inscription/${data.id}`;

@@ -77,2 +82,3 @@ const title = `Inscription ${data.number}`;

value: data.outputValue,
thumbnailSrc,
};

@@ -93,3 +99,3 @@

name: 'inscription',
src: iframeSrc,
src: primarySrc,
}),

@@ -100,3 +106,3 @@ gltf: () => ({

name: 'inscription',
src: iframeSrc,
src: primarySrc,
}),

@@ -107,3 +113,4 @@ html: () => ({

name: 'inscription',
src: iframeSrc,
thumbnailSrc: ordIoSrc,
src: primarySrc,
}),

@@ -114,3 +121,4 @@ image: () => ({

name: 'inscription',
src: data.contentSrc,
thumbnailSrc: ordIoSrc,
src: primarySrc,
}),

@@ -121,3 +129,3 @@ svg: () => ({

name: 'inscription',
src: iframeSrc,
src: primarySrc,
}),

@@ -134,3 +142,3 @@ text: () => ({

name: 'inscription',
src: iframeSrc,
src: primarySrc,
}),

@@ -141,5 +149,5 @@ other: () => ({

name: 'inscription',
src: '',
src: data.contentSrc ?? '',
}),
});
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display