From 669c472a473d74211f47136c49a7bdde6625de1d Mon Sep 17 00:00:00 2001 From: Steven Lee Date: Mon, 15 Apr 2024 00:40:49 -0700 Subject: [PATCH] Remove the need for runeName for RuneUtxoBalance (#42) --- package.json | 2 +- src/indexer/types.ts | 3 +-- src/indexer/updater.ts | 1 - test/updater.test.ts | 34 ---------------------------------- 4 files changed, 2 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 2df64ed..59d1b70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@magiceden-oss/runestone-lib", - "version": "0.7.0-alpha", + "version": "0.7.1-alpha", "description": "", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/indexer/types.ts b/src/indexer/types.ts index 5ee50a5..c1b97e5 100644 --- a/src/indexer/types.ts +++ b/src/indexer/types.ts @@ -111,7 +111,6 @@ export type RuneUtxoBalance = { address?: string; scriptPubKey: Buffer; runeId: RuneLocation; - runeName: string; runeTicker: string; amount: bigint; }; @@ -142,8 +141,8 @@ export type RuneEtchingSpec = RuneEtchingBase & { runeName?: string }; export type RuneEtching = ({ valid: false } | ({ valid: true } & RuneEtchingBase)) & { runeId: RuneLocation; - runeName: string; runeTicker: string; + runeName: string; txid: string; }; diff --git a/src/indexer/updater.ts b/src/indexer/updater.ts index 08dd333..214829e 100644 --- a/src/indexer/updater.ts +++ b/src/indexer/updater.ts @@ -287,7 +287,6 @@ export class RuneUpdater implements RuneBlockIndex { this.utxoBalances.push({ runeId: balance.runeId, runeTicker: etching.runeTicker, - runeName: etching.runeName, amount: balance.amount, scriptPubKey: Buffer.from(output.scriptPubKey.hex), txid: tx.txid, diff --git a/test/updater.test.ts b/test/updater.test.ts index 0ab4588..2272a95 100644 --- a/test/updater.test.ts +++ b/test/updater.test.ts @@ -478,7 +478,6 @@ describe('mint', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -534,7 +533,6 @@ describe('mint', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -586,7 +584,6 @@ describe('mint', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -639,7 +636,6 @@ describe('mint', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -688,7 +684,6 @@ describe('mint', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -699,7 +694,6 @@ describe('mint', () => { txid: 'txid', vout: 2, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 876543, tx: 21, @@ -793,7 +787,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -805,7 +798,6 @@ describe('edict', () => { vout: 1, amount: 89n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -827,7 +819,6 @@ describe('edict', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -838,7 +829,6 @@ describe('edict', () => { txid: 'txid', vout: 2, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -873,7 +863,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -897,7 +886,6 @@ describe('edict', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -908,7 +896,6 @@ describe('edict', () => { txid: 'childtxid', vout: 0, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -943,7 +930,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -992,7 +978,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1015,7 +1000,6 @@ describe('edict', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1046,7 +1030,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1069,7 +1052,6 @@ describe('edict', () => { txid: 'txid', vout: 2, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1104,7 +1086,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1128,7 +1109,6 @@ describe('edict', () => { txid: 'txid', vout: i + 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1164,7 +1144,6 @@ describe('edict', () => { vout: 0, amount: 402n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1188,7 +1167,6 @@ describe('edict', () => { txid: 'txid', vout: i + 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1227,7 +1205,6 @@ describe('edict', () => { vout: 0, amount: 500n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1251,7 +1228,6 @@ describe('edict', () => { txid: 'txid', vout: i + 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1287,7 +1263,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1311,7 +1286,6 @@ describe('edict', () => { txid: 'txid', vout: i + 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1347,7 +1321,6 @@ describe('edict', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1371,7 +1344,6 @@ describe('edict', () => { txid: 'txid', vout: i + 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1404,7 +1376,6 @@ describe('no runestone', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1426,7 +1397,6 @@ describe('no runestone', () => { txid: 'txid', vout: 0, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1456,7 +1426,6 @@ describe('no runestone', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1478,7 +1447,6 @@ describe('no runestone', () => { txid: 'txid', vout: 1, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8, @@ -1515,7 +1483,6 @@ describe('burning', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ', @@ -1568,7 +1535,6 @@ describe('burning', () => { vout: 0, amount: 400n, runeTicker: 'TESTRUNE', - runeName: 'TESTRUNE', runeId: { block: 888, tx: 8 }, scriptPubKey: Buffer.from('a914ea6b832a05c6ca578baa3836f3f25553d41068a587', 'hex'), address: '3P4WqXDbSLRhzo2H6MT6YFbvBKBDPLbVtQ',