@magiceden/magiceden-sdk
Version:
A TypeScript SDK for interacting with Magic Eden's API across multiple chains.
63 lines (62 loc) • 2.35 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CancelItemOfferParams = exports.SolanaCancelItemOfferParamsSchema = exports.EvmCancelMultipleItemOfferParamsSchema = exports.EvmCancelItemOfferParamsSchema = exports.BaseCancelItemOfferParamsSchema = void 0;
const zod_1 = require("zod");
const chains_1 = require("../../chains");
/**
* Parameters for canceling an offer
*/
exports.BaseCancelItemOfferParamsSchema = zod_1.z.object({
// Generic parameters that can be shared between chains
});
exports.EvmCancelItemOfferParamsSchema = exports.BaseCancelItemOfferParamsSchema.extend({
// EVM-specific parameters
});
exports.EvmCancelMultipleItemOfferParamsSchema = zod_1.z.object({
/**
* The EVM chain to cancel the item offer on
*/
chain: chains_1.ZodEvmBlockchain.describe('The chain to cancel the item offer on'),
/**
* The order IDs to cancel
*/
orderIds: zod_1.z.array(zod_1.z.string()).describe('The order IDs to cancel'),
});
exports.SolanaCancelItemOfferParamsSchema = exports.BaseCancelItemOfferParamsSchema.extend({
/**
* The NFT token address/mint
*/
token: zod_1.z.string().describe('The NFT token address/mint'),
/**
* The offer price to cancel
*/
price: zod_1.z.string().describe('The offer price to cancel'),
/**
* The offer expiry timestamp
*/
expiry: zod_1.z.number().optional().describe('Offer expiry timestamp'),
/**
* The auction house address
*/
auctionHouseAddress: zod_1.z.string().optional().describe('Auction house address'),
/**
* The buyer referral address
*/
buyerReferral: zod_1.z.string().optional().describe('Buyer referral address'),
/**
* The priority fee in micro lamports
*/
prioFeeMicroLamports: zod_1.z.number().optional().describe('Priority fee in micro lamports'),
/**
* The maximum priority fee in lamports
*/
maxPrioFeeLamports: zod_1.z.number().optional().describe('Maximum priority fee in lamports'),
/**
* The exact priority fee in lamports
*/
exactPrioFeeLamports: zod_1.z.number().optional().describe('Exact priority fee in lamports'),
});
exports.CancelItemOfferParams = zod_1.z.union([
exports.EvmCancelMultipleItemOfferParamsSchema,
exports.SolanaCancelItemOfferParamsSchema,
]);