UNPKG

@magiceden/magiceden-sdk

Version:

A TypeScript SDK for interacting with Magic Eden's API across multiple chains.

331 lines (330 loc) 11.7 kB
import { z } from 'zod'; import { SplAmount } from '../../solana'; /** * Parameters for buying an NFT */ export declare const BaseBuyParamsSchema: 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; }, "strip", z.ZodTypeAny, { token: string; }, { token: string; }>; export declare const EvmBuyParamsSchema: 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 collection to buy */ collection: z.ZodOptional<z.ZodString>; /** * The number of NFTs to buy */ quantity: z.ZodOptional<z.ZodNumber>; /** * The order id to fill */ orderId: z.ZodOptional<z.ZodString>; }>, "strip", z.ZodTypeAny, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }>; export declare const EvmMultipleBuyParamsSchema: z.ZodObject<{ /** * The EVM chain to buy 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 currency to use for the purchase */ currency: z.ZodOptional<z.ZodString>; /** * The chain id of the currency */ currencyChainId: z.ZodOptional<z.ZodNumber>; /** * The buy parameters */ items: 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 collection to buy */ collection: z.ZodOptional<z.ZodString>; /** * The number of NFTs to buy */ quantity: z.ZodOptional<z.ZodNumber>; /** * The order id to fill */ orderId: z.ZodOptional<z.ZodString>; }>, "strip", z.ZodTypeAny, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | 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; items: { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }[]; currency?: string | undefined; currencyChainId?: number | 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; items: { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }[]; currency?: string | undefined; currencyChainId?: number | undefined; }>; export declare const SolanaBuyParamsSchema: 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 seller's wallet address */ seller: z.ZodString; /** * The purchase price */ price: z.ZodString; /** * 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>; /** * The seller referral address */ sellerReferral: z.ZodOptional<z.ZodString>; /** * The buyer expiry timestamp */ buyerExpiry: z.ZodOptional<z.ZodNumber>; /** * The seller expiry timestamp */ sellerExpiry: z.ZodOptional<z.ZodNumber>; /** * The buyer creator royalty percentage */ buyerCreatorRoyaltyPercent: z.ZodOptional<z.ZodNumber>; /** * The SPL token price details */ splPrice: z.ZodOptional<z.ZodType<SplAmount, z.ZodTypeDef, SplAmount>>; }>, "strip", z.ZodTypeAny, { price: string; token: string; seller: string; auctionHouseAddress?: string | undefined; splPrice?: SplAmount | undefined; sellerReferral?: string | undefined; buyerReferral?: string | undefined; buyerCreatorRoyaltyPercent?: number | undefined; buyerExpiry?: number | undefined; sellerExpiry?: number | undefined; }, { price: string; token: string; seller: string; auctionHouseAddress?: string | undefined; splPrice?: SplAmount | undefined; sellerReferral?: string | undefined; buyerReferral?: string | undefined; buyerCreatorRoyaltyPercent?: number | undefined; buyerExpiry?: number | undefined; sellerExpiry?: number | undefined; }>; export type EvmBuyParams = z.infer<typeof EvmMultipleBuyParamsSchema>; export type SolanaBuyParams = z.infer<typeof SolanaBuyParamsSchema>; export declare const BuyParams: z.ZodUnion<[z.ZodObject<{ /** * The EVM chain to buy 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 currency to use for the purchase */ currency: z.ZodOptional<z.ZodString>; /** * The chain id of the currency */ currencyChainId: z.ZodOptional<z.ZodNumber>; /** * The buy parameters */ items: 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 collection to buy */ collection: z.ZodOptional<z.ZodString>; /** * The number of NFTs to buy */ quantity: z.ZodOptional<z.ZodNumber>; /** * The order id to fill */ orderId: z.ZodOptional<z.ZodString>; }>, "strip", z.ZodTypeAny, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }, { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | 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; items: { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }[]; currency?: string | undefined; currencyChainId?: number | 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; items: { token: string; quantity?: number | undefined; orderId?: string | undefined; collection?: string | undefined; }[]; currency?: string | undefined; currencyChainId?: number | 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 seller's wallet address */ seller: z.ZodString; /** * The purchase price */ price: z.ZodString; /** * 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>; /** * The seller referral address */ sellerReferral: z.ZodOptional<z.ZodString>; /** * The buyer expiry timestamp */ buyerExpiry: z.ZodOptional<z.ZodNumber>; /** * The seller expiry timestamp */ sellerExpiry: z.ZodOptional<z.ZodNumber>; /** * The buyer creator royalty percentage */ buyerCreatorRoyaltyPercent: z.ZodOptional<z.ZodNumber>; /** * The SPL token price details */ splPrice: z.ZodOptional<z.ZodType<SplAmount, z.ZodTypeDef, SplAmount>>; }>, "strip", z.ZodTypeAny, { price: string; token: string; seller: string; auctionHouseAddress?: string | undefined; splPrice?: SplAmount | undefined; sellerReferral?: string | undefined; buyerReferral?: string | undefined; buyerCreatorRoyaltyPercent?: number | undefined; buyerExpiry?: number | undefined; sellerExpiry?: number | undefined; }, { price: string; token: string; seller: string; auctionHouseAddress?: string | undefined; splPrice?: SplAmount | undefined; sellerReferral?: string | undefined; buyerReferral?: string | undefined; buyerCreatorRoyaltyPercent?: number | undefined; buyerExpiry?: number | undefined; sellerExpiry?: number | undefined; }>]>; export type BuyParams = z.infer<typeof BuyParams>;