minadata

1.0.1 • Public • Published

CircleCI

Mina Data

MinaData simplifies the retrieval of transaction data on the Mina blockchain. In doing so, it directly fetches data through the native GraphQL interfaces of the Archive Node. MinaData aims to assist you in quickly launching user interfaces.

Quickstart

node

npm init -y
npm i minadata

index.mjs

import { MinaData } from 'minadata'

const minaData = new MinaData( {
    'networkName': 'berkeley'
/*
    'graphQl': {
        'proxy': [ 'https://proxy.berkeley.minaexplorer.com/' ],
        'standard': [ 'https://berkeley.graphql.minaexplorer.com' ],
    }
*/
} )


minaData.getData( { 
    'preset': 'transactionByHash', 
    'userVars': {
        'hash': '5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1'
    }
} )

Table of Contents

  1. Quickstart
  2. Presets
  3. How to Use MinaData in HTML
  4. License

Presets

  • transactionByHash
Name Description Type Required Default
hash Transaction hash string true 5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1
  • latestBlockHeight
Name Description Type Required Default
blockHeight_lt Highest block number false 999999999
  • latestBlockHeights
Name Description Type Required Default
limit Limit number false 10
  • latestEventsFromContract
Name Description Type Required Default
limit Limit number false 10
blockHeight_lt Highest block number false 999999999
creator BTC address string true B62qnLVz8wM7MfJsuYbjFf4UWbwrUBEL5ZdawExxxFhnGXB6siqokyM

Example:

minaData.getData( {
    'preset': ' latestEventsFromContract',
    'userVars': {
        'creator': 'B62qnLVz8wM7MfJsuYbjFf4UWbwrUBEL5ZdawExxxFhnGXB6siqokyM'
    }
})

Please visit https://easymina.github.io/minadata

How to Use MinaData in HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your MinaData Project</title>
</head>
<body>
    <script type="module">
        import { MinaData } from 'https://unpkg.com/minadata@latest/dist/MinaData.js'

        const minaData = new MinaData( {
            'networkName': 'berkeley'
        } )

        minaData
            .getData( {
                'preset': 'transactionByHash',
                'userVars': {
                    'hash': '5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1'
                }
            } )
            .then( result => {
                console.log( `Here is the result ${JSON.stringify( result )}` )
            } )
    </script>
</body>
</html>

Create new dist

npx webpack

License

The module is available as open source under the terms of the Apache 2.0.

/minadata/

    Package Sidebar

    Install

    npm i minadata

    Weekly Downloads

    2

    Version

    1.0.1

    License

    Apache-2.0

    Unpacked Size

    121 kB

    Total Files

    18

    Last publish

    Collaborators

    • a6b8