Purchase Ordinal

In addition to transferring an ordinal, once an application is connected to Panda Wallet, it can also prompt the user for permission to purchase an ordinal. This is perfect for NFT applications using the global 1Sat Ordinal marketplace.

To purchase an ordinal, you simple pass an object like the following:

{
    outpoint: string, // the outpoint of the ordinal being purchased
    marketplaceRate?: number, // an optional percentage fee to collect (5% = 0.05)
    marketplaceAddress?: string, // an optional address to send the collected fee
}

Requesting to purchase an ordinal will look something like:

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

const purchaseParams = {
    outpoint: "0640087e862c2eec40ea216032221d9af3e3688d9644ed32a4a9e389a2894a84_0"
    marketplaceRate: 0.05,
    marketplaceAddress: "17dyCLLqGoJNgzDKkVd8c9NkXhjzxius62"
}

try {
    const txid = await wallet.purchaseOrdinal(purchaseParams);
    console.log(txid);
    // f2fc518036d96c956c30b995b4b0a70d6008b4b7ef666f7c913b2a79ab57d679
} catch (err) {
    console.log(err);
}

Last updated