This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set your node's API endpoints | |
INFO_URL="http://localhost:20443/v2/info" | |
ACCOUNT_URL="http://localhost:20443/v2/accounts/ST34CYSTX9853GG3TDY4FQZ9FM6F386MT0FHM0DMS?proof=0" | |
# Function to get the current block height | |
get_current_block_height() { | |
curl -s -X GET "$INFO_URL" | jq .burn_block_height | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
API_BASE="https://api.hiro.so" | |
declare -a CURL_OPTS=(-sS --fail) | |
if [[ -n "${HIRO_API_KEY:-}" ]]; then | |
CURL_OPTS+=( -H "Authorization: Bearer $HIRO_API_KEY" ) | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { c32address } from "c32check"; | |
import bs58check from "bs58check"; | |
const sipNumber = 33; // 👈 change me | |
const VERSION_SP_MAINNET = 22; | |
// Always make a 20-byte "hash": [00...00 | ASCII("yes-sip-N"|"no-sip-N")] | |
function makeHashHex(msg) { | |
const ascii = Buffer.from(msg, "ascii"); // explicit ASCII | |
if (ascii.length > 20) { |
OlderNewer