bitcore-node
Version:
A blockchain indexing node with extended capabilities using bitcore
99 lines • 3.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChainStateProvider = void 0;
const services = {};
class ChainStateProxy {
get({ chain, network }) {
if (services[chain]?.[network] == undefined) {
throw new Error(`Chain ${chain}:${network} doesn't have a ChainStateProvider registered`);
}
return services[chain][network];
}
streamAddressUtxos(params) {
return this.get(params).streamAddressUtxos(params);
}
streamAddressTransactions(params) {
return this.get(params).streamAddressTransactions(params);
}
async getBalanceForAddress(params) {
return this.get(params).getBalanceForAddress(params);
}
async getBlock(params) {
return this.get(params).getBlock(params);
}
async getBlockBeforeTime(params) {
return this.get(params).getBlockBeforeTime(params);
}
streamBlocks(params) {
return this.get(params).streamBlocks(params);
}
streamTransactions(params) {
return this.get(params).streamTransactions(params);
}
getAuthhead(params) {
return this.get(params).getAuthhead(params);
}
getDailyTransactions(params) {
return this.get(params).getDailyTransactions(params);
}
getTransaction(params) {
return this.get(params).getTransaction(params);
}
async createWallet(params) {
return this.get(params).createWallet(params);
}
async getWallet(params) {
return this.get(params).getWallet(params);
}
streamWalletAddresses(params) {
return this.get(params).streamWalletAddresses(params);
}
walletCheck(params) {
return this.get(params).walletCheck(params);
}
async updateWallet(params) {
return this.get(params).updateWallet(params);
}
streamWalletTransactions(params) {
return this.get(params).streamWalletTransactions(params);
}
async getWalletBalance(params) {
return this.get(params).getWalletBalance(params);
}
async getWalletBalanceAtTime(params) {
return this.get(params).getWalletBalanceAtTime(params);
}
async getFee(params) {
return this.get(params).getFee(params);
}
async getPriorityFee(params) {
return this.get(params).getPriorityFee?.(params);
}
streamWalletUtxos(params) {
return this.get(params).streamWalletUtxos(params);
}
async broadcastTransaction(params) {
return this.get(params).broadcastTransaction(params);
}
registerService(chain, network, service) {
services[chain] = services[chain] || {};
services[chain][network] = service;
}
async getCoinsForTx(params) {
return this.get(params).getCoinsForTx(params);
}
async getLocalTip(params) {
return this.get(params).getLocalTip(params);
}
async getLocatorHashes(params) {
return this.get(params).getLocatorHashes(params);
}
streamMissingWalletAddresses(params) {
return this.get(params).streamMissingWalletAddresses(params);
}
isValid(params) {
return this.get(params).isValid(params);
}
}
exports.ChainStateProvider = new ChainStateProxy();
//# sourceMappingURL=index.js.map