runes_estimateEtch

Use the runes_estimateEtch method to estimate the cost of a Rune etch order for your user, before executing it.

You can specify the characteristics of the Runes etch order you wish to estimate, by passing an EstimateEtchParams object to the method, with the below properties:

EstimateEtchParams
Description

runeName

a string representing the name of the Rune to etch

divisibility (ℹī¸ optional)

a number representing the rune's divisibility, i.e. how finely it may be divided into its atomic units. Divisibility is expressed as the number of digits permissible after the decimal point in an amount of runes. The default value is 0.

symbol (ℹī¸ optional)

a string representing the rune's currency symbol as a single . If a rune does not have a symbol, the generic currency sign ¤, also called a scarab, should be used

premine (ℹī¸ optional)

a string representing rune premine: the amount of rune units which the etcher can optionally allocate to themselves.

isMintable

a boolean indicating if the rune may have an open mint, allowing anyone to create and allocate units of that rune for themselves.

terms (ℹī¸ optional)

an object describing the terms governing minting if the rune is mintable, with the below properties:

  • amount a string representing the fixed amount of new units of the rune that each mint transaction creates

  • cap a string representing the number of times a rune may be minted.

  • heightStart the mint is open starting in the block with the given start height. ℹī¸Optional

  • heightEnd the rune may not be minted in or after the block with the given end height. ℹī¸Optional

  • offsetStart the mint is open starting in the block whose height is equal to the start offset plus the height of the block in which the rune was etched. ℹī¸Optional

  • offsetEnd the rune may not be minted in or after the block whose height is equal to the end offset plus the height of the block in which the rune was etched. ℹī¸Optional

inscriptionDetails (ℹī¸ optional)

You can optionally use the Rune etching transactions to inscribe some content for your user: - the inscription will be sent to the specified destinationAddress, along with the etched Runes - the etched Runes will be linked to the inscription If you wish to use that option, pass an inscriptionDetails object with the below properties to specify the content to inscribe:

  • contentType a string representing the content/mime type of the content being inscribed. Make sure you extract and pass the correct content type for the content you wish to inscribe

  • contentBase64 a string representing the content you wish to inscribe, encoded in Base64 format

delegateInscriptionId (ℹī¸ optional)

If you wish to use the Rune etching transactions to create an inscription, you can optionally nominate a delegate for your inscription, as an alternative to specifying its content with inscriptionDetail (see above)

You can instead choose to pass a delegateInscriptionId string representing the serialized binary inscription ID of the delegate.

turbo (ℹī¸ optional)

a boolean marking the rune etching as opting into future rune protocol changes if set to true According to the Runes specifications: These protocol changes may increase light client validation costs, or just be highly degenerate ℹī¸the default value is false

destinationAddress

The Bitcoin address to which the minted runes should be allocated. ℹī¸If minting Runes for your user, you can fetch their wallet addresses with the getAccounts method. ⚠ī¸ We recommend managing runes holdings on taproot/ordinal addresses.

feeRate

a number representing the desired fee rate to set for the Rune etch transactions, in sats per vbytes

appServiceFee (ℹī¸ optional)

a number representing the sats value of the fee to charge your user for your service.

appServiceFeeAddress (ℹī¸ optional)

a string representing the Bitcoin address which will receive the appServiceFee, if a fee is specified

network (ℹī¸ optional)

a string representing the Bitcoin network to use for the etch transactions: 'Mainnet' or 'Testnet'


   import { request } from "sats-connect";
     
    const response = await request('runes_estimateEtch', {
      runeName: "UNCOMMONGOODS",
      premine: ,
      isMintable: ,
      destinationAddress: ,
      // add request params described above
    });

    if (response.status === 'success') {
      setTotalCost(response.result.totalCost);
      setTotalSize(response.result.totalSize);
    } else {
      console.error(response.error);
      alert('Error Fetching Estimate. See console for details.');
    }

The runes_estimateEtch method will not trigger any etch operation or prompt your user to sign any transaction. It will return an EstimateEtchResponse object, intended for you and your user to anticipate the etching costs and their breakdown:

EstimateEtchResponse property
Description

totalSize

a number representing the total size of the etch transactions, in vbytes

totalCost

a number representing the total cost of the etch transactions in sats

costBreakdown

An object representing the cost breakdown of the etch transactions, with the below properties:

  • postage a number representing the total size of the Rune UTXOs etched, in sats

  • networkFee a number representing the total network fee for the etch transactions, in sats

  • serviceFee a number representing the total Sats Connect fee for processing the etch order, in sats

  • appServiceFee a number representing the optional service fee your app charges the user for the etch order

See the runes_etch method if you wish to execute a Runes etch order after estimating its cost.

Last updated