UNPKG

@ghostspeak/sdk

Version:

TypeScript SDK for GhostSpeak AI Agent Commerce Protocol - Production Ready Beta

1,195 lines (1,086 loc) 84.5 kB
import { Address, Option, ReadonlyUint8Array, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, WritableSignerAccount, AccountSignerMeta, ReadonlyAccount, ReadonlySignerAccount, Rpc, GetLatestBlockhashApi, SendTransactionApi, GetAccountInfoApi, SimulateTransactionApi, GetFeeForMessageApi, GetProgramAccountsApi, GetEpochInfoApi, GetSignatureStatusesApi, GetMultipleAccountsApi, RpcSubscriptions, SignatureNotificationsApi, SlotNotificationsApi, AccountRole, TransactionSigner, Signature as Signature$1 } from '@solana/kit'; import { Address as Address$1 } from '@solana/addresses'; import { IInstruction } from '@solana/instructions'; /** * 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 AccountState { Uninitialized = 0, Initialized = 1, Frozen = 2 } /** * 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 ApplicationStatus { Submitted = 0, Accepted = 1, Rejected = 2, Withdrawn = 3 } /** * 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 AuctionBid = { bidder: Address; amount: bigint; timestamp: bigint; isWinning: boolean; }; /** * 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 AuctionStatus { Active = 0, Ended = 1, Cancelled = 2, Settled = 3 } /** * 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 AuctionType { English = 0, Dutch = 1, SealedBid = 2, Vickrey = 3 } /** * 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 */ /** Types of execution conditions */ declare enum ConditionType { TimeDelay = 0, TokenBalance = 1, PriceThreshold = 2, VoteCount = 3, ExternalOracle = 4, CustomLogic = 5 } /** * 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 */ /** Vote delegation information */ type DelegationInfo = { /** Original delegator */ delegator: Address; /** Delegation timestamp */ delegatedAt: bigint; /** Delegation scope */ scope: DelegationScope; /** Delegation expiry */ expiresAt: Option<bigint>; }; /** * 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 */ /** Scope of vote delegation */ type DelegationScope = { __kind: 'All'; } | { __kind: 'ProposalType'; fields: readonly [ProposalType]; } | { __kind: 'SingleProposal'; } | { __kind: 'Limited'; }; /** * 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 DutchAuctionConfig = { decayType: DutchAuctionDecayType; priceStepCount: number; stepDuration: bigint; decayRateBasisPoints: number; }; /** * 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 DutchAuctionDecayType { Linear = 0, Exponential = 1, Stepped = 2 } /** * 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 */ /** Execution conditions for transactions */ type ExecutionCondition = { /** Condition type */ conditionType: ConditionType; /** Target value/threshold */ targetValue: bigint; /** Current value */ currentValue: bigint; /** Condition met */ met: boolean; /** Condition description */ description: string; }; /** * 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 */ /** Execution parameters for proposals */ type ExecutionParams = { /** Instructions to execute if passed */ instructions: Array<ProposalInstruction>; /** Time delay before execution */ executionDelay: bigint; /** Execution conditions */ executionConditions: Array<ExecutionCondition>; /** Can be cancelled after approval */ cancellable: boolean; /** Automatic execution enabled */ autoExecute: boolean; /** Required execution authority */ executionAuthority: Address; }; /** * 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 */ /** Account specification for proposal instruction */ type ProposalAccount = { /** Account public key */ pubkey: Address; /** Is signer required */ isSigner: boolean; /** Is writable */ isWritable: boolean; /** Account description */ description: string; }; /** * 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 */ /** Individual instruction in proposal */ type ProposalInstruction = { /** Target program */ programId: Address; /** Accounts required */ accounts: Array<ProposalAccount>; /** Instruction data */ data: ReadonlyUint8Array; /** Instruction description */ description: string; }; /** * 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 */ /** Proposal metadata */ type ProposalMetadata = { /** IPFS hash for detailed proposal */ ipfsHash: Option<string>; /** External references */ externalReferences: Array<string>; /** Proposal tags */ tags: Array<string>; /** Risk assessment */ riskAssessment: Option<string>; /** Impact analysis */ impactAnalysis: Option<string>; /** Implementation timeline */ implementationTimeline: Option<string>; }; /** * 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 */ /** Proposal execution status */ declare enum ProposalStatus { Draft = 0, Active = 1, Passed = 2, Failed = 3, Executed = 4, Cancelled = 5, Expired = 6, Queued = 7 } /** * 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 */ /** Types of governance proposals */ declare enum ProposalType { ParameterUpdate = 0, ProtocolUpgrade = 1, TreasuryOperation = 2, FeeUpdate = 3, SecurityUpdate = 4, GovernanceUpdate = 5, EmergencyAction = 6, Custom = 7 } /** * 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 PurchaseStatus { Pending = 0, Confirmed = 1, Completed = 2, Cancelled = 3, Paid = 4 } /** * 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 */ /** Methods for calculating quorum */ declare enum QuorumMethod { Absolute = 0, Relative = 1, Weighted = 2, Dynamic = 3 } /** * 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 */ /** Quorum requirements for proposals */ type QuorumRequirements = { /** Minimum participation rate (0-100) */ minimumParticipation: number; /** Approval threshold (0-100) */ approvalThreshold: number; /** Super majority required */ superMajorityRequired: boolean; /** Minimum total voting power */ minimumVotingPower: bigint; /** Quorum calculation method */ quorumMethod: QuorumMethod; }; /** * 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 */ /** Individual vote record */ type Vote = { /** Voter public key */ voter: Address; /** Vote choice */ choice: VoteChoice; /** Voting power used */ votingPower: bigint; /** Vote timestamp */ votedAt: bigint; /** Vote reasoning (optional) */ reasoning: Option<string>; /** Delegation info (if delegated vote) */ delegationInfo: Option<DelegationInfo>; }; /** * 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 */ /** Vote choices */ declare enum VoteChoice { For = 0, Against = 1, Abstain = 2 } /** * 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 */ /** Voting results for proposal */ type VotingResults = { /** Total votes for */ votesFor: bigint; /** Total votes against */ votesAgainst: bigint; /** Total votes abstain */ votesAbstain: bigint; /** Total voting power */ totalVotingPower: bigint; /** Participation rate */ participationRate: number; /** Individual votes */ individualVotes: Array<Vote>; /** Weighted voting enabled */ weightedVoting: boolean; /** Quorum reached */ quorumReached: boolean; /** Approval threshold met */ approvalThresholdMet: boolean; }; /** * 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 AuctionMarketplace = { discriminator: ReadonlyUint8Array; auction: Address; agent: Address; creator: Address; auctionType: AuctionType; startingPrice: bigint; reservePrice: bigint; isReserveHidden: boolean; reserveMet: boolean; currentPrice: bigint; currentWinner: Option<Address>; winner: Option<Address>; auctionEndTime: bigint; minimumBidIncrement: bigint; totalBids: number; status: AuctionStatus; bids: Array<AuctionBid>; createdAt: bigint; endedAt: Option<bigint>; metadataUri: string; dutchConfig: Option<DutchAuctionConfig>; extensionCount: number; originalEndTime: bigint; reservePriceLocked: boolean; reserveShortfallNotified: boolean; bump: number; }; /** * 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 GovernanceProposal = { discriminator: ReadonlyUint8Array; /** Proposal ID */ proposalId: bigint; /** Proposer */ proposer: Address; /** Proposal title */ title: string; /** Proposal description */ description: string; /** Proposal type */ proposalType: ProposalType; /** Creation timestamp */ createdAt: bigint; /** Voting start timestamp */ votingStartsAt: bigint; /** Voting end timestamp */ votingEndsAt: bigint; /** Execution timestamp (if approved) */ executionTimestamp: Option<bigint>; /** Proposal status */ status: ProposalStatus; /** Voting results */ votingResults: VotingResults; /** Execution parameters */ executionParams: ExecutionParams; /** Quorum requirements */ quorumRequirements: QuorumRequirements; /** Proposal metadata */ metadata: ProposalMetadata; /** Reserved space */ reserved: ReadonlyUint8Array; }; /** * 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 JobApplication = { discriminator: ReadonlyUint8Array; jobPosting: Address; agent: Address; agentOwner: Address; coverLetter: string; proposedRate: bigint; estimatedDelivery: bigint; portfolioItems: Array<string>; status: ApplicationStatus; appliedAt: bigint; bump: number; }; /** * 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 JobPosting = { discriminator: ReadonlyUint8Array; employer: Address; title: string; description: string; requirements: Array<string>; budget: bigint; deadline: bigint; skillsNeeded: Array<string>; budgetMin: bigint; budgetMax: bigint; paymentToken: Address; jobType: string; experienceLevel: string; isActive: boolean; applicationsCount: number; createdAt: bigint; updatedAt: bigint; bump: number; }; /** * 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 ServiceListing = { discriminator: ReadonlyUint8Array; agent: Address; owner: Address; title: string; description: string; price: bigint; tokenMint: Address; serviceType: string; paymentToken: Address; estimatedDelivery: bigint; tags: Array<string>; isActive: boolean; totalOrders: number; rating: number; createdAt: bigint; updatedAt: bigint; transferHook: Option<Address>; bump: number; }; /** * 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 ServicePurchase = { discriminator: ReadonlyUint8Array; customer: Address; agent: Address; listing: Address; listingId: bigint; quantity: number; requirements: Array<string>; customInstructions: string; deadline: bigint; paymentAmount: bigint; paymentToken: Address; status: PurchaseStatus; purchasedAt: bigint; updatedAt: bigint; transferHookApplied: boolean; bump: number; }; /** * 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 GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS: Address<"GssMyhkQPePLzByJsJadbQePZc6GtzGi22aQqW5opvUX">; /** * 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 AcceptJobApplicationInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountJobContract extends string | AccountMeta<string> = string, TAccountJobPosting extends string | AccountMeta<string> = string, TAccountJobApplication extends string | AccountMeta<string> = string, TAccountEmployer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountJobContract extends string ? WritableAccount<TAccountJobContract> : TAccountJobContract, TAccountJobPosting extends string ? WritableAccount<TAccountJobPosting> : TAccountJobPosting, TAccountJobApplication extends string ? WritableAccount<TAccountJobApplication> : TAccountJobApplication, TAccountEmployer extends string ? WritableSignerAccount<TAccountEmployer> & AccountSignerMeta<TAccountEmployer> : TAccountEmployer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * 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 ApplyToJobInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountJobApplication extends string | AccountMeta<string> = string, TAccountJobPosting extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountAgentOwner extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountJobApplication extends string ? WritableAccount<TAccountJobApplication> : TAccountJobApplication, TAccountJobPosting extends string ? WritableAccount<TAccountJobPosting> : TAccountJobPosting, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountAgentOwner extends string ? WritableSignerAccount<TAccountAgentOwner> & AccountSignerMeta<TAccountAgentOwner> : TAccountAgentOwner, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * 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 ApproveExtensionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountExtension extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountClock extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountExtension extends string ? WritableAccount<TAccountExtension> : TAccountExtension, TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock, ...TRemainingAccounts ]>; /** * 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 CastVoteInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountVoter extends string | AccountMeta<string> = string, TAccountVoterTokenAccount extends string | AccountMeta<string> = string, TAccountDelegateTokenAccount extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal, TAccountVoter extends string ? WritableSignerAccount<TAccountVoter> & AccountSignerMeta<TAccountVoter> : TAccountVoter, TAccountVoterTokenAccount extends string ? ReadonlyAccount<TAccountVoterTokenAccount> : TAccountVoterTokenAccount, TAccountDelegateTokenAccount extends string ? ReadonlyAccount<TAccountDelegateTokenAccount> : TAccountDelegateTokenAccount, ...TRemainingAccounts ]>; /** * 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 CreateJobPostingInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountJobPosting extends string | AccountMeta<string> = string, TAccountEmployer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountJobPosting extends string ? WritableAccount<TAccountJobPosting> : TAccountJobPosting, TAccountEmployer extends string ? WritableSignerAccount<TAccountEmployer> & AccountSignerMeta<TAccountEmployer> : TAccountEmployer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * 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 CreateServiceAuctionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountClock extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountUserRegistry extends string ? ReadonlyAccount<TAccountUserRegistry> : TAccountUserRegistry, TAccountCreator extends string ? WritableSignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock, ...TRemainingAccounts ]>; /** * 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 CreateServiceListingInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountServiceListing extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountClock extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountServiceListing extends string ? WritableAccount<TAccountServiceListing> : TAccountServiceListing, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountUserRegistry extends string ? WritableAccount<TAccountUserRegistry> : TAccountUserRegistry, TAccountCreator extends string ? WritableSignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock, ...TRemainingAccounts ]>; /** * 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 CreateToken2022MintInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountMint extends string ? WritableSignerAccount<TAccountMint> & AccountSignerMeta<TAccountMint> : TAccountMint, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent, ...TRemainingAccounts ]>; /** * 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 DelegateVoteInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountDelegator extends string | AccountMeta<string> = string, TAccountDelegate extends string | AccountMeta<string> = string, TAccountDelegatorTokenAccount extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal, TAccountDelegator extends string ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator> : TAccountDelegator, TAccountDelegate extends string ? ReadonlyAccount<TAccountDelegate> : TAccountDelegate, TAccountDelegatorTokenAccount extends string ? ReadonlyAccount<TAccountDelegatorTokenAccount> : TAccountDelegatorTokenAccount, ...TRemainingAccounts ]>; /** * 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 ExecuteProposalInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountExecutor extends string | AccountMeta<string> = string, TAccountTargetProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal, TAccountExecutor extends string ? WritableSignerAccount<TAccountExecutor> & AccountSignerMeta<TAccountExecutor> : TAccountExecutor, TAccountTargetProgram extends string ? ReadonlyAccount<TAccountTargetProgram> : TAccountTargetProgram, ...TRemainingAccounts ]>; /** * 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 FinalizeAuctionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountClock extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction, TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock, ...TRemainingAccounts ]>; /** * 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 InitializeConfidentialTransferMintInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, ...TRemainingAccounts ]>; /** * 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 InitializeDefaultAccountStateInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, ...TRemainingAccounts ]>; /** * 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 InitializeGovernanceProposalInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountProposer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal, TAccountProposer extends string ? WritableSignerAccount<TAccountProposer> & AccountSignerMeta<TAccountProposer> : TAccountProposer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * 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 InitializeInterestBearingConfigInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountRateAuthority extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountRateAuthority extends string ? ReadonlyAccount<TAccountRateAuthority> : TAccountRateAuthority, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, ...TRemainingAccounts ]>; /** * 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 InitializeMintCloseAuthorityInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountCloseAuthority extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountCloseAuthority extends string ? ReadonlyAccount<TAccountCloseAuthority> : TAccountCloseAuthority, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, ...TRemainingAccounts ]>; /** * 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 InitializeTransferFeeConfigInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint, TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent, TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram, ...TRemainingAccounts ]>; /** * 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 PlaceAuctionBidInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountBidder extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountClock extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction, TAccountUserRegistry extends string ? ReadonlyAccount<TAccountUserRegistry> : TAccountUserRegistry, TAccountBidder extends string ? WritableSignerAccount<TAccountBidder> & AccountSignerMeta<TAccountBidder> : TAccountBidder, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock, ...TRemainingAccounts ]>; /** * 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 PurchaseServiceInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountServicePurchase extends string | AccountMeta<string> = string, TAccountServiceListing extends string | AccountMeta<string> = string, TAccountBuyer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountServicePurchase extends string ? WritableAccount<TAccountServicePurchase> : TAccountServicePurchase, TAccountServiceListing extends string ? WritableAccount<TAccountServiceListing> : TAccountServiceListing, TAccountBuyer extends string ? WritableSignerAccount<TAccountBuyer> & AccountSignerMeta<TAccountBuyer> : TAccountBuyer, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * 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 TallyVotesInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal, TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, ...TRemainingAccounts ]>; /** * 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 UpdateAgentServiceInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAgent extends string | AccountMeta<string> = string, TAccountOwner extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[ TAccountAgent extends string ? WritableAccount<TAccountAgent> : TAccountAgent, TAccountOwner extends string ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts ]>; /** * IPFS configuration and types for GhostSpeak SDK */ /** * IPFS provider configuration */ interface IPFSProviderConfig { /** Provider name */ name: 'pinata' | 'infura' | 'ipfs-http-client' | 'web3-storage' | 'custom' | 'test'; /** API endpoint URL */ endpoint?: string; /** API key for authentication */ apiKey?: string; /** API secret for authentication */ apiSecret?: string; /** JWT token for authentication */ jwt?: string; /** Custom headers */ headers?: Record<string, string>; /** Request timeout in milliseconds */ timeout?: number; } /** * IPFS client configuration */ interface IPFSConfig { /** Primary provider */ provider: IPFSProviderConfig; /** Fallback providers */ fallbackProviders?: IPFSProviderConfig[]; /** Default IPFS gateway for retrieving content */ gateway?: string; /** Additional gateways for redundancy */ gateways?: string[]; /** Whether to automatically pin uploaded content */ autoPinning?: boolean; /** Content size threshold for IPFS (bytes) - content above this will use IPFS */ sizeThreshold?: number; /** Maximum retry attempts for failed operations */ maxRetries?: number; /** Retry delay in milliseconds */ retryDelay?: number; /** Enable caching of IPFS content */ enableCache?: boolean; /** Cache TTL in milliseconds */ cacheTTL?: number; } type RpcApi = Rpc<GetLatestBlockhashApi & SendTransactionApi & GetAccountInfoApi & SimulateTransactionApi & GetFeeForMessageApi & GetProgramAccountsApi>; type ExtendedRpcApi = RpcApi & Rpc<GetEpochInfoApi & GetSignatureStatusesApi & GetMultipleAccountsApi>; type RpcSubscriptionApi = RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>; type Commitment = 'processed' | 'confirmed' | 'finalized'; interface GhostSpeakConfig { programId?: Address$1; rpc: ExtendedRpcApi; rpcSubscriptions?: RpcSubscriptionApi; commitment?: Commitment; transactionTimeout?: number; defaultFeePayer?: Address$1; retryConfig?: RetryConfig; cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet'; rpcEndpoint?: string; wsEndpoint?: string; /** Token 2022 configuration options */ token2022?: Token2022Config; /** IPFS configuration for large content storage */ ipfsConfig?: IPFSConfig; } interface Token2022Config { /** Enable Token 2022 features by default */ enabled?: boolean; /** Default behavior for transfer fees */ defaultExpectTransferFees?: boolean; /** Maximum transfer fee slippage (basis points) */ maxFeeSlippageBasisPoints?: number; /** Enable confidential transfers by default */ enableConfidentialTransfers?: boolean; /** Default Token 2022 program address (for custom deployments) */ programAddress?: Address$1; /** Cache token program detection results for this many seconds */ tokenProgramCacheTtl?: number; } interface RetryConfig { maxRetries?: number; baseDelay?: number; maxDelay?: number; backoffMultiplier?: number; retryableErrors?: string[]; } /** * Developer Tools for GhostSpeak SDK * * Provides debugging, inspection, and development utilities */ /** * Transaction analysis result */ interface TransactionAnalysis { instructions: InstructionAnalysis[]; totalAccounts: number; signerCount: number; writableAccounts: Address$1[]; readonlyAccounts: Address$1[]; estimatedSize: number; estimatedComputeUnits: bigint; estimatedFee: bigint; warnings: string[]; } /** * Individual instruction analysis */ interface InstructionAnalysis { index: number; programId: Address$1; accountCount: number; dataSize: number; humanReadable: string; accounts: AccountInfo[]; } /** * Account information in instruction */ interface AccountInfo { address: Address$1; isWritable: boolean; isSigner: boolean; role: AccountRole; } /** * Type for instruction-like objects from generated code */ type InstructionLike = { programAddress: Address$1; accounts?: readonly unknown[]; data?: unknown; }; /** * Unified instruction builder that eliminates duplication across all instruction classes. * This is the single source of truth for instruction execution patterns. */ declare class InstructionBuilder { private rpcClient; private config; private devTools; private debugMode; constructor(config: GhostSpeakConfig); /** * Execute a single instruction with unified error handling and transaction patterns */ execute<T = string>(instructionName: string, instructionGetter: () => Promise<InstructionLike> | InstructionLike, signers: TransactionSigner[], options?: { simulate?: boolean; returnDetails?: boolean; skipPreflight?: boolean; maxRetries?: number; }): Promise<T>; /** * Execute multiple instructions in a single transaction */ executeBatch<T = string>(batchName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[], signers: TransactionSigner[], options?: { simulate?: boolean; returnDetails?: boolean; skipPreflight?: boolean; }): Promise<T>; /** * Get and decode account data with unified error handling */ getAccount<T>(address: Address$1, decoderImportName: string): Promise<T | null>; /** * Get multiple accounts with unified pattern */ getAccounts<T>(addresses: Address$1[], decoderImportName: string): Promise<(T | null)[]>; /** * Get program accounts with filters */ getProgramAccounts<T>(decoderImportName: string, filters?: ({ dataSize: bigint; } | { memcmp: { offset: bigint; bytes: string; encoding?: 'base58' | 'base64'; }; })[]): Promise<{ address: Address$1; data: T; }[]>; /** * Enable debug mode for next transaction */ enableDebug(): this; /** * Debug transaction - analyze without executing */ debug(instructionName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<TransactionAnalysis>; /** * Get human-readable explanation of transaction */ explain(instructionName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<string>; /** * Estimate transaction cost */ estimateCost(instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<bigint>; private sendAndConfirm; private simulateInstruction; private simulateBatch; private estimateTransactionSize; private extractRawData; } /** * Solana cluster types for URL generation */ type SolanaCluster = 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet'; /** * Transaction result with verification URLs */ interface TransactionResult { signature: