mallow
  • SMORES Token
    • Overview
    • How to earn
    • Economics
    • SMORES Uses
    • FAQ
  • REST API
    • Overview
    • Reference
      • Types
        • Artwork
        • Collection
      • /artworks
        • GET /artworks/:mintAccount
        • GET /artworks/trending
        • POST /artworks/listedBySeller
        • POST /artworks/byCreator
      • /events
        • POST /events/byMint
        • POST /events/bySeller
      • /users
        • GET /users/:address
      • /rewards
        • GET /rewards/unclaimed/:address
      • /getBidOrBuyTx
        • POST /getBidOrBuyTx
      • /scheduledBids
        • POST /scheduledBids/getBidTx
        • POST /scheduledBids/getCancelBidTx
        • GET /scheduledBids/:bidder
  • Actions/Blinks
Powered by GitBook
On this page
  • REST API
  • Rate Limits
  • Get your API key
  • Transactions
  1. REST API

Overview

PreviousFAQNextReference

Last updated 1 year ago

REST API

We provide a REST API to interact with our on-chain programs. The base url for all requests in production/mainnet is https://api.mallow.art/v1

Rate Limits

Requests are limited to 10 per second per IP address

Get your API key

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can request an API key by contacting the mallow team on our .

Set the X-Api-Key header with your API key to authenticate requests.

Transactions

Endpoints that return a transaction to be signed will have the following response body:

{
    "result": "AQAAAAAAAAAAA...AAAHL2xa1PfAJQ1dwAAAAA=" // base64 encoded
}

All transactions are serialized VersionedTransactions

Clients can create a VersionedTransaction object and have the user sign it as follows:

const encodedTx = (
  await (
    await fetch("https://api.mallow.art/v1/getBidOrBuyTx", {
      method: "POST",
	headers: {
	  "Content-Type": "application/json",
	  "X-Api-Key": "YOUR-API-KEY",
	},
	body: JSON.stringify({
	  buyer: publicKey.toBase58(),
	  mint: mint.toBase58(),
      }),
    })
  ).json()
).result;

const tx = VersionedTransaction.deserialize(Buffer.from(encodedTx, "base64"));
const signedTx = await wallet.signTransaction(tx);
const txId = await sendAndConfirmRawTransaction(connection, signedTx.serialize());
Discord