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

runes_transfer

You can use the runes_transfer method to request Runes transfers from your user's wallet. You can request multiple transfers in a single request, each transfer involving:

  • a rune

  • a transfer amount

  • a recipient address

The method accepts a recipients array as request parameter:

Request parameters
Description

recipients

an array of transfer objects with <runeName, amount & recipient> properties:

import { request } from "sats-connect";

   const response = await request('runes_transfer', {
      recipients: [
        {
          runeName: 'UNCOMMON•GOODS',
          amount: 200,
          address: ordinalsAddress1,
        },
        {
          runeName: 'SATOSHI•NAKAMOTO',
          amount: 100,
          address: ordinalsAddress2,
        }]
    });

    if (response.status === "success") {
      // handle success
    } else {
      if (response.error.code === RpcErrorCode.USER_REJECTION) {
        // handle user cancellation error
      } else {
        // handle error
      }
    }
  } catch (err) {
      alert(err.error.message);
  }

The user will be prompted to review the Rune transfer transaction in the wallet, and to confirm:

  • the recipients and amounts of the Rune token to send

  • their desired Bitcoin transaction fee

The transaction will be signed and broadcasted upon user approval.

The runes_transfer method returns a Promise that resolves to the transferRunesResult object:

Property
Description

txid

The Bitcoin transaction id as a hex-encoded string.

Previousrunes_getBalanceNextMint Runes

Last updated 5 months ago

runeName a string representing the to transfer

amount a number representing the amount of Rune tokens to send. You can retrieve your user's balance of any Rune tokens with the method

address a string representing the Bitcoin address of the Rune transfer recipient We recommend managing runes holdings on taproot/ordinal addresses.

If the requested transfer requires a whose size exceeds the OP_RETURN payload limit of 80 bytes, runes_transfer will return an error.

🔲
Runestone
ℹ️
name of the Rune
ℹ️
runes_getBalance