Skip to main content

Code Samples

The source code for all code samples is available on the official Mina Documentation Github page and should be used only for demonstration purposes.

Set up sample project

Start with the required imports and define constants:

import { Client } from 'mina-signer'
import axios from 'axios'

const TESTNET_NETWORK_IDENTIFIER = {
"network_identifier": {
"blockchain": "mina",
"network": "testnet"
}
}
const MINA_TOKEN_ID = "1"
const MINA_DECIMALS = 9
const MINA_SYMBOL = "MINA"
const MINA_CURVE_TYPE = "pallas"

const mina = new Client({network: 'testnet'})
const request = axios.create({
baseURL: "https://rosetta-devnet.minaprotocol.network/"
})
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));