Autogenerated typed Mempool SDK with a built-in GQL client.
npm i @dipdup/mempool
First of all you need to create an instance of mempool client:
import { createClient } from '@dipdup/mempool'
const client = createClient({
url: 'https://mempool.dipdup.net/v1/graphql',
subscription: {
url: "wss://mempool.dipdup.net/v1/graphql"
}
});
import { everything } from '@dipdup/mempool'
client.chain.query
.transaction({
where: {
destination: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' }
},
limit: 10
})
.get({ ...everything })
.then(txs => console.log)
import { everything } from '@dipdup/mempool'
const { unsubscribe } = client.chain.subscription
.transaction({
where: {
destination: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' }
}
})
.get({ ...everything })
.subscribe({
next: (tx) => console.log(tx),
})