runes_mint

Use the runes_mint method to execute a Rune mint order, and prompt your user to sign the funding transaction required to process the order.

ℹī¸ Note that you can use the runes_estimateMint method to estimate the cost of a Rune mint order for your user, before executing it.

You can specify the characteristics of the Runes mint order you wish to execute, by passing a RunesMintParams object to the method, with the below properties:

RunesMintParams Description

runeName

a string representing the name of the Rune to mint

repeats

refundAddress

destinationAddress

feeRate

a number representing the desired fee rate to set for the Rune mint transaction(s), in sats per vbytes

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

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

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

import { Wallet } from "sats-connect";

     const response = await Wallet.request('runes_mint', {
      destinationAddress: ordinalsAddress,
      feeRate: 12,
      repeats: 1,
      runeName: 'UNCOMMONGOODS',
      refundAddress: paymentAddress,
    });

    if (response.status === 'success') {
      setFundTxId(response.result.fundTransactionId);
    } else {
      console.error(response.error);
      alert('Error minting UNCOMMONGOODS. See console for details.');
    }
  };

The runes_mint method will

  1. Create a mint Runes order for Sats Connect to process, identified by an orderId

  2. Prompt your user to sign a send Bitcoin transaction with their connected Bitcoin payment address, to fund the Runes mint order. The funds are sent to a Sats Connect funding address dedicated to processing the order.

  3. return a RunesMintResponse object:

RunesMintResponse property Description

orderId

a string representing the ID of the Runes mint order created by Sats Connect.

fundTransactionId

a string representing the ID of the funding transaction required from your user for Sats Connect to process the Runes mint order.

fundingAddress

a string representing the BTC address which will collect the funds required to process the order, and sign the required mint transactions to process the order.

  1. Craft and broadcast the runes minting transaction(s) required to process your order, at the desired feeRate specified in the request, and signing with the funding address. Note that the runes minting transactions will be chained to your funding transaction and broadcast immediately after the funding transaction is detected, to optimize efficiency and speed. ℹī¸ If you order repeat mint transactions, Sats Connect will chain runes mint transactions: the output of mint transaction N will become the input of mint transaction N+1. The final mint transaction of chain will transfer the total amount of minted runes (# of mint transactions * fixed mint amount per transaction for the desired Rune) to the specified destinationAddress

  2. Monitor the confirmation of the funding transaction required from your user to the funding address dedicated to processing the order, and the confirmation of the chained minting transaction(s) -> You can then track the status of a Rune mint order using the runes_getOrder method.

Sats Connect charges a 2,000 sats fee for every mint transaction, with a cap of 36,000 sats (equivalent to 18 mint transactions) per mint order.

Last updated