Normally Pleasant Mixture

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

    0.1.0 • Public • Published

    Metadata indexer

    Tests Docker images Made With License: MIT

    Selective Tezos metadata indexer based on DipDup framework.
    Supported features:

    • TZIP-16 contract metadata
    • TZIP-12 token metadata
    • IPFS file pinning
    • Token thumbnails generating (and uploading to AWS)
    • Elasicsearch mode

    Configuration

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

    Read more in the docs.

    GQL client

    Installation

    npm i @dipdup/metadata
    

    Usage

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

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

    Query

    import { everything } from '@dipdup/metadata'
    
    client.chain.query
        .token_metadata({
            where: { 
                contract: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' },
                token_id: { _eq: 100000 }
            }
        })
        .get({ ...everything })
        .then(res => console.log)

    Subscription (live query)

    const { unsubscribe } = client.chain.subscription
        .token_metadata({
            where: { 
                contract: { _eq: 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton' },
                created_at: { _gt: '2021-07-06T00:00:00' }
            }
        })
        .get({ ...everything })
        .subscribe({
            next: res => console.log
        })

    Maintenance

    Refetch recent metadata

    This is not a permanent solution, rather an ad-hoc command to fix recent fetch errors. Adjust the data accordingly or remove time condition.

    UPDATE token_metadata
    SET retry_count=0, status=1
    WHERE created_at > 1646082000 AND metadata ISNULL

    Keywords

    none

    Install

    npm i @dipdup/metadata

    DownloadsWeekly Downloads

    4

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    376 kB

    Total Files

    88

    Last publish

    Collaborators

    • m_kus