@magiceden/magiceden-sdk
Version:
A TypeScript SDK for interacting with Magic Eden's API across multiple chains.
402 lines (401 loc) • 14.7 kB
TypeScript
import { z } from 'zod';
/**
* Parameters for making an offer on an NFT
*/
export declare const BaseMakeItemOfferParamsSchema: z.ZodObject<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
price: string;
token: string;
expiry?: number | undefined;
}, {
price: string;
token: string;
expiry?: number | undefined;
}>;
export declare const EvmMakeItemOfferParamsSchema: z.ZodObject<z.objectUtil.extendShape<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, {
/**
* The number of NFTs to bid on
*/
quantity: z.ZodOptional<z.ZodNumber>;
/**
* Whether to automatically set royalty amounts and recipients
*/
automatedRoyalties: z.ZodOptional<z.ZodBoolean>;
/**
* The maximum amount of royalties to pay in basis points (1 BPS = 0.01%)
*/
royaltyBps: z.ZodOptional<z.ZodNumber>;
/**
* The currency address for the offer
*/
currency: z.ZodOptional<z.ZodString>;
}>, "strip", z.ZodTypeAny, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}>;
export declare const EvmMultipleMakeItemOfferParamsSchema: z.ZodObject<{
/**
* The EVM chain to make the offer on
*/
chain: z.ZodEnum<[import("../../chains").Blockchain.ETHEREUM, import("../../chains").Blockchain.BASE, import("../../chains").Blockchain.POLYGON, import("../../chains").Blockchain.SEI, import("../../chains").Blockchain.ARBITRUM, import("../../chains").Blockchain.APECHAIN, import("../../chains").Blockchain.BERACHAIN, import("../../chains").Blockchain.MONAD_TESTNET, import("../../chains").Blockchain.BSC, import("../../chains").Blockchain.ABSTRACT]>;
/**
* The make item offer parameters
*/
params: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, {
/**
* The number of NFTs to bid on
*/
quantity: z.ZodOptional<z.ZodNumber>;
/**
* Whether to automatically set royalty amounts and recipients
*/
automatedRoyalties: z.ZodOptional<z.ZodBoolean>;
/**
* The maximum amount of royalties to pay in basis points (1 BPS = 0.01%)
*/
royaltyBps: z.ZodOptional<z.ZodNumber>;
/**
* The currency address for the offer
*/
currency: z.ZodOptional<z.ZodString>;
}>, "strip", z.ZodTypeAny, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
chain: import("../../chains").Blockchain.ETHEREUM | import("../../chains").Blockchain.POLYGON | import("../../chains").Blockchain.BASE | import("../../chains").Blockchain.SEI | import("../../chains").Blockchain.ARBITRUM | import("../../chains").Blockchain.APECHAIN | import("../../chains").Blockchain.BERACHAIN | import("../../chains").Blockchain.MONAD_TESTNET | import("../../chains").Blockchain.BSC | import("../../chains").Blockchain.ABSTRACT;
params: {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}[];
}, {
chain: import("../../chains").Blockchain.ETHEREUM | import("../../chains").Blockchain.POLYGON | import("../../chains").Blockchain.BASE | import("../../chains").Blockchain.SEI | import("../../chains").Blockchain.ARBITRUM | import("../../chains").Blockchain.APECHAIN | import("../../chains").Blockchain.BERACHAIN | import("../../chains").Blockchain.MONAD_TESTNET | import("../../chains").Blockchain.BSC | import("../../chains").Blockchain.ABSTRACT;
params: {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}[];
}>;
export declare const SolanaMakeItemOfferParamsSchema: z.ZodObject<z.objectUtil.extendShape<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, {
/**
* The auction house address
*
* @default AUCTION_HOUSE_ADDRESS (found in constants/solana/marketplace.ts)
*/
auctionHouseAddress: z.ZodOptional<z.ZodString>;
/**
* The buyer referral address
*/
buyerReferral: z.ZodOptional<z.ZodString>;
/**
* Whether to use buy v2
*/
useBuyV2: z.ZodOptional<z.ZodBoolean>;
/**
* The buyer creator royalty percentage
*/
buyerCreatorRoyaltyPercent: z.ZodOptional<z.ZodNumber>;
/**
* The priority fee in micro lamports
*/
prioFeeMicroLamports: z.ZodOptional<z.ZodNumber>;
/**
* The maximum priority fee in lamports
*/
maxPrioFeeLamports: z.ZodOptional<z.ZodNumber>;
/**
* The exact priority fee in lamports
*/
exactPrioFeeLamports: z.ZodOptional<z.ZodNumber>;
}>, "strip", z.ZodTypeAny, {
price: string;
token: string;
expiry?: number | undefined;
auctionHouseAddress?: string | undefined;
prioFeeMicroLamports?: number | undefined;
maxPrioFeeLamports?: number | undefined;
exactPrioFeeLamports?: number | undefined;
buyerReferral?: string | undefined;
useBuyV2?: boolean | undefined;
buyerCreatorRoyaltyPercent?: number | undefined;
}, {
price: string;
token: string;
expiry?: number | undefined;
auctionHouseAddress?: string | undefined;
prioFeeMicroLamports?: number | undefined;
maxPrioFeeLamports?: number | undefined;
exactPrioFeeLamports?: number | undefined;
buyerReferral?: string | undefined;
useBuyV2?: boolean | undefined;
buyerCreatorRoyaltyPercent?: number | undefined;
}>;
export type EvmMakeItemOfferParams = z.infer<typeof EvmMultipleMakeItemOfferParamsSchema>;
export type SolanaMakeItemOfferParams = z.infer<typeof SolanaMakeItemOfferParamsSchema>;
export declare const MakeItemOfferParams: z.ZodUnion<[z.ZodObject<{
/**
* The EVM chain to make the offer on
*/
chain: z.ZodEnum<[import("../../chains").Blockchain.ETHEREUM, import("../../chains").Blockchain.BASE, import("../../chains").Blockchain.POLYGON, import("../../chains").Blockchain.SEI, import("../../chains").Blockchain.ARBITRUM, import("../../chains").Blockchain.APECHAIN, import("../../chains").Blockchain.BERACHAIN, import("../../chains").Blockchain.MONAD_TESTNET, import("../../chains").Blockchain.BSC, import("../../chains").Blockchain.ABSTRACT]>;
/**
* The make item offer parameters
*/
params: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, {
/**
* The number of NFTs to bid on
*/
quantity: z.ZodOptional<z.ZodNumber>;
/**
* Whether to automatically set royalty amounts and recipients
*/
automatedRoyalties: z.ZodOptional<z.ZodBoolean>;
/**
* The maximum amount of royalties to pay in basis points (1 BPS = 0.01%)
*/
royaltyBps: z.ZodOptional<z.ZodNumber>;
/**
* The currency address for the offer
*/
currency: z.ZodOptional<z.ZodString>;
}>, "strip", z.ZodTypeAny, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}, {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
chain: import("../../chains").Blockchain.ETHEREUM | import("../../chains").Blockchain.POLYGON | import("../../chains").Blockchain.BASE | import("../../chains").Blockchain.SEI | import("../../chains").Blockchain.ARBITRUM | import("../../chains").Blockchain.APECHAIN | import("../../chains").Blockchain.BERACHAIN | import("../../chains").Blockchain.MONAD_TESTNET | import("../../chains").Blockchain.BSC | import("../../chains").Blockchain.ABSTRACT;
params: {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}[];
}, {
chain: import("../../chains").Blockchain.ETHEREUM | import("../../chains").Blockchain.POLYGON | import("../../chains").Blockchain.BASE | import("../../chains").Blockchain.SEI | import("../../chains").Blockchain.ARBITRUM | import("../../chains").Blockchain.APECHAIN | import("../../chains").Blockchain.BERACHAIN | import("../../chains").Blockchain.MONAD_TESTNET | import("../../chains").Blockchain.BSC | import("../../chains").Blockchain.ABSTRACT;
params: {
price: string;
token: string;
currency?: string | undefined;
royaltyBps?: number | undefined;
expiry?: number | undefined;
quantity?: number | undefined;
automatedRoyalties?: boolean | undefined;
}[];
}>, z.ZodObject<z.objectUtil.extendShape<{
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: z.ZodString;
/**
* The listing price
*
* - For EVM, the price is in the smallest unit of the token (e.g. Wei for ETH)
* - For Solana, the price is in lamports
*/
price: z.ZodString;
/**
* The offer expiry timestamp
*/
expiry: z.ZodOptional<z.ZodNumber>;
}, {
/**
* The auction house address
*
* @default AUCTION_HOUSE_ADDRESS (found in constants/solana/marketplace.ts)
*/
auctionHouseAddress: z.ZodOptional<z.ZodString>;
/**
* The buyer referral address
*/
buyerReferral: z.ZodOptional<z.ZodString>;
/**
* Whether to use buy v2
*/
useBuyV2: z.ZodOptional<z.ZodBoolean>;
/**
* The buyer creator royalty percentage
*/
buyerCreatorRoyaltyPercent: z.ZodOptional<z.ZodNumber>;
/**
* The priority fee in micro lamports
*/
prioFeeMicroLamports: z.ZodOptional<z.ZodNumber>;
/**
* The maximum priority fee in lamports
*/
maxPrioFeeLamports: z.ZodOptional<z.ZodNumber>;
/**
* The exact priority fee in lamports
*/
exactPrioFeeLamports: z.ZodOptional<z.ZodNumber>;
}>, "strip", z.ZodTypeAny, {
price: string;
token: string;
expiry?: number | undefined;
auctionHouseAddress?: string | undefined;
prioFeeMicroLamports?: number | undefined;
maxPrioFeeLamports?: number | undefined;
exactPrioFeeLamports?: number | undefined;
buyerReferral?: string | undefined;
useBuyV2?: boolean | undefined;
buyerCreatorRoyaltyPercent?: number | undefined;
}, {
price: string;
token: string;
expiry?: number | undefined;
auctionHouseAddress?: string | undefined;
prioFeeMicroLamports?: number | undefined;
maxPrioFeeLamports?: number | undefined;
exactPrioFeeLamports?: number | undefined;
buyerReferral?: string | undefined;
useBuyV2?: boolean | undefined;
buyerCreatorRoyaltyPercent?: number | undefined;
}>]>;
export type MakeItemOfferParams = z.infer<typeof MakeItemOfferParams>;