import * as _solana_kit from '@solana/kit'; import { Address, FixedSizeEncoder, FixedSizeDecoder, FixedSizeCodec, Encoder, Decoder, Codec, Option, OptionOrNullable, ReadonlyUint8Array, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableSignerAccount, AccountSignerMeta, WritableAccount, ReadonlyAccount, TransactionSigner, KeyPairSigner, SignatureBytes, BaseTransactionMessage, TransactionMessageWithFeePayer, Signature, Commitment } from '@solana/kit'; import * as anchor from '@coral-xyz/anchor'; import BN from 'bn.js'; import * as _solana_program_compute_budget from '@solana-program/compute-budget'; import { estimateComputeUnitLimitFactory } from '@solana-program/compute-budget'; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type BuyArgs = { configId: number; campaignId: number; buyer: Address; }; type BuyArgsArgs = BuyArgs; declare function getBuyArgsEncoder(): FixedSizeEncoder; declare function getBuyArgsDecoder(): FixedSizeDecoder; declare function getBuyArgsCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type BuyEvent = { buyer: Address; paymentDestination: Address; campaign: Address; config: Address; amount: bigint; totalLamports: bigint; mint: Address; associatedTokenAccount: Address; metadata: Address; edition: Address; }; type BuyEventArgs = { buyer: Address; paymentDestination: Address; campaign: Address; config: Address; amount: number | bigint; totalLamports: number | bigint; mint: Address; associatedTokenAccount: Address; metadata: Address; edition: Address; }; declare function getBuyEventEncoder(): FixedSizeEncoder; declare function getBuyEventDecoder(): FixedSizeDecoder; declare function getBuyEventCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type CreateCampaignArgs = { configId: number; campaignId: number; stages: Array; priceInLamports: bigint; paymentDestination: Address; itemsAvailable: bigint; maxItemsPerUser: bigint; campaignMetadata: Metadata; itemMetadata: Metadata; }; type CreateCampaignArgsArgs = { configId: number; campaignId: number; stages: Array; priceInLamports: number | bigint; paymentDestination: Address; itemsAvailable: number | bigint; maxItemsPerUser: number | bigint; campaignMetadata: MetadataArgs; itemMetadata: MetadataArgs; }; declare function getCreateCampaignArgsEncoder(): Encoder; declare function getCreateCampaignArgsDecoder(): Decoder; declare function getCreateCampaignArgsCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type CreateCampaignEvent = { campaignId: number; campaign: Address; config: Address; stages: Array; priceInLamports: bigint; paymentDestination: Address; itemsAvailable: bigint; maxItemsPerUser: bigint; campaignMetadata: Metadata; itemMetadata: Metadata; }; type CreateCampaignEventArgs = { campaignId: number; campaign: Address; config: Address; stages: Array; priceInLamports: number | bigint; paymentDestination: Address; itemsAvailable: number | bigint; maxItemsPerUser: number | bigint; campaignMetadata: MetadataArgs; itemMetadata: MetadataArgs; }; declare function getCreateCampaignEventEncoder(): Encoder; declare function getCreateCampaignEventDecoder(): Decoder; declare function getCreateCampaignEventCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type GrantRoleArgs = { configId: number; accountToGrant: Address; role: Role; }; type GrantRoleArgsArgs = { configId: number; accountToGrant: Address; role: RoleArgs; }; declare function getGrantRoleArgsEncoder(): FixedSizeEncoder; declare function getGrantRoleArgsDecoder(): FixedSizeDecoder; declare function getGrantRoleArgsCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type GrantRoleEvent = { role: Role; account: Address; }; type GrantRoleEventArgs = { role: RoleArgs; account: Address; }; declare function getGrantRoleEventEncoder(): FixedSizeEncoder; declare function getGrantRoleEventDecoder(): FixedSizeDecoder; declare function getGrantRoleEventCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type InitializeConfigArgs = { id: number; }; type InitializeConfigArgsArgs = InitializeConfigArgs; declare function getInitializeConfigArgsEncoder(): FixedSizeEncoder; declare function getInitializeConfigArgsDecoder(): FixedSizeDecoder; declare function getInitializeConfigArgsCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type InitializeEvent = { configId: number; config: Address; nftAuthority: Address; }; type InitializeEventArgs = InitializeEvent; declare function getInitializeEventEncoder(): FixedSizeEncoder; declare function getInitializeEventDecoder(): FixedSizeDecoder; declare function getInitializeEventCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type Metadata = { name: string; symbol: string; uri: string; }; type MetadataArgs = Metadata; declare function getMetadataEncoder(): Encoder; declare function getMetadataDecoder(): Decoder; declare function getMetadataCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type RevokeRoleArgs = { configId: number; accountToRevoke: Address; role: Role; }; type RevokeRoleArgsArgs = { configId: number; accountToRevoke: Address; role: RoleArgs; }; declare function getRevokeRoleArgsEncoder(): FixedSizeEncoder; declare function getRevokeRoleArgsDecoder(): FixedSizeDecoder; declare function getRevokeRoleArgsCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type RevokeRoleEvent = { role: Role; account: Address; }; type RevokeRoleEventArgs = { role: RoleArgs; account: Address; }; declare function getRevokeRoleEventEncoder(): FixedSizeEncoder; declare function getRevokeRoleEventDecoder(): FixedSizeDecoder; declare function getRevokeRoleEventCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare enum Role { Admin = 0, Operator = 1 } type RoleArgs = Role; declare function getRoleEncoder(): FixedSizeEncoder; declare function getRoleDecoder(): FixedSizeDecoder; declare function getRoleCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type Stage = { startTime: bigint; endTime: bigint; maxItemsPerUser: bigint; itemsAvailable: bigint; itemsPurchased: bigint; }; type StageArgs = { startTime: number | bigint; endTime: number | bigint; maxItemsPerUser: number | bigint; itemsAvailable: number | bigint; itemsPurchased: number | bigint; }; declare function getStageEncoder(): FixedSizeEncoder; declare function getStageDecoder(): FixedSizeDecoder; declare function getStageCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare enum Status { Active = 0, Inactive = 1 } type StatusArgs = Status; declare function getStatusEncoder(): FixedSizeEncoder; declare function getStatusDecoder(): FixedSizeDecoder; declare function getStatusCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateCampaignArgs = { campaignId: number; configId: number; stages: Option>; status: Option; priceInLamports: Option; paymentDestination: Option
; itemsAvailable: Option; maxItemsPerUser: Option; }; type UpdateCampaignArgsArgs = { campaignId: number; configId: number; stages: OptionOrNullable>; status: OptionOrNullable; priceInLamports: OptionOrNullable; paymentDestination: OptionOrNullable
; itemsAvailable: OptionOrNullable; maxItemsPerUser: OptionOrNullable; }; declare function getUpdateCampaignArgsEncoder(): Encoder; declare function getUpdateCampaignArgsDecoder(): Decoder; declare function getUpdateCampaignArgsCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateCampaignEvent = { campaignId: number; campaign: Address; config: Address; status: Status; stages: Array; priceInLamports: bigint; paymentDestination: Address; itemsAvailable: bigint; maxItemsPerUser: bigint; }; type UpdateCampaignEventArgs = { campaignId: number; campaign: Address; config: Address; status: StatusArgs; stages: Array; priceInLamports: number | bigint; paymentDestination: Address; itemsAvailable: number | bigint; maxItemsPerUser: number | bigint; }; declare function getUpdateCampaignEventEncoder(): Encoder; declare function getUpdateCampaignEventDecoder(): Decoder; declare function getUpdateCampaignEventCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateCampaignMetadataArgs = { campaignId: number; configId: number; campaignMetadata: Metadata; itemMetadata: Option; mintAccount: Address; }; type UpdateCampaignMetadataArgsArgs = { campaignId: number; configId: number; campaignMetadata: MetadataArgs; itemMetadata: OptionOrNullable; mintAccount: Address; }; declare function getUpdateCampaignMetadataArgsEncoder(): Encoder; declare function getUpdateCampaignMetadataArgsDecoder(): Decoder; declare function getUpdateCampaignMetadataArgsCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateCampaignMetadataEvent = { campaignId: number; campaign: Address; config: Address; oldCampaignMetadata: Metadata; oldItemMetadata: Metadata; newCampaignMetadata: Metadata; newItemMetadata: Metadata; }; type UpdateCampaignMetadataEventArgs = { campaignId: number; campaign: Address; config: Address; oldCampaignMetadata: MetadataArgs; oldItemMetadata: MetadataArgs; newCampaignMetadata: MetadataArgs; newItemMetadata: MetadataArgs; }; declare function getUpdateCampaignMetadataEventEncoder(): Encoder; declare function getUpdateCampaignMetadataEventDecoder(): Decoder; declare function getUpdateCampaignMetadataEventCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateConfigArgs = { configId: number; status: Option; }; type UpdateConfigArgsArgs = { configId: number; status: OptionOrNullable; }; declare function getUpdateConfigArgsEncoder(): Encoder; declare function getUpdateConfigArgsDecoder(): Decoder; declare function getUpdateConfigArgsCodec(): Codec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ type UpdateConfigEvent = { configId: number; config: Address; status: Status; }; type UpdateConfigEventArgs = { configId: number; config: Address; status: StatusArgs; }; declare function getUpdateConfigEventEncoder(): FixedSizeEncoder; declare function getUpdateConfigEventDecoder(): FixedSizeDecoder; declare function getUpdateConfigEventCodec(): FixedSizeCodec; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const CAMPAIGN_DISCRIMINATOR: Uint8Array; declare function getCampaignDiscriminatorBytes(): ReadonlyUint8Array; type Campaign = { discriminator: ReadonlyUint8Array; id: number; stages: Array; status: Status; priceInLamports: bigint; paymentDestination: Address; itemIds: ReadonlyUint8Array; itemsAvailable: bigint; itemsPurchased: bigint; itemsClaimed: bigint; maxItemsPerUser: bigint; metadata: Metadata; collection: Address; itemMetadata: Metadata; bump: number; }; type CampaignArgs = { id: number; stages: Array; status: StatusArgs; priceInLamports: number | bigint; paymentDestination: Address; itemIds: ReadonlyUint8Array; itemsAvailable: number | bigint; itemsPurchased: number | bigint; itemsClaimed: number | bigint; maxItemsPerUser: number | bigint; metadata: MetadataArgs; collection: Address; itemMetadata: MetadataArgs; bump: number; }; declare function getCampaignEncoder(): Encoder; declare function getCampaignDecoder(): Decoder; declare function getCampaignCodec(): Codec; declare function decodeCampaign(encodedAccount: EncodedAccount): Account; declare function decodeCampaign(encodedAccount: MaybeEncodedAccount): MaybeAccount; declare function fetchCampaign(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchMaybeCampaign(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchAllCampaign(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; declare function fetchAllMaybeCampaign(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const CAPABILITY_DISCRIMINATOR: Uint8Array; declare function getCapabilityDiscriminatorBytes(): ReadonlyUint8Array; type Capability = { discriminator: ReadonlyUint8Array; account: Address; role: Role; bump: number; }; type CapabilityArgs = { account: Address; role: RoleArgs; bump: number; }; declare function getCapabilityEncoder(): FixedSizeEncoder; declare function getCapabilityDecoder(): FixedSizeDecoder; declare function getCapabilityCodec(): FixedSizeCodec; declare function decodeCapability(encodedAccount: EncodedAccount): Account; declare function decodeCapability(encodedAccount: MaybeEncodedAccount): MaybeAccount; declare function fetchCapability(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchMaybeCapability(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchAllCapability(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; declare function fetchAllMaybeCapability(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const CONFIG_DISCRIMINATOR: Uint8Array; declare function getConfigDiscriminatorBytes(): ReadonlyUint8Array; type Config = { discriminator: ReadonlyUint8Array; id: number; activeCampaignIds: ReadonlyUint8Array; status: Status; bump: number; }; type ConfigArgs = { id: number; activeCampaignIds: ReadonlyUint8Array; status: StatusArgs; bump: number; }; declare function getConfigEncoder(): Encoder; declare function getConfigDecoder(): Decoder; declare function getConfigCodec(): Codec; declare function decodeConfig(encodedAccount: EncodedAccount): Account; declare function decodeConfig(encodedAccount: MaybeEncodedAccount): MaybeAccount; declare function fetchConfig(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchMaybeConfig(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchAllConfig(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; declare function fetchAllMaybeConfig(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const NFT_AUTHORITY_DISCRIMINATOR: Uint8Array; declare function getNftAuthorityDiscriminatorBytes(): ReadonlyUint8Array; type NftAuthority = { discriminator: ReadonlyUint8Array; bump: number; }; type NftAuthorityArgs = { bump: number; }; declare function getNftAuthorityEncoder(): FixedSizeEncoder; declare function getNftAuthorityDecoder(): FixedSizeDecoder; declare function getNftAuthorityCodec(): FixedSizeCodec; declare function decodeNftAuthority(encodedAccount: EncodedAccount): Account; declare function decodeNftAuthority(encodedAccount: MaybeEncodedAccount): MaybeAccount; declare function fetchNftAuthority(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchMaybeNftAuthority(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchAllNftAuthority(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; declare function fetchAllMaybeNftAuthority(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const USER_DISCRIMINATOR: Uint8Array; declare function getUserDiscriminatorBytes(): ReadonlyUint8Array; type User = { discriminator: ReadonlyUint8Array; campaign: Address; itemsPurchasedPerStage: Array; itemsPurchased: bigint; bump: number; }; type UserArgs = { campaign: Address; itemsPurchasedPerStage: Array; itemsPurchased: number | bigint; bump: number; }; declare function getUserEncoder(): Encoder; declare function getUserDecoder(): Decoder; declare function getUserCodec(): Codec; declare function decodeUser(encodedAccount: EncodedAccount): Account; declare function decodeUser(encodedAccount: MaybeEncodedAccount): MaybeAccount; declare function fetchUser(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchMaybeUser(rpc: Parameters[0], address: Address, config?: FetchAccountConfig): Promise>; declare function fetchAllUser(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; declare function fetchAllMaybeUser(rpc: Parameters[0], addresses: Array
, config?: FetchAccountsConfig): Promise[]>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ /** Unauthorized: Unauthorized */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNAUTHORIZED = 6000; /** InvalidTimestamp: InvalidTimestamp */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_TIMESTAMP = 6001; /** TooManyItems: TooManyItems */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_ITEMS = 6002; /** InvalidItemsStock: InvalidItemsStock */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEMS_STOCK = 6003; /** InvalidAccount: InvalidAccount */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ACCOUNT = 6004; /** InvalidStatus: InvalidStatus */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_STATUS = 6005; /** InvalidCampaignId: InvalidCampaignId */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_CAMPAIGN_ID = 6006; /** InvalidItemId: InvalidItemId */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_ID = 6007; /** InvalidAmount: InvalidAmount */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_AMOUNT = 6008; /** InvalidProof: InvalidProof */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_PROOF = 6009; /** Overflow: Overflow */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OVERFLOW = 6010; /** Underflow: Underflow */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNDERFLOW = 6011; /** OutOfCampaignDuration: OutOfCampaignDuration */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OUT_OF_CAMPAIGN_DURATION = 6012; /** PurchaseLimitExceeded: PurchaseLimitExceeded */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__PURCHASE_LIMIT_EXCEEDED = 6013; /** TooManyStages: TooManyStages */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_STAGES = 6014; /** InvalidItemMetadata: InvalidItemMetadata */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_METADATA = 6015; /** TooManyContents: TooManyContents */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_CONTENTS = 6016; /** NoItemsAvailable: NoItemsAvailable */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__NO_ITEMS_AVAILABLE = 6017; /** MaxItemsPerUserExceeded: MaxItemsPerUserExceeded */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_EXCEEDED = 6018; /** MaxItemsPerUserPerStageExceeded: MaxItemsPerUserPerStageExceeded */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_PER_STAGE_EXCEEDED = 6019; type MoonshotBlindboxSmartContractError = typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ACCOUNT | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_AMOUNT | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_CAMPAIGN_ID | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_ID | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_METADATA | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEMS_STOCK | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_PROOF | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_STATUS | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_TIMESTAMP | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_EXCEEDED | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_PER_STAGE_EXCEEDED | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__NO_ITEMS_AVAILABLE | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OUT_OF_CAMPAIGN_DURATION | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OVERFLOW | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__PURCHASE_LIMIT_EXCEEDED | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_CONTENTS | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_ITEMS | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_STAGES | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNAUTHORIZED | typeof MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNDERFLOW; declare function getMoonshotBlindboxSmartContractErrorMessage(code: MoonshotBlindboxSmartContractError): string; declare function isMoonshotBlindboxSmartContractError(error: unknown, transactionMessage: { instructions: Record; }, code?: TProgramErrorCode): error is SolanaError & Readonly<{ context: Readonly<{ code: TProgramErrorCode; }>; }>; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const MOONSHOT_BLINDBOX_SMART_CONTRACT_PROGRAM_ADDRESS: Address<"CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U">; declare enum MoonshotBlindboxSmartContractAccount { Campaign = 0, Capability = 1, Config = 2, NftAuthority = 3, User = 4 } declare function identifyMoonshotBlindboxSmartContractAccount(account: { data: ReadonlyUint8Array; } | ReadonlyUint8Array): MoonshotBlindboxSmartContractAccount; declare enum MoonshotBlindboxSmartContractInstruction { Buy = 0, CreateCampaign = 1, GrantRole = 2, InitializeConfig = 3, RevokeRole = 4, UpdateCampaign = 5, UpdateCampaignMetadata = 6, UpdateConfig = 7 } declare function identifyMoonshotBlindboxSmartContractInstruction(instruction: { data: ReadonlyUint8Array; } | ReadonlyUint8Array): MoonshotBlindboxSmartContractInstruction; type ParsedMoonshotBlindboxSmartContractInstruction = ({ instructionType: MoonshotBlindboxSmartContractInstruction.Buy; } & ParsedBuyInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.CreateCampaign; } & ParsedCreateCampaignInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.GrantRole; } & ParsedGrantRoleInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.InitializeConfig; } & ParsedInitializeConfigInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.RevokeRole; } & ParsedRevokeRoleInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.UpdateCampaign; } & ParsedUpdateCampaignInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.UpdateCampaignMetadata; } & ParsedUpdateCampaignMetadataInstruction) | ({ instructionType: MoonshotBlindboxSmartContractInstruction.UpdateConfig; } & ParsedUpdateConfigInstruction); /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const BUY_DISCRIMINATOR: Uint8Array; declare function getBuyDiscriminatorBytes(): ReadonlyUint8Array; type BuyInstruction = string, TAccountBuyer extends string | AccountMeta = string, TAccountPaymentDestination extends string | AccountMeta = string, TAccountConfig extends string | AccountMeta = string, TAccountCampaign extends string | AccountMeta = string, TAccountUser extends string | AccountMeta = string, TAccountCapability extends string | AccountMeta = string, TAccountNftAuthority extends string | AccountMeta = string, TAccountMintAccount extends string | AccountMeta = string, TAccountAssociatedTokenAccount extends string | AccountMeta = string, TAccountMetadataAccount extends string | AccountMeta = string, TAccountEditionAccount extends string | AccountMeta = string, TAccountAssociatedTokenProgram extends string | AccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TAccountTokenProgram extends string | AccountMeta = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountTokenMetadataProgram extends string | AccountMeta = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', TAccountSystemProgram extends string | AccountMeta = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta = 'SysvarRent111111111111111111111111111111111', TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOperator extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOperator, TAccountBuyer extends string ? WritableSignerAccount & AccountSignerMeta : TAccountBuyer, TAccountPaymentDestination extends string ? WritableAccount : TAccountPaymentDestination, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountCampaign extends string ? WritableAccount : TAccountCampaign, TAccountUser extends string ? WritableAccount : TAccountUser, TAccountCapability extends string ? ReadonlyAccount : TAccountCapability, TAccountNftAuthority extends string ? ReadonlyAccount : TAccountNftAuthority, TAccountMintAccount extends string ? WritableSignerAccount & AccountSignerMeta : TAccountMintAccount, TAccountAssociatedTokenAccount extends string ? WritableAccount : TAccountAssociatedTokenAccount, TAccountMetadataAccount extends string ? WritableAccount : TAccountMetadataAccount, TAccountEditionAccount extends string ? WritableAccount : TAccountEditionAccount, TAccountAssociatedTokenProgram extends string ? ReadonlyAccount : TAccountAssociatedTokenProgram, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountTokenMetadataProgram extends string ? ReadonlyAccount : TAccountTokenMetadataProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountRent extends string ? ReadonlyAccount : TAccountRent, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type BuyInstructionData = { discriminator: ReadonlyUint8Array; args: BuyArgs; }; type BuyInstructionDataArgs = { args: BuyArgsArgs; }; declare function getBuyInstructionDataEncoder(): FixedSizeEncoder; declare function getBuyInstructionDataDecoder(): FixedSizeDecoder; declare function getBuyInstructionDataCodec(): FixedSizeCodec; type BuyAsyncInput = { operator: TransactionSigner; buyer: TransactionSigner; paymentDestination: Address; config: Address; campaign: Address; user?: Address; capability?: Address; nftAuthority?: Address; mintAccount: TransactionSigner; associatedTokenAccount?: Address; metadataAccount?: Address; editionAccount?: Address; associatedTokenProgram?: Address; tokenProgram?: Address; tokenMetadataProgram?: Address; systemProgram?: Address; rent?: Address; eventAuthority?: Address; program: Address; args: BuyInstructionDataArgs['args']; }; declare function getBuyInstructionAsync(input: BuyAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type BuyInput = { operator: TransactionSigner; buyer: TransactionSigner; paymentDestination: Address; config: Address; campaign: Address; user: Address; capability: Address; nftAuthority: Address; mintAccount: TransactionSigner; associatedTokenAccount: Address; metadataAccount: Address; editionAccount: Address; associatedTokenProgram?: Address; tokenProgram?: Address; tokenMetadataProgram?: Address; systemProgram?: Address; rent?: Address; eventAuthority: Address; program: Address; args: BuyInstructionDataArgs['args']; }; declare function getBuyInstruction(input: BuyInput, config?: { programAddress?: TProgramAddress; }): BuyInstruction; type ParsedBuyInstruction = { programAddress: Address; accounts: { operator: TAccountMetas[0]; buyer: TAccountMetas[1]; paymentDestination: TAccountMetas[2]; config: TAccountMetas[3]; campaign: TAccountMetas[4]; user: TAccountMetas[5]; capability: TAccountMetas[6]; nftAuthority: TAccountMetas[7]; mintAccount: TAccountMetas[8]; associatedTokenAccount: TAccountMetas[9]; metadataAccount: TAccountMetas[10]; editionAccount: TAccountMetas[11]; associatedTokenProgram: TAccountMetas[12]; tokenProgram: TAccountMetas[13]; tokenMetadataProgram: TAccountMetas[14]; systemProgram: TAccountMetas[15]; rent: TAccountMetas[16]; eventAuthority: TAccountMetas[17]; program: TAccountMetas[18]; }; data: BuyInstructionData; }; declare function parseBuyInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedBuyInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const CREATE_CAMPAIGN_DISCRIMINATOR: Uint8Array; declare function getCreateCampaignDiscriminatorBytes(): ReadonlyUint8Array; type CreateCampaignInstruction = string, TAccountCapability extends string | AccountMeta = string, TAccountConfig extends string | AccountMeta = string, TAccountNftAuthority extends string | AccountMeta = string, TAccountCampaign extends string | AccountMeta = string, TAccountMintAccount extends string | AccountMeta = string, TAccountAssociatedTokenAccount extends string | AccountMeta = string, TAccountMetadataAccount extends string | AccountMeta = string, TAccountEditionAccount extends string | AccountMeta = string, TAccountAssociatedTokenProgram extends string | AccountMeta = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountTokenMetadataProgram extends string | AccountMeta = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TAccountRent extends string | AccountMeta = "SysvarRent111111111111111111111111111111111", TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountAdmin extends string ? WritableSignerAccount & AccountSignerMeta : TAccountAdmin, TAccountCapability extends string ? ReadonlyAccount : TAccountCapability, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountNftAuthority extends string ? ReadonlyAccount : TAccountNftAuthority, TAccountCampaign extends string ? WritableAccount : TAccountCampaign, TAccountMintAccount extends string ? WritableSignerAccount & AccountSignerMeta : TAccountMintAccount, TAccountAssociatedTokenAccount extends string ? WritableAccount : TAccountAssociatedTokenAccount, TAccountMetadataAccount extends string ? WritableAccount : TAccountMetadataAccount, TAccountEditionAccount extends string ? WritableAccount : TAccountEditionAccount, TAccountAssociatedTokenProgram extends string ? ReadonlyAccount : TAccountAssociatedTokenProgram, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountTokenMetadataProgram extends string ? ReadonlyAccount : TAccountTokenMetadataProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountRent extends string ? ReadonlyAccount : TAccountRent, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type CreateCampaignInstructionData = { discriminator: ReadonlyUint8Array; args: CreateCampaignArgs; }; type CreateCampaignInstructionDataArgs = { args: CreateCampaignArgsArgs; }; declare function getCreateCampaignInstructionDataEncoder(): Encoder; declare function getCreateCampaignInstructionDataDecoder(): Decoder; declare function getCreateCampaignInstructionDataCodec(): Codec; type CreateCampaignAsyncInput = { admin: TransactionSigner; capability?: Address; config: Address; nftAuthority?: Address; campaign: Address; mintAccount: TransactionSigner; associatedTokenAccount?: Address; metadataAccount?: Address; editionAccount?: Address; associatedTokenProgram?: Address; tokenProgram?: Address; tokenMetadataProgram?: Address; systemProgram?: Address; rent?: Address; eventAuthority?: Address; program: Address; args: CreateCampaignInstructionDataArgs["args"]; }; declare function getCreateCampaignInstructionAsync(input: CreateCampaignAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type CreateCampaignInput = { admin: TransactionSigner; capability: Address; config: Address; nftAuthority: Address; campaign: Address; mintAccount: TransactionSigner; associatedTokenAccount: Address; metadataAccount: Address; editionAccount: Address; associatedTokenProgram?: Address; tokenProgram?: Address; tokenMetadataProgram?: Address; systemProgram?: Address; rent?: Address; eventAuthority: Address; program: Address; args: CreateCampaignInstructionDataArgs["args"]; }; declare function getCreateCampaignInstruction(input: CreateCampaignInput, config?: { programAddress?: TProgramAddress; }): CreateCampaignInstruction; type ParsedCreateCampaignInstruction = { programAddress: Address; accounts: { admin: TAccountMetas[0]; capability: TAccountMetas[1]; config: TAccountMetas[2]; nftAuthority: TAccountMetas[3]; campaign: TAccountMetas[4]; mintAccount: TAccountMetas[5]; associatedTokenAccount: TAccountMetas[6]; metadataAccount: TAccountMetas[7]; editionAccount: TAccountMetas[8]; associatedTokenProgram: TAccountMetas[9]; tokenProgram: TAccountMetas[10]; tokenMetadataProgram: TAccountMetas[11]; systemProgram: TAccountMetas[12]; rent: TAccountMetas[13]; eventAuthority: TAccountMetas[14]; program: TAccountMetas[15]; }; data: CreateCampaignInstructionData; }; declare function parseCreateCampaignInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedCreateCampaignInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const GRANT_ROLE_DISCRIMINATOR: Uint8Array; declare function getGrantRoleDiscriminatorBytes(): ReadonlyUint8Array; type GrantRoleInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountAccountToGrant extends string | AccountMeta = string, TAccountCapability extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = '11111111111111111111111111111111', TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountAccountToGrant extends string ? ReadonlyAccount : TAccountAccountToGrant, TAccountCapability extends string ? WritableAccount : TAccountCapability, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type GrantRoleInstructionData = { discriminator: ReadonlyUint8Array; args: GrantRoleArgs; }; type GrantRoleInstructionDataArgs = { args: GrantRoleArgsArgs; }; declare function getGrantRoleInstructionDataEncoder(): FixedSizeEncoder; declare function getGrantRoleInstructionDataDecoder(): FixedSizeDecoder; declare function getGrantRoleInstructionDataCodec(): FixedSizeCodec; type GrantRoleAsyncInput = { owner: TransactionSigner; config: Address; accountToGrant: Address; capability: Address; systemProgram?: Address; eventAuthority?: Address; program: Address; args: GrantRoleInstructionDataArgs['args']; }; declare function getGrantRoleInstructionAsync(input: GrantRoleAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type GrantRoleInput = { owner: TransactionSigner; config: Address; accountToGrant: Address; capability: Address; systemProgram?: Address; eventAuthority: Address; program: Address; args: GrantRoleInstructionDataArgs['args']; }; declare function getGrantRoleInstruction(input: GrantRoleInput, config?: { programAddress?: TProgramAddress; }): GrantRoleInstruction; type ParsedGrantRoleInstruction = { programAddress: Address; accounts: { owner: TAccountMetas[0]; config: TAccountMetas[1]; accountToGrant: TAccountMetas[2]; capability: TAccountMetas[3]; systemProgram: TAccountMetas[4]; eventAuthority: TAccountMetas[5]; program: TAccountMetas[6]; }; data: GrantRoleInstructionData; }; declare function parseGrantRoleInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedGrantRoleInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const INITIALIZE_CONFIG_DISCRIMINATOR: Uint8Array; declare function getInitializeConfigDiscriminatorBytes(): ReadonlyUint8Array; type InitializeConfigInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountNftAuthority extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = '11111111111111111111111111111111', TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountNftAuthority extends string ? WritableAccount : TAccountNftAuthority, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type InitializeConfigInstructionData = { discriminator: ReadonlyUint8Array; args: InitializeConfigArgs; }; type InitializeConfigInstructionDataArgs = { args: InitializeConfigArgsArgs; }; declare function getInitializeConfigInstructionDataEncoder(): FixedSizeEncoder; declare function getInitializeConfigInstructionDataDecoder(): FixedSizeDecoder; declare function getInitializeConfigInstructionDataCodec(): FixedSizeCodec; type InitializeConfigAsyncInput = { owner: TransactionSigner; config: Address; nftAuthority?: Address; systemProgram?: Address; eventAuthority?: Address; program: Address; args: InitializeConfigInstructionDataArgs['args']; }; declare function getInitializeConfigInstructionAsync(input: InitializeConfigAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type InitializeConfigInput = { owner: TransactionSigner; config: Address; nftAuthority: Address; systemProgram?: Address; eventAuthority: Address; program: Address; args: InitializeConfigInstructionDataArgs['args']; }; declare function getInitializeConfigInstruction(input: InitializeConfigInput, config?: { programAddress?: TProgramAddress; }): InitializeConfigInstruction; type ParsedInitializeConfigInstruction = { programAddress: Address; accounts: { owner: TAccountMetas[0]; config: TAccountMetas[1]; nftAuthority: TAccountMetas[2]; systemProgram: TAccountMetas[3]; eventAuthority: TAccountMetas[4]; program: TAccountMetas[5]; }; data: InitializeConfigInstructionData; }; declare function parseInitializeConfigInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedInitializeConfigInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const REVOKE_ROLE_DISCRIMINATOR: Uint8Array; declare function getRevokeRoleDiscriminatorBytes(): ReadonlyUint8Array; type RevokeRoleInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountAccountToRevoke extends string | AccountMeta = string, TAccountCapability extends string | AccountMeta = string, TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountAccountToRevoke extends string ? ReadonlyAccount : TAccountAccountToRevoke, TAccountCapability extends string ? WritableAccount : TAccountCapability, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type RevokeRoleInstructionData = { discriminator: ReadonlyUint8Array; args: RevokeRoleArgs; }; type RevokeRoleInstructionDataArgs = { args: RevokeRoleArgsArgs; }; declare function getRevokeRoleInstructionDataEncoder(): FixedSizeEncoder; declare function getRevokeRoleInstructionDataDecoder(): FixedSizeDecoder; declare function getRevokeRoleInstructionDataCodec(): FixedSizeCodec; type RevokeRoleAsyncInput = { owner: TransactionSigner; config: Address; accountToRevoke: Address; capability: Address; eventAuthority?: Address; program: Address; args: RevokeRoleInstructionDataArgs['args']; }; declare function getRevokeRoleInstructionAsync(input: RevokeRoleAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type RevokeRoleInput = { owner: TransactionSigner; config: Address; accountToRevoke: Address; capability: Address; eventAuthority: Address; program: Address; args: RevokeRoleInstructionDataArgs['args']; }; declare function getRevokeRoleInstruction(input: RevokeRoleInput, config?: { programAddress?: TProgramAddress; }): RevokeRoleInstruction; type ParsedRevokeRoleInstruction = { programAddress: Address; accounts: { owner: TAccountMetas[0]; config: TAccountMetas[1]; accountToRevoke: TAccountMetas[2]; capability: TAccountMetas[3]; eventAuthority: TAccountMetas[4]; program: TAccountMetas[5]; }; data: RevokeRoleInstructionData; }; declare function parseRevokeRoleInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedRevokeRoleInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const UPDATE_CAMPAIGN_DISCRIMINATOR: Uint8Array; declare function getUpdateCampaignDiscriminatorBytes(): ReadonlyUint8Array; type UpdateCampaignInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountCampaign extends string | AccountMeta = string, TAccountCapability extends string | AccountMeta = string, TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountAdmin extends string ? WritableSignerAccount & AccountSignerMeta : TAccountAdmin, TAccountConfig extends string ? ReadonlyAccount : TAccountConfig, TAccountCampaign extends string ? WritableAccount : TAccountCampaign, TAccountCapability extends string ? ReadonlyAccount : TAccountCapability, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type UpdateCampaignInstructionData = { discriminator: ReadonlyUint8Array; args: UpdateCampaignArgs; }; type UpdateCampaignInstructionDataArgs = { args: UpdateCampaignArgsArgs; }; declare function getUpdateCampaignInstructionDataEncoder(): Encoder; declare function getUpdateCampaignInstructionDataDecoder(): Decoder; declare function getUpdateCampaignInstructionDataCodec(): Codec; type UpdateCampaignAsyncInput = { admin: TransactionSigner; config: Address; campaign: Address; capability?: Address; eventAuthority?: Address; program: Address; args: UpdateCampaignInstructionDataArgs['args']; }; declare function getUpdateCampaignInstructionAsync(input: UpdateCampaignAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type UpdateCampaignInput = { admin: TransactionSigner; config: Address; campaign: Address; capability: Address; eventAuthority: Address; program: Address; args: UpdateCampaignInstructionDataArgs['args']; }; declare function getUpdateCampaignInstruction(input: UpdateCampaignInput, config?: { programAddress?: TProgramAddress; }): UpdateCampaignInstruction; type ParsedUpdateCampaignInstruction = { programAddress: Address; accounts: { admin: TAccountMetas[0]; config: TAccountMetas[1]; campaign: TAccountMetas[2]; capability: TAccountMetas[3]; eventAuthority: TAccountMetas[4]; program: TAccountMetas[5]; }; data: UpdateCampaignInstructionData; }; declare function parseUpdateCampaignInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedUpdateCampaignInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const UPDATE_CAMPAIGN_METADATA_DISCRIMINATOR: Uint8Array; declare function getUpdateCampaignMetadataDiscriminatorBytes(): ReadonlyUint8Array; type UpdateCampaignMetadataInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountCampaign extends string | AccountMeta = string, TAccountCapability extends string | AccountMeta = string, TAccountNftAuthority extends string | AccountMeta = string, TAccountMintAccount extends string | AccountMeta = string, TAccountMetadataAccount extends string | AccountMeta = string, TAccountTokenMetadataProgram extends string | AccountMeta = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountAdmin extends string ? WritableSignerAccount & AccountSignerMeta : TAccountAdmin, TAccountConfig extends string ? ReadonlyAccount : TAccountConfig, TAccountCampaign extends string ? WritableAccount : TAccountCampaign, TAccountCapability extends string ? ReadonlyAccount : TAccountCapability, TAccountNftAuthority extends string ? ReadonlyAccount : TAccountNftAuthority, TAccountMintAccount extends string ? ReadonlyAccount : TAccountMintAccount, TAccountMetadataAccount extends string ? WritableAccount : TAccountMetadataAccount, TAccountTokenMetadataProgram extends string ? ReadonlyAccount : TAccountTokenMetadataProgram, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type UpdateCampaignMetadataInstructionData = { discriminator: ReadonlyUint8Array; args: UpdateCampaignMetadataArgs; }; type UpdateCampaignMetadataInstructionDataArgs = { args: UpdateCampaignMetadataArgsArgs; }; declare function getUpdateCampaignMetadataInstructionDataEncoder(): Encoder; declare function getUpdateCampaignMetadataInstructionDataDecoder(): Decoder; declare function getUpdateCampaignMetadataInstructionDataCodec(): Codec; type UpdateCampaignMetadataAsyncInput = { admin: TransactionSigner; config: Address; campaign: Address; capability?: Address; nftAuthority?: Address; mintAccount: Address; metadataAccount?: Address; tokenMetadataProgram?: Address; eventAuthority?: Address; program: Address; args: UpdateCampaignMetadataInstructionDataArgs['args']; }; declare function getUpdateCampaignMetadataInstructionAsync(input: UpdateCampaignMetadataAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type UpdateCampaignMetadataInput = { admin: TransactionSigner; config: Address; campaign: Address; capability: Address; nftAuthority: Address; mintAccount: Address; metadataAccount: Address; tokenMetadataProgram?: Address; eventAuthority: Address; program: Address; args: UpdateCampaignMetadataInstructionDataArgs['args']; }; declare function getUpdateCampaignMetadataInstruction(input: UpdateCampaignMetadataInput, config?: { programAddress?: TProgramAddress; }): UpdateCampaignMetadataInstruction; type ParsedUpdateCampaignMetadataInstruction = { programAddress: Address; accounts: { admin: TAccountMetas[0]; config: TAccountMetas[1]; campaign: TAccountMetas[2]; capability: TAccountMetas[3]; nftAuthority: TAccountMetas[4]; mintAccount: TAccountMetas[5]; metadataAccount: TAccountMetas[6]; tokenMetadataProgram: TAccountMetas[7]; eventAuthority: TAccountMetas[8]; program: TAccountMetas[9]; }; data: UpdateCampaignMetadataInstructionData; }; declare function parseUpdateCampaignMetadataInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedUpdateCampaignMetadataInstruction; /** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ declare const UPDATE_CONFIG_DISCRIMINATOR: Uint8Array; declare function getUpdateConfigDiscriminatorBytes(): ReadonlyUint8Array; type UpdateConfigInstruction = string, TAccountConfig extends string | AccountMeta = string, TAccountEventAuthority extends string | AccountMeta = string, TAccountProgram extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountConfig extends string ? WritableAccount : TAccountConfig, TAccountEventAuthority extends string ? ReadonlyAccount : TAccountEventAuthority, TAccountProgram extends string ? ReadonlyAccount : TAccountProgram, ...TRemainingAccounts ]>; type UpdateConfigInstructionData = { discriminator: ReadonlyUint8Array; args: UpdateConfigArgs; }; type UpdateConfigInstructionDataArgs = { args: UpdateConfigArgsArgs; }; declare function getUpdateConfigInstructionDataEncoder(): Encoder; declare function getUpdateConfigInstructionDataDecoder(): Decoder; declare function getUpdateConfigInstructionDataCodec(): Codec; type UpdateConfigAsyncInput = { owner: TransactionSigner; config: Address; eventAuthority?: Address; program: Address; args: UpdateConfigInstructionDataArgs['args']; }; declare function getUpdateConfigInstructionAsync(input: UpdateConfigAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; type UpdateConfigInput = { owner: TransactionSigner; config: Address; eventAuthority: Address; program: Address; args: UpdateConfigInstructionDataArgs['args']; }; declare function getUpdateConfigInstruction(input: UpdateConfigInput, config?: { programAddress?: TProgramAddress; }): UpdateConfigInstruction; type ParsedUpdateConfigInstruction = { programAddress: Address; accounts: { owner: TAccountMetas[0]; config: TAccountMetas[1]; eventAuthority: TAccountMetas[2]; program: TAccountMetas[3]; }; data: UpdateConfigInstructionData; }; declare function parseUpdateConfigInstruction(instruction: Instruction & InstructionWithAccounts & InstructionWithData): ParsedUpdateConfigInstruction; declare function getConfigAddress(configId: number, programAddress?: Address): Promise>; declare function getCampaignAddress(campaignId: number, configAddress: Address, programAddress?: Address): Promise>; declare function getCampaignItemAddress(itemId: number, campaignAddress: Address, programAddress?: Address): Promise>; declare function getCapabilityAddress(configAddress: Address, accountAddress: Address, role: Role, programAddress?: Address): Promise>; declare function getEventAuthorityAddress(programAddress?: Address): Promise>; declare function getUserAddress(campaignAddress: Address, accountAddress: Address, programAddress?: Address): Promise>; declare function getNftAuthorityAddress(configAddress: Address, programAddress?: Address): Promise>; declare const METAPLEX_TOKEN_METADATA_PROGRAM_ADDRESS: Address<"metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s">; declare function getTokenMetadataAddress(mintAddress: Address, programAddress?: Address, tokenMetadataProgramAddress?: Address): Promise>; declare function getMasterEditionAddress(mintAddress: Address, programAddress?: Address, tokenMetadataProgramAddress?: Address): Promise>; /** * Event Parser for Moonshot Blindbox Smart Contract * * This class handles parsing of event CPI (Cross-Program Invocation) data from transaction logs. * It automatically decodes events emitted by the smart contract and provides utilities * for event management and validation. * * The decoder registry is auto-generated based on IDL events, making it easy to add * new events without manual updates. * * @example * ```typescript * import { EventParser } from '@moonshot-blindbox/sdk'; * * // Parse event CPI data * const result = EventParser.parseEventCPI(eventCPIData); * console.log(`Event: ${result.name}`, result.data); * * // Get available events * const events = EventParser.getAvailableEvents(); * console.log('Available events:', events); * * // Check if event is supported * const isSupported = EventParser.isEventSupported('BuyEvent'); * console.log('BuyEvent supported:', isSupported); * ``` */ declare class EventParser { /** * Parses event CPI data from a transaction log. * * This method takes raw event CPI data and decodes it into a structured format * with the event name and parsed data. It automatically matches the event * discriminator and uses the appropriate decoder. * * @param eventCPIData - The base58 encoded event CPI data from transaction logs * @returns An object containing the parsed event data and its name * @throws Error if the event CPI has an invalid tag, no event is matched, or the decoder function is not available * * @example * ```typescript * // Parse event from transaction * const eventCPIData = Buffer.from(base58EncodedData, 'base58'); * const result = EventParser.parseEventCPI(eventCPIData); * * if (result.name === 'BuyEvent') { * console.log('Purchase made:', result.data); * } * ``` */ static parseEventCPI(eventCPIData: Buffer): { data: any; name: string; }; /** * Returns a list of all available event names from the IDL. * * This method provides a way to discover what events are available * in the current version of the smart contract. * * @returns An array of event names that can be parsed * * @example * ```typescript * const events = EventParser.getAvailableEvents(); * console.log('Available events:', events); * // Output: ['BuyEvent', 'CreateCampaignEvent', 'AddCampaignItemEvent', ...] * ``` */ static getAvailableEvents(): string[]; /** * Checks if a given event name is supported by the parser. * * This method verifies whether the parser has a decoder function * available for the specified event type. * * @param eventName - The name of the event to check (e.g., 'BuyEvent', 'CreateCampaignEvent') * @returns True if the event is supported and can be parsed, false otherwise * * @example * ```typescript * const isBuySupported = EventParser.isEventSupported('BuyEvent'); * console.log('BuyEvent supported:', isBuySupported); // true * * const isCustomSupported = EventParser.isEventSupported('CustomEvent'); * console.log('CustomEvent supported:', isCustomSupported); // false * ``` */ static isEventSupported(eventName: string): boolean; } declare function getBuyTransactionFee(rpcUrl: string, configId: number, campaignId: number, buyer: Address): Promise; /** * Main SDK class for interacting with the Moonshot Blindbox Smart Contract. * Provides methods for managing configs, campaigns, and executing buy operations. */ declare class MoonshotBlindbox { private signer; private skipSimulation; private readonly estimateAndSetComputeUnitLimit; private readonly sendAndConfirmTransaction; private readonly rpc; private readonly rpcSubscriptions; private readonly signersCache; /** * Creates a new instance of the MoonshotBlindbox SDK. * * @param signer - The transaction signer (either TransactionSigner or KeyPairSigner) used to sign transactions * @param rpcUrl - The Solana RPC endpoint URL (e.g., "https://api.devnet.solana.com") * @param wssUrl - The Solana WebSocket endpoint URL (e.g., "wss://api.devnet.solana.com") * @param skipSimulation - Optional. If true, skips transaction simulation and uses fixed compute units. Defaults to false. * * @example * ```typescript * const signer = await generateKeyPairSigner(); * const moonshot = new MoonshotBlindbox( * signer, * "https://api.devnet.solana.com", * "wss://api.devnet.solana.com", * true * ); * ``` */ constructor(signer: TransactionSigner | KeyPairSigner, rpcUrl: string, wssUrl: string, skipSimulation?: boolean); /** * Creates an instruction to initialize a new config account. * The config is the top-level account that manages campaigns and access control. * * @param args - The initialization arguments * @param args.id - The unique identifier for this config (0-255) * @returns The initialize config instruction * * @example * ```typescript * const initConfigIx = await moonshot.getInitializeConfigInstruction({ * id: 1 * }); * await moonshot.signAndSendTransaction([initConfigIx]); * ``` */ getInitializeConfigInstruction(args: InitializeConfigArgs): Promise, string, string, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to update an existing config account. * Can update the config status (Active/Inactive). * * @param args - The update arguments * @param args.configId - The ID of the config to update * @param args.status - Optional. The new status for the config * @returns The update config instruction * * @example * ```typescript * import { some, none } from "@solana/kit"; * import { Status } from "moonshot-blindbox-sdk"; * * const updateIx = await moonshot.getUpdateConfigInstruction({ * configId: 1, * status: some(Status.Inactive) * }); * await moonshot.signAndSendTransaction([updateIx]); * ``` */ getUpdateConfigInstruction(args: UpdateConfigArgs): Promise, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to grant a role to an account. * Roles control access to various operations (Admin and Operator roles available). * * @param args - The grant role arguments * @param args.configId - The ID of the config * @param args.accountToGrant - The address of the account receiving the role * @param args.role - The role to grant (Role.Admin or Role.Operator) * @returns The grant role instruction * * @example * ```typescript * import { Role } from "moonshot-blindbox-sdk"; * * const grantIx = await moonshot.getGrantRoleInstruction({ * configId: 1, * accountToGrant: "AccountAddressHere", * role: Role.Admin * }); * await moonshot.signAndSendTransaction([grantIx]); * ``` */ getGrantRoleInstruction(args: GrantRoleArgs): Promise, string, string, string, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to revoke a role from an account. * * @param args - The revoke role arguments * @param args.configId - The ID of the config * @param args.accountToRevoke - The address of the account losing the role * @param args.role - The role to revoke (Role.Admin or Role.Operator) * @returns The revoke role instruction * * @example * ```typescript * import { Role } from "moonshot-blindbox-sdk"; * * const revokeIx = await moonshot.getRevokeRoleInstruction({ * configId: 1, * accountToRevoke: "AccountAddressHere", * role: Role.Admin * }); * await moonshot.signAndSendTransaction([revokeIx]); * ``` */ getRevokeRoleInstruction(args: RevokeRoleArgs): Promise, string, string, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to initialize a new campaign. * A campaign represents a blindbox sale with stages, pricing, and available items. * * @param args - The campaign creation arguments * @param args.configId - The ID of the parent config * @param args.campaignId - The unique identifier for this campaign (0-255) * @param args.stages - Array of stage configurations with startTime, endTime, and purchaseLimit * @param args.priceInLamports - The price per item in lamports * @param args.paymentDestination - The address that receives payment * @param args.itemsAvailable - Total number of items available in this campaign * @param args.campaignMetadata - Metadata for the campaign collection (name, symbol, uri) * @param args.itemMetadata - Metadata for individual NFT items (name, symbol, uri) * @returns A tuple of [instruction, mintAddress] where mintAddress is the generated mint for the campaign * * @example * ```typescript * const now = Math.floor(Date.now() / 1000); * const [createIx, mintAddress] = await moonshot.getCreateCampaignInstruction({ * configId: 1, * campaignId: 0, * stages: [ * { * startTime: BigInt(now), * endTime: BigInt(now + 3600), * purchaseLimit: BigInt(2) * } * ], * priceInLamports: BigInt(1000000000), * paymentDestination: "PaymentAddressHere", * itemsAvailable: BigInt(100), * campaignMetadata: { * name: "My Campaign", * symbol: "MC", * uri: "https://example.com/campaign.json" * }, * itemMetadata: { * name: "Campaign Item", * symbol: "CI", * uri: "https://example.com/item.json" * } * }); * await moonshot.signAndSendTransaction([createIx]); * ``` */ getCreateCampaignInstruction(args: CreateCampaignArgs): Promise<[Instruction, Address]>; /** * Creates an instruction to update an existing campaign. * Can update status, stages, price, payment destination, and items available. * * @param args - The update arguments * @param args.configId - The ID of the parent config * @param args.campaignId - The ID of the campaign to update * @param args.status - Optional. New status (Status.Active or Status.Inactive) * @param args.stages - Optional. New array of stage configurations * @param args.priceInLamports - Optional. New price per item in lamports * @param args.paymentDestination - Optional. New payment destination address * @param args.itemsAvailable - Optional. New total items available * @returns The update campaign instruction * * @example * ```typescript * import { some, none } from "@solana/kit"; * import { Status } from "moonshot-blindbox-sdk"; * * const updateIx = await moonshot.getUpdateCampaignInstruction({ * configId: 1, * campaignId: 0, * status: some(Status.Inactive), * stages: none(), * priceInLamports: some(BigInt(500000000)), * paymentDestination: none(), * itemsAvailable: none() * }); * await moonshot.signAndSendTransaction([updateIx]); * ``` */ getUpdateCampaignInstruction(args: UpdateCampaignArgs): Promise, string, string, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to update campaign metadata. * Updates the metadata for the campaign's NFT collection. * * @param args - The update metadata arguments * @param args.configId - The ID of the parent config * @param args.campaignId - The ID of the campaign to update * @param args.mintAccount - The mint account address for the campaign * @param args.metadata - The new metadata (name, symbol, uri) * @returns The update campaign metadata instruction * * @example * ```typescript * const updateMetadataIx = await moonshot.getUpdateCampaignMetadataInstruction({ * configId: 1, * campaignId: 0, * mintAccount: "MintAddressHere", * metadata: { * name: "Updated Campaign Name", * symbol: "UCN", * uri: "https://example.com/updated.json" * } * }); * await moonshot.signAndSendTransaction([updateMetadataIx]); * ``` */ getUpdateCampaignMetadataInstruction(args: UpdateCampaignMetadataArgs): Promise, string, string, string, string, string, string, string, string, string, "CEqRYLCkBsYoPBwSNsEiX12D3NGeTCWPtM95DAo6qt1U", []>>; /** * Creates an instruction to buy items from a campaign. * Generates a new mint for the NFT that will be created upon purchase. * * @param args - The buy arguments * @param args.configId - The ID of the parent config * @param args.campaignId - The ID of the campaign to buy from * @param args.buyer - The address of the buyer (who will receive the NFT) * @returns A tuple of [instruction, mintAddress] where mintAddress is the generated mint for the NFT * * @throws {Error} If the campaign is not found * * @example * ```typescript * // Single signature (operator controls everything) * const [buyIx, mintAddress] = await moonshot.getBuyInstruction({ * configId: 1, * campaignId: 0, * buyer: "BuyerAddressHere", * }); * await moonshot.signAndSendTransaction([buyIx]); * ``` * * @example * ```typescript * // Multi-signature (buyer maintains control) * const [buyIx, mintAddress] = await operatorMoonshot.getBuyInstruction({ * configId: 1, * campaignId: 0, * buyer: buyerAddress, * }); * const encodedTx = await operatorMoonshot.partiallySignTransaction( * [buyIx], * buyerAddress * ); * await buyerMoonshot.signAndSendEncodedTransaction(encodedTx); * ``` */ getBuyInstruction(args: BuyArgs): Promise<[Instruction, Address]>; /** * Fetches a config account by its address. * * @param configAddress - The address of the config account * @returns The config data if it exists, null otherwise * * @example * ```typescript * import { getConfigAddress } from "moonshot-blindbox-sdk"; * * const configAddress = await getConfigAddress(1); * const config = await moonshot.fetchConfig(configAddress); * if (config) { * console.log("Config status:", config.status); * } * ``` */ fetchConfig(configAddress: Address): Promise; /** * Fetches a campaign account by its address. * * @param campaignAddress - The address of the campaign account * @returns The campaign data if it exists, null otherwise * * @example * ```typescript * import { getCampaignAddress, getConfigAddress } from "moonshot-blindbox-sdk"; * * const configAddress = await getConfigAddress(1); * const campaignAddress = await getCampaignAddress(0, configAddress); * const campaign = await moonshot.fetchCampaign(campaignAddress); * if (campaign) { * console.log("Items available:", campaign.itemsAvailable); * } * ``` */ fetchCampaign(campaignAddress: Address): Promise; /** * Fetches a capability account by its address. * Used to check if an account has a specific role. * * @param capabilityAddress - The address of the capability account * @returns The capability data if it exists, null otherwise * * @example * ```typescript * import { getCapabilityAddress, getConfigAddress, Role } from "moonshot-blindbox-sdk"; * * const configAddress = await getConfigAddress(1); * const capabilityAddress = await getCapabilityAddress(configAddress, accountAddress, Role.Admin); * const capability = await moonshot.fetchCapability(capabilityAddress); * console.log("Has Admin role:", capability !== null); * ``` */ fetchCapability(capabilityAddress: Address): Promise; /** * Fetches an NFT authority account by its address. * The NFT authority is a PDA that has authority over NFT minting operations for a specific config. * This account is used internally by the program to manage NFT creation during buy operations. * * @param nftAuthorityAddress - The address of the NFT authority account (PDA derived from config) * @returns The NFT authority data if it exists, null otherwise. Contains the config reference and bump seed. * * @example * ```typescript * import { getNftAuthorityAddress, getConfigAddress } from "moonshot-blindbox-sdk"; * * const configAddress = await getConfigAddress(1); * const nftAuthorityAddress = await getNftAuthorityAddress(configAddress); * const nftAuthority = await moonshot.fetchNftAuthority(nftAuthorityAddress); * if (nftAuthority) { * console.log("NFT Authority config:", nftAuthority.config); * } * ``` */ fetchNftAuthority(nftAuthorityAddress: Address): Promise; /** * Fetches a user account by its address. * User accounts track purchase history and limits for a specific buyer in a campaign. * * @param userAddress - The address of the user account * @returns The user data if it exists, null otherwise * * @example * ```typescript * import { getUserAddress, getCampaignAddress, getConfigAddress } from "moonshot-blindbox-sdk"; * * const configAddress = await getConfigAddress(1); * const campaignAddress = await getCampaignAddress(0, configAddress); * const userAddress = await getUserAddress(campaignAddress, buyerAddress); * const user = await moonshot.fetchUser(userAddress); * if (user) { * console.log("Items purchased:", user.itemsPurchased); * } * ``` */ fetchUser(userAddress: Address): Promise; /** * Gets the latest blockhash from the RPC endpoint. * This is used internally for setting transaction lifetime constraints. * The blockhash ensures transactions are only valid for a limited time window (~150 slots or ~60 seconds). * * @returns A promise that resolves to the latest blockhash information, including: * - blockhash: The recent blockhash string * - lastValidBlockHeight: The last block height this blockhash is valid for * * @remarks * This method is called automatically by `signAndSendTransaction` and `partiallySignTransaction`. * You typically don't need to call this directly unless implementing custom transaction flows. * * @example * ```typescript * const blockhash = await moonshot.getLatestBlockhash(); * console.log("Current blockhash:", blockhash.blockhash); * console.log("Valid until block:", blockhash.lastValidBlockHeight); * ``` */ getLatestBlockhash(): Promise>; /** * Signs and sends a transaction with the provided instructions. * This is the main method for executing transactions. It handles: * - Fetching the latest blockhash for transaction lifetime * - Setting the fee payer (the signer provided in constructor) * - Estimating and setting compute units (unless skipSimulation is true) * - Signing the transaction with the configured signer * - Sending the transaction to the network * - Waiting for confirmation with 'confirmed' commitment level * * @param ixs - Array of Solana instructions to include in the transaction. These will be executed in order. * @returns A promise that resolves to the transaction signature (base58 string) upon confirmation. * * @throws {Error} If the transaction fails to send or confirm * @throws {Error} If compute unit estimation fails (when skipSimulation is false) * * @remarks * - If `skipSimulation` is true (set in constructor), uses fixed 1,400,000 compute units * - If `skipSimulation` is false, estimates compute units by simulating the transaction * - Transactions are confirmed at 'confirmed' commitment level before returning * - The signer must have sufficient SOL to pay for transaction fees * * @example * ```typescript * // Single instruction * const initIx = await moonshot.getInitializeConfigInstruction({ id: 1 }); * const signature = await moonshot.signAndSendTransaction([initIx]); * console.log("Transaction signature:", signature); * ``` * * @example * ```typescript * // Multiple instructions in one transaction * const grantIx1 = await moonshot.getGrantRoleInstruction({ * configId: 1, * accountToGrant: address1, * role: Role.Admin * }); * const grantIx2 = await moonshot.getGrantRoleInstruction({ * configId: 1, * accountToGrant: address2, * role: Role.Operator * }); * const signature = await moonshot.signAndSendTransaction([grantIx1, grantIx2]); * console.log("Batch transaction signature:", signature); * ``` */ signAndSendTransaction(ixs: Instruction[]): Promise; /** * Partially signs a transaction with the operator's signature. * This method is used in multi-signature workflows where the buyer needs to maintain control * of the transaction. The operator (this SDK instance) signs the transaction, but the final * signature from the buyer is still required before the transaction can be sent to the network. * * **Workflow:** * 1. Operator creates transaction instructions (e.g., buy instruction) * 2. Operator partially signs with this method * 3. Operator sends encoded transaction to buyer (off-chain) * 4. Buyer completes signature and broadcasts with `signAndSendEncodedTransaction` * * @param ixs - Array of Solana instructions to include in the transaction. These will be executed in order. * @param feePayer - The address of the account that will pay transaction fees (typically the buyer's address). * This account must sign the transaction before it can be sent. * @returns A promise that resolves to the encoded partially-signed transaction as a ReadonlyUint8Array. * This can be serialized and sent to the buyer for completion. * * @remarks * - The transaction includes compute unit estimation/limits like `signAndSendTransaction` * - The transaction is valid for ~150 slots (~60 seconds) from creation * - The feePayer account must sign before the transaction can be broadcast * - The encoded transaction can be transferred via JSON-RPC, WebSocket, or any data channel * * @throws {Error} If compute unit estimation fails (when skipSimulation is false) * * @example * ```typescript * // Operator prepares and partially signs * const [buyIx, mintAddress] = await operatorMoonshot.getBuyInstruction({ * configId: 1, * campaignId: 0, * buyer: buyerAddress, * amount: BigInt(1) * }); * const encodedTx = await operatorMoonshot.partiallySignTransaction( * [buyIx], * buyerAddress * ); * * // Send encodedTx to buyer via your preferred method * // Buyer then completes with: * // await buyerMoonshot.signAndSendEncodedTransaction(encodedTx); * ``` * * @see {@link signAndSendEncodedTransaction} for the buyer's completion step */ partiallySignTransaction(ixs: Instruction[], feePayer: Address): Promise; /** * Signs and sends an encoded transaction. * This is the buyer's step in a multi-signature workflow. It takes a partially-signed transaction * from the operator, adds the buyer's signature, and broadcasts it to the Solana network. * * **Workflow (Buyer's perspective):** * 1. Receive encoded transaction from operator (via API, WebSocket, etc.) * 2. Call this method with the encoded transaction * 3. The buyer's signer (from constructor) signs the transaction * 4. Transaction is sent to the network and confirmed * * @param encodedTransaction - The encoded partially-signed transaction as ReadonlyUint8Array, * received from `partiallySignTransaction` call by the operator. * @returns A promise that resolves to the transaction signature (base58 string) upon confirmation. * For TransactionSendingSigner, returns the first signature from the array. * * @throws {Error} If the signer type is invalid (not TransactionSendingSigner or KeyPairSigner) * @throws {Error} If the transaction fails to decode * @throws {Error} If the transaction fails to send or confirm * * @remarks * - This method works with both KeyPairSigner and TransactionSendingSigner types * - The transaction must have been partially signed by the operator before calling this * - The buyer's account (signer) must be the fee payer specified in the original transaction * - The buyer's account must have sufficient SOL to pay for transaction fees * - Transaction is confirmed at 'confirmed' commitment level before returning * * @example * ```typescript * // Buyer receives encoded transaction from operator * const buyerSigner = await generateKeyPairSigner(); * const buyerMoonshot = new MoonshotBlindbox( * buyerSigner, * "https://api.devnet.solana.com", * "wss://api.devnet.solana.com", * true * ); * * // encodedTx received from operator * const signature = await buyerMoonshot.signAndSendEncodedTransaction(encodedTx); * console.log("Transaction completed:", signature); * ``` * * @example * ```typescript * // Complete multi-signature flow * // 1. Operator side: * const [buyIx, mintAddress] = await operatorMoonshot.getBuyInstruction({ * configId: 1, * campaignId: 0, * buyer: buyerAddress, * amount: BigInt(1) * }); * const encodedTx = await operatorMoonshot.partiallySignTransaction([buyIx], buyerAddress); * * // 2. Send encodedTx to buyer... * * // 3. Buyer side: * const signature = await buyerMoonshot.signAndSendEncodedTransaction(encodedTx); * console.log("Purchase complete! NFT mint:", mintAddress); * ``` * * @see {@link partiallySignTransaction} for the operator's preparation step */ signAndSendEncodedTransaction(encodedTransaction: ReadonlyUint8Array): Promise; } /** * @fileoverview Legacy SDK for Moonshot Blindbox Smart Contract * * This module provides a TypeScript SDK for interacting with the Moonshot Blindbox * smart contract on Solana. It offers methods for: * - Managing campaigns (create, update, fetch) * - Role-based access control (grant, revoke, check roles) * - Transaction building and confirmation * * The SDK uses Anchor framework and supports Version 0 transactions for * optimal performance on Solana. * * @module MoonshotBlindboxLegacy * @author Moonshot Team */ /** * Represents a campaign stage with time-based restrictions * Stages allow for phased launches with different limits per stage */ type TStage = { /** Unix timestamp when this stage starts */ startTime: BN; /** Unix timestamp when this stage ends */ endTime: BN; /** Maximum items a single user can purchase in this stage */ maxItemsPerUser: BN; /** Total items available for purchase in this stage */ itemsAvailable: BN; /** Number of items already purchased in this stage */ itemsPurchased: BN; }; /** * NFT metadata information for campaigns and items */ type TMetadata = { /** Display name of the NFT */ name: string; /** Token symbol for the NFT collection */ symbol: string; /** URI pointing to the metadata JSON file */ uri: string; }; /** * Arguments for creating a new campaign */ type TCreateCampaignArgs = { /** The configuration ID this campaign belongs to */ configId: number; /** Unique identifier for the campaign */ campaignId: number; /** Array of stages defining the campaign's timeline and limits */ stages: Array; /** Price per item in lamports (1 SOL = 1,000,000,000 lamports) */ priceInLamports: BN; /** Wallet address where payment funds will be sent */ paymentDestination: anchor.web3.PublicKey; /** Total number of items available across all stages */ itemsAvailable: BN; /** Maximum items a single user can purchase across all stages */ maxItemsPerUser: BN; /** Metadata for the campaign itself */ campaignMetadata: TMetadata; /** Metadata template for items in this campaign */ itemMetadata: TMetadata; }; /** * Arguments for updating an existing campaign * All fields except IDs are optional - only provided fields will be updated */ type TUpdateCampaignArgs = { /** The configuration ID this campaign belongs to */ configId: number; /** Unique identifier for the campaign to update */ campaignId: number; /** Optional: New stages configuration */ stages?: Array; /** Optional: New campaign status (Active/Inactive) */ status?: Status; /** Optional: New price per item in lamports */ priceInLamports?: BN; /** Optional: New payment destination wallet */ paymentDestination?: anchor.web3.PublicKey; /** Optional: New total items available */ itemsAvailable?: BN; /** Optional: New max items per user */ maxItemsPerUser?: BN; }; /** * Arguments for granting a role to an account */ type TGrantRoleArgs = { /** The configuration ID */ configId: number; /** The account public key to grant the role to */ accountToGrant: anchor.web3.PublicKey; /** The role to grant (Admin or Operator) */ role: Role; }; /** * Arguments for revoking a role from an account */ type TRevokeRoleArgs = { /** The configuration ID */ configId: number; /** The account public key to revoke the role from */ accountToRevoke: anchor.web3.PublicKey; /** The role to revoke (Admin or Operator) */ role: Role; }; /** * Status mappings for campaign status conversion * Maps enum values to their on-chain representation */ declare const statuses: { 0: { active: {}; }; 1: { inactive: {}; }; }; /** * Role mappings for role conversion * Maps enum values to their on-chain representation */ declare const roles: { 0: { admin: {}; }; 1: { operator: {}; }; }; /** * Legacy SDK class for interacting with the Moonshot Blindbox smart contract * Provides methods for managing campaigns, roles, and transactions * * @class MoonshotBlindboxLegacy * @example * const sdk = new MoonshotBlindboxLegacy("https://api.devnet.solana.com"); * const config = await sdk.fetchConfig(0); */ declare class MoonshotBlindboxLegacy { private readonly program; private readonly connection; /** * Creates an instance of MoonshotBlindboxLegacy * * @param {string} rpcUrl - The Solana RPC endpoint URL * @param {anchor.web3.PublicKey} [programId] - The program ID (defaults to deployed program address) */ constructor(rpcUrl: string, programId?: anchor.web3.PublicKey); /** * Fetches the configuration account data from the blockchain * * @param {number} configId - The unique identifier for the configuration * @returns {Promise} The configuration account data, or null if not found * @example * const config = await sdk.fetchConfig(0); * if (config) { * console.log("Owner:", config.owner); * } */ fetchConfig(configId: number): Promise; /** * Fetches a specific campaign account data from the blockchain * * @param {number} configId - The configuration ID the campaign belongs to * @param {number} campaignId - The unique identifier for the campaign * @returns {Promise} The campaign account data, or null if not found * @example * const campaign = await sdk.fetchCampaign(0, 1); * if (campaign) { * console.log("Items available:", campaign.itemsAvailable.toString()); * } */ fetchCampaign(configId: number, campaignId: number): Promise; /** * Fetches the capability (role permission) account for a specific account and role * * @param {number} configId - The configuration ID * @param {anchor.web3.PublicKey} account - The account public key to check capabilities for * @param {Role} role - The role to check (Admin or Operator) * @returns {Promise} The capability account data, or null if not found * @example * const capability = await sdk.fetchCapability(0, adminPubkey, Role.Admin); * if (capability) { * console.log("Account has admin role"); * } */ fetchCapability(configId: number, account: anchor.web3.PublicKey, role: Role): Promise; /** * Creates a versioned transaction for creating a new campaign * * This method generates a new mint account for the campaign's NFT collection, * validates the admin's capability, and prepares the transaction. * * @param {anchor.web3.PublicKey} admin - The admin's public key (must have admin role) * @param {TCreateCampaignArgs} args - The campaign creation parameters including stages, pricing, and metadata * @returns {Promise<[anchor.web3.VersionedTransaction, anchor.web3.PublicKey]>} A tuple of [transaction, mintAccountPublicKey] * @throws {Error} If config or admin capability is not found * @example * const [tx, mintPubkey] = await sdk.getCreateCampaignTransaction(adminPubkey, { * configId: 0, * campaignId: 1, * stages: [...], * priceInLamports: new BN(1000000), * // ... other args * }); */ getCreateCampaignTransaction(admin: anchor.web3.PublicKey, args: TCreateCampaignArgs): Promise<[anchor.web3.VersionedTransaction, anchor.web3.PublicKey]>; /** * Creates a versioned transaction for updating an existing campaign * * This method allows partial updates - only provided fields will be updated. * Validates the admin's capability before creating the transaction. * * @param {anchor.web3.PublicKey} admin - The admin's public key (must have admin role) * @param {TUpdateCampaignArgs} args - The campaign update parameters (all fields optional except IDs) * @returns {Promise} The prepared transaction * @throws {Error} If config or admin capability is not found * @example * const tx = await sdk.getUpdateCampaignTransaction(adminPubkey, { * configId: 0, * campaignId: 1, * status: Status.Inactive, * priceInLamports: new BN(2000000), * }); */ getUpdateCampaignTransaction(admin: anchor.web3.PublicKey, args: TUpdateCampaignArgs): Promise; /** * Creates a versioned transaction for granting a role to an account * * This creates a capability account that gives the specified account permission * to perform actions associated with the granted role (Admin or Operator). * * @param {anchor.web3.PublicKey} owner - The config owner's public key * @param {TGrantRoleArgs} args - The role grant parameters including account and role * @returns {Promise} The prepared transaction * @throws {Error} If config is not found * @example * const tx = await sdk.getGrantRoleTransaction(ownerPubkey, { * configId: 0, * accountToGrant: newAdminPubkey, * role: Role.Admin, * }); */ getGrantRoleTransaction(owner: anchor.web3.PublicKey, args: TGrantRoleArgs): Promise; /** * Creates a versioned transaction for revoking a role from an account * * This closes the capability account, removing the account's permission * to perform actions associated with the revoked role. * * @param {anchor.web3.PublicKey} owner - The config owner's public key * @param {TRevokeRoleArgs} args - The role revoke parameters including account and role * @returns {Promise} The prepared transaction * @throws {Error} If config is not found * @example * const tx = await sdk.getRevokeRoleTransaction(ownerPubkey, { * configId: 0, * accountToRevoke: oldAdminPubkey, * role: Role.Admin, * }); */ getRevokeRoleTransaction(owner: anchor.web3.PublicKey, args: TRevokeRoleArgs): Promise; /** * Checks if an account has a specific role * * This is a convenience method that fetches the capability and returns * a boolean indicating whether the account has the specified role. * * @param {number} configId - The configuration ID * @param {anchor.web3.PublicKey} account - The account to check * @param {Role} role - The role to check for * @returns {Promise} True if the account has the role, false otherwise * @example * const isAdmin = await sdk.hasRole(0, userPubkey, Role.Admin); * if (isAdmin) { * console.log("User has admin privileges"); * } */ hasRole(configId: number, account: anchor.web3.PublicKey, role: Role): Promise; /** * Creates a Version 0 transaction from instructions * * This is a helper method that compiles transaction instructions into a * versioned transaction with the latest blockhash. Optionally signs the * transaction with provided keypairs (e.g., for mint accounts). * * @param {anchor.web3.TransactionInstruction[]} ixs - Array of transaction instructions * @param {anchor.web3.PublicKey} payer - The transaction fee payer's public key * @param {anchor.web3.Keypair[]} [signers=[]] - Optional array of keypairs to sign the transaction * @returns {Promise} The compiled and optionally signed transaction * @example * const tx = await sdk.createAndSendV0Tx( * [instruction1, instruction2], * payerPubkey, * [mintKeypair] * ); */ createAndSendV0Tx(ixs: anchor.web3.TransactionInstruction[], payer: anchor.web3.PublicKey, signers?: anchor.web3.Keypair[]): Promise; /** * Confirms a transaction by polling for its status * * Continuously polls the transaction status until it reaches the desired * confirmation level or times out. Returns immediately if finalized. * * @param {anchor.web3.Connection} connection - The Solana connection to use * @param {anchor.web3.TransactionSignature} signature - The transaction signature to confirm * @param {anchor.web3.TransactionConfirmationStatus} [desiredConfirmationStatus="confirmed"] - The desired confirmation level (processed/confirmed/finalized) * @param {number} [timeout=30000] - Maximum time to wait in milliseconds * @param {number} [pollInterval=1000] - How often to check status in milliseconds * @param {boolean} [searchTransactionHistory=false] - Whether to search historical transactions * @returns {Promise} The transaction status once confirmed * @throws {Error} If transaction fails, status cannot be fetched, or confirmation times out * @example * const status = await sdk.confirmTransaction( * connection, * signature, * "finalized", * 60000 * ); */ confirmTransaction(connection: anchor.web3.Connection, signature: anchor.web3.TransactionSignature, desiredConfirmationStatus?: anchor.web3.TransactionConfirmationStatus, timeout?: number, pollInterval?: number, searchTransactionHistory?: boolean): Promise; /** * Sends a transaction to the network and waits for confirmation * * This is a convenience method that combines sending and confirming a transaction. * It will retry sending up to 5 times and wait for confirmation before returning. * * @param {anchor.web3.VersionedTransaction} transaction - The versioned transaction to send * @returns {Promise} Resolves when transaction is confirmed * @throws {Error} If transaction fails or cannot be confirmed * @example * const [tx] = await sdk.getCreateCampaignTransaction(admin, args); * // Sign the transaction with your wallet first * await sdk.sendAndConfirmTransaction(tx); * console.log("Campaign created successfully!"); */ sendAndConfirmTransaction(transaction: anchor.web3.VersionedTransaction): Promise; } declare class MoonshotBlindboxV2 { private readonly skipSimulation; private readonly rpc; private readonly estimateAndSetComputeUnitLimit; constructor(rpcUrl: string, skipSimulation?: boolean); /** * Creates a transaction to grant a role to an account. * @param signer - The signer of the transaction * @param args - The arguments for the grant role transaction * @param args.configId - The ID of the config * @param args.accountToGrant - The address of the account to grant the role to * @param args.role - The role to grant * @returns The grant role transaction */ getGrantRoleTransaction(signer: Address, args: GrantRoleArgs): Promise; /** * Creates a transaction to revoke a role from an account. * @param signer - The signer of the transaction * @param args - The arguments for the revoke role transaction * @param args.configId - The ID of the config * @param args.accountToRevoke - The address of the account to revoke the role from * @param args.role - The role to revoke * @returns The revoke role transaction */ getRevokeRoleTransaction(signer: Address, args: RevokeRoleArgs): Promise; /** * Creates a transaction to create a campaign. * @param signer - The signer of the transaction * @param args - The arguments for the create campaign transaction * @param args.configId - The ID of the config * @param args.campaignId - The ID of the campaign * @param args.mintAccount - The mint account for the campaign * @returns The create campaign transaction */ getCreateCampaignTransaction(signer: Address, args: CreateCampaignArgs): Promise; /** * Creates a transaction to update a campaign. * @param signer - The signer of the transaction * @param args - The arguments for the update campaign transaction * @param args.configId - The ID of the config * @param args.campaignId - The ID of the campaign * @returns The update campaign transaction */ getUpdateCampaignTransaction(signer: Address, args: UpdateCampaignArgs): Promise; getLatestBlockhash(): Promise>; createV0Transaction(ixs: Instruction[], signer: Address): Promise; } /** * Factory function that creates a compute unit estimator and setter. * * This function wraps the Solana compute unit estimation with automatic * instruction injection to set the compute unit limit on transactions. * * @param params - Parameters for the compute unit limit factory * @returns A function that estimates and sets compute units for transactions */ declare function estimateAndSetComputeUnitLimitFactory(...params: Parameters): (transactionMessage: T) => Promise, "instructions"> & { readonly instructions: readonly [...T["instructions"], _solana_program_compute_budget.SetComputeUnitLimitInstruction<_solana_kit.Address<"ComputeBudget111111111111111111111111111111">, []>]; }>; /** * Parses and extracts event CPI instruction data from a Solana transaction. * * This function fetches a transaction by signature and extracts the event * Cross-Program Invocation (CPI) instruction that contains the event authority. * * @param rpcUrl - The Solana RPC endpoint URL * @param signature - The transaction signature to parse * @param commitment - The commitment level for fetching the transaction (default: "confirmed") * @returns The event CPI instruction data * @throws Error if transaction is not found or no events are found */ declare function parseTransactionEventCPI(rpcUrl: string, signature: Signature, commitment?: Commitment): Promise<{ data: any; name: string; }>; export { BUY_DISCRIMINATOR, CAMPAIGN_DISCRIMINATOR, CAPABILITY_DISCRIMINATOR, CONFIG_DISCRIMINATOR, CREATE_CAMPAIGN_DISCRIMINATOR, EventParser, GRANT_ROLE_DISCRIMINATOR, INITIALIZE_CONFIG_DISCRIMINATOR, METAPLEX_TOKEN_METADATA_PROGRAM_ADDRESS, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ACCOUNT, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_AMOUNT, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_CAMPAIGN_ID, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEMS_STOCK, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_ID, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_ITEM_METADATA, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_PROOF, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_STATUS, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__INVALID_TIMESTAMP, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_EXCEEDED, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__MAX_ITEMS_PER_USER_PER_STAGE_EXCEEDED, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__NO_ITEMS_AVAILABLE, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OUT_OF_CAMPAIGN_DURATION, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__OVERFLOW, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__PURCHASE_LIMIT_EXCEEDED, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_CONTENTS, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_ITEMS, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__TOO_MANY_STAGES, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNAUTHORIZED, MOONSHOT_BLINDBOX_SMART_CONTRACT_ERROR__UNDERFLOW, MOONSHOT_BLINDBOX_SMART_CONTRACT_PROGRAM_ADDRESS, MoonshotBlindbox, MoonshotBlindboxLegacy, MoonshotBlindboxSmartContractAccount, MoonshotBlindboxSmartContractInstruction, MoonshotBlindboxV2, NFT_AUTHORITY_DISCRIMINATOR, REVOKE_ROLE_DISCRIMINATOR, Role, Status, UPDATE_CAMPAIGN_DISCRIMINATOR, UPDATE_CAMPAIGN_METADATA_DISCRIMINATOR, UPDATE_CONFIG_DISCRIMINATOR, USER_DISCRIMINATOR, decodeCampaign, decodeCapability, decodeConfig, decodeNftAuthority, decodeUser, estimateAndSetComputeUnitLimitFactory, fetchAllCampaign, fetchAllCapability, fetchAllConfig, fetchAllMaybeCampaign, fetchAllMaybeCapability, fetchAllMaybeConfig, fetchAllMaybeNftAuthority, fetchAllMaybeUser, fetchAllNftAuthority, fetchAllUser, fetchCampaign, fetchCapability, fetchConfig, fetchMaybeCampaign, fetchMaybeCapability, fetchMaybeConfig, fetchMaybeNftAuthority, fetchMaybeUser, fetchNftAuthority, fetchUser, getBuyArgsCodec, getBuyArgsDecoder, getBuyArgsEncoder, getBuyDiscriminatorBytes, getBuyEventCodec, getBuyEventDecoder, getBuyEventEncoder, getBuyInstruction, getBuyInstructionAsync, getBuyInstructionDataCodec, getBuyInstructionDataDecoder, getBuyInstructionDataEncoder, getBuyTransactionFee, getCampaignAddress, getCampaignCodec, getCampaignDecoder, getCampaignDiscriminatorBytes, getCampaignEncoder, getCampaignItemAddress, getCapabilityAddress, getCapabilityCodec, getCapabilityDecoder, getCapabilityDiscriminatorBytes, getCapabilityEncoder, getConfigAddress, getConfigCodec, getConfigDecoder, getConfigDiscriminatorBytes, getConfigEncoder, getCreateCampaignArgsCodec, getCreateCampaignArgsDecoder, getCreateCampaignArgsEncoder, getCreateCampaignDiscriminatorBytes, getCreateCampaignEventCodec, getCreateCampaignEventDecoder, getCreateCampaignEventEncoder, getCreateCampaignInstruction, getCreateCampaignInstructionAsync, getCreateCampaignInstructionDataCodec, getCreateCampaignInstructionDataDecoder, getCreateCampaignInstructionDataEncoder, getEventAuthorityAddress, getGrantRoleArgsCodec, getGrantRoleArgsDecoder, getGrantRoleArgsEncoder, getGrantRoleDiscriminatorBytes, getGrantRoleEventCodec, getGrantRoleEventDecoder, getGrantRoleEventEncoder, getGrantRoleInstruction, getGrantRoleInstructionAsync, getGrantRoleInstructionDataCodec, getGrantRoleInstructionDataDecoder, getGrantRoleInstructionDataEncoder, getInitializeConfigArgsCodec, getInitializeConfigArgsDecoder, getInitializeConfigArgsEncoder, getInitializeConfigDiscriminatorBytes, getInitializeConfigInstruction, getInitializeConfigInstructionAsync, getInitializeConfigInstructionDataCodec, getInitializeConfigInstructionDataDecoder, getInitializeConfigInstructionDataEncoder, getInitializeEventCodec, getInitializeEventDecoder, getInitializeEventEncoder, getMasterEditionAddress, getMetadataCodec, getMetadataDecoder, getMetadataEncoder, getMoonshotBlindboxSmartContractErrorMessage, getNftAuthorityAddress, getNftAuthorityCodec, getNftAuthorityDecoder, getNftAuthorityDiscriminatorBytes, getNftAuthorityEncoder, getRevokeRoleArgsCodec, getRevokeRoleArgsDecoder, getRevokeRoleArgsEncoder, getRevokeRoleDiscriminatorBytes, getRevokeRoleEventCodec, getRevokeRoleEventDecoder, getRevokeRoleEventEncoder, getRevokeRoleInstruction, getRevokeRoleInstructionAsync, getRevokeRoleInstructionDataCodec, getRevokeRoleInstructionDataDecoder, getRevokeRoleInstructionDataEncoder, getRoleCodec, getRoleDecoder, getRoleEncoder, getStageCodec, getStageDecoder, getStageEncoder, getStatusCodec, getStatusDecoder, getStatusEncoder, getTokenMetadataAddress, getUpdateCampaignArgsCodec, getUpdateCampaignArgsDecoder, getUpdateCampaignArgsEncoder, getUpdateCampaignDiscriminatorBytes, getUpdateCampaignEventCodec, getUpdateCampaignEventDecoder, getUpdateCampaignEventEncoder, getUpdateCampaignInstruction, getUpdateCampaignInstructionAsync, getUpdateCampaignInstructionDataCodec, getUpdateCampaignInstructionDataDecoder, getUpdateCampaignInstructionDataEncoder, getUpdateCampaignMetadataArgsCodec, getUpdateCampaignMetadataArgsDecoder, getUpdateCampaignMetadataArgsEncoder, getUpdateCampaignMetadataDiscriminatorBytes, getUpdateCampaignMetadataEventCodec, getUpdateCampaignMetadataEventDecoder, getUpdateCampaignMetadataEventEncoder, getUpdateCampaignMetadataInstruction, getUpdateCampaignMetadataInstructionAsync, getUpdateCampaignMetadataInstructionDataCodec, getUpdateCampaignMetadataInstructionDataDecoder, getUpdateCampaignMetadataInstructionDataEncoder, getUpdateConfigArgsCodec, getUpdateConfigArgsDecoder, getUpdateConfigArgsEncoder, getUpdateConfigDiscriminatorBytes, getUpdateConfigEventCodec, getUpdateConfigEventDecoder, getUpdateConfigEventEncoder, getUpdateConfigInstruction, getUpdateConfigInstructionAsync, getUpdateConfigInstructionDataCodec, getUpdateConfigInstructionDataDecoder, getUpdateConfigInstructionDataEncoder, getUserAddress, getUserCodec, getUserDecoder, getUserDiscriminatorBytes, getUserEncoder, identifyMoonshotBlindboxSmartContractAccount, identifyMoonshotBlindboxSmartContractInstruction, isMoonshotBlindboxSmartContractError, parseBuyInstruction, parseCreateCampaignInstruction, parseGrantRoleInstruction, parseInitializeConfigInstruction, parseRevokeRoleInstruction, parseTransactionEventCPI, parseUpdateCampaignInstruction, parseUpdateCampaignMetadataInstruction, parseUpdateConfigInstruction, roles, statuses }; export type { BuyArgs, BuyArgsArgs, BuyAsyncInput, BuyEvent, BuyEventArgs, BuyInput, BuyInstruction, BuyInstructionData, BuyInstructionDataArgs, Campaign, CampaignArgs, Capability, CapabilityArgs, Config, ConfigArgs, CreateCampaignArgs, CreateCampaignArgsArgs, CreateCampaignAsyncInput, CreateCampaignEvent, CreateCampaignEventArgs, CreateCampaignInput, CreateCampaignInstruction, CreateCampaignInstructionData, CreateCampaignInstructionDataArgs, GrantRoleArgs, GrantRoleArgsArgs, GrantRoleAsyncInput, GrantRoleEvent, GrantRoleEventArgs, GrantRoleInput, GrantRoleInstruction, GrantRoleInstructionData, GrantRoleInstructionDataArgs, InitializeConfigArgs, InitializeConfigArgsArgs, InitializeConfigAsyncInput, InitializeConfigInput, InitializeConfigInstruction, InitializeConfigInstructionData, InitializeConfigInstructionDataArgs, InitializeEvent, InitializeEventArgs, Metadata, MetadataArgs, MoonshotBlindboxSmartContractError, NftAuthority, NftAuthorityArgs, ParsedBuyInstruction, ParsedCreateCampaignInstruction, ParsedGrantRoleInstruction, ParsedInitializeConfigInstruction, ParsedMoonshotBlindboxSmartContractInstruction, ParsedRevokeRoleInstruction, ParsedUpdateCampaignInstruction, ParsedUpdateCampaignMetadataInstruction, ParsedUpdateConfigInstruction, RevokeRoleArgs, RevokeRoleArgsArgs, RevokeRoleAsyncInput, RevokeRoleEvent, RevokeRoleEventArgs, RevokeRoleInput, RevokeRoleInstruction, RevokeRoleInstructionData, RevokeRoleInstructionDataArgs, RoleArgs, Stage, StageArgs, StatusArgs, TCreateCampaignArgs, TGrantRoleArgs, TMetadata, TRevokeRoleArgs, TStage, TUpdateCampaignArgs, UpdateCampaignArgs, UpdateCampaignArgsArgs, UpdateCampaignAsyncInput, UpdateCampaignEvent, UpdateCampaignEventArgs, UpdateCampaignInput, UpdateCampaignInstruction, UpdateCampaignInstructionData, UpdateCampaignInstructionDataArgs, UpdateCampaignMetadataArgs, UpdateCampaignMetadataArgsArgs, UpdateCampaignMetadataAsyncInput, UpdateCampaignMetadataEvent, UpdateCampaignMetadataEventArgs, UpdateCampaignMetadataInput, UpdateCampaignMetadataInstruction, UpdateCampaignMetadataInstructionData, UpdateCampaignMetadataInstructionDataArgs, UpdateConfigArgs, UpdateConfigArgsArgs, UpdateConfigAsyncInput, UpdateConfigEvent, UpdateConfigEventArgs, UpdateConfigInput, UpdateConfigInstruction, UpdateConfigInstructionData, UpdateConfigInstructionDataArgs, User, UserArgs };