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 axios from "axios"
import { Client } from "mina-signer"

const TESTNET_NETWORK_IDENTIFIER = {
network_identifier: {
blockchain: "mina",
network: "testnet",
},
}
const MINA_TOKEN_ID = "wSHV2S4qX9jFsLjQo8r1BsMLH2ZRKsZx6EJd1sbozGPieEC4Jf"
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))