Move inscription type to utils

This commit is contained in:
natsoni 2024-10-08 12:53:18 +09:00
parent 1ddb8a39c9
commit 57a05c80a2
No known key found for this signature in database
GPG key ID: C65917583181743B
4 changed files with 12 additions and 13 deletions

View file

@ -1,14 +1,6 @@
import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Runestone, Etching } from '../../shared/ord/rune.utils';
export interface Inscription {
body?: Uint8Array;
is_cropped?: boolean;
body_length?: number;
content_type?: Uint8Array;
content_type_str?: string;
delegate_txid?: string;
}
import { Inscription } from '../../shared/ord/inscription.utils';
@Component({
selector: 'app-ord-data',

View file

@ -12,7 +12,7 @@ import { ApiService } from '../../services/api.service';
import { PriceService } from '../../services/price.service';
import { StorageService } from '../../services/storage.service';
import { OrdApiService } from '../../services/ord-api.service';
import { Inscription } from '../ord-data/ord-data.component';
import { Inscription } from '../../shared/ord/inscription.utils';
import { Etching, Runestone } from '../../shared/ord/rune.utils';
@Component({

View file

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { catchError, forkJoin, map, Observable, of, switchMap, tap } from 'rxjs';
import { Inscription } from '../components/ord-data/ord-data.component';
import { Inscription } from '../shared/ord/inscription.utils';
import { Transaction } from '../interfaces/electrs.interface';
import { getNextInscriptionMark, hexToBytes, extractInscriptionData } from '../shared/ord/inscription.utils';
import { decipherRunestone, Runestone, Etching, UNCOMMON_GOODS } from '../shared/ord/rune.utils';

View file

@ -1,8 +1,6 @@
// Adapted from https://github.com/ordpool-space/ordpool-parser/tree/ce04d7a5b6bb1cf37b9fdadd77ba430f5bd6e7d6/src
// Utils functions to decode ord inscriptions
import { Inscription } from "../../components/ord-data/ord-data.component";
export const OP_FALSE = 0x00;
export const OP_IF = 0x63;
export const OP_0 = 0x00;
@ -304,6 +302,15 @@ export function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array {
////////////////////////////// Inscription ///////////////////////////
export interface Inscription {
body?: Uint8Array;
is_cropped?: boolean;
body_length?: number;
content_type?: Uint8Array;
content_type_str?: string;
delegate_txid?: string;
}
/**
* Extracts fields from the raw data until OP_0 is encountered.
*