@ghostspeak/sdk 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +295 -30
  2. package/dist/GhostSpeakClient-bnXwUPHI.d.ts +1011 -0
  3. package/dist/StakingModule-DunDShLq.d.ts +2446 -0
  4. package/dist/{agent-M74TCRON.js → agent-S42FIMR7.js} +4 -4
  5. package/dist/{agent-M74TCRON.js.map → agent-S42FIMR7.js.map} +1 -1
  6. package/dist/batch-operations-45CQFEID.js +4 -0
  7. package/dist/batch-operations-45CQFEID.js.map +1 -0
  8. package/dist/browser-CI5_6Gzk.d.ts +234 -0
  9. package/dist/browser.d.ts +6 -576
  10. package/dist/browser.js +15 -842
  11. package/dist/browser.js.map +1 -1
  12. package/dist/chunk-46QWY3MG.js +156 -0
  13. package/dist/chunk-46QWY3MG.js.map +1 -0
  14. package/dist/{chunk-F3DZMBUA.js → chunk-5QBSC4T4.js} +327 -493
  15. package/dist/chunk-5QBSC4T4.js.map +1 -0
  16. package/dist/chunk-5QZVFUXB.js +4176 -0
  17. package/dist/chunk-5QZVFUXB.js.map +1 -0
  18. package/dist/chunk-6XCCMJ6M.js +1865 -0
  19. package/dist/chunk-6XCCMJ6M.js.map +1 -0
  20. package/dist/chunk-A7ALCVUI.js +98 -0
  21. package/dist/chunk-A7ALCVUI.js.map +1 -0
  22. package/dist/chunk-AWMGX3OX.js +814 -0
  23. package/dist/chunk-AWMGX3OX.js.map +1 -0
  24. package/dist/chunk-BF3IQ35I.js +284 -0
  25. package/dist/chunk-BF3IQ35I.js.map +1 -0
  26. package/dist/chunk-BQDGRTVP.js +168 -0
  27. package/dist/chunk-BQDGRTVP.js.map +1 -0
  28. package/dist/chunk-IQM5RASO.js +8502 -0
  29. package/dist/chunk-IQM5RASO.js.map +1 -0
  30. package/dist/chunk-JYXSOXCP.js +3850 -0
  31. package/dist/chunk-JYXSOXCP.js.map +1 -0
  32. package/dist/chunk-OXA7MECJ.js +7787 -0
  33. package/dist/chunk-OXA7MECJ.js.map +1 -0
  34. package/dist/chunk-QLRWUHN2.js +231 -0
  35. package/dist/chunk-QLRWUHN2.js.map +1 -0
  36. package/dist/chunk-SKMJJ3Q6.js +125 -0
  37. package/dist/chunk-SKMJJ3Q6.js.map +1 -0
  38. package/dist/chunk-TTB4OS2D.js +69 -0
  39. package/dist/chunk-TTB4OS2D.js.map +1 -0
  40. package/dist/chunk-UP2VWCW5.js +33 -0
  41. package/dist/{chunk-NSBPE2FW.js.map → chunk-UP2VWCW5.js.map} +1 -1
  42. package/dist/{chunk-UJUGGLMT.js → chunk-VQZQCHUT.js} +5 -5
  43. package/dist/{chunk-UJUGGLMT.js.map → chunk-VQZQCHUT.js.map} +1 -1
  44. package/dist/client.d.ts +4 -4
  45. package/dist/client.js +11 -10
  46. package/dist/createAgentAuthorization-KGZNXZBT.js +5 -0
  47. package/dist/createAgentAuthorization-KGZNXZBT.js.map +1 -0
  48. package/dist/credentials.js +1 -1
  49. package/dist/crypto.js +2 -2
  50. package/dist/errors.js +1 -1
  51. package/dist/feature-flags-B1g0DCPe.d.ts +1181 -0
  52. package/dist/generated-QJREJQ2C.js +9 -0
  53. package/dist/{generated-VNLHMR6Y.js.map → generated-QJREJQ2C.js.map} +1 -1
  54. package/dist/{ghostspeak_wasm-SB2RPJ3D.js → ghostspeak_wasm-F227HOSM.js} +3 -3
  55. package/dist/{ghostspeak_wasm-SB2RPJ3D.js.map → ghostspeak_wasm-F227HOSM.js.map} +1 -1
  56. package/dist/index.d.ts +1179 -1498
  57. package/dist/index.js +356 -3578
  58. package/dist/index.js.map +1 -1
  59. package/dist/metafile-esm.json +1 -1
  60. package/dist/minimal/core-minimal.d.ts +2446 -1245
  61. package/dist/minimal/core-minimal.js +9 -9
  62. package/dist/minimal/core-minimal.js.map +1 -1
  63. package/dist/nacl-fast-W5BJ3KZ2.js +2229 -0
  64. package/dist/nacl-fast-W5BJ3KZ2.js.map +1 -0
  65. package/dist/pda-4KP7CURF.js +4 -0
  66. package/dist/pda-4KP7CURF.js.map +1 -0
  67. package/dist/pda-Ce7VYg4T.d.ts +25 -0
  68. package/dist/reputation-types-Yebf0Rm_.d.ts +1071 -0
  69. package/dist/revokeAuthorization-2ZRO6GUZ.js +5 -0
  70. package/dist/revokeAuthorization-2ZRO6GUZ.js.map +1 -0
  71. package/dist/signature-verification-DGxR4aYQ.d.ts +448 -0
  72. package/dist/types.js +1 -1
  73. package/dist/updateReputationWithAuth-PCEUOCFV.js +5 -0
  74. package/dist/updateReputationWithAuth-PCEUOCFV.js.map +1 -0
  75. package/dist/utils.d.ts +69 -203
  76. package/dist/utils.js +15 -153
  77. package/dist/utils.js.map +1 -1
  78. package/package.json +27 -34
  79. package/dist/.tsbuildinfo +0 -1
  80. package/dist/GhostSpeakClient-D_66Uzsf.d.ts +0 -707
  81. package/dist/GovernanceModule-DQYYys-H.d.ts +0 -1766
  82. package/dist/chunk-APCKGD23.js +0 -1328
  83. package/dist/chunk-APCKGD23.js.map +0 -1
  84. package/dist/chunk-ASQXX4IT.js +0 -572
  85. package/dist/chunk-ASQXX4IT.js.map +0 -1
  86. package/dist/chunk-COGZFWOT.js +0 -19657
  87. package/dist/chunk-COGZFWOT.js.map +0 -1
  88. package/dist/chunk-F3DZMBUA.js.map +0 -1
  89. package/dist/chunk-GMHIUK2R.js +0 -7526
  90. package/dist/chunk-GMHIUK2R.js.map +0 -1
  91. package/dist/chunk-IAWBZYPE.js +0 -356
  92. package/dist/chunk-IAWBZYPE.js.map +0 -1
  93. package/dist/chunk-NSBPE2FW.js +0 -15
  94. package/dist/chunk-OWYHJG6H.js +0 -13311
  95. package/dist/chunk-OWYHJG6H.js.map +0 -1
  96. package/dist/chunk-RDDPOFR5.js +0 -3
  97. package/dist/chunk-RDDPOFR5.js.map +0 -1
  98. package/dist/chunk-RERCHKZP.js +0 -35
  99. package/dist/chunk-RERCHKZP.js.map +0 -1
  100. package/dist/chunk-TVVGXYCI.js +0 -2887
  101. package/dist/chunk-TVVGXYCI.js.map +0 -1
  102. package/dist/chunk-ZGP5552B.js +0 -377
  103. package/dist/chunk-ZGP5552B.js.map +0 -1
  104. package/dist/chunk-ZWOYNHVK.js +0 -196
  105. package/dist/chunk-ZWOYNHVK.js.map +0 -1
  106. package/dist/dist/.tsbuildinfo +0 -1
  107. package/dist/elgamal-VZLWB3XK.js +0 -5
  108. package/dist/elgamal-VZLWB3XK.js.map +0 -1
  109. package/dist/feature-flags-V722ZuXO.d.ts +0 -3512
  110. package/dist/generated-VNLHMR6Y.js +0 -5
  111. package/dist/ipfs-types-BOt9ZNg4.d.ts +0 -592
  112. package/dist/multisigConfig-BzEhy6jy.d.ts +0 -58
  113. package/dist/pda-B_nS8SbD.d.ts +0 -114
  114. package/dist/pda-S4BFJVGE.js +0 -4
  115. package/dist/pda-S4BFJVGE.js.map +0 -1
  116. package/dist/system-addresses-BFNLEbFx.d.ts +0 -857
  117. package/dist/token-2022-rpc-RALH4RK7.js +0 -593
  118. package/dist/token-2022-rpc-RALH4RK7.js.map +0 -1
