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.
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'
}
} )
- 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
<!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
The module is available as open source under the terms of the Apache 2.0.