Inscribe

Panda makes it easy to create inscriptions. It ultimately leverages the sendBsv method under the hood but the abstraction makes it easy for devs unfamiliar with building raw Bitcoin scripts to get started easily.

To create one or more inscriptions in a single request simple compose an object like the following:

A single transaction will handle up to 50MB worth of data. If your requirement is more than this, you will need to call the method multiple times.

[
  {
    address: string; // where to inscribe
    base64Data: string; // "Panda is awesome!"
    mimeType: MimeTypes; // see Provider Types section
    map?: MAP; // see Provider Types section
    satoshis?: number; // defaults to 1 in not provided
  }
]

An implementation may look like:

const wallet = initProvider(); // see "Detecting the Provider"

const inscriptions = [
  {
    address: "14kwyqNF7Ed5N1cXchroSjjxSASDrPksGA",
    base64Data: "UGFuZGEgaXMgYXdlc29tZSE=",
    mimeType: "text/plain",
    map: { app: "Cool app name", type: "ord", name: "Text #1" },
  },
  {
    address: "14kwyqNF7Ed5N1cXchroSjjxSASDrPksGA",
    base64Data: "UGFuZGEgaXMgYXdlc29tZSE=",
    mimeType: "text/plain",
    map: { app: "Cool app name", type: "ord", name: "Text #2" },
  }
];

try {
    const { txid, rawtx } = await wallet.inscribe(inscriptions);
    console.log(txid);
    // f2fc518036d96c956c30b995b4b0a70d6008b4b7ef666f7c913b2a79ab57d679
} catch (err) {
    console.log(err);
}

Last updated