Skip to content

Latest commit

 

History

History
491 lines (350 loc) · 36.5 KB

File metadata and controls

491 lines (350 loc) · 36.5 KB

CollectionStatistics

(collectionStatistics)

Overview

Available Operations

getGlobalCollectionStatistics

Global collection statistics 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.collectionStatistics.getGlobalCollectionStatistics({
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

  // 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 { collectionStatisticsGetGlobalCollectionStatistics } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetGlobalCollectionStatistics.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 collectionStatisticsGetGlobalCollectionStatistics(raribleProtocolMcp, {
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetGlobalCollectionStatisticsRequest ✔️ 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.OlapGlobalCollectionStatisticsResponse>

Errors

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

getGlobalCollectionStatisticsByIds

Global collection statistics by 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.collectionStatistics.getGlobalCollectionStatisticsByIds([
    "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  ]);

  // 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 { collectionStatisticsGetGlobalCollectionStatisticsByIds } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetGlobalCollectionStatisticsByIds.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 collectionStatisticsGetGlobalCollectionStatisticsByIds(raribleProtocolMcp, [
    "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  ]);

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request string[] ✔️ 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.OlapGlobalCollectionStatisticsResponse[]>

Errors

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

getPeriodCollectionStatistics

Period-based collection statistics 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.collectionStatistics.getPeriodCollectionStatistics({
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
    period: "D1",
  });

  // 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 { collectionStatisticsGetPeriodCollectionStatistics } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetPeriodCollectionStatistics.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 collectionStatisticsGetPeriodCollectionStatistics(raribleProtocolMcp, {
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
    period: "D1",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetPeriodCollectionStatisticsRequest ✔️ 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.OlapPeriodCollectionStatisticsResponse>

Errors

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

getPeriodCollectionStatisticsByIds

Period-based collection statistics by 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.collectionStatistics.getPeriodCollectionStatisticsByIds({
    collectionIds: [
      "<value 1>",
      "<value 2>",
    ],
    period: "MIN30",
  });

  // 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 { collectionStatisticsGetPeriodCollectionStatisticsByIds } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetPeriodCollectionStatisticsByIds.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 collectionStatisticsGetPeriodCollectionStatisticsByIds(raribleProtocolMcp, {
    collectionIds: [
      "<value 1>",
      "<value 2>",
    ],
    period: "MIN30",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request models.OlapPeriodCollectionsByIdsStatisticsRequest ✔️ 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.OlapPeriodCollectionStatisticsResponse[]>

Errors

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

getOwners

Returns list of owners of items in the collection along with the number of owned items

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.collectionStatistics.getOwners({
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

  // 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 { collectionStatisticsGetOwners } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetOwners.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 collectionStatisticsGetOwners(raribleProtocolMcp, {
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetOwnersRequest ✔️ 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.OlapOwnerStatistics>

Errors

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

getBidsByPrice

Returns list of bid prices with number of bids and bidders

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.collectionStatistics.getBidsByPrice({
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

  // 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 { collectionStatisticsGetBidsByPrice } from "@rarible/protocol-mcp/funcs/collectionStatisticsGetBidsByPrice.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 collectionStatisticsGetBidsByPrice(raribleProtocolMcp, {
    id: "ETHEREUM:0xb66a603f4cfe17e3d27b87a8bfcad319856518b8",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetBidsByPriceRequest ✔️ 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.OlapBidsByPriceStatistics>

Errors

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