mempool / mempool.js Goto Github PK
View Code? Open in Web Editor NEWNPM Package for Mempool.Space API.
License: MIT License
NPM Package for Mempool.Space API.
License: MIT License
New minor version (2.3.0) will add support to Bitcoin (mainet, testnet, signet), Bis and Liquid APIs.
Bitcoin Mainet API - https://mempool.space/bisq/api
Testnet Mainet API - https://mempool.space/bisq/api
Signet Mainet API - https://mempool.space/bisq/api
Bisq API - https://mempool.space/bisq/api
Liquid API - https://mempool.space/bisq/api
Context: track-address
appears to have an upper limit on addresses that can be tracked
Code:
ws.on("open", function open() {
addresses.forEach((address) => {
logger.info(`Subscribing to ${address}`);
ws.send(JSON.stringify({ "track-address": address }));
});
});
I've noticed that when the list of addresses increases, at some point messages for all addresses stop being pushed. Is there an upper limit enforced by the api?
My logs show that the websocket remains open and I receive pong
messages as expected but no messages are received. I don't have an exact number of addresses when the issue occurs. Locally, I'm only tracking 10 address or so but in my staging environment I'm tracking about 1.5k.
Thanks for any help!
I'm currently trying to listen to new address transactions. This current code prints nothing but some { loadingIndicators: { 'block-indexing': 0 } }
after about 10 minutes of waiting even though it was running while a faucet sent test coins to it. You can see the transactions on https://mempool.space/testnet/address/mhmBs5QbkMvHiXCWtaQugtid331g5rJdfU.
import { WebSocket } from "ws"
const ws = new WebSocket("wss://mempool.space/testnet/api/v1/ws")
setInterval(() => {
ws.ping()
}, 30000)
ws.on("open",() => {
console.log(`Listener connected to ${ws.url}`)
ws.send(JSON.stringify({ "address-transactions": "mhmBs5QbkMvHiXCWtaQugtid331g5rJdfU" }))
ws.send(JSON.stringify({ "track-address": "mhmBs5QbkMvHiXCWtaQugtid331g5rJdfU" }))
})
ws.on("message", (data => {
const res = JSON.parse(data.toString())
console.log(res)
}))
Am I doing something wrong or are address-related events not pushed on the testnet network?
(I've tried creating the ws with the library before using the network: "testnet" option)
Object mempoolJS is undefined when I import the ./dist/mempool.min.js
from the html examples ./examples/html
.
Just run any html example running with the script mempool.min.js
:
This line:
https://github.com/mempool/mempool-js/blob/f39361263a16d234988bf58175fd3f5e192ecc87/package.json#L28
Should be:
"build": "tsc | browserify lib/index.js --standalone mempoolJS > dist/mempool.js | browserify -p tinyify lib/index.js --standalone mempoolJS > dist/mempool.min.js",
BitcoinHashrate=404ac979f9c6ccc66d4c53a2a9cdcf938759f2908a31701bc8fea9e5018e0ade
Where the he'll is my transaction at been 20 hrs this is bullshit btc transaction were created to be fast my ass.
Reporting fraud related to this Bitcoin address065ece30fdbbe46f555a4877b24e29465fd4f83e55264d8e3e6e8086877ab251
mempool.js is not using the correct path for the new endpoint.
Wrong: https://mempool.space/api/difficulty-adjustment
Correct: https://mempool.space/api/v1/difficulty-adjustment
Is this a new path for new endpoints? All the old endpoints are not using v1/
does the track-address
works?
I tried this:
const ws = websocket.initServer({
options: [{ 'track-address': '<address>' }],
})
...
But the only message I got when a tx arrived to my address was this:
{ conversions: { USD: 59005.314597715995 } }
that seems not related.
Add a CDN file to ./dist/mempool.min.js
.
Also remember to update the /examples/html
examples and add the ./dist
folder to .gitignore
Пока что не очень хорошо понимаю это приложение. Уже долгое время не могу вывести деньги, они куда то пропадают. Их же можно после каждой удачной транзакций выводить или есть определённое время?
I'm just start learning by myself. Never study 🙏🙏
/
We decided to follow the major and minor version of the main project mempool/mempool
(current: v2.2.x).
So for now one, we will update the patch version
for features and bug fixes of this repository.
2.3.0
to 2.2.0
in the package.json
file.I installed the lastest version of mempool.js from npm.
https://www.npmjs.com/package/@mempool/mempool.js
Node.js version is v18.5.0
My code is....
import mempoolJS from '@mempool/mempool.js'
const { bitcoin: { transactions } } = mempoolJS({
hostname: 'mempool.space',
network: 'signet'
})
const txhex = 'a_valid_txhex';
const txid = await transactions.postTx({ txhex });
console.log(txid);
Run the program, then throwing this exception.
'sendrawtransaction RPC error: {"code":-22,"message":"TX decode failed. Make sure the tx has at least one input."}'
I copied the same txhex to https://mempool.space/signet/tx/push
The transaction is broadcast successfully!
This obviously is a bug from mempool.js
0x3b93B1f5232a4E99aDd90Ae65642c0289797420E
This address can only receive Ethereum from Ethereum network. Don’t send ETH from other networks, any ERC-20s or NFTs, or it may result in a loss of funds.
STP
Я вообще не могу понять что и как
A ideia seria ao retornar as taxas, traga também o horário previsto em que elas irão ocorrer
is there a plan to add lightning API endpoints?
Change:
mempool.js/src/app/bisq/addresses.ts
Line 6 in 112e54a
to:
const { data } = await api.get<Address>(`/address/${params.address}`);
I can't use getBlocks
function without parameters.
import mempoolJS from '@mempool/mempool-js'
const { blocks } = mempoolJS()
// Error `Expected 1 arguments, but got 0.`
blocks.getBlocks().then(console.log).catch(console.error)
// works
blocks.getBlocks({}).then(console.log).catch(console.error)
Should be:
getBlocks: (params?: { start_height: number }) => Promise<Block>;
Make sure that mempool.js is configurable with custom hostname, port and HTTP/HTTPS and WS/WSS.
Hello there! Right now, I'm working with MempoolJS and I have a few questions related to track-address.
When I subscribe one address and I make a payment to it, I'm receiving one property called address-transactions, in this step all is correct, but when I restart the server, the address-transactions doesn't show anything else, and I want to ask you guys, is it possible to subscribe one address for more time???
That is a little example code about how to implement that track-address event
const ws = new WebSocket("wss://mempool.space/api/v1/ws");
ws.on('open', () => {
ws.send(JSON.stringify({ 'track-address': "btc address"}));
});
Transaction is good but will not get mined please help.
047f25eacf03ebd2701548def8c73f0841b7642792617b02b73b6e6d1b96e71f
Documentation on the website is not clear, where do we pass the track-address parameter as stated on the documentation?
{ 'track-address': '3PbJ...bF9B' } ===> how do we pass this param to see the transaction for a specific address?
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
The addresses.getAddressTxsChain({ address });
API should accept an optional parameter to load more from a txid
.
Its would be nice if we could have the current "Difficulty (14.50 T)" and the network "Hash Rate (117.461,40 TH/s)" (maybe last 24h is enough)
Thanks :)
README-bitcoin.md
.homespace
params to hostname
.My transfer has not yet been confirmed it's already been didn't have
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.