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'
} )
minaData.getData( {
'preset': 'transactionByHash',
'userVars': {
'hash': '5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1'
}
} )
Table of Contents
- Quickstart
- Presets
- How to Use MinaData in HTML
- License
Presets
Name | Description | Type | Required | Default |
---|
hash | Transaction hash | string | true | 5Ju7HSdjQcPpgzkjECVdmErhuri3VMLm2N7b4z2mB6kMbbKnFHx1 |
Name | Description | Type | Required | Default |
---|
blockHeight_lt | Highest block | number | false | 999999999 |
Name | Description | Type | Required | Default |
---|
limit | Limit | number | false | 10 |
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.