@ghostspeak/sdk 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/EscrowInstructions-4P3H6ETO.js +2 -0
  3. package/dist/EscrowInstructions-4P3H6ETO.js.map +1 -0
  4. package/dist/GhostSpeakClient-4SROinEf.d.ts +503 -0
  5. package/dist/accounts-IUZMPYVE.js +2 -0
  6. package/dist/accounts-IUZMPYVE.js.map +1 -0
  7. package/dist/agent-GZ2OES75.js +2 -0
  8. package/dist/agent-GZ2OES75.js.map +1 -0
  9. package/dist/auctionMarketplace-W4YM7HKU.js +2 -0
  10. package/dist/auctionMarketplace-W4YM7HKU.js.map +1 -0
  11. package/dist/chunk-2KOOI5BX.js +2 -0
  12. package/dist/chunk-2KOOI5BX.js.map +1 -0
  13. package/dist/chunk-32GWTXRJ.js +3 -0
  14. package/dist/chunk-32GWTXRJ.js.map +1 -0
  15. package/dist/chunk-B4WUFVLE.js +2 -0
  16. package/dist/chunk-B4WUFVLE.js.map +1 -0
  17. package/dist/chunk-C2OTQ5YS.js +2 -0
  18. package/dist/chunk-C2OTQ5YS.js.map +1 -0
  19. package/dist/chunk-CTC4ZJ26.js +5 -0
  20. package/dist/chunk-CTC4ZJ26.js.map +1 -0
  21. package/dist/chunk-DF7LLAMH.js +2 -0
  22. package/dist/chunk-DF7LLAMH.js.map +1 -0
  23. package/dist/chunk-DJ356OUX.js +2 -0
  24. package/dist/chunk-DJ356OUX.js.map +1 -0
  25. package/dist/chunk-DK5YDBXR.js +2 -0
  26. package/dist/chunk-DK5YDBXR.js.map +1 -0
  27. package/dist/chunk-DOTF5ECA.js +4 -0
  28. package/dist/chunk-DOTF5ECA.js.map +1 -0
  29. package/dist/chunk-FKEUXXZS.js +30 -0
  30. package/dist/chunk-FKEUXXZS.js.map +1 -0
  31. package/dist/chunk-GSHXEKBW.js +2 -0
  32. package/dist/chunk-GSHXEKBW.js.map +1 -0
  33. package/dist/chunk-IZDAEOLH.js +2 -0
  34. package/dist/chunk-IZDAEOLH.js.map +1 -0
  35. package/dist/chunk-JY554RGE.js +3 -0
  36. package/dist/chunk-JY554RGE.js.map +1 -0
  37. package/dist/chunk-KK3HV2RD.js +3 -0
  38. package/dist/chunk-KK3HV2RD.js.map +1 -0
  39. package/dist/chunk-PPOCDM6G.js +2 -0
  40. package/dist/chunk-PPOCDM6G.js.map +1 -0
  41. package/dist/chunk-PUI35LBF.js +2 -0
  42. package/dist/chunk-PUI35LBF.js.map +1 -0
  43. package/dist/chunk-Q34J6YDA.js +11 -0
  44. package/dist/chunk-Q34J6YDA.js.map +1 -0
  45. package/dist/chunk-QATBFZMM.js +3 -0
  46. package/dist/chunk-QATBFZMM.js.map +1 -0
  47. package/dist/chunk-QTKN3VZV.js +2 -0
  48. package/dist/chunk-QTKN3VZV.js.map +1 -0
  49. package/dist/chunk-RFBYMTTN.js +2 -0
  50. package/dist/chunk-RFBYMTTN.js.map +1 -0
  51. package/dist/chunk-RJJPOLCK.js +22 -0
  52. package/dist/chunk-RJJPOLCK.js.map +1 -0
  53. package/dist/chunk-RTWJTEND.js +2 -0
  54. package/dist/chunk-RTWJTEND.js.map +1 -0
  55. package/dist/chunk-SR3ZJCME.js +2 -0
  56. package/dist/chunk-SR3ZJCME.js.map +1 -0
  57. package/dist/chunk-TAWXH7KX.js +2 -0
  58. package/dist/chunk-TAWXH7KX.js.map +1 -0
  59. package/dist/client.d.ts +4 -0
  60. package/dist/client.js +2 -0
  61. package/dist/client.js.map +1 -0
  62. package/dist/confidential-transfer-manager-CGS3T5DG.js +2 -0
  63. package/dist/confidential-transfer-manager-CGS3T5DG.js.map +1 -0
  64. package/dist/crypto.d.ts +331 -0
  65. package/dist/crypto.js +2 -0
  66. package/dist/crypto.js.map +1 -0
  67. package/dist/elgamal-3ABOJSHC.js +2 -0
  68. package/dist/elgamal-3ABOJSHC.js.map +1 -0
  69. package/dist/enhanced-client-errors-W22U3LNH.js +2 -0
  70. package/dist/enhanced-client-errors-W22U3LNH.js.map +1 -0
  71. package/dist/errors.d.ts +119 -0
  72. package/dist/errors.js +2 -0
  73. package/dist/errors.js.map +1 -0
  74. package/dist/feature-flags-CEaxXgQQ.d.ts +4157 -0
  75. package/dist/generated-U3L4KUE4.js +2 -0
  76. package/dist/generated-U3L4KUE4.js.map +1 -0
  77. package/dist/ghostspeak_wasm-3KPNJTSS.js +2 -0
  78. package/dist/ghostspeak_wasm-3KPNJTSS.js.map +1 -0
  79. package/dist/index.d.ts +1944 -17757
  80. package/dist/index.js +17 -68358
  81. package/dist/index.js.map +1 -1
  82. package/dist/ipfs-types-BlxtJ3q2.d.ts +194 -0
  83. package/dist/metafile-esm.json +1 -0
  84. package/dist/minimal/core-minimal.d.ts +444 -0
  85. package/dist/minimal/core-minimal.js +12 -0
  86. package/dist/minimal/core-minimal.js.map +1 -0
  87. package/dist/pda-2GUWRQ5G.js +2 -0
  88. package/dist/pda-2GUWRQ5G.js.map +1 -0
  89. package/dist/registerAgentCompressed-L6ACXD2Z.js +2 -0
  90. package/dist/registerAgentCompressed-L6ACXD2Z.js.map +1 -0
  91. package/dist/token-2022-rpc-SRHRFN5Y.js +2 -0
  92. package/dist/token-2022-rpc-SRHRFN5Y.js.map +1 -0
  93. package/dist/types.d.ts +396 -0
  94. package/dist/types.js +2 -0
  95. package/dist/types.js.map +1 -0
  96. package/dist/utils.d.ts +19 -0
  97. package/dist/utils.js +2 -0
  98. package/dist/utils.js.map +1 -0
  99. package/dist/zk-proof-builder-GXZ42QZA.js +2 -0
  100. package/dist/zk-proof-builder-GXZ42QZA.js.map +1 -0
  101. package/package.json +27 -1
