Skip to content

Commit 2b501fe

Browse files
committed
simplify: remove premature SRC-101 scaffolding, clean up stamp helper
- Remove DigitalArtifactType.Src101, ordpool_src101 flag, analyser switch case, hasAnyOrdpoolFlag check, ParsedSrc101 type file, and index.ts export. All were dead code -- no parser creates Src101 type (all 1951 mainnet SRC-101 use ARC4 multisig, not OLGA P2WSH). Per CLAUDE.md: don't claim support without a real mainnet tx. - Move STAMP_PREFIX to module level (consistency with CNTRPRTY_PREFIX) - Use STAMP_PREFIX[n] references instead of hardcoded hex bytes
1 parent a50dbd3 commit 2b501fe

6 files changed

Lines changed: 8 additions & 30 deletions

File tree

src/digital-artifact-analyser.service.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,6 @@ export class DigitalArtifactAnalyserService {
446446
flags |= OrdpoolTransactionFlags.ordpool_src721;
447447
break;
448448

449-
case DigitalArtifactType.Src101:
450-
flags |= OrdpoolTransactionFlags.ordpool_src101;
451-
break;
452-
453449
case DigitalArtifactType.Inscription:
454450
const inscription = artifact as ParsedInscription;
455451
flags |= OrdpoolTransactionFlags.ordpool_inscription;
@@ -565,8 +561,7 @@ export class DigitalArtifactAnalyserService {
565561
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_brc20) ||
566562
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_src20) ||
567563
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_stamp) ||
568-
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_src721) ||
569-
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_src101);
564+
isFlagSetOnTransaction(tx, OrdpoolTransactionFlags.ordpool_src721);
570565
}
571566

572567

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export * from './types/parsed-runestone';
4646
export * from './types/parsed-src20';
4747
export * from './types/parsed-stamp';
4848
export * from './types/parsed-src721';
49-
export * from './types/parsed-src101';
5049
export * from './types/parser-options';
5150
export * from './types/bitcoin-rpc';
5251
export * from './types/transaction-simple';

src/stamp/stamp-parser.service.helper.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { bigEndianBytesToNumber, hexToBytes, concatUint8Arrays } from '../lib/conversions';
22

3+
// "stamp:" in ASCII (hex: 7374616d703a) -- used by SRC-20/SRC-101 OLGA encoding
4+
const STAMP_PREFIX = new Uint8Array([0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a]);
5+
36
/**
47
* Extracts raw file data from OLGA P2WSH outputs.
58
*
@@ -62,12 +65,12 @@ export function extractOlgaData(
6265
// Extract the file data (skip 2-byte length prefix)
6366
const fileData = allBytes.subarray(2, 2 + fileLength);
6467

65-
// Check for "stamp:" prefix (0x7374616d703a) -- used by SRC-20/SRC-101 OLGA
68+
// Check for "stamp:" prefix -- used by SRC-20/SRC-101 OLGA encoding.
6669
// Counterparty-issued OLGA stamps do NOT have this prefix.
67-
const STAMP_PREFIX = new Uint8Array([0x73, 0x74, 0x61, 0x6d, 0x70, 0x3a]); // "stamp:"
6870
if (fileData.length > STAMP_PREFIX.length &&
69-
fileData[0] === 0x73 && fileData[1] === 0x74 && fileData[2] === 0x61 &&
70-
fileData[3] === 0x6d && fileData[4] === 0x70 && fileData[5] === 0x3a) {
71+
fileData[0] === STAMP_PREFIX[0] && fileData[1] === STAMP_PREFIX[1] &&
72+
fileData[2] === STAMP_PREFIX[2] && fileData[3] === STAMP_PREFIX[3] &&
73+
fileData[4] === STAMP_PREFIX[4] && fileData[5] === STAMP_PREFIX[5]) {
7174
// Strip the stamp: prefix
7275
return fileData.subarray(STAMP_PREFIX.length);
7376
}

src/types/digital-artifact.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export enum DigitalArtifactType {
33
Src20 = 'Src20',
44
Stamp = 'Stamp',
55
Src721 = 'Src721',
6-
Src101 = 'Src101',
76
Cat21 = 'Cat21',
87
Runestone = 'Runestone',
98
Atomical = 'Atomical',

src/types/ordpool-transaction-flags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const OrdpoolTransactionFlags = {
4242

4343
ordpool_stamp: 0b00001000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000n,
4444
ordpool_src721: 0b00010000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000n,
45-
ordpool_src101: 0b00100000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000n,
4645
};
4746

4847
export type OrdpoolTransactionFlag = typeof OrdpoolTransactionFlags[keyof typeof OrdpoolTransactionFlags];

src/types/parsed-src101.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)