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:
- TypeScript
- Python
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));
import json
from subprocess import run, PIPE
from time import sleep
from requests import post
BASE_URL = "http://localhost:3087"
SIGNER_PATH = 'path/to/signer.exe'
MAINNET_NETWORK_IDENTIFIER = {
"network_identifier": {
"blockchain": "mina",
"network": "mainnet"
}
}
MINA_TOKEN_ID = "1"
MINA_DECIMALS = 9
MINA_SYMBOL = "MINA"
MINA_CURVE_TYPE = "pallas"
MINA_SIGNATURE_TYPE = "schnorr_poseidon"