Skip to content

edictRune ​

edictRune(config, params): Promise<EdictRuneResponse>

Edicts (transfers) one or more runes to one or more receivers. It also supports transferring bitcoin.

WARNING

Only two different runes could be transferred at a time due to Bitcoin's transaction size limit.

Import ​

ts
import { edictRune } from "@midl/core";

Example ​

ts
edictRune(config, {
  transfers: [
    {
      runeId: "1:1",
      amount: 100n,
      receiver: "tb1q9zj...zj9q",
    },
  ],
});

Parameters ​

NameTypeDescription
configConfigThe configuration object
paramsEdictRuneParamsEdict rune parameters

EdictRuneParams ​

NameTypeDescription
feeRate?numberThe fee rate in satoshis per byte
from?stringThe address to transfer the rune from
publish?booleanIf true, the transaction will be broadcasted
transfers({ amount: bigint; receiver: string; runeId: string; } | { amount: number; receiver: string; })[]An array of transfers, supporting both rune and bitcoin transfers

Returns ​

Promise<EdictRuneResponse>

The PSBT and transaction data

EdictRuneResponse ​

NameTypeDescription
psbtstringBase64-encoded PSBT
txobjectThe transaction data
tx.hexstringThe transaction hex
tx.idstringThe transaction id

Released under the MIT License