Rename fetchTransactions to fetchAddressHistory

This commit is contained in:
Jim Hamill
2025-04-09 02:03:27 +00:00
parent a662d5cc7e
commit 05f858549b
6 changed files with 27 additions and 15 deletions
@@ -1,11 +1,17 @@
import { BlockchainElectrum, encodeExtendedJson, Transaction } from '@xocash/stack';
import {
BlockchainElectrum,
encodeExtendedJson,
Transaction,
} from '@xocash/stack';
export const electrumClient = {
from: [
{
label: 'From Servers',
inputs: ['Servers'],
models: ['bch.imaginary.cash, cashnode.bch.ninja, electrum.imaginary.cash'],
models: [
'bch.imaginary.cash, cashnode.bch.ninja, electrum.imaginary.cash',
],
callback: async (args: [string]) => {
const electrum = await BlockchainElectrum.from({
opts: {
@@ -39,11 +45,11 @@ export const electrumClient = {
},
},
{
label: 'Fetch Transactions',
label: 'Fetch Address History',
inputs: ['Address'],
models: ['Address'],
callback: async (electrum: BlockchainElectrum, args: [string]) => {
const transactions = await electrum.fetchTransactions(args[0]);
const transactions = await electrum.fetchAddressHistory(args[0]);
return encodeExtendedJson(transactions.toArray(), 2);
},
},
@@ -57,4 +63,4 @@ export const electrumClient = {
},
},
],
};
};