National Preventative Mechanism

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

    0.0.2 • Public • Published

    Mempool GQL client

    npm version Made With License: MIT

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

    Installation

    yarn add @dipdup/mempool
    

    Usage

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

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

    Query

    import { everything } from '@dipdup/mempool'
    
    client.chain.query
        .mempool_transaction({
            where: { 
                destination: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' }
            },
            limit: 10
        })
        .get({ ...everything })
        .then(txs => console.log)

    Subscription (live query)

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

    Keywords

    none

    Install

    npm i @dipdup/mempool

    Homepage

    dipdup.net

    DownloadsWeekly Downloads

    4

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    308 kB

    Total Files

    8

    Last publish

    Collaborators

    • m_kus