@magiceden/magiceden-sdk
Version:
A TypeScript SDK for interacting with Magic Eden's API across multiple chains.
58 lines (57 loc) • 2.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransferParams = exports.SolanaTransferParamsSchema = exports.EvmMultipleTransferParamsSchema = exports.EvmTransferParamsSchema = exports.BaseTransferParamsSchema = void 0;
const zod_1 = require("zod");
const chains_1 = require("../../chains");
/**
* Parameters for transferring an NFT
*/
exports.BaseTransferParamsSchema = zod_1.z.object({
/**
* The NFT token
*
* - For EVM, the token is in the format of contractAddress:tokenId
* - For Solana, the token is the mint address
*/
token: zod_1.z
.string()
.describe('The NFT token in the format of contractAddress:tokenId for EVM and <mint address> for Solana'),
});
exports.EvmTransferParamsSchema = exports.BaseTransferParamsSchema.extend({
/**
* The number of NFTs to transfer
*/
quantity: zod_1.z.number().optional().describe('The quantity of NFTs to transfer'),
});
exports.EvmMultipleTransferParamsSchema = zod_1.z.object({
/**
* The EVM chain to transfer the NFT on
*/
chain: chains_1.ZodEvmBlockchain.describe('The chain to transfer the NFT on'),
/**
* The recipient's wallet address
*/
to: zod_1.z.string().describe("The recipient's wallet address"),
/**
* The items (NFTs) to transfer
*/
items: zod_1.z.array(exports.EvmTransferParamsSchema).describe('The transfer parameters'),
});
exports.SolanaTransferParamsSchema = exports.BaseTransferParamsSchema.extend({
/**
* The recipient's wallet address
*/
to: zod_1.z.string().describe("The recipient's wallet address"),
/**
* Whether the NFT is a compressed NFT
*/
isCompressed: zod_1.z.boolean().optional().describe('Whether the NFT is a compressed NFT'),
/**
* The priority fee in micro lamports
*/
priorityFee: zod_1.z.number().optional().describe('The priority fee in micro lamports'),
});
exports.TransferParams = zod_1.z.union([
exports.EvmMultipleTransferParamsSchema,
exports.SolanaTransferParamsSchema,
]);