Sats Connect - Wallet API for Bitcoin & Stacks
  • Introduction
  • Wallet Providers
    • getInfo
    • getProviders & getProviderById
  • Connecting to the wallet
    • Connect to Xverse Wallet
    • Disconnect from Xverse Wallet
    • Connect to other wallets
      • Manage a user's default wallet
    • [Legacy âš ī¸] getAccounts
  • Wallet Methods
    • request methods
    • wallet_getAccount
    • wallet_getNetwork
    • wallet_changeNetwork
    • Xverse Custom Methods
  • Xverse Wallet Permissions
  • Xverse Wallet events
  • BITCOIN METHODS
    • 🟠getAddresses
    • 🟠signMessage
    • 🟠signPsbt
    • 🟠sendTransfer
    • 🟠signMultipleTransactions
    • 🟠getBalance
    • 🎨createInscription
    • 🎨createRepeatInscriptions
    • 🎨ord_getInscriptions
    • 🎨ord_sendInscriptions
    • 🔲runes_getBalance
    • 🔲runes_transfer
    • 🔲Mint Runes
      • runes_estimateMint
      • runes_mint
    • 🔲Etch Runes
      • runes_estimateEtch
      • runes_etch
    • 🔲runes_getOrder
    • 🔲Speed up a Rune Mint or Etch order
      • 🔲runes_estimateRbfOrder
      • 🔲runes_rbfOrder
  • STACKS METHODS
    • 🔴stx_getAccounts
    • 🔴stx_signMessage
    • 🔴stx_signStructuredMessage
    • 🔴stx_transferStx
    • 🔴stx_signTransaction
    • 🔴stx_callContract
    • 🔴stx_deployContract
  • GUIDES
    • Verify Bitcoin message signatures
    • Creating Bitcoin PSBTs
    • 📱Mobile Integration
    • Next.js support
  • RESOURCES
    • App Template
    • Demo App
    • Changelog
    • Github Issues
    • Developer forum
    • BIP322
Powered by GitBook
On this page
  1. BITCOIN METHODS

createRepeatInscriptions

PreviouscreateInscriptionNextord_getInscriptions

Last updated 1 year ago

This is an . It can only be invoked for users using the .

import { createRepeatInscriptions } from 'sats-connect'

The CreateRepeatInscriptions method lets you inscribe the same content multiple times via the user's wallet. You can use it to create both text and file inscriptions, which will be sent to the user's ordinal address. It is particularly well suited to BRC20 mints, as it lets you inscribe multiple token mints in a single request to bypass the limit per mint.

You can optionally charge a fee to the user for your service by specifying a fee amount and receiving address using the appFee and appFeeAddress parameters. The fee will be included as an additional output in the inscription commit transaction.

Payload
Description

network

The Network type you want to use. Please note that inscriptions currently only support Mainnet.

contentType

The content/mime type of the content being inscribed. It is up to you to extract and send through the correct content type for the content.

payloadType

The format of the content being sent through. (one of "PLAIN_TEXT" or "BASE_64")

content

The content being inscribed. If the `payloadType` has been set to "PLAIN_TEXT", this content will be inscribed directly; if set to "BASE_64", the content will be converted into a binary buffer before being inscribed (use this for image and other binary files).

repeat

appFee (optional)

If you would like to charge a fee for your services, add the sats value here.

appFeeAddress (optional)

The address where your appFee will be sent.

suggestedMinerFeeRate (optional)

This will be the initial fee rate set for the transaction in the confirmation dialog. The user will be able to change it within the wallet if they desire.

    import { createRepeatInscriptions } from 'sats-connect'
    
    await createRepeatInscriptions({
      payload: {
        network: {
          type: network,
        },
        repeat: Number(repeat),
        contentType,
        content,
        payloadType: "PLAIN_TEXT",
        /** Optional parameters:
        appFeeAddress: "", // the address where the inscription fee should go
        appFee: 1000, // the amount of sats that should be sent to the fee address
        */
        suggestedMinerFeeRate,
      },
      onFinish: (response: CreateRepeatInscriptionsResponse) => {
        alert(response.txId);
      },
      onCancel: () => alert("Canceled"),
    });

The method will request the signature of an inscription commit transaction from the user's wallet, to fund the inscriptions, and commit to their content.

Once approved by the user:

  • the commit inscription transactions are immediately broadcasted. The function will return a transaction ID commitTransactionId which you can track.

  • the first inscription reveal transaction is broadcasted immediately to send the first inscriptions to the user's wallet. The function will return a transaction ID revealTransactionId, which you can track.

  • the first inscription reveal transactions also trigger further commit & reveal inscription transactions, to inscribe the content multiple times to the user's wallet.

The number of inscriptions to create. Note that there is a 24 repeat limit per order due to transaction chaining restrictions on the Bitcoin blockchain.

🎨
Xverse custom method
Xverse wallet
â„šī¸