import { P as PrivacyMode, R as ReputationTier, S as ScoreRange, a as PrivacySettings, M as MetricVisibility, V as VisibleReputation } from './GhostSpeakClient-qdLGyuDp.js'; export { j as ApplyPresetParams, A as AuthorizationModule, G as GhostSpeakClient, h as GrantAccessParams, I as InitializePrivacyParams, n as IssuedCredentialResult, e as PRIVACY_CONSTANTS, b as PrivacyModule, f as PrivacyPreset, d as PrivacyPresets, i as RevokeAccessParams, g as SetMetricVisibilityParams, m as UnifiedCredentialConfig, k as UnifiedCredentialService, U as UpdatePrivacyModeParams, c as VisibilityLevel, G as default, l as lamportsToSol, s as sol } from './GhostSpeakClient-qdLGyuDp.js'; import { Address, ReadonlyUint8Array, Option, Decoder, TransactionSigner, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, ReadonlySignerAccount, AccountSignerMeta, ReadonlyAccount, OptionOrNullable, WritableSignerAccount, Slot, Lamports, Epoch, Base58EncodedBytes, Base64EncodedBytes, TransactionError, Base64EncodedWireTransaction, Signature, TransactionMessageBytesBase64, Commitment as Commitment$1, KeyPairSigner } from '@solana/kit'; export { TransactionSigner, address, createKeyPairSignerFromBytes, createSolanaRpc, generateKeyPairSigner } from '@solana/kit'; export { AddressOf, Agent, AgentCreationParams, AgentEvent, AgentMetadata, AgentType, Attachment, Channel, ChannelCreationParams, ChannelEvent, ChannelType, CommunicationMessage, CommunicationSession, ConfidentialBalance, ConfidentialTransfer, CreateCommunicationSessionParams, DeepPartial, ErrorCode, Escrow, EscrowCreationParams, EscrowEvent, Event, FilterOptions, Message, MessageType, Milestone, PaginationOptions, ParticipantStatus, ParticipantType, QueryResult, Rating, Reaction, Reputation, Result, SDKError, SendCommunicationMessageParams, SimulationResult, Transaction, TransferProof, UpdateParticipantStatusParams, WithAddress, isError, isSuccess, unwrap } from './types.js'; export { AccountNotFoundError, ErrorFactory, ErrorHandler, InsufficientBalanceError, InvalidInputError, NetworkError, SimulationFailedError, TimeoutError, TransactionFailedError, ValidationError } from './errors.js'; import { c as AccessTier, d as GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, P as PricingModelArgs, E as ExtendedRpcApi, B as BaseModule } from './StakingModule-CPhp_ZY0.js'; export { a8 as AgentAccount, A as AgentModule, a7 as AgentRegistrationData, a6 as AgentWithAddress, e as CacheConfig, C as CacheManager, f as ClaimGhostParams, am as Commitment, a0 as CreateDidDocumentParams, j as CreateProposalParams, p as Credential, n as CredentialKind, m as CredentialModule, o as CredentialStatus, q as CredentialTemplate, a2 as DeactivateDidDocumentParams, X as DidDocument, t as DidError, u as DidErrorClass, D as DidModule, _ as DidResolutionMetadata, al as EmergencyConfig, l as ExecutionParams, a as GhostModule, G as GhostSpeakConfig, aa as GhostSpeakError, b as GovernanceModule, i as InitializeStakingConfigParams, I as InstructionBuilder, M as MultisigModule, N as Network, a5 as PayAIReputationRecordInput, g as PreparedClaimResult, a9 as PricingModel, k as ProposalType, ab as RegisterAgentParams, a4 as ReputationData, R as ReputationModule, a3 as ResolveDidDocumentParams, an as RetryConfig, ad as RpcAccountInfo, ag as RpcAccountInfoResponse, ao as RpcApi, ah as RpcMultipleAccountsResponse, ae as RpcProgramAccount, af as RpcProgramAccountsResponse, ac as RpcResponse, ap as RpcSubscriptionApi, Z as ServiceEndpoint, s as ServiceEndpointType, aj as SimulatedTransactionResponse, ak as SolanaRpcClient, h as StakeParams, aq as StakingAccount, ar as StakingConfig, S as StakingModule, ai as TransactionResponse, U as UnstakeParams, a1 as UpdateDidDocumentParams, Y as VerificationMethod, V as VerificationMethodType, r as VerificationRelationship, $ as W3CDidDocument, W as W3CVerifiableCredential, L as canPerformAction, F as createEd25519VerificationMethod, H as createServiceEndpoint, at as decodeAgent, v as deriveDidDocumentPda, O as didDocumentToJson, z as exportAsW3CDidDocument, au as fetchAgent, av as fetchMaybeAgent, w as generateDidString, as as getAgentDecoder, T as getIdentifierFromDid, K as getMethodsForRelationship, Q as getNetworkFromDid, aw as getStakingAccountDecoder, ax as getStakingConfigDecoder, J as isDidActive, y as parseDidString, x as validateDidString } from './StakingModule-CPhp_ZY0.js'; import * as gill from 'gill'; import { SolanaClient } from 'gill'; import { Address as Address$1 } from '@solana/addresses'; export { l as AuthorizationFilter, p as AuthorizationInvalidReason, q as AuthorizationMessage, n as AuthorizationMetadata, o as AuthorizationProof, u as AuthorizationRevocation, A as AuthorizationStatus, t as AuthorizationUsage, k as AuthorizationWithStatus, B as BatchAuthorizationVerification, C as CreateAuthorizationParams, R as ReputationAuthorization, m as SolanaNetwork, V as VerificationDetails, r as VerifyAuthorizationParams, c as createAuthorizationMessage, b as createSignedAuthorization, e as deserializeAuthorization, g as generateNonce, f as getAuthorizationId, h as isAuthorizationExhausted, i as isAuthorizationExpired, d as serializeAuthorization, a as signAuthorizationMessage, j as validateAuthorizationNetwork, v as verifyAuthorizationSignature } from './signature-verification-BDzoR1MG.js'; export { h as ASSOCIATED_TOKEN_PROGRAM_ADDRESS, A as ATTESTATION_SEED, d as AttestationPDAResult, C as CREDENTIAL_SEED, e as CreateAttestationConfig, f as GHOSTSPEAK_PROGRAM_ID, c as GhostOwnershipAttestationData, G as GhostSpeakCredentialConfig, N as NATIVE_MINT_ADDRESS, S as SASAttestationHelper, a as SAS_PROGRAM_ID, b as SCHEMA_SEED, g as TOKEN_2022_PROGRAM_ADDRESS, T as TOKEN_PROGRAM_ADDRESS } from './browser-D1TpjbjZ.js'; import { I as IPFSClient, C as ClientEncryptionService } from './feature-flags-B1g0DCPe.js'; export { A as AccountInspectionResult, a5 as AssociatedTokenAccount, K as BatchDiagnosticReport, af as ClientEncryptionOptions, a7 as ConfidentialTransferConfig, J as DiagnosticReport, D as DiscriminatorValidationResult, ad as EncryptedData, ai as FeatureFlagManager, aj as FeatureFlags, G as GhostSpeakSDKError, a8 as InterestBearingConfig, L as LegacyAgentData, M as MigrationPlan, x as MigrationResult, ae as PrivateMetadata, R as ReputationTagEngine, _ as TokenExtension, T as TokenProgram, a6 as TransferFeeConfig, m as createDiscriminatorErrorMessage, c as createErrorContext, o as createMigrationPlan, q as createMigrationReport, d as deriveAssociatedTokenAddress, a9 as deriveMultisigPda, aa as deriveProposalPda, S as deriveSplTokenAssociatedTokenAddress, U as deriveToken2022AssociatedTokenAddress, a as detectTokenProgram, B as diagnoseAccountFromChain, F as diagnoseBatchFromChain, e as enhanceTransactionError, H as exportDiagnosticReport, Q as extractInstructionName, u as extractLegacyData, f as formatTokenAmount, ab as generateLocalPrivacyProof, W as getAllAssociatedTokenAddresses, V as getAssociatedTokenAccount, a3 as getConfidentialTransferConfig, ag as getFeatureFlags, a4 as getInterestBearingConfig, t as getMigrationInstructions, Y as getTokenProgramAddress, Z as getTokenProgramFromAddress, g as getTokenProgramType, a2 as getTransferFeeConfig, a0 as hasConfidentialTransferExtension, a1 as hasInterestBearingExtension, $ as hasTransferFeeExtension, n as inspectAccountData, ah as isFeatureEnabled, i as isToken2022Mint, O as logEnhancedError, p as parseTokenAmount, y as runAccountDiagnostics, z as runBatchDiagnostics, s as safeDecodeAgent, r as simulateMigration, v as validateAccountDiscriminator, X as validateAssociatedTokenAddress, P as validatePreconditions, ac as verifyLocalPrivacyProof, w as withEnhancedErrors, N as withEnhancedErrorsSync } from './feature-flags-B1g0DCPe.js'; import { Rpc, GetSignaturesForAddressApi, GetTransactionApi, GetAccountInfoApi } from '@solana/rpc'; import { I as IPFSConfig, g as IPFSUploadOptions, C as ContentStorageResult, m as IPFSContentMetadata, h as IPFSOperationResult, r as IPFSError } from './reputation-types-Yebf0Rm_.js'; export { B as BadgeType, t as BehaviorTag, A as BulkTagUpdateRequest, o as CategoryReputation, u as ComplianceTag, D as DEFAULT_TAG_DECAY, K as FlexibleContent, l as IPFSPinResult, H as IPFSProviderConfig, j as IPFSRetrievalOptions, k as IPFSRetrievalResult, i as IPFSUploadResult, J as JobPerformance, F as ProposalStatus, s as REPUTATION_CONSTANTS, a as ReputationCalculationResult, p as ReputationTier, S as SkillTag, v as TAG_CONSTANTS, q as TagCategory, w as TagConfidenceLevel, x as TagCriteria, T as TagDecayConfig, y as TagEvaluation, d as TagFilters, e as TagQueryResult, b as TagReputationMetrics, c as TagScoreType, z as TagUpdateRequest } from './reputation-types-Yebf0Rm_.js'; export { CrossmintClientOptions, CredentialType as CrossmintCredentialType, IssuedCredential as CrossmintIssuedCredential, CrossmintVCClient, GHOSTSPEAK_CREDENTIAL_TYPES } from './credentials.js'; export { ElGamalCiphertext, ElGamalKeypair, TransferProof as ElGamalTransferProof, WasmModule, WithdrawProof, decrypt, elgamal, encrypt, generateKeypair, generateTransferProof, generateWithdrawProof, isWasmAvailable, loadWasmModule, wasmBridge } from './crypto.js'; export { d as deriveAgentPda, b as deriveAgentVerificationPda, a as deriveUserRegistryPda, f as findProgramDerivedAddress } from './pda-Ce7VYg4T.js'; /** * 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 */ /** Arbitrator's final decision on disputed escrow */ type ArbitratorDecision = { __kind: "FavorClient"; reason: string; } | { __kind: "FavorAgent"; reason: string; } | { __kind: "Split"; clientPercentage: number; reason: string; }; type ArbitratorDecisionArgs = ArbitratorDecision; /** * 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 DeliverySubmittedEvent = { escrowId: bigint; agent: Address; deliveryProof: 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 */ type DisputeFiledEvent = { escrowId: bigint; client: Address; reason: 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 */ type DisputeResolvedEvent = { escrowId: bigint; decision: ArbitratorDecision; arbitrator: 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 */ type EscrowCompletedEvent = { escrowId: bigint; agent: Address; amount: 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 */ type EscrowCreatedEvent = { escrowId: bigint; client: Address; agent: Address; amount: bigint; deadline: 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 */ /** Escrow lifecycle states */ declare enum EscrowStatus { Active = 0, Completed = 1, Disputed = 2, Cancelled = 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 GhostSlashedEvent = { agent: Address; amount: bigint; reason: SlashReason; newTier: AccessTier; }; /** * 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 GhostStakedEvent = { agent: Address; amount: bigint; unlockAt: bigint; reputationBoostBps: number; tier: AccessTier; dailyApiCalls: number; votingPower: 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 */ type GhostUnstakedEvent = { agent: Address; amount: 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 */ type ReputationTagsUpdatedEvent = { agent: Address; totalTags: number; skillTagsCount: number; behaviorTagsCount: number; complianceTagsCount: number; tagScoresCount: number; timestamp: 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 */ type ServiceEndpointArgs = { /** Service identifier (e.g., "agent-api") */ id: string; /** Type of service */ serviceType: ServiceEndpointTypeArgs; /** Service endpoint URI */ serviceEndpoint: string; /** Optional 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 */ /** Service endpoint type */ declare enum ServiceEndpointType { AIAgentService = 0, DIDCommMessaging = 1, CredentialRepository = 2, LinkedDomains = 3, Custom = 4 } type ServiceEndpointTypeArgs = ServiceEndpointType; /** * 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 */ /** Reasons for slashing staked tokens */ declare enum SlashReason { Fraud = 0, DisputeLoss = 1, Custom = 2 } type SlashReasonArgs = SlashReason; /** * 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 TagDecayAppliedEvent = { agent: Address; tagsRemoved: number; remainingTags: number; timestamp: 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 */ /** Tag score with confidence tracking */ type TagScore = { /** Tag name (e.g., "fast-responder", "defi-expert") */ tagName: string; /** Confidence score in basis points (0-10000) */ confidence: number; /** Number of supporting data points for this tag */ evidenceCount: number; /** Last time this tag was updated */ lastUpdated: bigint; }; type TagScoreArgs = { /** Tag name (e.g., "fast-responder", "defi-expert") */ tagName: string; /** Confidence score in basis points (0-10000) */ confidence: number; /** Number of supporting data points for this tag */ evidenceCount: number; /** Last time this tag was updated */ lastUpdated: number | 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 */ type VerificationMethodArgs = { /** Method identifier (e.g., "key-1") */ id: string; /** Type of verification method */ methodType: VerificationMethodTypeArgs; /** DID of the controller (usually the DID itself) */ controller: string; /** Public key in multibase format (base58btc) */ publicKeyMultibase: string; /** Verification relationships this key has */ relationships: Array; /** Creation timestamp */ createdAt: number | bigint; /** Revoked flag */ revoked: 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 */ /** Verification method type for DIDs */ declare enum VerificationMethodType { Ed25519VerificationKey2020 = 0, X25519KeyAgreementKey2020 = 1, EcdsaSecp256k1VerificationKey2019 = 2 } type VerificationMethodTypeArgs = VerificationMethodType; /** * 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 */ /** Verification relationship types */ declare enum VerificationRelationship { Authentication = 0, AssertionMethod = 1, KeyAgreement = 2, CapabilityInvocation = 3, CapabilityDelegation = 4 } type VerificationRelationshipArgs = VerificationRelationship; /** * 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 GhostProtectEscrow = { discriminator: ReadonlyUint8Array; /** Unique escrow ID */ escrowId: bigint; /** Client (payer) */ client: Address; /** Agent (service provider) */ agent: Address; /** Payment amount */ amount: bigint; /** Payment token mint */ tokenMint: Address; /** Escrow status */ status: EscrowStatus; /** Job description (IPFS hash) */ jobDescription: string; /** Delivery proof (IPFS hash) */ deliveryProof: Option; /** Deadline timestamp */ deadline: bigint; /** Created timestamp */ createdAt: bigint; /** Completed/disputed timestamp */ completedAt: Option; /** Dispute reason (if disputed) */ disputeReason: Option; /** Arbitrator decision (if disputed) */ arbitratorDecision: Option; bump: number; }; /** Gets the decoder for {@link GhostProtectEscrow} account data. */ declare function getGhostProtectEscrowDecoder(): Decoder; /** * 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 ApproveDeliveryInstruction = string, TAccountEscrowVault extends string | AccountMeta = string, TAccountAgentTokenAccount extends string | AccountMeta = string, TAccountClient extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountEscrow extends string ? WritableAccount : TAccountEscrow, TAccountEscrowVault extends string ? WritableAccount : TAccountEscrowVault, TAccountAgentTokenAccount extends string ? WritableAccount : TAccountAgentTokenAccount, TAccountClient extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountClient, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, ...TRemainingAccounts ]>; type ApproveDeliveryInput = { escrow: Address; escrowVault: Address; agentTokenAccount: Address; client: TransactionSigner; tokenProgram?: Address; }; declare function getApproveDeliveryInstruction(input: ApproveDeliveryInput, config?: { programAddress?: TProgramAddress; }): ApproveDeliveryInstruction; /** * 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 ArbitrateDisputeInstruction = string, TAccountEscrowVault extends string | AccountMeta = string, TAccountAgentTokenAccount extends string | AccountMeta = string, TAccountClientTokenAccount extends string | AccountMeta = string, TAccountAgentStaking extends string | AccountMeta = string, TAccountArbitrator extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountEscrow extends string ? WritableAccount : TAccountEscrow, TAccountEscrowVault extends string ? WritableAccount : TAccountEscrowVault, TAccountAgentTokenAccount extends string ? WritableAccount : TAccountAgentTokenAccount, TAccountClientTokenAccount extends string ? WritableAccount : TAccountClientTokenAccount, TAccountAgentStaking extends string ? WritableAccount : TAccountAgentStaking, TAccountArbitrator extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountArbitrator, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, ...TRemainingAccounts ]>; type ArbitrateDisputeInstructionDataArgs = { decision: ArbitratorDecisionArgs; }; type ArbitrateDisputeInput = { escrow: Address; escrowVault: Address; agentTokenAccount: Address; clientTokenAccount: Address; /** Agent's staking account (for potential slashing) */ agentStaking: Address; arbitrator: TransactionSigner; tokenProgram?: Address; decision: ArbitrateDisputeInstructionDataArgs["decision"]; }; declare function getArbitrateDisputeInstruction(input: ArbitrateDisputeInput, config?: { programAddress?: TProgramAddress; }): ArbitrateDisputeInstruction; /** * 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 ClaimGhostInstruction = string, TAccountDidDocument extends string | AccountMeta = string, TAccountSasAttestation extends string | AccountMeta = string, TAccountClaimer extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountAgentAccount extends string ? WritableAccount : TAccountAgentAccount, TAccountDidDocument extends string ? WritableAccount : TAccountDidDocument, TAccountSasAttestation extends string ? ReadonlyAccount : TAccountSasAttestation, TAccountClaimer extends string ? WritableSignerAccount & AccountSignerMeta : TAccountClaimer, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, ...TRemainingAccounts ]>; type ClaimGhostInstructionDataArgs = { sasCredential: Address; sasSchema: Address; ipfsMetadataUri: OptionOrNullable; network: string; }; type ClaimGhostInput = { agentAccount: Address; /** * DID document to create for this Ghost * Seeds: [b"did_document", agent_account.x402_payment_address.as_ref()] */ didDocument: Address; /** * SAS Attestation proving ownership of x402_payment_address * PDA: [b"attestation", sas_credential, sas_schema, x402_payment_address] */ sasAttestation: Address; /** The claimer must have created a SAS attestation proving they own x402_payment_address */ claimer: TransactionSigner; systemProgram?: Address; sasCredential: ClaimGhostInstructionDataArgs["sasCredential"]; sasSchema: ClaimGhostInstructionDataArgs["sasSchema"]; ipfsMetadataUri: ClaimGhostInstructionDataArgs["ipfsMetadataUri"]; network: ClaimGhostInstructionDataArgs["network"]; }; declare function getClaimGhostInstruction(input: ClaimGhostInput, config?: { programAddress?: TProgramAddress; }): ClaimGhostInstruction; /** * 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 CreateDidDocumentInstruction = string, TAccountController extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TAccountClock extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountDidDocument extends string ? WritableAccount : TAccountDidDocument, TAccountController extends string ? WritableSignerAccount & AccountSignerMeta : TAccountController, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountClock extends string ? ReadonlyAccount : TAccountClock, ...TRemainingAccounts ]>; type CreateDidDocumentInstructionDataArgs = { didString: string; verificationMethods: Array; serviceEndpoints: Array; }; type CreateDidDocumentAsyncInput = { /** DID document account with canonical PDA */ didDocument?: Address; /** Controller of the DID (owner) */ controller: TransactionSigner; /** System program for account creation */ systemProgram?: Address; /** Clock sysvar for timestamp validation */ clock?: Address; didString: CreateDidDocumentInstructionDataArgs["didString"]; verificationMethods: CreateDidDocumentInstructionDataArgs["verificationMethods"]; serviceEndpoints: CreateDidDocumentInstructionDataArgs["serviceEndpoints"]; }; declare function getCreateDidDocumentInstructionAsync(input: CreateDidDocumentAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type CreateEscrowInstruction = string, TAccountAgent extends string | AccountMeta = string, TAccountClientTokenAccount extends string | AccountMeta = string, TAccountEscrowVault extends string | AccountMeta = string, TAccountTokenMint extends string | AccountMeta = string, TAccountClient extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountEscrow extends string ? WritableAccount : TAccountEscrow, TAccountAgent extends string ? ReadonlyAccount : TAccountAgent, TAccountClientTokenAccount extends string ? WritableAccount : TAccountClientTokenAccount, TAccountEscrowVault extends string ? WritableAccount : TAccountEscrowVault, TAccountTokenMint extends string ? ReadonlyAccount : TAccountTokenMint, TAccountClient extends string ? WritableSignerAccount & AccountSignerMeta : TAccountClient, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, ...TRemainingAccounts ]>; type CreateEscrowInstructionDataArgs = { escrowId: number | bigint; amount: number | bigint; jobDescription: string; deadline: number | bigint; }; type CreateEscrowAsyncInput = { escrow?: Address; agent: Address; clientTokenAccount: Address; escrowVault: Address; tokenMint: Address; client: TransactionSigner; tokenProgram?: Address; systemProgram?: Address; escrowId: CreateEscrowInstructionDataArgs["escrowId"]; amount: CreateEscrowInstructionDataArgs["amount"]; jobDescription: CreateEscrowInstructionDataArgs["jobDescription"]; deadline: CreateEscrowInstructionDataArgs["deadline"]; }; declare function getCreateEscrowInstructionAsync(input: CreateEscrowAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type DeactivateDidDocumentInstruction = string, TAccountController extends string | AccountMeta = string, TAccountClock extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountDidDocument extends string ? WritableAccount : TAccountDidDocument, TAccountController extends string ? WritableSignerAccount & AccountSignerMeta : TAccountController, TAccountClock extends string ? ReadonlyAccount : TAccountClock, ...TRemainingAccounts ]>; type DeactivateDidDocumentAsyncInput = { /** DID document account with canonical PDA validation */ didDocument?: Address; /** Controller of the DID (must match document controller) */ controller: TransactionSigner; /** Clock sysvar for timestamp validation */ clock?: Address; }; declare function getDeactivateDidDocumentInstructionAsync(input: DeactivateDidDocumentAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type FileDisputeInstruction = string, TAccountClient extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountEscrow extends string ? WritableAccount : TAccountEscrow, TAccountClient extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountClient, ...TRemainingAccounts ]>; type FileDisputeInstructionDataArgs = { reason: string; }; type FileDisputeInput = { escrow: Address; client: TransactionSigner; reason: FileDisputeInstructionDataArgs["reason"]; }; declare function getFileDisputeInstruction(input: FileDisputeInput, config?: { programAddress?: TProgramAddress; }): FileDisputeInstruction; /** * 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 InitializeStakingConfigInstruction = string, TAccountAuthority extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountStakingConfig extends string ? WritableAccount : TAccountStakingConfig, TAccountAuthority extends string ? WritableSignerAccount & AccountSignerMeta : TAccountAuthority, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, ...TRemainingAccounts ]>; type InitializeStakingConfigInstructionDataArgs = { minStake: number | bigint; treasury: Address; }; type InitializeStakingConfigAsyncInput = { stakingConfig?: Address; authority: TransactionSigner; systemProgram?: Address; minStake: InitializeStakingConfigInstructionDataArgs["minStake"]; treasury: InitializeStakingConfigInstructionDataArgs["treasury"]; }; declare function getInitializeStakingConfigInstructionAsync(input: InitializeStakingConfigAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type RegisterAgentInstruction = string, TAccountStakingAccount extends string | AccountMeta = string, TAccountSigner extends string | AccountMeta = string, TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TAccountClock extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountAgentAccount extends string ? WritableAccount : TAccountAgentAccount, TAccountStakingAccount extends string ? ReadonlyAccount : TAccountStakingAccount, TAccountSigner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountSigner, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountClock extends string ? ReadonlyAccount : TAccountClock, ...TRemainingAccounts ]>; type RegisterAgentInstructionDataArgs = { agentType: number; name: string; description: string; metadataUri: string; agentId: string; pricingModel: PricingModelArgs; }; type RegisterAgentAsyncInput = { /** Agent account with enhanced 2025 PDA security */ agentAccount?: Address; /** Staking account - REQUIRED for Sybil resistance (must have >= 1K GHOST staked) */ stakingAccount?: Address; /** * User registry with enhanced validation * Authority with enhanced verification */ signer: TransactionSigner; /** System program for account creation */ systemProgram?: Address; /** Clock sysvar for timestamp validation */ clock?: Address; agentType: RegisterAgentInstructionDataArgs["agentType"]; name: RegisterAgentInstructionDataArgs["name"]; description: RegisterAgentInstructionDataArgs["description"]; metadataUri: RegisterAgentInstructionDataArgs["metadataUri"]; agentId: RegisterAgentInstructionDataArgs["agentId"]; pricingModel: RegisterAgentInstructionDataArgs["pricingModel"]; }; declare function getRegisterAgentInstructionAsync(input: RegisterAgentAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type ResolveDidDocumentInstruction = string, TAccountDidController extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountDidDocument extends string ? ReadonlyAccount : TAccountDidDocument, TAccountDidController extends string ? ReadonlyAccount : TAccountDidController, ...TRemainingAccounts ]>; type ResolveDidDocumentAsyncInput = { /** DID document account */ didDocument?: Address; /** Controller public key (used for PDA derivation) */ didController: Address; }; declare function getResolveDidDocumentInstructionAsync(input: ResolveDidDocumentAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type SlashStakeInstruction = string, TAccountStakingConfig extends string | AccountMeta = string, TAccountStakingVault extends string | AccountMeta = string, TAccountTreasury extends string | AccountMeta = string, TAccountAuthority extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountStakingAccount extends string ? WritableAccount : TAccountStakingAccount, TAccountStakingConfig extends string ? ReadonlyAccount : TAccountStakingConfig, TAccountStakingVault extends string ? WritableAccount : TAccountStakingVault, TAccountTreasury extends string ? WritableAccount : TAccountTreasury, TAccountAuthority extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountAuthority, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, ...TRemainingAccounts ]>; type SlashStakeInstructionDataArgs = { owner: Address; reason: SlashReasonArgs; customAmount: OptionOrNullable; }; type SlashStakeAsyncInput = { stakingAccount?: Address; stakingConfig?: Address; stakingVault?: Address; treasury: Address; authority: TransactionSigner; tokenProgram?: Address; owner: SlashStakeInstructionDataArgs["owner"]; reason: SlashStakeInstructionDataArgs["reason"]; customAmount: SlashStakeInstructionDataArgs["customAmount"]; }; declare function getSlashStakeInstructionAsync(input: SlashStakeAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type StakeGhostInstruction = string, TAccountOwnerTokenAccount extends string | AccountMeta = string, TAccountStakingVault extends string | AccountMeta = string, TAccountStakingConfig extends string | AccountMeta = string, TAccountGhostMint extends string | AccountMeta = string, TAccountOwner extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountSystemProgram extends string | AccountMeta = "11111111111111111111111111111111", TAccountRent extends string | AccountMeta = "SysvarRent111111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountStakingAccount extends string ? WritableAccount : TAccountStakingAccount, TAccountOwnerTokenAccount extends string ? WritableAccount : TAccountOwnerTokenAccount, TAccountStakingVault extends string ? WritableAccount : TAccountStakingVault, TAccountStakingConfig extends string ? ReadonlyAccount : TAccountStakingConfig, TAccountGhostMint extends string ? ReadonlyAccount : TAccountGhostMint, TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountRent extends string ? ReadonlyAccount : TAccountRent, ...TRemainingAccounts ]>; type StakeGhostInstructionDataArgs = { amount: number | bigint; lockDuration: number | bigint; }; type StakeGhostAsyncInput = { stakingAccount?: Address; ownerTokenAccount: Address; /** * Staking vault to hold all staked GHOST tokens * Automatically initialized on first stake using init_if_needed */ stakingVault?: Address; stakingConfig: Address; ghostMint: Address; owner: TransactionSigner; tokenProgram?: Address; systemProgram?: Address; rent?: Address; amount: StakeGhostInstructionDataArgs["amount"]; lockDuration: StakeGhostInstructionDataArgs["lockDuration"]; }; declare function getStakeGhostInstructionAsync(input: StakeGhostAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type SubmitDeliveryInstruction = string, TAccountAgent extends string | AccountMeta = string, TAccountAgentOwner extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountEscrow extends string ? WritableAccount : TAccountEscrow, TAccountAgent extends string ? ReadonlyAccount : TAccountAgent, TAccountAgentOwner extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountAgentOwner, ...TRemainingAccounts ]>; type SubmitDeliveryInstructionDataArgs = { deliveryProof: string; }; type SubmitDeliveryInput = { escrow: Address; agent: Address; agentOwner: TransactionSigner; deliveryProof: SubmitDeliveryInstructionDataArgs["deliveryProof"]; }; declare function getSubmitDeliveryInstruction(input: SubmitDeliveryInput, config?: { programAddress?: TProgramAddress; }): SubmitDeliveryInstruction; /** * 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 UnstakeGhostInstruction = string, TAccountStakingConfig extends string | AccountMeta = string, TAccountStakingVault extends string | AccountMeta = string, TAccountOwnerTokenAccount extends string | AccountMeta = string, TAccountOwner extends string | AccountMeta = string, TAccountTokenProgram extends string | AccountMeta = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountStakingAccount extends string ? WritableAccount : TAccountStakingAccount, TAccountStakingConfig extends string ? ReadonlyAccount : TAccountStakingConfig, TAccountStakingVault extends string ? WritableAccount : TAccountStakingVault, TAccountOwnerTokenAccount extends string ? WritableAccount : TAccountOwnerTokenAccount, TAccountOwner extends string ? WritableSignerAccount & AccountSignerMeta : TAccountOwner, TAccountTokenProgram extends string ? ReadonlyAccount : TAccountTokenProgram, ...TRemainingAccounts ]>; type UnstakeGhostAsyncInput = { stakingAccount?: Address; stakingConfig?: Address; stakingVault?: Address; ownerTokenAccount: Address; owner: TransactionSigner; tokenProgram?: Address; }; declare function getUnstakeGhostInstructionAsync(input: UnstakeGhostAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type UpdateDidDocumentInstruction = string, TAccountController extends string | AccountMeta = string, TAccountClock extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountDidDocument extends string ? WritableAccount : TAccountDidDocument, TAccountController extends string ? WritableSignerAccount & AccountSignerMeta : TAccountController, TAccountClock extends string ? ReadonlyAccount : TAccountClock, ...TRemainingAccounts ]>; type UpdateDidDocumentInstructionDataArgs = { addVerificationMethod: OptionOrNullable; removeVerificationMethodId: OptionOrNullable; addServiceEndpoint: OptionOrNullable; removeServiceEndpointId: OptionOrNullable; }; type UpdateDidDocumentAsyncInput = { /** DID document account with canonical PDA validation */ didDocument?: Address; /** Controller of the DID (must match document controller) */ controller: TransactionSigner; /** Clock sysvar for timestamp validation */ clock?: Address; addVerificationMethod: UpdateDidDocumentInstructionDataArgs["addVerificationMethod"]; removeVerificationMethodId: UpdateDidDocumentInstructionDataArgs["removeVerificationMethodId"]; addServiceEndpoint: UpdateDidDocumentInstructionDataArgs["addServiceEndpoint"]; removeServiceEndpointId: UpdateDidDocumentInstructionDataArgs["removeServiceEndpointId"]; }; declare function getUpdateDidDocumentInstructionAsync(input: UpdateDidDocumentAsyncInput, config?: { programAddress?: TProgramAddress; }): 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 */ type UpdateReputationTagsInstruction = string, TAccountAgent extends string | AccountMeta = string, TAccountAuthority extends string | AccountMeta = string, TAccountClock extends string | AccountMeta = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta[] = []> = Instruction & InstructionWithData & InstructionWithAccounts<[ TAccountReputationMetrics extends string ? WritableAccount : TAccountReputationMetrics, TAccountAgent extends string ? WritableAccount : TAccountAgent, TAccountAuthority extends string ? ReadonlySignerAccount & AccountSignerMeta : TAccountAuthority, TAccountClock extends string ? ReadonlyAccount : TAccountClock, ...TRemainingAccounts ]>; type UpdateReputationTagsInstructionDataArgs = { skillTags: Array; behaviorTags: Array; complianceTags: Array; tagScores: Array; }; type UpdateReputationTagsAsyncInput = { /** Reputation metrics account */ reputationMetrics?: Address; /** Agent account */ agent: Address; /** Authority (can be the agent owner or authorized updater) */ authority: TransactionSigner; /** Clock for timestamps */ clock?: Address; skillTags: UpdateReputationTagsInstructionDataArgs["skillTags"]; behaviorTags: UpdateReputationTagsInstructionDataArgs["behaviorTags"]; complianceTags: UpdateReputationTagsInstructionDataArgs["complianceTags"]; tagScores: UpdateReputationTagsInstructionDataArgs["tagScores"]; }; declare function getUpdateReputationTagsInstructionAsync(input: UpdateReputationTagsAsyncInput, config?: { programAddress?: TProgramAddress; }): Promise>; /** * RPC Type Definitions for Solana Web3.js v2 * July 2025 Best Practices * * These types leverage TypeScript's advanced features for type safety * and use modern patterns from @solana/web3.js v2 */ type Commitment = 'processed' | 'confirmed' | 'finalized'; interface AccountInfo$2 { /** Indicates if the account contains a program */ executable: boolean; /** Number of lamports in the account */ lamports: Lamports; /** Public key of the program this account has been assigned to */ owner: Address; /** Epoch at which this account will next owe rent */ rentEpoch: Epoch; /** The account data */ data: TData; /** Size of the account data */ space?: bigint; } interface ParsedAccountData { program: string; parsed: unknown; space: bigint; } interface TransactionStatus { slot: Slot; confirmations: number | null; err: TransactionError | null; confirmationStatus?: Commitment; } type SignatureStatus = TransactionStatus; interface SimulatedTransactionResponse { err: TransactionError | null; logs: string[] | null; accounts?: (AccountInfo$2 | null)[] | null; unitsConsumed?: bigint; returnData?: { programId: Address; data: [string, 'base64']; } | null; } interface GetAccountInfoOptions { commitment?: Commitment; encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed'; dataSlice?: { offset: number; length: number; }; minContextSlot?: Slot; } interface GetMultipleAccountsOptions { commitment?: Commitment; encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed'; dataSlice?: { offset: number; length: number; }; minContextSlot?: Slot; } interface GetProgramAccountsOptions { commitment?: Commitment; encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed'; dataSlice?: { offset: number; length: number; }; minContextSlot?: Slot; filters?: ({ dataSize: bigint; } | { memcmp: { offset: bigint; bytes: Base58EncodedBytes; encoding: 'base58'; }; } | { memcmp: { offset: bigint; bytes: Base64EncodedBytes; encoding: 'base64'; }; })[]; withContext?: boolean; } interface SendTransactionOptions { skipPreflight?: boolean; preflightCommitment?: Commitment; encoding?: 'base58' | 'base64'; maxRetries?: number; minContextSlot?: Slot; } /** * API Response Types for GhostSpeak Public API * * These types match the REST API responses from packages/api */ interface ApiGhost { address: string; owner: string | null; status: string; firstTxSignature: string; firstSeenTimestamp: number; discoverySource: string; claimedAt: number | null; agentId: string; name: string; description: string; metadataUri: string; serviceEndpoint: string; externalIdentifiers: Array<{ platform: string; externalId: string; verified: boolean; verifiedAt: number; }>; ghostScore: number; reputationScore: number; reputationComponents: Array<{ source: string; score: number; weight: number; lastUpdated: number; }>; didAddress: string | null; credentials: string[]; isActive: boolean; isVerified: boolean; verificationTimestamp: number; createdAt: number; updatedAt: number; } interface ApiGhostScore { address: string; score: number; maxScore: number; components: Array<{ source: string; score: number; weight: number; lastUpdated: number; }>; lastUpdated: number; } interface ApiExternalIdLookup { mapping: { platform: string; externalId: string; ghostAddress: string; verified: boolean; verifiedAt: number | null; createdAt: number; }; ghost: ApiGhost | null; } /** * Calculate visible score based on privacy settings * * @param score - Actual reputation score * @param privacyMode - Privacy mode setting * @param hasAccess - Whether viewer has full access * @returns Visible score data */ declare function calculateVisibleScore(score: number, privacyMode: PrivacyMode, hasAccess: boolean): { exactScore?: number; tier?: ReputationTier; scoreRange?: ScoreRange; }; /** * Get reputation tier from score * * @param score - Reputation score (0-10000) * @returns Reputation tier */ declare function getReputationTier(score: number): ReputationTier; /** * Get score range bucket from score * * @param score - Reputation score (0-10000) * @returns Score range bucket */ declare function getScoreRange(score: number): ScoreRange; /** * Check if viewer has access to private data * * @param viewerAddress - Address of the viewer * @param settings - Privacy settings * @param agentAddress - Agent address (viewer is agent) * @returns Whether viewer has access */ declare function canViewerAccess(viewerAddress: Address$1, settings: PrivacySettings, agentAddress: Address$1): boolean; /** * Filter reputation metrics by visibility settings * * @param reputationData - Full reputation data * @param metricVisibility - Metric visibility settings * @param hasAccess - Whether viewer has full access * @returns Filtered visible reputation */ declare function filterMetricsByVisibility(reputationData: { agent: Address$1; overallScore: number; totalJobsCompleted: number; totalJobsFailed: number; avgResponseTime: number; disputesAgainst: number; disputesResolved: number; totalEarnings?: number; avgRating?: number; badges?: string[]; }, metricVisibility: MetricVisibility, hasAccess: boolean): Partial; /** * Create default metric visibility settings * * @param mode - Privacy mode * @returns Default metric visibility */ declare function getDefaultMetricVisibility(mode: PrivacyMode): MetricVisibility; /** * Validate privacy settings * * @param settings - Privacy settings to validate * @returns Validation result with errors if any */ declare function validatePrivacySettings(settings: PrivacySettings): { valid: boolean; errors: string[]; }; /** * Get tier display name * * @param tier - Reputation tier * @returns Display name */ declare function getTierDisplayName(tier: ReputationTier): string; /** * Get range display string * * @param range - Score range * @returns Display string */ declare function getRangeDisplayString(range: ScoreRange): string; interface RpcClientConfig { endpoint: string; wsEndpoint?: string; commitment?: Commitment; maxRetries?: number; retryDelay?: number; timeout?: number; } /** * Unified RPC client with all features consolidated from multiple implementations. * This is the single source of truth for all RPC operations. * * Now powered by Gill for simplified client management while maintaining * full backward compatibility with the existing API. */ declare class RpcClient { private client; private commitment; private endpoint; private maxRetries; private retryDelay; private timeout; constructor(config: RpcClientConfig); /** * Get the underlying RPC client for direct access * This provides access to Gill's rpc object for advanced operations */ get rpc(): gill.Rpc<(gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi) | (gill.RequestAirdropApi & gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi)> | gill.RpcDevnet<(gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi) | (gill.RequestAirdropApi & gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi)> | gill.RpcTestnet<(gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi) | (gill.RequestAirdropApi & gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi)> | gill.RpcMainnet<(gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi) | (gill.RequestAirdropApi & gill.GetAccountInfoApi & gill.GetBalanceApi & gill.GetBlockApi & gill.GetBlockCommitmentApi & gill.GetBlockHeightApi & gill.GetBlockProductionApi & gill.GetBlocksApi & gill.GetBlocksWithLimitApi & gill.GetBlockTimeApi & gill.GetClusterNodesApi & gill.GetEpochInfoApi & gill.GetEpochScheduleApi & gill.GetFeeForMessageApi & gill.GetFirstAvailableBlockApi & gill.GetGenesisHashApi & gill.GetHealthApi & gill.GetHighestSnapshotSlotApi & gill.GetIdentityApi & gill.GetInflationGovernorApi & gill.GetInflationRateApi & gill.GetInflationRewardApi & gill.GetLargestAccountsApi & gill.GetLatestBlockhashApi & gill.GetLeaderScheduleApi & gill.GetMaxRetransmitSlotApi & gill.GetMaxShredInsertSlotApi & gill.GetMinimumBalanceForRentExemptionApi & gill.GetMultipleAccountsApi & gill.GetProgramAccountsApi & gill.GetRecentPerformanceSamplesApi & gill.GetRecentPrioritizationFeesApi & gill.GetSignaturesForAddressApi & gill.GetSignatureStatusesApi & gill.GetSlotApi & gill.GetSlotLeaderApi & gill.GetSlotLeadersApi & gill.GetStakeMinimumDelegationApi & gill.GetSupplyApi & gill.GetTokenAccountBalanceApi & gill.GetTokenAccountsByDelegateApi & gill.GetTokenAccountsByOwnerApi & gill.GetTokenLargestAccountsApi & gill.GetTokenSupplyApi & gill.GetTransactionApi & gill.GetTransactionCountApi & gill.GetVersionApi & gill.GetVoteAccountsApi & gill.IsBlockhashValidApi & gill.MinimumLedgerSlotApi & gill.SendTransactionApi & gill.SimulateTransactionApi)>; /** * Get account information with automatic retries */ getAccountInfo(address: Address$1, options?: GetAccountInfoOptions): Promise; /** * Get multiple accounts efficiently */ getMultipleAccounts(addresses: Address$1[], options?: GetMultipleAccountsOptions): Promise<(AccountInfo$2 | null)[]>; /** * Get program accounts with filters */ getProgramAccounts(programId: Address$1, options?: GetProgramAccountsOptions): Promise<{ pubkey: Address$1; account: AccountInfo$2; }[]>; /** * Get latest blockhash with automatic caching */ private blockhashCache; getLatestBlockhash(): Promise<{ blockhash: string; lastValidBlockHeight: bigint; }>; /** * Send transaction with enhanced error handling */ sendTransaction(transaction: Base64EncodedWireTransaction, options?: SendTransactionOptions): Promise; /** * Get signature statuses with batch support */ getSignatureStatuses(signatures: Signature[]): Promise<(SignatureStatus | null)[]>; /** * Simulate transaction with detailed error info */ simulateTransaction(transaction: Base64EncodedWireTransaction, options?: { commitment?: Commitment; replaceRecentBlockhash?: boolean; }): Promise; /** * Get fee for message */ getFeeForMessage(encodedMessage: TransactionMessageBytesBase64): Promise; /** * Health check */ isHealthy(): Promise; /** * Get RPC node version */ getVersion(): Promise<{ 'solana-core': string; 'feature-set': number; }>; /** * Subscribe to account changes (WebSocket) * * Note: This is a polling-based implementation for backward compatibility. * For production use with real-time subscriptions, access the rpcSubscriptions * directly via client.rpcSubscriptions from Gill. */ subscribeToAccount(address: Address$1, callback: (accountInfo: AccountInfo$2 | null) => void): Promise<() => void>; /** * Get the underlying Gill client for advanced operations * This provides direct access to Gill's SolanaClient for features like: * - rpcSubscriptions for WebSocket subscriptions * - sendAndConfirmTransaction for transaction handling */ getGillClient(): SolanaClient; private withRetry; private parseAccountInfo; } /** * Batch Operations - Efficient multi-account fetching * * Utilities for batching RPC calls to reduce network overhead. * Uses Solana's getMultipleAccounts with 100-account limit. * * @module batch-operations */ /** * Batch progress callback */ type BatchProgressCallback = (completed: number, total: number) => void; /** * Batch fetch configuration */ interface BatchFetchConfig { /** Progress callback for large batches */ onProgress?: BatchProgressCallback; /** Batch size (default: 100, max: 100) */ batchSize?: number; } /** * Batch fetch multiple accounts with automatic chunking * * Features: * - Automatic batching (100 accounts per RPC call) * - Parallel batch execution * - Progress callback support * - Preserves order * * @param rpc - RPC client * @param addresses - Account addresses to fetch * @param config - Batch configuration * @returns Array of accounts (in same order as input) * * @example * ```typescript * const addresses = [...1000 agent addresses...] * const accounts = await batchGetAccounts(rpc, addresses, { * onProgress: (completed, total) => { * console.log(`Fetched ${completed}/${total} accounts`) * } * }) * ``` */ declare function batchGetAccounts(rpc: ExtendedRpcApi, addresses: Address$1[], config?: BatchFetchConfig): Promise<(T | null)[]>; /** * Batch fetch with filtering (only non-null accounts) * * Useful when you expect some addresses to not exist. * * @param rpc - RPC client * @param addresses - Account addresses to fetch * @param config - Batch configuration * @returns Array of non-null accounts with their addresses * * @example * ```typescript * const addresses = [...agent addresses...] * const existing = await batchGetExistingAccounts(rpc, addresses) * // Returns only accounts that exist: [{ address, account }, ...] * ``` */ declare function batchGetExistingAccounts(rpc: ExtendedRpcApi, addresses: Address$1[], config?: BatchFetchConfig): Promise>; /** * Batch fetch with mapping * * Fetches accounts and immediately maps them to a transformed type. * * @param rpc - RPC client * @param addresses - Account addresses to fetch * @param mapper - Transform function (account, address, index) => result * @param config - Batch configuration * @returns Array of mapped results * * @example * ```typescript * const agentSummaries = await batchGetAndMap( * rpc, * agentAddresses, * (account, address) => ({ * address, * name: account.data.name, * reputation: account.data.totalScore * }) * ) * ``` */ declare function batchGetAndMap(rpc: ExtendedRpcApi, addresses: Address$1[], mapper: (account: T | null, address: Address$1, index: number) => R, config?: BatchFetchConfig): Promise; /** * Batch fetch with retry logic * * Retries failed batches with exponential backoff. * * @param rpc - RPC client * @param addresses - Account addresses to fetch * @param config - Batch configuration * @param maxRetries - Maximum retry attempts (default: 3) * @returns Array of accounts */ declare function batchGetAccountsWithRetry(rpc: ExtendedRpcApi, addresses: Address$1[], config?: BatchFetchConfig, maxRetries?: number): Promise<(T | null)[]>; /** * Create a batch fetcher with reusable configuration * * Factory pattern for creating pre-configured batch fetchers. * * @param rpc - RPC client * @param defaultConfig - Default batch configuration * @returns Batch fetcher functions * * @example * ```typescript * const fetcher = createBatchFetcher(rpc, { * batchSize: 50, * onProgress: (c, t) => console.log(`${c}/${t}`) * }) * * const accounts = await fetcher.getAccounts(addresses) * const existing = await fetcher.getExisting(addresses) * ``` */ declare function createBatchFetcher(rpc: ExtendedRpcApi, defaultConfig?: BatchFetchConfig): { /** * Fetch multiple accounts */ getAccounts: (addresses: Address$1[], config?: BatchFetchConfig) => Promise<(T | null)[]>; /** * Fetch only existing accounts */ getExisting: (addresses: Address$1[], config?: BatchFetchConfig) => Promise<{ address: Address$1; account: T; }[]>; /** * Fetch and map accounts */ getAndMap: (addresses: Address$1[], mapper: (account: T | null, address: Address$1, index: number) => R, config?: BatchFetchConfig) => Promise; /** * Fetch with retry logic */ getWithRetry: (addresses: Address$1[], config?: BatchFetchConfig, maxRetries?: number) => Promise<(T | null)[]>; }; /** * ExternalIdResolver - Cross-Platform Identity Lookup * * Resolves platform-specific IDs (PayAI, ElizaOS, etc.) to Ghost addresses * Uses GhostSpeak Public API for fast lookups */ interface ApiResolverConfig { apiUrl?: string; cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet'; } declare class ExternalIdResolver { private apiUrl; constructor(config?: ApiResolverConfig); /** * Resolve external ID to Ghost address * * @example * const address = await resolver.resolve('payai', 'agent-123'); */ resolve(platform: string, externalId: string): Promise; /** * Lookup external ID with full Ghost data * * @example * const { mapping, ghost } = await resolver.lookup('payai', 'agent-123'); */ lookup(platform: string, externalId: string): Promise; /** * Get Ghost by Solana address via API * * Faster than on-chain lookup for read operations */ getGhost(ghostAddress: Address$1 | string): Promise; /** * Get Ghost Score via API */ getGhostScore(ghostAddress: Address$1 | string): Promise; /** * Get detailed reputation breakdown via API */ getGhostReputation(ghostAddress: Address$1 | string): Promise; /** * Batch resolve multiple external IDs */ resolveBatch(identifiers: Array<{ platform: string; externalId: string; }>): Promise>; /** * Check if external ID exists */ exists(platform: string, externalId: string): Promise; /** * Get all external IDs for a Ghost * * Fetches Ghost data and returns external identifiers */ getExternalIds(ghostAddress: Address$1 | string): Promise>; /** * Search for Ghost by partial platform ID * * Note: This is a client-side filter, not server-side search * For production, implement server-side search endpoint */ searchByExternalId(platform: string, partialId: string): Promise; /** * Set custom API URL */ setApiUrl(apiUrl: string): void; /** * Get current API URL */ getApiUrl(): string; /** * Check API health */ checkHealth(): Promise<{ status: string; network: string; rpc: { connected: boolean; latency: number; }; }>; } interface CreateEscrowParams { /** Agent providing the service */ agent: Address$1; /** Client's token account for payment */ clientTokenAccount: Address$1; /** Vault to hold escrowed funds */ escrowVault: Address$1; /** Token mint (e.g., USDC, GHOST) */ tokenMint: Address$1; /** Client who is paying */ client: TransactionSigner; /** Unique escrow identifier */ escrowId: bigint; /** Amount to escrow */ amount: bigint; /** Description of the job/service */ jobDescription: string; /** Deadline timestamp (unix seconds) */ deadline: bigint; } interface SubmitDeliveryParams { /** Escrow account */ escrow: Address$1; /** Agent account address */ agent: Address$1; /** Agent owner signer */ agentOwner: TransactionSigner; /** Proof of work (IPFS hash, URL, etc.) */ deliveryProof: string; } interface ApproveDeliveryParams { /** Escrow account */ escrow: Address$1; /** Vault holding escrowed funds */ escrowVault: Address$1; /** Agent's token account to receive payment */ agentTokenAccount: Address$1; /** Client approving the delivery */ client: TransactionSigner; } interface FileDisputeParams { /** Escrow account */ escrow: Address$1; /** Client filing the dispute */ client: TransactionSigner; /** Reason for dispute */ reason: string; } interface ArbitrateDisputeParams { /** Escrow account */ escrow: Address$1; /** Vault holding escrowed funds */ escrowVault: Address$1; /** Client's token account (for refund) */ clientTokenAccount: Address$1; /** Agent's token account (for payment) */ agentTokenAccount: Address$1; /** Agent's staking account (for potential slashing) */ agentStaking: Address$1; /** Arbitrator making the decision */ arbitrator: TransactionSigner; /** Decision: FavorClient, FavorAgent, Split, or Invalid */ decision: ArbitratorDecision; } declare class EscrowModule extends BaseModule { /** * Create a new escrow for a service agreement * * @param params - Escrow creation parameters * @returns Transaction signature */ createEscrow(params: CreateEscrowParams): Promise; /** * Submit proof of delivery for an escrow * * @param params - Delivery submission parameters * @returns Transaction signature */ submitDelivery(params: SubmitDeliveryParams): Promise; /** * Approve delivery and release funds to agent * * @param params - Approval parameters * @returns Transaction signature */ approveDelivery(params: ApproveDeliveryParams): Promise; /** * File a dispute for an escrow * * @param params - Dispute filing parameters * @returns Transaction signature */ fileDispute(params: FileDisputeParams): Promise; /** * Arbitrate a disputed escrow * * @param params - Arbitration parameters * @returns Transaction signature */ arbitrateDispute(params: ArbitrateDisputeParams): Promise; /** * Get escrow account data * * @param escrowAddress - The escrow account address * @returns Escrow data or null if not found */ getEscrow(escrowAddress: Address$1): Promise; } /** * X402 Transaction Indexer * * Polls Solana blockchain for x402 payment transactions to eliminate * webhook dependency and enable historical reputation backfilling. * * x402 payments are SPL token transfers (USDC) to PayAI facilitator addresses. * This indexer discovers these transfers and extracts payment metadata. * * @module modules/indexer */ /** * Parsed x402 payment data from on-chain transaction */ interface X402PaymentData { /** Transaction signature (on-chain proof) */ signature: string; /** Merchant (agent) receiving payment */ merchant: Address; /** Payer sending payment */ payer: Address; /** Payment amount in token base units (e.g., micro-USDC) */ amount: string; /** Payment success status */ success: boolean; /** Block timestamp */ timestamp: Date; /** Solana network */ network: 'solana' | 'solana-devnet'; /** Response time in milliseconds (if available from memo) */ responseTimeMs?: number; /** Additional metadata from transaction memo */ metadata?: Record; } /** * Transaction signature with metadata */ interface SignatureInfo { signature: Signature; slot: bigint; blockTime: bigint | null; err: unknown | null; } /** * Indexer configuration */ interface X402IndexerConfig { /** Solana RPC client */ rpc: Rpc; /** PayAI facilitator address to monitor */ facilitatorAddress: Address; /** Network identifier */ network?: 'solana' | 'solana-devnet'; /** Maximum transactions per poll */ batchSize?: number; } /** * X402 Transaction Indexer * * Discovers x402 payments by monitoring SPL token transfers * to PayAI facilitator addresses on Solana. * * @example * ```typescript * const indexer = new X402TransactionIndexer({ * rpc: createSolanaRpc('https://api.devnet.solana.com'), * facilitatorAddress: address('PayAI...'), * network: 'solana-devnet', * }) * * // Poll for new transactions * const payments = await indexer.pollTransactions() * ``` */ declare class X402TransactionIndexer { private readonly rpc; private readonly facilitatorAddress; private readonly network; private readonly batchSize; constructor(config: X402IndexerConfig); /** * Poll for new x402 transactions since last sync * * @param lastSignature - Last processed signature (for pagination) * @param limit - Maximum transactions to fetch * @returns Array of parsed x402 payment data */ pollTransactions(lastSignature?: Signature, limit?: number): Promise; /** * Parse a specific transaction signature * * @param signature - Transaction signature to parse * @returns Parsed x402 payment data or null if not an x402 payment */ parseTransaction(sig: Signature | string): Promise; /** * Fetch transaction signatures for the facilitator address */ private getSignatures; /** * Check if transaction is an x402 payment * * x402 payments are characterized by: * - SPL token transfer (TokenProgram or Token2022Program) for USDC * - Native SOL transfer (System Program) * - Transfer TO the facilitator address * - Optional memo instruction with payment metadata * * Supports both devnet and mainnet for all payment types */ private isX402Payment; /** * Extract payment data from transaction */ private extractPaymentData; } /** * Reputation Source Adapter Interface * * Base interface for all reputation data sources (PayAI, GitHub, custom webhooks, etc.) * Each adapter normalizes external data to a standard format for aggregation. */ /** * Supported reputation sources */ declare enum ReputationSource { PayAI = "payai", DirectSolana = "direct-solana", GitHub = "github", Twitter = "twitter", CustomWebhook = "custom-webhook", OnChainHistory = "onchain-history" } /** * Configuration for a reputation source */ interface ReputationSourceConfig { /** Source identifier */ source: ReputationSource; /** Weight in basis points (0-10000) */ weight: number; /** Reliability score in basis points (0-10000) */ reliability: number; /** Source-specific configuration (API keys, URLs, etc.) */ config: Record; /** Whether this source is enabled */ enabled: boolean; } /** * Normalized reputation data from a source */ interface SourceReputationData { /** Source identifier */ source: ReputationSource; /** Reputation score (0-1000) */ score: number; /** Number of data points contributing to score */ dataPoints: number; /** Reliability of this data (0-1) */ reliability: number; /** Raw data from source (for debugging/audit) */ rawData: any; /** Timestamp when data was fetched */ timestamp: Date; } /** * Base interface for reputation source adapters */ interface ReputationSourceAdapter { /** Source identifier */ readonly source: ReputationSource; /** * Fetch reputation data for an agent * * @param agentId - Agent identifier (public key or external ID) * @returns Normalized reputation data */ fetchReputationData(agentId: string): Promise; /** * Validate raw data from source * * @param data - Raw data to validate * @returns True if data is valid */ validateData(data: any): boolean; /** * Normalize raw score to 0-1000 scale * * @param rawScore - Raw score from source * @returns Normalized score (0-1000) */ normalizeScore(rawScore: any): number; /** * Calculate reliability score for this data point * * @param data - Source data * @returns Reliability (0-1) */ calculateReliability(data: any): number; } /** * Abstract base class for reputation adapters */ declare abstract class BaseReputationAdapter implements ReputationSourceAdapter { protected config: ReputationSourceConfig; constructor(config: ReputationSourceConfig); abstract get source(): ReputationSource; abstract fetchReputationData(agentId: string): Promise; abstract validateData(data: any): boolean; abstract normalizeScore(rawScore: any): number; /** * Default reliability calculation uses configured reliability */ calculateReliability(_data: any): number; /** * Check if adapter is enabled */ isEnabled(): boolean; /** * Get adapter weight in basis points */ getWeight(): number; /** * Validate score is in valid range (0-1000) */ protected validateScoreRange(score: number): boolean; /** * Clamp score to valid range */ protected clampScore(score: number): number; } /** * Multi-Source Reputation Aggregator * * Aggregates reputation data from multiple sources (PayAI, GitHub, custom webhooks) * with weighted scoring, conflict detection, and reliability-based adjustments. * * Based on MUSCLE multi-source oracle pattern with reputation-based source selection. */ /** * Aggregated reputation result */ interface AggregatedReputation { /** Agent address */ agentId: Address$1 | string; /** Weighted aggregate score (0-1000) */ aggregateScore: number; /** Individual source scores */ sourceScores: SourceScoreBreakdown[]; /** Whether conflicts were detected */ hasConflicts: boolean; /** Conflict descriptions */ conflicts: string[]; /** Total number of data points across all sources */ totalDataPoints: number; /** Timestamp of aggregation */ timestamp: Date; } /** * Individual source score breakdown */ interface SourceScoreBreakdown { /** Source identifier */ source: ReputationSource; /** Raw score from source (0-1000) */ score: number; /** Source weight (0-10000 basis points) */ weight: number; /** Source reliability (0-10000 basis points) */ reliability: number; /** Number of data points */ dataPoints: number; /** Weighted contribution to final score */ contribution: number; /** Last updated timestamp */ lastUpdated: Date; } /** * Multi-source reputation aggregator */ declare class MultiSourceAggregator { private adapters; private configs; /** Conflict threshold (30% variance) */ private readonly CONFLICT_THRESHOLD; /** * Create a new multi-source aggregator */ constructor(); /** * Add a reputation source * * @param adapter - Reputation source adapter * @param config - Source configuration */ addSource(adapter: ReputationSourceAdapter, config: ReputationSourceConfig): void; /** * Remove a reputation source * * @param source - Source to remove */ removeSource(source: ReputationSource): void; /** * Update source weight * * @param source - Source to update * @param weight - New weight in basis points (0-10000) */ updateSourceWeight(source: ReputationSource, weight: number): void; /** * Update source reliability * * @param source - Source to update * @param reliability - New reliability in basis points (0-10000) */ updateSourceReliability(source: ReputationSource, reliability: number): void; /** * Aggregate reputation from all sources * * @param agentId - Agent identifier * @returns Aggregated reputation data */ aggregateReputation(agentId: Address$1 | string): Promise; /** * Calculate weighted aggregate score * * Formula: Σ(score × weight × reliability) / Σ(weight × reliability) * * @param sourceDataList - Data from all sources * @returns Weighted aggregate score (0-1000) */ calculateWeightedScore(sourceDataList: SourceReputationData[]): number; /** * Detect conflicts between sources * * Flags conflicts if max_score - min_score > 30% * * @param sourceDataList - Data from all sources * @returns Conflict detection result */ detectConflicts(sourceDataList: SourceReputationData[]): { hasConflicts: boolean; conflicts: string[]; }; /** * Build source score breakdowns * * @param sourceDataList - Data from all sources * @returns Source score breakdowns */ private buildSourceBreakdowns; /** * Calculate normalization factor for weighted scoring */ private calculateNormalizationFactor; /** * Get detailed source breakdown for an agent * * @param agentId - Agent identifier * @returns Source breakdowns with full details */ getSourceBreakdown(agentId: Address$1 | string): Promise; /** * Get list of registered sources */ getRegisteredSources(): ReputationSource[]; /** * Get source configuration * * @param source - Source identifier * @returns Source configuration or undefined */ getSourceConfig(source: ReputationSource): ReputationSourceConfig | undefined; /** * Enable a source * * @param source - Source to enable */ enableSource(source: ReputationSource): void; /** * Disable a source * * @param source - Source to disable */ disableSource(source: ReputationSource): void; /** * Check if source is enabled * * @param source - Source to check * @returns True if enabled */ isSourceEnabled(source: ReputationSource): boolean; } /** * This file is auto-generated by scripts/generate-mappings.ts * Do not edit this file manually. */ interface AccountInfo$1 { name: string; writable: boolean; signer: boolean; optional: boolean; docs: string[]; address?: string; pda?: { seeds: unknown[]; }; } interface ExpectedAccount { name: string; pda: boolean; } interface InstructionMapping { name: string; expectedAccounts: ExpectedAccount[]; accounts: AccountInfo$1[]; docs?: string; discriminator: number[]; args: unknown[]; } /** * Instruction Error Handler * * Provides detailed error messages for instruction account validation * using the generated instruction mappings from the IDL. */ interface AccountInfo { name: string; pda: boolean; } /** * Enhanced error class for instruction validation errors */ declare class InstructionValidationError extends Error { readonly instruction: string; readonly expectedAccounts: number; readonly providedAccounts: number; readonly accountDetails?: AccountInfo[]; constructor(instruction: string, expectedAccounts: number, providedAccounts: number, message: string, accountDetails?: AccountInfo[]); } /** * Check if an instruction exists in our mappings */ declare function isKnownInstruction(instructionName: string): boolean; /** * Validate instruction accounts and throw detailed error if invalid */ declare function validateInstructionAccounts(instructionName: string, providedAccounts: unknown[], accountNames?: string[]): void; /** * Create a helpful error message for account mismatch */ declare function createAccountMismatchError(instructionName: string, providedCount: number, providedAccountNames?: string[]): string; /** * Get human-readable account requirements for an instruction */ declare function getAccountRequirements(instructionName: string): string; /** * Get instruction mapping (exported for external use) */ declare function getInstructionMapping(instructionName: string): InstructionMapping | null; /** * Generate account validation error message (exported for external use) */ declare function generateAccountValidationError(instructionName: string, providedCount: number, accountNames?: string[]): string; /** * Enhanced error message helper */ declare function enhanceErrorMessage(error: Error, context: string): string; /** * Debug instruction call helper */ declare function debugInstructionCall(instructionName: string, accounts: unknown[]): string; /** * Get required signers for an instruction */ declare function getRequiredSigners(instructionName: string): string[]; /** * Get writable accounts for an instruction */ declare function getWritableAccounts(instructionName: string): string[]; /** * Get PDA accounts for an instruction */ declare function getPDAAccounts(instructionName: string): string[]; /** * Instruction mappings constant for external access */ declare const INSTRUCTION_MAPPINGS: Record; /** * Utility functions for IPFS operations in GhostSpeak */ /** * Default IPFS configuration for GhostSpeak */ declare const DEFAULT_IPFS_CONFIG: IPFSConfig; /** * IPFS utility class with convenience methods */ declare class IPFSUtils { client: IPFSClient; constructor(config: IPFSConfig); /** * Store agent metadata with automatic IPFS/inline decision */ storeAgentMetadata(metadata: { name: string; description: string; capabilities: string[]; serviceEndpoint: string; agentId?: string; [key: string]: unknown; }, options?: IPFSUploadOptions): Promise; /** * Store channel message content with automatic IPFS/inline decision */ storeChannelMessage(message: { content: string; messageType?: number; attachments?: string[]; channelId?: string; sender?: string; [key: string]: unknown; }, options?: IPFSUploadOptions): Promise; /** * Store file attachments on IPFS */ storeFileAttachment(fileContent: Uint8Array | string, filename: string, contentType: string, options?: IPFSUploadOptions): Promise; /** * Retrieve and parse agent metadata */ retrieveAgentMetadata(uri: string): Promise<{ name: string; description: string; capabilities: string[]; serviceEndpoint: string; agentId?: string; createdAt?: string; [key: string]: unknown; }>; /** * Retrieve and parse channel message content */ retrieveChannelMessage(uri: string): Promise<{ content: string; messageType?: number; attachments?: string[]; timestamp?: string; [key: string]: unknown; }>; /** * Batch upload multiple content items */ batchUpload(items: { content: string; type: IPFSContentMetadata['type']; filename?: string; options?: IPFSUploadOptions; }[]): Promise[]>; /** * Pin existing content by hash */ pinContent(hash: string): Promise>; /** * Check if a URI uses IPFS storage */ isIPFSUri(uri: string): boolean; /** * Extract IPFS hash from URI */ extractIPFSHash(uri: string): string | null; /** * Convert IPFS hash to gateway URLs */ getGatewayUrls(hash: string, gateways?: string[]): string[]; /** * Validate IPFS hash format */ isValidIPFSHash(hash: string): boolean; /** * Calculate content size to determine if IPFS should be used */ shouldUseIPFS(content: string, threshold?: number): boolean; /** * Compress content before IPFS upload using modern compression APIs */ compressContent(content: string): Promise<{ compressed: string; algorithm: string; }>; /** * Decompress content after IPFS retrieval using modern decompression APIs */ decompressContent(compressed: string, algorithm: string): Promise; /** * Get client stats */ getStats(): { cacheStats: { size: number; keys: string[]; }; config: IPFSConfig; }; /** * Clear client cache */ clearCache(): void; } /** * Create an IPFS utility instance with configuration */ declare function createIPFSUtils(config?: Partial): IPFSUtils; /** * Helper function to determine optimal storage method */ declare function determineStorageMethod(content: string, options?: { sizeThreshold?: number; forceIPFS?: boolean; forceInline?: boolean; }): 'inline' | 'ipfs'; /** * Create metadata URI with automatic storage decision */ declare function createMetadataUri(metadata: Record, ipfsUtils?: IPFSUtils, options?: { type?: IPFSContentMetadata['type']; filename?: string; forceIPFS?: boolean; }): Promise; /** * Test IPFS configuration for beta testing and development */ /** * Test IPFS configuration that uses the in-memory test provider * This configuration does not require any external services */ declare const TEST_IPFS_CONFIG: IPFSConfig; /** * Create a test IPFS configuration with custom options */ declare function createTestIPFSConfig(options?: Partial): IPFSConfig; /** * Enhanced error handling and retry logic for IPFS operations in GhostSpeak */ /** * IPFS-specific error class with enhanced context */ declare class IPFSOperationError extends Error { readonly type: IPFSError; readonly provider?: string | undefined; readonly retryCount?: number | undefined; readonly originalError?: Error | undefined; constructor(type: IPFSError, message: string, provider?: string | undefined, retryCount?: number | undefined, originalError?: Error | undefined); } /** * Configuration for retry logic */ interface RetryConfig { maxRetries: number; baseDelay: number; maxDelay: number; backoffFactor: number; retryableErrors: IPFSError[]; } /** * Default retry configuration */ declare const DEFAULT_RETRY_CONFIG: RetryConfig; /** * Circuit breaker for preventing cascading failures */ declare class CircuitBreaker { private readonly failureThreshold; private readonly recoveryTime; private failures; private lastFailureTime; private state; constructor(failureThreshold?: number, recoveryTime?: number); execute(operation: () => Promise): Promise; private onSuccess; private onFailure; getState(): { state: string; failures: number; lastFailureTime: number; }; reset(): void; } /** * Enhanced retry utility with exponential backoff */ declare class RetryHandler { private readonly config; private circuitBreaker; constructor(config?: RetryConfig); execute(operation: () => Promise, context?: string): Promise; private shouldRetry; private calculateDelay; private categorizeError; getStats(): { circuitBreakerState: ReturnType; config: RetryConfig; }; reset(): void; } /** * Fallback handler for graceful degradation */ declare class FallbackHandler { private fallbackStrategies; constructor(); private setupDefaultFallbacks; handleError(error: IPFSOperationError, fallbackValue?: T): Promise; registerFallback(errorType: IPFSError, strategy: (error: IPFSOperationError) => Promise): void; } /** * Comprehensive error handler that combines retry logic with fallback strategies */ declare class IPFSErrorHandler { private retryHandler; private fallbackHandler; constructor(retryConfig?: Partial); executeWithErrorHandling(operation: () => Promise>, context?: string, fallbackValue?: T): Promise>; /** * Register a custom fallback strategy */ registerFallback(errorType: IPFSError, strategy: (error: IPFSOperationError) => Promise): void; /** * Get error handler statistics */ getStats(): { retryStats: ReturnType; registeredFallbacks: IPFSError[]; }; /** * Reset all error handling state */ reset(): void; } /** * Utility function to create a configured error handler */ declare function createIPFSErrorHandler(config?: { retryConfig?: Partial; customFallbacks?: { errorType: IPFSError; strategy: (error: IPFSOperationError) => Promise; }[]; }): IPFSErrorHandler; /** * Type guard to check if an error is an IPFS error */ declare function isIPFSError(error: unknown): error is IPFSOperationError; /** * Helper function to wrap any IPFS operation with error handling */ declare function withIPFSErrorHandling(operation: () => Promise, context?: string, errorHandler?: IPFSErrorHandler): Promise>; /** * Wallet Funding Utilities * * Provides robust wallet funding strategies that don't depend solely on unreliable devnet airdrops. * Supports multiple funding strategies with automatic fallback mechanisms. */ /** * Funding strategy options */ interface FundingStrategyOptions { /** Target amount in lamports */ amount: bigint; /** Minimum amount required (if less, will try to top up) */ minAmount?: bigint; /** Maximum retries for airdrop */ maxRetries?: number; /** Delay between retries in ms */ retryDelay?: number; /** Use treasury wallet if available */ useTreasury?: boolean; /** Treasury wallet path or signer */ treasuryWallet?: string | KeyPairSigner; /** Additional funded wallets to try */ fundedWallets?: (string | KeyPairSigner)[]; /** Log funding attempts */ verbose?: boolean; } /** * Funding result */ interface FundingResult { /** Whether funding was successful */ success: boolean; /** Final balance after funding */ balance: bigint; /** Funding method used */ method: 'airdrop' | 'treasury' | 'funded-wallet' | 'existing'; /** Number of attempts made */ attempts: number; /** Error if funding failed */ error?: string; /** Transaction signature if transfer was made */ signature?: string; } /** * Wallet funding utility with multiple strategies */ declare class WalletFundingService { private rpc; private commitment; private isDevnetUrl; constructor(rpcUrl: string, commitment?: Commitment$1); /** * Fund a wallet using multiple strategies */ fundWallet(targetWallet: Address, options: FundingStrategyOptions): Promise; /** * Try to fund using devnet airdrop with retries */ private tryAirdrop; /** * Try to fund from treasury wallet */ private tryTreasuryFunding; /** * Try to fund from another funded wallet */ private tryFundedWalletTransfer; /** * Transfer SOL from one wallet to another */ private transferSol; /** * Load wallet from path or return existing signer */ private loadWallet; /** * Load wallet from base58 private key */ static loadWalletFromBase58(base58PrivateKey: string): Promise; /** * Get wallet balance */ getBalance(wallet: Address): Promise; /** * Check if connected to devnet */ private isDevnet; /** * Format lamports as SOL */ private formatSol; /** * Create and fund multiple test wallets */ createAndFundTestWallets(count: number, amountPerWallet: bigint, options: Omit): Promise; /** * Ensure minimum balance for a wallet */ ensureMinimumBalance(wallet: Address, minBalance: bigint, options?: Partial): Promise; } /** * Default funding service instance for devnet */ declare const defaultFundingService: WalletFundingService; /** * Quick helper to fund a wallet with default settings */ declare function fundWallet(wallet: Address, amountInSol: number, options?: Partial): Promise; /** * Quick helper to ensure minimum balance */ declare function ensureMinimumBalance(wallet: Address, minBalanceInSol: number, options?: Partial): Promise; /** * Private Metadata Storage * * Handles off-chain storage of encrypted data with on-chain references. * Supports IPFS and other storage backends for private data while * maintaining on-chain integrity verification. */ interface StorageProvider { store(data: Uint8Array): Promise; retrieve(hash: string): Promise; delete(hash: string): Promise; } interface StoredPrivateData { /** On-chain reference hash */ onChainHash: Uint8Array; /** Storage provider identifier */ storageProvider: 'ipfs' | 'arweave' | 'custom'; /** Storage location (IPFS hash, Arweave ID, etc) */ storageLocation: string; /** Encryption metadata */ encryptionMetadata: { version: number; publicKey: Uint8Array; timestamp: number; }; /** Size of stored data */ size: number; /** Content type hint */ contentType?: string; } interface PrivateDataReference { /** Account storing the reference */ account: Address; /** Storage details */ storage: StoredPrivateData; /** Access control */ accessControl: { owner: Address; allowedReaders: Address[]; expiresAt?: number; }; } /** * Real IPFS storage provider using kubo-rpc-client (2025) * Connects to actual IPFS nodes for production use * * SECURITY NOTICE (Kluster MCP): * - All data stored is encrypted client-side before IPFS upload * - Use private IPFS networks for sensitive production data * - Implement proper key management and rotation policies * - Monitor for unauthorized access patterns */ declare class IPFSProvider implements StorageProvider { private client; private readonly isPrivateNetwork; constructor(options?: { ipfsNodeUrl?: string; headers?: Record; usePrivateNetwork?: boolean; }); store(data: Uint8Array): Promise; /** * Basic heuristic to detect potentially unencrypted data * This is not foolproof but can catch obvious cases */ private isDataUnencrypted; retrieve(hash: string): Promise; delete(hash: string): Promise; } /** * Local storage provider (for development) */ declare class LocalStorageProvider implements StorageProvider { private prefix; store(data: Uint8Array): Promise; retrieve(hash: string): Promise; delete(hash: string): Promise; } declare class PrivateMetadataStorage { private encryptionService; private storageProvider; private featureFlags; constructor(storageProvider?: StorageProvider, encryptionService?: ClientEncryptionService); /** * Store private data off-chain with on-chain reference */ storePrivateData(data: Record, publicMetadata: Record, recipientPubkey: Uint8Array): Promise; /** * Retrieve private data from off-chain storage */ retrievePrivateData(reference: StoredPrivateData, secretKey: Uint8Array): Promise<{ privateData: Record; publicData: Record; }>; /** * Create a verifiable link between on-chain and off-chain data */ createVerifiableLink(onChainData: Record, offChainReference: StoredPrivateData): Uint8Array; /** * Batch store multiple private data items */ batchStore(items: { data: Record; publicMetadata: Record; recipientPubkey: Uint8Array; }[]): Promise; private serializePrivateMetadata; private deserializePrivateMetadata; private createOnChainHash; private decryptPrivateData; } /** * Query builder for private data */ declare class PrivateDataQuery { private conditions; where(field: string, operator: 'eq' | 'gt' | 'lt' | 'contains', value: unknown): this; whereEncrypted(field: string, commitment: Uint8Array): this; /** * Execute query against encrypted data * Note: This is limited compared to on-chain queries */ execute(storage: PrivateMetadataStorage, references: StoredPrivateData[]): Promise; } /** * Calculate storage cost estimate */ declare function estimateStorageCost(dataSize: number, provider: 'ipfs' | 'arweave'): { cost: bigint; currency: string; }; /** * Create a privacy manifest for transparency */ interface PrivacyManifest { dataTypes: string[]; encryptionMethod: 'elgamal' | 'aes256'; storageLocation: 'ipfs' | 'arweave' | 'on-chain'; retentionPeriod?: number; accessControl: 'owner-only' | 'public-read' | 'permissioned'; } declare function createPrivacyManifest(dataTypes: string[], options?: Partial): PrivacyManifest; /** * Feature Gate Detector * * Runtime detection of Solana feature gates to determine which native * programs and features are available on the current network. * * This module specifically tracks feature gates * and provides caching to minimize RPC calls. */ /** * Known feature gate addresses */ declare const FEATURE_GATES: { /** Confidential transfers feature (placeholder) */ readonly CONFIDENTIAL_TRANSFERS: Address<"11111111111111111111111111111111">; /** Token-2022 program (placeholder) */ readonly TOKEN_2022: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">; }; interface FeatureStatus { /** Whether the feature is activated */ activated: boolean; /** When the status was last checked */ lastChecked: number; /** Optional activation slot if known */ activationSlot?: bigint; /** Error if status check failed */ error?: string; } /** * Check if a feature gate is activated on the current network * * @param connection - Solana connection * @param featureGate - Feature gate public key to check * @returns Feature activation status */ declare function checkFeatureGate(rpc: Rpc, featureGate: Address): Promise; /** * Clear the feature gate cache * Useful for testing or forcing fresh checks */ declare function clearFeatureGateCache(): void; export { type AggregatedReputation, type ApiResolverConfig, type ApproveDeliveryParams, type ArbitrateDisputeParams, type ArbitratorDecision, BaseModule, BaseReputationAdapter, type BatchFetchConfig, type BatchProgressCallback, CircuitBreaker, ClientEncryptionService, ContentStorageResult, type CreateEscrowParams, DEFAULT_IPFS_CONFIG, DEFAULT_RETRY_CONFIG, type DeliverySubmittedEvent, type DisputeFiledEvent, type DisputeResolvedEvent, type EscrowCompletedEvent, type EscrowCreatedEvent, EscrowModule, EscrowStatus, ExtendedRpcApi, ExternalIdResolver, FEATURE_GATES, FallbackHandler, type FeatureStatus, type FileDisputeParams, type FundingResult, type FundingStrategyOptions, GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, type GhostProtectEscrow, type GhostSlashedEvent, type GhostStakedEvent, type GhostUnstakedEvent, INSTRUCTION_MAPPINGS, IPFSClient, IPFSConfig, IPFSContentMetadata, IPFSError, IPFSErrorHandler, IPFSOperationError, IPFSOperationResult, IPFSProvider, IPFSUploadOptions, IPFSUtils, InstructionValidationError, LocalStorageProvider, MetricVisibility, MultiSourceAggregator, type PrivacyManifest, PrivacyMode, PrivacySettings, PrivateDataQuery, type PrivateDataReference, PrivateMetadataStorage, ReputationSource, type ReputationSourceAdapter, type ReputationSourceConfig, type ReputationTagsUpdatedEvent, RetryHandler, RpcClient, ScoreRange, type SignatureInfo, SlashReason, type SourceReputationData, type SourceScoreBreakdown, type StorageProvider, type StoredPrivateData, type SubmitDeliveryParams, TEST_IPFS_CONFIG, type TagDecayAppliedEvent, type TagScore, VisibleReputation, WalletFundingService, type X402IndexerConfig, type X402PaymentData, X402TransactionIndexer, batchGetAccounts, batchGetAccountsWithRetry, batchGetAndMap, batchGetExistingAccounts, calculateVisibleScore, canViewerAccess, checkFeatureGate, clearFeatureGateCache, createAccountMismatchError, createBatchFetcher, createIPFSErrorHandler, createIPFSUtils, createMetadataUri, createPrivacyManifest, createTestIPFSConfig, debugInstructionCall, defaultFundingService, determineStorageMethod, enhanceErrorMessage, ensureMinimumBalance, estimateStorageCost, filterMetricsByVisibility, fundWallet, generateAccountValidationError, getAccountRequirements, getApproveDeliveryInstruction, getArbitrateDisputeInstruction, getClaimGhostInstruction, getCreateDidDocumentInstructionAsync, getCreateEscrowInstructionAsync, getDeactivateDidDocumentInstructionAsync, getDefaultMetricVisibility, getFileDisputeInstruction, getGhostProtectEscrowDecoder, getInitializeStakingConfigInstructionAsync, getInstructionMapping, getPDAAccounts, getRangeDisplayString, getRegisterAgentInstructionAsync, getReputationTier, getRequiredSigners, getResolveDidDocumentInstructionAsync, getScoreRange, getSlashStakeInstructionAsync, getStakeGhostInstructionAsync, getSubmitDeliveryInstruction, getTierDisplayName, getUnstakeGhostInstructionAsync, getUpdateDidDocumentInstructionAsync, getUpdateReputationTagsInstructionAsync, getWritableAccounts, isIPFSError, isKnownInstruction, validateInstructionAccounts, validatePrivacySettings, withIPFSErrorHandling };