# minadata

> 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.

Latest version **1.0.1** (published 2024-01-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install minadata
pnpm add minadata
yarn add minadata
bun add minadata
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-01-15 |
| First published | 2023-10-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 118.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | a6b8 |
| Maintainers | a6b8 |

## Links

- npm: https://www.npmjs.com/package/minadata
- npm.io page: https://npm.io/package/minadata

## Recent versions

- 1.0.1 (latest) — 2024-01-15
- 1.0.0 — 2024-01-15
- 0.0.94 — 2023-11-21
- 0.0.93 — 2023-11-21
- 0.0.92 — 2023-11-21
- 0.0.91 — 2023-11-20
- 0.0.9 — 2023-11-20
- 0.0.82 — 2023-11-19
- 0.0.81 — 2023-11-19
- 0.0.8 — 2023-11-19
- 0.0.7 — 2023-11-19
- 0.0.6 — 2023-11-19
- 0.0.5 — 2023-11-19
- 0.0.4 — 2023-11-03
- 0.0.3 — 2023-10-30

## README

![CircleCI](https://img.shields.io/circleci/build/github/EasyMina/minaData/main)


# 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
```bash
npm init -y
npm i minadata
```

index.mjs

```js
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](#quickstart)<br>
2. [Presets](#presets)
3. [How to Use MinaData in HTML]()
4.  [License](#license)<br>

## 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](https://easymina.github.io/minadata)


## How to Use MinaData in HTML

```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](https://github.com/EasyMina/minaData/blob/main/LICENSE).

---
_Source: https://npm.io/package/minadata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
