import { TransactionSignature, PublicKey, Transaction, Keypair } from '@solana/web3.js'; import BN from 'bn.js'; declare const pubKeyNominality: unique symbol; declare const secretNominality: unique symbol; type Pubkey = (string & { [pubKeyNominality]: never; }) | string; type Secret = (string & { [secretNominality]: never; }) | string; 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): Promise>; } declare global { interface Array { submit(feePayer?: Secret): 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; 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; share: number; }; type PhantomProvider = { isPhantom?: boolean; publicKey: PublicKey | null; signTransaction(transaction: Transaction): Promise; signAllTransactions(transactions: Transaction[]): Promise; signMessage(message: Uint8Array): Promise; connect(): Promise; disconnect(): Promise; }; type FileType = string | File; type UploadableFileType = string & File; type Identity = Secret | PhantomProvider; type Tags = [{ name: string; value: string; }]; 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 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 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 namespace Arweave { const uploadFile: (filePath: FileType, feePayer: Secret) => Promise>; const uploadData: (metadata: Offchain, feePayer: Secret) => Promise>; } declare namespace ProvenanceLayer { const uploadFile: (uploadFile: FileType, identity: Identity, tags?: Tags) => Promise; const uploadData: (data: string, identity: Identity, tags?: Tags) => Promise; const isNodeable: (value: unknown) => value is string; const isBrowserable: (value: unknown) => value is File; const isUploadable: (value: unknown) => value is UploadableFileType; } declare namespace NftStorage { const uploadFile: (fileType: FileType) => Promise>; /** * Upload content * * @param {Offchain} storageData * { * name?: {string} // nft content name * symbol?: {string} // nft ticker symbol * description?: {string} // nft content description * sellerFeeBasisPoints?: number // royalty percentage * image?: {string} // uploaded uri of original content * external_url?: {string} // landing page, home page uri, related url * attributes?: {JsonMetadataAttribute[]} // game character parameter, personality, characteristics * properties?: {JsonMetadataProperties} // included file name, uri, supported file type * collection?: Collection // collections of different colors, shapes, etc. * [key: string]: {unknown} // optional param, Usually not used. * } * @return Promise> */ const uploadData: (storageData: Offchain) => Promise>; } declare namespace Storage { const toConvertOffchaindata: (input: InputNftMetadata, sellerFeeBasisPoints: number) => Offchain; const uploadFile: (filePath: FileType, storageType: StorageType, feePayer?: Secret) => Promise>; const uploadData: (input: Offchain, storageType: StorageType, feePayer?: Secret) => Promise>; const upload: (input: Offchain, filePath: FileType, storageType: StorageType, feePayer?: Secret) => Promise>; } export { Arweave, NftStorage, ProvenanceLayer, Storage };