@dipdup/mempool
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Mempool indexer

Tests Docker images Made With License: MIT

Selective Tezos mempool indexer based on DipDup framework.

Configuration

Fully compatible with DipDup YAML configuration file format.
Mempool indexer reuses datasources, contracts, database, hasura sections, and reads its own settings from mempool top-level section.

Read more in the docs.

GQL Client

Autogenerated typed Mempool SDK with a built-in GQL client.

Installation

npm i @dipdup/mempool

Usage

First of all you need to create an instance of mempool client:

import { createClient } from '@dipdup/mempool'

const client = createClient({
    url: 'https://api.dipdup.net/mempool/graphql',
    subscription: {
        url: "wss://api.dipdup.net/mempool/graphql"
    }
});

Query

import { everything } from '@dipdup/mempool'

client.chain.query
    .transaction({
        where: { 
            destination: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' }
        },
        limit: 10
    })
    .get({ ...everything })
    .then(txs => console.log)

Subscription (live query)

import { everything } from '@dipdup/mempool'

const { unsubscribe } = client.chain.subscription
    .transaction({
        where: { 
            destination: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' }
        }
    })
    .get({ ...everything })
    .subscribe({
        next: (tx) => console.log(tx),
    })

Dependencies (2)

Dev Dependencies (1)

Package Sidebar

Install

npm i @dipdup/mempool

Weekly Downloads

15

Version

0.2.0

License

MIT

Unpacked Size

709 kB

Total Files

73

Last publish

Collaborators

  • dmirg
  • m_kus