@ghostspeak/sdk 2.0.6 → 2.0.7
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 +152 -30
- package/dist/GhostSpeakClient-CWmGaM9Q.d.ts +1007 -0
- package/dist/StakingModule-C5rzuOWb.d.ts +2526 -0
- package/dist/{agent-M74TCRON.js → agent-5YLZ7DAC.js} +4 -4
- package/dist/{agent-M74TCRON.js.map → agent-5YLZ7DAC.js.map} +1 -1
- package/dist/batch-operations-45CQFEID.js +4 -0
- package/dist/batch-operations-45CQFEID.js.map +1 -0
- package/dist/browser.d.ts +45 -554
- package/dist/browser.js +15 -842
- package/dist/browser.js.map +1 -1
- package/dist/chunk-AL3HQN73.js +754 -0
- package/dist/chunk-AL3HQN73.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-C5CDA3WX.js +7314 -0
- package/dist/chunk-C5CDA3WX.js.map +1 -0
- package/dist/chunk-E3FD2CNY.js +1869 -0
- package/dist/chunk-E3FD2CNY.js.map +1 -0
- package/dist/{chunk-F3DZMBUA.js → chunk-G7S6B6WB.js} +327 -493
- package/dist/chunk-G7S6B6WB.js.map +1 -0
- package/dist/chunk-IHVDQ4YI.js +4231 -0
- package/dist/chunk-IHVDQ4YI.js.map +1 -0
- package/dist/chunk-JV2SWONF.js +98 -0
- package/dist/chunk-JV2SWONF.js.map +1 -0
- package/dist/chunk-KB6CKIUK.js +231 -0
- package/dist/chunk-KB6CKIUK.js.map +1 -0
- package/dist/chunk-S74EH3KD.js +7890 -0
- package/dist/chunk-S74EH3KD.js.map +1 -0
- package/dist/chunk-SFTSZ3LC.js +156 -0
- package/dist/chunk-SFTSZ3LC.js.map +1 -0
- package/dist/chunk-SKMJJ3Q6.js +125 -0
- package/dist/chunk-SKMJJ3Q6.js.map +1 -0
- package/dist/chunk-SZGFSCNU.js +3682 -0
- package/dist/chunk-SZGFSCNU.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 +5 -4
- package/dist/client.js +11 -10
- package/dist/createAgentAuthorization-ULG47ZJI.js +5 -0
- package/dist/createAgentAuthorization-ULG47ZJI.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-EG5USUFG.js +9 -0
- package/dist/{generated-VNLHMR6Y.js.map → generated-EG5USUFG.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 +1209 -1506
- package/dist/index.js +600 -3532
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/minimal/core-minimal.d.ts +2383 -1264
- 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-OK7E7OK3.js +5 -0
- package/dist/revokeAuthorization-OK7E7OK3.js.map +1 -0
- package/dist/signature-verification-DGxR4aYQ.d.ts +448 -0
- package/dist/types.js +1 -1
- package/dist/updateReputationWithAuth-Y4ONEVSP.js +5 -0
- package/dist/updateReputationWithAuth-Y4ONEVSP.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 +24 -31
- 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
|
-
export { AGENT_DISCRIMINATOR, decodeAgent, fetchAgent, fetchAllAgent, fetchAllMaybeAgent, fetchMaybeAgent, getAgentCodec, getAgentDecoder, getAgentDiscriminatorBytes, getAgentEncoder } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
//# sourceMappingURL=agent-
|
|
4
|
-
//# sourceMappingURL=agent-
|
|
1
|
+
export { AGENT_DISCRIMINATOR, decodeAgent, fetchAgent, fetchAllAgent, fetchAllMaybeAgent, fetchMaybeAgent, getAgentCodec, getAgentDecoder, getAgentDiscriminatorBytes, getAgentEncoder } from './chunk-IHVDQ4YI.js';
|
|
2
|
+
import './chunk-UP2VWCW5.js';
|
|
3
|
+
//# sourceMappingURL=agent-5YLZ7DAC.js.map
|
|
4
|
+
//# sourceMappingURL=agent-5YLZ7DAC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-5YLZ7DAC.js"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { batchGetAccounts, batchGetAccountsWithRetry, batchGetAndMap, batchGetExistingAccounts, createBatchFetcher } from './chunk-SKMJJ3Q6.js';
|
|
2
|
+
import './chunk-UP2VWCW5.js';
|
|
3
|
+
//# sourceMappingURL=batch-operations-45CQFEID.js.map
|
|
4
|
+
//# sourceMappingURL=batch-operations-45CQFEID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"batch-operations-45CQFEID.js"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,577 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
export { d as
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
export { G as GovernanceProposal } from './ipfs-types-BOt9ZNg4.js';
|
|
1
|
+
export { aG as Agent, A as AgentModule, q as CredentialsModule, G as GhostSpeakConfig, a as GovernanceModule, M as MultisigModule, P as PayAIClient, a6 as ReputationData, R as ReputationModule, S as StakingModule } from './StakingModule-C5rzuOWb.js';
|
|
2
|
+
import * as _solana_addresses from '@solana/addresses';
|
|
3
|
+
import { Address } from '@solana/addresses';
|
|
4
|
+
export { d as deriveAgentPda, a as deriveUserRegistryPda } from './pda-Ce7VYg4T.js';
|
|
5
|
+
export { B as BadgeType, o as CategoryReputation, G as GovernanceProposal, J as JobPerformance, s as REPUTATION_CONSTANTS, a as ReputationCalculationResult, p as ReputationTier } from './reputation-types-Yebf0Rm_.js';
|
|
6
|
+
import '@solana/kit';
|
|
7
|
+
import 'node:events';
|
|
9
8
|
import './types.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* to add features, then rerun Codama to update it.
|
|
15
|
-
*
|
|
16
|
-
* @see https://github.com/codama-idl/codama
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
type DisputeEvidence = {
|
|
20
|
-
submitter: Address;
|
|
21
|
-
evidenceType: string;
|
|
22
|
-
evidenceData: string;
|
|
23
|
-
timestamp: bigint;
|
|
24
|
-
isVerified: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
29
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
30
|
-
* to add features, then rerun Codama to update it.
|
|
31
|
-
*
|
|
32
|
-
* @see https://github.com/codama-idl/codama
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
type DisputeCase = {
|
|
36
|
-
discriminator: ReadonlyUint8Array;
|
|
37
|
-
transaction: Address;
|
|
38
|
-
complainant: Address;
|
|
39
|
-
respondent: Address;
|
|
40
|
-
moderator: Option<Address>;
|
|
41
|
-
reason: string;
|
|
42
|
-
status: DisputeStatus;
|
|
43
|
-
evidence: Array<DisputeEvidence>;
|
|
44
|
-
resolution: Option<string>;
|
|
45
|
-
aiScore: number;
|
|
46
|
-
humanReview: boolean;
|
|
47
|
-
createdAt: bigint;
|
|
48
|
-
resolvedAt: Option<bigint>;
|
|
49
|
-
bump: number;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
54
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
55
|
-
* to add features, then rerun Codama to update it.
|
|
56
|
-
*
|
|
57
|
-
* @see https://github.com/codama-idl/codama
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
type StakingAccount = {
|
|
61
|
-
discriminator: ReadonlyUint8Array;
|
|
62
|
-
/** Owner of this staking account */
|
|
63
|
-
owner: Address;
|
|
64
|
-
/** Token mint being staked (GHOST token) */
|
|
65
|
-
tokenMint: Address;
|
|
66
|
-
/** Amount of tokens currently staked */
|
|
67
|
-
stakedAmount: bigint;
|
|
68
|
-
/** Timestamp when tokens were staked */
|
|
69
|
-
stakedAt: bigint;
|
|
70
|
-
/** Lockup end timestamp (0 if no lockup) */
|
|
71
|
-
lockupEndsAt: bigint;
|
|
72
|
-
/** Lockup tier (0=none, 1=1month, 2=3months, 3=6months, 4=1year, 5=2years) */
|
|
73
|
-
lockupTier: number;
|
|
74
|
-
/** Total rewards claimed */
|
|
75
|
-
rewardsClaimed: bigint;
|
|
76
|
-
/** Last reward claim timestamp */
|
|
77
|
-
lastClaimAt: bigint;
|
|
78
|
-
/** Pending rewards (not yet claimed) */
|
|
79
|
-
pendingRewards: bigint;
|
|
80
|
-
/** Whether auto-compound is enabled */
|
|
81
|
-
autoCompound: boolean;
|
|
82
|
-
/** Account creation timestamp */
|
|
83
|
-
createdAt: bigint;
|
|
84
|
-
/** Last update timestamp */
|
|
85
|
-
updatedAt: bigint;
|
|
86
|
-
/** PDA bump */
|
|
87
|
-
bump: number;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
92
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
93
|
-
* to add features, then rerun Codama to update it.
|
|
94
|
-
*
|
|
95
|
-
* @see https://github.com/codama-idl/codama
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
type StakingConfig = {
|
|
99
|
-
discriminator: ReadonlyUint8Array;
|
|
100
|
-
/** Authority that can update config */
|
|
101
|
-
authority: Address;
|
|
102
|
-
/** GHOST token mint address */
|
|
103
|
-
ghostTokenMint: Address;
|
|
104
|
-
/** Treasury account for reward distribution */
|
|
105
|
-
rewardsTreasury: Address;
|
|
106
|
-
/** Base APY in basis points (e.g., 500 = 5%) */
|
|
107
|
-
baseApy: number;
|
|
108
|
-
/** Bonus APY per lockup tier (basis points) */
|
|
109
|
-
tierBonusApy: Array<number>;
|
|
110
|
-
/** Minimum stake amount */
|
|
111
|
-
minStakeAmount: bigint;
|
|
112
|
-
/** Maximum stake amount per account (0 = no limit) */
|
|
113
|
-
maxStakeAmount: bigint;
|
|
114
|
-
/** Total tokens staked across all accounts */
|
|
115
|
-
totalStaked: bigint;
|
|
116
|
-
/** Total rewards distributed */
|
|
117
|
-
totalRewardsDistributed: bigint;
|
|
118
|
-
/** Whether staking is currently enabled */
|
|
119
|
-
isEnabled: boolean;
|
|
120
|
-
/** Emergency pause flag */
|
|
121
|
-
isPaused: boolean;
|
|
122
|
-
/** Creation timestamp */
|
|
123
|
-
createdAt: bigint;
|
|
124
|
-
/** Last update timestamp */
|
|
125
|
-
updatedAt: bigint;
|
|
126
|
-
/** PDA bump */
|
|
127
|
-
bump: number;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Reputation tier levels
|
|
132
|
-
*/
|
|
133
|
-
declare enum ReputationTier {
|
|
134
|
-
None = "None",
|
|
135
|
-
Bronze = "Bronze",
|
|
136
|
-
Silver = "Silver",
|
|
137
|
-
Gold = "Gold",
|
|
138
|
-
Platinum = "Platinum"
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Badge types for reputation achievements
|
|
142
|
-
*/
|
|
143
|
-
declare enum BadgeType {
|
|
144
|
-
FirstJob = "FirstJob",
|
|
145
|
-
TenJobs = "TenJobs",
|
|
146
|
-
HundredJobs = "HundredJobs",
|
|
147
|
-
ThousandJobs = "ThousandJobs",
|
|
148
|
-
PerfectRating = "PerfectRating",
|
|
149
|
-
QuickResponder = "QuickResponder",
|
|
150
|
-
HighEarner = "HighEarner",
|
|
151
|
-
DisputeResolver = "DisputeResolver",
|
|
152
|
-
CategoryExpert = "CategoryExpert",
|
|
153
|
-
CrossCategoryMaster = "CrossCategoryMaster"
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Category-specific reputation data
|
|
11
|
+
* GhostSpeak Protocol Constants
|
|
12
|
+
* July 2025 Implementation
|
|
157
13
|
*/
|
|
158
|
-
interface CategoryReputation {
|
|
159
|
-
/** Category identifier (e.g., "defi", "nft", "gaming") */
|
|
160
|
-
category: string;
|
|
161
|
-
/** Current reputation score in this category (basis points) */
|
|
162
|
-
score: number;
|
|
163
|
-
/** Total completed jobs in this category */
|
|
164
|
-
completedJobs: number;
|
|
165
|
-
/** Average completion time in seconds */
|
|
166
|
-
avgCompletionTime: number;
|
|
167
|
-
/** Quality ratings sum */
|
|
168
|
-
qualitySum: number;
|
|
169
|
-
/** Number of quality ratings */
|
|
170
|
-
qualityCount: number;
|
|
171
|
-
/** Last activity timestamp */
|
|
172
|
-
lastActivity: number;
|
|
173
|
-
/** Total earnings in this category */
|
|
174
|
-
totalEarnings: number;
|
|
175
|
-
}
|
|
176
14
|
/**
|
|
177
|
-
*
|
|
15
|
+
* Program ID for GhostSpeak Marketplace on Solana
|
|
16
|
+
* Deployed on devnet - December 30, 2025
|
|
17
|
+
* Deployment signature: 5zdU8HdtenhgwDmeEJu2ZPrQwoG9gztHHM5Ft6URxCzTj7m4y9ZkvmVKrpvMK41skcHvh8xa7ckNuUkQwPsierJr
|
|
178
18
|
*/
|
|
179
|
-
|
|
180
|
-
/** Whether job was completed successfully */
|
|
181
|
-
completed: boolean;
|
|
182
|
-
/** Quality rating (0-100) */
|
|
183
|
-
qualityRating: number;
|
|
184
|
-
/** Expected duration in seconds */
|
|
185
|
-
expectedDuration: number;
|
|
186
|
-
/** Actual duration in seconds */
|
|
187
|
-
actualDuration: number;
|
|
188
|
-
/** Client satisfaction (0-100) */
|
|
189
|
-
clientSatisfaction: number;
|
|
190
|
-
/** Whether there was a dispute */
|
|
191
|
-
hadDispute: boolean;
|
|
192
|
-
/** Whether dispute was resolved favorably for agent */
|
|
193
|
-
disputeResolvedFavorably: boolean;
|
|
194
|
-
/** Job category */
|
|
195
|
-
category: string;
|
|
196
|
-
/** Payment amount */
|
|
197
|
-
paymentAmount: number;
|
|
198
|
-
}
|
|
19
|
+
declare const GHOSTSPEAK_PROGRAM_ID: _solana_addresses.Address<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">;
|
|
199
20
|
/**
|
|
200
|
-
*
|
|
21
|
+
* Network-specific configurations
|
|
201
22
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
/** Fraud risk score (0-100) */
|
|
216
|
-
fraudRiskScore: number;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Constants for reputation calculations
|
|
220
|
-
*/
|
|
221
|
-
declare const REPUTATION_CONSTANTS: {
|
|
222
|
-
/** Maximum reputation score (basis points) */
|
|
223
|
-
MAX_REPUTATION_SCORE: number;
|
|
224
|
-
/** Minimum reputation score for slashing */
|
|
225
|
-
MIN_REPUTATION_FOR_SLASH: number;
|
|
226
|
-
/** Reputation decay rate per day (basis points) */
|
|
227
|
-
REPUTATION_DECAY_RATE_BPS: number;
|
|
228
|
-
/** Tier thresholds (basis points) */
|
|
229
|
-
BRONZE_TIER_THRESHOLD: number;
|
|
230
|
-
SILVER_TIER_THRESHOLD: number;
|
|
231
|
-
GOLD_TIER_THRESHOLD: number;
|
|
232
|
-
PLATINUM_TIER_THRESHOLD: number;
|
|
233
|
-
/** Maximum categories per agent */
|
|
234
|
-
MAX_REPUTATION_CATEGORIES: number;
|
|
235
|
-
/** Maximum performance history entries */
|
|
236
|
-
MAX_PERFORMANCE_HISTORY: number;
|
|
237
|
-
/** Maximum badges per agent */
|
|
238
|
-
MAX_BADGES: number;
|
|
23
|
+
declare const NETWORK_CONFIG: {
|
|
24
|
+
readonly devnet: {
|
|
25
|
+
readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
|
|
26
|
+
readonly rpcUrl: "https://api.devnet.solana.com";
|
|
27
|
+
};
|
|
28
|
+
readonly testnet: {
|
|
29
|
+
readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
|
|
30
|
+
readonly rpcUrl: "https://api.testnet.solana.com";
|
|
31
|
+
};
|
|
32
|
+
readonly mainnet: {
|
|
33
|
+
readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
|
|
34
|
+
readonly rpcUrl: "https://api.mainnet-beta.solana.com";
|
|
35
|
+
};
|
|
239
36
|
};
|
|
240
37
|
|
|
241
38
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* Manages GHOST token staking operations including:
|
|
245
|
-
* - Creating staking accounts
|
|
246
|
-
* - Staking tokens with lockup tiers
|
|
247
|
-
* - Claiming rewards
|
|
248
|
-
* - Auto-compounding
|
|
249
|
-
*/
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Lockup tier enum for staking
|
|
253
|
-
*/
|
|
254
|
-
declare enum LockupTier {
|
|
255
|
-
None = 0,
|
|
256
|
-
OneMonth = 1,
|
|
257
|
-
ThreeMonths = 2,
|
|
258
|
-
SixMonths = 3,
|
|
259
|
-
OneYear = 4,
|
|
260
|
-
TwoYears = 5
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Staking module for GHOST token staking operations
|
|
264
|
-
*/
|
|
265
|
-
declare class StakingModule extends BaseModule {
|
|
266
|
-
/**
|
|
267
|
-
* Derive staking account PDA for a user
|
|
268
|
-
* Seeds: ["staking", owner]
|
|
269
|
-
*/
|
|
270
|
-
deriveStakingAccountPda(owner: Address$1): Promise<Address$1>;
|
|
271
|
-
/**
|
|
272
|
-
* Derive staking config PDA
|
|
273
|
-
* Seeds: ["staking_config"]
|
|
274
|
-
*/
|
|
275
|
-
deriveStakingConfigPda(): Promise<Address$1>;
|
|
276
|
-
/**
|
|
277
|
-
* Initialize staking configuration (admin only)
|
|
278
|
-
*/
|
|
279
|
-
initializeConfig(params: {
|
|
280
|
-
signer: TransactionSigner;
|
|
281
|
-
ghostTokenMint: Address$1;
|
|
282
|
-
rewardsTreasury: Address$1;
|
|
283
|
-
baseApy: number;
|
|
284
|
-
minStakeAmount: bigint;
|
|
285
|
-
maxStakeAmount: bigint;
|
|
286
|
-
}): Promise<string>;
|
|
287
|
-
/**
|
|
288
|
-
* Create a staking account for a user
|
|
289
|
-
*/
|
|
290
|
-
createStakingAccount(params: {
|
|
291
|
-
signer: TransactionSigner;
|
|
292
|
-
}): Promise<string>;
|
|
293
|
-
/**
|
|
294
|
-
* Claim staking rewards
|
|
295
|
-
*/
|
|
296
|
-
claimRewards(params: {
|
|
297
|
-
signer: TransactionSigner;
|
|
298
|
-
ghostMint: Address$1;
|
|
299
|
-
userTokenAccount: Address$1;
|
|
300
|
-
rewardsTreasury: Address$1;
|
|
301
|
-
}): Promise<string>;
|
|
302
|
-
/**
|
|
303
|
-
* Get staking account for a user
|
|
304
|
-
*/
|
|
305
|
-
getStakingAccount(owner: Address$1): Promise<StakingAccount | null>;
|
|
306
|
-
/**
|
|
307
|
-
* Get staking account by address
|
|
308
|
-
*/
|
|
309
|
-
getStakingAccountByAddress(address: Address$1): Promise<StakingAccount | null>;
|
|
310
|
-
/**
|
|
311
|
-
* Get all staking accounts
|
|
312
|
-
*/
|
|
313
|
-
getAllStakingAccounts(): Promise<{
|
|
314
|
-
address: Address$1;
|
|
315
|
-
data: StakingAccount;
|
|
316
|
-
}[]>;
|
|
317
|
-
/**
|
|
318
|
-
* Get staking config
|
|
319
|
-
*/
|
|
320
|
-
getStakingConfig(): Promise<StakingConfig | null>;
|
|
321
|
-
/**
|
|
322
|
-
* Calculate pending rewards for a staking account
|
|
323
|
-
*/
|
|
324
|
-
calculatePendingRewards(stakingAccount: StakingAccount, config: StakingConfig): bigint;
|
|
325
|
-
/**
|
|
326
|
-
* Get tier bonus APY in basis points
|
|
327
|
-
*/
|
|
328
|
-
getTierBonusApy(tier: number, config: StakingConfig): number;
|
|
329
|
-
/**
|
|
330
|
-
* Get lockup duration in seconds for a tier
|
|
331
|
-
*/
|
|
332
|
-
getLockupDuration(tier: LockupTier): number;
|
|
333
|
-
/**
|
|
334
|
-
* Check if a staking account is locked
|
|
335
|
-
*/
|
|
336
|
-
isLocked(stakingAccount: StakingAccount): boolean;
|
|
337
|
-
/**
|
|
338
|
-
* Get time remaining on lockup in seconds
|
|
339
|
-
*/
|
|
340
|
-
getLockupTimeRemaining(stakingAccount: StakingAccount): number;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Dispute Module
|
|
39
|
+
* System Program Addresses for Solana
|
|
345
40
|
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
41
|
+
* These are the standard system program addresses used across Solana.
|
|
42
|
+
* Using constants instead of hardcoded values improves maintainability
|
|
43
|
+
* and ensures consistency across the SDK.
|
|
348
44
|
*/
|
|
349
45
|
|
|
350
46
|
/**
|
|
351
|
-
*
|
|
47
|
+
* SPL Token Program
|
|
48
|
+
* The standard SPL Token program
|
|
352
49
|
*/
|
|
353
|
-
declare
|
|
354
|
-
FavorComplainant = 0,
|
|
355
|
-
FavorRespondent = 1,
|
|
356
|
-
Split = 2,
|
|
357
|
-
Dismissed = 3
|
|
358
|
-
}
|
|
50
|
+
declare const TOKEN_PROGRAM_ADDRESS: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
|
|
359
51
|
/**
|
|
360
|
-
*
|
|
52
|
+
* SPL Token 2022 Program (Token Extensions)
|
|
53
|
+
* The new token program with extended functionality
|
|
361
54
|
*/
|
|
362
|
-
|
|
363
|
-
evidenceType: 'document' | 'screenshot' | 'message' | 'other';
|
|
364
|
-
description: string;
|
|
365
|
-
contentHash: string;
|
|
366
|
-
uri?: string;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Dispute module for handling escrow disputes
|
|
370
|
-
*/
|
|
371
|
-
declare class DisputeModule extends BaseModule {
|
|
372
|
-
/**
|
|
373
|
-
* Derive dispute case PDA
|
|
374
|
-
* Seeds: ["dispute", transaction_address, complainant, reason]
|
|
375
|
-
*/
|
|
376
|
-
deriveDisputePda(transactionAddress: Address$1, complainant: Address$1, reason: string): Promise<Address$1>;
|
|
377
|
-
/**
|
|
378
|
-
* Get dispute case by address
|
|
379
|
-
*/
|
|
380
|
-
getDisputeCase(address: Address$1): Promise<DisputeCase | null>;
|
|
381
|
-
/**
|
|
382
|
-
* Get all disputes
|
|
383
|
-
*/
|
|
384
|
-
getAllDisputes(): Promise<{
|
|
385
|
-
address: Address$1;
|
|
386
|
-
data: DisputeCase;
|
|
387
|
-
}[]>;
|
|
388
|
-
/**
|
|
389
|
-
* Get disputes by complainant
|
|
390
|
-
*/
|
|
391
|
-
getDisputesByComplainant(complainant: Address$1): Promise<{
|
|
392
|
-
address: Address$1;
|
|
393
|
-
data: DisputeCase;
|
|
394
|
-
}[]>;
|
|
395
|
-
/**
|
|
396
|
-
* Get disputes by respondent
|
|
397
|
-
*/
|
|
398
|
-
getDisputesByRespondent(respondent: Address$1): Promise<{
|
|
399
|
-
address: Address$1;
|
|
400
|
-
data: DisputeCase;
|
|
401
|
-
}[]>;
|
|
402
|
-
/**
|
|
403
|
-
* Get pending disputes (awaiting resolution)
|
|
404
|
-
*/
|
|
405
|
-
getPendingDisputes(): Promise<{
|
|
406
|
-
address: Address$1;
|
|
407
|
-
data: DisputeCase;
|
|
408
|
-
}[]>;
|
|
409
|
-
/**
|
|
410
|
-
* Check if a dispute is resolved
|
|
411
|
-
*/
|
|
412
|
-
isResolved(dispute: DisputeCase): boolean;
|
|
413
|
-
/**
|
|
414
|
-
* Get evidence count for a dispute
|
|
415
|
-
*/
|
|
416
|
-
getEvidenceCount(dispute: DisputeCase): number;
|
|
417
|
-
/**
|
|
418
|
-
* Get AI confidence score (0-100)
|
|
419
|
-
*/
|
|
420
|
-
getAiConfidence(dispute: DisputeCase): number;
|
|
421
|
-
/**
|
|
422
|
-
* Check if dispute requires human review
|
|
423
|
-
*/
|
|
424
|
-
requiresHumanReview(dispute: DisputeCase): boolean;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Simplified reputation data for module use
|
|
429
|
-
*/
|
|
430
|
-
interface ReputationData {
|
|
431
|
-
agent: Address$1;
|
|
432
|
-
overallScore: number;
|
|
433
|
-
totalJobsCompleted: number;
|
|
434
|
-
totalJobsFailed: number;
|
|
435
|
-
avgResponseTime: number;
|
|
436
|
-
disputesAgainst: number;
|
|
437
|
-
disputesResolved: number;
|
|
438
|
-
lastUpdated: number;
|
|
439
|
-
categoryReputations: CategoryReputation[];
|
|
440
|
-
badges: Array<{
|
|
441
|
-
badgeType: BadgeType;
|
|
442
|
-
earnedAt: number;
|
|
443
|
-
}>;
|
|
444
|
-
performanceHistory: Array<{
|
|
445
|
-
timestamp: number;
|
|
446
|
-
score: number;
|
|
447
|
-
jobsCompleted: number;
|
|
448
|
-
avgQuality: number;
|
|
449
|
-
}>;
|
|
450
|
-
factors: {
|
|
451
|
-
completionWeight: number;
|
|
452
|
-
qualityWeight: number;
|
|
453
|
-
timelinessWeight: number;
|
|
454
|
-
satisfactionWeight: number;
|
|
455
|
-
disputeWeight: number;
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Reputation module for managing reputation calculations
|
|
460
|
-
*/
|
|
461
|
-
declare class ReputationModule extends BaseModule {
|
|
462
|
-
private calculator;
|
|
463
|
-
constructor(config: GhostSpeakConfig);
|
|
464
|
-
/**
|
|
465
|
-
* Calculate reputation change for a job
|
|
466
|
-
*/
|
|
467
|
-
calculateReputationChange(currentData: ReputationData, jobPerformance: JobPerformance): ReputationCalculationResult;
|
|
468
|
-
/**
|
|
469
|
-
* Get tier name from tier enum
|
|
470
|
-
*/
|
|
471
|
-
getTierName(tier: ReputationTier): string;
|
|
472
|
-
/**
|
|
473
|
-
* Get tier from score
|
|
474
|
-
*/
|
|
475
|
-
getTierFromScore(score: number): ReputationTier;
|
|
476
|
-
/**
|
|
477
|
-
* Get badge display name
|
|
478
|
-
*/
|
|
479
|
-
getBadgeName(badge: BadgeType): string;
|
|
480
|
-
/**
|
|
481
|
-
* Calculate estimated APY boost from reputation
|
|
482
|
-
*/
|
|
483
|
-
calculateApyBoost(score: number): number;
|
|
484
|
-
/**
|
|
485
|
-
* Get reputation tier color for UI
|
|
486
|
-
*/
|
|
487
|
-
getTierColor(tier: ReputationTier): string;
|
|
488
|
-
/**
|
|
489
|
-
* Create default reputation data for new agents
|
|
490
|
-
*/
|
|
491
|
-
createDefaultReputationData(agentAddress: Address$1): ReputationData;
|
|
492
|
-
/**
|
|
493
|
-
* Check if agent qualifies for a specific tier
|
|
494
|
-
*/
|
|
495
|
-
qualifiesForTier(score: number, tier: ReputationTier): boolean;
|
|
496
|
-
/**
|
|
497
|
-
* Calculate points needed for next tier
|
|
498
|
-
*/
|
|
499
|
-
pointsToNextTier(score: number): {
|
|
500
|
-
nextTier: ReputationTier;
|
|
501
|
-
pointsNeeded: number;
|
|
502
|
-
} | null;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Auction Module
|
|
507
|
-
*
|
|
508
|
-
* Manages service auctions for AI agent capabilities.
|
|
509
|
-
* Provides read access to auction data.
|
|
510
|
-
*/
|
|
511
|
-
|
|
55
|
+
declare const TOKEN_2022_PROGRAM_ADDRESS: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
|
|
512
56
|
/**
|
|
513
|
-
*
|
|
57
|
+
* Associated Token Account Program
|
|
58
|
+
* Manages associated token accounts
|
|
514
59
|
*/
|
|
515
|
-
declare
|
|
516
|
-
English = 0,// Standard ascending auction
|
|
517
|
-
Dutch = 1,// Descending price auction
|
|
518
|
-
SealedBid = 2
|
|
519
|
-
}
|
|
60
|
+
declare const ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address<"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL">;
|
|
520
61
|
/**
|
|
521
|
-
*
|
|
62
|
+
* Native SOL Mint Address (wSOL) - Token 2022 Program
|
|
63
|
+
* The mint address for wrapped SOL on Token 2022
|
|
64
|
+
* This is the one used by GhostSpeak escrow operations
|
|
522
65
|
*/
|
|
523
|
-
declare
|
|
524
|
-
/**
|
|
525
|
-
* Derive auction PDA
|
|
526
|
-
* Seeds: ["auction", creator, auction_id]
|
|
527
|
-
*/
|
|
528
|
-
deriveAuctionPda(creator: Address$1, auctionId: string): Promise<Address$1>;
|
|
529
|
-
/**
|
|
530
|
-
* Get auction marketplace account
|
|
531
|
-
*/
|
|
532
|
-
getAuctionMarketplace(address: Address$1): Promise<AuctionMarketplace | null>;
|
|
533
|
-
/**
|
|
534
|
-
* Get all auction marketplaces
|
|
535
|
-
*/
|
|
536
|
-
getAllAuctions(): Promise<{
|
|
537
|
-
address: Address$1;
|
|
538
|
-
data: AuctionMarketplace;
|
|
539
|
-
}[]>;
|
|
540
|
-
/**
|
|
541
|
-
* Get auction by creator and ID
|
|
542
|
-
*/
|
|
543
|
-
getAuctionByCreatorAndId(creator: Address$1, auctionId: string): Promise<AuctionMarketplace | null>;
|
|
544
|
-
/**
|
|
545
|
-
* Calculate time remaining in auction
|
|
546
|
-
*/
|
|
547
|
-
getTimeRemaining(auction: AuctionMarketplace): number;
|
|
548
|
-
/**
|
|
549
|
-
* Check if auction has ended
|
|
550
|
-
*/
|
|
551
|
-
hasEnded(auction: AuctionMarketplace): boolean;
|
|
552
|
-
/**
|
|
553
|
-
* Get total bid count for an auction
|
|
554
|
-
*/
|
|
555
|
-
getTotalBids(auction: AuctionMarketplace): number;
|
|
556
|
-
/**
|
|
557
|
-
* Get auction metadata URI
|
|
558
|
-
*/
|
|
559
|
-
getMetadataUri(auction: AuctionMarketplace): string;
|
|
560
|
-
/**
|
|
561
|
-
* Check if reserve price was met
|
|
562
|
-
*/
|
|
563
|
-
isReserveMet(auction: AuctionMarketplace): boolean;
|
|
564
|
-
/**
|
|
565
|
-
* Get current winning price
|
|
566
|
-
*/
|
|
567
|
-
getCurrentPrice(auction: AuctionMarketplace): bigint;
|
|
568
|
-
/**
|
|
569
|
-
* Get auctions by creator
|
|
570
|
-
*/
|
|
571
|
-
getAuctionsByCreator(creator: Address$1): Promise<{
|
|
572
|
-
address: Address$1;
|
|
573
|
-
data: AuctionMarketplace;
|
|
574
|
-
}[]>;
|
|
575
|
-
}
|
|
66
|
+
declare const NATIVE_MINT_ADDRESS: Address<"9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP">;
|
|
576
67
|
|
|
577
|
-
export {
|
|
68
|
+
export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, GHOSTSPEAK_PROGRAM_ID, NATIVE_MINT_ADDRESS, NETWORK_CONFIG, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS };
|