Skip to content

Instantly share code, notes, and snippets.

@tiero
Last active December 14, 2022 15:51
Show Gist options
  • Save tiero/5b62ab65dab75a8b8367149e73c291ca to your computer and use it in GitHub Desktop.
Save tiero/5b62ab65dab75a8b8367149e73c291ca to your computer and use it in GitHub Desktop.
const ElectrumClient = require('@mempool/electrum-client');
async function main() {
const client = new ElectrumClient(465, "blockstream.info", "ssl");
await client.initElectrum({ client: 'electrum-client-js', version: '1.4' }, {
retryPeriod: 5000,
maxRetry: 10,
pingPeriod: 5000,
callback: null,
});
// it works!
const response = await client.blockchainScripthash_getHistory(
"c40a8fadd3f13a91d506b820b1158cbb8166a2f45345088843d8f8483d44e17e"
);
console.log(response);
// doesn't work
const response2 = await client.blockchainScripthash_getHistoryBatch([
"c40a8fadd3f13a91d506b820b1158cbb8166a2f45345088843d8f8483d44e17e",
"57f6e1e3b30eea697504172e2a7967e3cb1f0dac5a6a188d18fa14d5fde1b850"
]);
console.log(response2);
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment