Skip to content

Latest commit

 

History

History
1214 lines (881 loc) · 89.2 KB

File metadata and controls

1214 lines (881 loc) · 89.2 KB

NFTItems

(nftItems)

Overview

Available Operations

getItemById

Returns NFT Item by Id

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemById({
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemById } from "@rarible/protocol-mcp/funcs/nftItemsGetItemById.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemById(raribleProtocolMcp, {
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemByIdRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Item>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorEntityNotFound 404 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemByIds

Returns NFT Items by specified list of Ids

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemByIds({
    ids: [
      "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemByIds } from "@rarible/protocol-mcp/funcs/nftItemsGetItemByIds.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemByIds(raribleProtocolMcp, {
    ids: [
      "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.ItemIds ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Items>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorEntityNotFound 404 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemRoyaltiesById

Returns NFT royalties by Id

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemRoyaltiesById({
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemRoyaltiesById } from "@rarible/protocol-mcp/funcs/nftItemsGetItemRoyaltiesById.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemRoyaltiesById(raribleProtocolMcp, {
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemRoyaltiesByIdRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Royalties>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

resetItemMeta

Reloads NFT metadata from the source. If source not available, old metadata stays.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  await raribleProtocolMcp.nftItems.resetItemMeta({
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });


}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsResetItemMeta } from "@rarible/protocol-mcp/funcs/nftItemsResetItemMeta.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsResetItemMeta(raribleProtocolMcp, {
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.ResetItemMetaRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemsByOwner

Returns list of NFTs belong to specified user and sorted by last updated date

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemsByOwner({
    blockchains: [
      "ETHEREUM",
    ],
    owner: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemsByOwner } from "@rarible/protocol-mcp/funcs/nftItemsGetItemsByOwner.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemsByOwner(raribleProtocolMcp, {
    blockchains: [
      "ETHEREUM",
    ],
    owner: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemsByOwnerRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Items>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemsByCreator

Returns list of NFTs created by specified user and sorted by last updated date

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemsByCreator({
    blockchains: [
      "ETHEREUM",
    ],
    creator: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemsByCreator } from "@rarible/protocol-mcp/funcs/nftItemsGetItemsByCreator.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemsByCreator(raribleProtocolMcp, {
    blockchains: [
      "ETHEREUM",
    ],
    creator: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemsByCreatorRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Items>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemsByCollection

Returns list of NFTs from specified collection and sorted by last updated date

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemsByCollection({
    collection: "ETHEREUM:0xd07dc4262bcdbf85190c01c996b4c06a461d2430",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemsByCollection } from "@rarible/protocol-mcp/funcs/nftItemsGetItemsByCollection.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemsByCollection(raribleProtocolMcp, {
    collection: "ETHEREUM:0xd07dc4262bcdbf85190c01c996b4c06a461d2430",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemsByCollectionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Items>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getItemsByOwnerWithOwnership

Returns list of NFTs belong to specified user and sorted by last updated date of ownership

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getItemsByOwnerWithOwnership({
    owner: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetItemsByOwnerWithOwnership } from "@rarible/protocol-mcp/funcs/nftItemsGetItemsByOwnerWithOwnership.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetItemsByOwnerWithOwnership(raribleProtocolMcp, {
    owner: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetItemsByOwnerWithOwnershipRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ItemsWithOwnership>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

getAllItems

Returns all NFT Items in accordance with specified filters and sorted by last updated date

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getAllItems({
    blockchains: [
      "ETHEREUM",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetAllItems } from "@rarible/protocol-mcp/funcs/nftItemsGetAllItems.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetAllItems(raribleProtocolMcp, {
    blockchains: [
      "ETHEREUM",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetAllItemsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Items>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

queryTraits

Returns aggregation of existing traits for specified collections with counter for each trait type/value.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.queryTraits({
    keys: [
      "Hat",
    ],
    collectionIds: [
      "ETHEREUM:0x60e4d786628fea6478f785a6d7e704777c86a7c6",
    ],
    owners: [
      "${filterOwners}",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsQueryTraits } from "@rarible/protocol-mcp/funcs/nftItemsQueryTraits.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsQueryTraits(raribleProtocolMcp, {
    keys: [
      "Hat",
    ],
    collectionIds: [
      "ETHEREUM:0x60e4d786628fea6478f785a6d7e704777c86a7c6",
    ],
    owners: [
      "${filterOwners}",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.QueryTraitsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Traits>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

queryTraitsWithRarity

Returns the rarity of the trait

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.queryTraitsWithRarity({
    collectionId: "ETHEREUM:0x60e4d786628fea6478f785a6d7e704777c86a7c6",
    properties: [],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsQueryTraitsWithRarity } from "@rarible/protocol-mcp/funcs/nftItemsQueryTraitsWithRarity.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsQueryTraitsWithRarity(raribleProtocolMcp, {
    collectionId: "ETHEREUM:0x60e4d786628fea6478f785a6d7e704777c86a7c6",
    properties: [],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.TraitsRarityRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ExtendedTraitProperties>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

getLazyItemById

Returns Lazy NFT Item by Id

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.getLazyItemById({
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsGetLazyItemById } from "@rarible/protocol-mcp/funcs/nftItemsGetLazyItemById.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsGetLazyItemById(raribleProtocolMcp, {
    itemId: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetLazyItemByIdRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.LazyItem>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorEntityNotFound 404 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

mintLazyItem

Create Lazy NFT (supported only for some blockchains)

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const result = await raribleProtocolMcp.nftItems.mintLazyItem({
    item: {
      atType: "ETH_ERC1155",
      supply: "123456",
      id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
      uri: "https://blushing-calculus.com/",
      creators: [
        {
          account: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
          value: 403222,
        },
      ],
      royalties: [
        {
          account: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
          value: 440498,
        },
      ],
      signatures: [
        "<value>",
      ],
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsMintLazyItem } from "@rarible/protocol-mcp/funcs/nftItemsMintLazyItem.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsMintLazyItem(raribleProtocolMcp, {
    item: {
      atType: "ETH_ERC1155",
      supply: "123456",
      id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
      uri: "https://writhing-ravioli.info/",
      creators: [
        {
          account: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
          value: 526422,
        },
      ],
      royalties: [
        {
          account: "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
          value: 822344,
        },
      ],
      signatures: [
        "<value>",
      ],
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request models.LazyItemMintForm ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.Item>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorEntityNotFound 404 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*

burnLazyItem

Deletes Lazy NFT (supported only for some blockchains)

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

import { RaribleProtocolMcp } from "@rarible/protocol-mcp";

const raribleProtocolMcp = new RaribleProtocolMcp({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  await raribleProtocolMcp.nftItems.burnLazyItem({
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
    creators: [
      "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
    ],
    signatures: [
      "<value 1>",
      "<value 2>",
      "<value 3>",
    ],
  });


}

run();

Standalone function

The standalone function version of this method:

import { RaribleProtocolMcpCore } from "@rarible/protocol-mcp/core.js";
import { nftItemsBurnLazyItem } from "@rarible/protocol-mcp/funcs/nftItemsBurnLazyItem.js";

// Use `RaribleProtocolMcpCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raribleProtocolMcp = new RaribleProtocolMcpCore({
  apiKeyAuth: process.env["RARIBLE_API_KEY"] ?? "",
});

async function run() {
  const res = await nftItemsBurnLazyItem(raribleProtocolMcp, {
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8:32292934596187112148346015918544186536963932779440027682601542850818403729410",
    creators: [
      "ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb",
    ],
    signatures: [
      "<value 1>",
      "<value 2>",
      "<value 3>",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request models.LazyItemBurnForm ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.UnionApiErrorBadRequest 400 application/json
errors.UnionApiErrorEntityNotFound 404 application/json
errors.UnionApiErrorServerError 500 application/json
errors.APIError 4XX, 5XX */*