@leather.io/utils
Advanced tools
| > @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 @@ | ||
| [34mESM[39m Build start | ||
| [32mESM[39m [1mdist/index.js [22m[32m73.26 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m138.80 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 38ms | ||
| [32mESM[39m [1mdist/index.js [22m[32m73.59 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m139.33 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 41ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 2195ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m14.75 KB[39m | ||
| [32mDTS[39m ⚡️ Build success in 2258ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m14.78 KB[39m |
+16
-0
@@ -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 @@ |
+1
-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
-5
@@ -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
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
422146
0.68%9221
0.4%+ Added
+ Added
- Removed
- Removed
Updated
Updated