🔲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 transfers array as request parameter:

Request parametersDescription

transfers

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

import { Wallet } from "sats-connect";

   const response = await Wallet.request('runes_transfer', [
      {
        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:

PropertyDescription

txid

The Bitcoin transaction id as a hex-encoded string.

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

Last updated