@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.
- package/README.md +295 -30
- package/dist/GhostSpeakClient-bnXwUPHI.d.ts +1011 -0
- package/dist/StakingModule-DunDShLq.d.ts +2446 -0
- package/dist/{agent-M74TCRON.js → agent-S42FIMR7.js} +4 -4
- package/dist/{agent-M74TCRON.js.map → agent-S42FIMR7.js.map} +1 -1
- package/dist/batch-operations-45CQFEID.js +4 -0
- package/dist/batch-operations-45CQFEID.js.map +1 -0
- package/dist/browser-CI5_6Gzk.d.ts +234 -0
- package/dist/browser.d.ts +6 -576
- package/dist/browser.js +15 -842
- package/dist/browser.js.map +1 -1
- package/dist/chunk-46QWY3MG.js +156 -0
- package/dist/chunk-46QWY3MG.js.map +1 -0
- package/dist/{chunk-F3DZMBUA.js → chunk-5QBSC4T4.js} +327 -493
- package/dist/chunk-5QBSC4T4.js.map +1 -0
- package/dist/chunk-5QZVFUXB.js +4176 -0
- package/dist/chunk-5QZVFUXB.js.map +1 -0
- package/dist/chunk-6XCCMJ6M.js +1865 -0
- package/dist/chunk-6XCCMJ6M.js.map +1 -0
- package/dist/chunk-A7ALCVUI.js +98 -0
- package/dist/chunk-A7ALCVUI.js.map +1 -0
- package/dist/chunk-AWMGX3OX.js +814 -0
- package/dist/chunk-AWMGX3OX.js.map +1 -0
- package/dist/chunk-BF3IQ35I.js +284 -0
- package/dist/chunk-BF3IQ35I.js.map +1 -0
- package/dist/chunk-BQDGRTVP.js +168 -0
- package/dist/chunk-BQDGRTVP.js.map +1 -0
- package/dist/chunk-IQM5RASO.js +8502 -0
- package/dist/chunk-IQM5RASO.js.map +1 -0
- package/dist/chunk-JYXSOXCP.js +3850 -0
- package/dist/chunk-JYXSOXCP.js.map +1 -0
- package/dist/chunk-OXA7MECJ.js +7787 -0
- package/dist/chunk-OXA7MECJ.js.map +1 -0
- package/dist/chunk-QLRWUHN2.js +231 -0
- package/dist/chunk-QLRWUHN2.js.map +1 -0
- package/dist/chunk-SKMJJ3Q6.js +125 -0
- package/dist/chunk-SKMJJ3Q6.js.map +1 -0
- package/dist/chunk-TTB4OS2D.js +69 -0
- package/dist/chunk-TTB4OS2D.js.map +1 -0
- package/dist/chunk-UP2VWCW5.js +33 -0
- package/dist/{chunk-NSBPE2FW.js.map → chunk-UP2VWCW5.js.map} +1 -1
- package/dist/{chunk-UJUGGLMT.js → chunk-VQZQCHUT.js} +5 -5
- package/dist/{chunk-UJUGGLMT.js.map → chunk-VQZQCHUT.js.map} +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/client.js +11 -10
- package/dist/createAgentAuthorization-KGZNXZBT.js +5 -0
- package/dist/createAgentAuthorization-KGZNXZBT.js.map +1 -0
- package/dist/credentials.js +1 -1
- package/dist/crypto.js +2 -2
- package/dist/errors.js +1 -1
- package/dist/feature-flags-B1g0DCPe.d.ts +1181 -0
- package/dist/generated-QJREJQ2C.js +9 -0
- package/dist/{generated-VNLHMR6Y.js.map → generated-QJREJQ2C.js.map} +1 -1
- package/dist/{ghostspeak_wasm-SB2RPJ3D.js → ghostspeak_wasm-F227HOSM.js} +3 -3
- package/dist/{ghostspeak_wasm-SB2RPJ3D.js.map → ghostspeak_wasm-F227HOSM.js.map} +1 -1
- package/dist/index.d.ts +1179 -1498
- package/dist/index.js +356 -3578
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/minimal/core-minimal.d.ts +2446 -1245
- package/dist/minimal/core-minimal.js +9 -9
- package/dist/minimal/core-minimal.js.map +1 -1
- package/dist/nacl-fast-W5BJ3KZ2.js +2229 -0
- package/dist/nacl-fast-W5BJ3KZ2.js.map +1 -0
- package/dist/pda-4KP7CURF.js +4 -0
- package/dist/pda-4KP7CURF.js.map +1 -0
- package/dist/pda-Ce7VYg4T.d.ts +25 -0
- package/dist/reputation-types-Yebf0Rm_.d.ts +1071 -0
- package/dist/revokeAuthorization-2ZRO6GUZ.js +5 -0
- package/dist/revokeAuthorization-2ZRO6GUZ.js.map +1 -0
- package/dist/signature-verification-DGxR4aYQ.d.ts +448 -0
- package/dist/types.js +1 -1
- package/dist/updateReputationWithAuth-PCEUOCFV.js +5 -0
- package/dist/updateReputationWithAuth-PCEUOCFV.js.map +1 -0
- package/dist/utils.d.ts +69 -203
- package/dist/utils.js +15 -153
- package/dist/utils.js.map +1 -1
- package/package.json +27 -34
- package/dist/.tsbuildinfo +0 -1
- package/dist/GhostSpeakClient-D_66Uzsf.d.ts +0 -707
- package/dist/GovernanceModule-DQYYys-H.d.ts +0 -1766
- package/dist/chunk-APCKGD23.js +0 -1328
- package/dist/chunk-APCKGD23.js.map +0 -1
- package/dist/chunk-ASQXX4IT.js +0 -572
- package/dist/chunk-ASQXX4IT.js.map +0 -1
- package/dist/chunk-COGZFWOT.js +0 -19657
- package/dist/chunk-COGZFWOT.js.map +0 -1
- package/dist/chunk-F3DZMBUA.js.map +0 -1
- package/dist/chunk-GMHIUK2R.js +0 -7526
- package/dist/chunk-GMHIUK2R.js.map +0 -1
- package/dist/chunk-IAWBZYPE.js +0 -356
- package/dist/chunk-IAWBZYPE.js.map +0 -1
- package/dist/chunk-NSBPE2FW.js +0 -15
- package/dist/chunk-OWYHJG6H.js +0 -13311
- package/dist/chunk-OWYHJG6H.js.map +0 -1
- package/dist/chunk-RDDPOFR5.js +0 -3
- package/dist/chunk-RDDPOFR5.js.map +0 -1
- package/dist/chunk-RERCHKZP.js +0 -35
- package/dist/chunk-RERCHKZP.js.map +0 -1
- package/dist/chunk-TVVGXYCI.js +0 -2887
- package/dist/chunk-TVVGXYCI.js.map +0 -1
- package/dist/chunk-ZGP5552B.js +0 -377
- package/dist/chunk-ZGP5552B.js.map +0 -1
- package/dist/chunk-ZWOYNHVK.js +0 -196
- package/dist/chunk-ZWOYNHVK.js.map +0 -1
- package/dist/dist/.tsbuildinfo +0 -1
- package/dist/elgamal-VZLWB3XK.js +0 -5
- package/dist/elgamal-VZLWB3XK.js.map +0 -1
- package/dist/feature-flags-V722ZuXO.d.ts +0 -3512
- package/dist/generated-VNLHMR6Y.js +0 -5
- package/dist/ipfs-types-BOt9ZNg4.d.ts +0 -592
- package/dist/multisigConfig-BzEhy6jy.d.ts +0 -58
- package/dist/pda-B_nS8SbD.d.ts +0 -114
- package/dist/pda-S4BFJVGE.js +0 -4
- package/dist/pda-S4BFJVGE.js.map +0 -1
- package/dist/system-addresses-BFNLEbFx.d.ts +0 -857
- package/dist/token-2022-rpc-RALH4RK7.js +0 -593
- package/dist/token-2022-rpc-RALH4RK7.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Option, ReadonlyUint8Array, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, WritableSignerAccount, AccountSignerMeta, ReadonlyAccount,
|
|
1
|
+
import { Address, Option, ReadonlyUint8Array, 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';
|
|
2
2
|
import { Address as Address$1 } from '@solana/addresses';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,10 +9,13 @@ import { Address as Address$1 } from '@solana/addresses';
|
|
|
9
9
|
* @see https://github.com/codama-idl/codama
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/** Access tiers based on GHOST token stake amount */
|
|
13
|
+
declare enum AccessTier {
|
|
14
|
+
None = 0,
|
|
15
|
+
Basic = 1,
|
|
16
|
+
Verified = 2,
|
|
17
|
+
Pro = 3,
|
|
18
|
+
Whale = 4
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -23,56 +26,12 @@ declare enum AccountState {
|
|
|
23
26
|
* @see https://github.com/codama-idl/codama
|
|
24
27
|
*/
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
35
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
36
|
-
* to add features, then rerun Codama to update it.
|
|
37
|
-
*
|
|
38
|
-
* @see https://github.com/codama-idl/codama
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
type AuctionBid = {
|
|
42
|
-
bidder: Address;
|
|
43
|
-
amount: bigint;
|
|
44
|
-
timestamp: bigint;
|
|
45
|
-
isWinning: boolean;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
50
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
51
|
-
* to add features, then rerun Codama to update it.
|
|
52
|
-
*
|
|
53
|
-
* @see https://github.com/codama-idl/codama
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
declare enum AuctionStatus {
|
|
57
|
-
Active = 0,
|
|
58
|
-
Ended = 1,
|
|
59
|
-
Cancelled = 2,
|
|
60
|
-
Settled = 3
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
65
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
66
|
-
* to add features, then rerun Codama to update it.
|
|
67
|
-
*
|
|
68
|
-
* @see https://github.com/codama-idl/codama
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
declare enum AuctionType {
|
|
72
|
-
English = 0,
|
|
73
|
-
Dutch = 1,
|
|
74
|
-
SealedBid = 2,
|
|
75
|
-
Vickrey = 3
|
|
29
|
+
/** Agent lifecycle status (Ghost Identity) */
|
|
30
|
+
declare enum AgentStatus {
|
|
31
|
+
Unregistered = 0,
|
|
32
|
+
Registered = 1,
|
|
33
|
+
Claimed = 2,
|
|
34
|
+
Verified = 3
|
|
76
35
|
}
|
|
77
36
|
|
|
78
37
|
/**
|
|
@@ -134,35 +93,6 @@ type DelegationScope = {
|
|
|
134
93
|
__kind: "Limited";
|
|
135
94
|
};
|
|
136
95
|
|
|
137
|
-
/**
|
|
138
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
139
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
140
|
-
* to add features, then rerun Codama to update it.
|
|
141
|
-
*
|
|
142
|
-
* @see https://github.com/codama-idl/codama
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
type DutchAuctionConfig = {
|
|
146
|
-
decayType: DutchAuctionDecayType;
|
|
147
|
-
priceStepCount: number;
|
|
148
|
-
stepDuration: bigint;
|
|
149
|
-
decayRateBasisPoints: number;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
154
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
155
|
-
* to add features, then rerun Codama to update it.
|
|
156
|
-
*
|
|
157
|
-
* @see https://github.com/codama-idl/codama
|
|
158
|
-
*/
|
|
159
|
-
|
|
160
|
-
declare enum DutchAuctionDecayType {
|
|
161
|
-
Linear = 0,
|
|
162
|
-
Exponential = 1,
|
|
163
|
-
Stepped = 2
|
|
164
|
-
}
|
|
165
|
-
|
|
166
96
|
/**
|
|
167
97
|
* This code was AUTOGENERATED using the Codama library.
|
|
168
98
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -235,6 +165,88 @@ type ExecutionParamsArgs = {
|
|
|
235
165
|
executionAuthority: Address;
|
|
236
166
|
};
|
|
237
167
|
|
|
168
|
+
/**
|
|
169
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
170
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
171
|
+
* to add features, then rerun Codama to update it.
|
|
172
|
+
*
|
|
173
|
+
* @see https://github.com/codama-idl/codama
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
/** Cross-platform identity mapping */
|
|
177
|
+
type ExternalIdentifier = {
|
|
178
|
+
platform: string;
|
|
179
|
+
externalId: string;
|
|
180
|
+
verified: boolean;
|
|
181
|
+
verifiedAt: bigint;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
186
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
187
|
+
* to add features, then rerun Codama to update it.
|
|
188
|
+
*
|
|
189
|
+
* @see https://github.com/codama-idl/codama
|
|
190
|
+
*/
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* MultisigType defines the governance layer a multisig belongs to.
|
|
194
|
+
* Different types have different permissions and requirements.
|
|
195
|
+
*/
|
|
196
|
+
declare enum MultisigType {
|
|
197
|
+
Protocol = 0,
|
|
198
|
+
Dao = 1,
|
|
199
|
+
Dispute = 2,
|
|
200
|
+
AgentConsortium = 3,
|
|
201
|
+
AgentTreasury = 4,
|
|
202
|
+
Custom = 5
|
|
203
|
+
}
|
|
204
|
+
type MultisigTypeArgs = MultisigType;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
208
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
209
|
+
* to add features, then rerun Codama to update it.
|
|
210
|
+
*
|
|
211
|
+
* @see https://github.com/codama-idl/codama
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
type MultisigTypeConfigArgs = {
|
|
215
|
+
/** The multisig type */
|
|
216
|
+
multisigType: MultisigTypeArgs;
|
|
217
|
+
/** Required timelock duration in seconds (0 = no timelock) */
|
|
218
|
+
timelockSeconds: number | bigint;
|
|
219
|
+
/** Minimum number of signers allowed */
|
|
220
|
+
minSigners: number;
|
|
221
|
+
/** Maximum number of signers allowed */
|
|
222
|
+
maxSigners: number;
|
|
223
|
+
/** Minimum reputation score required (0-10000 basis points) */
|
|
224
|
+
minReputationScore: number;
|
|
225
|
+
/** Whether signers must hold governance tokens */
|
|
226
|
+
requiresTokenHoldings: boolean;
|
|
227
|
+
/** Minimum token balance required (if requires_token_holdings) */
|
|
228
|
+
minTokenBalance: number | bigint;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
233
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
234
|
+
* to add features, then rerun Codama to update it.
|
|
235
|
+
*
|
|
236
|
+
* @see https://github.com/codama-idl/codama
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
declare enum PricingModel {
|
|
240
|
+
Fixed = 0,
|
|
241
|
+
Hourly = 1,
|
|
242
|
+
PerTask = 2,
|
|
243
|
+
Subscription = 3,
|
|
244
|
+
Auction = 4,
|
|
245
|
+
Dynamic = 5,
|
|
246
|
+
RevenueShare = 6,
|
|
247
|
+
Tiered = 7
|
|
248
|
+
}
|
|
249
|
+
|
|
238
250
|
/**
|
|
239
251
|
* This code was AUTOGENERATED using the Codama library.
|
|
240
252
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -351,22 +363,6 @@ declare enum ProposalType {
|
|
|
351
363
|
}
|
|
352
364
|
type ProposalTypeArgs = ProposalType;
|
|
353
365
|
|
|
354
|
-
/**
|
|
355
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
356
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
357
|
-
* to add features, then rerun Codama to update it.
|
|
358
|
-
*
|
|
359
|
-
* @see https://github.com/codama-idl/codama
|
|
360
|
-
*/
|
|
361
|
-
|
|
362
|
-
declare enum PurchaseStatus {
|
|
363
|
-
Pending = 0,
|
|
364
|
-
Confirmed = 1,
|
|
365
|
-
Completed = 2,
|
|
366
|
-
Cancelled = 3,
|
|
367
|
-
Paid = 4
|
|
368
|
-
}
|
|
369
|
-
|
|
370
366
|
/**
|
|
371
367
|
* This code was AUTOGENERATED using the Codama library.
|
|
372
368
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -413,27 +409,34 @@ type QuorumRequirements = {
|
|
|
413
409
|
* @see https://github.com/codama-idl/codama
|
|
414
410
|
*/
|
|
415
411
|
|
|
416
|
-
/**
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
412
|
+
/** Reputation component for multi-source Ghost Score */
|
|
413
|
+
type ReputationComponent = {
|
|
414
|
+
sourceType: ReputationSourceType;
|
|
415
|
+
score: bigint;
|
|
416
|
+
weight: number;
|
|
417
|
+
lastUpdated: bigint;
|
|
418
|
+
dataPoints: bigint;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
423
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
424
|
+
* to add features, then rerun Codama to update it.
|
|
425
|
+
*
|
|
426
|
+
* @see https://github.com/codama-idl/codama
|
|
427
|
+
*/
|
|
428
|
+
|
|
429
|
+
/** Multi-source reputation types for Ghost Score */
|
|
430
|
+
declare enum ReputationSourceType {
|
|
431
|
+
AccountAge = 0,
|
|
432
|
+
X402Transactions = 1,
|
|
433
|
+
UserReviews = 2,
|
|
434
|
+
ElizaOSReputation = 3,
|
|
435
|
+
CrossmintVerification = 4,
|
|
436
|
+
EndpointReliability = 5,
|
|
437
|
+
JobCompletions = 6,
|
|
438
|
+
SkillEndorsements = 7
|
|
439
|
+
}
|
|
437
440
|
|
|
438
441
|
/**
|
|
439
442
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -504,21 +507,6 @@ type VotingResults = {
|
|
|
504
507
|
approvalThresholdMet: boolean;
|
|
505
508
|
};
|
|
506
509
|
|
|
507
|
-
/**
|
|
508
|
-
* This code was AUTOGENERATED by scripts/generate-missing-types.ts
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
|
-
type MultisigConfigArgs = {
|
|
512
|
-
max_signers: number;
|
|
513
|
-
default_timeout: number | bigint;
|
|
514
|
-
allow_emergency_override: boolean;
|
|
515
|
-
emergency_threshold: Option<number>;
|
|
516
|
-
auto_execute: boolean;
|
|
517
|
-
signer_change_threshold: number;
|
|
518
|
-
allowed_transaction_types: Array<TransactionTypeArgs>;
|
|
519
|
-
daily_limits: Array<readonly [string, number | bigint]>;
|
|
520
|
-
};
|
|
521
|
-
|
|
522
510
|
/**
|
|
523
511
|
* This code was AUTOGENERATED using the Codama library.
|
|
524
512
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -527,32 +515,57 @@ type MultisigConfigArgs = {
|
|
|
527
515
|
* @see https://github.com/codama-idl/codama
|
|
528
516
|
*/
|
|
529
517
|
|
|
530
|
-
type
|
|
518
|
+
type Agent$1 = {
|
|
531
519
|
discriminator: ReadonlyUint8Array;
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
520
|
+
owner: Option<Address>;
|
|
521
|
+
status: AgentStatus;
|
|
522
|
+
agentId: string;
|
|
523
|
+
firstTxSignature: string;
|
|
524
|
+
firstSeenTimestamp: bigint;
|
|
525
|
+
discoverySource: string;
|
|
526
|
+
claimedAt: Option<bigint>;
|
|
527
|
+
agentType: number;
|
|
528
|
+
name: string;
|
|
529
|
+
description: string;
|
|
530
|
+
capabilities: Array<string>;
|
|
531
|
+
pricingModel: PricingModel;
|
|
532
|
+
reputationScore: number;
|
|
533
|
+
totalJobsCompleted: number;
|
|
534
|
+
totalEarnings: bigint;
|
|
535
|
+
isActive: boolean;
|
|
548
536
|
createdAt: bigint;
|
|
549
|
-
|
|
537
|
+
updatedAt: bigint;
|
|
538
|
+
originalPrice: bigint;
|
|
539
|
+
genomeHash: string;
|
|
540
|
+
isReplicable: boolean;
|
|
541
|
+
replicationFee: bigint;
|
|
542
|
+
serviceEndpoint: string;
|
|
543
|
+
isVerified: boolean;
|
|
544
|
+
verificationTimestamp: bigint;
|
|
550
545
|
metadataUri: string;
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
546
|
+
frameworkOrigin: string;
|
|
547
|
+
supportedTokens: Array<Address>;
|
|
548
|
+
cnftMint: Option<Address>;
|
|
549
|
+
merkleTree: Option<Address>;
|
|
550
|
+
supportsA2a: boolean;
|
|
551
|
+
transferHook: Option<Address>;
|
|
552
|
+
parentAgent: Option<Address>;
|
|
553
|
+
generation: number;
|
|
554
|
+
x402Enabled: boolean;
|
|
555
|
+
x402PaymentAddress: Address;
|
|
556
|
+
x402AcceptedTokens: Array<Address>;
|
|
557
|
+
x402PricePerCall: bigint;
|
|
558
|
+
x402ServiceEndpoint: string;
|
|
559
|
+
x402TotalPayments: bigint;
|
|
560
|
+
x402TotalCalls: bigint;
|
|
561
|
+
lastPaymentTimestamp: bigint;
|
|
562
|
+
externalIdentifiers: Array<ExternalIdentifier>;
|
|
563
|
+
ghostScore: bigint;
|
|
564
|
+
reputationComponents: Array<ReputationComponent>;
|
|
565
|
+
didAddress: Option<Address>;
|
|
566
|
+
credentials: Array<Address>;
|
|
567
|
+
apiSpecUri: string;
|
|
568
|
+
apiVersion: string;
|
|
556
569
|
bump: number;
|
|
557
570
|
};
|
|
558
571
|
|
|
@@ -606,75 +619,35 @@ type GovernanceProposal = {
|
|
|
606
619
|
* @see https://github.com/codama-idl/codama
|
|
607
620
|
*/
|
|
608
621
|
|
|
609
|
-
type
|
|
610
|
-
discriminator: ReadonlyUint8Array;
|
|
611
|
-
jobPosting: Address;
|
|
612
|
-
agent: Address;
|
|
613
|
-
agentOwner: Address;
|
|
614
|
-
coverLetter: string;
|
|
615
|
-
proposedRate: bigint;
|
|
616
|
-
estimatedDelivery: bigint;
|
|
617
|
-
portfolioItems: Array<string>;
|
|
618
|
-
status: ApplicationStatus;
|
|
619
|
-
appliedAt: bigint;
|
|
620
|
-
bump: number;
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
625
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
626
|
-
* to add features, then rerun Codama to update it.
|
|
627
|
-
*
|
|
628
|
-
* @see https://github.com/codama-idl/codama
|
|
629
|
-
*/
|
|
630
|
-
|
|
631
|
-
type JobPosting = {
|
|
632
|
-
discriminator: ReadonlyUint8Array;
|
|
633
|
-
employer: Address;
|
|
634
|
-
title: string;
|
|
635
|
-
description: string;
|
|
636
|
-
requirements: Array<string>;
|
|
637
|
-
budget: bigint;
|
|
638
|
-
deadline: bigint;
|
|
639
|
-
skillsNeeded: Array<string>;
|
|
640
|
-
budgetMin: bigint;
|
|
641
|
-
budgetMax: bigint;
|
|
642
|
-
paymentToken: Address;
|
|
643
|
-
jobType: string;
|
|
644
|
-
experienceLevel: string;
|
|
645
|
-
isActive: boolean;
|
|
646
|
-
applicationsCount: number;
|
|
647
|
-
createdAt: bigint;
|
|
648
|
-
updatedAt: bigint;
|
|
649
|
-
bump: number;
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
654
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
655
|
-
* to add features, then rerun Codama to update it.
|
|
656
|
-
*
|
|
657
|
-
* @see https://github.com/codama-idl/codama
|
|
658
|
-
*/
|
|
659
|
-
|
|
660
|
-
type ServiceListing = {
|
|
622
|
+
type StakingAccount = {
|
|
661
623
|
discriminator: ReadonlyUint8Array;
|
|
662
|
-
|
|
624
|
+
/** Owner of this staking account (can register multiple agents) */
|
|
663
625
|
owner: Address;
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
626
|
+
/** Amount of GHOST tokens staked */
|
|
627
|
+
amountStaked: bigint;
|
|
628
|
+
/** Timestamp when staking started */
|
|
629
|
+
stakedAt: bigint;
|
|
630
|
+
/** Lock duration in seconds (minimum 30 days) */
|
|
631
|
+
lockDuration: bigint;
|
|
632
|
+
/** Timestamp when unlock is available */
|
|
633
|
+
unlockAt: bigint;
|
|
634
|
+
/** Reputation boost percentage (in basis points, e.g., 500 = 5%) */
|
|
635
|
+
reputationBoostBps: number;
|
|
636
|
+
/** Whether agent has "Verified" badge */
|
|
637
|
+
hasVerifiedBadge: boolean;
|
|
638
|
+
/** Whether agent has premium listing benefits */
|
|
639
|
+
hasPremiumBenefits: boolean;
|
|
640
|
+
/** Total slashed amount (never recoverable) */
|
|
641
|
+
totalSlashed: bigint;
|
|
642
|
+
/** Current access tier based on stake amount */
|
|
643
|
+
tier: AccessTier;
|
|
644
|
+
/** Daily API calls remaining (resets every 24h) */
|
|
645
|
+
apiCallsRemaining: number;
|
|
646
|
+
/** Last API quota reset timestamp */
|
|
647
|
+
lastQuotaReset: bigint;
|
|
648
|
+
/** Voting power for governance (equals amount_staked) */
|
|
649
|
+
votingPower: bigint;
|
|
650
|
+
/** Bump for PDA */
|
|
678
651
|
bump: number;
|
|
679
652
|
};
|
|
680
653
|
|
|
@@ -686,22 +659,20 @@ type ServiceListing = {
|
|
|
686
659
|
* @see https://github.com/codama-idl/codama
|
|
687
660
|
*/
|
|
688
661
|
|
|
689
|
-
type
|
|
662
|
+
type StakingConfig = {
|
|
690
663
|
discriminator: ReadonlyUint8Array;
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
updatedAt: bigint;
|
|
704
|
-
transferHookApplied: boolean;
|
|
664
|
+
/** Authority who can update staking parameters */
|
|
665
|
+
authority: Address;
|
|
666
|
+
/** Minimum stake amount (1,000 GHOST) */
|
|
667
|
+
minStake: bigint;
|
|
668
|
+
/** Minimum lock duration (30 days in seconds) */
|
|
669
|
+
minLockDuration: bigint;
|
|
670
|
+
/** Slash percentage for fraud (50% = 5000 bps) */
|
|
671
|
+
fraudSlashBps: number;
|
|
672
|
+
/** Slash percentage for dispute loss (10% = 1000 bps) */
|
|
673
|
+
disputeSlashBps: number;
|
|
674
|
+
/** Treasury account for slashed tokens */
|
|
675
|
+
treasury: Address;
|
|
705
676
|
bump: number;
|
|
706
677
|
};
|
|
707
678
|
|
|
@@ -713,7 +684,7 @@ type ServicePurchase = {
|
|
|
713
684
|
* @see https://github.com/codama-idl/codama
|
|
714
685
|
*/
|
|
715
686
|
|
|
716
|
-
declare const GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS: Address<"
|
|
687
|
+
declare const GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS: Address<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">;
|
|
717
688
|
|
|
718
689
|
/**
|
|
719
690
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -723,326 +694,123 @@ declare const GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS: Address<"GpvFxus2eecFKcqa2
|
|
|
723
694
|
* @see https://github.com/codama-idl/codama
|
|
724
695
|
*/
|
|
725
696
|
|
|
726
|
-
type
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
TAccountJobApplication extends string ? WritableAccount<TAccountJobApplication> : TAccountJobApplication,
|
|
730
|
-
TAccountEmployer extends string ? WritableSignerAccount<TAccountEmployer> & AccountSignerMeta<TAccountEmployer> : TAccountEmployer,
|
|
697
|
+
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<[
|
|
698
|
+
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
699
|
+
TAccountProposer extends string ? WritableSignerAccount<TAccountProposer> & AccountSignerMeta<TAccountProposer> : TAccountProposer,
|
|
731
700
|
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
732
701
|
...TRemainingAccounts
|
|
733
702
|
]>;
|
|
734
703
|
|
|
735
704
|
/**
|
|
736
|
-
*
|
|
737
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
738
|
-
* to add features, then rerun Codama to update it.
|
|
705
|
+
* CacheManager - Slot-aware RPC result caching
|
|
739
706
|
*
|
|
740
|
-
*
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
type ApplyToJobInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountJobApplication extends string | AccountMeta<string> = string, TAccountJobPosting extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountAgentOwner extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
744
|
-
TAccountJobApplication extends string ? WritableAccount<TAccountJobApplication> : TAccountJobApplication,
|
|
745
|
-
TAccountJobPosting extends string ? WritableAccount<TAccountJobPosting> : TAccountJobPosting,
|
|
746
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
747
|
-
TAccountAgentOwner extends string ? WritableSignerAccount<TAccountAgentOwner> & AccountSignerMeta<TAccountAgentOwner> : TAccountAgentOwner,
|
|
748
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
749
|
-
...TRemainingAccounts
|
|
750
|
-
]>;
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
754
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
755
|
-
* to add features, then rerun Codama to update it.
|
|
707
|
+
* Reduces RPC calls by caching account data and PDA derivations
|
|
708
|
+
* with commitment-level aware TTLs.
|
|
756
709
|
*
|
|
757
|
-
* @
|
|
710
|
+
* @module CacheManager
|
|
758
711
|
*/
|
|
759
712
|
|
|
760
|
-
type ApproveExtensionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountExtension extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountClock extends string | AccountMeta<string> = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
761
|
-
TAccountExtension extends string ? WritableAccount<TAccountExtension> : TAccountExtension,
|
|
762
|
-
TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
763
|
-
TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock,
|
|
764
|
-
...TRemainingAccounts
|
|
765
|
-
]>;
|
|
766
|
-
|
|
767
713
|
/**
|
|
768
|
-
*
|
|
769
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
770
|
-
* to add features, then rerun Codama to update it.
|
|
771
|
-
*
|
|
772
|
-
* @see https://github.com/codama-idl/codama
|
|
714
|
+
* Cache configuration options
|
|
773
715
|
*/
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
716
|
+
interface CacheConfig {
|
|
717
|
+
/** Enable caching (default: false, opt-in) */
|
|
718
|
+
enabled?: boolean;
|
|
719
|
+
/** Maximum cache entries (default: 1000) */
|
|
720
|
+
maxSize?: number;
|
|
721
|
+
/** Custom TTL overrides (milliseconds) */
|
|
722
|
+
ttlOverrides?: {
|
|
723
|
+
processed?: number;
|
|
724
|
+
confirmed?: number;
|
|
725
|
+
finalized?: number;
|
|
726
|
+
};
|
|
727
|
+
}
|
|
783
728
|
/**
|
|
784
|
-
*
|
|
785
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
786
|
-
* to add features, then rerun Codama to update it.
|
|
729
|
+
* CacheManager handles slot-aware caching for RPC results
|
|
787
730
|
*
|
|
788
|
-
*
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
731
|
+
* Features:
|
|
732
|
+
* - Commitment-level TTLs (finalized=30s, confirmed=2s, processed=500ms)
|
|
733
|
+
* - Indefinite PDA caching (deterministic addresses)
|
|
734
|
+
* - LRU eviction policy
|
|
735
|
+
* - Opt-in (disabled by default)
|
|
736
|
+
*/
|
|
737
|
+
declare class CacheManager {
|
|
738
|
+
private accountCache;
|
|
739
|
+
private pdaCache;
|
|
740
|
+
private config;
|
|
741
|
+
private ttls;
|
|
742
|
+
constructor(config?: CacheConfig);
|
|
743
|
+
/**
|
|
744
|
+
* Check if caching is enabled
|
|
745
|
+
*/
|
|
746
|
+
isEnabled(): boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Get cached account data
|
|
749
|
+
*
|
|
750
|
+
* @param address - Account address
|
|
751
|
+
* @param commitment - Commitment level
|
|
752
|
+
* @param currentSlot - Current blockchain slot (for staleness check)
|
|
753
|
+
* @returns Cached data or undefined
|
|
754
|
+
*/
|
|
755
|
+
getAccount<T>(address: Address$1, commitment: Commitment$1, currentSlot?: number): T | undefined;
|
|
756
|
+
/**
|
|
757
|
+
* Cache account data
|
|
758
|
+
*
|
|
759
|
+
* @param address - Account address
|
|
760
|
+
* @param data - Account data to cache
|
|
761
|
+
* @param commitment - Commitment level
|
|
762
|
+
* @param slot - Blockchain slot when data was fetched
|
|
763
|
+
*/
|
|
764
|
+
setAccount<T>(address: Address$1, data: T, commitment: Commitment$1, slot: number): void;
|
|
765
|
+
/**
|
|
766
|
+
* Get cached PDA
|
|
767
|
+
*
|
|
768
|
+
* PDAs are cached indefinitely as they're deterministic.
|
|
769
|
+
*
|
|
770
|
+
* @param seeds - Serialized seed components
|
|
771
|
+
* @returns Cached PDA or undefined
|
|
772
|
+
*/
|
|
773
|
+
getPDA(seeds: string): Address$1 | undefined;
|
|
774
|
+
/**
|
|
775
|
+
* Cache PDA derivation
|
|
776
|
+
*
|
|
777
|
+
* @param seeds - Serialized seed components (use JSON.stringify for consistency)
|
|
778
|
+
* @param pda - Derived PDA address
|
|
779
|
+
*/
|
|
780
|
+
setPDA(seeds: string, pda: Address$1): void;
|
|
781
|
+
/**
|
|
782
|
+
* Invalidate account cache entry
|
|
783
|
+
*
|
|
784
|
+
* @param address - Account address to invalidate
|
|
785
|
+
* @param commitment - Optional commitment level (invalidates all if not specified)
|
|
786
|
+
*/
|
|
787
|
+
invalidateAccount(address: Address$1, commitment?: Commitment$1): void;
|
|
788
|
+
/**
|
|
789
|
+
* Clear all caches
|
|
790
|
+
*/
|
|
791
|
+
clear(): void;
|
|
792
|
+
/**
|
|
793
|
+
* Get cache statistics
|
|
794
|
+
*
|
|
795
|
+
* @returns Cache size and hit/miss stats
|
|
796
|
+
*/
|
|
797
|
+
getStats(): {
|
|
798
|
+
accountCache: {
|
|
799
|
+
size: number;
|
|
800
|
+
max: number;
|
|
801
|
+
};
|
|
802
|
+
pdaCache: {
|
|
803
|
+
size: number;
|
|
804
|
+
max: number;
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
}
|
|
797
808
|
|
|
798
809
|
/**
|
|
799
|
-
*
|
|
800
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
801
|
-
* to add features, then rerun Codama to update it.
|
|
802
|
-
*
|
|
803
|
-
* @see https://github.com/codama-idl/codama
|
|
810
|
+
* IPFS configuration and types for GhostSpeak SDK
|
|
804
811
|
*/
|
|
805
|
-
|
|
806
|
-
type CreateServiceAuctionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountClock extends string | AccountMeta<string> = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
807
|
-
TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction,
|
|
808
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
809
|
-
TAccountUserRegistry extends string ? ReadonlyAccount<TAccountUserRegistry> : TAccountUserRegistry,
|
|
810
|
-
TAccountCreator extends string ? WritableSignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator,
|
|
811
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
812
|
-
TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock,
|
|
813
|
-
...TRemainingAccounts
|
|
814
|
-
]>;
|
|
815
|
-
|
|
816
812
|
/**
|
|
817
|
-
*
|
|
818
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
819
|
-
* to add features, then rerun Codama to update it.
|
|
820
|
-
*
|
|
821
|
-
* @see https://github.com/codama-idl/codama
|
|
822
|
-
*/
|
|
823
|
-
|
|
824
|
-
type CreateServiceListingInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountServiceListing extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountClock extends string | AccountMeta<string> = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
825
|
-
TAccountServiceListing extends string ? WritableAccount<TAccountServiceListing> : TAccountServiceListing,
|
|
826
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
827
|
-
TAccountUserRegistry extends string ? WritableAccount<TAccountUserRegistry> : TAccountUserRegistry,
|
|
828
|
-
TAccountCreator extends string ? WritableSignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator,
|
|
829
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
830
|
-
TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock,
|
|
831
|
-
...TRemainingAccounts
|
|
832
|
-
]>;
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
836
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
837
|
-
* to add features, then rerun Codama to update it.
|
|
838
|
-
*
|
|
839
|
-
* @see https://github.com/codama-idl/codama
|
|
840
|
-
*/
|
|
841
|
-
|
|
842
|
-
type CreateToken2022MintInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountRent extends string | AccountMeta<string> = "SysvarRent111111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
843
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
844
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
845
|
-
TAccountMint extends string ? WritableSignerAccount<TAccountMint> & AccountSignerMeta<TAccountMint> : TAccountMint,
|
|
846
|
-
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
847
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
848
|
-
TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent,
|
|
849
|
-
...TRemainingAccounts
|
|
850
|
-
]>;
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
854
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
855
|
-
* to add features, then rerun Codama to update it.
|
|
856
|
-
*
|
|
857
|
-
* @see https://github.com/codama-idl/codama
|
|
858
|
-
*/
|
|
859
|
-
|
|
860
|
-
type DelegateVoteInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountDelegator extends string | AccountMeta<string> = string, TAccountDelegate extends string | AccountMeta<string> = string, TAccountDelegatorTokenAccount extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
861
|
-
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
862
|
-
TAccountDelegator extends string ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator> : TAccountDelegator,
|
|
863
|
-
TAccountDelegate extends string ? ReadonlyAccount<TAccountDelegate> : TAccountDelegate,
|
|
864
|
-
TAccountDelegatorTokenAccount extends string ? ReadonlyAccount<TAccountDelegatorTokenAccount> : TAccountDelegatorTokenAccount,
|
|
865
|
-
...TRemainingAccounts
|
|
866
|
-
]>;
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
870
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
871
|
-
* to add features, then rerun Codama to update it.
|
|
872
|
-
*
|
|
873
|
-
* @see https://github.com/codama-idl/codama
|
|
874
|
-
*/
|
|
875
|
-
|
|
876
|
-
type ExecuteProposalInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountExecutor extends string | AccountMeta<string> = string, TAccountTargetProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
877
|
-
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
878
|
-
TAccountExecutor extends string ? WritableSignerAccount<TAccountExecutor> & AccountSignerMeta<TAccountExecutor> : TAccountExecutor,
|
|
879
|
-
TAccountTargetProgram extends string ? ReadonlyAccount<TAccountTargetProgram> : TAccountTargetProgram,
|
|
880
|
-
...TRemainingAccounts
|
|
881
|
-
]>;
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
885
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
886
|
-
* to add features, then rerun Codama to update it.
|
|
887
|
-
*
|
|
888
|
-
* @see https://github.com/codama-idl/codama
|
|
889
|
-
*/
|
|
890
|
-
|
|
891
|
-
type FinalizeAuctionInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TAccountClock extends string | AccountMeta<string> = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
892
|
-
TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction,
|
|
893
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
894
|
-
TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock,
|
|
895
|
-
...TRemainingAccounts
|
|
896
|
-
]>;
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
900
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
901
|
-
* to add features, then rerun Codama to update it.
|
|
902
|
-
*
|
|
903
|
-
* @see https://github.com/codama-idl/codama
|
|
904
|
-
*/
|
|
905
|
-
|
|
906
|
-
type InitializeConfidentialTransferMintInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
907
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
908
|
-
TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint,
|
|
909
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
910
|
-
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
911
|
-
...TRemainingAccounts
|
|
912
|
-
]>;
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
916
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
917
|
-
* to add features, then rerun Codama to update it.
|
|
918
|
-
*
|
|
919
|
-
* @see https://github.com/codama-idl/codama
|
|
920
|
-
*/
|
|
921
|
-
|
|
922
|
-
type InitializeDefaultAccountStateInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
923
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
924
|
-
TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint,
|
|
925
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
926
|
-
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
927
|
-
...TRemainingAccounts
|
|
928
|
-
]>;
|
|
929
|
-
|
|
930
|
-
/**
|
|
931
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
932
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
933
|
-
* to add features, then rerun Codama to update it.
|
|
934
|
-
*
|
|
935
|
-
* @see https://github.com/codama-idl/codama
|
|
936
|
-
*/
|
|
937
|
-
|
|
938
|
-
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<[
|
|
939
|
-
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
940
|
-
TAccountProposer extends string ? WritableSignerAccount<TAccountProposer> & AccountSignerMeta<TAccountProposer> : TAccountProposer,
|
|
941
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
942
|
-
...TRemainingAccounts
|
|
943
|
-
]>;
|
|
944
|
-
|
|
945
|
-
/**
|
|
946
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
947
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
948
|
-
* to add features, then rerun Codama to update it.
|
|
949
|
-
*
|
|
950
|
-
* @see https://github.com/codama-idl/codama
|
|
951
|
-
*/
|
|
952
|
-
|
|
953
|
-
type InitializeInterestBearingConfigInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountRateAuthority extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
954
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
955
|
-
TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint,
|
|
956
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
957
|
-
TAccountRateAuthority extends string ? ReadonlyAccount<TAccountRateAuthority> : TAccountRateAuthority,
|
|
958
|
-
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
959
|
-
...TRemainingAccounts
|
|
960
|
-
]>;
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
964
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
965
|
-
* to add features, then rerun Codama to update it.
|
|
966
|
-
*
|
|
967
|
-
* @see https://github.com/codama-idl/codama
|
|
968
|
-
*/
|
|
969
|
-
|
|
970
|
-
type InitializeMintCloseAuthorityInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountMint extends string | AccountMeta<string> = string, TAccountAgent extends string | AccountMeta<string> = string, TAccountCloseAuthority extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
971
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
972
|
-
TAccountMint extends string ? WritableAccount<TAccountMint> : TAccountMint,
|
|
973
|
-
TAccountAgent extends string ? ReadonlyAccount<TAccountAgent> : TAccountAgent,
|
|
974
|
-
TAccountCloseAuthority extends string ? ReadonlyAccount<TAccountCloseAuthority> : TAccountCloseAuthority,
|
|
975
|
-
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
976
|
-
...TRemainingAccounts
|
|
977
|
-
]>;
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
981
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
982
|
-
* to add features, then rerun Codama to update it.
|
|
983
|
-
*
|
|
984
|
-
* @see https://github.com/codama-idl/codama
|
|
985
|
-
*/
|
|
986
|
-
|
|
987
|
-
type PlaceAuctionBidInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAuction extends string | AccountMeta<string> = string, TAccountUserRegistry extends string | AccountMeta<string> = string, TAccountBidder extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TAccountClock extends string | AccountMeta<string> = "SysvarC1ock11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
988
|
-
TAccountAuction extends string ? WritableAccount<TAccountAuction> : TAccountAuction,
|
|
989
|
-
TAccountUserRegistry extends string ? ReadonlyAccount<TAccountUserRegistry> : TAccountUserRegistry,
|
|
990
|
-
TAccountBidder extends string ? WritableSignerAccount<TAccountBidder> & AccountSignerMeta<TAccountBidder> : TAccountBidder,
|
|
991
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
992
|
-
TAccountClock extends string ? ReadonlyAccount<TAccountClock> : TAccountClock,
|
|
993
|
-
...TRemainingAccounts
|
|
994
|
-
]>;
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
998
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
999
|
-
* to add features, then rerun Codama to update it.
|
|
1000
|
-
*
|
|
1001
|
-
* @see https://github.com/codama-idl/codama
|
|
1002
|
-
*/
|
|
1003
|
-
|
|
1004
|
-
type PurchaseServiceInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountServicePurchase extends string | AccountMeta<string> = string, TAccountServiceListing extends string | AccountMeta<string> = string, TAccountBuyer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
1005
|
-
TAccountServicePurchase extends string ? WritableAccount<TAccountServicePurchase> : TAccountServicePurchase,
|
|
1006
|
-
TAccountServiceListing extends string ? WritableAccount<TAccountServiceListing> : TAccountServiceListing,
|
|
1007
|
-
TAccountBuyer extends string ? WritableSignerAccount<TAccountBuyer> & AccountSignerMeta<TAccountBuyer> : TAccountBuyer,
|
|
1008
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
1009
|
-
...TRemainingAccounts
|
|
1010
|
-
]>;
|
|
1011
|
-
|
|
1012
|
-
/**
|
|
1013
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
1014
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1015
|
-
* to add features, then rerun Codama to update it.
|
|
1016
|
-
*
|
|
1017
|
-
* @see https://github.com/codama-idl/codama
|
|
1018
|
-
*/
|
|
1019
|
-
|
|
1020
|
-
type TallyVotesInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountProposal extends string | AccountMeta<string> = string, TAccountAuthority extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
1021
|
-
TAccountProposal extends string ? WritableAccount<TAccountProposal> : TAccountProposal,
|
|
1022
|
-
TAccountAuthority extends string ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority,
|
|
1023
|
-
...TRemainingAccounts
|
|
1024
|
-
]>;
|
|
1025
|
-
|
|
1026
|
-
/**
|
|
1027
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
1028
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1029
|
-
* to add features, then rerun Codama to update it.
|
|
1030
|
-
*
|
|
1031
|
-
* @see https://github.com/codama-idl/codama
|
|
1032
|
-
*/
|
|
1033
|
-
|
|
1034
|
-
type UpdateAgentServiceInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAgent extends string | AccountMeta<string> = string, TAccountOwner extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
1035
|
-
TAccountAgent extends string ? WritableAccount<TAccountAgent> : TAccountAgent,
|
|
1036
|
-
TAccountOwner extends string ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner,
|
|
1037
|
-
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
1038
|
-
...TRemainingAccounts
|
|
1039
|
-
]>;
|
|
1040
|
-
|
|
1041
|
-
/**
|
|
1042
|
-
* IPFS configuration and types for GhostSpeak SDK
|
|
1043
|
-
*/
|
|
1044
|
-
/**
|
|
1045
|
-
* IPFS provider configuration
|
|
813
|
+
* IPFS provider configuration
|
|
1046
814
|
*/
|
|
1047
815
|
interface IPFSProviderConfig {
|
|
1048
816
|
/** Provider name */
|
|
@@ -1086,6 +854,282 @@ interface IPFSConfig {
|
|
|
1086
854
|
cacheTTL?: number;
|
|
1087
855
|
}
|
|
1088
856
|
|
|
857
|
+
/**
|
|
858
|
+
* Reputation Tags System
|
|
859
|
+
*
|
|
860
|
+
* Granular tagging system for agent reputation with confidence scoring.
|
|
861
|
+
* Tags are automatically assigned based on metrics and evidence strength.
|
|
862
|
+
*
|
|
863
|
+
* Three tag categories:
|
|
864
|
+
* - Skill Tags: Technical capabilities and domain expertise
|
|
865
|
+
* - Behavior Tags: Service quality patterns and reliability
|
|
866
|
+
* - Compliance Tags: Regulatory and security compliance status
|
|
867
|
+
*/
|
|
868
|
+
/**
|
|
869
|
+
* Tag confidence score (basis points)
|
|
870
|
+
* 0-10000 where 10000 = 100% confidence
|
|
871
|
+
*/
|
|
872
|
+
interface TagScore {
|
|
873
|
+
/** Tag identifier (e.g., "fast-responder", "defi-expert") */
|
|
874
|
+
tagName: string;
|
|
875
|
+
/** Confidence level in basis points (0-10000) */
|
|
876
|
+
confidence: number;
|
|
877
|
+
/** Number of supporting data points */
|
|
878
|
+
evidenceCount: number;
|
|
879
|
+
/** Timestamp when tag was last updated */
|
|
880
|
+
lastUpdated: number;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Tag categories for organization
|
|
884
|
+
*/
|
|
885
|
+
declare enum TagCategory {
|
|
886
|
+
Skill = "skill",
|
|
887
|
+
Behavior = "behavior",
|
|
888
|
+
Compliance = "compliance"
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Reputation metrics for tag evaluation
|
|
892
|
+
*/
|
|
893
|
+
interface ReputationMetrics {
|
|
894
|
+
successfulPayments: bigint;
|
|
895
|
+
failedPayments: bigint;
|
|
896
|
+
totalResponseTime: bigint;
|
|
897
|
+
responseTimeCount: bigint;
|
|
898
|
+
totalDisputes: number;
|
|
899
|
+
disputesResolved: number;
|
|
900
|
+
totalRating: number;
|
|
901
|
+
totalRatingsCount: number;
|
|
902
|
+
createdAt: number;
|
|
903
|
+
updatedAt: number;
|
|
904
|
+
avgResponseTime: number;
|
|
905
|
+
successRate: number;
|
|
906
|
+
avgRating: number;
|
|
907
|
+
disputeResolutionRate: number;
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Tag filtering options
|
|
911
|
+
*/
|
|
912
|
+
interface TagFilters {
|
|
913
|
+
/** Filter by category */
|
|
914
|
+
category?: TagCategory;
|
|
915
|
+
/** Minimum confidence threshold */
|
|
916
|
+
minConfidence?: number;
|
|
917
|
+
/** Maximum age in seconds */
|
|
918
|
+
maxAge?: number;
|
|
919
|
+
/** Include only active tags */
|
|
920
|
+
activeOnly?: boolean;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Tag query result
|
|
924
|
+
*/
|
|
925
|
+
interface TagQueryResult {
|
|
926
|
+
/** All tags */
|
|
927
|
+
allTags: string[];
|
|
928
|
+
/** Skill tags */
|
|
929
|
+
skillTags: string[];
|
|
930
|
+
/** Behavior tags */
|
|
931
|
+
behaviorTags: string[];
|
|
932
|
+
/** Compliance tags */
|
|
933
|
+
complianceTags: string[];
|
|
934
|
+
/** Tag scores */
|
|
935
|
+
tagScores: TagScore[];
|
|
936
|
+
/** Last updated timestamp */
|
|
937
|
+
lastUpdated: number;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Privacy mode for reputation display
|
|
942
|
+
*
|
|
943
|
+
* Determines how much reputation information is publicly visible.
|
|
944
|
+
*/
|
|
945
|
+
declare enum PrivacyMode {
|
|
946
|
+
/** Full disclosure - all reputation data is public */
|
|
947
|
+
Public = "Public",
|
|
948
|
+
/** Show only reputation tier (Bronze/Silver/Gold/Platinum) */
|
|
949
|
+
TierOnly = "TierOnly",
|
|
950
|
+
/** Show score range bucket (e.g., 750-850) */
|
|
951
|
+
RangeOnly = "RangeOnly",
|
|
952
|
+
/** Custom selective disclosure */
|
|
953
|
+
Custom = "Custom",
|
|
954
|
+
/** Fully confidential - ZK proofs required */
|
|
955
|
+
Confidential = "Confidential"
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Visibility level for individual metrics
|
|
959
|
+
*/
|
|
960
|
+
declare enum VisibilityLevel {
|
|
961
|
+
/** Visible to everyone */
|
|
962
|
+
Public = "Public",
|
|
963
|
+
/** Visible only to authorized viewers */
|
|
964
|
+
Private = "Private",
|
|
965
|
+
/** Visible only with ZK proof */
|
|
966
|
+
ZKProof = "ZKProof"
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Reputation tier levels (for tier-only privacy mode)
|
|
970
|
+
*/
|
|
971
|
+
declare enum ReputationTier$1 {
|
|
972
|
+
None = "None",
|
|
973
|
+
Bronze = "Bronze",
|
|
974
|
+
Silver = "Silver",
|
|
975
|
+
Gold = "Gold",
|
|
976
|
+
Platinum = "Platinum"
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Score range buckets (for range-only privacy mode)
|
|
980
|
+
*/
|
|
981
|
+
declare enum ScoreRange {
|
|
982
|
+
VeryLow = "VeryLow",// 0-2000
|
|
983
|
+
Low = "Low",// 2000-5000
|
|
984
|
+
Medium = "Medium",// 5000-7500
|
|
985
|
+
High = "High",// 7500-9000
|
|
986
|
+
VeryHigh = "VeryHigh"
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Selective disclosure settings for individual metrics
|
|
990
|
+
*/
|
|
991
|
+
interface MetricVisibility {
|
|
992
|
+
/** Show exact Ghost Score */
|
|
993
|
+
showScore: VisibilityLevel;
|
|
994
|
+
/** Show total jobs completed */
|
|
995
|
+
showJobsCompleted: VisibilityLevel;
|
|
996
|
+
/** Show success rate percentage */
|
|
997
|
+
showSuccessRate: VisibilityLevel;
|
|
998
|
+
/** Show average response time */
|
|
999
|
+
showResponseTime: VisibilityLevel;
|
|
1000
|
+
/** Show dispute statistics */
|
|
1001
|
+
showDisputes: VisibilityLevel;
|
|
1002
|
+
/** Show earnings/payment data */
|
|
1003
|
+
showEarnings: VisibilityLevel;
|
|
1004
|
+
/** Show client ratings */
|
|
1005
|
+
showRatings: VisibilityLevel;
|
|
1006
|
+
/** Show badges earned */
|
|
1007
|
+
showBadges: VisibilityLevel;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Privacy settings for an agent's reputation
|
|
1011
|
+
*/
|
|
1012
|
+
interface PrivacySettings {
|
|
1013
|
+
/** Agent public key */
|
|
1014
|
+
agent: Address$1;
|
|
1015
|
+
/** Current privacy mode */
|
|
1016
|
+
mode: PrivacyMode;
|
|
1017
|
+
/** Metric-specific visibility settings */
|
|
1018
|
+
metricVisibility: MetricVisibility;
|
|
1019
|
+
/** List of addresses with viewing permission */
|
|
1020
|
+
authorizedViewers: Address$1[];
|
|
1021
|
+
/** Auto-grant access to clients who pay */
|
|
1022
|
+
autoGrantClients: boolean;
|
|
1023
|
+
/** Last updated timestamp */
|
|
1024
|
+
updatedAt: number;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Privacy preset configurations
|
|
1028
|
+
*/
|
|
1029
|
+
interface PrivacyPreset {
|
|
1030
|
+
/** Preset name */
|
|
1031
|
+
name: string;
|
|
1032
|
+
/** Privacy mode */
|
|
1033
|
+
mode: PrivacyMode;
|
|
1034
|
+
/** Metric visibility settings */
|
|
1035
|
+
metricVisibility: MetricVisibility;
|
|
1036
|
+
/** Auto-grant to clients */
|
|
1037
|
+
autoGrantClients: boolean;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Visible reputation data (filtered by privacy settings)
|
|
1041
|
+
*
|
|
1042
|
+
* This is the client-side type returned when fetching reputation
|
|
1043
|
+
* with privacy filters applied.
|
|
1044
|
+
*/
|
|
1045
|
+
interface VisibleReputation {
|
|
1046
|
+
/** Agent public key */
|
|
1047
|
+
agent: Address$1;
|
|
1048
|
+
/** Privacy mode applied */
|
|
1049
|
+
privacyMode: PrivacyMode;
|
|
1050
|
+
/** Exact score (only if visible) */
|
|
1051
|
+
exactScore?: number;
|
|
1052
|
+
/** Reputation tier (always visible in TierOnly mode) */
|
|
1053
|
+
tier?: ReputationTier$1;
|
|
1054
|
+
/** Score range (visible in RangeOnly mode) */
|
|
1055
|
+
scoreRange?: ScoreRange;
|
|
1056
|
+
/** Total jobs completed (if visible) */
|
|
1057
|
+
totalJobsCompleted?: number;
|
|
1058
|
+
/** Success rate percentage (if visible) */
|
|
1059
|
+
successRate?: number;
|
|
1060
|
+
/** Average response time in ms (if visible) */
|
|
1061
|
+
avgResponseTime?: number;
|
|
1062
|
+
/** Dispute statistics (if visible) */
|
|
1063
|
+
disputes?: {
|
|
1064
|
+
total: number;
|
|
1065
|
+
resolved: number;
|
|
1066
|
+
};
|
|
1067
|
+
/** Total earnings (if visible) */
|
|
1068
|
+
totalEarnings?: number;
|
|
1069
|
+
/** Average rating (if visible) */
|
|
1070
|
+
avgRating?: number;
|
|
1071
|
+
/** Badges earned (if visible) */
|
|
1072
|
+
badges?: string[];
|
|
1073
|
+
/** Whether viewer has full access */
|
|
1074
|
+
hasFullAccess: boolean;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Parameters for initializing privacy settings
|
|
1078
|
+
*/
|
|
1079
|
+
interface InitializePrivacyParams {
|
|
1080
|
+
/** Agent address to enable privacy for */
|
|
1081
|
+
agentAddress: Address$1;
|
|
1082
|
+
/** Initial privacy mode */
|
|
1083
|
+
mode?: PrivacyMode;
|
|
1084
|
+
/** Metric visibility settings */
|
|
1085
|
+
metricVisibility?: MetricVisibility;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Parameters for updating privacy mode
|
|
1089
|
+
*/
|
|
1090
|
+
interface UpdatePrivacyModeParams {
|
|
1091
|
+
/** Agent address */
|
|
1092
|
+
agentAddress: Address$1;
|
|
1093
|
+
/** New privacy mode */
|
|
1094
|
+
mode: PrivacyMode;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Parameters for setting metric visibility
|
|
1098
|
+
*/
|
|
1099
|
+
interface SetMetricVisibilityParams {
|
|
1100
|
+
/** Agent address */
|
|
1101
|
+
agentAddress: Address$1;
|
|
1102
|
+
/** Metric visibility settings */
|
|
1103
|
+
metricVisibility: MetricVisibility;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Parameters for granting viewer access
|
|
1107
|
+
*/
|
|
1108
|
+
interface GrantAccessParams {
|
|
1109
|
+
/** Agent address */
|
|
1110
|
+
agentAddress: Address$1;
|
|
1111
|
+
/** Viewer address to grant access */
|
|
1112
|
+
viewer: Address$1;
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Parameters for revoking viewer access
|
|
1116
|
+
*/
|
|
1117
|
+
interface RevokeAccessParams {
|
|
1118
|
+
/** Agent address */
|
|
1119
|
+
agentAddress: Address$1;
|
|
1120
|
+
/** Viewer address to revoke access */
|
|
1121
|
+
viewer: Address$1;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Parameters for applying a privacy preset
|
|
1125
|
+
*/
|
|
1126
|
+
interface ApplyPresetParams {
|
|
1127
|
+
/** Agent address */
|
|
1128
|
+
agentAddress: Address$1;
|
|
1129
|
+
/** Preset to apply */
|
|
1130
|
+
preset: PrivacyPreset;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1089
1133
|
/**
|
|
1090
1134
|
* Comprehensive Type System for GhostSpeak SDK
|
|
1091
1135
|
*
|
|
@@ -1256,6 +1300,13 @@ interface GhostSpeakConfig {
|
|
|
1256
1300
|
cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
|
|
1257
1301
|
rpcEndpoint?: string;
|
|
1258
1302
|
wsEndpoint?: string;
|
|
1303
|
+
/** Optional logger for debug output */
|
|
1304
|
+
logger?: {
|
|
1305
|
+
info: (...args: unknown[]) => void;
|
|
1306
|
+
error: (...args: unknown[]) => void;
|
|
1307
|
+
};
|
|
1308
|
+
/** Cache configuration for RPC result caching */
|
|
1309
|
+
cache?: CacheConfig;
|
|
1259
1310
|
/** Token 2022 configuration options */
|
|
1260
1311
|
token2022?: Token2022Config;
|
|
1261
1312
|
/** IPFS configuration for large content storage */
|
|
@@ -1480,6 +1531,11 @@ type IInstruction = Instruction;
|
|
|
1480
1531
|
declare abstract class BaseModule {
|
|
1481
1532
|
protected builder: InstructionBuilder;
|
|
1482
1533
|
protected config: GhostSpeakConfig;
|
|
1534
|
+
protected logger?: {
|
|
1535
|
+
info: (...args: unknown[]) => void;
|
|
1536
|
+
error: (...args: unknown[]) => void;
|
|
1537
|
+
};
|
|
1538
|
+
protected cacheManager: CacheManager;
|
|
1483
1539
|
private _debugMode;
|
|
1484
1540
|
constructor(config: GhostSpeakConfig);
|
|
1485
1541
|
/**
|
|
@@ -1523,11 +1579,11 @@ declare abstract class BaseModule {
|
|
|
1523
1579
|
*/
|
|
1524
1580
|
analyze(instructionName: string, instructionGetter: () => Promise<IInstruction> | IInstruction): Promise<unknown>;
|
|
1525
1581
|
/**
|
|
1526
|
-
* Get decoded account
|
|
1582
|
+
* Get decoded account (with optional caching)
|
|
1527
1583
|
*/
|
|
1528
1584
|
protected getAccount<T>(address: Address$1, decoderImportName: string): Promise<T | null>;
|
|
1529
1585
|
/**
|
|
1530
|
-
* Get multiple decoded accounts
|
|
1586
|
+
* Get multiple decoded accounts (with optional caching)
|
|
1531
1587
|
*/
|
|
1532
1588
|
protected getAccounts<T>(addresses: Address$1[], decoderImportName: string): Promise<(T | null)[]>;
|
|
1533
1589
|
/**
|
|
@@ -1561,408 +1617,365 @@ declare abstract class BaseModule {
|
|
|
1561
1617
|
* Get commitment level (public accessor)
|
|
1562
1618
|
*/
|
|
1563
1619
|
getCommitment(): Commitment;
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
interface Token2022MintData {
|
|
1567
|
-
mintAuthority: Address$1 | null;
|
|
1568
|
-
supply: bigint;
|
|
1569
|
-
decimals: number;
|
|
1570
|
-
isInitialized: boolean;
|
|
1571
|
-
freezeAuthority: Address$1 | null;
|
|
1572
|
-
extensions?: Extension[];
|
|
1573
|
-
}
|
|
1574
|
-
interface Extension {
|
|
1575
|
-
extensionType: string;
|
|
1576
|
-
data: Uint8Array;
|
|
1577
|
-
}
|
|
1578
|
-
/**
|
|
1579
|
-
* Token-2022 management module
|
|
1580
|
-
*
|
|
1581
|
-
* Provides high-level access to Token-2022 operations including:
|
|
1582
|
-
* - Mint creation with extensions
|
|
1583
|
-
* - Transfer fee configuration
|
|
1584
|
-
* - Confidential transfer setup
|
|
1585
|
-
* - Interest bearing configuration
|
|
1586
|
-
* - Default account state management
|
|
1587
|
-
*/
|
|
1588
|
-
declare class Token2022Module extends BaseModule {
|
|
1589
|
-
/**
|
|
1590
|
-
* Get create Token-2022 mint instruction
|
|
1591
|
-
*/
|
|
1592
|
-
getCreateToken2022MintInstruction(params: {
|
|
1593
|
-
authority: TransactionSigner;
|
|
1594
|
-
agent?: Address$1;
|
|
1595
|
-
mint: TransactionSigner;
|
|
1596
|
-
decimals: number;
|
|
1597
|
-
freezeAuthority: Address$1 | null;
|
|
1598
|
-
enableTransferFee: boolean;
|
|
1599
|
-
enableConfidentialTransfers: boolean;
|
|
1600
|
-
enableInterestBearing: boolean;
|
|
1601
|
-
transferFeeBasisPoints?: number | null;
|
|
1602
|
-
maximumFee?: bigint | null;
|
|
1603
|
-
transferFeeAuthority?: Address$1 | null;
|
|
1604
|
-
withdrawWithheldAuthority?: Address$1 | null;
|
|
1605
|
-
autoApproveNewAccounts?: boolean | null;
|
|
1606
|
-
auditorElgamalPubkey?: ReadonlyUint8Array | null;
|
|
1607
|
-
interestRate?: number | null;
|
|
1608
|
-
rateAuthority?: Address$1 | null;
|
|
1609
|
-
closeAuthority?: Address$1 | null;
|
|
1610
|
-
defaultAccountState?: AccountState | null;
|
|
1611
|
-
}): Promise<CreateToken2022MintInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, string, []>>;
|
|
1612
|
-
/**
|
|
1613
|
-
* Get initialize confidential transfer mint instruction
|
|
1614
|
-
*/
|
|
1615
|
-
getInitializeConfidentialTransferMintInstruction(params: {
|
|
1616
|
-
authority: TransactionSigner;
|
|
1617
|
-
mint: Address$1;
|
|
1618
|
-
autoApproveNewAccounts: boolean;
|
|
1619
|
-
auditorElgamalPubkey: ReadonlyUint8Array | null;
|
|
1620
|
-
}): Promise<InitializeConfidentialTransferMintInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, []>>;
|
|
1621
|
-
/**
|
|
1622
|
-
* Get initialize interest bearing config instruction
|
|
1623
|
-
*/
|
|
1624
|
-
getInitializeInterestBearingConfigInstruction(params: {
|
|
1625
|
-
mint: Address$1;
|
|
1626
|
-
authority: TransactionSigner;
|
|
1627
|
-
rate: number;
|
|
1628
|
-
rateAuthority: Address$1;
|
|
1629
|
-
}): Promise<InitializeInterestBearingConfigInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, []>>;
|
|
1630
|
-
/**
|
|
1631
|
-
* Get initialize mint close authority instruction
|
|
1632
|
-
*/
|
|
1633
|
-
getInitializeMintCloseAuthorityInstruction(params: {
|
|
1634
|
-
mint: Address$1;
|
|
1635
|
-
authority: TransactionSigner;
|
|
1636
|
-
closeAuthority: Address$1;
|
|
1637
|
-
}): Promise<InitializeMintCloseAuthorityInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, []>>;
|
|
1638
|
-
/**
|
|
1639
|
-
* Get initialize default account state instruction
|
|
1640
|
-
*/
|
|
1641
|
-
getInitializeDefaultAccountStateInstruction(params: {
|
|
1642
|
-
mint: Address$1;
|
|
1643
|
-
authority: TransactionSigner;
|
|
1644
|
-
state: AccountState;
|
|
1645
|
-
}): Promise<InitializeDefaultAccountStateInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, []>>;
|
|
1646
|
-
/**
|
|
1647
|
-
* Get approve extension instruction
|
|
1648
|
-
*/
|
|
1649
|
-
getApproveExtensionInstruction(params: {
|
|
1650
|
-
mint: Address$1;
|
|
1651
|
-
authority: TransactionSigner;
|
|
1652
|
-
extension: Address$1;
|
|
1653
|
-
}): ApproveExtensionInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, []>;
|
|
1654
|
-
/**
|
|
1655
|
-
* Create a basic Token-2022 mint
|
|
1656
|
-
*/
|
|
1657
|
-
createMint(params: {
|
|
1658
|
-
signer: TransactionSigner;
|
|
1659
|
-
agentAddress: Address$1;
|
|
1660
|
-
decimals: number;
|
|
1661
|
-
freezeAuthority?: Address$1;
|
|
1662
|
-
}): Promise<string>;
|
|
1663
|
-
createMintWithTransferFees(params: {
|
|
1664
|
-
signer: TransactionSigner;
|
|
1665
|
-
agentAddress: Address$1;
|
|
1666
|
-
decimals: number;
|
|
1667
|
-
transferFeeBasisPoints: number;
|
|
1668
|
-
maxFee: bigint;
|
|
1669
|
-
withdrawWithheldAuthority?: Address$1;
|
|
1670
|
-
}): Promise<string>;
|
|
1671
|
-
createMintWithConfidentialTransfers(params: {
|
|
1672
|
-
signer: TransactionSigner;
|
|
1673
|
-
agentAddress: Address$1;
|
|
1674
|
-
decimals: number;
|
|
1675
|
-
auditorElgamalPubkey?: ReadonlyUint8Array;
|
|
1676
|
-
autoApproveNewAccounts?: boolean;
|
|
1677
|
-
}): Promise<string>;
|
|
1678
|
-
createMintWithInterestBearing(params: {
|
|
1679
|
-
signer: TransactionSigner;
|
|
1680
|
-
agentAddress: Address$1;
|
|
1681
|
-
decimals: number;
|
|
1682
|
-
interestRate: number;
|
|
1683
|
-
rateAuthority?: Address$1;
|
|
1684
|
-
}): Promise<string>;
|
|
1685
1620
|
/**
|
|
1686
|
-
*
|
|
1621
|
+
* Invalidate cache for specific account
|
|
1687
1622
|
*/
|
|
1688
|
-
|
|
1689
|
-
signer: TransactionSigner;
|
|
1690
|
-
agentAddress: Address$1;
|
|
1691
|
-
decimals: number;
|
|
1692
|
-
transferFeeBasisPoints: number;
|
|
1693
|
-
maxFee: bigint;
|
|
1694
|
-
interestRate: number;
|
|
1695
|
-
autoApproveConfidential?: boolean;
|
|
1696
|
-
defaultAccountState?: AccountState;
|
|
1697
|
-
}): Promise<string>;
|
|
1698
|
-
/**
|
|
1699
|
-
* Get Token-2022 mint account
|
|
1700
|
-
*/
|
|
1701
|
-
getMint(address: Address$1): Promise<Token2022MintData | null>;
|
|
1623
|
+
invalidateCache(address: Address$1): void;
|
|
1702
1624
|
/**
|
|
1703
|
-
*
|
|
1625
|
+
* Clear all caches
|
|
1704
1626
|
*/
|
|
1705
|
-
|
|
1706
|
-
address: Address$1;
|
|
1707
|
-
data: Token2022MintData;
|
|
1708
|
-
}[]>;
|
|
1627
|
+
clearCache(): void;
|
|
1709
1628
|
/**
|
|
1710
|
-
* Get
|
|
1629
|
+
* Get cache statistics
|
|
1711
1630
|
*/
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1631
|
+
getCacheStats(): {
|
|
1632
|
+
accountCache: {
|
|
1633
|
+
size: number;
|
|
1634
|
+
max: number;
|
|
1635
|
+
};
|
|
1636
|
+
pdaCache: {
|
|
1637
|
+
size: number;
|
|
1638
|
+
max: number;
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1718
1641
|
}
|
|
1719
1642
|
|
|
1720
1643
|
/**
|
|
1721
|
-
*
|
|
1722
|
-
*
|
|
1723
|
-
* Provides high-level access to marketplace operations including:
|
|
1724
|
-
* - Service listings and purchases
|
|
1725
|
-
* - Job postings and applications
|
|
1726
|
-
* - Service auctions and bidding
|
|
1727
|
-
* - Marketplace queries and filtering
|
|
1644
|
+
* Simplified agent management using unified instruction pattern
|
|
1728
1645
|
*/
|
|
1729
|
-
declare class
|
|
1646
|
+
declare class AgentModule extends BaseModule {
|
|
1647
|
+
private ipfsUtils;
|
|
1648
|
+
constructor(config: GhostSpeakConfig & {
|
|
1649
|
+
ipfsConfig?: IPFSConfig;
|
|
1650
|
+
});
|
|
1730
1651
|
/**
|
|
1731
|
-
*
|
|
1652
|
+
* Register a new agent
|
|
1732
1653
|
*/
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
title: string;
|
|
1737
|
-
description: string;
|
|
1738
|
-
price: bigint;
|
|
1739
|
-
tokenMint: Address$1;
|
|
1740
|
-
serviceType: string;
|
|
1741
|
-
paymentToken: Address$1;
|
|
1742
|
-
estimatedDelivery: number;
|
|
1743
|
-
tags: string[];
|
|
1744
|
-
listingId: string;
|
|
1745
|
-
}): Promise<CreateServiceListingInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, string, []>>;
|
|
1746
|
-
/**
|
|
1747
|
-
* Get purchase service instruction
|
|
1748
|
-
*/
|
|
1749
|
-
getPurchaseServiceInstruction(params: {
|
|
1750
|
-
serviceListing: Address$1;
|
|
1751
|
-
servicePurchase: Address$1;
|
|
1752
|
-
buyer: TransactionSigner;
|
|
1753
|
-
listingId: number;
|
|
1754
|
-
quantity: number;
|
|
1755
|
-
requirements: string[];
|
|
1756
|
-
customInstructions: string;
|
|
1757
|
-
deadline: number;
|
|
1758
|
-
}): PurchaseServiceInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, []>;
|
|
1759
|
-
/**
|
|
1760
|
-
* Get create job posting instruction
|
|
1761
|
-
*/
|
|
1762
|
-
getCreateJobPostingInstruction(params: {
|
|
1763
|
-
jobPosting?: Address$1;
|
|
1764
|
-
employer: TransactionSigner;
|
|
1765
|
-
title: string;
|
|
1654
|
+
register(signer: TransactionSigner, params: {
|
|
1655
|
+
agentType: number;
|
|
1656
|
+
name: string;
|
|
1766
1657
|
description: string;
|
|
1767
|
-
requirements: string[];
|
|
1768
|
-
budget: number | bigint;
|
|
1769
|
-
deadline: number | bigint;
|
|
1770
|
-
skillsNeeded: string[];
|
|
1771
|
-
budgetMin: number | bigint;
|
|
1772
|
-
budgetMax: number | bigint;
|
|
1773
|
-
paymentToken: Address$1;
|
|
1774
|
-
jobType: string;
|
|
1775
|
-
experienceLevel: string;
|
|
1776
|
-
}): Promise<CreateJobPostingInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, []>>;
|
|
1777
|
-
/**
|
|
1778
|
-
* Get apply to job instruction
|
|
1779
|
-
*/
|
|
1780
|
-
getApplyToJobInstruction(params: {
|
|
1781
|
-
jobApplication?: Address$1;
|
|
1782
|
-
jobPosting: Address$1;
|
|
1783
|
-
agent: Address$1;
|
|
1784
|
-
agentOwner: TransactionSigner;
|
|
1785
|
-
coverLetter: string;
|
|
1786
|
-
proposedPrice: number | bigint;
|
|
1787
|
-
estimatedDuration: number;
|
|
1788
|
-
proposedRate: number | bigint;
|
|
1789
|
-
estimatedDelivery: number | bigint;
|
|
1790
|
-
portfolioItems: string[];
|
|
1791
|
-
}): Promise<ApplyToJobInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, []>>;
|
|
1792
|
-
/**
|
|
1793
|
-
* Get accept job application instruction
|
|
1794
|
-
*/
|
|
1795
|
-
getAcceptJobApplicationInstruction(params: {
|
|
1796
|
-
jobContract?: Address$1;
|
|
1797
|
-
jobPosting: Address$1;
|
|
1798
|
-
jobApplication: Address$1;
|
|
1799
|
-
employer: TransactionSigner;
|
|
1800
|
-
}): Promise<AcceptJobApplicationInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, []>>;
|
|
1801
|
-
/**
|
|
1802
|
-
* Get create service auction instruction
|
|
1803
|
-
*/
|
|
1804
|
-
getCreateServiceAuctionInstruction(params: {
|
|
1805
|
-
auction?: Address$1;
|
|
1806
|
-
agent: Address$1;
|
|
1807
|
-
userRegistry: Address$1;
|
|
1808
|
-
creator: TransactionSigner;
|
|
1809
|
-
systemProgram?: Address$1;
|
|
1810
|
-
clock?: Address$1;
|
|
1811
|
-
auctionType: AuctionType;
|
|
1812
|
-
startingPrice: bigint;
|
|
1813
|
-
reservePrice: bigint;
|
|
1814
|
-
isReserveHidden: boolean;
|
|
1815
|
-
currentBid: bigint;
|
|
1816
|
-
currentBidder: Address$1 | null;
|
|
1817
|
-
auctionEndTime: bigint;
|
|
1818
|
-
minimumBidIncrement: bigint;
|
|
1819
|
-
totalBids: number;
|
|
1820
|
-
dutchConfig: DutchAuctionConfig | null;
|
|
1821
|
-
}): Promise<CreateServiceAuctionInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, string, []>>;
|
|
1822
|
-
/**
|
|
1823
|
-
* Get place auction bid instruction
|
|
1824
|
-
*/
|
|
1825
|
-
getPlaceAuctionBidInstruction(params: {
|
|
1826
|
-
auction: Address$1;
|
|
1827
|
-
userRegistry: Address$1;
|
|
1828
|
-
bidder: TransactionSigner;
|
|
1829
|
-
systemProgram?: Address$1;
|
|
1830
|
-
clock?: Address$1;
|
|
1831
|
-
bidAmount: bigint;
|
|
1832
|
-
}): PlaceAuctionBidInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, string, []>;
|
|
1833
|
-
/**
|
|
1834
|
-
* Get finalize auction instruction
|
|
1835
|
-
*/
|
|
1836
|
-
getFinalizeAuctionInstruction(params: {
|
|
1837
|
-
auction: Address$1;
|
|
1838
|
-
authority: TransactionSigner;
|
|
1839
|
-
clock?: Address$1;
|
|
1840
|
-
}): FinalizeAuctionInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, []>;
|
|
1841
|
-
/**
|
|
1842
|
-
* Get update agent service instruction
|
|
1843
|
-
*/
|
|
1844
|
-
getUpdateAgentServiceInstruction(params: {
|
|
1845
|
-
agent: Address$1;
|
|
1846
|
-
owner: TransactionSigner;
|
|
1847
|
-
systemProgram?: Address$1;
|
|
1848
|
-
agentPubkey: Address$1;
|
|
1849
|
-
serviceEndpoint: string;
|
|
1850
|
-
isActive: boolean;
|
|
1851
|
-
lastUpdated: bigint;
|
|
1852
1658
|
metadataUri: string;
|
|
1853
|
-
|
|
1854
|
-
|
|
1659
|
+
agentId: string;
|
|
1660
|
+
pricingModel?: PricingModel;
|
|
1661
|
+
skipSimulation?: boolean;
|
|
1662
|
+
}): Promise<string>;
|
|
1855
1663
|
/**
|
|
1856
|
-
*
|
|
1664
|
+
* Register a compressed agent (5000x cheaper)
|
|
1857
1665
|
*/
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
title: string;
|
|
1666
|
+
registerCompressed(signer: TransactionSigner, params: {
|
|
1667
|
+
agentType: number;
|
|
1668
|
+
name: string;
|
|
1862
1669
|
description: string;
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1670
|
+
metadataUri: string;
|
|
1671
|
+
agentId: string;
|
|
1672
|
+
merkleTree: Address$1;
|
|
1673
|
+
treeConfig?: Address$1;
|
|
1674
|
+
pricingModel?: PricingModel;
|
|
1866
1675
|
}): Promise<string>;
|
|
1867
1676
|
/**
|
|
1868
|
-
*
|
|
1677
|
+
* Update agent metadata
|
|
1869
1678
|
*/
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1679
|
+
update(signer: TransactionSigner, params: {
|
|
1680
|
+
agentAddress: Address$1;
|
|
1681
|
+
metadataUri: string;
|
|
1682
|
+
agentType: number;
|
|
1683
|
+
agentId: string;
|
|
1684
|
+
name?: string | null;
|
|
1685
|
+
description?: string | null;
|
|
1686
|
+
pricingModel?: PricingModel;
|
|
1878
1687
|
}): Promise<string>;
|
|
1879
1688
|
/**
|
|
1880
|
-
*
|
|
1689
|
+
* Verify an agent
|
|
1881
1690
|
*/
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
auctionType: 'english' | 'dutch';
|
|
1691
|
+
verify(signer: TransactionSigner, params: {
|
|
1692
|
+
agentAddress: Address$1;
|
|
1693
|
+
agentPubkey: Address$1;
|
|
1694
|
+
serviceEndpoint: string;
|
|
1695
|
+
supportedCapabilities: Array<number | bigint>;
|
|
1696
|
+
verifiedAt: number | bigint;
|
|
1889
1697
|
}): Promise<string>;
|
|
1890
1698
|
/**
|
|
1891
|
-
*
|
|
1699
|
+
* Deactivate an agent
|
|
1892
1700
|
*/
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
getJobPosting(address: Address$1): Promise<JobPosting | null>;
|
|
1701
|
+
deactivate(signer: TransactionSigner, params: {
|
|
1702
|
+
agentAddress: Address$1;
|
|
1703
|
+
agentId: string;
|
|
1704
|
+
}): Promise<string>;
|
|
1898
1705
|
/**
|
|
1899
|
-
*
|
|
1706
|
+
* Activate an agent
|
|
1900
1707
|
*/
|
|
1901
|
-
|
|
1708
|
+
activate(signer: TransactionSigner, params: {
|
|
1709
|
+
agentAddress: Address$1;
|
|
1710
|
+
agentId: string;
|
|
1711
|
+
}): Promise<string>;
|
|
1902
1712
|
/**
|
|
1903
|
-
* Get
|
|
1713
|
+
* Get agent account
|
|
1904
1714
|
*/
|
|
1905
|
-
|
|
1715
|
+
getAgentAccount(address: Address$1): Promise<Agent$1 | null>;
|
|
1906
1716
|
/**
|
|
1907
|
-
* Get
|
|
1717
|
+
* Get all agents
|
|
1908
1718
|
*/
|
|
1909
|
-
|
|
1719
|
+
getAllAgents(): Promise<{
|
|
1720
|
+
address: Address$1;
|
|
1721
|
+
data: Agent$1;
|
|
1722
|
+
}[]>;
|
|
1910
1723
|
/**
|
|
1911
|
-
* Get
|
|
1724
|
+
* Get agents by type
|
|
1912
1725
|
*/
|
|
1913
|
-
|
|
1726
|
+
getAgentsByType(agentType: number): Promise<{
|
|
1914
1727
|
address: Address$1;
|
|
1915
|
-
data:
|
|
1728
|
+
data: Agent$1;
|
|
1916
1729
|
}[]>;
|
|
1917
1730
|
/**
|
|
1918
|
-
* Get
|
|
1731
|
+
* Get user's agents
|
|
1919
1732
|
*/
|
|
1920
|
-
|
|
1733
|
+
getUserAgents(authority: Address$1): Promise<{
|
|
1921
1734
|
address: Address$1;
|
|
1922
|
-
data:
|
|
1735
|
+
data: Agent$1;
|
|
1923
1736
|
}[]>;
|
|
1924
1737
|
/**
|
|
1925
|
-
*
|
|
1738
|
+
* Batch get multiple agent accounts
|
|
1739
|
+
*
|
|
1740
|
+
* Uses efficient batching (100 accounts per RPC call) with optional caching.
|
|
1741
|
+
*
|
|
1742
|
+
* @param addresses - Agent addresses to fetch
|
|
1743
|
+
* @param onProgress - Optional progress callback
|
|
1744
|
+
* @returns Array of agent accounts (null for non-existent)
|
|
1745
|
+
*
|
|
1746
|
+
* @example
|
|
1747
|
+
* ```typescript
|
|
1748
|
+
* const agents = await client.agents.batchGetAgents(
|
|
1749
|
+
* ['agent1...', 'agent2...', 'agent3...'],
|
|
1750
|
+
* (completed, total) => console.log(`${completed}/${total}`)
|
|
1751
|
+
* )
|
|
1752
|
+
* ```
|
|
1753
|
+
*/
|
|
1754
|
+
batchGetAgents(addresses: Address$1[], onProgress?: (completed: number, total: number) => void): Promise<(Agent$1 | null)[]>;
|
|
1755
|
+
/**
|
|
1756
|
+
* Batch get only existing agent accounts
|
|
1757
|
+
*
|
|
1758
|
+
* Filters out non-existent addresses.
|
|
1759
|
+
*
|
|
1760
|
+
* @param addresses - Agent addresses to fetch
|
|
1761
|
+
* @param onProgress - Optional progress callback
|
|
1762
|
+
* @returns Array of existing agents with their addresses
|
|
1763
|
+
*
|
|
1764
|
+
* @example
|
|
1765
|
+
* ```typescript
|
|
1766
|
+
* const existingAgents = await client.agents.batchGetExistingAgents(['addr1', 'addr2'])
|
|
1767
|
+
* // Returns: [{ address: 'addr1', account: Agent }, ...]
|
|
1768
|
+
* ```
|
|
1926
1769
|
*/
|
|
1927
|
-
|
|
1770
|
+
batchGetExistingAgents(addresses: Address$1[], onProgress?: (completed: number, total: number) => void): Promise<Array<{
|
|
1928
1771
|
address: Address$1;
|
|
1929
|
-
|
|
1930
|
-
}
|
|
1772
|
+
account: Agent$1;
|
|
1773
|
+
}>>;
|
|
1774
|
+
/**
|
|
1775
|
+
* Batch get and map agents to a simplified format
|
|
1776
|
+
*
|
|
1777
|
+
* Useful for creating agent summaries or lists.
|
|
1778
|
+
*
|
|
1779
|
+
* @param addresses - Agent addresses to fetch
|
|
1780
|
+
* @param mapper - Transform function
|
|
1781
|
+
* @returns Array of mapped results
|
|
1782
|
+
*
|
|
1783
|
+
* @example
|
|
1784
|
+
* ```typescript
|
|
1785
|
+
* const summaries = await client.agents.batchGetAndMapAgents(
|
|
1786
|
+
* addresses,
|
|
1787
|
+
* (agent, address) => agent ? {
|
|
1788
|
+
* address,
|
|
1789
|
+
* name: agent.name,
|
|
1790
|
+
* type: agent.agentType,
|
|
1791
|
+
* active: agent.isActive
|
|
1792
|
+
* } : null
|
|
1793
|
+
* )
|
|
1794
|
+
* ```
|
|
1795
|
+
*/
|
|
1796
|
+
batchGetAndMapAgents<R>(addresses: Address$1[], mapper: (agent: Agent$1 | null, address: Address$1, index: number) => R): Promise<R[]>;
|
|
1797
|
+
private deriveAgentPda;
|
|
1798
|
+
private deriveUserRegistryPda;
|
|
1799
|
+
private deriveTreeConfigPda;
|
|
1800
|
+
private get systemProgramId();
|
|
1801
|
+
private get compressionProgramId();
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Ghost Module - Claim and manage external AI agents
|
|
1806
|
+
*
|
|
1807
|
+
* This module provides methods for claiming "Ghost" agents (external agents
|
|
1808
|
+
* registered on x402 facilitators like PayAI) using the Solana Attestation
|
|
1809
|
+
* Service (SAS) for trustless ownership verification.
|
|
1810
|
+
*/
|
|
1811
|
+
|
|
1812
|
+
/**
|
|
1813
|
+
* Network identifier for DID generation
|
|
1814
|
+
*/
|
|
1815
|
+
type Network = 'devnet' | 'testnet' | 'mainnet-beta' | 'localnet';
|
|
1816
|
+
/**
|
|
1817
|
+
* Parameters for claiming a Ghost
|
|
1818
|
+
*/
|
|
1819
|
+
interface ClaimGhostParams {
|
|
1820
|
+
/** Agent account address (the external agent to claim) */
|
|
1821
|
+
agentAddress: Address$1;
|
|
1822
|
+
/** x402 payment address of the agent (used for PDA derivation) */
|
|
1823
|
+
x402PaymentAddress: Address$1;
|
|
1824
|
+
/** SAS Credential address (issuer) */
|
|
1825
|
+
sasCredential: Address$1;
|
|
1826
|
+
/** SAS Schema address (defines attestation structure) */
|
|
1827
|
+
sasSchema: Address$1;
|
|
1828
|
+
/** Network identifier for DID (e.g., "devnet", "mainnet-beta") */
|
|
1829
|
+
network: Network;
|
|
1830
|
+
/** Optional IPFS metadata URI (ipfs://...) */
|
|
1831
|
+
ipfsMetadataUri?: string;
|
|
1832
|
+
/** Optional GitHub username for social proof */
|
|
1833
|
+
githubUsername?: string;
|
|
1834
|
+
/** Optional Twitter handle for social proof */
|
|
1835
|
+
twitterHandle?: string;
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* Result of preparing a Ghost claim
|
|
1839
|
+
*/
|
|
1840
|
+
interface PreparedClaimResult {
|
|
1841
|
+
/** Derived attestation PDA */
|
|
1842
|
+
attestationPda: Address$1;
|
|
1843
|
+
/** Derived DID document PDA */
|
|
1844
|
+
didDocumentPda: Address$1;
|
|
1845
|
+
/** Attestation bump seed */
|
|
1846
|
+
attestationBump: number;
|
|
1847
|
+
/** DID document bump seed */
|
|
1848
|
+
didDocumentBump: number;
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Ghost Module - Manage external agent claims
|
|
1852
|
+
*/
|
|
1853
|
+
declare class GhostModule extends BaseModule {
|
|
1854
|
+
constructor(config: GhostSpeakConfig);
|
|
1855
|
+
/**
|
|
1856
|
+
* Claim ownership of a Ghost using SAS attestation
|
|
1857
|
+
*
|
|
1858
|
+
* This method performs the complete claim flow:
|
|
1859
|
+
* 1. Derives required PDAs (attestation, DID document)
|
|
1860
|
+
* 2. Builds the claim_ghost instruction
|
|
1861
|
+
* 3. Executes the transaction
|
|
1862
|
+
*
|
|
1863
|
+
* **Prerequisites:**
|
|
1864
|
+
* - The claimer must have already created a SAS attestation proving ownership
|
|
1865
|
+
* of the agent's x402_payment_address
|
|
1866
|
+
* - The agent must be in Unregistered or Registered status (not already claimed)
|
|
1867
|
+
*
|
|
1868
|
+
* **Results:**
|
|
1869
|
+
* - Agent status transitions to Claimed
|
|
1870
|
+
* - DID document is auto-created with did:sol:<network>:<address>
|
|
1871
|
+
* - Claimer becomes the owner of the agent
|
|
1872
|
+
*
|
|
1873
|
+
* @param claimer - Transaction signer (must own the SAS attestation)
|
|
1874
|
+
* @param params - Claim parameters
|
|
1875
|
+
* @returns Transaction signature
|
|
1876
|
+
*
|
|
1877
|
+
* @example
|
|
1878
|
+
* ```typescript
|
|
1879
|
+
* const signature = await client.ghosts.claim(signer, {
|
|
1880
|
+
* agentAddress: 'GhostAgent123...',
|
|
1881
|
+
* x402PaymentAddress: 'PaymentAddr456...',
|
|
1882
|
+
* sasCredential: 'SASCredential789...',
|
|
1883
|
+
* sasSchema: 'SASSchema012...',
|
|
1884
|
+
* network: 'devnet',
|
|
1885
|
+
* ipfsMetadataUri: 'ipfs://QmHash...',
|
|
1886
|
+
* githubUsername: 'myusername'
|
|
1887
|
+
* })
|
|
1888
|
+
* ```
|
|
1889
|
+
*/
|
|
1890
|
+
claim(claimer: TransactionSigner, params: ClaimGhostParams): Promise<string>;
|
|
1891
|
+
/**
|
|
1892
|
+
* Prepare a Ghost claim by deriving all required PDAs
|
|
1893
|
+
*
|
|
1894
|
+
* This is useful for:
|
|
1895
|
+
* - Pre-flight validation (checking if PDAs are correct)
|
|
1896
|
+
* - Building custom transactions with manual PDA management
|
|
1897
|
+
* - Debugging claim issues
|
|
1898
|
+
*
|
|
1899
|
+
* @param params - Claim parameters
|
|
1900
|
+
* @returns Prepared claim data with derived PDAs
|
|
1901
|
+
*
|
|
1902
|
+
* @example
|
|
1903
|
+
* ```typescript
|
|
1904
|
+
* const prepared = await client.ghosts.prepareClaim({
|
|
1905
|
+
* agentAddress: 'GhostAgent123...',
|
|
1906
|
+
* x402PaymentAddress: 'PaymentAddr456...',
|
|
1907
|
+
* sasCredential: 'SASCredential789...',
|
|
1908
|
+
* sasSchema: 'SASSchema012...',
|
|
1909
|
+
* network: 'devnet'
|
|
1910
|
+
* })
|
|
1911
|
+
*
|
|
1912
|
+
* console.log('Attestation PDA:', prepared.attestationPda)
|
|
1913
|
+
* console.log('DID Document PDA:', prepared.didDocumentPda)
|
|
1914
|
+
* ```
|
|
1915
|
+
*/
|
|
1916
|
+
prepareClaim(params: ClaimGhostParams): Promise<PreparedClaimResult>;
|
|
1917
|
+
/**
|
|
1918
|
+
* Get Ghost agent account
|
|
1919
|
+
*
|
|
1920
|
+
* @param address - Agent account address
|
|
1921
|
+
* @returns Agent account data or null if not found
|
|
1922
|
+
*/
|
|
1923
|
+
getGhostAgent(address: Address$1): Promise<Agent$1 | null>;
|
|
1931
1924
|
/**
|
|
1932
|
-
* Get
|
|
1925
|
+
* Get all Ghost agents (agents with type 10 - external x402 agents)
|
|
1926
|
+
*
|
|
1927
|
+
* @returns Array of Ghost agents
|
|
1933
1928
|
*/
|
|
1934
|
-
|
|
1929
|
+
getAllGhosts(): Promise<{
|
|
1935
1930
|
address: Address$1;
|
|
1936
|
-
data:
|
|
1931
|
+
data: Agent$1;
|
|
1937
1932
|
}[]>;
|
|
1938
1933
|
/**
|
|
1939
|
-
* Get
|
|
1934
|
+
* Get Ghost agents by type
|
|
1935
|
+
*
|
|
1936
|
+
* @param agentType - Agent type filter (default: 10 for x402 ghosts)
|
|
1937
|
+
* @returns Array of matching Ghost agents
|
|
1940
1938
|
*/
|
|
1941
|
-
|
|
1939
|
+
getGhostsByType(agentType?: number): Promise<{
|
|
1942
1940
|
address: Address$1;
|
|
1943
|
-
data:
|
|
1941
|
+
data: Agent$1;
|
|
1944
1942
|
}[]>;
|
|
1945
1943
|
/**
|
|
1946
|
-
* Get
|
|
1944
|
+
* Get claimed Ghosts by owner
|
|
1945
|
+
*
|
|
1946
|
+
* @param owner - Owner address
|
|
1947
|
+
* @returns Array of Ghost agents owned by the address
|
|
1947
1948
|
*/
|
|
1948
|
-
|
|
1949
|
+
getClaimedGhosts(owner: Address$1): Promise<{
|
|
1949
1950
|
address: Address$1;
|
|
1950
|
-
data:
|
|
1951
|
+
data: Agent$1;
|
|
1951
1952
|
}[]>;
|
|
1952
1953
|
/**
|
|
1953
|
-
*
|
|
1954
|
+
* Validate claim parameters
|
|
1955
|
+
*
|
|
1956
|
+
* Performs pre-flight checks to ensure claim will succeed:
|
|
1957
|
+
* - Agent exists and is in correct status
|
|
1958
|
+
* - Agent is not already claimed
|
|
1959
|
+
* - PDAs are correctly derived
|
|
1960
|
+
*
|
|
1961
|
+
* @param params - Claim parameters
|
|
1962
|
+
* @returns Validation result with error messages if any
|
|
1954
1963
|
*/
|
|
1955
|
-
|
|
1964
|
+
validateClaim(params: ClaimGhostParams): Promise<{
|
|
1965
|
+
valid: boolean;
|
|
1966
|
+
errors: string[];
|
|
1967
|
+
warnings: string[];
|
|
1968
|
+
}>;
|
|
1956
1969
|
/**
|
|
1957
|
-
*
|
|
1970
|
+
* Derive DID document PDA
|
|
1971
|
+
*
|
|
1972
|
+
* Pattern: ['did_document', x402_payment_address]
|
|
1973
|
+
*
|
|
1974
|
+
* @param x402PaymentAddress - Agent's x402 payment address
|
|
1975
|
+
* @returns [DID document PDA, bump]
|
|
1958
1976
|
*/
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
amount: bigint;
|
|
1962
|
-
}): Promise<string>;
|
|
1963
|
-
private deriveJobPostingPda;
|
|
1964
|
-
private deriveAuctionPda;
|
|
1965
|
-
private get nativeMint();
|
|
1977
|
+
private deriveDidDocumentPda;
|
|
1978
|
+
private get systemProgramId();
|
|
1966
1979
|
}
|
|
1967
1980
|
|
|
1968
1981
|
/**
|
|
@@ -1970,9 +1983,8 @@ declare class MarketplaceModule extends BaseModule {
|
|
|
1970
1983
|
*
|
|
1971
1984
|
* Provides high-level access to governance operations including:
|
|
1972
1985
|
* - Proposal creation and management
|
|
1973
|
-
*
|
|
1974
|
-
*
|
|
1975
|
-
* - Vote tallying and results
|
|
1986
|
+
*
|
|
1987
|
+
* NOTE: Voting, delegation, and execution are handled through protocol_config + multisig
|
|
1976
1988
|
*/
|
|
1977
1989
|
declare class GovernanceModule extends BaseModule {
|
|
1978
1990
|
/**
|
|
@@ -1986,45 +1998,7 @@ declare class GovernanceModule extends BaseModule {
|
|
|
1986
1998
|
proposalType: any;
|
|
1987
1999
|
executionParams: any;
|
|
1988
2000
|
proposalId: number | bigint;
|
|
1989
|
-
}): Promise<InitializeGovernanceProposalInstruction<Address$1<"
|
|
1990
|
-
/**
|
|
1991
|
-
* Get cast vote instruction
|
|
1992
|
-
*/
|
|
1993
|
-
getCastVoteInstruction(params: {
|
|
1994
|
-
proposal: Address$1;
|
|
1995
|
-
voter: TransactionSigner;
|
|
1996
|
-
voterTokenAccount: Address$1;
|
|
1997
|
-
delegateTokenAccount?: Address$1;
|
|
1998
|
-
voteChoice: VoteChoice;
|
|
1999
|
-
reasoning: string | null;
|
|
2000
|
-
}): CastVoteInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, []>;
|
|
2001
|
-
/**
|
|
2002
|
-
* Get delegate vote instruction
|
|
2003
|
-
*/
|
|
2004
|
-
getDelegateVoteInstruction(params: {
|
|
2005
|
-
proposal?: Address$1;
|
|
2006
|
-
delegator: TransactionSigner;
|
|
2007
|
-
delegate: Address$1;
|
|
2008
|
-
delegatorTokenAccount: Address$1;
|
|
2009
|
-
proposalId: number | bigint;
|
|
2010
|
-
scope: any;
|
|
2011
|
-
expiresAt: number | bigint | null;
|
|
2012
|
-
}): DelegateVoteInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, string, []>;
|
|
2013
|
-
/**
|
|
2014
|
-
* Get execute proposal instruction
|
|
2015
|
-
*/
|
|
2016
|
-
getExecuteProposalInstruction(params: {
|
|
2017
|
-
proposal: Address$1;
|
|
2018
|
-
executor: TransactionSigner;
|
|
2019
|
-
targetProgram: Address$1;
|
|
2020
|
-
}): ExecuteProposalInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, string, []>;
|
|
2021
|
-
/**
|
|
2022
|
-
* Get tally votes instruction
|
|
2023
|
-
*/
|
|
2024
|
-
getTallyVotesInstruction(params: {
|
|
2025
|
-
proposal: Address$1;
|
|
2026
|
-
authority: TransactionSigner;
|
|
2027
|
-
}): TallyVotesInstruction<Address$1<"GpvFxus2eecFKcqa2bhxXeRjpstPeCEJNX216TQCcNC9">, string, string, []>;
|
|
2001
|
+
}): Promise<InitializeGovernanceProposalInstruction<Address$1<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">, string, string, string, []>>;
|
|
2028
2002
|
/**
|
|
2029
2003
|
* Create a new governance proposal
|
|
2030
2004
|
*/
|
|
@@ -2036,40 +2010,6 @@ declare class GovernanceModule extends BaseModule {
|
|
|
2036
2010
|
votingDuration: number;
|
|
2037
2011
|
executionDelay?: number;
|
|
2038
2012
|
}): Promise<string>;
|
|
2039
|
-
/**
|
|
2040
|
-
* Cast a vote on a proposal
|
|
2041
|
-
*/
|
|
2042
|
-
vote(params: {
|
|
2043
|
-
signer: TransactionSigner;
|
|
2044
|
-
proposalAddress: Address$1;
|
|
2045
|
-
choice: 'yes' | 'no' | 'abstain';
|
|
2046
|
-
reasoning?: string;
|
|
2047
|
-
tokenAccount: Address$1;
|
|
2048
|
-
}): Promise<string>;
|
|
2049
|
-
/**
|
|
2050
|
-
* Delegate voting power to another address
|
|
2051
|
-
*/
|
|
2052
|
-
delegateVotingPower(params: {
|
|
2053
|
-
signer: TransactionSigner;
|
|
2054
|
-
delegate: Address$1;
|
|
2055
|
-
amount: bigint;
|
|
2056
|
-
tokenAccount: Address$1;
|
|
2057
|
-
}): Promise<string>;
|
|
2058
|
-
/**
|
|
2059
|
-
* Execute a passed proposal
|
|
2060
|
-
*/
|
|
2061
|
-
executeProposal(params: {
|
|
2062
|
-
signer: TransactionSigner;
|
|
2063
|
-
proposalAddress: Address$1;
|
|
2064
|
-
proposalId: string;
|
|
2065
|
-
}): Promise<string>;
|
|
2066
|
-
/**
|
|
2067
|
-
* Tally votes for a proposal
|
|
2068
|
-
*/
|
|
2069
|
-
tallyVotes(params: {
|
|
2070
|
-
signer: TransactionSigner;
|
|
2071
|
-
proposalAddress: Address$1;
|
|
2072
|
-
}): Promise<string>;
|
|
2073
2013
|
/**
|
|
2074
2014
|
* Get governance proposal account
|
|
2075
2015
|
*/
|
|
@@ -2096,14 +2036,13 @@ declare class GovernanceModule extends BaseModule {
|
|
|
2096
2036
|
data: GovernanceProposal;
|
|
2097
2037
|
}[]>;
|
|
2098
2038
|
private deriveProposalPda;
|
|
2099
|
-
private mapVoteChoice;
|
|
2100
2039
|
}
|
|
2101
2040
|
|
|
2102
2041
|
interface CreateMultisigParams {
|
|
2103
2042
|
multisigId: bigint;
|
|
2104
2043
|
threshold: number;
|
|
2105
2044
|
signers: Address$1[];
|
|
2106
|
-
config?: Partial<
|
|
2045
|
+
config?: Partial<MultisigTypeConfigArgs>;
|
|
2107
2046
|
owner: TransactionSigner;
|
|
2108
2047
|
}
|
|
2109
2048
|
interface MultisigProposalParams {
|
|
@@ -2115,13 +2054,6 @@ interface MultisigProposalParams {
|
|
|
2115
2054
|
proposalId: bigint;
|
|
2116
2055
|
proposer: TransactionSigner;
|
|
2117
2056
|
}
|
|
2118
|
-
interface ApproveProposalParams {
|
|
2119
|
-
proposalAddress: Address$1;
|
|
2120
|
-
voter: TransactionSigner;
|
|
2121
|
-
voterTokenAccount: Address$1;
|
|
2122
|
-
reasoning?: string;
|
|
2123
|
-
voteChoice?: VoteChoice;
|
|
2124
|
-
}
|
|
2125
2057
|
interface ExecuteProposalParams {
|
|
2126
2058
|
proposalAddress: Address$1;
|
|
2127
2059
|
executor: TransactionSigner;
|
|
@@ -2139,11 +2071,7 @@ declare class MultisigModule extends BaseModule {
|
|
|
2139
2071
|
*/
|
|
2140
2072
|
createProposal(params: MultisigProposalParams): Promise<string>;
|
|
2141
2073
|
/**
|
|
2142
|
-
*
|
|
2143
|
-
*/
|
|
2144
|
-
approveProposal(params: ApproveProposalParams): Promise<string>;
|
|
2145
|
-
/**
|
|
2146
|
-
* Execute a proposal
|
|
2074
|
+
* Execute a proposal (Note: Approval/voting removed, use protocol_config instead)
|
|
2147
2075
|
*/
|
|
2148
2076
|
executeProposal(params: ExecuteProposalParams): Promise<string>;
|
|
2149
2077
|
}
|
|
@@ -2154,11 +2082,405 @@ interface CrossmintClientOptions {
|
|
|
2154
2082
|
chain?: 'base-sepolia' | 'polygon-amoy' | 'ethereum-sepolia' | 'base' | 'polygon' | 'ethereum';
|
|
2155
2083
|
}
|
|
2156
2084
|
|
|
2085
|
+
/**
|
|
2086
|
+
* GhostSpeak DID (Decentralized Identifier) Types
|
|
2087
|
+
*
|
|
2088
|
+
* Implements the did:sol method for Solana-based DIDs following W3C standards.
|
|
2089
|
+
* Based on Identity.com's did:sol specification v3.0.
|
|
2090
|
+
*/
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Verification method type for DIDs
|
|
2094
|
+
*/
|
|
2095
|
+
declare enum VerificationMethodType {
|
|
2096
|
+
/** Ed25519 verification key (Solana native) */
|
|
2097
|
+
Ed25519VerificationKey2020 = "Ed25519VerificationKey2020",
|
|
2098
|
+
/** X25519 key agreement for encryption */
|
|
2099
|
+
X25519KeyAgreementKey2020 = "X25519KeyAgreementKey2020",
|
|
2100
|
+
/** Secp256k1 verification key (Ethereum compatibility) */
|
|
2101
|
+
EcdsaSecp256k1VerificationKey2019 = "EcdsaSecp256k1VerificationKey2019"
|
|
2102
|
+
}
|
|
2103
|
+
/**
|
|
2104
|
+
* Verification relationship types
|
|
2105
|
+
*/
|
|
2106
|
+
declare enum VerificationRelationship {
|
|
2107
|
+
/** Key can authenticate as the DID */
|
|
2108
|
+
Authentication = "authentication",
|
|
2109
|
+
/** Key can assert claims (issue credentials) */
|
|
2110
|
+
AssertionMethod = "assertionMethod",
|
|
2111
|
+
/** Key can perform key agreement (encryption) */
|
|
2112
|
+
KeyAgreement = "keyAgreement",
|
|
2113
|
+
/** Key can invoke capabilities (update DID document) */
|
|
2114
|
+
CapabilityInvocation = "capabilityInvocation",
|
|
2115
|
+
/** Key can delegate capabilities */
|
|
2116
|
+
CapabilityDelegation = "capabilityDelegation"
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Service endpoint type
|
|
2120
|
+
*/
|
|
2121
|
+
declare enum ServiceEndpointType {
|
|
2122
|
+
/** AI agent service endpoint */
|
|
2123
|
+
AIAgentService = "AIAgentService",
|
|
2124
|
+
/** Messaging service endpoint (DIDComm) */
|
|
2125
|
+
DIDCommMessaging = "DIDCommMessaging",
|
|
2126
|
+
/** Credential repository */
|
|
2127
|
+
CredentialRepository = "CredentialRepository",
|
|
2128
|
+
/** Linked domains verification */
|
|
2129
|
+
LinkedDomains = "LinkedDomains",
|
|
2130
|
+
/** Custom service type */
|
|
2131
|
+
Custom = "Custom"
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Verification method for DID document
|
|
2135
|
+
*
|
|
2136
|
+
* Represents a cryptographic key that can be used to verify
|
|
2137
|
+
* signatures or perform other cryptographic operations
|
|
2138
|
+
*/
|
|
2139
|
+
interface VerificationMethod {
|
|
2140
|
+
/** Method identifier (e.g., "key-1") */
|
|
2141
|
+
id: string;
|
|
2142
|
+
/** Type of verification method */
|
|
2143
|
+
methodType: VerificationMethodType;
|
|
2144
|
+
/** DID of the controller (usually the DID itself) */
|
|
2145
|
+
controller: string;
|
|
2146
|
+
/** Public key in multibase format (base58btc) */
|
|
2147
|
+
publicKeyMultibase: string;
|
|
2148
|
+
/** Verification relationships this key has */
|
|
2149
|
+
relationships: VerificationRelationship[];
|
|
2150
|
+
/** Creation timestamp */
|
|
2151
|
+
createdAt: number;
|
|
2152
|
+
/** Revoked flag */
|
|
2153
|
+
revoked: boolean;
|
|
2154
|
+
}
|
|
2155
|
+
/**
|
|
2156
|
+
* Service endpoint in DID document
|
|
2157
|
+
*/
|
|
2158
|
+
interface ServiceEndpoint {
|
|
2159
|
+
/** Service identifier (e.g., "agent-api") */
|
|
2160
|
+
id: string;
|
|
2161
|
+
/** Type of service */
|
|
2162
|
+
serviceType: ServiceEndpointType;
|
|
2163
|
+
/** Service endpoint URI */
|
|
2164
|
+
serviceEndpoint: string;
|
|
2165
|
+
/** Optional description */
|
|
2166
|
+
description: string;
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
* DID Document - main account for storing decentralized identifiers
|
|
2170
|
+
*
|
|
2171
|
+
* Follows W3C DID Core specification and did:sol method
|
|
2172
|
+
*/
|
|
2173
|
+
interface DidDocument {
|
|
2174
|
+
/** The DID string (e.g., "did:sol:devnet:HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH") */
|
|
2175
|
+
did: string;
|
|
2176
|
+
/** Controller of the DID (can update the document) */
|
|
2177
|
+
controller: Address$1;
|
|
2178
|
+
/** Verification methods (public keys) */
|
|
2179
|
+
verificationMethods: VerificationMethod[];
|
|
2180
|
+
/** Service endpoints */
|
|
2181
|
+
serviceEndpoints: ServiceEndpoint[];
|
|
2182
|
+
/** Context URIs (for W3C compatibility) */
|
|
2183
|
+
context: string[];
|
|
2184
|
+
/** Also known as (alternative DIDs) */
|
|
2185
|
+
alsoKnownAs: string[];
|
|
2186
|
+
/** DID document creation timestamp */
|
|
2187
|
+
createdAt: number;
|
|
2188
|
+
/** Last update timestamp */
|
|
2189
|
+
updatedAt: number;
|
|
2190
|
+
/** Version number (incremented on each update) */
|
|
2191
|
+
version: number;
|
|
2192
|
+
/** Deactivated flag */
|
|
2193
|
+
deactivated: boolean;
|
|
2194
|
+
/** Deactivation timestamp (if deactivated) */
|
|
2195
|
+
deactivatedAt?: number;
|
|
2196
|
+
/** PDA bump */
|
|
2197
|
+
bump: number;
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* W3C DID Document format for export
|
|
2201
|
+
* Compliant with W3C DID Core specification
|
|
2202
|
+
*/
|
|
2203
|
+
interface W3CDidDocument {
|
|
2204
|
+
'@context': string[];
|
|
2205
|
+
id: string;
|
|
2206
|
+
controller?: string | string[];
|
|
2207
|
+
verificationMethod: Array<{
|
|
2208
|
+
id: string;
|
|
2209
|
+
type: string;
|
|
2210
|
+
controller: string;
|
|
2211
|
+
publicKeyMultibase: string;
|
|
2212
|
+
}>;
|
|
2213
|
+
authentication?: Array<string | {
|
|
2214
|
+
id: string;
|
|
2215
|
+
type: string;
|
|
2216
|
+
controller: string;
|
|
2217
|
+
publicKeyMultibase: string;
|
|
2218
|
+
}>;
|
|
2219
|
+
assertionMethod?: string[];
|
|
2220
|
+
keyAgreement?: string[];
|
|
2221
|
+
capabilityInvocation?: string[];
|
|
2222
|
+
capabilityDelegation?: string[];
|
|
2223
|
+
service?: Array<{
|
|
2224
|
+
id: string;
|
|
2225
|
+
type: string;
|
|
2226
|
+
serviceEndpoint: string;
|
|
2227
|
+
description?: string;
|
|
2228
|
+
}>;
|
|
2229
|
+
alsoKnownAs?: string[];
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* Parameters for creating a DID document
|
|
2233
|
+
*/
|
|
2234
|
+
interface CreateDidDocumentParams {
|
|
2235
|
+
/** Controller public key */
|
|
2236
|
+
controller: Address$1;
|
|
2237
|
+
/** Initial verification methods */
|
|
2238
|
+
verificationMethods?: VerificationMethod[];
|
|
2239
|
+
/** Initial service endpoints */
|
|
2240
|
+
serviceEndpoints?: ServiceEndpoint[];
|
|
2241
|
+
/** Network (mainnet, devnet, testnet) */
|
|
2242
|
+
network?: 'mainnet' | 'devnet' | 'testnet';
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* Parameters for updating a DID document
|
|
2246
|
+
*/
|
|
2247
|
+
interface UpdateDidDocumentParams {
|
|
2248
|
+
/** DID document address */
|
|
2249
|
+
didDocument: Address$1;
|
|
2250
|
+
/** Verification method to add */
|
|
2251
|
+
addVerificationMethod?: VerificationMethod;
|
|
2252
|
+
/** Verification method ID to remove */
|
|
2253
|
+
removeVerificationMethodId?: string;
|
|
2254
|
+
/** Service endpoint to add */
|
|
2255
|
+
addServiceEndpoint?: ServiceEndpoint;
|
|
2256
|
+
/** Service endpoint ID to remove */
|
|
2257
|
+
removeServiceEndpointId?: string;
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Parameters for deactivating a DID document
|
|
2261
|
+
*/
|
|
2262
|
+
interface DeactivateDidDocumentParams {
|
|
2263
|
+
/** DID document address */
|
|
2264
|
+
didDocument: Address$1;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/**
|
|
2268
|
+
* GhostSpeak DID Helpers
|
|
2269
|
+
*
|
|
2270
|
+
* Utility functions for DID operations, validation, and W3C export
|
|
2271
|
+
*/
|
|
2272
|
+
|
|
2273
|
+
/**
|
|
2274
|
+
* Create a default Ed25519 verification method
|
|
2275
|
+
*
|
|
2276
|
+
* @param id - Method identifier (e.g., "key-1")
|
|
2277
|
+
* @param controller - Controller DID
|
|
2278
|
+
* @param publicKey - Public key (Address or base58 string)
|
|
2279
|
+
* @param relationships - Verification relationships
|
|
2280
|
+
* @returns Verification method object
|
|
2281
|
+
*/
|
|
2282
|
+
declare function createEd25519VerificationMethod(id: string, controller: string, publicKey: Address$1 | string, relationships?: VerificationRelationship[]): VerificationMethod;
|
|
2283
|
+
/**
|
|
2284
|
+
* Create a service endpoint
|
|
2285
|
+
*
|
|
2286
|
+
* @param id - Service identifier (e.g., "agent-api")
|
|
2287
|
+
* @param serviceType - Type of service
|
|
2288
|
+
* @param serviceEndpoint - Service endpoint URI
|
|
2289
|
+
* @param description - Optional description
|
|
2290
|
+
* @returns Service endpoint object
|
|
2291
|
+
*/
|
|
2292
|
+
declare function createServiceEndpoint(id: string, serviceType: string, serviceEndpoint: string, description?: string): ServiceEndpoint;
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* GhostSpeak DID Module
|
|
2296
|
+
*
|
|
2297
|
+
* Provides functionality for managing Decentralized Identifiers (DIDs)
|
|
2298
|
+
* following the W3C DID Core specification and did:sol method.
|
|
2299
|
+
*/
|
|
2300
|
+
|
|
2301
|
+
/**
|
|
2302
|
+
* DidModule - Manage decentralized identifiers on Solana
|
|
2303
|
+
*
|
|
2304
|
+
* @example
|
|
2305
|
+
* ```typescript
|
|
2306
|
+
* const client = new GhostSpeakClient({ cluster: 'devnet' })
|
|
2307
|
+
* const did = client.did
|
|
2308
|
+
*
|
|
2309
|
+
* // Create a DID
|
|
2310
|
+
* const signature = await did.create(signer, {
|
|
2311
|
+
* controller: signer.address,
|
|
2312
|
+
* network: 'devnet'
|
|
2313
|
+
* })
|
|
2314
|
+
*
|
|
2315
|
+
* // Resolve a DID
|
|
2316
|
+
* const didDoc = await did.resolve(signer.address)
|
|
2317
|
+
*
|
|
2318
|
+
* // Export as W3C format
|
|
2319
|
+
* const w3c = await did.exportW3C(signer.address)
|
|
2320
|
+
* ```
|
|
2321
|
+
*/
|
|
2322
|
+
declare class DidModule extends BaseModule {
|
|
2323
|
+
constructor(config: GhostSpeakConfig);
|
|
2324
|
+
/**
|
|
2325
|
+
* Create a new DID document
|
|
2326
|
+
*
|
|
2327
|
+
* @param signer - Transaction signer (will be the controller)
|
|
2328
|
+
* @param params - DID creation parameters
|
|
2329
|
+
* @returns Transaction signature
|
|
2330
|
+
*
|
|
2331
|
+
* @example
|
|
2332
|
+
* ```typescript
|
|
2333
|
+
* const signature = await didModule.create(signer, {
|
|
2334
|
+
* controller: signer.address,
|
|
2335
|
+
* network: 'devnet',
|
|
2336
|
+
* verificationMethods: [{
|
|
2337
|
+
* id: 'key-1',
|
|
2338
|
+
* methodType: VerificationMethodType.Ed25519VerificationKey2020,
|
|
2339
|
+
* controller: 'did:sol:devnet:...',
|
|
2340
|
+
* publicKeyMultibase: 'z...',
|
|
2341
|
+
* relationships: [VerificationRelationship.Authentication],
|
|
2342
|
+
* createdAt: Date.now() / 1000,
|
|
2343
|
+
* revoked: false
|
|
2344
|
+
* }]
|
|
2345
|
+
* })
|
|
2346
|
+
* ```
|
|
2347
|
+
*/
|
|
2348
|
+
create(signer: TransactionSigner, params: CreateDidDocumentParams): Promise<string>;
|
|
2349
|
+
/**
|
|
2350
|
+
* Update an existing DID document
|
|
2351
|
+
*
|
|
2352
|
+
* @param signer - Transaction signer (must be the controller)
|
|
2353
|
+
* @param params - Update parameters
|
|
2354
|
+
* @returns Transaction signature
|
|
2355
|
+
*
|
|
2356
|
+
* @example
|
|
2357
|
+
* ```typescript
|
|
2358
|
+
* const signature = await didModule.update(signer, {
|
|
2359
|
+
* didDocument: didPda,
|
|
2360
|
+
* addVerificationMethod: {
|
|
2361
|
+
* id: 'key-2',
|
|
2362
|
+
* methodType: VerificationMethodType.X25519KeyAgreementKey2020,
|
|
2363
|
+
* controller: 'did:sol:devnet:...',
|
|
2364
|
+
* publicKeyMultibase: 'z...',
|
|
2365
|
+
* relationships: [VerificationRelationship.KeyAgreement],
|
|
2366
|
+
* createdAt: Date.now() / 1000,
|
|
2367
|
+
* revoked: false
|
|
2368
|
+
* }
|
|
2369
|
+
* })
|
|
2370
|
+
* ```
|
|
2371
|
+
*/
|
|
2372
|
+
update(signer: TransactionSigner, params: UpdateDidDocumentParams): Promise<string>;
|
|
2373
|
+
/**
|
|
2374
|
+
* Deactivate a DID document (irreversible)
|
|
2375
|
+
*
|
|
2376
|
+
* @param signer - Transaction signer (must be the controller)
|
|
2377
|
+
* @param params - Deactivation parameters
|
|
2378
|
+
* @returns Transaction signature
|
|
2379
|
+
*
|
|
2380
|
+
* @example
|
|
2381
|
+
* ```typescript
|
|
2382
|
+
* const signature = await didModule.deactivate(signer, {
|
|
2383
|
+
* didDocument: didPda
|
|
2384
|
+
* })
|
|
2385
|
+
* ```
|
|
2386
|
+
*/
|
|
2387
|
+
deactivate(signer: TransactionSigner, params: DeactivateDidDocumentParams): Promise<string>;
|
|
2388
|
+
/**
|
|
2389
|
+
* Resolve a DID document
|
|
2390
|
+
*
|
|
2391
|
+
* @param didOrController - DID string or controller address
|
|
2392
|
+
* @returns DID document or null if not found
|
|
2393
|
+
*
|
|
2394
|
+
* @example
|
|
2395
|
+
* ```typescript
|
|
2396
|
+
* // Resolve by controller address
|
|
2397
|
+
* const didDoc = await didModule.resolve(controllerAddress)
|
|
2398
|
+
*
|
|
2399
|
+
* // Resolve by DID string
|
|
2400
|
+
* const didDoc = await didModule.resolve('did:sol:devnet:5VKz...')
|
|
2401
|
+
* ```
|
|
2402
|
+
*/
|
|
2403
|
+
resolve(didOrController: string | Address$1): Promise<DidDocument | null>;
|
|
2404
|
+
/**
|
|
2405
|
+
* Export a DID document as W3C-compliant JSON
|
|
2406
|
+
*
|
|
2407
|
+
* @param didOrController - DID string or controller address
|
|
2408
|
+
* @param pretty - Whether to pretty-print the JSON
|
|
2409
|
+
* @returns W3C DID document JSON string
|
|
2410
|
+
*
|
|
2411
|
+
* @example
|
|
2412
|
+
* ```typescript
|
|
2413
|
+
* const json = await didModule.exportW3C(controllerAddress, true)
|
|
2414
|
+
* console.log(json)
|
|
2415
|
+
* ```
|
|
2416
|
+
*/
|
|
2417
|
+
exportW3C(didOrController: string | Address$1, pretty?: boolean): Promise<string | null>;
|
|
2418
|
+
/**
|
|
2419
|
+
* Get W3C DID document object
|
|
2420
|
+
*
|
|
2421
|
+
* @param didOrController - DID string or controller address
|
|
2422
|
+
* @returns W3C DID document object or null
|
|
2423
|
+
*/
|
|
2424
|
+
getW3CDocument(didOrController: string | Address$1): Promise<W3CDidDocument | null>;
|
|
2425
|
+
/**
|
|
2426
|
+
* Derive DID document PDA for a controller
|
|
2427
|
+
*
|
|
2428
|
+
* @param controller - Controller address
|
|
2429
|
+
* @returns DID document PDA and bump
|
|
2430
|
+
*/
|
|
2431
|
+
deriveDidPda(controller: Address$1): Promise<[Address$1, number]>;
|
|
2432
|
+
/**
|
|
2433
|
+
* Generate a DID string for a controller
|
|
2434
|
+
*
|
|
2435
|
+
* @param controller - Controller address
|
|
2436
|
+
* @param network - Network identifier
|
|
2437
|
+
* @returns DID string
|
|
2438
|
+
*/
|
|
2439
|
+
generateDid(controller: Address$1, network?: 'mainnet' | 'devnet' | 'testnet'): string;
|
|
2440
|
+
/**
|
|
2441
|
+
* Validate a DID string
|
|
2442
|
+
*
|
|
2443
|
+
* @param did - DID string to validate
|
|
2444
|
+
* @returns True if valid, throws error if invalid
|
|
2445
|
+
*/
|
|
2446
|
+
validateDid(did: string): boolean;
|
|
2447
|
+
/**
|
|
2448
|
+
* Check if a DID is active
|
|
2449
|
+
*
|
|
2450
|
+
* @param didOrController - DID string or controller address
|
|
2451
|
+
* @returns True if active, false if deactivated or not found
|
|
2452
|
+
*/
|
|
2453
|
+
isActive(didOrController: string | Address$1): Promise<boolean>;
|
|
2454
|
+
/**
|
|
2455
|
+
* Build create DID instruction manually
|
|
2456
|
+
* Note: This is temporary until DID instructions are generated from IDL
|
|
2457
|
+
*/
|
|
2458
|
+
private buildCreateDidInstruction;
|
|
2459
|
+
/**
|
|
2460
|
+
* Build update DID instruction manually
|
|
2461
|
+
* Note: This is temporary until DID instructions are generated from IDL
|
|
2462
|
+
*/
|
|
2463
|
+
private buildUpdateDidInstruction;
|
|
2464
|
+
/**
|
|
2465
|
+
* Build deactivate DID instruction manually
|
|
2466
|
+
* Note: This is temporary until DID instructions are generated from IDL
|
|
2467
|
+
*/
|
|
2468
|
+
private buildDeactivateDidInstruction;
|
|
2469
|
+
/**
|
|
2470
|
+
* Create an Ed25519 verification method
|
|
2471
|
+
*/
|
|
2472
|
+
static createVerificationMethod: typeof createEd25519VerificationMethod;
|
|
2473
|
+
/**
|
|
2474
|
+
* Create a service endpoint
|
|
2475
|
+
*/
|
|
2476
|
+
static createServiceEndpoint: typeof createServiceEndpoint;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2157
2479
|
/**
|
|
2158
2480
|
* GhostSpeak Credential Module
|
|
2159
2481
|
*
|
|
2160
2482
|
* Provides functionality for creating, signing, and exporting
|
|
2161
|
-
* W3C-compatible Verifiable Credentials.
|
|
2483
|
+
* W3C-compatible Verifiable Credentials with DID integration.
|
|
2162
2484
|
*/
|
|
2163
2485
|
|
|
2164
2486
|
interface W3CVerifiableCredential {
|
|
@@ -2251,277 +2573,1217 @@ declare class UnifiedCredentialService {
|
|
|
2251
2573
|
}
|
|
2252
2574
|
|
|
2253
2575
|
/**
|
|
2254
|
-
*
|
|
2255
|
-
*
|
|
2256
|
-
* Example usage:
|
|
2257
|
-
* ```typescript
|
|
2258
|
-
* const ghostspeak = new GhostSpeak()
|
|
2259
|
-
*
|
|
2260
|
-
* // Create an agent
|
|
2261
|
-
* const agent = await ghostspeak
|
|
2262
|
-
* .agent()
|
|
2263
|
-
* .create({ name: "My Agent", capabilities: ["coding"] })
|
|
2264
|
-
* .compressed()
|
|
2265
|
-
* .execute()
|
|
2266
|
-
*
|
|
2267
|
-
* // Create an escrow
|
|
2268
|
-
* const escrow = await ghostspeak
|
|
2269
|
-
* .escrow()
|
|
2270
|
-
* .between(buyer, seller)
|
|
2271
|
-
* .amount(sol(10))
|
|
2272
|
-
* .withMilestones([...])
|
|
2273
|
-
* .execute()
|
|
2274
|
-
* ```
|
|
2576
|
+
* Reputation tier levels
|
|
2275
2577
|
*/
|
|
2276
|
-
declare
|
|
2277
|
-
|
|
2278
|
-
|
|
2578
|
+
declare enum ReputationTier {
|
|
2579
|
+
None = "None",
|
|
2580
|
+
Bronze = "Bronze",
|
|
2581
|
+
Silver = "Silver",
|
|
2582
|
+
Gold = "Gold",
|
|
2583
|
+
Platinum = "Platinum"
|
|
2584
|
+
}
|
|
2585
|
+
/**
|
|
2586
|
+
* Badge types for reputation achievements
|
|
2587
|
+
*/
|
|
2588
|
+
declare enum BadgeType {
|
|
2589
|
+
FirstJob = "FirstJob",
|
|
2590
|
+
TenJobs = "TenJobs",
|
|
2591
|
+
HundredJobs = "HundredJobs",
|
|
2592
|
+
ThousandJobs = "ThousandJobs",
|
|
2593
|
+
PerfectRating = "PerfectRating",
|
|
2594
|
+
QuickResponder = "QuickResponder",
|
|
2595
|
+
HighEarner = "HighEarner",
|
|
2596
|
+
DisputeResolver = "DisputeResolver",
|
|
2597
|
+
CategoryExpert = "CategoryExpert",
|
|
2598
|
+
CrossCategoryMaster = "CrossCategoryMaster"
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* Category-specific reputation data
|
|
2602
|
+
*/
|
|
2603
|
+
interface CategoryReputation {
|
|
2604
|
+
/** Category identifier (e.g., "defi", "nft", "gaming") */
|
|
2605
|
+
category: string;
|
|
2606
|
+
/** Current reputation score in this category (basis points) */
|
|
2607
|
+
score: number;
|
|
2608
|
+
/** Total completed jobs in this category */
|
|
2609
|
+
completedJobs: number;
|
|
2610
|
+
/** Average completion time in seconds */
|
|
2611
|
+
avgCompletionTime: number;
|
|
2612
|
+
/** Quality ratings sum */
|
|
2613
|
+
qualitySum: number;
|
|
2614
|
+
/** Number of quality ratings */
|
|
2615
|
+
qualityCount: number;
|
|
2616
|
+
/** Last activity timestamp */
|
|
2617
|
+
lastActivity: number;
|
|
2618
|
+
/** Total earnings in this category */
|
|
2619
|
+
totalEarnings: number;
|
|
2620
|
+
}
|
|
2621
|
+
/**
|
|
2622
|
+
* Job performance data for reputation calculation
|
|
2623
|
+
*/
|
|
2624
|
+
interface JobPerformance {
|
|
2625
|
+
/** Whether job was completed successfully */
|
|
2626
|
+
completed: boolean;
|
|
2627
|
+
/** Quality rating (0-100) */
|
|
2628
|
+
qualityRating: number;
|
|
2629
|
+
/** Expected duration in seconds */
|
|
2630
|
+
expectedDuration: number;
|
|
2631
|
+
/** Actual duration in seconds */
|
|
2632
|
+
actualDuration: number;
|
|
2633
|
+
/** Client satisfaction (0-100) */
|
|
2634
|
+
clientSatisfaction: number;
|
|
2635
|
+
/** Whether there was a dispute */
|
|
2636
|
+
hadDispute: boolean;
|
|
2637
|
+
/** Whether dispute was resolved favorably for agent */
|
|
2638
|
+
disputeResolvedFavorably: boolean;
|
|
2639
|
+
/** Job category */
|
|
2640
|
+
category: string;
|
|
2641
|
+
/** Payment amount */
|
|
2642
|
+
paymentAmount: number;
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
* Reputation calculation result
|
|
2646
|
+
*/
|
|
2647
|
+
interface ReputationCalculationResult {
|
|
2648
|
+
/** New overall score */
|
|
2649
|
+
overallScore: number;
|
|
2650
|
+
/** Score for this specific job */
|
|
2651
|
+
jobScore: number;
|
|
2652
|
+
/** Category-specific score */
|
|
2653
|
+
categoryScore: number;
|
|
2654
|
+
/** New reputation tier */
|
|
2655
|
+
tier: ReputationTier;
|
|
2656
|
+
/** Badges earned from this update */
|
|
2657
|
+
newBadges: BadgeType[];
|
|
2658
|
+
/** Whether fraud was detected */
|
|
2659
|
+
fraudDetected: boolean;
|
|
2660
|
+
/** Fraud risk score (0-100) */
|
|
2661
|
+
fraudRiskScore: number;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
/**
|
|
2665
|
+
* Simplified reputation data for module use
|
|
2666
|
+
*/
|
|
2667
|
+
interface ReputationData {
|
|
2668
|
+
agent: Address$1;
|
|
2669
|
+
overallScore: number;
|
|
2670
|
+
totalJobsCompleted: number;
|
|
2671
|
+
totalJobsFailed: number;
|
|
2672
|
+
avgResponseTime: number;
|
|
2673
|
+
disputesAgainst: number;
|
|
2674
|
+
disputesResolved: number;
|
|
2675
|
+
lastUpdated: number;
|
|
2676
|
+
categoryReputations: CategoryReputation[];
|
|
2677
|
+
badges: Array<{
|
|
2678
|
+
badgeType: BadgeType;
|
|
2679
|
+
earnedAt: number;
|
|
2680
|
+
}>;
|
|
2681
|
+
performanceHistory: Array<{
|
|
2682
|
+
timestamp: number;
|
|
2683
|
+
score: number;
|
|
2684
|
+
jobsCompleted: number;
|
|
2685
|
+
avgQuality: number;
|
|
2686
|
+
}>;
|
|
2687
|
+
factors: {
|
|
2688
|
+
completionWeight: number;
|
|
2689
|
+
qualityWeight: number;
|
|
2690
|
+
timelinessWeight: number;
|
|
2691
|
+
satisfactionWeight: number;
|
|
2692
|
+
disputeWeight: number;
|
|
2693
|
+
};
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* Reputation module for managing reputation calculations
|
|
2697
|
+
*/
|
|
2698
|
+
declare class ReputationModule extends BaseModule {
|
|
2699
|
+
private calculator;
|
|
2700
|
+
private tagEngine;
|
|
2701
|
+
constructor(config: GhostSpeakConfig);
|
|
2279
2702
|
/**
|
|
2280
|
-
*
|
|
2703
|
+
* Calculate reputation change for a job
|
|
2281
2704
|
*/
|
|
2282
|
-
|
|
2705
|
+
calculateReputationChange(currentData: ReputationData, jobPerformance: JobPerformance): ReputationCalculationResult;
|
|
2283
2706
|
/**
|
|
2284
|
-
*
|
|
2707
|
+
* Get tier name from tier enum
|
|
2285
2708
|
*/
|
|
2286
|
-
|
|
2709
|
+
getTierName(tier: ReputationTier): string;
|
|
2287
2710
|
/**
|
|
2288
|
-
*
|
|
2711
|
+
* Get tier from score
|
|
2289
2712
|
*/
|
|
2290
|
-
|
|
2713
|
+
getTierFromScore(score: number): ReputationTier;
|
|
2291
2714
|
/**
|
|
2292
|
-
*
|
|
2715
|
+
* Get badge display name
|
|
2293
2716
|
*/
|
|
2294
|
-
|
|
2717
|
+
getBadgeName(badge: BadgeType): string;
|
|
2295
2718
|
/**
|
|
2296
|
-
*
|
|
2719
|
+
* Calculate estimated APY boost from reputation
|
|
2297
2720
|
*/
|
|
2298
|
-
|
|
2721
|
+
calculateApyBoost(score: number): number;
|
|
2299
2722
|
/**
|
|
2300
|
-
*
|
|
2723
|
+
* Get reputation tier color for UI
|
|
2301
2724
|
*/
|
|
2302
|
-
|
|
2725
|
+
getTierColor(tier: ReputationTier): string;
|
|
2303
2726
|
/**
|
|
2304
|
-
*
|
|
2727
|
+
* Create default reputation data for new agents
|
|
2305
2728
|
*/
|
|
2306
|
-
|
|
2729
|
+
createDefaultReputationData(agentAddress: Address$1): ReputationData;
|
|
2307
2730
|
/**
|
|
2308
|
-
*
|
|
2731
|
+
* Check if agent qualifies for a specific tier
|
|
2309
2732
|
*/
|
|
2310
|
-
|
|
2733
|
+
qualifiesForTier(score: number, tier: ReputationTier): boolean;
|
|
2311
2734
|
/**
|
|
2312
|
-
*
|
|
2735
|
+
* Calculate points needed for next tier
|
|
2313
2736
|
*/
|
|
2314
|
-
|
|
2737
|
+
pointsToNextTier(score: number): {
|
|
2738
|
+
nextTier: ReputationTier;
|
|
2739
|
+
pointsNeeded: number;
|
|
2740
|
+
} | null;
|
|
2315
2741
|
/**
|
|
2316
|
-
*
|
|
2742
|
+
* Record a PayAI payment event to update reputation
|
|
2743
|
+
*
|
|
2744
|
+
* Converts PayAI webhook data to JobPerformance format and
|
|
2745
|
+
* calculates reputation change.
|
|
2746
|
+
*
|
|
2747
|
+
* @param record - PayAI reputation record from webhook
|
|
2748
|
+
* @param currentData - Current agent reputation data (fetched from on-chain or cache)
|
|
2749
|
+
* @returns Reputation calculation result
|
|
2317
2750
|
*/
|
|
2318
|
-
|
|
2751
|
+
recordPayAIPayment(record: PayAIReputationRecordInput, currentData: ReputationData): ReputationCalculationResult;
|
|
2319
2752
|
/**
|
|
2320
|
-
*
|
|
2753
|
+
* Convert a PayAI reputation record to JobPerformance format
|
|
2754
|
+
*
|
|
2755
|
+
* PayAI provides basic payment data, so we derive quality metrics
|
|
2756
|
+
* from response time and success status.
|
|
2321
2757
|
*/
|
|
2322
|
-
|
|
2758
|
+
payAIRecordToJobPerformance(record: PayAIReputationRecordInput): JobPerformance;
|
|
2323
2759
|
/**
|
|
2324
|
-
*
|
|
2760
|
+
* Estimate quality rating from response time
|
|
2761
|
+
*
|
|
2762
|
+
* Fast responses (< 500ms) = 100 quality
|
|
2763
|
+
* Average responses (500ms-2s) = 70-90 quality
|
|
2764
|
+
* Slow responses (2s-10s) = 40-70 quality
|
|
2765
|
+
* Very slow responses (> 10s) = 20-40 quality
|
|
2325
2766
|
*/
|
|
2326
|
-
private
|
|
2767
|
+
private estimateQualityFromResponseTime;
|
|
2768
|
+
/**
|
|
2769
|
+
* Estimate expected duration based on payment amount
|
|
2770
|
+
*
|
|
2771
|
+
* Larger payments = longer expected processing time
|
|
2772
|
+
*/
|
|
2773
|
+
private estimateExpectedDuration;
|
|
2774
|
+
/**
|
|
2775
|
+
* Categorize payment by network
|
|
2776
|
+
*/
|
|
2777
|
+
private categorizeFromNetwork;
|
|
2778
|
+
/**
|
|
2779
|
+
* Create a PayAI-compatible performance snapshot
|
|
2780
|
+
* Useful for tracking payment patterns
|
|
2781
|
+
*/
|
|
2782
|
+
createPayAIPerformanceSnapshot(record: PayAIReputationRecordInput, reputationResult: ReputationCalculationResult): {
|
|
2783
|
+
timestamp: number;
|
|
2784
|
+
paymentId: string;
|
|
2785
|
+
network: string;
|
|
2786
|
+
amount: string;
|
|
2787
|
+
success: boolean;
|
|
2788
|
+
responseTimeMs: number;
|
|
2789
|
+
reputationChange: number;
|
|
2790
|
+
newScore: number;
|
|
2791
|
+
tier: string;
|
|
2792
|
+
};
|
|
2793
|
+
/**
|
|
2794
|
+
* Calculate tags for an agent based on metrics
|
|
2795
|
+
*
|
|
2796
|
+
* Automatically evaluates all tag criteria and assigns tags
|
|
2797
|
+
* with appropriate confidence scores.
|
|
2798
|
+
*
|
|
2799
|
+
* @param metrics - Agent reputation metrics
|
|
2800
|
+
* @returns Array of tag scores
|
|
2801
|
+
*/
|
|
2802
|
+
calculateTagsForAgent(metrics: ReputationMetrics): Promise<TagScore[]>;
|
|
2803
|
+
/**
|
|
2804
|
+
* Get tags by category
|
|
2805
|
+
*
|
|
2806
|
+
* Filters tags to only those in the specified category.
|
|
2807
|
+
*
|
|
2808
|
+
* @param tags - All tag scores
|
|
2809
|
+
* @param category - Category to filter by
|
|
2810
|
+
* @returns Filtered tag scores
|
|
2811
|
+
*/
|
|
2812
|
+
getTagsByCategory(tags: TagScore[], category: TagCategory): TagScore[];
|
|
2813
|
+
/**
|
|
2814
|
+
* Check if agent has a specific tag
|
|
2815
|
+
*
|
|
2816
|
+
* @param tags - Agent's tag scores
|
|
2817
|
+
* @param tagName - Tag to check for
|
|
2818
|
+
* @returns Whether the tag exists
|
|
2819
|
+
*/
|
|
2820
|
+
hasTag(tags: TagScore[], tagName: string): boolean;
|
|
2821
|
+
/**
|
|
2822
|
+
* Get tag confidence score
|
|
2823
|
+
*
|
|
2824
|
+
* @param tags - Agent's tag scores
|
|
2825
|
+
* @param tagName - Tag to check
|
|
2826
|
+
* @returns Confidence score or undefined if tag doesn't exist
|
|
2827
|
+
*/
|
|
2828
|
+
getTagConfidence(tags: TagScore[], tagName: string): number | undefined;
|
|
2829
|
+
/**
|
|
2830
|
+
* Filter tags by criteria
|
|
2831
|
+
*
|
|
2832
|
+
* @param tags - Tags to filter
|
|
2833
|
+
* @param filters - Filter criteria
|
|
2834
|
+
* @returns Filtered tags
|
|
2835
|
+
*/
|
|
2836
|
+
filterTags(tags: TagScore[], filters: TagFilters): TagScore[];
|
|
2837
|
+
/**
|
|
2838
|
+
* Apply tag decay based on age
|
|
2839
|
+
*
|
|
2840
|
+
* Reduces confidence scores for old tags and removes stale tags.
|
|
2841
|
+
*
|
|
2842
|
+
* @param tags - Current tag scores
|
|
2843
|
+
* @param currentTimestamp - Current Unix timestamp (optional)
|
|
2844
|
+
* @returns Tags with decay applied
|
|
2845
|
+
*/
|
|
2846
|
+
applyTagDecay(tags: TagScore[], currentTimestamp?: number): TagScore[];
|
|
2847
|
+
/**
|
|
2848
|
+
* Merge new tags with existing tags
|
|
2849
|
+
*
|
|
2850
|
+
* Updates existing tags or adds new ones, preferring higher confidence.
|
|
2851
|
+
*
|
|
2852
|
+
* @param existingTags - Current tags
|
|
2853
|
+
* @param newTags - New tags to merge
|
|
2854
|
+
* @returns Merged tag list
|
|
2855
|
+
*/
|
|
2856
|
+
mergeTags(existingTags: TagScore[], newTags: TagScore[]): TagScore[];
|
|
2857
|
+
/**
|
|
2858
|
+
* Categorize tags by type
|
|
2859
|
+
*
|
|
2860
|
+
* Organizes tags into skill, behavior, and compliance categories.
|
|
2861
|
+
*
|
|
2862
|
+
* @param tags - Tags to categorize
|
|
2863
|
+
* @returns Categorized tag result
|
|
2864
|
+
*/
|
|
2865
|
+
categorizeTags(tags: TagScore[]): TagQueryResult;
|
|
2866
|
+
/**
|
|
2867
|
+
* Get top N tags by confidence
|
|
2868
|
+
*
|
|
2869
|
+
* @param tags - Tags to sort
|
|
2870
|
+
* @param count - Number of tags to return
|
|
2871
|
+
* @returns Top tags
|
|
2872
|
+
*/
|
|
2873
|
+
getTopTags(tags: TagScore[], count: number): TagScore[];
|
|
2874
|
+
/**
|
|
2875
|
+
* Sort tags by confidence (descending)
|
|
2876
|
+
*
|
|
2877
|
+
* @param tags - Tags to sort
|
|
2878
|
+
* @returns Sorted tags
|
|
2879
|
+
*/
|
|
2880
|
+
sortTagsByConfidence(tags: TagScore[]): TagScore[];
|
|
2881
|
+
/**
|
|
2882
|
+
* Sort tags by evidence count (descending)
|
|
2883
|
+
*
|
|
2884
|
+
* @param tags - Tags to sort
|
|
2885
|
+
* @returns Sorted tags
|
|
2886
|
+
*/
|
|
2887
|
+
sortTagsByEvidence(tags: TagScore[]): TagScore[];
|
|
2888
|
+
/**
|
|
2889
|
+
* Sort tags by most recently updated
|
|
2890
|
+
*
|
|
2891
|
+
* @param tags - Tags to sort
|
|
2892
|
+
* @returns Sorted tags
|
|
2893
|
+
*/
|
|
2894
|
+
sortTagsByRecent(tags: TagScore[]): TagScore[];
|
|
2895
|
+
/**
|
|
2896
|
+
* Get confidence level description
|
|
2897
|
+
*
|
|
2898
|
+
* @param confidence - Confidence score (0-10000)
|
|
2899
|
+
* @returns Human-readable confidence level
|
|
2900
|
+
*/
|
|
2901
|
+
getConfidenceLevel(confidence: number): string;
|
|
2902
|
+
/**
|
|
2903
|
+
* Validate tag name length
|
|
2904
|
+
*
|
|
2905
|
+
* @param tagName - Tag name to validate
|
|
2906
|
+
* @returns Whether tag name is valid
|
|
2907
|
+
*/
|
|
2908
|
+
validateTagName(tagName: string): boolean;
|
|
2909
|
+
/**
|
|
2910
|
+
* Validate confidence score
|
|
2911
|
+
*
|
|
2912
|
+
* @param confidence - Confidence to validate
|
|
2913
|
+
* @returns Whether confidence is valid (0-10000)
|
|
2914
|
+
*/
|
|
2915
|
+
validateConfidence(confidence: number): boolean;
|
|
2916
|
+
/**
|
|
2917
|
+
* Convert on-chain ReputationMetrics to TagEngine format
|
|
2918
|
+
*
|
|
2919
|
+
* Helper to convert blockchain data to the format needed for tag calculation.
|
|
2920
|
+
*
|
|
2921
|
+
* @param onChainMetrics - Metrics from blockchain
|
|
2922
|
+
* @returns Metrics in TagEngine format
|
|
2923
|
+
*/
|
|
2924
|
+
convertMetricsForTagging(onChainMetrics: {
|
|
2925
|
+
successfulPayments: bigint;
|
|
2926
|
+
failedPayments: bigint;
|
|
2927
|
+
totalResponseTime: bigint;
|
|
2928
|
+
responseTimeCount: bigint;
|
|
2929
|
+
totalDisputes: number;
|
|
2930
|
+
disputesResolved: number;
|
|
2931
|
+
totalRating: number;
|
|
2932
|
+
totalRatingsCount: number;
|
|
2933
|
+
createdAt: number;
|
|
2934
|
+
updatedAt: number;
|
|
2935
|
+
}): ReputationMetrics;
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Interface for PayAI reputation record input
|
|
2939
|
+
* Matches the PayAIReputationRecord from payai module
|
|
2940
|
+
*/
|
|
2941
|
+
interface PayAIReputationRecordInput {
|
|
2942
|
+
agentAddress: Address$1;
|
|
2943
|
+
paymentSignature: string;
|
|
2944
|
+
amount: bigint;
|
|
2945
|
+
success: boolean;
|
|
2946
|
+
responseTimeMs: number;
|
|
2947
|
+
payerAddress: string;
|
|
2948
|
+
timestamp: Date;
|
|
2949
|
+
network: string;
|
|
2327
2950
|
}
|
|
2951
|
+
|
|
2328
2952
|
/**
|
|
2329
|
-
*
|
|
2953
|
+
* Privacy module for managing reputation privacy settings
|
|
2330
2954
|
*/
|
|
2331
|
-
declare class
|
|
2332
|
-
private module;
|
|
2333
|
-
private params;
|
|
2955
|
+
declare class PrivacyModule extends BaseModule {
|
|
2334
2956
|
constructor(config: GhostSpeakConfig);
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2957
|
+
/**
|
|
2958
|
+
* Initialize privacy settings for an agent
|
|
2959
|
+
*
|
|
2960
|
+
* Sets up privacy controls for an agent's reputation data.
|
|
2961
|
+
* By default, starts in Public mode with all metrics visible.
|
|
2962
|
+
*
|
|
2963
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
2964
|
+
* @param params - Initialization parameters
|
|
2965
|
+
* @returns Transaction signature
|
|
2966
|
+
*
|
|
2967
|
+
* @example
|
|
2968
|
+
* ```typescript
|
|
2969
|
+
* const signature = await privacyModule.initializePrivacy(signer, {
|
|
2970
|
+
* agentAddress: agentPda,
|
|
2971
|
+
* mode: PrivacyMode.TierOnly,
|
|
2972
|
+
* metricVisibility: {
|
|
2973
|
+
* showScore: VisibilityLevel.Private,
|
|
2974
|
+
* showJobsCompleted: VisibilityLevel.Public,
|
|
2975
|
+
* // ... other metrics
|
|
2976
|
+
* }
|
|
2977
|
+
* })
|
|
2978
|
+
* ```
|
|
2979
|
+
*/
|
|
2980
|
+
initializePrivacy(signer: TransactionSigner, params: InitializePrivacyParams): Promise<string>;
|
|
2981
|
+
/**
|
|
2982
|
+
* Update privacy mode for an agent
|
|
2983
|
+
*
|
|
2984
|
+
* Changes how reputation data is displayed publicly.
|
|
2985
|
+
*
|
|
2986
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
2987
|
+
* @param params - Update parameters
|
|
2988
|
+
* @returns Transaction signature
|
|
2989
|
+
*
|
|
2990
|
+
* @example
|
|
2991
|
+
* ```typescript
|
|
2992
|
+
* // Switch to tier-only mode
|
|
2993
|
+
* await privacyModule.updatePrivacyMode(signer, {
|
|
2994
|
+
* agentAddress: agentPda,
|
|
2995
|
+
* mode: PrivacyMode.TierOnly
|
|
2996
|
+
* })
|
|
2997
|
+
* ```
|
|
2998
|
+
*/
|
|
2999
|
+
updatePrivacyMode(signer: TransactionSigner, params: UpdatePrivacyModeParams): Promise<string>;
|
|
3000
|
+
/**
|
|
3001
|
+
* Set metric visibility settings
|
|
3002
|
+
*
|
|
3003
|
+
* Configure selective disclosure for individual metrics.
|
|
3004
|
+
* Only works in Custom privacy mode.
|
|
3005
|
+
*
|
|
3006
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
3007
|
+
* @param params - Metric visibility parameters
|
|
3008
|
+
* @returns Transaction signature
|
|
3009
|
+
*
|
|
3010
|
+
* @example
|
|
3011
|
+
* ```typescript
|
|
3012
|
+
* await privacyModule.setMetricVisibility(signer, {
|
|
3013
|
+
* agentAddress: agentPda,
|
|
3014
|
+
* metricVisibility: {
|
|
3015
|
+
* showScore: VisibilityLevel.Private,
|
|
3016
|
+
* showJobsCompleted: VisibilityLevel.Public,
|
|
3017
|
+
* showSuccessRate: VisibilityLevel.Public,
|
|
3018
|
+
* showResponseTime: VisibilityLevel.Public,
|
|
3019
|
+
* showDisputes: VisibilityLevel.Private,
|
|
3020
|
+
* showEarnings: VisibilityLevel.Private,
|
|
3021
|
+
* showRatings: VisibilityLevel.Public,
|
|
3022
|
+
* showBadges: VisibilityLevel.Public
|
|
3023
|
+
* }
|
|
3024
|
+
* })
|
|
3025
|
+
* ```
|
|
3026
|
+
*/
|
|
3027
|
+
setMetricVisibility(signer: TransactionSigner, params: SetMetricVisibilityParams): Promise<string>;
|
|
3028
|
+
/**
|
|
3029
|
+
* Grant viewer access to private reputation data
|
|
3030
|
+
*
|
|
3031
|
+
* Adds an address to the authorized viewers list, giving them
|
|
3032
|
+
* full access to all private metrics.
|
|
3033
|
+
*
|
|
3034
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
3035
|
+
* @param params - Grant access parameters
|
|
3036
|
+
* @returns Transaction signature
|
|
3037
|
+
*
|
|
3038
|
+
* @example
|
|
3039
|
+
* ```typescript
|
|
3040
|
+
* // Grant access to a client
|
|
3041
|
+
* await privacyModule.grantAccess(signer, {
|
|
3042
|
+
* agentAddress: agentPda,
|
|
3043
|
+
* viewer: clientAddress
|
|
3044
|
+
* })
|
|
3045
|
+
* ```
|
|
3046
|
+
*/
|
|
3047
|
+
grantAccess(signer: TransactionSigner, params: GrantAccessParams): Promise<string>;
|
|
3048
|
+
/**
|
|
3049
|
+
* Revoke viewer access to private reputation data
|
|
3050
|
+
*
|
|
3051
|
+
* Removes an address from the authorized viewers list.
|
|
3052
|
+
*
|
|
3053
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
3054
|
+
* @param params - Revoke access parameters
|
|
3055
|
+
* @returns Transaction signature
|
|
3056
|
+
*
|
|
3057
|
+
* @example
|
|
3058
|
+
* ```typescript
|
|
3059
|
+
* // Revoke access from a viewer
|
|
3060
|
+
* await privacyModule.revokeAccess(signer, {
|
|
3061
|
+
* agentAddress: agentPda,
|
|
3062
|
+
* viewer: viewerAddress
|
|
3063
|
+
* })
|
|
3064
|
+
* ```
|
|
3065
|
+
*/
|
|
3066
|
+
revokeAccess(signer: TransactionSigner, params: RevokeAccessParams): Promise<string>;
|
|
3067
|
+
/**
|
|
3068
|
+
* Apply a privacy preset
|
|
3069
|
+
*
|
|
3070
|
+
* Quickly configure privacy settings using a predefined preset
|
|
3071
|
+
* (Conservative, Balanced, or Open).
|
|
3072
|
+
*
|
|
3073
|
+
* @param signer - Transaction signer (must be agent owner)
|
|
3074
|
+
* @param params - Preset parameters
|
|
3075
|
+
* @returns Transaction signature
|
|
3076
|
+
*
|
|
3077
|
+
* @example
|
|
3078
|
+
* ```typescript
|
|
3079
|
+
* // Apply balanced preset
|
|
3080
|
+
* await privacyModule.applyPreset(signer, {
|
|
3081
|
+
* agentAddress: agentPda,
|
|
3082
|
+
* preset: PrivacyPresets.BALANCED
|
|
3083
|
+
* })
|
|
3084
|
+
* ```
|
|
3085
|
+
*/
|
|
3086
|
+
applyPreset(signer: TransactionSigner, params: ApplyPresetParams): Promise<string>;
|
|
3087
|
+
/**
|
|
3088
|
+
* Get privacy settings for an agent
|
|
3089
|
+
*
|
|
3090
|
+
* Fetches the current privacy configuration.
|
|
3091
|
+
*
|
|
3092
|
+
* @param agentAddress - Agent address
|
|
3093
|
+
* @returns Privacy settings or null if not initialized
|
|
3094
|
+
*
|
|
3095
|
+
* @example
|
|
3096
|
+
* ```typescript
|
|
3097
|
+
* const settings = await privacyModule.getPrivacySettings(agentPda)
|
|
3098
|
+
* if (settings) {
|
|
3099
|
+
* console.log('Privacy mode:', settings.mode)
|
|
3100
|
+
* console.log('Authorized viewers:', settings.authorizedViewers.length)
|
|
3101
|
+
* }
|
|
3102
|
+
* ```
|
|
3103
|
+
*/
|
|
3104
|
+
getPrivacySettings(agentAddress: Address$1): Promise<PrivacySettings | null>;
|
|
3105
|
+
/**
|
|
3106
|
+
* Get visible reputation data (privacy-filtered)
|
|
3107
|
+
*
|
|
3108
|
+
* Fetches reputation data and applies privacy filters based on
|
|
3109
|
+
* the viewer's access level.
|
|
3110
|
+
*
|
|
3111
|
+
* @param agentAddress - Agent address
|
|
3112
|
+
* @param viewerAddress - Viewer address (for access check)
|
|
3113
|
+
* @returns Privacy-filtered reputation data
|
|
3114
|
+
*
|
|
3115
|
+
* @example
|
|
3116
|
+
* ```typescript
|
|
3117
|
+
* // Get visible reputation for a specific viewer
|
|
3118
|
+
* const visibleRep = await privacyModule.getVisibleReputation(
|
|
3119
|
+
* agentPda,
|
|
3120
|
+
* viewerAddress
|
|
3121
|
+
* )
|
|
3122
|
+
*
|
|
3123
|
+
* console.log('Tier:', visibleRep.tier)
|
|
3124
|
+
* console.log('Exact score:', visibleRep.exactScore) // Only if visible
|
|
3125
|
+
* console.log('Has full access:', visibleRep.hasFullAccess)
|
|
3126
|
+
* ```
|
|
3127
|
+
*/
|
|
3128
|
+
getVisibleReputation(agentAddress: Address$1, viewerAddress: Address$1): Promise<VisibleReputation>;
|
|
3129
|
+
/**
|
|
3130
|
+
* Validate privacy settings before applying
|
|
3131
|
+
*
|
|
3132
|
+
* @param settings - Privacy settings to validate
|
|
3133
|
+
* @returns Validation result
|
|
3134
|
+
*/
|
|
3135
|
+
validateSettings(settings: PrivacySettings): {
|
|
3136
|
+
valid: boolean;
|
|
3137
|
+
errors: string[];
|
|
3138
|
+
};
|
|
3139
|
+
/**
|
|
3140
|
+
* Get available privacy presets
|
|
3141
|
+
*
|
|
3142
|
+
* @returns Record of available presets
|
|
3143
|
+
*/
|
|
3144
|
+
getAvailablePresets(): Record<string, PrivacyPreset>;
|
|
3145
|
+
/**
|
|
3146
|
+
* Get default metric visibility for a privacy mode
|
|
3147
|
+
*
|
|
3148
|
+
* @param mode - Privacy mode
|
|
3149
|
+
* @returns Default metric visibility
|
|
3150
|
+
*/
|
|
3151
|
+
getDefaultVisibility(mode: PrivacyMode): MetricVisibility;
|
|
3152
|
+
/**
|
|
3153
|
+
* Calculate reputation tier from score
|
|
3154
|
+
*
|
|
3155
|
+
* @param score - Reputation score
|
|
3156
|
+
* @returns Reputation tier
|
|
3157
|
+
*/
|
|
3158
|
+
getTier(score: number): ReputationTier$1;
|
|
3159
|
+
/**
|
|
3160
|
+
* Calculate score range from score
|
|
3161
|
+
*
|
|
3162
|
+
* @param score - Reputation score
|
|
3163
|
+
* @returns Score range
|
|
3164
|
+
*/
|
|
3165
|
+
getRange(score: number): ScoreRange;
|
|
3166
|
+
private derivePrivacyPda;
|
|
2355
3167
|
}
|
|
3168
|
+
|
|
2356
3169
|
/**
|
|
2357
|
-
*
|
|
3170
|
+
* Agent Authorization System Types
|
|
3171
|
+
*
|
|
3172
|
+
* GhostSpeak's trustless authorization mechanism for agents to
|
|
3173
|
+
* pre-authorize reputation updates with cryptographic signatures.
|
|
3174
|
+
*
|
|
3175
|
+
* Built for secure, delegated reputation management across protocols.
|
|
2358
3176
|
*/
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* Network types supported by GhostSpeak
|
|
3180
|
+
*/
|
|
3181
|
+
type SolanaNetwork = 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
|
|
3182
|
+
/**
|
|
3183
|
+
* Configuration for on-chain authorization storage
|
|
3184
|
+
*
|
|
3185
|
+
* On-chain storage provides an immutable audit trail for authorizations,
|
|
3186
|
+
* but costs ~0.002 SOL in rent. Off-chain storage (default) is free but
|
|
3187
|
+
* requires agents to share signed authorizations with facilitators.
|
|
3188
|
+
*/
|
|
3189
|
+
interface OnChainStorageConfig {
|
|
3190
|
+
/** Enable on-chain storage (default: false for cost efficiency) */
|
|
3191
|
+
enabled: boolean;
|
|
3192
|
+
/**
|
|
3193
|
+
* Storage fee in lamports (default: 0.002 SOL = 2000000 lamports for rent)
|
|
3194
|
+
* This covers the account rent exemption cost on Solana
|
|
3195
|
+
*/
|
|
3196
|
+
storageFee?: bigint;
|
|
3197
|
+
/**
|
|
3198
|
+
* Who pays the storage fee
|
|
3199
|
+
* - true: Agent pays (stored authorization benefits agent's transparency)
|
|
3200
|
+
* - false: Facilitator pays (facilitator wants on-chain proof)
|
|
3201
|
+
* Default: true (agent pays for their own authorization storage)
|
|
3202
|
+
*/
|
|
3203
|
+
feePayedByAgent?: boolean;
|
|
3204
|
+
/**
|
|
3205
|
+
* Automatically store on-chain after creation
|
|
3206
|
+
* - true: Store immediately (requires funded wallet)
|
|
3207
|
+
* - false: Manual storage via storeAuthorizationOnChain()
|
|
3208
|
+
* Default: false (manual control)
|
|
3209
|
+
*/
|
|
3210
|
+
autoStore?: boolean;
|
|
3211
|
+
/**
|
|
3212
|
+
* Custom fee structure for different authorization durations
|
|
3213
|
+
* Maps duration in seconds to fee in lamports
|
|
3214
|
+
* Example: { 2592000: 1000000n } // 30 days = 0.001 SOL
|
|
3215
|
+
*/
|
|
3216
|
+
customFees?: Record<number, bigint>;
|
|
2380
3217
|
}
|
|
2381
3218
|
/**
|
|
2382
|
-
*
|
|
3219
|
+
* Reputation Authorization
|
|
3220
|
+
*
|
|
3221
|
+
* Allows an agent to pre-authorize a specific source (e.g., PayAI facilitator)
|
|
3222
|
+
* to update their reputation a limited number of times before expiration.
|
|
3223
|
+
*/
|
|
3224
|
+
interface ReputationAuthorization {
|
|
3225
|
+
/** Agent's public key (the one granting authorization) */
|
|
3226
|
+
agentAddress: Address$1;
|
|
3227
|
+
/** Authorized source address (e.g., PayAI facilitator address) */
|
|
3228
|
+
authorizedSource: Address$1;
|
|
3229
|
+
/** Maximum number of reputation updates allowed */
|
|
3230
|
+
indexLimit: number;
|
|
3231
|
+
/** Unix timestamp when authorization expires */
|
|
3232
|
+
expiresAt: number;
|
|
3233
|
+
/** Solana network this authorization is valid on */
|
|
3234
|
+
network: SolanaNetwork;
|
|
3235
|
+
/** Ed25519 signature (64 bytes) proving agent's intent */
|
|
3236
|
+
signature: Uint8Array;
|
|
3237
|
+
/** Optional nonce to prevent replay attacks */
|
|
3238
|
+
nonce?: string;
|
|
3239
|
+
/** Optional metadata */
|
|
3240
|
+
metadata?: AuthorizationMetadata;
|
|
3241
|
+
}
|
|
3242
|
+
/**
|
|
3243
|
+
* Authorization metadata (optional fields)
|
|
3244
|
+
*/
|
|
3245
|
+
interface AuthorizationMetadata {
|
|
3246
|
+
/** Human-readable description */
|
|
3247
|
+
description?: string;
|
|
3248
|
+
/** Tags for categorization */
|
|
3249
|
+
tags?: string[];
|
|
3250
|
+
/** Custom data */
|
|
3251
|
+
customData?: Record<string, unknown>;
|
|
3252
|
+
/** Creation timestamp */
|
|
3253
|
+
createdAt?: number;
|
|
3254
|
+
/** Version of authorization format */
|
|
3255
|
+
version?: string;
|
|
3256
|
+
}
|
|
3257
|
+
/**
|
|
3258
|
+
* Authorization creation parameters
|
|
3259
|
+
*/
|
|
3260
|
+
interface CreateAuthorizationParams {
|
|
3261
|
+
/** Authorized source (e.g., PayAI facilitator) */
|
|
3262
|
+
authorizedSource: Address$1;
|
|
3263
|
+
/** Maximum number of updates (default: 1000) */
|
|
3264
|
+
indexLimit?: number;
|
|
3265
|
+
/** Expiration time in seconds from now (default: 30 days) */
|
|
3266
|
+
expiresIn?: number;
|
|
3267
|
+
/** Specific expiration timestamp (overrides expiresIn) */
|
|
3268
|
+
expiresAt?: number;
|
|
3269
|
+
/** Network (defaults to current cluster) */
|
|
3270
|
+
network?: SolanaNetwork;
|
|
3271
|
+
/** Optional nonce for replay protection */
|
|
3272
|
+
nonce?: string;
|
|
3273
|
+
/** Optional metadata */
|
|
3274
|
+
metadata?: AuthorizationMetadata;
|
|
3275
|
+
/**
|
|
3276
|
+
* Whether to store authorization on-chain (default: false)
|
|
3277
|
+
* @deprecated Use onChainStorage.enabled instead
|
|
3278
|
+
*/
|
|
3279
|
+
storeOnChain?: boolean;
|
|
3280
|
+
/**
|
|
3281
|
+
* On-chain storage configuration
|
|
3282
|
+
* If not provided, defaults to off-chain (free) storage
|
|
3283
|
+
*/
|
|
3284
|
+
onChainStorage?: OnChainStorageConfig;
|
|
3285
|
+
}
|
|
3286
|
+
/**
|
|
3287
|
+
* Authorization status
|
|
3288
|
+
*/
|
|
3289
|
+
declare enum AuthorizationStatus {
|
|
3290
|
+
ACTIVE = "active",
|
|
3291
|
+
EXPIRED = "expired",
|
|
3292
|
+
EXHAUSTED = "exhausted",// Index limit reached
|
|
3293
|
+
REVOKED = "revoked",
|
|
3294
|
+
PENDING = "pending"
|
|
3295
|
+
}
|
|
3296
|
+
/**
|
|
3297
|
+
* Authorization with status
|
|
3298
|
+
*/
|
|
3299
|
+
interface AuthorizationWithStatus extends ReputationAuthorization {
|
|
3300
|
+
/** Current status */
|
|
3301
|
+
status: AuthorizationStatus;
|
|
3302
|
+
/** Current usage count */
|
|
3303
|
+
currentIndex: number;
|
|
3304
|
+
/** Remaining uses */
|
|
3305
|
+
remainingUses: number;
|
|
3306
|
+
/** Whether currently valid */
|
|
3307
|
+
isValid: boolean;
|
|
3308
|
+
/** Last used timestamp */
|
|
3309
|
+
lastUsedAt?: number;
|
|
3310
|
+
/** Authorization ID (derived from signature or on-chain account) */
|
|
3311
|
+
id: string;
|
|
3312
|
+
}
|
|
3313
|
+
/**
|
|
3314
|
+
* Authorization query filter
|
|
2383
3315
|
*/
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
3316
|
+
interface AuthorizationFilter {
|
|
3317
|
+
/** Filter by agent address */
|
|
3318
|
+
agentAddress?: Address$1;
|
|
3319
|
+
/** Filter by authorized source */
|
|
3320
|
+
authorizedSource?: Address$1;
|
|
3321
|
+
/** Filter by status */
|
|
3322
|
+
status?: AuthorizationStatus | AuthorizationStatus[];
|
|
3323
|
+
/** Filter by network */
|
|
3324
|
+
network?: SolanaNetwork;
|
|
3325
|
+
/** Filter by expiration (before/after timestamp) */
|
|
3326
|
+
expiresAfter?: number;
|
|
3327
|
+
expiresBefore?: number;
|
|
3328
|
+
/** Filter by creation time */
|
|
3329
|
+
createdAfter?: number;
|
|
3330
|
+
createdBefore?: number;
|
|
3331
|
+
/** Pagination */
|
|
3332
|
+
limit?: number;
|
|
3333
|
+
offset?: number;
|
|
2402
3334
|
}
|
|
3335
|
+
|
|
2403
3336
|
/**
|
|
2404
|
-
*
|
|
3337
|
+
* Agent Authorization Signature Verification
|
|
3338
|
+
*
|
|
3339
|
+
* Ed25519 signature creation and verification for GhostSpeak's
|
|
3340
|
+
* trustless agent pre-authorization system.
|
|
3341
|
+
*
|
|
3342
|
+
* Enables verifiable delegation of reputation update authority.
|
|
2405
3343
|
*/
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
3344
|
+
|
|
3345
|
+
/**
|
|
3346
|
+
* Keypair interface for Ed25519 signing operations
|
|
3347
|
+
* Compatible with both legacy and modern Solana key formats
|
|
3348
|
+
*/
|
|
3349
|
+
interface SigningKeypair {
|
|
3350
|
+
publicKey: {
|
|
3351
|
+
toBase58(): string;
|
|
3352
|
+
toBytes(): Uint8Array;
|
|
3353
|
+
};
|
|
3354
|
+
secretKey: Uint8Array;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* Authorization Module - Agent Pre-Authorization System
|
|
3359
|
+
*
|
|
3360
|
+
* GhostSpeak's trustless system for agents to pre-authorize facilitators
|
|
3361
|
+
* (e.g., PayAI) to update their reputation with built-in security limits.
|
|
3362
|
+
*
|
|
3363
|
+
* @module AuthorizationModule
|
|
3364
|
+
*/
|
|
3365
|
+
|
|
3366
|
+
/**
|
|
3367
|
+
* Authorization Module
|
|
3368
|
+
*
|
|
3369
|
+
* Manages agent pre-authorizations for reputation updates.
|
|
3370
|
+
*/
|
|
3371
|
+
declare class AuthorizationModule extends BaseModule {
|
|
2409
3372
|
constructor(config: GhostSpeakConfig);
|
|
2410
3373
|
/**
|
|
2411
|
-
* Create a
|
|
3374
|
+
* Create a signed authorization for a facilitator
|
|
3375
|
+
*
|
|
3376
|
+
* @param params - Authorization parameters
|
|
3377
|
+
* @param agentKeypair - Agent's keypair for signing
|
|
3378
|
+
* @returns Signed authorization
|
|
3379
|
+
*
|
|
3380
|
+
* @example
|
|
3381
|
+
* ```typescript
|
|
3382
|
+
* const authorization = await client.authorization.createAuthorization({
|
|
3383
|
+
* authorizedSource: payAIFacilitatorAddress,
|
|
3384
|
+
* indexLimit: 1000, // Allow 1000 reputation updates
|
|
3385
|
+
* expiresIn: 30 * 24 * 60 * 60, // 30 days
|
|
3386
|
+
* network: 'devnet',
|
|
3387
|
+
* }, agentKeypair)
|
|
3388
|
+
* ```
|
|
3389
|
+
*/
|
|
3390
|
+
createAuthorization(params: CreateAuthorizationParams, agentKeypair: SigningKeypair): Promise<ReputationAuthorization>;
|
|
3391
|
+
/**
|
|
3392
|
+
* Store authorization on-chain (optional, ~0.002 SOL fee)
|
|
3393
|
+
*
|
|
3394
|
+
* Creates a PDA account storing the authorization for on-chain verification.
|
|
3395
|
+
* This provides an immutable audit trail but costs rent (~0.002 SOL).
|
|
3396
|
+
*
|
|
3397
|
+
* **Cost vs Benefit:**
|
|
3398
|
+
* - Off-chain (default): Free, but requires sharing signed authorization
|
|
3399
|
+
* - On-chain: ~0.002 SOL, provides transparent audit trail
|
|
3400
|
+
*
|
|
3401
|
+
* **When to use on-chain storage:**
|
|
3402
|
+
* - High-value authorizations where transparency is critical
|
|
3403
|
+
* - Compliance/audit requirements
|
|
3404
|
+
* - Public agent reputation systems
|
|
3405
|
+
*
|
|
3406
|
+
* @param authorization - Authorization to store
|
|
3407
|
+
* @param agentSigner - Agent's signer (or facilitator if they pay fee)
|
|
3408
|
+
* @param config - Optional storage configuration
|
|
3409
|
+
* @returns Transaction signature
|
|
3410
|
+
*
|
|
3411
|
+
* @example
|
|
3412
|
+
* ```typescript
|
|
3413
|
+
* // Default: Agent pays ~0.002 SOL
|
|
3414
|
+
* const sig = await client.authorization.storeAuthorizationOnChain(auth, agentSigner)
|
|
3415
|
+
*
|
|
3416
|
+
* // Custom fee structure
|
|
3417
|
+
* const sig = await client.authorization.storeAuthorizationOnChain(auth, agentSigner, {
|
|
3418
|
+
* storageFee: 1500000n, // 0.0015 SOL
|
|
3419
|
+
* feePayedByAgent: false // Facilitator pays
|
|
3420
|
+
* })
|
|
3421
|
+
* ```
|
|
3422
|
+
*/
|
|
3423
|
+
storeAuthorizationOnChain(authorization: ReputationAuthorization, agentSigner: TransactionSigner, config?: Partial<OnChainStorageConfig>): Promise<string>;
|
|
3424
|
+
/**
|
|
3425
|
+
* Verify authorization signature
|
|
3426
|
+
*
|
|
3427
|
+
* @param authorization - Authorization to verify
|
|
3428
|
+
* @returns True if signature is valid
|
|
3429
|
+
*
|
|
3430
|
+
* @example
|
|
3431
|
+
* ```typescript
|
|
3432
|
+
* const isValid = await client.authorization.verifySignature(authorization)
|
|
3433
|
+
* if (!isValid) {
|
|
3434
|
+
* throw new Error('Invalid authorization signature')
|
|
3435
|
+
* }
|
|
3436
|
+
* ```
|
|
2412
3437
|
*/
|
|
2413
|
-
|
|
3438
|
+
verifySignature(authorization: ReputationAuthorization): Promise<boolean>;
|
|
2414
3439
|
/**
|
|
2415
|
-
*
|
|
3440
|
+
* Check authorization status (without on-chain call)
|
|
3441
|
+
*
|
|
3442
|
+
* @param authorization - Authorization to check
|
|
3443
|
+
* @param currentIndex - Current usage count (optional, defaults to authorization.currentIndex)
|
|
3444
|
+
* @returns Authorization status
|
|
3445
|
+
*/
|
|
3446
|
+
getAuthorizationStatus(authorization: ReputationAuthorization, currentIndex?: number): {
|
|
3447
|
+
status: AuthorizationStatus;
|
|
3448
|
+
isValid: boolean;
|
|
3449
|
+
remainingUses: number;
|
|
3450
|
+
reason?: string;
|
|
3451
|
+
};
|
|
3452
|
+
/**
|
|
3453
|
+
* Fetch authorization from on-chain PDA
|
|
3454
|
+
*
|
|
3455
|
+
* @param agentAddress - Agent's address
|
|
3456
|
+
* @param authorizedSource - Authorized source address
|
|
3457
|
+
* @param nonce - Optional nonce (must match creation)
|
|
3458
|
+
* @returns Authorization with current on-chain status
|
|
2416
3459
|
*/
|
|
2417
|
-
|
|
3460
|
+
fetchAuthorization(agentAddress: Address$1, authorizedSource: Address$1, nonce?: string): Promise<AuthorizationWithStatus | null>;
|
|
2418
3461
|
/**
|
|
2419
|
-
*
|
|
3462
|
+
* Update reputation using authorization
|
|
3463
|
+
*
|
|
3464
|
+
* Called by facilitators (e.g., PayAI) to update agent reputation
|
|
3465
|
+
* using a pre-signed authorization.
|
|
3466
|
+
*
|
|
3467
|
+
* @param authorization - Authorization to use
|
|
3468
|
+
* @param reputationChange - Reputation change to apply
|
|
3469
|
+
* @param transactionSignature - Transaction signature for audit trail
|
|
3470
|
+
* @param usageRecord - PDA for usage record (audit trail)
|
|
3471
|
+
* @param metadata - Optional metadata
|
|
3472
|
+
* @param facilitatorSigner - Facilitator's signer
|
|
3473
|
+
* @returns Transaction signature
|
|
2420
3474
|
*/
|
|
2421
|
-
|
|
3475
|
+
updateReputationWithAuth(authorization: ReputationAuthorization, reputationChange: number, transactionSignature: string, usageRecord: Address$1, metadata: Record<string, unknown> | undefined, facilitatorSigner: TransactionSigner): Promise<string>;
|
|
2422
3476
|
/**
|
|
2423
|
-
*
|
|
3477
|
+
* Revoke authorization
|
|
3478
|
+
*
|
|
3479
|
+
* Agent can revoke an authorization before it expires or is exhausted.
|
|
3480
|
+
*
|
|
3481
|
+
* @param agentAddress - Agent's address
|
|
3482
|
+
* @param authorization - Authorization account PDA
|
|
3483
|
+
* @param nonce - Optional nonce (must match creation)
|
|
3484
|
+
* @param agentSigner - Agent's signer
|
|
3485
|
+
* @returns Transaction signature
|
|
2424
3486
|
*/
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
3487
|
+
revokeAuthorization(agentAddress: Address$1, authorization: Address$1, nonce: string | undefined, agentSigner: TransactionSigner): Promise<string>;
|
|
3488
|
+
/**
|
|
3489
|
+
* List authorizations for an agent (filtering)
|
|
3490
|
+
*
|
|
3491
|
+
* @param filter - Filter criteria
|
|
3492
|
+
* @returns List of authorizations
|
|
3493
|
+
*/
|
|
3494
|
+
listAuthorizations(filter: AuthorizationFilter): Promise<AuthorizationWithStatus[]>;
|
|
3495
|
+
/**
|
|
3496
|
+
* Serialize authorization for storage/transmission
|
|
3497
|
+
*
|
|
3498
|
+
* @param authorization - Authorization to serialize
|
|
3499
|
+
* @returns JSON-safe object
|
|
3500
|
+
*/
|
|
3501
|
+
serializeAuthorization(authorization: ReputationAuthorization): Record<string, unknown>;
|
|
3502
|
+
/**
|
|
3503
|
+
* Deserialize authorization from storage/transmission
|
|
3504
|
+
*
|
|
3505
|
+
* @param data - Serialized authorization data
|
|
3506
|
+
* @returns Authorization object
|
|
3507
|
+
*/
|
|
3508
|
+
deserializeAuthorization(data: Record<string, unknown>): ReputationAuthorization;
|
|
3509
|
+
/**
|
|
3510
|
+
* Get authorization ID (deterministic hash)
|
|
3511
|
+
*
|
|
3512
|
+
* @param authorization - Authorization to hash
|
|
3513
|
+
* @returns Base58-encoded hash
|
|
3514
|
+
*/
|
|
3515
|
+
getAuthorizationId(authorization: ReputationAuthorization): Promise<string>;
|
|
3516
|
+
/**
|
|
3517
|
+
* Helper: Create authorization for PayAI facilitator
|
|
3518
|
+
*
|
|
3519
|
+
* Convenience method with sensible defaults for PayAI integration.
|
|
3520
|
+
*
|
|
3521
|
+
* @param payAIFacilitatorAddress - PayAI facilitator address
|
|
3522
|
+
* @param agentKeypair - Agent's keypair
|
|
3523
|
+
* @param options - Optional overrides
|
|
3524
|
+
* @returns Signed authorization
|
|
3525
|
+
*
|
|
3526
|
+
* @example
|
|
3527
|
+
* ```typescript
|
|
3528
|
+
* const auth = await client.authorization.createPayAIAuthorization(
|
|
3529
|
+
* 'PayAI...FacilitatorAddress',
|
|
3530
|
+
* agentKeypair,
|
|
3531
|
+
* { indexLimit: 5000 } // Optional overrides
|
|
3532
|
+
* )
|
|
3533
|
+
* ```
|
|
3534
|
+
*/
|
|
3535
|
+
createPayAIAuthorization(payAIFacilitatorAddress: Address$1, agentKeypair: SigningKeypair, options?: Partial<CreateAuthorizationParams>): Promise<ReputationAuthorization>;
|
|
3536
|
+
/**
|
|
3537
|
+
* Calculate storage fee based on authorization duration and custom fees
|
|
3538
|
+
*
|
|
3539
|
+
* @param authorization - Authorization to calculate fee for
|
|
3540
|
+
* @param config - Storage configuration
|
|
3541
|
+
* @returns Fee in lamports
|
|
3542
|
+
*
|
|
3543
|
+
* @example
|
|
3544
|
+
* ```typescript
|
|
3545
|
+
* // Default fee: 0.002 SOL
|
|
3546
|
+
* const fee = module.calculateStorageFee(auth)
|
|
3547
|
+
*
|
|
3548
|
+
* // Custom fee for 30-day authorizations: 0.001 SOL
|
|
3549
|
+
* const fee = module.calculateStorageFee(auth, {
|
|
3550
|
+
* customFees: { 2592000: 1000000n } // 30 days = 0.001 SOL
|
|
3551
|
+
* })
|
|
3552
|
+
* ```
|
|
3553
|
+
*/
|
|
3554
|
+
private calculateStorageFee;
|
|
3555
|
+
/**
|
|
3556
|
+
* Estimate on-chain storage cost for an authorization
|
|
3557
|
+
*
|
|
3558
|
+
* @param params - Authorization parameters
|
|
3559
|
+
* @param config - Optional storage configuration
|
|
3560
|
+
* @returns Estimated cost in SOL
|
|
3561
|
+
*
|
|
3562
|
+
* @example
|
|
3563
|
+
* ```typescript
|
|
3564
|
+
* const costInSOL = await client.authorization.estimateStorageCost({
|
|
3565
|
+
* authorizedSource: facilitatorAddress,
|
|
3566
|
+
* expiresIn: 30 * 24 * 60 * 60 // 30 days
|
|
3567
|
+
* })
|
|
3568
|
+
* console.log(`On-chain storage will cost ${costInSOL} SOL`)
|
|
3569
|
+
* ```
|
|
3570
|
+
*/
|
|
3571
|
+
estimateStorageCost(params: CreateAuthorizationParams, config?: Partial<OnChainStorageConfig>): Promise<number>;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
interface StakeParams {
|
|
3575
|
+
/** Agent address to stake for */
|
|
3576
|
+
agent: Address$1;
|
|
3577
|
+
/** Agent's token account holding GHOST tokens */
|
|
3578
|
+
agentTokenAccount: Address$1;
|
|
3579
|
+
/** Staking vault to receive tokens */
|
|
3580
|
+
stakingVault: Address$1;
|
|
3581
|
+
/** Global staking config account */
|
|
3582
|
+
stakingConfig: Address$1;
|
|
3583
|
+
/** GHOST token mint address */
|
|
3584
|
+
ghostMint: Address$1;
|
|
3585
|
+
/** Amount of GHOST tokens to stake (in lamports) */
|
|
3586
|
+
amount: bigint;
|
|
3587
|
+
/** Lock duration in seconds */
|
|
3588
|
+
lockDuration: bigint;
|
|
3589
|
+
/** The agent owner's transaction signer */
|
|
3590
|
+
agentOwner: TransactionSigner;
|
|
3591
|
+
}
|
|
3592
|
+
interface UnstakeParams {
|
|
3593
|
+
/** Staking account to unstake from */
|
|
3594
|
+
stakingAccount: Address$1;
|
|
3595
|
+
/** Agent address */
|
|
3596
|
+
agent: Address$1;
|
|
3597
|
+
/** Staking vault holding the tokens */
|
|
3598
|
+
stakingVault: Address$1;
|
|
3599
|
+
/** Agent's token account to receive tokens */
|
|
3600
|
+
agentTokenAccount: Address$1;
|
|
3601
|
+
/** The agent owner's transaction signer */
|
|
3602
|
+
agentOwner: TransactionSigner;
|
|
3603
|
+
}
|
|
3604
|
+
interface InitializeStakingConfigParams {
|
|
3605
|
+
/** Admin who can modify staking config */
|
|
3606
|
+
authority: TransactionSigner;
|
|
3607
|
+
/** Minimum stake amount */
|
|
3608
|
+
minStake: bigint;
|
|
3609
|
+
/** Treasury address to receive fees */
|
|
3610
|
+
treasury: Address$1;
|
|
3611
|
+
}
|
|
3612
|
+
declare class StakingModule extends BaseModule {
|
|
3613
|
+
/**
|
|
3614
|
+
* Initialize the global staking configuration (admin only)
|
|
3615
|
+
*/
|
|
3616
|
+
initializeStakingConfig(params: InitializeStakingConfigParams): Promise<string>;
|
|
3617
|
+
/**
|
|
3618
|
+
* Stake GHOST tokens for an agent
|
|
3619
|
+
*
|
|
3620
|
+
* @param params - Staking parameters
|
|
3621
|
+
* @returns Transaction signature
|
|
3622
|
+
*/
|
|
3623
|
+
stake(params: StakeParams): Promise<string>;
|
|
3624
|
+
/**
|
|
3625
|
+
* Unstake GHOST tokens from an agent
|
|
3626
|
+
*
|
|
3627
|
+
* @param params - Unstaking parameters
|
|
3628
|
+
* @returns Transaction signature
|
|
3629
|
+
*/
|
|
3630
|
+
unstake(params: UnstakeParams): Promise<string>;
|
|
3631
|
+
/**
|
|
3632
|
+
* Get staking account for an agent
|
|
3633
|
+
*
|
|
3634
|
+
* @param stakingAccountAddress - The staking account address
|
|
3635
|
+
* @returns Staking account data or null if not found
|
|
3636
|
+
*/
|
|
3637
|
+
getStakingAccount(stakingAccountAddress: Address$1): Promise<StakingAccount | null>;
|
|
3638
|
+
/**
|
|
3639
|
+
* Get the global staking configuration
|
|
3640
|
+
*
|
|
3641
|
+
* @param stakingConfigAddress - The staking config account address
|
|
3642
|
+
* @returns Staking config data or null if not initialized
|
|
3643
|
+
*/
|
|
3644
|
+
getStakingConfig(stakingConfigAddress: Address$1): Promise<StakingConfig | null>;
|
|
2428
3645
|
}
|
|
3646
|
+
|
|
2429
3647
|
/**
|
|
2430
|
-
*
|
|
3648
|
+
* Main GhostSpeak client with fluent API design
|
|
3649
|
+
*
|
|
3650
|
+
* Example usage:
|
|
3651
|
+
* ```typescript
|
|
3652
|
+
* const ghostspeak = new GhostSpeak()
|
|
3653
|
+
*
|
|
3654
|
+
* // Create an agent
|
|
3655
|
+
* const agent = await ghostspeak
|
|
3656
|
+
* .agent()
|
|
3657
|
+
* .create({ name: "My Agent", capabilities: ["coding"] })
|
|
3658
|
+
* .compressed()
|
|
3659
|
+
* .execute()
|
|
3660
|
+
*
|
|
3661
|
+
* ```
|
|
2431
3662
|
*/
|
|
2432
|
-
|
|
2433
|
-
|
|
3663
|
+
declare class GhostSpeakClient {
|
|
3664
|
+
private config;
|
|
3665
|
+
constructor(config?: Partial<GhostSpeakConfig>);
|
|
3666
|
+
/**
|
|
3667
|
+
* Direct access to Agent Module for read operations
|
|
3668
|
+
*/
|
|
3669
|
+
get agents(): AgentModule;
|
|
3670
|
+
/**
|
|
3671
|
+
* Direct access to Ghost Module for claiming external agents
|
|
3672
|
+
*
|
|
3673
|
+
* Ghosts are external AI agents (type 10) that exist on x402 facilitators.
|
|
3674
|
+
* They can be claimed using Solana Attestation Service (SAS)
|
|
3675
|
+
* for trustless ownership verification.
|
|
3676
|
+
*/
|
|
3677
|
+
get ghosts(): GhostModule;
|
|
3678
|
+
/**
|
|
3679
|
+
* Direct access to Governance Module for read operations
|
|
3680
|
+
*/
|
|
3681
|
+
get governanceModule(): GovernanceModule;
|
|
3682
|
+
/**
|
|
3683
|
+
* Direct access to Multisig Module for read operations
|
|
3684
|
+
*/
|
|
3685
|
+
get multisigModule(): MultisigModule;
|
|
3686
|
+
/**
|
|
3687
|
+
* Agent operations
|
|
3688
|
+
*/
|
|
3689
|
+
agent(): AgentBuilder;
|
|
3690
|
+
/**
|
|
3691
|
+
* Reputation operations
|
|
3692
|
+
*/
|
|
3693
|
+
reputation(): ReputationModule;
|
|
3694
|
+
/**
|
|
3695
|
+
* Reputation Tag Engine (Pillar 2: Granular Tags)
|
|
3696
|
+
*
|
|
3697
|
+
* Automatic tag assignment and management based on agent metrics.
|
|
3698
|
+
* Features confidence scoring, evidence tracking, and tag decay.
|
|
3699
|
+
*/
|
|
3700
|
+
tagEngine(): any;
|
|
3701
|
+
/**
|
|
3702
|
+
* Multi-Source Reputation Aggregator (Pillar 3: External Sources)
|
|
3703
|
+
*
|
|
3704
|
+
* Aggregate reputation data from multiple sources (x402, GitHub, custom webhooks)
|
|
3705
|
+
* with weighted scoring and conflict detection.
|
|
3706
|
+
*/
|
|
3707
|
+
reputationAggregator(): any;
|
|
3708
|
+
/**
|
|
3709
|
+
* Privacy operations
|
|
3710
|
+
*/
|
|
3711
|
+
privacy(): PrivacyModule;
|
|
3712
|
+
/**
|
|
3713
|
+
* Governance operations
|
|
3714
|
+
*/
|
|
3715
|
+
governance(): GovernanceBuilder;
|
|
3716
|
+
/**
|
|
3717
|
+
* Multisig operations
|
|
3718
|
+
*/
|
|
3719
|
+
multisig(): MultisigBuilder;
|
|
3720
|
+
/**
|
|
3721
|
+
* Unified Credential operations (Solana + Crossmint)
|
|
3722
|
+
*/
|
|
3723
|
+
credentials(): UnifiedCredentialService;
|
|
3724
|
+
/**
|
|
3725
|
+
* DID operations (Decentralized Identifiers)
|
|
3726
|
+
*/
|
|
3727
|
+
did(): DidModule;
|
|
3728
|
+
/**
|
|
3729
|
+
* Direct access to Authorization Module for read operations
|
|
3730
|
+
*/
|
|
3731
|
+
get authorization(): AuthorizationModule;
|
|
3732
|
+
/**
|
|
3733
|
+
* Direct access to Staking Module for read operations
|
|
3734
|
+
*/
|
|
3735
|
+
get staking(): StakingModule;
|
|
3736
|
+
/**
|
|
3737
|
+
* Enable development mode features
|
|
3738
|
+
*/
|
|
3739
|
+
enableDevMode(): this;
|
|
3740
|
+
/**
|
|
3741
|
+
* Configure network
|
|
3742
|
+
*/
|
|
3743
|
+
useNetwork(cluster: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet'): this;
|
|
3744
|
+
/**
|
|
3745
|
+
* Configure custom RPC
|
|
3746
|
+
*/
|
|
3747
|
+
useRpc(endpoint: string, wsEndpoint?: string): this;
|
|
3748
|
+
/**
|
|
3749
|
+
* Get default RPC endpoint for cluster
|
|
3750
|
+
*/
|
|
3751
|
+
private getDefaultRpcEndpoint;
|
|
2434
3752
|
}
|
|
2435
3753
|
/**
|
|
2436
|
-
*
|
|
3754
|
+
* Agent builder for fluent API
|
|
2437
3755
|
*/
|
|
2438
|
-
declare class
|
|
3756
|
+
declare class AgentBuilder {
|
|
2439
3757
|
private module;
|
|
2440
|
-
private builderParams;
|
|
2441
3758
|
private params;
|
|
2442
|
-
constructor(
|
|
3759
|
+
constructor(config: GhostSpeakConfig);
|
|
2443
3760
|
create(params: {
|
|
2444
|
-
|
|
2445
|
-
description
|
|
2446
|
-
|
|
3761
|
+
name: string;
|
|
3762
|
+
description?: string;
|
|
3763
|
+
capabilities: string[];
|
|
2447
3764
|
}): this;
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
address: Address$1;
|
|
2454
|
-
signature: string;
|
|
2455
|
-
}>;
|
|
3765
|
+
withDescription(description: string): this;
|
|
3766
|
+
withType(agentType: number): this;
|
|
3767
|
+
withIPFS(): this;
|
|
3768
|
+
compressed(): this;
|
|
3769
|
+
debug(): this;
|
|
2456
3770
|
withSigner(signer: TransactionSigner): this;
|
|
2457
|
-
}
|
|
2458
|
-
/**
|
|
2459
|
-
* Job builder for fluent API
|
|
2460
|
-
*/
|
|
2461
|
-
declare class JobBuilder {
|
|
2462
|
-
private module;
|
|
2463
|
-
private builderParams;
|
|
2464
|
-
private params;
|
|
2465
|
-
constructor(module: MarketplaceModule, builderParams: MarketplaceBuilderParams);
|
|
2466
|
-
create(params: {
|
|
2467
|
-
title: string;
|
|
2468
|
-
description: string;
|
|
2469
|
-
}): this;
|
|
2470
|
-
budget(amount: bigint): this;
|
|
2471
|
-
duration(hours: number): this;
|
|
2472
|
-
skills(skillList: string[]): this;
|
|
2473
|
-
category(cat: string): this;
|
|
2474
3771
|
private validateParams;
|
|
3772
|
+
getCost(): Promise<bigint>;
|
|
3773
|
+
simulate(): Promise<unknown>;
|
|
3774
|
+
explain(): Promise<string>;
|
|
2475
3775
|
execute(): Promise<{
|
|
2476
3776
|
address: Address$1;
|
|
2477
3777
|
signature: string;
|
|
2478
3778
|
}>;
|
|
2479
|
-
|
|
3779
|
+
private deriveAgentAddress;
|
|
2480
3780
|
}
|
|
2481
3781
|
/**
|
|
2482
|
-
*
|
|
3782
|
+
* Channel builder parameters interface
|
|
2483
3783
|
*/
|
|
2484
|
-
declare class AuctionBuilder {
|
|
2485
|
-
private module;
|
|
2486
|
-
private builderParams;
|
|
2487
|
-
private params;
|
|
2488
|
-
constructor(module: MarketplaceModule, builderParams: MarketplaceBuilderParams);
|
|
2489
|
-
forService(serviceAddress: Address$1): this;
|
|
2490
|
-
startingPrice(price: bigint): this;
|
|
2491
|
-
reservePrice(price: bigint): this;
|
|
2492
|
-
duration(hours: number): this;
|
|
2493
|
-
english(): this;
|
|
2494
|
-
dutch(): this;
|
|
2495
|
-
private validateParams;
|
|
2496
|
-
execute(): Promise<{
|
|
2497
|
-
address: Address$1;
|
|
2498
|
-
signature: string;
|
|
2499
|
-
}>;
|
|
2500
|
-
withSigner(signer: TransactionSigner): this;
|
|
2501
|
-
}
|
|
2502
3784
|
/**
|
|
2503
|
-
* Marketplace
|
|
3785
|
+
* Marketplace builder for fluent API
|
|
2504
3786
|
*/
|
|
2505
|
-
declare class MarketplaceQuery {
|
|
2506
|
-
private module;
|
|
2507
|
-
constructor(module: MarketplaceModule);
|
|
2508
|
-
serviceListings(): Promise<{
|
|
2509
|
-
address: Address$1;
|
|
2510
|
-
data: ServiceListing;
|
|
2511
|
-
}[]>;
|
|
2512
|
-
serviceListingsByCategory(_category: string): Promise<{
|
|
2513
|
-
address: Address$1;
|
|
2514
|
-
data: ServiceListing;
|
|
2515
|
-
}[]>;
|
|
2516
|
-
jobPostings(): Promise<{
|
|
2517
|
-
address: Address$1;
|
|
2518
|
-
data: JobPosting;
|
|
2519
|
-
}[]>;
|
|
2520
|
-
auctions(): Promise<{
|
|
2521
|
-
address: Address$1;
|
|
2522
|
-
data: AuctionMarketplace;
|
|
2523
|
-
}[]>;
|
|
2524
|
-
}
|
|
2525
3787
|
/**
|
|
2526
3788
|
* Governance builder for fluent API
|
|
2527
3789
|
*/
|
|
@@ -2656,67 +3918,6 @@ declare class MultisigExecuteBuilder {
|
|
|
2656
3918
|
}>;
|
|
2657
3919
|
withSigner(signer: TransactionSigner): this;
|
|
2658
3920
|
}
|
|
2659
|
-
/**
|
|
2660
|
-
* Token2022 builder for fluent API
|
|
2661
|
-
*/
|
|
2662
|
-
declare class Token2022Builder {
|
|
2663
|
-
private module;
|
|
2664
|
-
private params;
|
|
2665
|
-
constructor(config: GhostSpeakConfig);
|
|
2666
|
-
/**
|
|
2667
|
-
* Create a basic mint
|
|
2668
|
-
*/
|
|
2669
|
-
mint(): MintBuilder;
|
|
2670
|
-
/**
|
|
2671
|
-
* Get Token2022 queries
|
|
2672
|
-
*/
|
|
2673
|
-
query(): Token2022Query;
|
|
2674
|
-
debug(): this;
|
|
2675
|
-
withSigner(signer: TransactionSigner): this;
|
|
2676
|
-
}
|
|
2677
|
-
/**
|
|
2678
|
-
* Token2022 builder parameters interface
|
|
2679
|
-
*/
|
|
2680
|
-
interface Token2022BuilderParams {
|
|
2681
|
-
signer?: TransactionSigner;
|
|
2682
|
-
}
|
|
2683
|
-
/**
|
|
2684
|
-
* Mint builder for fluent API
|
|
2685
|
-
*/
|
|
2686
|
-
declare class MintBuilder {
|
|
2687
|
-
private module;
|
|
2688
|
-
private builderParams;
|
|
2689
|
-
private params;
|
|
2690
|
-
constructor(module: Token2022Module, builderParams: Token2022BuilderParams);
|
|
2691
|
-
forAgent(agentAddress: Address$1): this;
|
|
2692
|
-
decimals(dec: number): this;
|
|
2693
|
-
freezeAuthority(authority: Address$1): this;
|
|
2694
|
-
withTransferFees(basisPoints: number, maxFee: bigint): this;
|
|
2695
|
-
withConfidentialTransfers(autoApprove?: boolean): this;
|
|
2696
|
-
withInterestBearing(rate: number): this;
|
|
2697
|
-
defaultAccountState(state: AccountState): this;
|
|
2698
|
-
private validateParams;
|
|
2699
|
-
execute(): Promise<{
|
|
2700
|
-
address: Address$1;
|
|
2701
|
-
signature: string;
|
|
2702
|
-
}>;
|
|
2703
|
-
withSigner(signer: TransactionSigner): this;
|
|
2704
|
-
}
|
|
2705
|
-
/**
|
|
2706
|
-
* Token2022 query helper
|
|
2707
|
-
*/
|
|
2708
|
-
declare class Token2022Query {
|
|
2709
|
-
private module;
|
|
2710
|
-
constructor(module: Token2022Module);
|
|
2711
|
-
allMints(): Promise<{
|
|
2712
|
-
address: Address$1;
|
|
2713
|
-
data: Token2022MintData;
|
|
2714
|
-
}[]>;
|
|
2715
|
-
mintsByAuthority(authority: Address$1): Promise<{
|
|
2716
|
-
address: Address$1;
|
|
2717
|
-
data: Token2022MintData;
|
|
2718
|
-
}[]>;
|
|
2719
|
-
}
|
|
2720
3921
|
|
|
2721
3922
|
/**
|
|
2722
3923
|
* Common utility functions for GhostSpeak SDK
|