Fixes World
Github
  • 💡What is Fixes?
  • 📓Concepts
    • 🔡Fixes Inscription
    • 💹Fixes Coins
      • Guide 1: How to Launch a new Coin?
    • 🎟️Lottery Game
    • 👻𝔉rc20s
    • 📔Token List
      • 📘Query TokenList
      • 📙Query Reviewers
  • 👨‍💻Developer
    • On-chain Interactions
      • 🔯𝔉rc20
        • Deploy - tx
        • Mint(batch) - tx
        • Transfer - tx
        • Burn - tx
        • List for Sale - tx
        • Take list as buyer - tx
        • List for Purchase - tx
        • Take list as seller - tx
        • Cancel Listing - tx
      • 🔡Fixes Inscription
        • EstimateCost - read
    • Open API Service
      • 🔯𝔉rc20 Basics
        • Query 𝔉rc20 Tokens
        • Fetch 𝔉rc20 Token Info
        • Check 𝔉rc20 registered
        • Get 𝔉rc20 balances
        • Get 𝔉rc20 balance
      • 🛒𝔉rc20 Marketplace
        • Query all 𝔉rc20 Markets
        • Fetch 𝔉rc20 Market detailed info
        • Check 𝔉rc20 Market enabled
        • Query 𝔉rc20 Listings
        • Query Market Trading History
        • Query Address Trading History
      • 🔧Utilities
        • Estimate Fixes inscribing cost
        • Get current $FLOW price
      • 📃Legal Disclaimer
  • 🔗LINKS
    • Official Website
    • Linktree
Powered by GitBook
On this page
Edit on GitHub
  1. Developer
  2. On-chain Interactions
  3. Fixes Inscription

EstimateCost - read

Estimate current inscribing cost

Script parameters

Key
Required
FType
Description

mimeType

t.String

for 𝔉rc20 use "text/plain"

data

t.String

the data string of each inscription

protocol

t.String

for 𝔉rc20 use "frc20"

Code example

import scEstimateCost from "@fixes/contracts/scripts/estimate-cost.cdc?raw";

async function estimateInscriptionCost(data: string) {
  return await flowSrv.executeScript(
      scEstimateCost,
      (arg, t) => [
        arg("text/plain", t.String),
        arg(data, t.String),
        arg("frc20", t.String),
      ],
      "0.001"
    );
}

Script source code

PreviousFixes InscriptionNextOpen API Service

Last updated 1 year ago

👨‍💻
🔡
https://github.com/fixes-world/fixes/blob/main/cadence/scripts/estimate-cost.cdc
import "Fixes"

access(all)
fun main(
    mimeType: String,
    data: String,
    protocol: String
): UFix64 {
    return Fixes.estimateValue(
        index: Fixes.totalInscriptions + 1,
        mimeType: mimeType,
        data: data.utf8,
        protocol: protocol,
        encoding: nil
    ) + 0.0001
}