@@ -0,0 +1,2446 @@
1
+ import { Address as Address$1 } from '@solana/addresses';
2
+ import { ReadonlyUint8Array, Option, Address, Decoder, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, FixedSizeDecoder, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, WritableSignerAccount, AccountSignerMeta, ReadonlyAccount, Commitment as Commitment$1, Rpc, GetLatestBlockhashApi, SendTransactionApi, GetAccountInfoApi, SimulateTransactionApi, GetFeeForMessageApi, GetProgramAccountsApi, GetEpochInfoApi, GetSignatureStatusesApi, GetMultipleAccountsApi, RpcSubscriptions, SignatureNotificationsApi, SlotNotificationsApi, AccountRole, TransactionSigner, Signature as Signature$1 } from '@solana/kit';
3
+ import { I as IPFSConfig, G as GovernanceProposal, n as ProposalTypeArgs, E as ExecutionParamsArgs, o as CategoryReputation, B as BadgeType, J as JobPerformance, a as ReputationCalculationResult, p as ReputationTier, b as ReputationMetrics, c as TagScore, q as TagCategory, d as TagFilters, e as TagQueryResult } from './reputation-types-Yebf0Rm_.js';
4
+ import { ParticipantType } from './types.js';
5
+
6
+ /**
7
+ * This code was AUTOGENERATED using the Codama library.
8
+ * Please DO NOT EDIT THIS FILE, instead use visitors
9
+ * to add features, then rerun Codama to update it.
10
+ *
11
+ * @see https://github.com/codama-idl/codama
12
+ */
13
+
14
+ /** Access tiers based on GHOST token stake amount */
15
+ declare enum AccessTier {
16
+ None = 0,
17
+ Basic = 1,
18
+ Verified = 2,
19
+ Pro = 3,
20
+ Whale = 4
21
+ }
22
+
23
+ /**
24
+ * This code was AUTOGENERATED using the Codama library.
25
+ * Please DO NOT EDIT THIS FILE, instead use visitors
26
+ * to add features, then rerun Codama to update it.
27
+ *
28
+ * @see https://github.com/codama-idl/codama
29
+ */
30
+
31
+ /** Agent lifecycle status (Ghost Identity) */
32
+ declare enum AgentStatus {
33
+ Unregistered = 0,
34
+ Registered = 1,
35
+ Claimed = 2,
36
+ Verified = 3
37
+ }
38
+
39
+ /**
40
+ * This code was AUTOGENERATED using the Codama library.
41
+ * Please DO NOT EDIT THIS FILE, instead use visitors
42
+ * to add features, then rerun Codama to update it.
43
+ *
44
+ * @see https://github.com/codama-idl/codama
45
+ */
46
+
47
+ /** Cross-platform identity mapping */
48
+ type ExternalIdentifier = {
49
+ platform: string;
50
+ externalId: string;
51
+ verified: boolean;
52
+ verifiedAt: bigint;
53
+ };
54
+
55
+ /**
56
+ * This code was AUTOGENERATED using the Codama library.
57
+ * Please DO NOT EDIT THIS FILE, instead use visitors
58
+ * to add features, then rerun Codama to update it.
59
+ *
60
+ * @see https://github.com/codama-idl/codama
61
+ */
62
+
63
+ /**
64
+ * MultisigType defines the governance layer a multisig belongs to.
65
+ * Different types have different permissions and requirements.
66
+ */
67
+ declare enum MultisigType {
68
+ Protocol = 0,
69
+ Dao = 1,
70
+ Dispute = 2,
71
+ AgentConsortium = 3,
72
+ AgentTreasury = 4,
73
+ Custom = 5
74
+ }
75
+ type MultisigTypeArgs = MultisigType;
76
+
77
+ /**
78
+ * This code was AUTOGENERATED using the Codama library.
79
+ * Please DO NOT EDIT THIS FILE, instead use visitors
80
+ * to add features, then rerun Codama to update it.
81
+ *
82
+ * @see https://github.com/codama-idl/codama
83
+ */
84
+
85
+ type MultisigTypeConfigArgs = {
86
+ /** The multisig type */
87
+ multisigType: MultisigTypeArgs;
88
+ /** Required timelock duration in seconds (0 = no timelock) */
89
+ timelockSeconds: number | bigint;
90
+ /** Minimum number of signers allowed */
91
+ minSigners: number;
92
+ /** Maximum number of signers allowed */
93
+ maxSigners: number;
94
+ /** Minimum reputation score required (0-10000 basis points) */
95
+ minReputationScore: number;
96
+ /** Whether signers must hold governance tokens */
97
+ requiresTokenHoldings: boolean;
98
+ /** Minimum token balance required (if requires_token_holdings) */
99
+ minTokenBalance: number | bigint;
100
+ };
101
+
102
+ /**
103
+ * This code was AUTOGENERATED using the Codama library.
104
+ * Please DO NOT EDIT THIS FILE, instead use visitors
105
+ * to add features, then rerun Codama to update it.
106
+ *
107
+ * @see https://github.com/codama-idl/codama
108
+ */
109
+
110
+ declare enum PricingModel$1 {
111
+ Fixed = 0,
112
+ Hourly = 1,
113
+ PerTask = 2,
114
+ Subscription = 3,
115
+ Auction = 4,
116
+ Dynamic = 5,
117
+ RevenueShare = 6,
118
+ Tiered = 7
119
+ }
120
+ type PricingModelArgs = PricingModel$1;
121
+
122
+ /**
123
+ * This code was AUTOGENERATED using the Codama library.
124
+ * Please DO NOT EDIT THIS FILE, instead use visitors
125
+ * to add features, then rerun Codama to update it.
126
+ *
127
+ * @see https://github.com/codama-idl/codama
128
+ */
129
+
130
+ /** Reputation component for multi-source Ghost Score */
131
+ type ReputationComponent = {
132
+ sourceType: ReputationSourceType;
133
+ score: bigint;
134
+ weight: number;
135
+ lastUpdated: bigint;
136
+ dataPoints: bigint;
137
+ };
138
+
139
+ /**
140
+ * This code was AUTOGENERATED using the Codama library.
141
+ * Please DO NOT EDIT THIS FILE, instead use visitors
142
+ * to add features, then rerun Codama to update it.
143
+ *
144
+ * @see https://github.com/codama-idl/codama
145
+ */
146
+
147
+ /** Multi-source reputation types for Ghost Score */
148
+ declare enum ReputationSourceType {
149
+ AccountAge = 0,
150
+ X402Transactions = 1,
151
+ UserReviews = 2,
152
+ ElizaOSReputation = 3,
153
+ CrossmintVerification = 4,
154
+ EndpointReliability = 5,
155
+ JobCompletions = 6,
156
+ SkillEndorsements = 7
157
+ }
158
+
159
+ /**
160
+ * This code was AUTOGENERATED using the Codama library.
161
+ * Please DO NOT EDIT THIS FILE, instead use visitors
162
+ * to add features, then rerun Codama to update it.
163
+ *
164
+ * @see https://github.com/codama-idl/codama
165
+ */
166
+
167
+ type Agent = {
168
+ discriminator: ReadonlyUint8Array;
169
+ owner: Option<Address>;
170
+ status: AgentStatus;
171
+ agentId: string;
172
+ firstTxSignature: string;
173
+ firstSeenTimestamp: bigint;
174
+ discoverySource: string;
175
+ claimedAt: Option<bigint>;
176
+ agentType: number;
177
+ name: string;
178
+ description: string;
179
+ capabilities: Array<string>;
180
+ pricingModel: PricingModel$1;
181
+ reputationScore: number;
182
+ totalJobsCompleted: number;
183
+ totalEarnings: bigint;
184
+ isActive: boolean;
185
+ createdAt: bigint;
186
+ updatedAt: bigint;
187
+ originalPrice: bigint;
188
+ genomeHash: string;
189
+ isReplicable: boolean;
190
+ replicationFee: bigint;
191
+ serviceEndpoint: string;
192
+ isVerified: boolean;
193
+ verificationTimestamp: bigint;
194
+ metadataUri: string;
195
+ frameworkOrigin: string;
196
+ supportedTokens: Array<Address>;
197
+ cnftMint: Option<Address>;
198
+ merkleTree: Option<Address>;
199
+ supportsA2a: boolean;
200
+ transferHook: Option<Address>;
201
+ parentAgent: Option<Address>;
202
+ generation: number;
203
+ x402Enabled: boolean;
204
+ x402PaymentAddress: Address;
205
+ x402AcceptedTokens: Array<Address>;
206
+ x402PricePerCall: bigint;
207
+ x402ServiceEndpoint: string;
208
+ x402TotalPayments: bigint;
209
+ x402TotalCalls: bigint;
210
+ lastPaymentTimestamp: bigint;
211
+ externalIdentifiers: Array<ExternalIdentifier>;
212
+ ghostScore: bigint;
213
+ reputationComponents: Array<ReputationComponent>;
214
+ didAddress: Option<Address>;
215
+ credentials: Array<Address>;
216
+ apiSpecUri: string;
217
+ apiVersion: string;
218
+ bump: number;
219
+ };
220
+ /** Gets the decoder for {@link Agent} account data. */
221
+ declare function getAgentDecoder(): Decoder<Agent>;
222
+ declare function decodeAgent<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Agent, TAddress>;
223
+ declare function decodeAgent<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Agent, TAddress>;
224
+ declare function fetchAgent<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Agent, TAddress>>;
225
+ declare function fetchMaybeAgent<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Agent, TAddress>>;
226
+
227
+ /**
228
+ * This code was AUTOGENERATED using the Codama library.
229
+ * Please DO NOT EDIT THIS FILE, instead use visitors
230
+ * to add features, then rerun Codama to update it.
231
+ *
232
+ * @see https://github.com/codama-idl/codama
233
+ */
234
+
235
+ type StakingAccount = {
236
+ discriminator: ReadonlyUint8Array;
237
+ /** Owner of this staking account (can register multiple agents) */
238
+ owner: Address;
239
+ /** Amount of GHOST tokens staked */
240
+ amountStaked: bigint;
241
+ /** Timestamp when staking started */
242
+ stakedAt: bigint;
243
+ /** Lock duration in seconds (minimum 30 days) */
244
+ lockDuration: bigint;
245
+ /** Timestamp when unlock is available */
246
+ unlockAt: bigint;
247
+ /** Reputation boost percentage (in basis points, e.g., 500 = 5%) */
248
+ reputationBoostBps: number;
249
+ /** Whether agent has "Verified" badge */
250
+ hasVerifiedBadge: boolean;
251
+ /** Whether agent has premium listing benefits */
252
+ hasPremiumBenefits: boolean;
253
+ /** Total slashed amount (never recoverable) */
254
+ totalSlashed: bigint;
255
+ /** Current access tier based on stake amount */
256
+ tier: AccessTier;
257
+ /** Daily API calls remaining (resets every 24h) */
258
+ apiCallsRemaining: number;
259
+ /** Last API quota reset timestamp */
260
+ lastQuotaReset: bigint;
261
+ /** Voting power for governance (equals amount_staked) */
262
+ votingPower: bigint;
263
+ /** Bump for PDA */
264
+ bump: number;
265
+ };
266
+ /** Gets the decoder for {@link StakingAccount} account data. */
267
+ declare function getStakingAccountDecoder(): FixedSizeDecoder<StakingAccount>;
268
+
269
+ /**
270
+ * This code was AUTOGENERATED using the Codama library.
271
+ * Please DO NOT EDIT THIS FILE, instead use visitors
272
+ * to add features, then rerun Codama to update it.
273
+ *
274
+ * @see https://github.com/codama-idl/codama
275
+ */
276
+
277
+ type StakingConfig = {
278
+ discriminator: ReadonlyUint8Array;
279
+ /** Authority who can update staking parameters */
280
+ authority: Address;
281
+ /** Minimum stake amount (1,000 GHOST) */
282
+ minStake: bigint;
283
+ /** Minimum lock duration (30 days in seconds) */
284
+ minLockDuration: bigint;
285
+ /** Slash percentage for fraud (50% = 5000 bps) */
286
+ fraudSlashBps: number;
287
+ /** Slash percentage for dispute loss (10% = 1000 bps) */
288
+ disputeSlashBps: number;
289
+ /** Treasury account for slashed tokens */
290
+ treasury: Address;
291
+ bump: number;
292
+ };
293
+ /** Gets the decoder for {@link StakingConfig} account data. */
294
+ declare function getStakingConfigDecoder(): FixedSizeDecoder<StakingConfig>;
295
+
296
+ /**
297
+ * This code was AUTOGENERATED using the Codama library.
298
+ * Please DO NOT EDIT THIS FILE, instead use visitors
299
+ * to add features, then rerun Codama to update it.
300
+ *
301
+ * @see https://github.com/codama-idl/codama
302
+ */
303
+
304
+ declare const GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS: Address<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">;
305
+
306
+ /**
307
+ * This code was AUTOGENERATED using the Codama library.
308
+ * Please DO NOT EDIT THIS FILE, instead use visitors
309
+ * to add features, then rerun Codama to update it.
310
+ *
311
+ * @see https://github.com/codama-idl/codama
312
+ */
313
+
314
+ type InitializeGovernanceProposalInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountProposer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
315
+ TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
316
+ TAccountProposer extends string ? WritableSignerAccount<TAccountProposer> & AccountSignerMeta<TAccountProposer> : TAccountProposer,
317
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
318
+ ...TRemainingAccounts
319
+ ]>;
320
+
321
+ /**
322
+ * CacheManager - Slot-aware RPC result caching
323
+ *
324
+ * Reduces RPC calls by caching account data and PDA derivations
325
+ * with commitment-level aware TTLs.
326
+ *
327
+ * @module CacheManager
328
+ */
329
+
330
+ /**
331
+ * Cache configuration options
332
+ */
333
+ interface CacheConfig {
334
+ /** Enable caching (default: false, opt-in) */
335
+ enabled?: boolean;
336
+ /** Maximum cache entries (default: 1000) */
337
+ maxSize?: number;
338
+ /** Custom TTL overrides (milliseconds) */
339
+ ttlOverrides?: {
340
+ processed?: number;
341
+ confirmed?: number;
342
+ finalized?: number;
343
+ };
344
+ }
345
+ /**
346
+ * CacheManager handles slot-aware caching for RPC results
347
+ *
348
+ * Features:
349
+ * - Commitment-level TTLs (finalized=30s, confirmed=2s, processed=500ms)
350
+ * - Indefinite PDA caching (deterministic addresses)
351
+ * - LRU eviction policy
352
+ * - Opt-in (disabled by default)
353
+ */
354
+ declare class CacheManager {
355
+ private accountCache;
356
+ private pdaCache;
357
+ private config;
358
+ private ttls;
359
+ constructor(config?: CacheConfig);
360
+ /**
361
+ * Check if caching is enabled
362
+ */
363
+ isEnabled(): boolean;
364
+ /**
365
+ * Get cached account data
366
+ *
367
+ * @param address - Account address
368
+ * @param commitment - Commitment level
369
+ * @param currentSlot - Current blockchain slot (for staleness check)
370
+ * @returns Cached data or undefined
371
+ */
372
+ getAccount<T>(address: Address$1, commitment: Commitment$1, currentSlot?: number): T | undefined;
373
+ /**
374
+ * Cache account data
375
+ *
376
+ * @param address - Account address
377
+ * @param data - Account data to cache
378
+ * @param commitment - Commitment level
379
+ * @param slot - Blockchain slot when data was fetched
380
+ */
381
+ setAccount<T>(address: Address$1, data: T, commitment: Commitment$1, slot: number): void;
382
+ /**
383
+ * Get cached PDA
384
+ *
385
+ * PDAs are cached indefinitely as they're deterministic.
386
+ *
387
+ * @param seeds - Serialized seed components
388
+ * @returns Cached PDA or undefined
389
+ */
390
+ getPDA(seeds: string): Address$1 | undefined;
391
+ /**
392
+ * Cache PDA derivation
393
+ *
394
+ * @param seeds - Serialized seed components (use JSON.stringify for consistency)
395
+ * @param pda - Derived PDA address
396
+ */
397
+ setPDA(seeds: string, pda: Address$1): void;
398
+ /**
399
+ * Invalidate account cache entry
400
+ *
401
+ * @param address - Account address to invalidate
402
+ * @param commitment - Optional commitment level (invalidates all if not specified)
403
+ */
404
+ invalidateAccount(address: Address$1, commitment?: Commitment$1): void;
405
+ /**
406
+ * Clear all caches
407
+ */
408
+ clear(): void;
409
+ /**
410
+ * Get cache statistics
411
+ *
412
+ * @returns Cache size and hit/miss stats
413
+ */
414
+ getStats(): {
415
+ accountCache: {
416
+ size: number;
417
+ max: number;
418
+ };
419
+ pdaCache: {
420
+ size: number;
421
+ max: number;
422
+ };
423
+ };
424
+ }
425
+
426
+ type RpcApi = Rpc<GetLatestBlockhashApi & SendTransactionApi & GetAccountInfoApi & SimulateTransactionApi & GetFeeForMessageApi & GetProgramAccountsApi>;
427
+ type ExtendedRpcApi = RpcApi & Rpc<GetEpochInfoApi & GetSignatureStatusesApi & GetMultipleAccountsApi>;
428
+ type RpcSubscriptionApi = RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>;
429
+ type Commitment = 'processed' | 'confirmed' | 'finalized';
430
+
431
+ interface GhostSpeakConfig {
432
+ programId?: Address$1;
433
+ rpc: ExtendedRpcApi;
434
+ rpcSubscriptions?: RpcSubscriptionApi;
435
+ commitment?: Commitment;
436
+ transactionTimeout?: number;
437
+ defaultFeePayer?: Address$1;
438
+ retryConfig?: RetryConfig;
439
+ cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
440
+ rpcEndpoint?: string;
441
+ wsEndpoint?: string;
442
+ /** Optional logger for debug output */
443
+ logger?: {
444
+ info: (...args: unknown[]) => void;
445
+ error: (...args: unknown[]) => void;
446
+ };
447
+ /** Cache configuration for RPC result caching */
448
+ cache?: CacheConfig;
449
+ /** Token 2022 configuration options */
450
+ token2022?: Token2022Config;
451
+ /** IPFS configuration for large content storage */
452
+ ipfsConfig?: IPFSConfig;
453
+ /** Credential configuration for Crossmint sync */
454
+ credentials?: CredentialConfig;
455
+ }
456
+ interface CredentialConfig {
457
+ crossmintApiKey?: string;
458
+ crossmintEnvironment?: 'staging' | 'production';
459
+ crossmintChain?: 'base-sepolia' | 'polygon-amoy' | 'base' | 'polygon';
460
+ templates?: {
461
+ agentIdentity?: string;
462
+ reputation?: string;
463
+ jobCompletion?: string;
464
+ };
465
+ }
466
+ interface Token2022Config {
467
+ /** Enable Token 2022 features by default */
468
+ enabled?: boolean;
469
+ /** Default behavior for transfer fees */
470
+ defaultExpectTransferFees?: boolean;
471
+ /** Maximum transfer fee slippage (basis points) */
472
+ maxFeeSlippageBasisPoints?: number;
473
+ /** Enable confidential transfers by default */
474
+ enableConfidentialTransfers?: boolean;
475
+ /** Default Token 2022 program address (for custom deployments) */
476
+ programAddress?: Address$1;
477
+ /** Cache token program detection results for this many seconds */
478
+ tokenProgramCacheTtl?: number;
479
+ }
480
+ interface RetryConfig {
481
+ maxRetries?: number;
482
+ baseDelay?: number;
483
+ maxDelay?: number;
484
+ backoffMultiplier?: number;
485
+ retryableErrors?: string[];
486
+ }
487
+ interface AgentWithAddress {
488
+ address: Address$1;
489
+ data: Agent;
490
+ }
491
+ interface AgentRegistrationData {
492
+ agentId: string;
493
+ name: string;
494
+ description: string;
495
+ metadataUri: string;
496
+ agentType: number;
497
+ }
498
+ interface AgentAccount {
499
+ owner: Address$1;
500
+ name: string;
501
+ description: string;
502
+ capabilities: string[];
503
+ metadataUri: string;
504
+ serviceEndpoint: string;
505
+ isActive: boolean;
506
+ registeredAt: bigint;
507
+ reputation: number;
508
+ totalEarnings: bigint;
509
+ totalJobs: number;
510
+ successRate: number;
511
+ bump: number;
512
+ }
513
+ declare enum PricingModel {
514
+ Fixed = "Fixed",
515
+ Hourly = "Hourly",
516
+ PerTask = "PerTask",
517
+ Subscription = "Subscription",
518
+ Auction = "Auction"
519
+ }
520
+ declare class GhostSpeakError extends Error {
521
+ code?: string | undefined;
522
+ constructor(message: string, code?: string | undefined);
523
+ }
524
+ interface RegisterAgentParams {
525
+ agentData: AgentRegistrationData;
526
+ }
527
+ interface RpcResponse<T> {
528
+ value: T | null;
529
+ }
530
+ interface RpcAccountInfo {
531
+ executable: boolean;
532
+ lamports: bigint;
533
+ owner: Address$1;
534
+ rentEpoch: bigint;
535
+ space: bigint;
536
+ data: string | Uint8Array;
537
+ }
538
+ interface RpcProgramAccount {
539
+ pubkey: Address$1;
540
+ account: RpcAccountInfo;
541
+ }
542
+ interface RpcProgramAccountsResponse {
543
+ value: RpcProgramAccount[] | null;
544
+ }
545
+ interface RpcAccountInfoResponse {
546
+ value: RpcAccountInfo | null;
547
+ }
548
+ interface RpcMultipleAccountsResponse {
549
+ value: (RpcAccountInfo | null)[];
550
+ }
551
+ interface TransactionResponse {
552
+ signature: string;
553
+ confirmationStatus?: Commitment;
554
+ err?: unknown | null;
555
+ }
556
+ interface SimulatedTransactionResponse {
557
+ value: {
558
+ err?: unknown | null;
559
+ logs?: string[];
560
+ unitsConsumed?: number;
561
+ };
562
+ }
563
+ interface SolanaRpcClient {
564
+ getAccountInfo(address: Address$1, options?: {
565
+ commitment?: Commitment;
566
+ encoding?: string;
567
+ }): Promise<RpcAccountInfoResponse>;
568
+ getMultipleAccounts(addresses: Address$1[], options?: {
569
+ commitment?: Commitment;
570
+ encoding?: string;
571
+ }): Promise<RpcMultipleAccountsResponse>;
572
+ getProgramAccounts(programId: Address$1, options?: {
573
+ commitment?: Commitment;
574
+ encoding?: string;
575
+ filters?: unknown[];
576
+ }): Promise<RpcProgramAccountsResponse>;
577
+ sendTransaction(transaction: unknown, options?: {
578
+ commitment?: Commitment;
579
+ }): Promise<TransactionResponse>;
580
+ simulateTransaction(transaction: unknown, options?: {
581
+ commitment?: Commitment;
582
+ }): Promise<SimulatedTransactionResponse>;
583
+ }
584
+ interface EmergencyConfig {
585
+ emergencyDelay?: bigint;
586
+ emergencyThreshold?: number;
587
+ emergencySigners?: Address$1[];
588
+ canEmergencyPause?: boolean;
589
+ emergencyContact?: string;
590
+ }
591
+
592
+ /**
593
+ * Developer Tools for GhostSpeak SDK
594
+ *
595
+ * Provides debugging, inspection, and development utilities
596
+ */
597
+
598
+ /**
599
+ * Transaction analysis result
600
+ */
601
+ interface TransactionAnalysis {
602
+ instructions: InstructionAnalysis[];
603
+ totalAccounts: number;
604
+ signerCount: number;
605
+ writableAccounts: Address$1[];
606
+ readonlyAccounts: Address$1[];
607
+ estimatedSize: number;
608
+ estimatedComputeUnits: bigint;
609
+ estimatedFee: bigint;
610
+ warnings: string[];
611
+ }
612
+ /**
613
+ * Individual instruction analysis
614
+ */
615
+ interface InstructionAnalysis {
616
+ index: number;
617
+ programId: Address$1;
618
+ accountCount: number;
619
+ dataSize: number;
620
+ humanReadable: string;
621
+ accounts: AccountInfo[];
622
+ }
623
+ /**
624
+ * Account information in instruction
625
+ */
626
+ interface AccountInfo {
627
+ address: Address$1;
628
+ isWritable: boolean;
629
+ isSigner: boolean;
630
+ role: AccountRole;
631
+ }
632
+
633
+ /**
634
+ * Type for instruction-like objects from generated code
635
+ */
636
+ type InstructionLike = {
637
+ programAddress: Address$1;
638
+ accounts?: readonly unknown[];
639
+ data?: unknown;
640
+ };
641
+ /**
642
+ * Unified instruction builder that eliminates duplication across all instruction classes.
643
+ * This is the single source of truth for instruction execution patterns.
644
+ */
645
+ declare class InstructionBuilder {
646
+ private rpcClient;
647
+ private config;
648
+ private devTools;
649
+ private debugMode;
650
+ constructor(config: GhostSpeakConfig);
651
+ /**
652
+ * Execute a single instruction with unified error handling and transaction patterns
653
+ */
654
+ execute<T = string>(instructionName: string, instructionGetter: () => Promise<InstructionLike> | InstructionLike, signers: TransactionSigner[], options?: {
655
+ simulate?: boolean;
656
+ returnDetails?: boolean;
657
+ skipPreflight?: boolean;
658
+ maxRetries?: number;
659
+ }): Promise<T>;
660
+ /**
661
+ * Execute multiple instructions in a single transaction
662
+ */
663
+ executeBatch<T = string>(batchName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[], signers: TransactionSigner[], options?: {
664
+ simulate?: boolean;
665
+ returnDetails?: boolean;
666
+ skipPreflight?: boolean;
667
+ }): Promise<T>;
668
+ /**
669
+ * Get and decode account data with unified error handling
670
+ */
671
+ getAccount<T>(address: Address$1, decoderImportName: string): Promise<T | null>;
672
+ /**
673
+ * Get multiple accounts with unified pattern
674
+ */
675
+ getAccounts<T>(addresses: Address$1[], decoderImportName: string): Promise<(T | null)[]>;
676
+ /**
677
+ * Get program accounts with filters
678
+ */
679
+ getProgramAccounts<T>(decoderImportName: string, filters?: ({
680
+ dataSize: bigint;
681
+ } | {
682
+ memcmp: {
683
+ offset: bigint;
684
+ bytes: string;
685
+ encoding?: 'base58' | 'base64';
686
+ };
687
+ })[]): Promise<{
688
+ address: Address$1;
689
+ data: T;
690
+ }[]>;
691
+ /**
692
+ * Enable debug mode for next transaction
693
+ */
694
+ enableDebug(): this;
695
+ /**
696
+ * Debug transaction - analyze without executing
697
+ */
698
+ debug(instructionName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<TransactionAnalysis>;
699
+ /**
700
+ * Get human-readable explanation of transaction
701
+ */
702
+ explain(instructionName: string, instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<string>;
703
+ /**
704
+ * Estimate transaction cost
705
+ */
706
+ estimateCost(instructionGetters: (() => Promise<InstructionLike> | InstructionLike)[]): Promise<bigint>;
707
+ private sendAndConfirm;
708
+ private simulateInstruction;
709
+ private simulateBatch;
710
+ private estimateTransactionSize;
711
+ private extractRawData;
712
+ /**
713
+ * Create a communication session instruction
714
+ */
715
+ createCommunicationSession(_params: {
716
+ sessionId: bigint;
717
+ initiator: Address$1;
718
+ initiatorType: ParticipantType;
719
+ responder: Address$1;
720
+ responderType: ParticipantType;
721
+ sessionType: string;
722
+ metadata: string;
723
+ expiresAt: bigint;
724
+ }): Promise<InstructionLike>;
725
+ /**
726
+ * Send a communication message instruction
727
+ */
728
+ sendCommunicationMessage(_sessionAddress: Address$1, _params: {
729
+ messageId: bigint;
730
+ senderType: unknown;
731
+ content: string;
732
+ messageType: string;
733
+ attachments: string[];
734
+ }): Promise<InstructionLike>;
735
+ /**
736
+ * Update participant status instruction
737
+ */
738
+ updateParticipantStatus(_params: {
739
+ participant: Address$1;
740
+ participantType: unknown;
741
+ servicesOffered: string[];
742
+ availability: boolean;
743
+ reputationScore: number;
744
+ }): Promise<InstructionLike>;
745
+ }
746
+
747
+ /**
748
+ * Solana cluster types for URL generation
749
+ */
750
+ type SolanaCluster = 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
751
+ /**
752
+ * Transaction result with verification URLs
753
+ */
754
+ interface TransactionResult {
755
+ signature: string | Signature$1;
756
+ cluster: SolanaCluster;
757
+ urls: {
758
+ solanaExplorer: string;
759
+ solscan: string;
760
+ solanaFM: string;
761
+ xray: string;
762
+ };
763
+ commitment: Commitment;
764
+ timestamp: number;
765
+ }
766
+
767
+ type Signature = string;
768
+ type IInstruction = Instruction;
769
+
770
+ /**
771
+ * Base class for all instruction modules using the unified InstructionBuilder.
772
+ * This replaces the old BaseInstructions class with a much simpler pattern.
773
+ */
774
+ declare abstract class BaseModule {
775
+ protected builder: InstructionBuilder;
776
+ protected config: GhostSpeakConfig;
777
+ protected logger?: {
778
+ info: (...args: unknown[]) => void;
779
+ error: (...args: unknown[]) => void;
780
+ };
781
+ protected cacheManager: CacheManager;
782
+ private _debugMode;
783
+ constructor(config: GhostSpeakConfig);
784
+ /**
785
+ * Enable debug mode for next operation
786
+ */
787
+ debug(): this;
788
+ /**
789
+ * Execute a single instruction
790
+ */
791
+ protected execute(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction, signers: TransactionSigner[]): Promise<string>;
792
+ /**
793
+ * Execute a single instruction with detailed result
794
+ */
795
+ protected executeWithDetails(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction, signers: TransactionSigner[]): Promise<TransactionResult>;
796
+ /**
797
+ * Execute multiple instructions in a batch
798
+ */
799
+ protected executeBatch(batchName: string, instructionGetters: (() => Promise<IInstruction> | IInstruction)[], signers: TransactionSigner[]): Promise<Signature>;
800
+ /**
801
+ * Simulate an instruction
802
+ */
803
+ protected simulate(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction, signers: TransactionSigner[]): Promise<unknown>;
804
+ /**
805
+ * Simulate an instruction (public accessor)
806
+ */
807
+ simulateInstruction(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction, signers: TransactionSigner[]): Promise<unknown>;
808
+ /**
809
+ * Estimate transaction cost
810
+ */
811
+ protected estimateCost(instructionGetters: (() => Promise<IInstruction> | IInstruction)[]): Promise<bigint>;
812
+ /**
813
+ * Get cost estimation for an instruction
814
+ */
815
+ getCost(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction): Promise<bigint>;
816
+ /**
817
+ * Get human-readable explanation
818
+ */
819
+ explain(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction): Promise<string>;
820
+ /**
821
+ * Debug analyze without executing
822
+ */
823
+ analyze(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction): Promise<unknown>;
824
+ /**
825
+ * Get decoded account (with optional caching)
826
+ */
827
+ protected getAccount<T>(address: Address$1, decoderImportName: string): Promise<T | null>;
828
+ /**
829
+ * Get multiple decoded accounts (with optional caching)
830
+ */
831
+ protected getAccounts<T>(addresses: Address$1[], decoderImportName: string): Promise<(T | null)[]>;
832
+ /**
833
+ * Get program accounts
834
+ */
835
+ protected getProgramAccounts<T>(decoderImportName: string, filters?: ({
836
+ dataSize: bigint;
837
+ } | {
838
+ memcmp: {
839
+ offset: bigint;
840
+ bytes: string;
841
+ encoding?: 'base58' | 'base64';
842
+ };
843
+ })[]): Promise<{
844
+ address: Address$1;
845
+ data: T;
846
+ }[]>;
847
+ /**
848
+ * Get program ID
849
+ */
850
+ protected get programId(): Address$1;
851
+ /**
852
+ * Get program ID (public accessor)
853
+ */
854
+ getProgramId(): Address$1;
855
+ /**
856
+ * Get commitment level
857
+ */
858
+ protected get commitment(): Commitment;
859
+ /**
860
+ * Get commitment level (public accessor)
861
+ */
862
+ getCommitment(): Commitment;
863
+ /**
864
+ * Invalidate cache for specific account
865
+ */
866
+ invalidateCache(address: Address$1): void;
867
+ /**
868
+ * Clear all caches
869
+ */
870
+ clearCache(): void;
871
+ /**
872
+ * Get cache statistics
873
+ */
874
+ getCacheStats(): {
875
+ accountCache: {
876
+ size: number;
877
+ max: number;
878
+ };
879
+ pdaCache: {
880
+ size: number;
881
+ max: number;
882
+ };
883
+ };
884
+ }
885
+
886
+ /**
887
+ * Simplified agent management using unified instruction pattern
888
+ */
889
+ declare class AgentModule extends BaseModule {
890
+ private ipfsUtils;
891
+ constructor(config: GhostSpeakConfig & {
892
+ ipfsConfig?: IPFSConfig;
893
+ });
894
+ /**
895
+ * Register a new agent
896
+ */
897
+ register(signer: TransactionSigner, params: {
898
+ agentType: number;
899
+ name: string;
900
+ description: string;
901
+ metadataUri: string;
902
+ agentId: string;
903
+ pricingModel?: PricingModel$1;
904
+ skipSimulation?: boolean;
905
+ }): Promise<string>;
906
+ /**
907
+ * Register a compressed agent (5000x cheaper)
908
+ */
909
+ registerCompressed(signer: TransactionSigner, params: {
910
+ agentType: number;
911
+ name: string;
912
+ description: string;
913
+ metadataUri: string;
914
+ agentId: string;
915
+ merkleTree: Address$1;
916
+ treeConfig?: Address$1;
917
+ pricingModel?: PricingModel$1;
918
+ }): Promise<string>;
919
+ /**
920
+ * Update agent metadata
921
+ */
922
+ update(signer: TransactionSigner, params: {
923
+ agentAddress: Address$1;
924
+ metadataUri: string;
925
+ agentType: number;
926
+ agentId: string;
927
+ name?: string | null;
928
+ description?: string | null;
929
+ pricingModel?: PricingModel$1;
930
+ }): Promise<string>;
931
+ /**
932
+ * Verify an agent
933
+ */
934
+ verify(signer: TransactionSigner, params: {
935
+ agentAddress: Address$1;
936
+ agentPubkey: Address$1;
937
+ serviceEndpoint: string;
938
+ supportedCapabilities: Array<number | bigint>;
939
+ verifiedAt: number | bigint;
940
+ }): Promise<string>;
941
+ /**
942
+ * Deactivate an agent
943
+ */
944
+ deactivate(signer: TransactionSigner, params: {
945
+ agentAddress: Address$1;
946
+ agentId: string;
947
+ }): Promise<string>;
948
+ /**
949
+ * Activate an agent
950
+ */
951
+ activate(signer: TransactionSigner, params: {
952
+ agentAddress: Address$1;
953
+ agentId: string;
954
+ }): Promise<string>;
955
+ /**
956
+ * Get agent account
957
+ */
958
+ getAgentAccount(address: Address$1): Promise<Agent | null>;
959
+ /**
960
+ * Get all agents
961
+ */
962
+ getAllAgents(): Promise<{
963
+ address: Address$1;
964
+ data: Agent;
965
+ }[]>;
966
+ /**
967
+ * Get agents by type
968
+ */
969
+ getAgentsByType(agentType: number): Promise<{
970
+ address: Address$1;
971
+ data: Agent;
972
+ }[]>;
973
+ /**
974
+ * Get user's agents
975
+ */
976
+ getUserAgents(authority: Address$1): Promise<{
977
+ address: Address$1;
978
+ data: Agent;
979
+ }[]>;
980
+ /**
981
+ * Batch get multiple agent accounts
982
+ *
983
+ * Uses efficient batching (100 accounts per RPC call) with optional caching.
984
+ *
985
+ * @param addresses - Agent addresses to fetch
986
+ * @param onProgress - Optional progress callback
987
+ * @returns Array of agent accounts (null for non-existent)
988
+ *
989
+ * @example
990
+ * ```typescript
991
+ * const agents = await client.agents.batchGetAgents(
992
+ * ['agent1...', 'agent2...', 'agent3...'],
993
+ * (completed, total) => console.log(`${completed}/${total}`)
994
+ * )
995
+ * ```
996
+ */
997
+ batchGetAgents(addresses: Address$1[], onProgress?: (completed: number, total: number) => void): Promise<(Agent | null)[]>;
998
+ /**
999
+ * Batch get only existing agent accounts
1000
+ *
1001
+ * Filters out non-existent addresses.
1002
+ *
1003
+ * @param addresses - Agent addresses to fetch
1004
+ * @param onProgress - Optional progress callback
1005
+ * @returns Array of existing agents with their addresses
1006
+ *
1007
+ * @example
1008
+ * ```typescript
1009
+ * const existingAgents = await client.agents.batchGetExistingAgents(['addr1', 'addr2'])
1010
+ * // Returns: [{ address: 'addr1', account: Agent }, ...]
1011
+ * ```
1012
+ */
1013
+ batchGetExistingAgents(addresses: Address$1[], onProgress?: (completed: number, total: number) => void): Promise<Array<{
1014
+ address: Address$1;
1015
+ account: Agent;
1016
+ }>>;
1017
+ /**
1018
+ * Batch get and map agents to a simplified format
1019
+ *
1020
+ * Useful for creating agent summaries or lists.
1021
+ *
1022
+ * @param addresses - Agent addresses to fetch
1023
+ * @param mapper - Transform function
1024
+ * @returns Array of mapped results
1025
+ *
1026
+ * @example
1027
+ * ```typescript
1028
+ * const summaries = await client.agents.batchGetAndMapAgents(
1029
+ * addresses,
1030
+ * (agent, address) => agent ? {
1031
+ * address,
1032
+ * name: agent.name,
1033
+ * type: agent.agentType,
1034
+ * active: agent.isActive
1035
+ * } : null
1036
+ * )
1037
+ * ```
1038
+ */
1039
+ batchGetAndMapAgents<R>(addresses: Address$1[], mapper: (agent: Agent | null, address: Address$1, index: number) => R): Promise<R[]>;
1040
+ private deriveAgentPda;
1041
+ private deriveUserRegistryPda;
1042
+ private deriveTreeConfigPda;
1043
+ private get systemProgramId();
1044
+ private get compressionProgramId();
1045
+ }
1046
+
1047
+ /**
1048
+ * Ghost Module - Claim and manage external AI agents
1049
+ *
1050
+ * This module provides methods for claiming "Ghost" agents (external agents
1051
+ * registered on x402 facilitators like PayAI) using the Solana Attestation
1052
+ * Service (SAS) for trustless ownership verification.
1053
+ */
1054
+
1055
+ /**
1056
+ * Network identifier for DID generation
1057
+ */
1058
+ type Network = 'devnet' | 'testnet' | 'mainnet-beta' | 'localnet';
1059
+ /**
1060
+ * Parameters for claiming a Ghost
1061
+ */
1062
+ interface ClaimGhostParams {
1063
+ /** Agent account address (the external agent to claim) */
1064
+ agentAddress: Address$1;
1065
+ /** x402 payment address of the agent (used for PDA derivation) */
1066
+ x402PaymentAddress: Address$1;
1067
+ /** SAS Credential address (issuer) */
1068
+ sasCredential: Address$1;
1069
+ /** SAS Schema address (defines attestation structure) */
1070
+ sasSchema: Address$1;
1071
+ /** Network identifier for DID (e.g., "devnet", "mainnet-beta") */
1072
+ network: Network;
1073
+ /** Optional IPFS metadata URI (ipfs://...) */
1074
+ ipfsMetadataUri?: string;
1075
+ /** Optional GitHub username for social proof */
1076
+ githubUsername?: string;
1077
+ /** Optional Twitter handle for social proof */
1078
+ twitterHandle?: string;
1079
+ }
1080
+ /**
1081
+ * Result of preparing a Ghost claim
1082
+ */
1083
+ interface PreparedClaimResult {
1084
+ /** Derived attestation PDA */
1085
+ attestationPda: Address$1;
1086
+ /** Derived DID document PDA */
1087
+ didDocumentPda: Address$1;
1088
+ /** Attestation bump seed */
1089
+ attestationBump: number;
1090
+ /** DID document bump seed */
1091
+ didDocumentBump: number;
1092
+ }
1093
+ /**
1094
+ * Ghost Module - Manage external agent claims
1095
+ */
1096
+ declare class GhostModule extends BaseModule {
1097
+ constructor(config: GhostSpeakConfig);
1098
+ /**
1099
+ * Claim ownership of a Ghost using SAS attestation
1100
+ *
1101
+ * This method performs the complete claim flow:
1102
+ * 1. Derives required PDAs (attestation, DID document)
1103
+ * 2. Builds the claim_ghost instruction
1104
+ * 3. Executes the transaction
1105
+ *
1106
+ * **Prerequisites:**
1107
+ * - The claimer must have already created a SAS attestation proving ownership
1108
+ * of the agent's x402_payment_address
1109
+ * - The agent must be in Unregistered or Registered status (not already claimed)
1110
+ *
1111
+ * **Results:**
1112
+ * - Agent status transitions to Claimed
1113
+ * - DID document is auto-created with did:sol:<network>:<address>
1114
+ * - Claimer becomes the owner of the agent
1115
+ *
1116
+ * @param claimer - Transaction signer (must own the SAS attestation)
1117
+ * @param params - Claim parameters
1118
+ * @returns Transaction signature
1119
+ *
1120
+ * @example
1121
+ * ```typescript
1122
+ * const signature = await client.ghosts.claim(signer, {
1123
+ * agentAddress: 'GhostAgent123...',
1124
+ * x402PaymentAddress: 'PaymentAddr456...',
1125
+ * sasCredential: 'SASCredential789...',
1126
+ * sasSchema: 'SASSchema012...',
1127
+ * network: 'devnet',
1128
+ * ipfsMetadataUri: 'ipfs://QmHash...',
1129
+ * githubUsername: 'myusername'
1130
+ * })
1131
+ * ```
1132
+ */
1133
+ claim(claimer: TransactionSigner, params: ClaimGhostParams): Promise<string>;
1134
+ /**
1135
+ * Prepare a Ghost claim by deriving all required PDAs
1136
+ *
1137
+ * This is useful for:
1138
+ * - Pre-flight validation (checking if PDAs are correct)
1139
+ * - Building custom transactions with manual PDA management
1140
+ * - Debugging claim issues
1141
+ *
1142
+ * @param params - Claim parameters
1143
+ * @returns Prepared claim data with derived PDAs
1144
+ *
1145
+ * @example
1146
+ * ```typescript
1147
+ * const prepared = await client.ghosts.prepareClaim({
1148
+ * agentAddress: 'GhostAgent123...',
1149
+ * x402PaymentAddress: 'PaymentAddr456...',
1150
+ * sasCredential: 'SASCredential789...',
1151
+ * sasSchema: 'SASSchema012...',
1152
+ * network: 'devnet'
1153
+ * })
1154
+ *
1155
+ * console.log('Attestation PDA:', prepared.attestationPda)
1156
+ * console.log('DID Document PDA:', prepared.didDocumentPda)
1157
+ * ```
1158
+ */
1159
+ prepareClaim(params: ClaimGhostParams): Promise<PreparedClaimResult>;
1160
+ /**
1161
+ * Get Ghost agent account
1162
+ *
1163
+ * @param address - Agent account address
1164
+ * @returns Agent account data or null if not found
1165
+ */
1166
+ getGhostAgent(address: Address$1): Promise<Agent | null>;
1167
+ /**
1168
+ * Get all Ghost agents (agents with type 10 - external x402 agents)
1169
+ *
1170
+ * @returns Array of Ghost agents
1171
+ */
1172
+ getAllGhosts(): Promise<{
1173
+ address: Address$1;
1174
+ data: Agent;
1175
+ }[]>;
1176
+ /**
1177
+ * Get Ghost agents by type
1178
+ *
1179
+ * @param agentType - Agent type filter (default: 10 for x402 ghosts)
1180
+ * @returns Array of matching Ghost agents
1181
+ */
1182
+ getGhostsByType(agentType?: number): Promise<{
1183
+ address: Address$1;
1184
+ data: Agent;
1185
+ }[]>;
1186
+ /**
1187
+ * Get claimed Ghosts by owner
1188
+ *
1189
+ * @param owner - Owner address
1190
+ * @returns Array of Ghost agents owned by the address
1191
+ */
1192
+ getClaimedGhosts(owner: Address$1): Promise<{
1193
+ address: Address$1;
1194
+ data: Agent;
1195
+ }[]>;
1196
+ /**
1197
+ * Validate claim parameters
1198
+ *
1199
+ * Performs pre-flight checks to ensure claim will succeed:
1200
+ * - Agent exists and is in correct status
1201
+ * - Agent is not already claimed
1202
+ * - PDAs are correctly derived
1203
+ *
1204
+ * @param params - Claim parameters
1205
+ * @returns Validation result with error messages if any
1206
+ */
1207
+ validateClaim(params: ClaimGhostParams): Promise<{
1208
+ valid: boolean;
1209
+ errors: string[];
1210
+ warnings: string[];
1211
+ }>;
1212
+ /**
1213
+ * Derive DID document PDA
1214
+ *
1215
+ * Pattern: ['did_document', x402_payment_address]
1216
+ *
1217
+ * @param x402PaymentAddress - Agent's x402 payment address
1218
+ * @returns [DID document PDA, bump]
1219
+ */
1220
+ private deriveDidDocumentPda;
1221
+ private get systemProgramId();
1222
+ }
1223
+
1224
+ interface ProposalType {
1225
+ kind: 'ConfigChange' | 'Treasury' | 'Protocol' | 'Emergency';
1226
+ data?: Record<string, unknown>;
1227
+ }
1228
+ interface ExecutionParams {
1229
+ instructions: string[];
1230
+ accounts: Address$1[];
1231
+ targetProgram: Address$1;
1232
+ executeAfter?: bigint;
1233
+ }
1234
+ interface CreateProposalParams {
1235
+ title: string;
1236
+ description: string;
1237
+ proposalType: ProposalType;
1238
+ executionParams: ExecutionParams;
1239
+ proposalId: bigint;
1240
+ }
1241
+ /**
1242
+ * Governance management module
1243
+ *
1244
+ * Provides high-level access to governance operations including:
1245
+ * - Proposal creation and management
1246
+ *
1247
+ * NOTE: Voting, delegation, and execution are handled through protocol_config + multisig
1248
+ */
1249
+ declare class GovernanceModule extends BaseModule {
1250
+ /**
1251
+ * Get initialize governance proposal instruction
1252
+ */
1253
+ getInitializeGovernanceProposalInstruction(params: {
1254
+ proposal?: Address$1;
1255
+ proposer: TransactionSigner;
1256
+ title: string;
1257
+ description: string;
1258
+ proposalType: any;
1259
+ executionParams: any;
1260
+ proposalId: number | bigint;
1261
+ }): Promise<InitializeGovernanceProposalInstruction<Address$1<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">, string, string, string, []>>;
1262
+ /**
1263
+ * Create a new governance proposal
1264
+ */
1265
+ createProposal(params: {
1266
+ signer: TransactionSigner;
1267
+ title: string;
1268
+ description: string;
1269
+ proposalType: 'parameter_change' | 'upgrade' | 'treasury';
1270
+ votingDuration: number;
1271
+ executionDelay?: number;
1272
+ }): Promise<string>;
1273
+ /**
1274
+ * Get governance proposal account
1275
+ */
1276
+ getProposal(address: Address$1): Promise<GovernanceProposal | null>;
1277
+ /**
1278
+ * Get all active proposals
1279
+ */
1280
+ getActiveProposals(): Promise<{
1281
+ address: Address$1;
1282
+ data: GovernanceProposal;
1283
+ }[]>;
1284
+ /**
1285
+ * Get proposals by proposer
1286
+ */
1287
+ getProposalsByProposer(proposer: Address$1): Promise<{
1288
+ address: Address$1;
1289
+ data: GovernanceProposal;
1290
+ }[]>;
1291
+ /**
1292
+ * Get proposals by status
1293
+ */
1294
+ getProposalsByStatus(_status: 'draft' | 'voting' | 'succeeded' | 'defeated' | 'executed'): Promise<{
1295
+ address: Address$1;
1296
+ data: GovernanceProposal;
1297
+ }[]>;
1298
+ private deriveProposalPda;
1299
+ }
1300
+
1301
+ interface CreateMultisigParams {
1302
+ multisigId: bigint;
1303
+ threshold: number;
1304
+ signers: Address$1[];
1305
+ config?: Partial<MultisigTypeConfigArgs>;
1306
+ owner: TransactionSigner;
1307
+ }
1308
+ interface MultisigProposalParams {
1309
+ multisigAddress: Address$1;
1310
+ title: string;
1311
+ description: string;
1312
+ proposalType: ProposalTypeArgs;
1313
+ executionParams: ExecutionParamsArgs;
1314
+ proposalId: bigint;
1315
+ proposer: TransactionSigner;
1316
+ }
1317
+ interface ExecuteProposalParams {
1318
+ proposalAddress: Address$1;
1319
+ executor: TransactionSigner;
1320
+ targetProgram: Address$1;
1321
+ }
1322
+ declare class MultisigModule extends BaseModule {
1323
+ /**
1324
+ * Create a new multisig account
1325
+ */
1326
+ createMultisig(params: CreateMultisigParams): Promise<string>;
1327
+ /**
1328
+ * Create a proposal (Uses Governance Protocol)
1329
+ *
1330
+ * Note: This creates a GovernanceProposal. The proposer must be a signer.
1331
+ */
1332
+ createProposal(params: MultisigProposalParams): Promise<string>;
1333
+ /**
1334
+ * Execute a proposal (Note: Approval/voting removed, use protocol_config instead)
1335
+ */
1336
+ executeProposal(params: ExecuteProposalParams): Promise<string>;
1337
+ }
1338
+
1339
+ /**
1340
+ * GhostSpeak DID (Decentralized Identifier) Types
1341
+ *
1342
+ * Implements the did:sol method for Solana-based DIDs following W3C standards.
1343
+ * Based on Identity.com's did:sol specification v3.0.
1344
+ */
1345
+
1346
+ /**
1347
+ * Verification method type for DIDs
1348
+ */
1349
+ declare enum VerificationMethodType {
1350
+ /** Ed25519 verification key (Solana native) */
1351
+ Ed25519VerificationKey2020 = "Ed25519VerificationKey2020",
1352
+ /** X25519 key agreement for encryption */
1353
+ X25519KeyAgreementKey2020 = "X25519KeyAgreementKey2020",
1354
+ /** Secp256k1 verification key (Ethereum compatibility) */
1355
+ EcdsaSecp256k1VerificationKey2019 = "EcdsaSecp256k1VerificationKey2019"
1356
+ }
1357
+ /**
1358
+ * Verification relationship types
1359
+ */
1360
+ declare enum VerificationRelationship {
1361
+ /** Key can authenticate as the DID */
1362
+ Authentication = "authentication",
1363
+ /** Key can assert claims (issue credentials) */
1364
+ AssertionMethod = "assertionMethod",
1365
+ /** Key can perform key agreement (encryption) */
1366
+ KeyAgreement = "keyAgreement",
1367
+ /** Key can invoke capabilities (update DID document) */
1368
+ CapabilityInvocation = "capabilityInvocation",
1369
+ /** Key can delegate capabilities */
1370
+ CapabilityDelegation = "capabilityDelegation"
1371
+ }
1372
+ /**
1373
+ * Service endpoint type
1374
+ */
1375
+ declare enum ServiceEndpointType {
1376
+ /** AI agent service endpoint */
1377
+ AIAgentService = "AIAgentService",
1378
+ /** Messaging service endpoint (DIDComm) */
1379
+ DIDCommMessaging = "DIDCommMessaging",
1380
+ /** Credential repository */
1381
+ CredentialRepository = "CredentialRepository",
1382
+ /** Linked domains verification */
1383
+ LinkedDomains = "LinkedDomains",
1384
+ /** Custom service type */
1385
+ Custom = "Custom"
1386
+ }
1387
+ /**
1388
+ * Verification method for DID document
1389
+ *
1390
+ * Represents a cryptographic key that can be used to verify
1391
+ * signatures or perform other cryptographic operations
1392
+ */
1393
+ interface VerificationMethod {
1394
+ /** Method identifier (e.g., "key-1") */
1395
+ id: string;
1396
+ /** Type of verification method */
1397
+ methodType: VerificationMethodType;
1398
+ /** DID of the controller (usually the DID itself) */
1399
+ controller: string;
1400
+ /** Public key in multibase format (base58btc) */
1401
+ publicKeyMultibase: string;
1402
+ /** Verification relationships this key has */
1403
+ relationships: VerificationRelationship[];
1404
+ /** Creation timestamp */
1405
+ createdAt: number;
1406
+ /** Revoked flag */
1407
+ revoked: boolean;
1408
+ }
1409
+ /**
1410
+ * Service endpoint in DID document
1411
+ */
1412
+ interface ServiceEndpoint {
1413
+ /** Service identifier (e.g., "agent-api") */
1414
+ id: string;
1415
+ /** Type of service */
1416
+ serviceType: ServiceEndpointType;
1417
+ /** Service endpoint URI */
1418
+ serviceEndpoint: string;
1419
+ /** Optional description */
1420
+ description: string;
1421
+ }
1422
+ /**
1423
+ * DID Document - main account for storing decentralized identifiers
1424
+ *
1425
+ * Follows W3C DID Core specification and did:sol method
1426
+ */
1427
+ interface DidDocument {
1428
+ /** The DID string (e.g., "did:sol:devnet:HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH") */
1429
+ did: string;
1430
+ /** Controller of the DID (can update the document) */
1431
+ controller: Address$1;
1432
+ /** Verification methods (public keys) */
1433
+ verificationMethods: VerificationMethod[];
1434
+ /** Service endpoints */
1435
+ serviceEndpoints: ServiceEndpoint[];
1436
+ /** Context URIs (for W3C compatibility) */
1437
+ context: string[];
1438
+ /** Also known as (alternative DIDs) */
1439
+ alsoKnownAs: string[];
1440
+ /** DID document creation timestamp */
1441
+ createdAt: number;
1442
+ /** Last update timestamp */
1443
+ updatedAt: number;
1444
+ /** Version number (incremented on each update) */
1445
+ version: number;
1446
+ /** Deactivated flag */
1447
+ deactivated: boolean;
1448
+ /** Deactivation timestamp (if deactivated) */
1449
+ deactivatedAt?: number;
1450
+ /** PDA bump */
1451
+ bump: number;
1452
+ }
1453
+ /**
1454
+ * DID Resolution Metadata
1455
+ *
1456
+ * Additional metadata for DID resolution
1457
+ */
1458
+ interface DidResolutionMetadata {
1459
+ /** DID being resolved */
1460
+ did: string;
1461
+ /** Pointer to the DID document account */
1462
+ didDocument: Address$1;
1463
+ /** Resolution timestamp */
1464
+ resolvedAt: number;
1465
+ /** Content type (application/did+json) */
1466
+ contentType: string;
1467
+ /** DID document version at resolution time */
1468
+ version: number;
1469
+ /** PDA bump */
1470
+ bump: number;
1471
+ }
1472
+ /**
1473
+ * W3C DID Document format for export
1474
+ * Compliant with W3C DID Core specification
1475
+ */
1476
+ interface W3CDidDocument {
1477
+ '@context': string[];
1478
+ id: string;
1479
+ controller?: string | string[];
1480
+ verificationMethod: Array<{
1481
+ id: string;
1482
+ type: string;
1483
+ controller: string;
1484
+ publicKeyMultibase: string;
1485
+ }>;
1486
+ authentication?: Array<string | {
1487
+ id: string;
1488
+ type: string;
1489
+ controller: string;
1490
+ publicKeyMultibase: string;
1491
+ }>;
1492
+ assertionMethod?: string[];
1493
+ keyAgreement?: string[];
1494
+ capabilityInvocation?: string[];
1495
+ capabilityDelegation?: string[];
1496
+ service?: Array<{
1497
+ id: string;
1498
+ type: string;
1499
+ serviceEndpoint: string;
1500
+ description?: string;
1501
+ }>;
1502
+ alsoKnownAs?: string[];
1503
+ }
1504
+ /**
1505
+ * Parameters for creating a DID document
1506
+ */
1507
+ interface CreateDidDocumentParams {
1508
+ /** Controller public key */
1509
+ controller: Address$1;
1510
+ /** Initial verification methods */
1511
+ verificationMethods?: VerificationMethod[];
1512
+ /** Initial service endpoints */
1513
+ serviceEndpoints?: ServiceEndpoint[];
1514
+ /** Network (mainnet, devnet, testnet) */
1515
+ network?: 'mainnet' | 'devnet' | 'testnet';
1516
+ }
1517
+ /**
1518
+ * Parameters for updating a DID document
1519
+ */
1520
+ interface UpdateDidDocumentParams {
1521
+ /** DID document address */
1522
+ didDocument: Address$1;
1523
+ /** Verification method to add */
1524
+ addVerificationMethod?: VerificationMethod;
1525
+ /** Verification method ID to remove */
1526
+ removeVerificationMethodId?: string;
1527
+ /** Service endpoint to add */
1528
+ addServiceEndpoint?: ServiceEndpoint;
1529
+ /** Service endpoint ID to remove */
1530
+ removeServiceEndpointId?: string;
1531
+ }
1532
+ /**
1533
+ * Parameters for deactivating a DID document
1534
+ */
1535
+ interface DeactivateDidDocumentParams {
1536
+ /** DID document address */
1537
+ didDocument: Address$1;
1538
+ }
1539
+ /**
1540
+ * Parameters for resolving a DID document
1541
+ */
1542
+ interface ResolveDidDocumentParams {
1543
+ /** DID string or controller address */
1544
+ did: string | Address$1;
1545
+ }
1546
+ /**
1547
+ * DID-related errors
1548
+ */
1549
+ declare enum DidError {
1550
+ AlreadyDeactivated = "AlreadyDeactivated",
1551
+ TooManyVerificationMethods = "TooManyVerificationMethods",
1552
+ TooManyServiceEndpoints = "TooManyServiceEndpoints",
1553
+ DuplicateMethodId = "DuplicateMethodId",
1554
+ DuplicateServiceId = "DuplicateServiceId",
1555
+ MethodNotFound = "MethodNotFound",
1556
+ ServiceNotFound = "ServiceNotFound",
1557
+ InvalidDidFormat = "InvalidDidFormat",
1558
+ UnauthorizedDidOperation = "UnauthorizedDidOperation",
1559
+ DidDeactivated = "DidDeactivated"
1560
+ }
1561
+ /**
1562
+ * DID Error class
1563
+ */
1564
+ declare class DidErrorClass extends Error {
1565
+ code: DidError;
1566
+ constructor(code: DidError, message?: string);
1567
+ }
1568
+
1569
+ /**
1570
+ * GhostSpeak DID Helpers
1571
+ *
1572
+ * Utility functions for DID operations, validation, and W3C export
1573
+ */
1574
+
1575
+ /**
1576
+ * Derive DID document PDA
1577
+ * Pattern: ['did_document', controller]
1578
+ */
1579
+ declare function deriveDidDocumentPda(programId: Address$1, controller: Address$1): Promise<[Address$1, number]>;
1580
+ /**
1581
+ * Generate a did:sol string from network and public key
1582
+ *
1583
+ * @param network - Solana network (mainnet, devnet, testnet, localnet)
1584
+ * @param pubkey - Public key to use as the DID identifier
1585
+ * @returns DID string in the format "did:sol:network:pubkey"
1586
+ *
1587
+ * @example
1588
+ * ```typescript
1589
+ * const did = generateDidString('devnet', '5VKz...')
1590
+ * // Returns: "did:sol:devnet:5VKz..."
1591
+ * ```
1592
+ */
1593
+ declare function generateDidString(network: 'mainnet' | 'devnet' | 'testnet' | 'localnet', pubkey: Address$1 | string): string;
1594
+ /**
1595
+ * Validate DID string format
1596
+ *
1597
+ * @param did - DID string to validate
1598
+ * @throws {DidErrorClass} If DID format is invalid
1599
+ *
1600
+ * @example
1601
+ * ```typescript
1602
+ * validateDidString('did:sol:devnet:5VKz...')
1603
+ * // Returns: void (no error)
1604
+ *
1605
+ * validateDidString('invalid:did')
1606
+ * // Throws: DidErrorClass
1607
+ * ```
1608
+ */
1609
+ declare function validateDidString(did: string): void;
1610
+ /**
1611
+ * Parse a DID string into its components
1612
+ *
1613
+ * @param did - DID string to parse
1614
+ * @returns Object with method, network, and identifier
1615
+ *
1616
+ * @example
1617
+ * ```typescript
1618
+ * const parts = parseDidString('did:sol:devnet:5VKz...')
1619
+ * // Returns: { method: 'sol', network: 'devnet', identifier: '5VKz...' }
1620
+ * ```
1621
+ */
1622
+ declare function parseDidString(did: string): {
1623
+ method: string;
1624
+ network: string;
1625
+ identifier: string;
1626
+ };
1627
+ /**
1628
+ * Export a DID document as W3C-compliant format
1629
+ *
1630
+ * @param didDocument - DID document to export
1631
+ * @returns W3C-compliant DID document
1632
+ *
1633
+ * @example
1634
+ * ```typescript
1635
+ * const w3cDoc = exportAsW3CDidDocument(didDocument)
1636
+ * console.log(JSON.stringify(w3cDoc, null, 2))
1637
+ * ```
1638
+ */
1639
+ declare function exportAsW3CDidDocument(didDocument: DidDocument): W3CDidDocument;
1640
+ /**
1641
+ * Create a default Ed25519 verification method
1642
+ *
1643
+ * @param id - Method identifier (e.g., "key-1")
1644
+ * @param controller - Controller DID
1645
+ * @param publicKey - Public key (Address or base58 string)
1646
+ * @param relationships - Verification relationships
1647
+ * @returns Verification method object
1648
+ */
1649
+ declare function createEd25519VerificationMethod(id: string, controller: string, publicKey: Address$1 | string, relationships?: VerificationRelationship[]): VerificationMethod;
1650
+ /**
1651
+ * Create a service endpoint
1652
+ *
1653
+ * @param id - Service identifier (e.g., "agent-api")
1654
+ * @param serviceType - Type of service
1655
+ * @param serviceEndpoint - Service endpoint URI
1656
+ * @param description - Optional description
1657
+ * @returns Service endpoint object
1658
+ */
1659
+ declare function createServiceEndpoint(id: string, serviceType: string, serviceEndpoint: string, description?: string): ServiceEndpoint;
1660
+ /**
1661
+ * Check if a DID document is active and can be used
1662
+ *
1663
+ * @param didDocument - DID document to check
1664
+ * @returns True if active, false if deactivated
1665
+ */
1666
+ declare function isDidActive(didDocument: DidDocument): boolean;
1667
+ /**
1668
+ * Get verification methods for a specific relationship
1669
+ *
1670
+ * @param didDocument - DID document
1671
+ * @param relationship - Verification relationship to filter by
1672
+ * @returns Array of verification methods with the specified relationship
1673
+ */
1674
+ declare function getMethodsForRelationship(didDocument: DidDocument, relationship: VerificationRelationship): VerificationMethod[];
1675
+ /**
1676
+ * Check if a public key can perform a specific action
1677
+ *
1678
+ * @param didDocument - DID document
1679
+ * @param publicKey - Public key to check
1680
+ * @param relationship - Required verification relationship
1681
+ * @returns True if the public key has the required relationship
1682
+ */
1683
+ declare function canPerformAction(didDocument: DidDocument, publicKey: Address$1, relationship: VerificationRelationship): boolean;
1684
+ /**
1685
+ * Convert a DID document to JSON string
1686
+ *
1687
+ * @param didDocument - DID document to convert
1688
+ * @param pretty - Whether to pretty-print the JSON
1689
+ * @returns JSON string representation
1690
+ */
1691
+ declare function didDocumentToJson(didDocument: DidDocument, pretty?: boolean): string;
1692
+ /**
1693
+ * Extract network from DID string
1694
+ *
1695
+ * @param did - DID string
1696
+ * @returns Network identifier
1697
+ */
1698
+ declare function getNetworkFromDid(did: string): string;
1699
+ /**
1700
+ * Extract identifier (public key) from DID string
1701
+ *
1702
+ * @param did - DID string
1703
+ * @returns Public key identifier
1704
+ */
1705
+ declare function getIdentifierFromDid(did: string): string;
1706
+
1707
+ /**
1708
+ * GhostSpeak DID Module
1709
+ *
1710
+ * Provides functionality for managing Decentralized Identifiers (DIDs)
1711
+ * following the W3C DID Core specification and did:sol method.
1712
+ */
1713
+
1714
+ /**
1715
+ * DidModule - Manage decentralized identifiers on Solana
1716
+ *
1717
+ * @example
1718
+ * ```typescript
1719
+ * const client = new GhostSpeakClient({ cluster: 'devnet' })
1720
+ * const did = client.did
1721
+ *
1722
+ * // Create a DID
1723
+ * const signature = await did.create(signer, {
1724
+ * controller: signer.address,
1725
+ * network: 'devnet'
1726
+ * })
1727
+ *
1728
+ * // Resolve a DID
1729
+ * const didDoc = await did.resolve(signer.address)
1730
+ *
1731
+ * // Export as W3C format
1732
+ * const w3c = await did.exportW3C(signer.address)
1733
+ * ```
1734
+ */
1735
+ declare class DidModule extends BaseModule {
1736
+ constructor(config: GhostSpeakConfig);
1737
+ /**
1738
+ * Create a new DID document
1739
+ *
1740
+ * @param signer - Transaction signer (will be the controller)
1741
+ * @param params - DID creation parameters
1742
+ * @returns Transaction signature
1743
+ *
1744
+ * @example
1745
+ * ```typescript
1746
+ * const signature = await didModule.create(signer, {
1747
+ * controller: signer.address,
1748
+ * network: 'devnet',
1749
+ * verificationMethods: [{
1750
+ * id: 'key-1',
1751
+ * methodType: VerificationMethodType.Ed25519VerificationKey2020,
1752
+ * controller: 'did:sol:devnet:...',
1753
+ * publicKeyMultibase: 'z...',
1754
+ * relationships: [VerificationRelationship.Authentication],
1755
+ * createdAt: Date.now() / 1000,
1756
+ * revoked: false
1757
+ * }]
1758
+ * })
1759
+ * ```
1760
+ */
1761
+ create(signer: TransactionSigner, params: CreateDidDocumentParams): Promise<string>;
1762
+ /**
1763
+ * Update an existing DID document
1764
+ *
1765
+ * @param signer - Transaction signer (must be the controller)
1766
+ * @param params - Update parameters
1767
+ * @returns Transaction signature
1768
+ *
1769
+ * @example
1770
+ * ```typescript
1771
+ * const signature = await didModule.update(signer, {
1772
+ * didDocument: didPda,
1773
+ * addVerificationMethod: {
1774
+ * id: 'key-2',
1775
+ * methodType: VerificationMethodType.X25519KeyAgreementKey2020,
1776
+ * controller: 'did:sol:devnet:...',
1777
+ * publicKeyMultibase: 'z...',
1778
+ * relationships: [VerificationRelationship.KeyAgreement],
1779
+ * createdAt: Date.now() / 1000,
1780
+ * revoked: false
1781
+ * }
1782
+ * })
1783
+ * ```
1784
+ */
1785
+ update(signer: TransactionSigner, params: UpdateDidDocumentParams): Promise<string>;
1786
+ /**
1787
+ * Deactivate a DID document (irreversible)
1788
+ *
1789
+ * @param signer - Transaction signer (must be the controller)
1790
+ * @param params - Deactivation parameters
1791
+ * @returns Transaction signature
1792
+ *
1793
+ * @example
1794
+ * ```typescript
1795
+ * const signature = await didModule.deactivate(signer, {
1796
+ * didDocument: didPda
1797
+ * })
1798
+ * ```
1799
+ */
1800
+ deactivate(signer: TransactionSigner, params: DeactivateDidDocumentParams): Promise<string>;
1801
+ /**
1802
+ * Resolve a DID document
1803
+ *
1804
+ * @param didOrController - DID string or controller address
1805
+ * @returns DID document or null if not found
1806
+ *
1807
+ * @example
1808
+ * ```typescript
1809
+ * // Resolve by controller address
1810
+ * const didDoc = await didModule.resolve(controllerAddress)
1811
+ *
1812
+ * // Resolve by DID string
1813
+ * const didDoc = await didModule.resolve('did:sol:devnet:5VKz...')
1814
+ * ```
1815
+ */
1816
+ resolve(didOrController: string | Address$1): Promise<DidDocument | null>;
1817
+ /**
1818
+ * Export a DID document as W3C-compliant JSON
1819
+ *
1820
+ * @param didOrController - DID string or controller address
1821
+ * @param pretty - Whether to pretty-print the JSON
1822
+ * @returns W3C DID document JSON string
1823
+ *
1824
+ * @example
1825
+ * ```typescript
1826
+ * const json = await didModule.exportW3C(controllerAddress, true)
1827
+ * console.log(json)
1828
+ * ```
1829
+ */
1830
+ exportW3C(didOrController: string | Address$1, pretty?: boolean): Promise<string | null>;
1831
+ /**
1832
+ * Get W3C DID document object
1833
+ *
1834
+ * @param didOrController - DID string or controller address
1835
+ * @returns W3C DID document object or null
1836
+ */
1837
+ getW3CDocument(didOrController: string | Address$1): Promise<W3CDidDocument | null>;
1838
+ /**
1839
+ * Derive DID document PDA for a controller
1840
+ *
1841
+ * @param controller - Controller address
1842
+ * @returns DID document PDA and bump
1843
+ */
1844
+ deriveDidPda(controller: Address$1): Promise<[Address$1, number]>;
1845
+ /**
1846
+ * Generate a DID string for a controller
1847
+ *
1848
+ * @param controller - Controller address
1849
+ * @param network - Network identifier
1850
+ * @returns DID string
1851
+ */
1852
+ generateDid(controller: Address$1, network?: 'mainnet' | 'devnet' | 'testnet'): string;
1853
+ /**
1854
+ * Validate a DID string
1855
+ *
1856
+ * @param did - DID string to validate
1857
+ * @returns True if valid, throws error if invalid
1858
+ */
1859
+ validateDid(did: string): boolean;
1860
+ /**
1861
+ * Check if a DID is active
1862
+ *
1863
+ * @param didOrController - DID string or controller address
1864
+ * @returns True if active, false if deactivated or not found
1865
+ */
1866
+ isActive(didOrController: string | Address$1): Promise<boolean>;
1867
+ /**
1868
+ * Build create DID instruction manually
1869
+ * Note: This is temporary until DID instructions are generated from IDL
1870
+ */
1871
+ private buildCreateDidInstruction;
1872
+ /**
1873
+ * Build update DID instruction manually
1874
+ * Note: This is temporary until DID instructions are generated from IDL
1875
+ */
1876
+ private buildUpdateDidInstruction;
1877
+ /**
1878
+ * Build deactivate DID instruction manually
1879
+ * Note: This is temporary until DID instructions are generated from IDL
1880
+ */
1881
+ private buildDeactivateDidInstruction;
1882
+ /**
1883
+ * Create an Ed25519 verification method
1884
+ */
1885
+ static createVerificationMethod: typeof createEd25519VerificationMethod;
1886
+ /**
1887
+ * Create a service endpoint
1888
+ */
1889
+ static createServiceEndpoint: typeof createServiceEndpoint;
1890
+ }
1891
+
1892
+ /**
1893
+ * GhostSpeak Credential Module
1894
+ *
1895
+ * Provides functionality for creating, signing, and exporting
1896
+ * W3C-compatible Verifiable Credentials with DID integration.
1897
+ */
1898
+
1899
+ declare enum CredentialKind {
1900
+ AgentIdentity = "AgentIdentity",
1901
+ ReputationScore = "ReputationScore",
1902
+ JobCompletion = "JobCompletion",
1903
+ DelegatedSigner = "DelegatedSigner",
1904
+ Custom = "Custom"
1905
+ }
1906
+ declare enum CredentialStatus {
1907
+ Pending = "Pending",
1908
+ Active = "Active",
1909
+ Revoked = "Revoked",
1910
+ Expired = "Expired"
1911
+ }
1912
+ interface CredentialType {
1913
+ authority: string;
1914
+ name: string;
1915
+ kind: CredentialKind;
1916
+ schemaUri: string;
1917
+ description: string;
1918
+ isActive: boolean;
1919
+ totalIssued: number;
1920
+ createdAt: number;
1921
+ }
1922
+ interface CredentialTemplate {
1923
+ credentialType: string;
1924
+ name: string;
1925
+ imageUri: string;
1926
+ issuer: string;
1927
+ isActive: boolean;
1928
+ totalIssued: number;
1929
+ createdAt: number;
1930
+ crossmintTemplateId?: string;
1931
+ }
1932
+ interface Credential {
1933
+ template: string;
1934
+ subject: string;
1935
+ issuer: string;
1936
+ credentialId: string;
1937
+ subjectDataHash: Uint8Array;
1938
+ subjectDataUri: string;
1939
+ status: CredentialStatus;
1940
+ signature: Uint8Array;
1941
+ issuedAt: number;
1942
+ expiresAt?: number;
1943
+ revokedAt?: number;
1944
+ crossmintCredentialId?: string;
1945
+ }
1946
+ interface W3CVerifiableCredential {
1947
+ '@context': string[];
1948
+ type: string[];
1949
+ id: string;
1950
+ issuer: {
1951
+ id: string;
1952
+ name?: string;
1953
+ } | string;
1954
+ validFrom: string;
1955
+ validUntil?: string;
1956
+ credentialSubject: {
1957
+ id?: string;
1958
+ [key: string]: unknown;
1959
+ };
1960
+ credentialSchema?: {
1961
+ id: string;
1962
+ type: 'JsonSchema';
1963
+ };
1964
+ credentialStatus?: {
1965
+ id: string;
1966
+ type: string;
1967
+ statusPurpose: 'revocation' | 'suspension';
1968
+ };
1969
+ relatedResource?: Array<{
1970
+ id: string;
1971
+ digestMultibase?: string;
1972
+ }>;
1973
+ proof: {
1974
+ type: 'DataIntegrityProof';
1975
+ created: string;
1976
+ verificationMethod: string;
1977
+ cryptosuite: 'eddsa-rdfc-2022';
1978
+ proofPurpose: 'assertionMethod';
1979
+ proofValue: string;
1980
+ };
1981
+ }
1982
+ declare class CredentialModule {
1983
+ private programId;
1984
+ private didModule?;
1985
+ constructor(programId?: Address$1, didModule?: DidModule);
1986
+ /**
1987
+ * Set the DID module for enhanced DID resolution
1988
+ * This enables automatic DID creation and resolution for credentials
1989
+ */
1990
+ setDidModule(didModule: DidModule): void;
1991
+ hashSubjectData(subjectData: Record<string, unknown>): Uint8Array;
1992
+ generateCredentialId(kind: CredentialKind, subject: string): string;
1993
+ exportAsW3CCredential(credential: Credential, template: CredentialTemplate, credentialType: CredentialType, subjectData: Record<string, unknown>, options?: {
1994
+ network?: 'mainnet' | 'devnet' | 'testnet';
1995
+ includeRelatedResource?: boolean;
1996
+ }): W3CVerifiableCredential;
1997
+ /**
1998
+ * Export credential with DID resolution
1999
+ * Resolves DIDs for issuer and subject to get full DID documents
2000
+ *
2001
+ * @param credential - Credential to export
2002
+ * @param template - Credential template
2003
+ * @param credentialType - Credential type
2004
+ * @param subjectData - Subject data
2005
+ * @param options - Export options
2006
+ * @returns W3C credential with resolved DIDs
2007
+ */
2008
+ exportWithDidResolution(credential: Credential, template: CredentialTemplate, credentialType: CredentialType, subjectData: Record<string, unknown>, options?: {
2009
+ network?: 'mainnet' | 'devnet' | 'testnet';
2010
+ includeRelatedResource?: boolean;
2011
+ }): Promise<W3CVerifiableCredential>;
2012
+ static buildAgentIdentitySubject(params: {
2013
+ agentId: string;
2014
+ owner: string;
2015
+ name: string;
2016
+ capabilities: string[];
2017
+ serviceEndpoint: string;
2018
+ frameworkOrigin: string;
2019
+ x402Enabled: boolean;
2020
+ registeredAt: number;
2021
+ verifiedAt: number;
2022
+ }): {
2023
+ agentId: string;
2024
+ owner: string;
2025
+ name: string;
2026
+ capabilities: string[];
2027
+ serviceEndpoint: string;
2028
+ frameworkOrigin: string;
2029
+ x402Enabled: boolean;
2030
+ registeredAt: number;
2031
+ verifiedAt: number;
2032
+ };
2033
+ /**
2034
+ * Issue an AgentIdentity credential for a newly registered x402 agent
2035
+ *
2036
+ * This creates a W3C Verifiable Credential that can be:
2037
+ * - Stored on-chain for reputation
2038
+ * - Exported as standard W3C VC JSON
2039
+ * - Verified by third parties
2040
+ *
2041
+ * @example
2042
+ * ```typescript
2043
+ * const result = await credentialModule.issueX402AgentCredential({
2044
+ * agentAddress: 'EPjFWdd5...',
2045
+ * agentId: 'x402-abc123',
2046
+ * owner: 'HN7cAB...',
2047
+ * name: 'My Coinbase Agent',
2048
+ * serviceEndpoint: 'https://my-agent.com/api',
2049
+ * frameworkOrigin: 'coinbase-x402',
2050
+ * x402PaymentAddress: 'EPjFWdd5...',
2051
+ * x402AcceptedTokens: ['EPjFWdd5...'],
2052
+ * x402PricePerCall: '1000000'
2053
+ * })
2054
+ * ```
2055
+ */
2056
+ issueX402AgentCredential(params: {
2057
+ agentAddress: string;
2058
+ agentId: string;
2059
+ owner: string;
2060
+ name: string;
2061
+ serviceEndpoint: string;
2062
+ frameworkOrigin: string;
2063
+ x402PaymentAddress: string;
2064
+ x402AcceptedTokens: string[];
2065
+ x402PricePerCall: string;
2066
+ capabilities?: string[];
2067
+ description?: string;
2068
+ verificationResponseTimeMs?: number;
2069
+ network?: 'mainnet' | 'devnet' | 'testnet';
2070
+ }): {
2071
+ credentialId: string;
2072
+ credential: Credential;
2073
+ w3cCredential: W3CVerifiableCredential;
2074
+ subjectData: Record<string, unknown>;
2075
+ };
2076
+ /**
2077
+ * Export an existing credential to W3C JSON format
2078
+ */
2079
+ exportCredentialToJSON(credential: Credential, subjectData: Record<string, unknown>, options?: {
2080
+ network?: 'mainnet' | 'devnet' | 'testnet';
2081
+ pretty?: boolean;
2082
+ }): string;
2083
+ }
2084
+
2085
+ /**
2086
+ * Simplified reputation data for module use
2087
+ */
2088
+ interface ReputationData {
2089
+ agent: Address$1;
2090
+ overallScore: number;
2091
+ totalJobsCompleted: number;
2092
+ totalJobsFailed: number;
2093
+ avgResponseTime: number;
2094
+ disputesAgainst: number;
2095
+ disputesResolved: number;
2096
+ lastUpdated: number;
2097
+ categoryReputations: CategoryReputation[];
2098
+ badges: Array<{
2099
+ badgeType: BadgeType;
2100
+ earnedAt: number;
2101
+ }>;
2102
+ performanceHistory: Array<{
2103
+ timestamp: number;
2104
+ score: number;
2105
+ jobsCompleted: number;
2106
+ avgQuality: number;
2107
+ }>;
2108
+ factors: {
2109
+ completionWeight: number;
2110
+ qualityWeight: number;
2111
+ timelinessWeight: number;
2112
+ satisfactionWeight: number;
2113
+ disputeWeight: number;
2114
+ };
2115
+ }
2116
+ /**
2117
+ * Reputation module for managing reputation calculations
2118
+ */
2119
+ declare class ReputationModule extends BaseModule {
2120
+ private calculator;
2121
+ private tagEngine;
2122
+ constructor(config: GhostSpeakConfig);
2123
+ /**
2124
+ * Calculate reputation change for a job
2125
+ */
2126
+ calculateReputationChange(currentData: ReputationData, jobPerformance: JobPerformance): ReputationCalculationResult;
2127
+ /**
2128
+ * Get tier name from tier enum
2129
+ */
2130
+ getTierName(tier: ReputationTier): string;
2131
+ /**
2132
+ * Get tier from score
2133
+ */
2134
+ getTierFromScore(score: number): ReputationTier;
2135
+ /**
2136
+ * Get badge display name
2137
+ */
2138
+ getBadgeName(badge: BadgeType): string;
2139
+ /**
2140
+ * Calculate estimated APY boost from reputation
2141
+ */
2142
+ calculateApyBoost(score: number): number;
2143
+ /**
2144
+ * Get reputation tier color for UI
2145
+ */
2146
+ getTierColor(tier: ReputationTier): string;
2147
+ /**
2148
+ * Create default reputation data for new agents
2149
+ */
2150
+ createDefaultReputationData(agentAddress: Address$1): ReputationData;
2151
+ /**
2152
+ * Check if agent qualifies for a specific tier
2153
+ */
2154
+ qualifiesForTier(score: number, tier: ReputationTier): boolean;
2155
+ /**
2156
+ * Calculate points needed for next tier
2157
+ */
2158
+ pointsToNextTier(score: number): {
2159
+ nextTier: ReputationTier;
2160
+ pointsNeeded: number;
2161
+ } | null;
2162
+ /**
2163
+ * Record a PayAI payment event to update reputation
2164
+ *
2165
+ * Converts PayAI webhook data to JobPerformance format and
2166
+ * calculates reputation change.
2167
+ *
2168
+ * @param record - PayAI reputation record from webhook
2169
+ * @param currentData - Current agent reputation data (fetched from on-chain or cache)
2170
+ * @returns Reputation calculation result
2171
+ */
2172
+ recordPayAIPayment(record: PayAIReputationRecordInput, currentData: ReputationData): ReputationCalculationResult;
2173
+ /**
2174
+ * Convert a PayAI reputation record to JobPerformance format
2175
+ *
2176
+ * PayAI provides basic payment data, so we derive quality metrics
2177
+ * from response time and success status.
2178
+ */
2179
+ payAIRecordToJobPerformance(record: PayAIReputationRecordInput): JobPerformance;
2180
+ /**
2181
+ * Estimate quality rating from response time
2182
+ *
2183
+ * Fast responses (< 500ms) = 100 quality
2184
+ * Average responses (500ms-2s) = 70-90 quality
2185
+ * Slow responses (2s-10s) = 40-70 quality
2186
+ * Very slow responses (> 10s) = 20-40 quality
2187
+ */
2188
+ private estimateQualityFromResponseTime;
2189
+ /**
2190
+ * Estimate expected duration based on payment amount
2191
+ *
2192
+ * Larger payments = longer expected processing time
2193
+ */
2194
+ private estimateExpectedDuration;
2195
+ /**
2196
+ * Categorize payment by network
2197
+ */
2198
+ private categorizeFromNetwork;
2199
+ /**
2200
+ * Create a PayAI-compatible performance snapshot
2201
+ * Useful for tracking payment patterns
2202
+ */
2203
+ createPayAIPerformanceSnapshot(record: PayAIReputationRecordInput, reputationResult: ReputationCalculationResult): {
2204
+ timestamp: number;
2205
+ paymentId: string;
2206
+ network: string;
2207
+ amount: string;
2208
+ success: boolean;
2209
+ responseTimeMs: number;
2210
+ reputationChange: number;
2211
+ newScore: number;
2212
+ tier: string;
2213
+ };
2214
+ /**
2215
+ * Calculate tags for an agent based on metrics
2216
+ *
2217
+ * Automatically evaluates all tag criteria and assigns tags
2218
+ * with appropriate confidence scores.
2219
+ *
2220
+ * @param metrics - Agent reputation metrics
2221
+ * @returns Array of tag scores
2222
+ */
2223
+ calculateTagsForAgent(metrics: ReputationMetrics): Promise<TagScore[]>;
2224
+ /**
2225
+ * Get tags by category
2226
+ *
2227
+ * Filters tags to only those in the specified category.
2228
+ *
2229
+ * @param tags - All tag scores
2230
+ * @param category - Category to filter by
2231
+ * @returns Filtered tag scores
2232
+ */
2233
+ getTagsByCategory(tags: TagScore[], category: TagCategory): TagScore[];
2234
+ /**
2235
+ * Check if agent has a specific tag
2236
+ *
2237
+ * @param tags - Agent's tag scores
2238
+ * @param tagName - Tag to check for
2239
+ * @returns Whether the tag exists
2240
+ */
2241
+ hasTag(tags: TagScore[], tagName: string): boolean;
2242
+ /**
2243
+ * Get tag confidence score
2244
+ *
2245
+ * @param tags - Agent's tag scores
2246
+ * @param tagName - Tag to check
2247
+ * @returns Confidence score or undefined if tag doesn't exist
2248
+ */
2249
+ getTagConfidence(tags: TagScore[], tagName: string): number | undefined;
2250
+ /**
2251
+ * Filter tags by criteria
2252
+ *
2253
+ * @param tags - Tags to filter
2254
+ * @param filters - Filter criteria
2255
+ * @returns Filtered tags
2256
+ */
2257
+ filterTags(tags: TagScore[], filters: TagFilters): TagScore[];
2258
+ /**
2259
+ * Apply tag decay based on age
2260
+ *
2261
+ * Reduces confidence scores for old tags and removes stale tags.
2262
+ *
2263
+ * @param tags - Current tag scores
2264
+ * @param currentTimestamp - Current Unix timestamp (optional)
2265
+ * @returns Tags with decay applied
2266
+ */
2267
+ applyTagDecay(tags: TagScore[], currentTimestamp?: number): TagScore[];
2268
+ /**
2269
+ * Merge new tags with existing tags
2270
+ *
2271
+ * Updates existing tags or adds new ones, preferring higher confidence.
2272
+ *
2273
+ * @param existingTags - Current tags
2274
+ * @param newTags - New tags to merge
2275
+ * @returns Merged tag list
2276
+ */
2277
+ mergeTags(existingTags: TagScore[], newTags: TagScore[]): TagScore[];
2278
+ /**
2279
+ * Categorize tags by type
2280
+ *
2281
+ * Organizes tags into skill, behavior, and compliance categories.
2282
+ *
2283
+ * @param tags - Tags to categorize
2284
+ * @returns Categorized tag result
2285
+ */
2286
+ categorizeTags(tags: TagScore[]): TagQueryResult;
2287
+ /**
2288
+ * Get top N tags by confidence
2289
+ *
2290
+ * @param tags - Tags to sort
2291
+ * @param count - Number of tags to return
2292
+ * @returns Top tags
2293
+ */
2294
+ getTopTags(tags: TagScore[], count: number): TagScore[];
2295
+ /**
2296
+ * Sort tags by confidence (descending)
2297
+ *
2298
+ * @param tags - Tags to sort
2299
+ * @returns Sorted tags
2300
+ */
2301
+ sortTagsByConfidence(tags: TagScore[]): TagScore[];
2302
+ /**
2303
+ * Sort tags by evidence count (descending)
2304
+ *
2305
+ * @param tags - Tags to sort
2306
+ * @returns Sorted tags
2307
+ */
2308
+ sortTagsByEvidence(tags: TagScore[]): TagScore[];
2309
+ /**
2310
+ * Sort tags by most recently updated
2311
+ *
2312
+ * @param tags - Tags to sort
2313
+ * @returns Sorted tags
2314
+ */
2315
+ sortTagsByRecent(tags: TagScore[]): TagScore[];
2316
+ /**
2317
+ * Get confidence level description
2318
+ *
2319
+ * @param confidence - Confidence score (0-10000)
2320
+ * @returns Human-readable confidence level
2321
+ */
2322
+ getConfidenceLevel(confidence: number): string;
2323
+ /**
2324
+ * Validate tag name length
2325
+ *
2326
+ * @param tagName - Tag name to validate
2327
+ * @returns Whether tag name is valid
2328
+ */
2329
+ validateTagName(tagName: string): boolean;
2330
+ /**
2331
+ * Validate confidence score
2332
+ *
2333
+ * @param confidence - Confidence to validate
2334
+ * @returns Whether confidence is valid (0-10000)
2335
+ */
2336
+ validateConfidence(confidence: number): boolean;
2337
+ /**
2338
+ * Convert on-chain ReputationMetrics to TagEngine format
2339
+ *
2340
+ * Helper to convert blockchain data to the format needed for tag calculation.
2341
+ *
2342
+ * @param onChainMetrics - Metrics from blockchain
2343
+ * @returns Metrics in TagEngine format
2344
+ */
2345
+ convertMetricsForTagging(onChainMetrics: {
2346
+ successfulPayments: bigint;
2347
+ failedPayments: bigint;
2348
+ totalResponseTime: bigint;
2349
+ responseTimeCount: bigint;
2350
+ totalDisputes: number;
2351
+ disputesResolved: number;
2352
+ totalRating: number;
2353
+ totalRatingsCount: number;
2354
+ createdAt: number;
2355
+ updatedAt: number;
2356
+ }): ReputationMetrics;
2357
+ }
2358
+ /**
2359
+ * Interface for PayAI reputation record input
2360
+ * Matches the PayAIReputationRecord from payai module
2361
+ */
2362
+ interface PayAIReputationRecordInput {
2363
+ agentAddress: Address$1;
2364
+ paymentSignature: string;
2365
+ amount: bigint;
2366
+ success: boolean;
2367
+ responseTimeMs: number;
2368
+ payerAddress: string;
2369
+ timestamp: Date;
2370
+ network: string;
2371
+ }
2372
+
2373
+ interface StakeParams {
2374
+ /** Agent address to stake for */
2375
+ agent: Address$1;
2376
+ /** Agent's token account holding GHOST tokens */
2377
+ agentTokenAccount: Address$1;
2378
+ /** Staking vault to receive tokens */
2379
+ stakingVault: Address$1;
2380
+ /** Global staking config account */
2381
+ stakingConfig: Address$1;
2382
+ /** GHOST token mint address */
2383
+ ghostMint: Address$1;
2384
+ /** Amount of GHOST tokens to stake (in lamports) */
2385
+ amount: bigint;
2386
+ /** Lock duration in seconds */
2387
+ lockDuration: bigint;
2388
+ /** The agent owner's transaction signer */
2389
+ agentOwner: TransactionSigner;
2390
+ }
2391
+ interface UnstakeParams {
2392
+ /** Staking account to unstake from */
2393
+ stakingAccount: Address$1;
2394
+ /** Agent address */
2395
+ agent: Address$1;
2396
+ /** Staking vault holding the tokens */
2397
+ stakingVault: Address$1;
2398
+ /** Agent's token account to receive tokens */
2399
+ agentTokenAccount: Address$1;
2400
+ /** The agent owner's transaction signer */
2401
+ agentOwner: TransactionSigner;
2402
+ }
2403
+ interface InitializeStakingConfigParams {
2404
+ /** Admin who can modify staking config */
2405
+ authority: TransactionSigner;
2406
+ /** Minimum stake amount */
2407
+ minStake: bigint;
2408
+ /** Treasury address to receive fees */
2409
+ treasury: Address$1;
2410
+ }
2411
+ declare class StakingModule extends BaseModule {
2412
+ /**
2413
+ * Initialize the global staking configuration (admin only)
2414
+ */
2415
+ initializeStakingConfig(params: InitializeStakingConfigParams): Promise<string>;
2416
+ /**
2417
+ * Stake GHOST tokens for an agent
2418
+ *
2419
+ * @param params - Staking parameters
2420
+ * @returns Transaction signature
2421
+ */
2422
+ stake(params: StakeParams): Promise<string>;
2423
+ /**
2424
+ * Unstake GHOST tokens from an agent
2425
+ *
2426
+ * @param params - Unstaking parameters
2427
+ * @returns Transaction signature
2428
+ */
2429
+ unstake(params: UnstakeParams): Promise<string>;
2430
+ /**
2431
+ * Get staking account for an agent
2432
+ *
2433
+ * @param stakingAccountAddress - The staking account address
2434
+ * @returns Staking account data or null if not found
2435
+ */
2436
+ getStakingAccount(stakingAccountAddress: Address$1): Promise<StakingAccount | null>;
2437
+ /**
2438
+ * Get the global staking configuration
2439
+ *
2440
+ * @param stakingConfigAddress - The staking config account address
2441
+ * @returns Staking config data or null if not initialized
2442
+ */
2443
+ getStakingConfig(stakingConfigAddress: Address$1): Promise<StakingConfig | null>;
2444
+ }
2445
+
2446
+ export { type DeactivateDidDocumentParams as $, AgentModule as A, BaseModule as B, CacheManager as C, DidModule as D, type ExtendedRpcApi as E, isDidActive as F, type GhostSpeakConfig as G, getMethodsForRelationship as H, InstructionBuilder as I, canPerformAction as J, didDocumentToJson as K, getNetworkFromDid as L, MultisigModule as M, type Network as N, getIdentifierFromDid as O, type PricingModelArgs as P, type DidDocument as Q, ReputationModule as R, StakingModule as S, type VerificationMethod as T, type ServiceEndpoint as U, VerificationMethodType as V, type W3CVerifiableCredential as W, type DidResolutionMetadata as X, type W3CDidDocument as Y, type CreateDidDocumentParams as Z, type UpdateDidDocumentParams as _, GhostModule as a, type ResolveDidDocumentParams as a0, type ReputationData as a1, type PayAIReputationRecordInput as a2, type AgentWithAddress as a3, type AgentRegistrationData as a4, type AgentAccount as a5, PricingModel as a6, GhostSpeakError as a7, type RegisterAgentParams as a8, type RpcResponse as a9, type RpcAccountInfo as aa, type RpcProgramAccount as ab, type RpcProgramAccountsResponse as ac, type RpcAccountInfoResponse as ad, type RpcMultipleAccountsResponse as ae, type TransactionResponse as af, type SimulatedTransactionResponse as ag, type SolanaRpcClient as ah, type EmergencyConfig as ai, type Commitment as aj, type RetryConfig as ak, type RpcApi as al, type RpcSubscriptionApi as am, type StakingAccount as an, type StakingConfig as ao, getAgentDecoder as ap, decodeAgent as aq, fetchAgent as ar, fetchMaybeAgent as as, getStakingAccountDecoder as at, getStakingConfigDecoder as au, type Agent as av, GovernanceModule as b, AccessTier as c, GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS as d, type CacheConfig as e, type ClaimGhostParams as f, type PreparedClaimResult as g, type CreateProposalParams as h, type ProposalType as i, type ExecutionParams as j, CredentialModule as k, CredentialKind as l, CredentialStatus as m, type Credential as n, type CredentialTemplate as o, VerificationRelationship as p, ServiceEndpointType as q, DidError as r, DidErrorClass as s, deriveDidDocumentPda as t, generateDidString as u, validateDidString as v, parseDidString as w, exportAsW3CDidDocument as x, createEd25519VerificationMethod as y, createServiceEndpoint as z };