(nftItems)
- getItemById - Get NFT by Id
- getItemByIds - Get NFT by Ids
- getItemRoyaltiesById - Get NFT royalties by Id
- resetItemMeta - Reset NFT metadata
- getItemsByOwner - Get NFT owned by user
- getItemsByCreator - Get NFT created by user
- getItemsByCollection - Get NFT from collection
- getItemsByOwnerWithOwnership - Get NFT owned by user - detailed
getAllItems- Get all NFTs⚠️ Deprecated- queryTraits - Get NFT collection traits
- queryTraitsWithRarity - Get NFT traits rarity
getLazyItemById- Get Lazy NFT⚠️ DeprecatedmintLazyItem- Mint Lazy NFT⚠️ DeprecatedburnLazyItem- Burn Lazy NFT⚠️ Deprecated
Returns NFT Item by Id
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();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();| 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. |
Promise<models.Item>
| 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 | */* |
Returns NFT Items by specified list of Ids
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();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();| 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. |
Promise<models.Items>
| 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 | */* |
Returns NFT royalties by Id
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();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();| 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. |
Promise<models.Royalties>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Reloads NFT metadata from the source. If source not available, old metadata stays.
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();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();| 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. |
Promise<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns list of NFTs belong to specified user and sorted by last updated date
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();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();| 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. |
Promise<models.Items>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns list of NFTs created by specified user and sorted by last updated date
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();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();| 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. |
Promise<models.Items>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns list of NFTs from specified collection and sorted by last updated date
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();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();| 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. |
Promise<models.Items>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns list of NFTs belong to specified user and sorted by last updated date of ownership
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();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();| 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. |
Promise<models.ItemsWithOwnership>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
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.
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();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();| 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. |
Promise<models.Items>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns aggregation of existing traits for specified collections with counter for each trait type/value.
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();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();| 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. |
Promise<models.Traits>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UnionApiErrorBadRequest | 400 | application/json |
| errors.UnionApiErrorServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Returns the rarity of the trait
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();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();| 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. |
Promise<models.ExtendedTraitProperties>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Returns Lazy NFT Item by Id
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
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();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();| 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. |
Promise<models.LazyItem>
| 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 | */* |
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.
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();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();| 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. |
Promise<models.Item>
| 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 | */* |
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.
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();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();| 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. |
Promise<void>
| 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 | */* |