@@ -0,0 +1,2 @@
1
+ export{b as EscrowInstructions}from'./chunk-QATBFZMM.js';import'./chunk-DOTF5ECA.js';import'./chunk-32GWTXRJ.js';import'./chunk-C2OTQ5YS.js';import'./chunk-QTKN3VZV.js';import'./chunk-DF7LLAMH.js';import'./chunk-FKEUXXZS.js';import'./chunk-TAWXH7KX.js';import'./chunk-2KOOI5BX.js';import'./chunk-GSHXEKBW.js';import'./chunk-PUI35LBF.js';import'./chunk-B4WUFVLE.js';import'./chunk-DJ356OUX.js';//# sourceMappingURL=EscrowInstructions-4P3H6ETO.js.map
2
+ //# sourceMappingURL=EscrowInstructions-4P3H6ETO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"EscrowInstructions-4P3H6ETO.js"}
@@ -0,0 +1,503 @@
1
+ import { Address as Address$1 } from '@solana/addresses';
2
+ import { ReadonlyUint8Array, Address, Option, Decoder, Rpc, GetLatestBlockhashApi, SendTransactionApi, GetAccountInfoApi, SimulateTransactionApi, GetFeeForMessageApi, GetProgramAccountsApi, GetEpochInfoApi, GetSignatureStatusesApi, GetMultipleAccountsApi, RpcSubscriptions, SignatureNotificationsApi, SlotNotificationsApi } from '@solana/kit';
3
+ import { I as IPFSConfig } from './ipfs-types-BlxtJ3q2.js';
4
+
5
+ /**
6
+ * This code was AUTOGENERATED using the codama library.
7
+ * Please DO NOT EDIT THIS FILE, instead use visitors
8
+ * to add features, then rerun codama to update it.
9
+ *
10
+ * @see https://github.com/codama-idl/codama
11
+ */
12
+
13
+ declare enum PricingModel$1 {
14
+ Fixed = 0,
15
+ Hourly = 1,
16
+ PerTask = 2,
17
+ Subscription = 3,
18
+ Auction = 4,
19
+ Dynamic = 5,
20
+ RevenueShare = 6,
21
+ Tiered = 7
22
+ }
23
+
24
+ /**
25
+ * This code was AUTOGENERATED using the codama library.
26
+ * Please DO NOT EDIT THIS FILE, instead use visitors
27
+ * to add features, then rerun codama to update it.
28
+ *
29
+ * @see https://github.com/codama-idl/codama
30
+ */
31
+
32
+ type Agent = {
33
+ discriminator: ReadonlyUint8Array;
34
+ owner: Address;
35
+ name: string;
36
+ description: string;
37
+ capabilities: Array<string>;
38
+ pricingModel: PricingModel$1;
39
+ reputationScore: number;
40
+ totalJobsCompleted: number;
41
+ totalEarnings: bigint;
42
+ isActive: boolean;
43
+ createdAt: bigint;
44
+ updatedAt: bigint;
45
+ originalPrice: bigint;
46
+ genomeHash: string;
47
+ isReplicable: boolean;
48
+ replicationFee: bigint;
49
+ serviceEndpoint: string;
50
+ isVerified: boolean;
51
+ verificationTimestamp: bigint;
52
+ metadataUri: string;
53
+ frameworkOrigin: string;
54
+ supportedTokens: Array<Address>;
55
+ cnftMint: Option<Address>;
56
+ merkleTree: Option<Address>;
57
+ supportsA2a: boolean;
58
+ transferHook: Option<Address>;
59
+ parentAgent: Option<Address>;
60
+ generation: number;
61
+ bump: number;
62
+ };
63
+ declare function getAgentDecoder(): Decoder<Agent>;
64
+
65
+ /**
66
+ * This code was AUTOGENERATED using the codama library.
67
+ * Please DO NOT EDIT THIS FILE, instead use visitors
68
+ * to add features, then rerun codama to update it.
69
+ *
70
+ * @see https://github.com/codama-idl/codama
71
+ */
72
+
73
+ type ServiceListing = {
74
+ discriminator: ReadonlyUint8Array;
75
+ agent: Address;
76
+ owner: Address;
77
+ title: string;
78
+ description: string;
79
+ price: bigint;
80
+ tokenMint: Address;
81
+ serviceType: string;
82
+ paymentToken: Address;
83
+ estimatedDelivery: bigint;
84
+ tags: Array<string>;
85
+ isActive: boolean;
86
+ totalOrders: number;
87
+ rating: number;
88
+ createdAt: bigint;
89
+ updatedAt: bigint;
90
+ transferHook: Option<Address>;
91
+ bump: number;
92
+ };
93
+
94
+ type RpcApi = Rpc<GetLatestBlockhashApi & SendTransactionApi & GetAccountInfoApi & SimulateTransactionApi & GetFeeForMessageApi & GetProgramAccountsApi>;
95
+ type ExtendedRpcApi = RpcApi & Rpc<GetEpochInfoApi & GetSignatureStatusesApi & GetMultipleAccountsApi>;
96
+ type RpcSubscriptionApi = RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>;
97
+ type Commitment = 'processed' | 'confirmed' | 'finalized';
98
+
99
+ interface GhostSpeakConfig {
100
+ programId?: Address$1;
101
+ rpc: ExtendedRpcApi;
102
+ rpcSubscriptions?: RpcSubscriptionApi;
103
+ commitment?: Commitment;
104
+ transactionTimeout?: number;
105
+ defaultFeePayer?: Address$1;
106
+ retryConfig?: RetryConfig;
107
+ cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
108
+ rpcEndpoint?: string;
109
+ wsEndpoint?: string;
110
+ /** Token 2022 configuration options */
111
+ token2022?: Token2022Config;
112
+ /** IPFS configuration for large content storage */
113
+ ipfsConfig?: IPFSConfig;
114
+ }
115
+ interface Token2022Config {
116
+ /** Enable Token 2022 features by default */
117
+ enabled?: boolean;
118
+ /** Default behavior for transfer fees */
119
+ defaultExpectTransferFees?: boolean;
120
+ /** Maximum transfer fee slippage (basis points) */
121
+ maxFeeSlippageBasisPoints?: number;
122
+ /** Enable confidential transfers by default */
123
+ enableConfidentialTransfers?: boolean;
124
+ /** Default Token 2022 program address (for custom deployments) */
125
+ programAddress?: Address$1;
126
+ /** Cache token program detection results for this many seconds */
127
+ tokenProgramCacheTtl?: number;
128
+ }
129
+ interface RetryConfig {
130
+ maxRetries?: number;
131
+ baseDelay?: number;
132
+ maxDelay?: number;
133
+ backoffMultiplier?: number;
134
+ retryableErrors?: string[];
135
+ }
136
+ interface AgentWithAddress {
137
+ address: Address$1;
138
+ data: Agent;
139
+ }
140
+ interface ServiceListingWithAddress {
141
+ address: Address$1;
142
+ data: ServiceListing;
143
+ }
144
+ interface AgentRegistrationData {
145
+ name: string;
146
+ description: string;
147
+ capabilities: string[];
148
+ metadataUri: string;
149
+ serviceEndpoint: string;
150
+ }
151
+ interface AgentAccount {
152
+ owner: Address$1;
153
+ name: string;
154
+ description: string;
155
+ capabilities: string[];
156
+ metadataUri: string;
157
+ serviceEndpoint: string;
158
+ isActive: boolean;
159
+ registeredAt: bigint;
160
+ reputation: number;
161
+ totalEarnings: bigint;
162
+ totalJobs: number;
163
+ successRate: number;
164
+ bump: number;
165
+ }
166
+ interface ServiceListingData {
167
+ id: string;
168
+ agent: Address$1;
169
+ title: string;
170
+ description: string;
171
+ price: bigint;
172
+ currency: Address$1;
173
+ category: string;
174
+ isActive: boolean;
175
+ createdAt: bigint;
176
+ }
177
+ interface JobPosting {
178
+ id: string;
179
+ poster: Address$1;
180
+ title: string;
181
+ description: string;
182
+ budget: bigint;
183
+ currency: Address$1;
184
+ deadline: bigint;
185
+ requirements: string[];
186
+ isActive: boolean;
187
+ createdAt: bigint;
188
+ }
189
+ interface EscrowAccount {
190
+ buyer: Address$1;
191
+ seller: Address$1;
192
+ agent: Address$1;
193
+ amount: bigint;
194
+ currency: Address$1;
195
+ status: EscrowStatus;
196
+ createdAt: bigint;
197
+ completedAt?: bigint;
198
+ }
199
+ declare enum EscrowStatus {
200
+ Active = "Active",
201
+ Completed = "Completed",
202
+ Disputed = "Disputed",
203
+ Cancelled = "Cancelled"
204
+ }
205
+ interface A2ASession {
206
+ sessionId: bigint;
207
+ initiator: Address$1;
208
+ responder: Address$1;
209
+ sessionType: string;
210
+ metadata: string;
211
+ isActive: boolean;
212
+ createdAt: bigint;
213
+ expiresAt: bigint;
214
+ }
215
+ interface A2AMessage {
216
+ messageId: bigint;
217
+ session: Address$1;
218
+ sender: Address$1;
219
+ content: string;
220
+ messageType: string;
221
+ sentAt: bigint;
222
+ }
223
+ declare enum PricingModel {
224
+ Fixed = "Fixed",
225
+ Hourly = "Hourly",
226
+ PerTask = "PerTask",
227
+ Subscription = "Subscription",
228
+ Auction = "Auction"
229
+ }
230
+ declare class GhostSpeakError extends Error {
231
+ code?: string | undefined;
232
+ constructor(message: string, code?: string | undefined);
233
+ }
234
+ interface RegisterAgentParams {
235
+ agentData: AgentRegistrationData;
236
+ }
237
+ interface CreateServiceListingParams {
238
+ title: string;
239
+ description: string;
240
+ price: bigint;
241
+ currency: Address$1;
242
+ category: string;
243
+ }
244
+ interface CreateJobPostingParams {
245
+ title: string;
246
+ description: string;
247
+ budget: bigint;
248
+ currency: Address$1;
249
+ deadline: bigint;
250
+ requirements: string[];
251
+ }
252
+ interface CreateEscrowParams {
253
+ seller: Address$1;
254
+ agent: Address$1;
255
+ amount: bigint;
256
+ currency: Address$1;
257
+ }
258
+ interface CreateA2ASessionParams {
259
+ responder: Address$1;
260
+ sessionType: string;
261
+ metadata: string;
262
+ expiresAt: bigint;
263
+ }
264
+ interface SendA2AMessageParams {
265
+ session: Address$1;
266
+ content: string;
267
+ messageType: string;
268
+ }
269
+ interface RpcResponse<T> {
270
+ value: T | null;
271
+ }
272
+ interface RpcAccountInfo {
273
+ executable: boolean;
274
+ lamports: bigint;
275
+ owner: Address$1;
276
+ rentEpoch: bigint;
277
+ space: bigint;
278
+ data: string | Uint8Array;
279
+ }
280
+ interface RpcProgramAccount {
281
+ pubkey: Address$1;
282
+ account: RpcAccountInfo;
283
+ }
284
+ interface RpcProgramAccountsResponse {
285
+ value: RpcProgramAccount[] | null;
286
+ }
287
+ interface RpcAccountInfoResponse {
288
+ value: RpcAccountInfo | null;
289
+ }
290
+ interface RpcMultipleAccountsResponse {
291
+ value: (RpcAccountInfo | null)[];
292
+ }
293
+ interface TransactionResponse {
294
+ signature: string;
295
+ confirmationStatus?: Commitment;
296
+ err?: unknown | null;
297
+ }
298
+ interface SimulatedTransactionResponse {
299
+ value: {
300
+ err?: unknown | null;
301
+ logs?: string[];
302
+ unitsConsumed?: number;
303
+ };
304
+ }
305
+ interface SolanaRpcClient {
306
+ getAccountInfo(address: Address$1, options?: {
307
+ commitment?: Commitment;
308
+ encoding?: string;
309
+ }): Promise<RpcAccountInfoResponse>;
310
+ getMultipleAccounts(addresses: Address$1[], options?: {
311
+ commitment?: Commitment;
312
+ encoding?: string;
313
+ }): Promise<RpcMultipleAccountsResponse>;
314
+ getProgramAccounts(programId: Address$1, options?: {
315
+ commitment?: Commitment;
316
+ encoding?: string;
317
+ filters?: unknown[];
318
+ }): Promise<RpcProgramAccountsResponse>;
319
+ sendTransaction(transaction: unknown, options?: {
320
+ commitment?: Commitment;
321
+ }): Promise<TransactionResponse>;
322
+ simulateTransaction(transaction: unknown, options?: {
323
+ commitment?: Commitment;
324
+ }): Promise<SimulatedTransactionResponse>;
325
+ }
326
+ interface EmergencyConfig {
327
+ emergencyDelay?: bigint;
328
+ emergencyThreshold?: number;
329
+ emergencySigners?: Address$1[];
330
+ canEmergencyPause?: boolean;
331
+ emergencyContact?: string;
332
+ }
333
+ interface MessageMetadata {
334
+ ipfsHash: string;
335
+ originalSize: number;
336
+ contentPreview: string;
337
+ uploadedAt: number;
338
+ }
339
+ interface ResolvedMessageContent {
340
+ resolvedContent: string;
341
+ isIPFS: boolean;
342
+ metadata?: MessageMetadata;
343
+ }
344
+
345
+ /**
346
+ * Main GhostSpeak client with fluent API design
347
+ *
348
+ * Example usage:
349
+ * ```typescript
350
+ * const ghostspeak = new GhostSpeak()
351
+ *
352
+ * // Create an agent
353
+ * const agent = await ghostspeak
354
+ * .agent()
355
+ * .create({ name: "My Agent", capabilities: ["coding"] })
356
+ * .compressed()
357
+ * .execute()
358
+ *
359
+ * // Create an escrow
360
+ * const escrow = await ghostspeak
361
+ * .escrow()
362
+ * .between(buyer, seller)
363
+ * .amount(sol(10))
364
+ * .withMilestones([...])
365
+ * .execute()
366
+ * ```
367
+ */
368
+ declare class GhostSpeak {
369
+ private config;
370
+ constructor(config?: Partial<GhostSpeakConfig>);
371
+ /**
372
+ * Agent operations
373
+ */
374
+ agent(): AgentBuilder;
375
+ /**
376
+ * Escrow operations
377
+ */
378
+ escrow(): EscrowBuilder;
379
+ /**
380
+ * Channel operations
381
+ */
382
+ channel(): ChannelBuilder;
383
+ /**
384
+ * Marketplace operations
385
+ */
386
+ marketplace(): MarketplaceBuilder;
387
+ /**
388
+ * Governance operations
389
+ */
390
+ governance(): GovernanceBuilder;
391
+ /**
392
+ * Token-2022 operations
393
+ */
394
+ token2022(): Token2022Builder;
395
+ /**
396
+ * Enable development mode features
397
+ */
398
+ enableDevMode(): this;
399
+ /**
400
+ * Configure network
401
+ */
402
+ useNetwork(cluster: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet'): this;
403
+ /**
404
+ * Configure custom RPC
405
+ */
406
+ useRpc(endpoint: string, wsEndpoint?: string): this;
407
+ /**
408
+ * Get default RPC endpoint for cluster
409
+ */
410
+ private getDefaultRpcEndpoint;
411
+ }
412
+ /**
413
+ * Agent builder for fluent API
414
+ */
415
+ declare class AgentBuilder {
416
+ private module;
417
+ private params;
418
+ constructor(config: GhostSpeakConfig);
419
+ create(params: {
420
+ name: string;
421
+ capabilities: string[];
422
+ }): this;
423
+ withType(agentType: number): this;
424
+ withIPFS(): this;
425
+ compressed(): this;
426
+ debug(): this;
427
+ private validateParams;
428
+ getCost(): Promise<bigint>;
429
+ simulate(): Promise<unknown>;
430
+ explain(): Promise<string>;
431
+ execute(): Promise<{
432
+ address: Address$1;
433
+ signature: string;
434
+ }>;
435
+ private deriveAgentAddress;
436
+ }
437
+ /**
438
+ * Escrow builder for fluent API
439
+ */
440
+ declare class EscrowBuilder {
441
+ private module;
442
+ private params;
443
+ constructor(config: GhostSpeakConfig);
444
+ between(buyer: Address$1, seller: Address$1): this;
445
+ amount(lamports: bigint): this;
446
+ description(desc: string): this;
447
+ withMilestones(milestones: Array<{
448
+ amount: bigint;
449
+ description: string;
450
+ }>): this;
451
+ debug(): this;
452
+ private validateParams;
453
+ getCost(): Promise<bigint>;
454
+ explain(): Promise<string>;
455
+ execute(): Promise<{
456
+ address: Address$1;
457
+ signature: string;
458
+ }>;
459
+ private deriveEscrowAddress;
460
+ }
461
+ /**
462
+ * Channel builder for fluent API
463
+ */
464
+ declare class ChannelBuilder {
465
+ private module;
466
+ private params;
467
+ constructor(config: GhostSpeakConfig);
468
+ create(name: string): this;
469
+ description(desc: string): this;
470
+ private(): this;
471
+ maxMembers(max: number): this;
472
+ debug(): this;
473
+ private validateParams;
474
+ getCost(): Promise<bigint>;
475
+ explain(): Promise<string>;
476
+ execute(): Promise<{
477
+ address: Address$1;
478
+ signature: string;
479
+ }>;
480
+ private deriveChannelAddress;
481
+ }
482
+ declare class MarketplaceBuilder {
483
+ private config;
484
+ constructor(config: GhostSpeakConfig);
485
+ }
486
+ declare class GovernanceBuilder {
487
+ private config;
488
+ constructor(config: GhostSpeakConfig);
489
+ }
490
+ declare class Token2022Builder {
491
+ private config;
492
+ constructor(config: GhostSpeakConfig);
493
+ }
494
+ /**
495
+ * Convert SOL to lamports
496
+ */
497
+ declare function sol(amount: number): bigint;
498
+ /**
499
+ * Convert lamports to SOL
500
+ */
501
+ declare function lamportsToSol(lamports: bigint): number;
502
+
503
+ export { type Agent as A, type RpcAccountInfoResponse as B, type Commitment as C, type RpcMultipleAccountsResponse as D, type ExtendedRpcApi as E, type SimulatedTransactionResponse as F, type GhostSpeakConfig as G, type SolanaRpcClient as H, type RetryConfig as I, type JobPosting as J, type RpcApi as K, getAgentDecoder as L, PricingModel$1 as P, type RpcSubscriptionApi as R, type ServiceListing as S, type TransactionResponse as T, type AgentWithAddress as a, type ServiceListingWithAddress as b, type EmergencyConfig as c, type ResolvedMessageContent as d, GhostSpeak as e, type AgentRegistrationData as f, type AgentAccount as g, type ServiceListingData as h, type EscrowAccount as i, EscrowStatus as j, type A2ASession as k, lamportsToSol as l, type A2AMessage as m, PricingModel as n, GhostSpeakError as o, type RegisterAgentParams as p, type CreateServiceListingParams as q, type CreateJobPostingParams as r, sol as s, type CreateEscrowParams as t, type CreateA2ASessionParams as u, type SendA2AMessageParams as v, type RpcResponse as w, type RpcAccountInfo as x, type RpcProgramAccount as y, type RpcProgramAccountsResponse as z };
@@ -0,0 +1,2 @@
1
+ export{a as A2_A_MESSAGE_DISCRIMINATOR,k as A2_A_SESSION_DISCRIMINATOR,u as A2_A_STATUS_DISCRIMINATOR,E as AGENT_INCENTIVES_DISCRIMINATOR,P as AGENT_TREE_CONFIG_DISCRIMINATOR,_ as AGENT_VERIFICATION_DISCRIMINATOR,ia as ANALYTICS_DASHBOARD_DISCRIMINATOR,sa as ARBITRATOR_REGISTRY_DISCRIMINATOR,Ca as AUDIT_TRAIL_DISCRIMINATOR,Ma as BULK_DEAL_DISCRIMINATOR,Wa as CHANNEL_DISCRIMINATOR,eb as COMPLIANCE_REPORT_DISCRIMINATOR,ob as DISPUTE_CASE_DISCRIMINATOR,yb as DYNAMIC_PRICING_ENGINE_DISCRIMINATOR,Ib as ESCROW_DISCRIMINATOR,Sb as EXTENSION_DISCRIMINATOR,ac as GOVERNANCE_PROPOSAL_DISCRIMINATOR,kc as INCENTIVE_PROGRAM_DISCRIMINATOR,vc as JOB_APPLICATION_DISCRIMINATOR,Fc as JOB_CONTRACT_DISCRIMINATOR,Qc as JOB_POSTING_DISCRIMINATOR,_c as MARKET_ANALYTICS_DISCRIMINATOR,id as MESSAGE_DISCRIMINATOR,sd as MULTISIG_DISCRIMINATOR,Cd as NEGOTIATION_CHATBOT_DISCRIMINATOR,Md as PAYMENT_DISCRIMINATOR,Wd as RBAC_CONFIG_DISCRIMINATOR,ee as REENTRANCY_GUARD_DISCRIMINATOR,pe as REPLICATION_RECORD_DISCRIMINATOR,ze as REPLICATION_TEMPLATE_DISCRIMINATOR,Je as RESALE_MARKET_DISCRIMINATOR,Te as ROYALTY_STREAM_DISCRIMINATOR,cf as SERVICE_LISTING_DISCRIMINATOR,mf as SERVICE_PURCHASE_DISCRIMINATOR,wf as USER_REGISTRY_DISCRIMINATOR,Hf as WORK_DELIVERY_DISCRIMINATOR,Rf as WORK_ORDER_DISCRIMINATOR,f as decodeA2AMessage,p as decodeA2ASession,z as decodeA2AStatus,J as decodeAgentIncentives,U as decodeAgentTreeConfig,da as decodeAgentVerification,na as decodeAnalyticsDashboard,xa as decodeArbitratorRegistry,Ha as decodeAuditTrail,Ra as decodeBulkDeal,$a as decodeChannel,jb as decodeComplianceReport,tb as decodeDisputeCase,Db as decodeDynamicPricingEngine,Nb as decodeEscrow,Xb as decodeExtension,fc as decodeGovernanceProposal,pc as decodeIncentiveProgram,Ac as decodeJobApplication,Kc as decodeJobContract,Vc as decodeJobPosting,dd as decodeMarketAnalytics,nd as decodeMessage,xd as decodeMultisig,Hd as decodeNegotiationChatbot,Rd as decodePayment,$d as decodeRbacConfig,je as decodeReentrancyGuard,ue as decodeReplicationRecord,Ee as decodeReplicationTemplate,Oe as decodeResaleMarket,Ye as decodeRoyaltyStream,hf as decodeServiceListing,rf as decodeServicePurchase,Bf as decodeUserRegistry,Mf as decodeWorkDelivery,Wf as decodeWorkOrder,g as fetchA2AMessage,q as fetchA2ASession,A as fetchA2AStatus,K as fetchAgentIncentives,V as fetchAgentTreeConfig,ea as fetchAgentVerification,i as fetchAllA2AMessage,s as fetchAllA2ASession,C as fetchAllA2AStatus,M as fetchAllAgentIncentives,X as fetchAllAgentTreeConfig,ga as fetchAllAgentVerification,qa as fetchAllAnalyticsDashboard,Aa as fetchAllArbitratorRegistry,Ka as fetchAllAuditTrail,Ua as fetchAllBulkDeal,cb as fetchAllChannel,mb as fetchAllComplianceReport,wb as fetchAllDisputeCase,Gb as fetchAllDynamicPricingEngine,Qb as fetchAllEscrow,_b as fetchAllExtension,ic as fetchAllGovernanceProposal,sc as fetchAllIncentiveProgram,Dc as fetchAllJobApplication,Nc as fetchAllJobContract,Yc as fetchAllJobPosting,gd as fetchAllMarketAnalytics,j as fetchAllMaybeA2AMessage,t as fetchAllMaybeA2ASession,D as fetchAllMaybeA2AStatus,N as fetchAllMaybeAgentIncentives,Y as fetchAllMaybeAgentTreeConfig,ha as fetchAllMaybeAgentVerification,ra as fetchAllMaybeAnalyticsDashboard,Ba as fetchAllMaybeArbitratorRegistry,La as fetchAllMaybeAuditTrail,Va as fetchAllMaybeBulkDeal,db as fetchAllMaybeChannel,nb as fetchAllMaybeComplianceReport,xb as fetchAllMaybeDisputeCase,Hb as fetchAllMaybeDynamicPricingEngine,Rb as fetchAllMaybeEscrow,$b as fetchAllMaybeExtension,jc as fetchAllMaybeGovernanceProposal,tc as fetchAllMaybeIncentiveProgram,Ec as fetchAllMaybeJobApplication,Oc as fetchAllMaybeJobContract,Zc as fetchAllMaybeJobPosting,hd as fetchAllMaybeMarketAnalytics,rd as fetchAllMaybeMessage,Bd as fetchAllMaybeMultisig,Ld as fetchAllMaybeNegotiationChatbot,Vd as fetchAllMaybePayment,de as fetchAllMaybeRbacConfig,ne as fetchAllMaybeReentrancyGuard,ye as fetchAllMaybeReplicationRecord,Ie as fetchAllMaybeReplicationTemplate,Se as fetchAllMaybeResaleMarket,af as fetchAllMaybeRoyaltyStream,lf as fetchAllMaybeServiceListing,vf as fetchAllMaybeServicePurchase,Ff as fetchAllMaybeUserRegistry,Qf as fetchAllMaybeWorkDelivery,_f as fetchAllMaybeWorkOrder,qd as fetchAllMessage,Ad as fetchAllMultisig,Kd as fetchAllNegotiationChatbot,Ud as fetchAllPayment,ce as fetchAllRbacConfig,me as fetchAllReentrancyGuard,xe as fetchAllReplicationRecord,He as fetchAllReplicationTemplate,Re as fetchAllResaleMarket,$e as fetchAllRoyaltyStream,kf as fetchAllServiceListing,uf as fetchAllServicePurchase,Ef as fetchAllUserRegistry,Pf as fetchAllWorkDelivery,Zf as fetchAllWorkOrder,oa as fetchAnalyticsDashboard,ya as fetchArbitratorRegistry,Ia as fetchAuditTrail,Sa as fetchBulkDeal,ab as fetchChannel,kb as fetchComplianceReport,ub as fetchDisputeCase,Eb as fetchDynamicPricingEngine,Ob as fetchEscrow,Yb as fetchExtension,gc as fetchGovernanceProposal,qc as fetchIncentiveProgram,Bc as fetchJobApplication,Lc as fetchJobContract,Wc as fetchJobPosting,ed as fetchMarketAnalytics,h as fetchMaybeA2AMessage,r as fetchMaybeA2ASession,B as fetchMaybeA2AStatus,L as fetchMaybeAgentIncentives,W as fetchMaybeAgentTreeConfig,fa as fetchMaybeAgentVerification,pa as fetchMaybeAnalyticsDashboard,za as fetchMaybeArbitratorRegistry,Ja as fetchMaybeAuditTrail,Ta as fetchMaybeBulkDeal,bb as fetchMaybeChannel,lb as fetchMaybeComplianceReport,vb as fetchMaybeDisputeCase,Fb as fetchMaybeDynamicPricingEngine,Pb as fetchMaybeEscrow,Zb as fetchMaybeExtension,hc as fetchMaybeGovernanceProposal,rc as fetchMaybeIncentiveProgram,Cc as fetchMaybeJobApplication,Mc as fetchMaybeJobContract,Xc as fetchMaybeJobPosting,fd as fetchMaybeMarketAnalytics,pd as fetchMaybeMessage,zd as fetchMaybeMultisig,Jd as fetchMaybeNegotiationChatbot,Td as fetchMaybePayment,be as fetchMaybeRbacConfig,le as fetchMaybeReentrancyGuard,we as fetchMaybeReplicationRecord,Ge as fetchMaybeReplicationTemplate,Qe as fetchMaybeResaleMarket,_e as fetchMaybeRoyaltyStream,jf as fetchMaybeServiceListing,tf as fetchMaybeServicePurchase,Df as fetchMaybeUserRegistry,Of as fetchMaybeWorkDelivery,Yf as fetchMaybeWorkOrder,od as fetchMessage,yd as fetchMultisig,Id as fetchNegotiationChatbot,Sd as fetchPayment,ae as fetchRbacConfig,ke as fetchReentrancyGuard,ve as fetchReplicationRecord,Fe as fetchReplicationTemplate,Pe as fetchResaleMarket,Ze as fetchRoyaltyStream,if as fetchServiceListing,sf as fetchServicePurchase,Cf as fetchUserRegistry,Nf as fetchWorkDelivery,Xf as fetchWorkOrder,e as getA2AMessageCodec,d as getA2AMessageDecoder,b as getA2AMessageDiscriminatorBytes,c as getA2AMessageEncoder,o as getA2ASessionCodec,n as getA2ASessionDecoder,l as getA2ASessionDiscriminatorBytes,m as getA2ASessionEncoder,y as getA2AStatusCodec,x as getA2AStatusDecoder,v as getA2AStatusDiscriminatorBytes,w as getA2AStatusEncoder,I as getAgentIncentivesCodec,H as getAgentIncentivesDecoder,F as getAgentIncentivesDiscriminatorBytes,G as getAgentIncentivesEncoder,O as getAgentIncentivesSize,T as getAgentTreeConfigCodec,S as getAgentTreeConfigDecoder,Q as getAgentTreeConfigDiscriminatorBytes,R as getAgentTreeConfigEncoder,Z as getAgentTreeConfigSize,ca as getAgentVerificationCodec,ba as getAgentVerificationDecoder,$ as getAgentVerificationDiscriminatorBytes,aa as getAgentVerificationEncoder,ma as getAnalyticsDashboardCodec,la as getAnalyticsDashboardDecoder,ja as getAnalyticsDashboardDiscriminatorBytes,ka as getAnalyticsDashboardEncoder,wa as getArbitratorRegistryCodec,va as getArbitratorRegistryDecoder,ta as getArbitratorRegistryDiscriminatorBytes,ua as getArbitratorRegistryEncoder,Ga as getAuditTrailCodec,Fa as getAuditTrailDecoder,Da as getAuditTrailDiscriminatorBytes,Ea as getAuditTrailEncoder,Qa as getBulkDealCodec,Pa as getBulkDealDecoder,Na as getBulkDealDiscriminatorBytes,Oa as getBulkDealEncoder,_a as getChannelCodec,Za as getChannelDecoder,Xa as getChannelDiscriminatorBytes,Ya as getChannelEncoder,ib as getComplianceReportCodec,hb as getComplianceReportDecoder,fb as getComplianceReportDiscriminatorBytes,gb as getComplianceReportEncoder,sb as getDisputeCaseCodec,rb as getDisputeCaseDecoder,pb as getDisputeCaseDiscriminatorBytes,qb as getDisputeCaseEncoder,Cb as getDynamicPricingEngineCodec,Bb as getDynamicPricingEngineDecoder,zb as getDynamicPricingEngineDiscriminatorBytes,Ab as getDynamicPricingEngineEncoder,Mb as getEscrowCodec,Lb as getEscrowDecoder,Jb as getEscrowDiscriminatorBytes,Kb as getEscrowEncoder,Wb as getExtensionCodec,Vb as getExtensionDecoder,Tb as getExtensionDiscriminatorBytes,Ub as getExtensionEncoder,ec as getGovernanceProposalCodec,dc as getGovernanceProposalDecoder,bc as getGovernanceProposalDiscriminatorBytes,cc as getGovernanceProposalEncoder,oc as getIncentiveProgramCodec,nc as getIncentiveProgramDecoder,lc as getIncentiveProgramDiscriminatorBytes,mc as getIncentiveProgramEncoder,uc as getIncentiveProgramSize,zc as getJobApplicationCodec,yc as getJobApplicationDecoder,wc as getJobApplicationDiscriminatorBytes,xc as getJobApplicationEncoder,Jc as getJobContractCodec,Ic as getJobContractDecoder,Gc as getJobContractDiscriminatorBytes,Hc as getJobContractEncoder,Pc as getJobContractSize,Uc as getJobPostingCodec,Tc as getJobPostingDecoder,Rc as getJobPostingDiscriminatorBytes,Sc as getJobPostingEncoder,cd as getMarketAnalyticsCodec,bd as getMarketAnalyticsDecoder,$c as getMarketAnalyticsDiscriminatorBytes,ad as getMarketAnalyticsEncoder,md as getMessageCodec,ld as getMessageDecoder,jd as getMessageDiscriminatorBytes,kd as getMessageEncoder,wd as getMultisigCodec,vd as getMultisigDecoder,td as getMultisigDiscriminatorBytes,ud as getMultisigEncoder,Gd as getNegotiationChatbotCodec,Fd as getNegotiationChatbotDecoder,Dd as getNegotiationChatbotDiscriminatorBytes,Ed as getNegotiationChatbotEncoder,Qd as getPaymentCodec,Pd as getPaymentDecoder,Nd as getPaymentDiscriminatorBytes,Od as getPaymentEncoder,_d as getRbacConfigCodec,Zd as getRbacConfigDecoder,Xd as getRbacConfigDiscriminatorBytes,Yd as getRbacConfigEncoder,ie as getReentrancyGuardCodec,he as getReentrancyGuardDecoder,fe as getReentrancyGuardDiscriminatorBytes,ge as getReentrancyGuardEncoder,oe as getReentrancyGuardSize,te as getReplicationRecordCodec,se as getReplicationRecordDecoder,qe as getReplicationRecordDiscriminatorBytes,re as getReplicationRecordEncoder,De as getReplicationTemplateCodec,Ce as getReplicationTemplateDecoder,Ae as getReplicationTemplateDiscriminatorBytes,Be as getReplicationTemplateEncoder,Ne as getResaleMarketCodec,Me as getResaleMarketDecoder,Ke as getResaleMarketDiscriminatorBytes,Le as getResaleMarketEncoder,Xe as getRoyaltyStreamCodec,We as getRoyaltyStreamDecoder,Ue as getRoyaltyStreamDiscriminatorBytes,Ve as getRoyaltyStreamEncoder,bf as getRoyaltyStreamSize,gf as getServiceListingCodec,ff as getServiceListingDecoder,df as getServiceListingDiscriminatorBytes,ef as getServiceListingEncoder,qf as getServicePurchaseCodec,pf as getServicePurchaseDecoder,nf as getServicePurchaseDiscriminatorBytes,of as getServicePurchaseEncoder,Af as getUserRegistryCodec,zf as getUserRegistryDecoder,xf as getUserRegistryDiscriminatorBytes,yf as getUserRegistryEncoder,Gf as getUserRegistrySize,Lf as getWorkDeliveryCodec,Kf as getWorkDeliveryDecoder,If as getWorkDeliveryDiscriminatorBytes,Jf as getWorkDeliveryEncoder,Vf as getWorkOrderCodec,Uf as getWorkOrderDecoder,Sf as getWorkOrderDiscriminatorBytes,Tf as getWorkOrderEncoder}from'./chunk-DF7LLAMH.js';export{a as AGENT_DISCRIMINATOR,f as decodeAgent,g as fetchAgent,i as fetchAllAgent,j as fetchAllMaybeAgent,h as fetchMaybeAgent,e as getAgentCodec,d as getAgentDecoder,b as getAgentDiscriminatorBytes,c as getAgentEncoder}from'./chunk-GSHXEKBW.js';export{a as AUCTION_MARKETPLACE_DISCRIMINATOR,f as decodeAuctionMarketplace,i as fetchAllAuctionMarketplace,j as fetchAllMaybeAuctionMarketplace,g as fetchAuctionMarketplace,h as fetchMaybeAuctionMarketplace,e as getAuctionMarketplaceCodec,d as getAuctionMarketplaceDecoder,b as getAuctionMarketplaceDiscriminatorBytes,c as getAuctionMarketplaceEncoder}from'./chunk-PUI35LBF.js';import'./chunk-B4WUFVLE.js';import'./chunk-DJ356OUX.js';//# sourceMappingURL=accounts-IUZMPYVE.js.map
2
+ //# sourceMappingURL=accounts-IUZMPYVE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"accounts-IUZMPYVE.js"}
@@ -0,0 +1,2 @@
1
+ export{a as AGENT_DISCRIMINATOR,f as decodeAgent,g as fetchAgent,i as fetchAllAgent,j as fetchAllMaybeAgent,h as fetchMaybeAgent,e as getAgentCodec,d as getAgentDecoder,b as getAgentDiscriminatorBytes,c as getAgentEncoder}from'./chunk-GSHXEKBW.js';import'./chunk-B4WUFVLE.js';import'./chunk-DJ356OUX.js';//# sourceMappingURL=agent-GZ2OES75.js.map
2
+ //# sourceMappingURL=agent-GZ2OES75.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-GZ2OES75.js"}
@@ -0,0 +1,2 @@
1
+ export{a as AUCTION_MARKETPLACE_DISCRIMINATOR,f as decodeAuctionMarketplace,i as fetchAllAuctionMarketplace,j as fetchAllMaybeAuctionMarketplace,g as fetchAuctionMarketplace,h as fetchMaybeAuctionMarketplace,e as getAuctionMarketplaceCodec,d as getAuctionMarketplaceDecoder,b as getAuctionMarketplaceDiscriminatorBytes,c as getAuctionMarketplaceEncoder}from'./chunk-PUI35LBF.js';import'./chunk-B4WUFVLE.js';import'./chunk-DJ356OUX.js';//# sourceMappingURL=auctionMarketplace-W4YM7HKU.js.map
2
+ //# sourceMappingURL=auctionMarketplace-W4YM7HKU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"auctionMarketplace-W4YM7HKU.js"}
@@ -0,0 +1,2 @@
1
+ if(typeof globalThis.TextEncoder>"u"&&typeof process<"u"&&process?.versions?.node)try{let util=eval("require")("util");globalThis.TextEncoder=util.TextEncoder,globalThis.TextDecoder=util.TextDecoder;}catch{}//# sourceMappingURL=chunk-2KOOI5BX.js.map
2
+ //# sourceMappingURL=chunk-2KOOI5BX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/text-encoder-polyfill.ts"],"names":[],"mappings":"AAUA,GAAI,OAAO,UAAA,CAAW,WAAA,CAAgB,GAAA,EAEhC,OAAO,OAAA,CAAY,GAAA,EAAe,OAAA,EAAS,QAAA,EAAU,IAAA,CACvD,GAAI,CAGF,IAAM,IAAA,CAAO,IAAA,CAAK,SAAS,CAAA,CAAE,MAAM,CAAA,CAEnC,UAAA,CAAW,WAAA,CAAc,IAAA,CAAK,WAAA,CAE9B,UAAA,CAAW,WAAA,CAAc,IAAA,CAAK,YAChC,CAAA,KAAQ,CAER","file":"chunk-2KOOI5BX.js","sourcesContent":["/**\n * TextEncoder polyfill for Node.js compatibility\n * Node.js has TextEncoder in the util module, but not in global scope\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const globalThis: any\n\n// Check if TextEncoder is already available globally\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\nif (typeof globalThis.TextEncoder === 'undefined') {\n // In Node.js environment, try to use util module\n if (typeof process !== 'undefined' && process?.versions?.node) {\n try {\n // Dynamic import for Node.js util module\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const util = eval('require')('util')\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n globalThis.TextEncoder = util.TextEncoder\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n globalThis.TextDecoder = util.TextDecoder\n } catch {\n // Ignore errors - TextEncoder might not be needed or available elsewhere\n }\n }\n}\n\n// Export for explicit usage\nexport const getTextEncoder = (): typeof TextEncoder => {\n if (typeof TextEncoder !== 'undefined') {\n return TextEncoder\n }\n \n // Fallback for environments without TextEncoder\n throw new Error('TextEncoder is not available in this environment')\n}\n\nexport const getTextDecoder = (): typeof TextDecoder => {\n if (typeof TextDecoder !== 'undefined') {\n return TextDecoder\n }\n \n // Fallback for environments without TextDecoder \n throw new Error('TextDecoder is not available in this environment')\n}"]}
@@ -0,0 +1,3 @@
1
+ import {b}from'./chunk-C2OTQ5YS.js';import {a}from'./chunk-DJ356OUX.js';import {address}from'@solana/addresses';import {SYSVAR_CLOCK_ADDRESS}from'@solana/sysvars';import {getAddressEncoder,getU64Encoder,getBytesEncoder,getUtf8Encoder,getProgramDerivedAddress}from'@solana/kit';import {ed25519}from'@noble/curves/ed25519';import {randomBytes}from'@noble/curves/abstract/utils';import {sha256}from'@noble/hashes/sha256';address("11111111111111111111111111111111");var ke=address("11111111111111111111111111111111"),De=SYSVAR_CLOCK_ADDRESS;address("SysvarRecentB1ockHashes11111111111111111111");address("SysvarStakeHistory1111111111111111111111111");address("Sysvar1nstructions1111111111111111111111111");var y=address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),x=address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),L=address("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),Le=address("So11111111111111111111111111111111111111112");address("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");var J=(n=>(n.SPL_TOKEN="spl-token",n.TOKEN_2022="token-2022",n))(J||{}),K=(s=>(s[s.UNINITIALIZED=0]="UNINITIALIZED",s[s.TRANSFER_FEE_CONFIG=1]="TRANSFER_FEE_CONFIG",s[s.TRANSFER_FEE_AMOUNT=2]="TRANSFER_FEE_AMOUNT",s[s.MINT_CLOSE_AUTHORITY=3]="MINT_CLOSE_AUTHORITY",s[s.CONFIDENTIAL_TRANSFER_MINT=4]="CONFIDENTIAL_TRANSFER_MINT",s[s.CONFIDENTIAL_TRANSFER_ACCOUNT=5]="CONFIDENTIAL_TRANSFER_ACCOUNT",s[s.DEFAULT_ACCOUNT_STATE=6]="DEFAULT_ACCOUNT_STATE",s[s.IMMUTABLE_OWNER=7]="IMMUTABLE_OWNER",s[s.MEMO_TRANSFER=8]="MEMO_TRANSFER",s[s.NON_TRANSFERABLE=9]="NON_TRANSFERABLE",s[s.INTEREST_BEARING_MINT=10]="INTEREST_BEARING_MINT",s[s.CPI_GUARD=11]="CPI_GUARD",s[s.PERMANENT_DELEGATE=12]="PERMANENT_DELEGATE",s[s.NON_TRANSFERABLE_ACCOUNT=13]="NON_TRANSFERABLE_ACCOUNT",s[s.TRANSFER_HOOK=14]="TRANSFER_HOOK",s[s.TRANSFER_HOOK_ACCOUNT=15]="TRANSFER_HOOK_ACCOUNT",s[s.METADATA_POINTER=16]="METADATA_POINTER",s[s.TOKEN_METADATA=17]="TOKEN_METADATA",s[s.GROUP_POINTER=18]="GROUP_POINTER",s[s.TOKEN_GROUP=19]="TOKEN_GROUP",s[s.GROUP_MEMBER_POINTER=20]="GROUP_MEMBER_POINTER",s[s.TOKEN_GROUP_MEMBER=21]="TOKEN_GROUP_MEMBER",s))(K||{});async function O(e,t,n=y){let[r]=await getProgramDerivedAddress({programAddress:L,seeds:[getAddressEncoder().encode(e),getAddressEncoder().encode(n),getAddressEncoder().encode(t)]});return r}async function X(e,t){return O(e,t,y)}async function ee(e,t){return O(e,t,x)}async function We(e,t,n){let r=n??y,i=r===x;return {address:await O(e,t,r),owner:e,mint:t,tokenProgram:r,isToken2022:i}}async function te(e,t="https://api.devnet.solana.com"){try{let{createSolanaRpc:n}=await import('@solana/kit'),i=await n(t).getAccountInfo(e,{encoding:"base64",commitment:"confirmed"}).send();if(!i.value)throw new Error(`Mint account ${e} not found`);let a=i.value.owner;return a===y?y:a===x?x:(console.warn(`Unknown token program owner: ${a}, defaulting to SPL Token`),y)}catch(n){return console.error(`Failed to detect token program for mint ${e}:`,n),y}}async function ne(e){return await te(e)===x}async function Ye(e){return await ne(e)?"token-2022":"spl-token"}async function k(e,t,n="https://api.devnet.solana.com"){try{let{getMintWithExtensions:r}=await import('./token-2022-rpc-SRHRFN5Y.js'),{createSolanaRpc:i}=await import('@solana/kit'),a=i(n),o=await r(a,e,"confirmed");if(!o){let c={};for(let f of t)c[f]=!1;return c}let m={};for(let c of t)switch(c){case 1:m[c]=!!o.extensions.transferFeeConfig;break;case 3:m[c]=!!o.extensions.mintCloseAuthority;break;case 4:m[c]=!!o.extensions.confidentialTransferMint;break;case 6:m[c]=!!o.extensions.defaultAccountState;break;case 9:m[c]=!!o.extensions.nonTransferable;break;case 10:m[c]=!!o.extensions.interestBearingConfig;break;case 12:m[c]=!!o.extensions.permanentDelegate;break;case 14:m[c]=!!o.extensions.transferHook;break;case 16:m[c]=!!o.extensions.metadataPointer;break;case 17:m[c]=!!o.extensions.tokenMetadata;break;case 18:m[c]=!!o.extensions.groupPointer;break;case 19:m[c]=!!o.extensions.tokenGroup;break;default:m[c]=!1;}return m}catch(r){console.error(`Failed to check Token-2022 extensions for mint ${e}:`,r);let i={};for(let a of t)i[a]=false;return i}}async function Ze(e,t="https://api.devnet.solana.com"){return (await k(e,[1],t))[1]}async function $e(e,t="https://api.devnet.solana.com"){return (await k(e,[4],t))[4]}async function ze(e,t="https://api.devnet.solana.com"){return (await k(e,[10],t))[10]}async function je(e,t="https://api.devnet.solana.com"){try{let{getMintWithExtensions:n}=await import('./token-2022-rpc-SRHRFN5Y.js'),{createSolanaRpc:r}=await import('@solana/kit'),i=r(t),a=await n(i,e,"confirmed");if(!a?.extensions.transferFeeConfig)return null;let o=a.extensions.transferFeeConfig;return {transferFeeBasisPoints:o.newerTransferFee.transferFeeBasisPoints,maximumFee:o.newerTransferFee.maximumFee,transferFeeConfigAuthority:o.transferFeeConfigAuthority,withdrawWithheldAuthority:o.withdrawWithheldAuthority,withheldAmount:BigInt(0),olderTransferFee:{epoch:o.olderTransferFee.epoch||BigInt(0),transferFeeBasisPoints:o.olderTransferFee.transferFeeBasisPoints||0,maximumFee:o.olderTransferFee.maximumFee||BigInt(0)},newerTransferFee:{epoch:o.newerTransferFee.epoch,transferFeeBasisPoints:o.newerTransferFee.transferFeeBasisPoints,maximumFee:o.newerTransferFee.maximumFee}}}catch(n){return console.error(`Failed to get transfer fee config for mint ${e}:`,n),null}}async function Qe(e,t="https://api.devnet.solana.com"){try{let{getMintWithExtensions:n}=await import('./token-2022-rpc-SRHRFN5Y.js'),{createSolanaRpc:r}=await import('@solana/kit'),i=r(t),a=await n(i,e,"confirmed");if(!a?.extensions.confidentialTransferMint)return null;let o=a.extensions.confidentialTransferMint;return {authority:o.authority,autoApproveNewAccounts:o.autoApproveNewAccounts,auditorElgamalPubkey:o.auditorElgamalPubkey}}catch(n){return console.error(`Failed to get confidential transfer config for mint ${e}:`,n),null}}async function Je(e,t="https://api.devnet.solana.com"){try{let{getMintWithExtensions:n}=await import('./token-2022-rpc-SRHRFN5Y.js'),{createSolanaRpc:r}=await import('@solana/kit'),i=r(t),a=await n(i,e,"confirmed");if(!a?.extensions.interestBearingConfig)return null;let o=a.extensions.interestBearingConfig;return {rateAuthority:o.rateAuthority,currentRate:o.currentRate,initializationTimestamp:o.initializationTimestamp||BigInt(Math.floor(Date.now()/1e3)),lastUpdateTimestamp:o.lastUpdateTimestamp,preUpdateAverageRate:o.preUpdateAverageRate}}catch(n){return console.error(`Failed to get interest-bearing config for mint ${e}:`,n),null}}async function re(e,t){let[n,r]=await Promise.all([X(e,t),ee(e,t)]);return {splToken:n,token2022:r}}async function Xe(e,t,n){let r=await re(t,n);return e===r.splToken?{isValid:true,program:y}:e===r.token2022?{isValid:true,program:x}:{isValid:false}}function et(e){switch(e){case "spl-token":return y;case "token-2022":return x;default:throw new Error(`Unknown token program: ${e}`)}}function tt(e){if(e===y)return "spl-token";if(e===x)return "token-2022";throw new Error(`Unknown token program address: ${e}`)}function nt(e,t){let n=BigInt(10**t),r=e/n,i=e%n;if(i===0n)return r.toString();let o=i.toString().padStart(t,"0").replace(/0+$/,"");return `${r}.${o}`}function rt(e,t){let[n,r=""]=e.split("."),i=r.padEnd(t,"0").slice(0,t),a=n+i;return BigInt(a)}function oe(e){try{let t;if(Buffer.isBuffer(e)){let n=e.toString();t=JSON.parse(n);}else t=e;if(t&&typeof t=="object"){let n=t;return {transferFeeBasisPoints:n.transferFeeBasisPoints??0,maximumFee:typeof n.maximumFee=="bigint"?n.maximumFee:BigInt(n.maximumFee??0),transferFeeConfigAuthority:n.transferFeeConfigAuthority??null,withdrawWithheldAuthority:n.withdrawWithheldAuthority??null,withheldAmount:BigInt(0),olderTransferFee:{epoch:BigInt(0),transferFeeBasisPoints:0,maximumFee:BigInt(0)},newerTransferFee:{epoch:BigInt(1),transferFeeBasisPoints:n.transferFeeBasisPoints??0,maximumFee:typeof n.maximumFee=="bigint"?n.maximumFee:BigInt(n.maximumFee??0)}}}}catch(t){console.warn("Failed to parse transfer fee config:",t);}return {transferFeeBasisPoints:0,maximumFee:BigInt(0),transferFeeConfigAuthority:null,withdrawWithheldAuthority:null,withheldAmount:BigInt(0),olderTransferFee:{epoch:BigInt(0),transferFeeBasisPoints:0,maximumFee:BigInt(0)},newerTransferFee:{epoch:BigInt(1),transferFeeBasisPoints:0,maximumFee:BigInt(0)}}}async function ie(e,t){try{let{getMintWithExtensions:n}=await import('./token-2022-rpc-SRHRFN5Y.js'),r=await n(e,t,"confirmed");return r?.extensions.transferFeeConfig?oe(r.extensions.transferFeeConfig):null}catch(n){return console.warn(`Failed to fetch transfer fee config for mint ${t}:`,n),null}}async function ot(e,t){let n=await ie(e,t);return n!==null&&n.transferFeeBasisPoints>0}var Be={};a(Be,{TokenAccountState:()=>W,basisPointsToPercentage:()=>Y,calculateCompoundInterest:()=>ge,calculateInterest:()=>pe,calculateRequiredAmountForNetTransfer:()=>ue,calculateTransferFee:()=>G,canTransfer:()=>he,createInterestBearingConfig:()=>Ne,createTransferFeeConfig:()=>be,createTransferHookInstruction:()=>ye,deserializeTokenMetadata:()=>Pe,estimateAccumulatedFees:()=>de,estimateComputeUnits:()=>we,formatBasisPoints:()=>Fe,generateConfidentialTransferProof:()=>Ae,getRequiredExtensions:()=>xe,parseTokenExtension:()=>_e,percentageToBasisPoints:()=>Ce,serializeTokenMetadata:()=>Re,validateTransferHookInstruction:()=>Te,verifyConfidentialTransferProof:()=>Ee});var h=ed25519.ExtendedPoint.BASE,ae=()=>{let e=new TextEncoder().encode("GhostSpeak-Pedersen-Generator-H"),t=sha256(e);for(let a=0;a<256;a++)try{let o=sha256(new Uint8Array([...t,a]));return ed25519.ExtendedPoint.fromHex(o.slice(0,32))}catch{continue}let n=Array.from(t).map(a=>a.toString(16).padStart(2,"0")).join(""),i=BigInt("0x"+n)%ed25519.CURVE.n;return h.multiply(i)},B=ae(),D=2n**64n-1n;function V(e,t){if(e<0n||e>D)throw new Error(`Amount must be between 0 and ${D}`);let n=randomBytes(32),r=p(n)%ed25519.CURVE.n,a=ed25519.ExtendedPoint.fromHex(t).multiply(r),o=e===0n?ed25519.ExtendedPoint.ZERO:h.multiply(e),m=a.add(o),c=h.multiply(r);return {commitment:{commitment:m.toRawBytes()},handle:{handle:c.toRawBytes()}}}function se(e,t,n){if(e<0n||e>D)throw new Error("Amount must be in range [0, 2^64)");let r=p(n)%ed25519.CURVE.n,i=[],a=e;for(let u=0;u<64;u++)i.push(a&1n),a=a>>1n;let o=[],m=0n;for(let u=0;u<63;u++){let T=p(randomBytes(32))%ed25519.CURVE.n;o.push(T),m=(m+T)%ed25519.CURVE.n;}o.push((r-m+ed25519.CURVE.n)%ed25519.CURVE.n);let c=[],f=ed25519.ExtendedPoint.ZERO;for(let u=0;u<64;u++){let T=i[u],g=o[u],Z=T===0n?f:h.multiply(T),$=g===0n?f:B.multiply(g),s=Z.add($);c.push(s.toRawBytes());}let A=new Uint8Array(t.commitment.length+c.length*32);A.set(t.commitment,0);let d=t.commitment.length;for(let u of c)A.set(u,d),d+=32;let E=p(sha256(A))%ed25519.CURVE.n,R=new Uint8Array(b.RANGE_PROOF_BULLETPROOF);d=0;for(let u=0;u<8;u++)R.set(c[u],d),d+=32;let w=E*r%ed25519.CURVE.n,_=new Uint8Array(32);for(let u=0;u<32;u++)_[u]=Number(w>>BigInt(u*8)&0xffn);R.set(_,d),d+=32;let I=ce(i,o,E);return R.set(I,d),{proof:R,commitment:t.commitment}}function ce(e,t,n){let r=b.RANGE_PROOF_BULLETPROOF-256-32,i=new Uint8Array(r),a=0,o=Math.ceil(Math.log2(e.length)),m=Math.floor((r-32)/64),c=Math.min(o,m);for(let f=0;f<c&&a+64<=i.length;f++){let A=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,d=n||1n,E=h.multiply(A).add(B.multiply(d)),R=h.multiply(A*d%ed25519.CURVE.n);a+32<=i.length&&(i.set(E.toRawBytes(),a),a+=32),a+32<=i.length&&(i.set(R.toRawBytes(),a),a+=32);}if(a+32<=i.length){let f=e.reduce((d,E,R)=>(d+E*2n**BigInt(R))%ed25519.CURVE.n,0n),A=F(f,32);i.set(A,a);}return i}function v(e,t,n){let r=p(n)%ed25519.CURVE.n,i=ed25519.ExtendedPoint.fromHex(t),a=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,o=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,m=h.multiply(a),c=i.multiply(a).add(B.multiply(o)),f=p(sha256(new Uint8Array([...e.commitment.commitment,...e.handle.handle,...m.toRawBytes(),...c.toRawBytes(),...t])))%ed25519.CURVE.n,A=(a+f*r%ed25519.CURVE.n)%ed25519.CURVE.n,d=(o+f*p(e.commitment.commitment)%ed25519.CURVE.n%ed25519.CURVE.n)%ed25519.CURVE.n,E=new Uint8Array(b.VALIDITY_PROOF);return E.set(m.toRawBytes(),0),E.set(F(A,32),32),E.set(F(d,32),64),{proof:E}}function H(e,t,n,r,i){let a=p(r)%ed25519.CURVE.n,o=p(i)%ed25519.CURVE.n,m=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,c=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,f=p(randomBytes(32))%(ed25519.CURVE.n-1n)+1n,A=h.multiply(m).add(B.multiply((c+f)%ed25519.CURVE.n)),d=h.multiply(c),E=h.multiply(f),R=new Uint8Array([...e.commitment.commitment,...t.commitment.commitment,...e.handle.handle,...t.handle.handle,...A.toRawBytes(),...d.toRawBytes(),...E.toRawBytes()]),w=p(sha256(R))%ed25519.CURVE.n,_=(m+w*n%ed25519.CURVE.n)%ed25519.CURVE.n,I=(c+w*a%ed25519.CURVE.n)%ed25519.CURVE.n,u=(f+w*o%ed25519.CURVE.n)%ed25519.CURVE.n,T=new Uint8Array(b.EQUALITY_PROOF),g=0;return T.set(A.toRawBytes(),g),g+=32,T.set(d.toRawBytes(),g),g+=32,T.set(E.toRawBytes(),g),g+=32,T.set(F(_,32),g),g+=32,T.set(F(I,32),g),g+=32,T.set(F(u,32),g),{proof:T}}function q(e,t,n){return se(e,t,n)}function p(e){let t=0n;for(let n=0;n<e.length;n++)t|=BigInt(e[n])<<BigInt(8*n);return t}function F(e,t){let n=new Uint8Array(t),r=e;for(let i=0;i<t;i++)n[i]=Number(r&0xFFn),r=r>>8n;return n}function M(e){let t=new Uint8Array(64);return t.set(e.commitment.commitment,0),t.set(e.handle.handle,32),t}function G(e,t){let{transferFeeBasisPoints:n,maximumFee:r}=t,i=e*BigInt(n)/10000n,a=i>r?r:i,o=i>r,m=e-a;return {transferAmount:e,feeAmount:a,netAmount:m,feeBasisPoints:n,wasFeeCapped:o}}function ue(e,t){let{transferFeeBasisPoints:n}=t,r=e*10000n/(10000n-BigInt(n));return G(r,t)}function de(e,t){let n=[],r=0n;for(let i of e){let a=G(i,t);n.push(a),r+=a.feeAmount;}return {totalFees:r,feeBreakdown:n}}async function Ae(e,t,n,r){let i=V(e,n),a=M(i),o=new Uint8Array(32);crypto.getRandomValues(o);let m=q(e,i.commitment,o),c=v(i,n,o),f;if(r){let A=V(e,r),d=new Uint8Array(32);crypto.getRandomValues(d);let E=H(i,A,e,o,d);f=new Uint8Array(160),f.set(M(A),0),f.set(E.proof,64);}return {encryptedAmount:a,rangeProof:m.proof,validityProof:c.proof,auditorProof:f}}async function Ee(e,t){try{if(e.encryptedAmount.length!==64||e.rangeProof.length<128||e.validityProof.length<64||t.auditorPubkey&&!e.auditorProof||e.auditorProof&&e.auditorProof.length!==160)return !1;let{verifyRangeProof:n,verifyValidityProof:r,verifyEqualityProof:i,deserializeCiphertext:a}=await import('./elgamal-3ABOJSHC.js'),o=a(e.encryptedAmount);if(!await n({proof:e.rangeProof,commitment:o.commitment.commitment},o.commitment.commitment)||!r({proof:e.validityProof},o,t.recipientPubkey))return !1;if(e.auditorProof&&t.auditorPubkey){let f=a(e.auditorProof.slice(0,64)),A=e.auditorProof.slice(64);if(!i({proof:A},o,f))return !1}return !0}catch{return false}}function pe(e,t,n){let r=n-t.lastUpdateTimestamp,i=365n*24n*60n*60n,a=BigInt(t.currentRate),o=e*a*r/(10000n*i),m=e+o,c=Number(r)/Number(i),f=t.currentRate/100*c;return {principal:e,annualRateBasisPoints:t.currentRate,timePeriodSeconds:r,interestAmount:o,newAmount:m,effectiveAnnualRate:f}}function ge(e,t,n,r){let i=t/1e4,a=n,o=Math.pow(1+i/a,a*r),m=Number(e)*o,c=BigInt(Math.floor(m)),f=c-e,A=BigInt(Math.floor(r*365*24*60*60));return {principal:e,annualRateBasisPoints:t,timePeriodSeconds:A,interestAmount:f,newAmount:c,effectiveAnnualRate:(o-1)*100}}function Te(e){return !(!e.programId||!Array.isArray(e.additionalAccounts))}function ye(e,t){let n=new Uint8Array([...getAddressEncoder().encode(t.source),...getAddressEncoder().encode(t.destination),...getAddressEncoder().encode(t.authority),...getU64Encoder().encode(t.amount),...getAddressEncoder().encode(t.mint),...getBytesEncoder().encode(t.contextData)]);return {programId:e,instructionData:n,additionalAccounts:[]}}function Re(e){let t=JSON.stringify(e),n=getUtf8Encoder().encode(t);return new Uint8Array(n)}function Pe(e){let t=new TextDecoder().decode(e);return JSON.parse(t)}var W=(r=>(r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.INITIALIZED=1]="INITIALIZED",r[r.FROZEN=2]="FROZEN",r))(W||{});function he(e,t=false,n=false){return !(e!==1||t||n)}function xe(e){let t=new Set;for(let n of e)switch(t.add(n),n){case 2:t.add(1);break;case 5:t.add(4);break;case 15:t.add(14);break}return Array.from(t).sort((n,r)=>n-r)}function Y(e){return e/1e4}function Ce(e){return Math.round(e*1e4)}function Fe(e){return `${(Y(e)*100).toFixed(2)}%`}function we(e,t=[]){let n=0n;switch(e){case "transfer":n=15000n;break;case "create_account":n=25000n;break;case "mint":n=10000n;break;case "burn":n=10000n;break}let r=0n;for(let i of t)switch(i){case 1:r+=5000n;break;case 4:case 5:r+=50000n;break;case 14:r+=15000n;break;default:r+=2000n;}return n+r}function be(e){if(e.transferFeeBasisPoints>1e4)throw new Error("Transfer fee basis points cannot exceed 10000");return {transferFeeBasisPoints:e.transferFeeBasisPoints,maximumFee:e.maximumFee,transferFeeConfigAuthority:e.transferFeeConfigAuthority,withdrawWithheldAuthority:e.withdrawWithheldAuthority,withheldAmount:BigInt(0),olderTransferFee:{epoch:BigInt(0),transferFeeBasisPoints:0,maximumFee:BigInt(0)},newerTransferFee:{epoch:BigInt(1),transferFeeBasisPoints:e.transferFeeBasisPoints,maximumFee:e.maximumFee}}}function Ne(e){if(e.currentRate>32767||e.currentRate<-32768)throw new Error("Interest rate must be within i16 range");let t=BigInt(Math.floor(Date.now()/1e3));return {rateAuthority:e.rateAuthority,initializationTimestamp:t,preUpdateAverageRate:0,lastUpdateTimestamp:t,currentRate:e.currentRate}}function _e(e,t){switch(e){case "TransferFeeConfig":{if(t.length<108)throw new Error("Invalid extension data length");let n=t[0]|t[1]<<8;return {transferFeeBasisPoints:n,maximumFee:BigInt(0),transferFeeConfigAuthority:null,withdrawWithheldAuthority:null,withheldAmount:BigInt(0),olderTransferFee:{epoch:BigInt(0),transferFeeBasisPoints:0,maximumFee:BigInt(0)},newerTransferFee:{epoch:BigInt(1),transferFeeBasisPoints:n,maximumFee:BigInt(0)}}}case "InterestBearingConfig":{if(t.length<40)throw new Error("Invalid extension data length");let n=0n;for(let r=0;r<8;r++)n|=BigInt(t[r])<<BigInt(r*8);return {rateAuthority:null,initializationTimestamp:n,preUpdateAverageRate:0,lastUpdateTimestamp:n,currentRate:0}}default:throw new Error("Unknown extension type")}}
2
+ export{rt as A,ie as B,ot as C,G as D,ue as E,de as F,Ae as G,Ee as H,pe as I,ge as J,Te as K,ye as L,Re as M,Pe as N,W as O,he as P,xe as Q,Y as R,Ce as S,Fe as T,we as U,be as V,Be as W,ke as a,De as b,y as c,x as d,L as e,Le as f,J as g,K as h,O as i,X as j,ee as k,We as l,te as m,ne as n,Ye as o,Ze as p,$e as q,ze as r,je as s,Qe as t,Je as u,re as v,Xe as w,et as x,tt as y,nt as z};//# sourceMappingURL=chunk-32GWTXRJ.js.map
3
+ //# sourceMappingURL=chunk-32GWTXRJ.js.map