import * as mpl_bubblegum_instruction from 'mpl-bubblegum-instruction'; import BN from 'bn.js'; import * as _solana_web3_js from '@solana/web3.js'; import { TransactionSignature, TransactionInstruction, PublicKey, Keypair, Connection, Commitment } from '@solana/web3.js'; import { DataV2 } from '@metaplex-foundation/mpl-token-metadata'; declare const pubKeyNominality: unique symbol; declare const secretNominality: unique symbol; type Pubkey = (string & { [pubKeyNominality]: never; }) | string; type Secret$1 = (string & { [secretNominality]: never; }) | string; type KeypairAccount = { pubkey: Pubkey; secret: Secret$1; }; type OwnerInfo = { sol: number; lamports: number; owner: string; }; type FileType = string | File; type StorageType = 'nftStorage' | 'arweave' | string; type Offchain = { name?: string; symbol?: string; description?: string; seller_fee_basis_points?: number; image?: string; external_url?: string; attributes?: Attribute[]; properties?: Properties; collection?: { name?: string; family?: string; [key: string]: unknown; }; collectionDetails?: { kind: string; size: number; }; created_at?: number; }; type Properties = { creators?: { address?: string; share?: number; [key: string]: unknown; }[]; files?: { type?: string; filePath?: FileType; [key: string]: unknown; }[]; [key: string]: unknown; }; type Attribute = { trait_type?: string; value?: string; [key: string]: unknown; }; type Authority = { address: Pubkey; scopes: string[]; }; type Creators = { address: Pubkey; share: number; verified: boolean; }[]; type Metadata = { mint: Pubkey; collectionMint: Pubkey; authorities: Authority[]; royalty: number; name: string; symbol: string; uri: string; creators: Creators; treeAddress: Pubkey; isCompressed: boolean; isMutable: boolean; isBurn: boolean; editionNonce: number; primarySaleHappened: boolean; dateTime: Date; offchain: Offchain; }; type NftMetadata = { page: number; total: number; limit: number; metadatas: Metadata[]; }; declare enum SortDirection { Asc = "asc", Desc = "desc" } declare enum SortBy { Created = "created", Updated = "updated", Recent = "recent_action" } type Sortable = { sortBy: SortBy; sortDirection: SortDirection; }; type FindOptions = { limit: number; page: number; sortBy: Sortable; before: string; after: string; }; type DelegateOptions = { delegate: Pubkey; }; type MintOptions = { receiver: Pubkey; delegate: Pubkey; feePayer: Secret$1; }; type MintCollectionOptions = { freezeAuthority: Pubkey; feePayer: Secret$1; }; type SpaceOptions = { feePayer: Secret$1; }; type SpaceNumber = 8 | 16000 | 100000 | 16700000 | 67000000 | 1000000000; type bignum = number | BN; declare enum UseMethod { Burn = 0, Multiple = 1, Single = 2 } type Uses = { useMethod: UseMethod; remaining: bignum; total: bignum; }; type InputCreators = { address: Pubkey; secret: Secret$1; share: number; }; type InputCollection = Pubkey; type Options = { [key: string]: unknown; }; type InputNftMetadata = { name: string; symbol: string; royalty?: number; storageType?: StorageType; filePath?: FileType; uri?: string; isMutable?: boolean; description?: string; external_url?: string; attributes?: Attribute[]; properties?: Properties; maxSupply?: bignum; creators?: InputCreators[]; uses?: Uses; collection?: InputCollection; options?: Options; }; declare abstract class AbstractResult { protected abstract _chain(ok: (value: T) => Result, err: (error: E) => Result): Result; unwrap(): T; unwrap(ok: (value: T) => U): U; unwrap(ok: (value: T) => U, err: (error: E) => V): U | V; unwrap(ok: (value: T) => U, err: (error: E) => U): U; map(ok: (value: T) => U): Result; map(ok: (value: T) => U, err: (error: E) => F): Result; chain(ok: (value: T) => Result): Result; chain(ok: (value: T) => Result): Result; chain(ok: (value: T) => Result, err: (error: E) => Result): Result; match(ok: (value: T) => U, err: (error: E) => F): void | Promise; submit(feePayer?: Secret$1): Promise>; } declare global { interface Array { submit(feePayer?: Secret$1): Promise>; } } declare class InternalOk extends AbstractResult { readonly value: T; readonly isOk = true; readonly isErr = false; constructor(value: T); protected _chain(ok: (value: T) => Result, _err: (error: E) => Result): Result; } declare class InternalErr extends AbstractResult { readonly error: E; readonly isOk = false; readonly isErr = true; constructor(error: E); protected _chain(_ok: (value: T) => Result, err: (error: E) => Result): Result; } declare namespace Result { export type Ok = InternalOk; export type Err = InternalErr; export function ok(value: T): Result; export function err(error?: E): Result; type U = Result; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8, R9]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7, R8]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6, R7]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5, R6]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4, R5]): Result<[ OkType, OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3, R4]): Result<[ OkType, OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2, R3]): Result<[ OkType, OkType, OkType, OkType ], ErrType>; export function all(obj: [R0, R1, R2]): Result<[OkType, OkType, OkType], ErrType>; export function all(obj: [R0, R1]): Result<[OkType, OkType], ErrType>; export function all(obj: [R0]): Result<[OkType], ErrType>; export function all(obj: []): Result<[]>; export function all>(obj: T): Result<{ [K in keyof T]: T[K] extends Result ? I : never; }, { [K in keyof T]: T[K] extends Result ? E : never; }[keyof T]>; export {}; } type Result = Result.Ok | Result.Err; type OkType> = R extends Result ? O : never; type ErrType> = R extends Result ? E : never; /** * convert buffer to Array * * @param {Buffer} buffer * @returns number[] */ declare const bufferToArray: (buffer: Buffer) => number[]; /** * Overwrite JS Object * * @param {unknown} object * @param {OverwriteObject[]} targets * @returns Object */ declare const overwriteObject: (object: unknown, targets: { existsKey: string; will: { key: string; value: unknown; }; }[]) => unknown; /** * Display log for solana-suite-config.js * * @param {unknown} data1 * @param {unknown} data2 * @param {unknown} data3 * @param {unknown} data4 * @returns void */ declare const debugLog: (data1: unknown, data2?: unknown, data3?: unknown, data4?: unknown) => void; /** * sleep timer * * @param {number} sec * @returns Promise */ declare const sleep: (sec: number) => Promise; /** * Node.js or Browser js * * @returns boolean */ declare const isBrowser: () => boolean; /** * Node.js or Browser js * * @returns boolean */ declare const isNode: () => boolean; /** * argument is promise or other * * @param {unknown} obj * @returns boolean */ declare const isPromise: (obj: unknown) => obj is Promise; /** * Try async monad * * @returns Promise> */ declare function Try(asyncblock: () => Promise, finallyInput?: () => void): Promise>; declare function Try(block: () => T): Result; /** * argument is promise or other * * @param {number|undefined} created_at * @returns Date | undefined */ declare const convertTimestampToDateTime: (created_at: number | undefined) => Date | undefined; /** * Get unix timestamp * * @returns number */ declare const unixTimestamp: () => number; /** * Get Associated token Account. * if not created, create new token accouint * * @param {Pubkey} mint * @param {Pubkey} owner * @param {Secret} feePayer * @param {boolean} allowOwnerOffCurve * @returns Promise */ declare namespace Account$3 { namespace Associated { /** * Retry function if create new token accouint * * @param {Pubkey} mint * @param {Pubkey} owner * @param {Secret} feePayer * @returns Promise */ const retryGetOrCreate: (mint: Pubkey, owner: Pubkey, feePayer: Secret$1) => Promise; /** * [Main logic]Get Associated token Account. * if not created, create new token accouint * * @param {Pubkey} mint * @param {Pubkey} owner * @param {Pubkey} feePayer * @returns Promise */ const makeOrCreateInstruction: (mint: Pubkey, owner: Pubkey, feePayer?: Pubkey, allowOwnerOffCurve?: boolean) => Promise<{ tokenAccount: string; inst: TransactionInstruction | undefined; }>; } } declare namespace Account$2 { class Keypair { secret: Secret$1; pubkey: Pubkey; constructor(params: { pubkey?: Pubkey; secret: Secret$1; }); toPublicKey(): PublicKey; toKeypair(): Keypair; static isPubkey: (value: string) => value is Pubkey; static isSecret: (value: string) => value is Secret$1; static create: () => Keypair; static toKeyPair: (keypair: Keypair) => Keypair; } } declare namespace Account$1 { namespace Pda { const getMetadata: (address: Pubkey) => PublicKey; const getMasterEdition: (address: Pubkey) => PublicKey; const getTreeAuthority: (address: Pubkey) => PublicKey; const getBgumSigner: () => PublicKey; const getAssetId: (address: Pubkey, leafIndex: number) => Pubkey; } } declare const Account: { Pda: typeof Account$1.Pda; Keypair: typeof Account$2.Keypair; Associated: typeof Account$3.Associated; }; declare namespace Node { const getConnection: () => Connection; const changeConnection: (param: { cluster?: string; commitment?: Commitment; customClusterUrl?: string[]; }) => void; const confirmedSig: (signature: string, commitment?: Commitment) => Promise, Error> | Result.Err<_solana_web3_js.RpcResponseAndContext<_solana_web3_js.SignatureResult>, Error> | Result.Ok | Result.Err>; } type Condition = 'overMax' | 'underMin'; interface Limit { threshold: number; condition: Condition; } interface Details { key: string; message: string; actual: string | number; limit?: Limit; } declare namespace Validator { export namespace Message { const SUCCESS = "success"; const SMALL_NUMBER = "too small"; const BIG_NUMBER = "too big"; const LONG_LENGTH = "too long"; const EMPTY = "invalid empty value"; const INVALID_URL = "invalid url"; const ONLY_NODE_JS = "`string` type is only Node.js"; } export const NAME_LENGTH = 32; export const SYMBOL_LENGTH = 10; export const URL_LENGTH = 200; export const ROYALTY_MAX = 100; export const SELLER_FEE_BASIS_POINTS_MAX = 10000; export const ROYALTY_MIN = 0; export const isRoyalty: (royalty: number) => Result; export const isSellerFeeBasisPoints: (royalty: number) => Result; export const isName: (name: string) => Result; export const isSymbol: (symbol: string) => Result; export const isImageUrl: (image: string) => Result; export const checkAll: (metadata: T) => Result; type PickNftStorage = Pick; type PickNftStorageMetaplex = Pick; type PickMetaplex = Pick; export {}; } declare class ValidatorError extends Error { details: Details[]; constructor(message: string, details: Details[]); } declare global { interface String { toPublicKey(): PublicKey; toKeypair(): Keypair; toExplorerUrl(explorer?: Explorer, options?: ExplorerOptions): string; } interface Number { toSol(): number; toLamports(): number; } interface Console { debug(data: unknown, data2?: unknown, data3?: unknown): void; } interface Secret { toKeypair(): Keypair; } interface Pubkey { toPublicKey(): PublicKey; } } declare enum Explorer { Solscan = "solscan", SolanaFM = "solanafm", Xray = "xray" } type ExplorerOptions = { replacePath: string; }; declare enum FilterType { Memo = "memo", Mint = "mint", OnlyMemo = "only-memo", Transfer = "transfer" } declare enum ModuleName { SolNative = "system", SplToken = "spl-token" } declare const FilterOptions: { Transfer: { program: string[]; action: string[]; }; Memo: { program: string[]; action: string[]; }; Mint: { program: string[]; action: string[]; }; }; type PostTokenAccount = { account: string; owner: string; }; type WithMemo = { sig: string[]; memo: string; }; type Transfer = { parsed: { info: { destination: Pubkey; source: Pubkey; lamports: number; }; type: string; }; program: string; programId?: PublicKey; }; type MintTo = { parsed: { info: { account: Pubkey; mint: Pubkey; mintAuthority: Pubkey; tokenAmount: string; }; type: string; }; program: string; programId?: PublicKey; }; type MintToChecked = MintTo; type TransferChecked = { parsed: { info: { destination: Pubkey; mint: Pubkey; multisigAuthority: Pubkey; signers: Pubkey[]; source: Pubkey; tokenAmount: string; }; type: string; }; program: string; programId?: PublicKey; }; type Memo = { parsed: string; program: string; programId: PublicKey; }; type CommonStructure = { instructions: TransactionInstruction[]; signers: Keypair[]; feePayer?: Keypair; canSubmit?: boolean; data?: T; submit: () => Promise>; }; type MintStructure = { instructions: TransactionInstruction[]; signers: Keypair[]; data: T; feePayer: Keypair; canSubmit?: boolean; submit: () => Promise>; }; type PartialSignStructure = { hexInstruction: string; canSubmit?: boolean; data?: T; submit: (feePayer: Secret$1) => Promise>; }; declare namespace CompressedNft$1 { class Space { spaceOwner: Pubkey; constructor(spaceOwner: Pubkey); getAssetId: () => Promise; } /** * create a new markle tree * This function needs only 1 call * * @param {Secret} owner * @param {number} maxDepth * @param {number} maxBufferSize * @param {number} canopyDepth * @param {Partial} options * @return Promise> */ const initSpace: (owner: Secret, maxDepth: number, maxBufferSize: number, canopyDepth: number, options?: Partial) => Promise>; /** * create a new nft space * This function needs only 1 call * * @param {Secret} owner * @param {SpaceNumber} spaceSize * @param {Partial} options * * @return Promise> */ const createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial) => Promise>; /** * Calculate space cost * * @param {number} spaceSize * @return Promise<{sol: number}> */ const calculateSpaceCost: (spaceSize: number) => Promise<{ sol: number; }>; } declare const CompressedNft: { createTransfer: (assetId: Pubkey, assetIdOwner: Pubkey, dest: Pubkey, delegate?: Pubkey | undefined) => Promise<_solana_web3_js.TransactionInstruction>; transfer: (mint: Pubkey, owner: Pubkey, dest: Pubkey, ownerOrMultisig: Secret[]) => Promise>; mintCollection: (owner: Secret$1, input: InputNftMetadata, options?: Partial) => Promise>; Space: typeof CompressedNft$1.Space; initSpace: (owner: Secret, maxDepth: number, maxBufferSize: number, canopyDepth: number, options?: Partial) => Promise>; createSpace: (owner: Secret, spaceSize: SpaceNumber, options?: Partial) => Promise>; calculateSpaceCost: (spaceSize: number) => Promise<{ sol: number; }>; createVerifyCreator: (creators: mpl_bubblegum_instruction.Creator[], assetId: _solana_web3_js.PublicKey, treeOwner: _solana_web3_js.PublicKey, metadata: mpl_bubblegum_instruction.MetadataArgs, feePayer: _solana_web3_js.PublicKey) => Promise<_solana_web3_js.TransactionInstruction>; mint: (owner: Secret$1, input: InputNftMetadata, treeOwner: Pubkey, collectionMint: Pubkey, options?: Partial) => Promise, Error>>; gasLessTransfer: (mint: Pubkey, owner: Secret$1, dest: Pubkey, feePayer: Pubkey) => Promise[]>; gasLessDelegate: (mint: Pubkey, owner: Secret$1, newDelegate: Pubkey) => Promise>; findByOwner: (owner: Pubkey, options?: Partial) => Promise>; findByMint: (mint: Pubkey) => Promise, Error>>; findByCollection: (collectionMint: Pubkey, options?: Partial) => Promise>; createDeleagate: (assetId: _solana_web3_js.PublicKey, newDelegate: _solana_web3_js.PublicKey | null) => Promise<_solana_web3_js.TransactionInstruction>; setDelegate: (mint: Pubkey, owner: Secret$1, options?: Partial) => Promise>; }; export { Account, CompressedNft, Explorer, ExplorerOptions, FilterOptions, FilterType, KeypairAccount, Memo, MintTo, MintToChecked, ModuleName, Node, OwnerInfo, PostTokenAccount, Pubkey, Secret$1 as Secret, Transfer, TransferChecked, Try, Validator, ValidatorError, WithMemo, bufferToArray, convertTimestampToDateTime, debugLog, isBrowser, isNode, isPromise, overwriteObject, sleep, unixTimestamp };