@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,4157 @@
1
+ import { Address as Address$1 } from '@solana/addresses';
2
+ import { Option, Address, ReadonlyUint8Array, EncodedAccount, MaybeEncodedAccount, fetchEncodedAccount, IInstruction, TransactionSigner } from '@solana/kit';
3
+ import { I as IPFSConfig, a as IPFSUploadOptions, c as IPFSOperationResult, f as IPFSUploadResult, g as IPFSRetrievalOptions, h as IPFSRetrievalResult, i as IPFSPinResult, b as IPFSContentMetadata, C as ContentStorageResult } from './ipfs-types-BlxtJ3q2.js';
4
+ import { Connection } from '@solana/web3.js';
5
+
6
+ /**
7
+ * This code was AUTOGENERATED using the codama library.
8
+ * Please DO NOT EDIT THIS FILE, instead use visitors
9
+ * to add features, then rerun codama to update it.
10
+ *
11
+ * @see https://github.com/codama-idl/codama
12
+ */
13
+
14
+ type AccessAuditConfig = {
15
+ auditEnabled: boolean;
16
+ realTimeMonitoring: boolean;
17
+ retentionPeriod: bigint;
18
+ };
19
+
20
+ /**
21
+ * This code was AUTOGENERATED using the codama library.
22
+ * Please DO NOT EDIT THIS FILE, instead use visitors
23
+ * to add features, then rerun codama to update it.
24
+ *
25
+ * @see https://github.com/codama-idl/codama
26
+ */
27
+
28
+ /** Access policy definition */
29
+ type AccessPolicy = {
30
+ /** Policy identifier */
31
+ policyId: string;
32
+ /** Policy name */
33
+ name: string;
34
+ /** Policy description */
35
+ description: string;
36
+ /** Policy type */
37
+ policyType: PolicyType;
38
+ /** Policy rules */
39
+ rules: Array<PolicyRule>;
40
+ /** Policy scope */
41
+ scope: PolicyScope;
42
+ /** Policy priority */
43
+ priority: number;
44
+ /** Policy status */
45
+ status: PolicyStatus;
46
+ /** Effective date */
47
+ effectiveDate: bigint;
48
+ /** Expiration date */
49
+ expirationDate: Option<bigint>;
50
+ /** Policy metadata */
51
+ metadata: PolicyMetadata;
52
+ };
53
+
54
+ /**
55
+ * This code was AUTOGENERATED using the codama library.
56
+ * Please DO NOT EDIT THIS FILE, instead use visitors
57
+ * to add features, then rerun codama to update it.
58
+ *
59
+ * @see https://github.com/codama-idl/codama
60
+ */
61
+
62
+ /** Account lockout policies */
63
+ type AccountLockoutPolicies = {
64
+ /** Max failed attempts before lockout */
65
+ maxFailedAttempts: number;
66
+ /** Lockout duration */
67
+ lockoutDuration: bigint;
68
+ /** Progressive lockout enabled */
69
+ progressiveLockout: boolean;
70
+ /** Unlock methods */
71
+ unlockMethods: Array<UnlockMethod>;
72
+ /** Notification requirements */
73
+ notificationRequirements: Array<NotificationRequirement>;
74
+ };
75
+
76
+ /**
77
+ * This code was AUTOGENERATED using the codama library.
78
+ * Please DO NOT EDIT THIS FILE, instead use visitors
79
+ * to add features, then rerun codama to update it.
80
+ *
81
+ * @see https://github.com/codama-idl/codama
82
+ */
83
+
84
+ interface Action {
85
+ [key: string]: unknown;
86
+ }
87
+
88
+ /**
89
+ * This code was AUTOGENERATED using the codama library.
90
+ * Please DO NOT EDIT THIS FILE, instead use visitors
91
+ * to add features, then rerun codama to update it.
92
+ *
93
+ * @see https://github.com/codama-idl/codama
94
+ */
95
+
96
+ /** Role activation requirements */
97
+ type ActivationRequirement = {
98
+ /** Requirement type */
99
+ requirementType: ActivationRequirementType;
100
+ /** Required approvers */
101
+ approvers: Array<Address>;
102
+ /** Minimum approvals needed */
103
+ minApprovals: number;
104
+ /** Approval timeout */
105
+ approvalTimeout: bigint;
106
+ /** Evidence requirements */
107
+ evidenceRequirements: Array<string>;
108
+ };
109
+
110
+ /**
111
+ * This code was AUTOGENERATED using the codama library.
112
+ * Please DO NOT EDIT THIS FILE, instead use visitors
113
+ * to add features, then rerun codama to update it.
114
+ *
115
+ * @see https://github.com/codama-idl/codama
116
+ */
117
+
118
+ /** Types of role activation requirements */
119
+ declare enum ActivationRequirementType {
120
+ ManagerApproval = 0,
121
+ PeerReview = 1,
122
+ SecurityClearance = 2,
123
+ BackgroundCheck = 3,
124
+ TrainingCompletion = 4,
125
+ CertificationRequired = 5,
126
+ BusinessJustification = 6,
127
+ TechnicalAssessment = 7
128
+ }
129
+
130
+ /**
131
+ * This code was AUTOGENERATED using the codama library.
132
+ * Please DO NOT EDIT THIS FILE, instead use visitors
133
+ * to add features, then rerun codama to update it.
134
+ *
135
+ * @see https://github.com/codama-idl/codama
136
+ */
137
+
138
+ /** Template aging policies */
139
+ type AgingPolicy = {
140
+ /** Biometric type */
141
+ biometricType: BiometricType;
142
+ /** Maximum age */
143
+ maxAge: bigint;
144
+ /** Refresh requirements */
145
+ refreshRequirements: Array<string>;
146
+ /** Degradation handling */
147
+ degradationHandling: DegradationHandling;
148
+ };
149
+
150
+ /**
151
+ * This code was AUTOGENERATED using the codama library.
152
+ * Please DO NOT EDIT THIS FILE, instead use visitors
153
+ * to add features, then rerun codama to update it.
154
+ *
155
+ * @see https://github.com/codama-idl/codama
156
+ */
157
+
158
+ /** Authentication levels */
159
+ declare enum AuthenticationLevel {
160
+ Low = 0,
161
+ Medium = 1,
162
+ High = 2,
163
+ VeryHigh = 3
164
+ }
165
+
166
+ /**
167
+ * This code was AUTOGENERATED using the codama library.
168
+ * Please DO NOT EDIT THIS FILE, instead use visitors
169
+ * to add features, then rerun codama to update it.
170
+ *
171
+ * @see https://github.com/codama-idl/codama
172
+ */
173
+
174
+ /** Authentication methods */
175
+ declare enum AuthenticationMethod {
176
+ Password = 0,
177
+ DigitalSignature = 1,
178
+ Biometric = 2,
179
+ Token = 3,
180
+ Certificate = 4,
181
+ Sms = 5,
182
+ Email = 6,
183
+ App = 7,
184
+ Hardware = 8
185
+ }
186
+
187
+ /**
188
+ * This code was AUTOGENERATED using the codama library.
189
+ * Please DO NOT EDIT THIS FILE, instead use visitors
190
+ * to add features, then rerun codama to update it.
191
+ *
192
+ * @see https://github.com/codama-idl/codama
193
+ */
194
+
195
+ /** Authentication policies */
196
+ type AuthenticationPolicies = {
197
+ /** Multi-factor authentication required */
198
+ mfaRequired: boolean;
199
+ /** Supported authentication methods */
200
+ supportedMethods: Array<AuthenticationMethod>;
201
+ /** Authentication strength requirements */
202
+ strengthRequirements: AuthenticationStrength;
203
+ /** Account lockout policies */
204
+ lockoutPolicies: AccountLockoutPolicies;
205
+ /** Biometric policies */
206
+ biometricPolicies: Option<BiometricPolicies>;
207
+ };
208
+
209
+ /**
210
+ * This code was AUTOGENERATED using the codama library.
211
+ * Please DO NOT EDIT THIS FILE, instead use visitors
212
+ * to add features, then rerun codama to update it.
213
+ *
214
+ * @see https://github.com/codama-idl/codama
215
+ */
216
+
217
+ /** Authentication strength requirements */
218
+ type AuthenticationStrength = {
219
+ /** Minimum authentication level */
220
+ minimumLevel: AuthenticationLevel;
221
+ /** Risk-based authentication */
222
+ riskBased: boolean;
223
+ /** Adaptive authentication */
224
+ adaptive: boolean;
225
+ /** Step-up authentication triggers */
226
+ stepUpTriggers: Array<StepUpTrigger>;
227
+ };
228
+
229
+ /**
230
+ * This code was AUTOGENERATED using the codama library.
231
+ * Please DO NOT EDIT THIS FILE, instead use visitors
232
+ * to add features, then rerun codama to update it.
233
+ *
234
+ * @see https://github.com/codama-idl/codama
235
+ */
236
+
237
+ type AuthorizationPolicies = {
238
+ defaultDeny: boolean;
239
+ explicitPermissionsRequired: boolean;
240
+ };
241
+
242
+ /**
243
+ * This code was AUTOGENERATED using the codama library.
244
+ * Please DO NOT EDIT THIS FILE, instead use visitors
245
+ * to add features, then rerun codama to update it.
246
+ *
247
+ * @see https://github.com/codama-idl/codama
248
+ */
249
+
250
+ /** Biometric authentication policies */
251
+ type BiometricPolicies = {
252
+ /** Supported biometric types */
253
+ supportedTypes: Array<BiometricType>;
254
+ /** Biometric quality requirements */
255
+ qualityRequirements: BiometricQuality;
256
+ /** Liveness detection required */
257
+ livenessDetection: boolean;
258
+ /** Biometric template protection */
259
+ templateProtection: BiometricProtection;
260
+ };
261
+
262
+ /**
263
+ * This code was AUTOGENERATED using the codama library.
264
+ * Please DO NOT EDIT THIS FILE, instead use visitors
265
+ * to add features, then rerun codama to update it.
266
+ *
267
+ * @see https://github.com/codama-idl/codama
268
+ */
269
+
270
+ /** Biometric template protection */
271
+ type BiometricProtection = {
272
+ /** Template encryption required */
273
+ encryptionRequired: boolean;
274
+ /** Template storage method */
275
+ storageMethod: BiometricStorageMethod;
276
+ /** Template revocation support */
277
+ revocationSupport: boolean;
278
+ /** Template aging policies */
279
+ agingPolicies: Array<AgingPolicy>;
280
+ };
281
+
282
+ /**
283
+ * This code was AUTOGENERATED using the codama library.
284
+ * Please DO NOT EDIT THIS FILE, instead use visitors
285
+ * to add features, then rerun codama to update it.
286
+ *
287
+ * @see https://github.com/codama-idl/codama
288
+ */
289
+
290
+ declare enum BiometricQuality {
291
+ Low = 0,
292
+ Medium = 1,
293
+ High = 2
294
+ }
295
+
296
+ /**
297
+ * This code was AUTOGENERATED using the codama library.
298
+ * Please DO NOT EDIT THIS FILE, instead use visitors
299
+ * to add features, then rerun codama to update it.
300
+ *
301
+ * @see https://github.com/codama-idl/codama
302
+ */
303
+
304
+ /** Biometric template storage methods */
305
+ declare enum BiometricStorageMethod {
306
+ OnDevice = 0,
307
+ Encrypted = 1,
308
+ Hashed = 2,
309
+ Distributed = 3,
310
+ None = 4
311
+ }
312
+
313
+ /**
314
+ * This code was AUTOGENERATED using the codama library.
315
+ * Please DO NOT EDIT THIS FILE, instead use visitors
316
+ * to add features, then rerun codama to update it.
317
+ *
318
+ * @see https://github.com/codama-idl/codama
319
+ */
320
+
321
+ /** Types of biometric authentication */
322
+ declare enum BiometricType {
323
+ Fingerprint = 0,
324
+ FaceRecognition = 1,
325
+ IrisRecognition = 2,
326
+ VoiceRecognition = 3,
327
+ Signature = 4,
328
+ Gait = 5,
329
+ Behavioral = 6
330
+ }
331
+
332
+ /**
333
+ * This code was AUTOGENERATED using the codama library.
334
+ * Please DO NOT EDIT THIS FILE, instead use visitors
335
+ * to add features, then rerun codama to update it.
336
+ *
337
+ * @see https://github.com/codama-idl/codama
338
+ */
339
+
340
+ type CompliancePolicies = {
341
+ frameworks: Array<string>;
342
+ auditRequirements: Array<string>;
343
+ reportingRequirements: Array<string>;
344
+ };
345
+
346
+ /**
347
+ * This code was AUTOGENERATED using the codama library.
348
+ * Please DO NOT EDIT THIS FILE, instead use visitors
349
+ * to add features, then rerun codama to update it.
350
+ *
351
+ * @see https://github.com/codama-idl/codama
352
+ */
353
+
354
+ /** Types of execution conditions */
355
+ declare enum ConditionType {
356
+ TimeDelay = 0,
357
+ TokenBalance = 1,
358
+ PriceThreshold = 2,
359
+ VoteCount = 3,
360
+ ExternalOracle = 4,
361
+ CustomLogic = 5
362
+ }
363
+
364
+ /**
365
+ * This code was AUTOGENERATED using the codama library.
366
+ * Please DO NOT EDIT THIS FILE, instead use visitors
367
+ * to add features, then rerun codama to update it.
368
+ *
369
+ * @see https://github.com/codama-idl/codama
370
+ */
371
+
372
+ /** Constraint condition definition */
373
+ type ConstraintCondition = {
374
+ /** Attribute name */
375
+ attribute: string;
376
+ /** Condition operator */
377
+ operator: ConstraintOperator;
378
+ /** Expected value */
379
+ value: string;
380
+ /** Value type */
381
+ valueType: ValueType;
382
+ };
383
+
384
+ /**
385
+ * This code was AUTOGENERATED using the codama library.
386
+ * Please DO NOT EDIT THIS FILE, instead use visitors
387
+ * to add features, then rerun codama to update it.
388
+ *
389
+ * @see https://github.com/codama-idl/codama
390
+ */
391
+
392
+ /** Operators for constraint conditions */
393
+ declare enum ConstraintOperator {
394
+ Equals = 0,
395
+ NotEquals = 1,
396
+ GreaterThan = 2,
397
+ LessThan = 3,
398
+ GreaterThanOrEqual = 4,
399
+ LessThanOrEqual = 5,
400
+ Contains = 6,
401
+ NotContains = 7,
402
+ In = 8,
403
+ NotIn = 9,
404
+ Matches = 10,
405
+ NotMatches = 11
406
+ }
407
+
408
+ /**
409
+ * This code was AUTOGENERATED using the codama library.
410
+ * Please DO NOT EDIT THIS FILE, instead use visitors
411
+ * to add features, then rerun codama to update it.
412
+ *
413
+ * @see https://github.com/codama-idl/codama
414
+ */
415
+
416
+ /** Data access levels */
417
+ declare enum DataAccessLevel {
418
+ Public = 0,
419
+ Internal = 1,
420
+ Confidential = 2,
421
+ Restricted = 3,
422
+ TopSecret = 4
423
+ }
424
+
425
+ /**
426
+ * This code was AUTOGENERATED using the codama library.
427
+ * Please DO NOT EDIT THIS FILE, instead use visitors
428
+ * to add features, then rerun codama to update it.
429
+ *
430
+ * @see https://github.com/codama-idl/codama
431
+ */
432
+
433
+ type DataProtectionPolicies = {
434
+ encryptionRequired: boolean;
435
+ classificationRequired: boolean;
436
+ dlpEnabled: boolean;
437
+ };
438
+
439
+ /**
440
+ * This code was AUTOGENERATED using the codama library.
441
+ * Please DO NOT EDIT THIS FILE, instead use visitors
442
+ * to add features, then rerun codama to update it.
443
+ *
444
+ * @see https://github.com/codama-idl/codama
445
+ */
446
+
447
+ /** Handling of template degradation */
448
+ declare enum DegradationHandling {
449
+ RequireRefresh = 0,
450
+ GradualDegradation = 1,
451
+ ImmediateExpiry = 2,
452
+ AdaptiveThreshold = 3
453
+ }
454
+
455
+ /**
456
+ * This code was AUTOGENERATED using the codama library.
457
+ * Please DO NOT EDIT THIS FILE, instead use visitors
458
+ * to add features, then rerun codama to update it.
459
+ *
460
+ * @see https://github.com/codama-idl/codama
461
+ */
462
+
463
+ /** Vote delegation information */
464
+ type DelegationInfo = {
465
+ /** Original delegator */
466
+ delegator: Address;
467
+ /** Delegation timestamp */
468
+ delegatedAt: bigint;
469
+ /** Delegation scope */
470
+ scope: DelegationScope;
471
+ /** Delegation expiry */
472
+ expiresAt: Option<bigint>;
473
+ };
474
+
475
+ /**
476
+ * This code was AUTOGENERATED using the codama library.
477
+ * Please DO NOT EDIT THIS FILE, instead use visitors
478
+ * to add features, then rerun codama to update it.
479
+ *
480
+ * @see https://github.com/codama-idl/codama
481
+ */
482
+
483
+ /** Scope of vote delegation */
484
+ type DelegationScope = {
485
+ __kind: 'All';
486
+ } | {
487
+ __kind: 'ProposalType';
488
+ fields: readonly [ProposalType];
489
+ } | {
490
+ __kind: 'SingleProposal';
491
+ } | {
492
+ __kind: 'Limited';
493
+ };
494
+
495
+ /**
496
+ * This code was AUTOGENERATED using the codama library.
497
+ * Please DO NOT EDIT THIS FILE, instead use visitors
498
+ * to add features, then rerun codama to update it.
499
+ *
500
+ * @see https://github.com/codama-idl/codama
501
+ */
502
+
503
+ type EmergencyAccessConfig = {
504
+ breakGlassEnabled: boolean;
505
+ emergencyContacts: Array<Address>;
506
+ approvalRequired: boolean;
507
+ };
508
+
509
+ /**
510
+ * This code was AUTOGENERATED using the codama library.
511
+ * Please DO NOT EDIT THIS FILE, instead use visitors
512
+ * to add features, then rerun codama to update it.
513
+ *
514
+ * @see https://github.com/codama-idl/codama
515
+ */
516
+
517
+ /** Emergency configuration for multisig */
518
+ type EmergencyConfig = {
519
+ /** Emergency contacts */
520
+ emergencyContacts: Array<Address>;
521
+ /** Emergency threshold override */
522
+ emergencyThreshold: number;
523
+ /** Emergency timeout (shorter than normal) */
524
+ emergencyTimeout: bigint;
525
+ /** Allowed emergency transaction types */
526
+ emergencyTransactionTypes: Array<TransactionType>;
527
+ /** Emergency freeze enabled */
528
+ freezeEnabled: boolean;
529
+ /** Current freeze status */
530
+ frozen: boolean;
531
+ /** Freeze timestamp */
532
+ frozenAt: Option<bigint>;
533
+ /** Auto-unfreeze after duration */
534
+ autoUnfreezeDuration: Option<bigint>;
535
+ };
536
+
537
+ /**
538
+ * This code was AUTOGENERATED using the codama library.
539
+ * Please DO NOT EDIT THIS FILE, instead use visitors
540
+ * to add features, then rerun codama to update it.
541
+ *
542
+ * @see https://github.com/codama-idl/codama
543
+ */
544
+
545
+ /** Enforcement levels for constraints */
546
+ declare enum EnforcementLevel {
547
+ Hard = 0,
548
+ Soft = 1,
549
+ Advisory = 2,
550
+ ExceptionBased = 3
551
+ }
552
+
553
+ /**
554
+ * This code was AUTOGENERATED using the codama library.
555
+ * Please DO NOT EDIT THIS FILE, instead use visitors
556
+ * to add features, then rerun codama to update it.
557
+ *
558
+ * @see https://github.com/codama-idl/codama
559
+ */
560
+
561
+ /** Execution conditions for transactions */
562
+ type ExecutionCondition = {
563
+ /** Condition type */
564
+ conditionType: ConditionType;
565
+ /** Target value/threshold */
566
+ targetValue: bigint;
567
+ /** Current value */
568
+ currentValue: bigint;
569
+ /** Condition met */
570
+ met: boolean;
571
+ /** Condition description */
572
+ description: string;
573
+ };
574
+
575
+ /**
576
+ * This code was AUTOGENERATED using the codama library.
577
+ * Please DO NOT EDIT THIS FILE, instead use visitors
578
+ * to add features, then rerun codama to update it.
579
+ *
580
+ * @see https://github.com/codama-idl/codama
581
+ */
582
+
583
+ /** Execution parameters for proposals */
584
+ type ExecutionParams = {
585
+ /** Instructions to execute if passed */
586
+ instructions: Array<ProposalInstruction>;
587
+ /** Time delay before execution */
588
+ executionDelay: bigint;
589
+ /** Execution conditions */
590
+ executionConditions: Array<ExecutionCondition>;
591
+ /** Can be cancelled after approval */
592
+ cancellable: boolean;
593
+ /** Automatic execution enabled */
594
+ autoExecute: boolean;
595
+ /** Required execution authority */
596
+ executionAuthority: Address;
597
+ };
598
+
599
+ /**
600
+ * This code was AUTOGENERATED using the codama library.
601
+ * Please DO NOT EDIT THIS FILE, instead use visitors
602
+ * to add features, then rerun codama to update it.
603
+ *
604
+ * @see https://github.com/codama-idl/codama
605
+ */
606
+
607
+ /** Geographic region definition */
608
+ type GeographicRegion = {
609
+ /** Region name */
610
+ name: string;
611
+ /** Latitude boundaries */
612
+ latitudeRange: LatitudeRange;
613
+ /** Longitude boundaries */
614
+ longitudeRange: LongitudeRange;
615
+ /** Radius for circular regions (meters) */
616
+ radius: Option<number>;
617
+ };
618
+
619
+ /**
620
+ * This code was AUTOGENERATED using the codama library.
621
+ * Please DO NOT EDIT THIS FILE, instead use visitors
622
+ * to add features, then rerun codama to update it.
623
+ *
624
+ * @see https://github.com/codama-idl/codama
625
+ */
626
+
627
+ /** Hierarchical boundary definition */
628
+ type HierarchicalBoundary = {
629
+ /** Boundary level */
630
+ level: string;
631
+ /** Boundary value */
632
+ value: string;
633
+ /** Include descendants */
634
+ includeDescendants: boolean;
635
+ };
636
+
637
+ /**
638
+ * This code was AUTOGENERATED using the codama library.
639
+ * Please DO NOT EDIT THIS FILE, instead use visitors
640
+ * to add features, then rerun codama to update it.
641
+ *
642
+ * @see https://github.com/codama-idl/codama
643
+ */
644
+
645
+ type IncidentResponsePolicies = {
646
+ responseTeam: Array<Address>;
647
+ escalationProcedures: Array<string>;
648
+ notificationRequirements: Array<NotificationRequirement>;
649
+ };
650
+
651
+ /**
652
+ * This code was AUTOGENERATED using the codama library.
653
+ * Please DO NOT EDIT THIS FILE, instead use visitors
654
+ * to add features, then rerun codama to update it.
655
+ *
656
+ * @see https://github.com/codama-idl/codama
657
+ */
658
+
659
+ /** Latitude range for geographic constraints */
660
+ type LatitudeRange = {
661
+ /** Minimum latitude */
662
+ min: number;
663
+ /** Maximum latitude */
664
+ max: number;
665
+ };
666
+
667
+ /**
668
+ * This code was AUTOGENERATED using the codama library.
669
+ * Please DO NOT EDIT THIS FILE, instead use visitors
670
+ * to add features, then rerun codama to update it.
671
+ *
672
+ * @see https://github.com/codama-idl/codama
673
+ */
674
+
675
+ /** Location-based access constraints */
676
+ type LocationConstraints = {
677
+ /** Allowed countries (ISO codes) */
678
+ allowedCountries: Array<string>;
679
+ /** Blocked countries (ISO codes) */
680
+ blockedCountries: Array<string>;
681
+ /** Allowed IP address ranges (CIDR) */
682
+ allowedIpRanges: Array<string>;
683
+ /** Blocked IP address ranges (CIDR) */
684
+ blockedIpRanges: Array<string>;
685
+ /** Geofencing enabled */
686
+ geofencingEnabled: boolean;
687
+ /** Allowed geographic regions */
688
+ allowedRegions: Array<GeographicRegion>;
689
+ };
690
+
691
+ /**
692
+ * This code was AUTOGENERATED using the codama library.
693
+ * Please DO NOT EDIT THIS FILE, instead use visitors
694
+ * to add features, then rerun codama to update it.
695
+ *
696
+ * @see https://github.com/codama-idl/codama
697
+ */
698
+
699
+ /** Longitude range for geographic constraints */
700
+ type LongitudeRange = {
701
+ /** Minimum longitude */
702
+ min: number;
703
+ /** Maximum longitude */
704
+ max: number;
705
+ };
706
+
707
+ /**
708
+ * This code was AUTOGENERATED using the codama library.
709
+ * Please DO NOT EDIT THIS FILE, instead use visitors
710
+ * to add features, then rerun codama to update it.
711
+ *
712
+ * @see https://github.com/codama-idl/codama
713
+ */
714
+
715
+ interface MultisigConfig {
716
+ requireSequentialSigning: boolean;
717
+ allowOwnerOffCurve: boolean;
718
+ }
719
+
720
+ /**
721
+ * This code was AUTOGENERATED using the codama library.
722
+ * Please DO NOT EDIT THIS FILE, instead use visitors
723
+ * to add features, then rerun codama to update it.
724
+ *
725
+ * @see https://github.com/codama-idl/codama
726
+ */
727
+
728
+ /** Individual signature in multisig */
729
+ type MultisigSignature = {
730
+ /** Signer public key */
731
+ signer: Address;
732
+ /** Signature data */
733
+ signature: ReadonlyUint8Array;
734
+ /** Signature timestamp */
735
+ signedAt: bigint;
736
+ /** Signature method/algorithm */
737
+ signatureMethod: string;
738
+ /** Additional verification data */
739
+ verificationData: Option<ReadonlyUint8Array>;
740
+ };
741
+
742
+ /**
743
+ * This code was AUTOGENERATED using the codama library.
744
+ * Please DO NOT EDIT THIS FILE, instead use visitors
745
+ * to add features, then rerun codama to update it.
746
+ *
747
+ * @see https://github.com/codama-idl/codama
748
+ */
749
+
750
+ type NetworkSecurityPolicies = {
751
+ firewallRequired: boolean;
752
+ intrusionDetection: boolean;
753
+ trafficMonitoring: boolean;
754
+ };
755
+
756
+ /**
757
+ * This code was AUTOGENERATED using the codama library.
758
+ * Please DO NOT EDIT THIS FILE, instead use visitors
759
+ * to add features, then rerun codama to update it.
760
+ *
761
+ * @see https://github.com/codama-idl/codama
762
+ */
763
+
764
+ /** Notification methods */
765
+ declare enum NotificationMethod {
766
+ OnChain = 0,
767
+ Email = 1,
768
+ Sms = 2,
769
+ Push = 3,
770
+ InApp = 4,
771
+ All = 5
772
+ }
773
+
774
+ /**
775
+ * This code was AUTOGENERATED using the codama library.
776
+ * Please DO NOT EDIT THIS FILE, instead use visitors
777
+ * to add features, then rerun codama to update it.
778
+ *
779
+ * @see https://github.com/codama-idl/codama
780
+ */
781
+
782
+ /** Notification priorities */
783
+ declare enum NotificationPriority {
784
+ Low = 0,
785
+ Medium = 1,
786
+ High = 2,
787
+ Critical = 3,
788
+ Emergency = 4
789
+ }
790
+
791
+ /**
792
+ * This code was AUTOGENERATED using the codama library.
793
+ * Please DO NOT EDIT THIS FILE, instead use visitors
794
+ * to add features, then rerun codama to update it.
795
+ *
796
+ * @see https://github.com/codama-idl/codama
797
+ */
798
+
799
+ /** Notification requirements for security events */
800
+ type NotificationRequirement = {
801
+ /** Event type */
802
+ eventType: SecurityEventType;
803
+ /** Notification targets */
804
+ targets: Array<NotificationTarget>;
805
+ /** Notification method */
806
+ method: NotificationMethod;
807
+ /** Notification timing */
808
+ timing: NotificationTiming;
809
+ };
810
+
811
+ /**
812
+ * This code was AUTOGENERATED using the codama library.
813
+ * Please DO NOT EDIT THIS FILE, instead use visitors
814
+ * to add features, then rerun codama to update it.
815
+ *
816
+ * @see https://github.com/codama-idl/codama
817
+ */
818
+
819
+ /** Notification targets */
820
+ type NotificationTarget = {
821
+ /** Target type */
822
+ targetType: NotificationTargetType;
823
+ /** Target identifier */
824
+ targetId: string;
825
+ /** Notification priority */
826
+ priority: NotificationPriority;
827
+ };
828
+
829
+ /**
830
+ * This code was AUTOGENERATED using the codama library.
831
+ * Please DO NOT EDIT THIS FILE, instead use visitors
832
+ * to add features, then rerun codama to update it.
833
+ *
834
+ * @see https://github.com/codama-idl/codama
835
+ */
836
+
837
+ /** Types of notification targets */
838
+ declare enum NotificationTargetType {
839
+ User = 0,
840
+ Administrator = 1,
841
+ SecurityTeam = 2,
842
+ ComplianceTeam = 3,
843
+ Manager = 4,
844
+ AuditTeam = 5,
845
+ ExternalSystem = 6
846
+ }
847
+
848
+ /**
849
+ * This code was AUTOGENERATED using the codama library.
850
+ * Please DO NOT EDIT THIS FILE, instead use visitors
851
+ * to add features, then rerun codama to update it.
852
+ *
853
+ * @see https://github.com/codama-idl/codama
854
+ */
855
+
856
+ /** Notification timing */
857
+ declare enum NotificationTiming {
858
+ Immediate = 0,
859
+ Delayed = 1,
860
+ Batched = 2,
861
+ Scheduled = 3
862
+ }
863
+
864
+ /**
865
+ * This code was AUTOGENERATED using the codama library.
866
+ * Please DO NOT EDIT THIS FILE, instead use visitors
867
+ * to add features, then rerun codama to update it.
868
+ *
869
+ * @see https://github.com/codama-idl/codama
870
+ */
871
+
872
+ type PasswordPolicies = {
873
+ minimumLength: number;
874
+ complexityRequirements: Array<string>;
875
+ historyCount: number;
876
+ maxAge: bigint;
877
+ };
878
+
879
+ /**
880
+ * This code was AUTOGENERATED using the codama library.
881
+ * Please DO NOT EDIT THIS FILE, instead use visitors
882
+ * to add features, then rerun codama to update it.
883
+ *
884
+ * @see https://github.com/codama-idl/codama
885
+ */
886
+
887
+ /** Pending transaction in multisig queue */
888
+ type PendingTransaction = {
889
+ /** Transaction ID */
890
+ transactionId: bigint;
891
+ /** Transaction type */
892
+ transactionType: TransactionType;
893
+ /** Target program/account */
894
+ target: Address;
895
+ /** Transaction data */
896
+ data: ReadonlyUint8Array;
897
+ /** Required signatures */
898
+ requiredSignatures: number;
899
+ /** Current signatures */
900
+ signatures: Array<MultisigSignature>;
901
+ /** Creation timestamp */
902
+ createdAt: bigint;
903
+ /** Expiration timestamp */
904
+ expiresAt: bigint;
905
+ /** Transaction priority */
906
+ priority: TransactionPriority;
907
+ /** Execution conditions */
908
+ executionConditions: Array<ExecutionCondition>;
909
+ /** Transaction status */
910
+ status: TransactionStatus;
911
+ /** Time lock (if applicable) */
912
+ timeLock: Option<TimeLock>;
913
+ };
914
+
915
+ /**
916
+ * This code was AUTOGENERATED using the codama library.
917
+ * Please DO NOT EDIT THIS FILE, instead use visitors
918
+ * to add features, then rerun codama to update it.
919
+ *
920
+ * @see https://github.com/codama-idl/codama
921
+ */
922
+
923
+ /** Permission definition */
924
+ type Permission = {
925
+ /** Permission identifier */
926
+ permissionId: string;
927
+ /** Permission name */
928
+ name: string;
929
+ /** Permission description */
930
+ description: string;
931
+ /** Resource type this permission applies to */
932
+ resourceType: string;
933
+ /** Actions allowed by this permission */
934
+ actions: Array<Action>;
935
+ /** Permission scope */
936
+ scope: PermissionScope;
937
+ /** Permission constraints */
938
+ constraints: Array<PermissionConstraint>;
939
+ /** Permission metadata */
940
+ metadata: PermissionMetadata;
941
+ };
942
+
943
+ /**
944
+ * This code was AUTOGENERATED using the codama library.
945
+ * Please DO NOT EDIT THIS FILE, instead use visitors
946
+ * to add features, then rerun codama to update it.
947
+ *
948
+ * @see https://github.com/codama-idl/codama
949
+ */
950
+
951
+ /** Permission constraint */
952
+ type PermissionConstraint = {
953
+ /** Constraint type */
954
+ constraintType: PermissionConstraintType;
955
+ /** Constraint conditions */
956
+ conditions: Array<ConstraintCondition>;
957
+ /** Constraint enforcement */
958
+ enforcement: EnforcementLevel;
959
+ };
960
+
961
+ /**
962
+ * This code was AUTOGENERATED using the codama library.
963
+ * Please DO NOT EDIT THIS FILE, instead use visitors
964
+ * to add features, then rerun codama to update it.
965
+ *
966
+ * @see https://github.com/codama-idl/codama
967
+ */
968
+
969
+ /** Types of permission constraints */
970
+ declare enum PermissionConstraintType {
971
+ Temporal = 0,
972
+ Contextual = 1,
973
+ Conditional = 2,
974
+ ResourceBased = 3,
975
+ AttributeBased = 4,
976
+ RiskBased = 5
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
+ /** Permission metadata */
988
+ type PermissionMetadata = {
989
+ /** Business justification */
990
+ businessJustification: string;
991
+ /** Risk assessment */
992
+ riskAssessment: RiskAssessment;
993
+ /** Compliance mapping */
994
+ complianceMapping: Array<string>;
995
+ /** Related permissions */
996
+ relatedPermissions: Array<string>;
997
+ /** Permission owner */
998
+ owner: Option<Address>;
999
+ /** Last review */
1000
+ lastReview: Option<bigint>;
1001
+ /** Review frequency */
1002
+ reviewFrequency: bigint;
1003
+ };
1004
+
1005
+ /**
1006
+ * This code was AUTOGENERATED using the codama library.
1007
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1008
+ * to add features, then rerun codama to update it.
1009
+ *
1010
+ * @see https://github.com/codama-idl/codama
1011
+ */
1012
+
1013
+ /** Permission scope definition */
1014
+ type PermissionScope = {
1015
+ /** Scope type */
1016
+ scopeType: ScopeType;
1017
+ /** Scope boundaries */
1018
+ boundaries: ScopeBoundaries;
1019
+ /** Hierarchical scope */
1020
+ hierarchical: boolean;
1021
+ /** Inherited permissions */
1022
+ inherited: boolean;
1023
+ };
1024
+
1025
+ /**
1026
+ * This code was AUTOGENERATED using the codama library.
1027
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1028
+ * to add features, then rerun codama to update it.
1029
+ *
1030
+ * @see https://github.com/codama-idl/codama
1031
+ */
1032
+
1033
+ /** Policy metadata */
1034
+ type PolicyMetadata = {
1035
+ /** Policy author */
1036
+ author: Option<Address>;
1037
+ /** Policy approver */
1038
+ approver: Option<Address>;
1039
+ /** Approval date */
1040
+ approvalDate: Option<bigint>;
1041
+ /** Business justification */
1042
+ businessJustification: string;
1043
+ /** Compliance references */
1044
+ complianceReferences: Array<string>;
1045
+ /** Risk assessment */
1046
+ riskAssessment: Option<string>;
1047
+ /** Review schedule */
1048
+ reviewSchedule: ReviewSchedule;
1049
+ };
1050
+
1051
+ /**
1052
+ * This code was AUTOGENERATED using the codama library.
1053
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1054
+ * to add features, then rerun codama to update it.
1055
+ *
1056
+ * @see https://github.com/codama-idl/codama
1057
+ */
1058
+
1059
+ /** Policy rule definition */
1060
+ type PolicyRule = {
1061
+ /** Rule identifier */
1062
+ ruleId: string;
1063
+ /** Rule conditions */
1064
+ conditions: Array<RuleCondition>;
1065
+ /** Rule effect */
1066
+ effect: RuleEffect;
1067
+ /** Rule priority */
1068
+ priority: number;
1069
+ /** Rule enabled */
1070
+ enabled: boolean;
1071
+ };
1072
+
1073
+ /**
1074
+ * This code was AUTOGENERATED using the codama library.
1075
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1076
+ * to add features, then rerun codama to update it.
1077
+ *
1078
+ * @see https://github.com/codama-idl/codama
1079
+ */
1080
+
1081
+ /** Policy scope */
1082
+ type PolicyScope = {
1083
+ /** Applicable subjects */
1084
+ subjects: Array<string>;
1085
+ /** Applicable resources */
1086
+ resources: Array<string>;
1087
+ /** Applicable actions */
1088
+ actions: Array<string>;
1089
+ /** Scope inheritance */
1090
+ inheritance: ScopeInheritance;
1091
+ };
1092
+
1093
+ /**
1094
+ * This code was AUTOGENERATED using the codama library.
1095
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1096
+ * to add features, then rerun codama to update it.
1097
+ *
1098
+ * @see https://github.com/codama-idl/codama
1099
+ */
1100
+
1101
+ /** Policy status */
1102
+ declare enum PolicyStatus {
1103
+ Active = 0,
1104
+ Inactive = 1,
1105
+ Draft = 2,
1106
+ UnderReview = 3,
1107
+ Deprecated = 4,
1108
+ Suspended = 5
1109
+ }
1110
+
1111
+ /**
1112
+ * This code was AUTOGENERATED using the codama library.
1113
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1114
+ * to add features, then rerun codama to update it.
1115
+ *
1116
+ * @see https://github.com/codama-idl/codama
1117
+ */
1118
+
1119
+ /** Types of access policies */
1120
+ declare enum PolicyType {
1121
+ Allow = 0,
1122
+ Deny = 1,
1123
+ Conditional = 2,
1124
+ Delegated = 3,
1125
+ Temporary = 4,
1126
+ Emergency = 5
1127
+ }
1128
+
1129
+ /**
1130
+ * This code was AUTOGENERATED using the codama library.
1131
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1132
+ * to add features, then rerun codama to update it.
1133
+ *
1134
+ * @see https://github.com/codama-idl/codama
1135
+ */
1136
+
1137
+ /** Account specification for proposal instruction */
1138
+ type ProposalAccount = {
1139
+ /** Account public key */
1140
+ pubkey: Address;
1141
+ /** Is signer required */
1142
+ isSigner: boolean;
1143
+ /** Is writable */
1144
+ isWritable: boolean;
1145
+ /** Account description */
1146
+ description: string;
1147
+ };
1148
+
1149
+ /**
1150
+ * This code was AUTOGENERATED using the codama library.
1151
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1152
+ * to add features, then rerun codama to update it.
1153
+ *
1154
+ * @see https://github.com/codama-idl/codama
1155
+ */
1156
+
1157
+ /** Individual instruction in proposal */
1158
+ type ProposalInstruction = {
1159
+ /** Target program */
1160
+ programId: Address;
1161
+ /** Accounts required */
1162
+ accounts: Array<ProposalAccount>;
1163
+ /** Instruction data */
1164
+ data: ReadonlyUint8Array;
1165
+ /** Instruction description */
1166
+ description: string;
1167
+ };
1168
+
1169
+ /**
1170
+ * This code was AUTOGENERATED using the codama library.
1171
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1172
+ * to add features, then rerun codama to update it.
1173
+ *
1174
+ * @see https://github.com/codama-idl/codama
1175
+ */
1176
+
1177
+ /** Proposal metadata */
1178
+ type ProposalMetadata = {
1179
+ /** IPFS hash for detailed proposal */
1180
+ ipfsHash: Option<string>;
1181
+ /** External references */
1182
+ externalReferences: Array<string>;
1183
+ /** Proposal tags */
1184
+ tags: Array<string>;
1185
+ /** Risk assessment */
1186
+ riskAssessment: Option<string>;
1187
+ /** Impact analysis */
1188
+ impactAnalysis: Option<string>;
1189
+ /** Implementation timeline */
1190
+ implementationTimeline: Option<string>;
1191
+ };
1192
+
1193
+ /**
1194
+ * This code was AUTOGENERATED using the codama library.
1195
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1196
+ * to add features, then rerun codama to update it.
1197
+ *
1198
+ * @see https://github.com/codama-idl/codama
1199
+ */
1200
+
1201
+ /** Proposal execution status */
1202
+ declare enum ProposalStatus {
1203
+ Draft = 0,
1204
+ Active = 1,
1205
+ Passed = 2,
1206
+ Failed = 3,
1207
+ Executed = 4,
1208
+ Cancelled = 5,
1209
+ Expired = 6,
1210
+ Queued = 7
1211
+ }
1212
+
1213
+ /**
1214
+ * This code was AUTOGENERATED using the codama library.
1215
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1216
+ * to add features, then rerun codama to update it.
1217
+ *
1218
+ * @see https://github.com/codama-idl/codama
1219
+ */
1220
+
1221
+ /** Types of governance proposals */
1222
+ declare enum ProposalType {
1223
+ ParameterUpdate = 0,
1224
+ ProtocolUpgrade = 1,
1225
+ TreasuryOperation = 2,
1226
+ FeeUpdate = 3,
1227
+ SecurityUpdate = 4,
1228
+ GovernanceUpdate = 5,
1229
+ EmergencyAction = 6,
1230
+ Custom = 7
1231
+ }
1232
+
1233
+ /**
1234
+ * This code was AUTOGENERATED using the codama library.
1235
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1236
+ * to add features, then rerun codama to update it.
1237
+ *
1238
+ * @see https://github.com/codama-idl/codama
1239
+ */
1240
+
1241
+ /** Methods for calculating quorum */
1242
+ declare enum QuorumMethod {
1243
+ Absolute = 0,
1244
+ Relative = 1,
1245
+ Weighted = 2,
1246
+ Dynamic = 3
1247
+ }
1248
+
1249
+ /**
1250
+ * This code was AUTOGENERATED using the codama library.
1251
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1252
+ * to add features, then rerun codama to update it.
1253
+ *
1254
+ * @see https://github.com/codama-idl/codama
1255
+ */
1256
+
1257
+ /** Quorum requirements for proposals */
1258
+ type QuorumRequirements = {
1259
+ /** Minimum participation rate (0-100) */
1260
+ minimumParticipation: number;
1261
+ /** Approval threshold (0-100) */
1262
+ approvalThreshold: number;
1263
+ /** Super majority required */
1264
+ superMajorityRequired: boolean;
1265
+ /** Minimum total voting power */
1266
+ minimumVotingPower: bigint;
1267
+ /** Quorum calculation method */
1268
+ quorumMethod: QuorumMethod;
1269
+ };
1270
+
1271
+ /**
1272
+ * This code was AUTOGENERATED using the codama library.
1273
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1274
+ * to add features, then rerun codama to update it.
1275
+ *
1276
+ * @see https://github.com/codama-idl/codama
1277
+ */
1278
+
1279
+ interface ResourceConstraints {
1280
+ [key: string]: unknown;
1281
+ }
1282
+
1283
+ /**
1284
+ * This code was AUTOGENERATED using the codama library.
1285
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1286
+ * to add features, then rerun codama to update it.
1287
+ *
1288
+ * @see https://github.com/codama-idl/codama
1289
+ */
1290
+
1291
+ /** Review schedule for policies */
1292
+ type ReviewSchedule = {
1293
+ /** Review frequency */
1294
+ frequency: bigint;
1295
+ /** Last review date */
1296
+ lastReview: Option<bigint>;
1297
+ /** Next review date */
1298
+ nextReview: bigint;
1299
+ /** Review owners */
1300
+ reviewOwners: Array<Address>;
1301
+ /** Review criteria */
1302
+ reviewCriteria: Array<string>;
1303
+ };
1304
+
1305
+ /**
1306
+ * This code was AUTOGENERATED using the codama library.
1307
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1308
+ * to add features, then rerun codama to update it.
1309
+ *
1310
+ * @see https://github.com/codama-idl/codama
1311
+ */
1312
+
1313
+ /** Risk acceptance status */
1314
+ type RiskAcceptance = {
1315
+ /** Risk accepted */
1316
+ accepted: boolean;
1317
+ /** Accepting authority */
1318
+ acceptingAuthority: Option<Address>;
1319
+ /** Acceptance date */
1320
+ acceptanceDate: Option<bigint>;
1321
+ /** Acceptance reasoning */
1322
+ reasoning: Option<string>;
1323
+ /** Review date */
1324
+ reviewDate: Option<bigint>;
1325
+ };
1326
+
1327
+ /**
1328
+ * This code was AUTOGENERATED using the codama library.
1329
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1330
+ * to add features, then rerun codama to update it.
1331
+ *
1332
+ * @see https://github.com/codama-idl/codama
1333
+ */
1334
+
1335
+ /** Risk assessment for permissions */
1336
+ type RiskAssessment = {
1337
+ /** Overall risk score */
1338
+ riskScore: number;
1339
+ /** Risk factors */
1340
+ riskFactors: Array<RiskFactor>;
1341
+ /** Mitigation measures */
1342
+ mitigationMeasures: Array<string>;
1343
+ /** Risk acceptance */
1344
+ riskAcceptance: RiskAcceptance;
1345
+ };
1346
+
1347
+ /**
1348
+ * This code was AUTOGENERATED using the codama library.
1349
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1350
+ * to add features, then rerun codama to update it.
1351
+ *
1352
+ * @see https://github.com/codama-idl/codama
1353
+ */
1354
+
1355
+ /** Risk categories */
1356
+ declare enum RiskCategory {
1357
+ Operational = 0,
1358
+ Financial = 1,
1359
+ Compliance = 2,
1360
+ Security = 3,
1361
+ Reputational = 4,
1362
+ Technical = 5,
1363
+ Legal = 6
1364
+ }
1365
+
1366
+ /**
1367
+ * This code was AUTOGENERATED using the codama library.
1368
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1369
+ * to add features, then rerun codama to update it.
1370
+ *
1371
+ * @see https://github.com/codama-idl/codama
1372
+ */
1373
+
1374
+ /** Individual risk factor */
1375
+ type RiskFactor = {
1376
+ /** Factor name */
1377
+ name: string;
1378
+ /** Factor category */
1379
+ category: RiskCategory;
1380
+ /** Impact score */
1381
+ impact: number;
1382
+ /** Likelihood score */
1383
+ likelihood: number;
1384
+ /** Risk score */
1385
+ riskScore: number;
1386
+ };
1387
+
1388
+ /**
1389
+ * This code was AUTOGENERATED using the codama library.
1390
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1391
+ * to add features, then rerun codama to update it.
1392
+ *
1393
+ * @see https://github.com/codama-idl/codama
1394
+ */
1395
+
1396
+ /** Risk levels for roles */
1397
+ declare enum RiskLevel {
1398
+ Low = 0,
1399
+ Medium = 1,
1400
+ High = 2,
1401
+ Critical = 3
1402
+ }
1403
+
1404
+ /**
1405
+ * This code was AUTOGENERATED using the codama library.
1406
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1407
+ * to add features, then rerun codama to update it.
1408
+ *
1409
+ * @see https://github.com/codama-idl/codama
1410
+ */
1411
+
1412
+ /** Role definition with permissions and constraints */
1413
+ type Role = {
1414
+ /** Role identifier */
1415
+ roleId: string;
1416
+ /** Role name */
1417
+ name: string;
1418
+ /** Role description */
1419
+ description: string;
1420
+ /** Role type */
1421
+ roleType: RoleType;
1422
+ /** Permission assignments */
1423
+ permissions: Array<string>;
1424
+ /** Role constraints */
1425
+ constraints: RoleConstraints;
1426
+ /** Inheritance relationships */
1427
+ inheritsFrom: Array<string>;
1428
+ /** Role metadata */
1429
+ metadata: RoleMetadata;
1430
+ /** Role status */
1431
+ status: RoleStatus;
1432
+ /** Creation timestamp */
1433
+ createdAt: bigint;
1434
+ /** Last modification timestamp */
1435
+ modifiedAt: bigint;
1436
+ };
1437
+
1438
+ /**
1439
+ * This code was AUTOGENERATED using the codama library.
1440
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1441
+ * to add features, then rerun codama to update it.
1442
+ *
1443
+ * @see https://github.com/codama-idl/codama
1444
+ */
1445
+
1446
+ /** Constraints applied to roles */
1447
+ type RoleConstraints = {
1448
+ /** Time-based constraints */
1449
+ timeConstraints: Option<TimeConstraints>;
1450
+ /** Location-based constraints */
1451
+ locationConstraints: Option<LocationConstraints>;
1452
+ /** Resource-based constraints */
1453
+ resourceConstraints: Option<ResourceConstraints>;
1454
+ /** Session-based constraints */
1455
+ sessionConstraints: Option<SessionConstraints>;
1456
+ /** Segregation of duties constraints */
1457
+ sodConstraints: Array<SodConstraint>;
1458
+ /** Maximum concurrent sessions */
1459
+ maxConcurrentSessions: Option<number>;
1460
+ /** Role activation requirements */
1461
+ activationRequirements: Array<ActivationRequirement>;
1462
+ };
1463
+
1464
+ /**
1465
+ * This code was AUTOGENERATED using the codama library.
1466
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1467
+ * to add features, then rerun codama to update it.
1468
+ *
1469
+ * @see https://github.com/codama-idl/codama
1470
+ */
1471
+
1472
+ /** Role metadata for additional information */
1473
+ type RoleMetadata = {
1474
+ /** Business purpose */
1475
+ businessPurpose: string;
1476
+ /** Risk level */
1477
+ riskLevel: RiskLevel;
1478
+ /** Data access level */
1479
+ dataAccessLevel: DataAccessLevel;
1480
+ /** Compliance requirements */
1481
+ complianceRequirements: Array<string>;
1482
+ /** Role owner */
1483
+ roleOwner: Option<Address>;
1484
+ /** Role custodian */
1485
+ roleCustodian: Option<Address>;
1486
+ /** Review frequency */
1487
+ reviewFrequency: bigint;
1488
+ /** Last review timestamp */
1489
+ lastReview: Option<bigint>;
1490
+ /** Next review due */
1491
+ nextReview: Option<bigint>;
1492
+ };
1493
+
1494
+ /**
1495
+ * This code was AUTOGENERATED using the codama library.
1496
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1497
+ * to add features, then rerun codama to update it.
1498
+ *
1499
+ * @see https://github.com/codama-idl/codama
1500
+ */
1501
+
1502
+ /** Role status */
1503
+ declare enum RoleStatus {
1504
+ Active = 0,
1505
+ Inactive = 1,
1506
+ Deprecated = 2,
1507
+ UnderReview = 3,
1508
+ Suspended = 4
1509
+ }
1510
+
1511
+ /**
1512
+ * This code was AUTOGENERATED using the codama library.
1513
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1514
+ * to add features, then rerun codama to update it.
1515
+ *
1516
+ * @see https://github.com/codama-idl/codama
1517
+ */
1518
+
1519
+ /** Types of roles in the system */
1520
+ declare enum RoleType {
1521
+ Administrative = 0,
1522
+ Operational = 1,
1523
+ ReadOnly = 2,
1524
+ Compliance = 3,
1525
+ Emergency = 4,
1526
+ Custom = 5,
1527
+ Service = 6,
1528
+ Guest = 7
1529
+ }
1530
+
1531
+ /**
1532
+ * This code was AUTOGENERATED using the codama library.
1533
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1534
+ * to add features, then rerun codama to update it.
1535
+ *
1536
+ * @see https://github.com/codama-idl/codama
1537
+ */
1538
+
1539
+ interface RuleCondition {
1540
+ [key: string]: unknown;
1541
+ }
1542
+
1543
+ /**
1544
+ * This code was AUTOGENERATED using the codama library.
1545
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1546
+ * to add features, then rerun codama to update it.
1547
+ *
1548
+ * @see https://github.com/codama-idl/codama
1549
+ */
1550
+
1551
+ /** Rule effects */
1552
+ declare enum RuleEffect {
1553
+ Allow = 0,
1554
+ Deny = 1,
1555
+ AuditOnly = 2,
1556
+ RequireApproval = 3,
1557
+ RequireMfa = 4,
1558
+ RequireJustification = 5
1559
+ }
1560
+
1561
+ /**
1562
+ * This code was AUTOGENERATED using the codama library.
1563
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1564
+ * to add features, then rerun codama to update it.
1565
+ *
1566
+ * @see https://github.com/codama-idl/codama
1567
+ */
1568
+
1569
+ /** Scope boundaries definition */
1570
+ type ScopeBoundaries = {
1571
+ /** Included resources */
1572
+ includedResources: Array<string>;
1573
+ /** Excluded resources */
1574
+ excludedResources: Array<string>;
1575
+ /** Resource patterns (regex) */
1576
+ resourcePatterns: Array<string>;
1577
+ /** Hierarchical boundaries */
1578
+ hierarchicalBoundaries: Array<HierarchicalBoundary>;
1579
+ };
1580
+
1581
+ /**
1582
+ * This code was AUTOGENERATED using the codama library.
1583
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1584
+ * to add features, then rerun codama to update it.
1585
+ *
1586
+ * @see https://github.com/codama-idl/codama
1587
+ */
1588
+
1589
+ /** Scope inheritance options */
1590
+ declare enum ScopeInheritance {
1591
+ None = 0,
1592
+ Hierarchical = 1,
1593
+ Delegated = 2,
1594
+ Inherited = 3
1595
+ }
1596
+
1597
+ /**
1598
+ * This code was AUTOGENERATED using the codama library.
1599
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1600
+ * to add features, then rerun codama to update it.
1601
+ *
1602
+ * @see https://github.com/codama-idl/codama
1603
+ */
1604
+
1605
+ /** Types of permission scopes */
1606
+ declare enum ScopeType {
1607
+ Global = 0,
1608
+ Organization = 1,
1609
+ Department = 2,
1610
+ Project = 3,
1611
+ Resource = 4,
1612
+ Individual = 5
1613
+ }
1614
+
1615
+ /**
1616
+ * This code was AUTOGENERATED using the codama library.
1617
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1618
+ * to add features, then rerun codama to update it.
1619
+ *
1620
+ * @see https://github.com/codama-idl/codama
1621
+ */
1622
+
1623
+ /** Types of security events */
1624
+ declare enum SecurityEventType {
1625
+ AccountLockout = 0,
1626
+ PasswordChange = 1,
1627
+ PrivilegeEscalation = 2,
1628
+ SuspiciousActivity = 3,
1629
+ PolicyViolation = 4,
1630
+ AccessDenied = 5,
1631
+ DataBreach = 6,
1632
+ SystemCompromise = 7
1633
+ }
1634
+
1635
+ /**
1636
+ * This code was AUTOGENERATED using the codama library.
1637
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1638
+ * to add features, then rerun codama to update it.
1639
+ *
1640
+ * @see https://github.com/codama-idl/codama
1641
+ */
1642
+
1643
+ /** Comprehensive security policies configuration */
1644
+ type SecurityPolicies = {
1645
+ /** Authentication policies */
1646
+ authentication: AuthenticationPolicies;
1647
+ /** Authorization policies */
1648
+ authorization: AuthorizationPolicies;
1649
+ /** Password policies */
1650
+ password: PasswordPolicies;
1651
+ /** Session policies */
1652
+ session: SessionPolicies;
1653
+ /** Data protection policies */
1654
+ dataProtection: DataProtectionPolicies;
1655
+ /** Network security policies */
1656
+ networkSecurity: NetworkSecurityPolicies;
1657
+ /** Incident response policies */
1658
+ incidentResponse: IncidentResponsePolicies;
1659
+ /** Compliance policies */
1660
+ compliance: CompliancePolicies;
1661
+ };
1662
+
1663
+ /**
1664
+ * This code was AUTOGENERATED using the codama library.
1665
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1666
+ * to add features, then rerun codama to update it.
1667
+ *
1668
+ * @see https://github.com/codama-idl/codama
1669
+ */
1670
+
1671
+ /** Session-based access constraints */
1672
+ type SessionConstraints = {
1673
+ /** Maximum session duration */
1674
+ maxSessionDuration: bigint;
1675
+ /** Idle timeout */
1676
+ idleTimeout: bigint;
1677
+ /** Re-authentication interval */
1678
+ reauthInterval: bigint;
1679
+ /** Multi-factor authentication required */
1680
+ mfaRequired: boolean;
1681
+ /** Device fingerprinting required */
1682
+ deviceFingerprinting: boolean;
1683
+ /** Session encryption required */
1684
+ sessionEncryption: boolean;
1685
+ };
1686
+
1687
+ /**
1688
+ * This code was AUTOGENERATED using the codama library.
1689
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1690
+ * to add features, then rerun codama to update it.
1691
+ *
1692
+ * @see https://github.com/codama-idl/codama
1693
+ */
1694
+
1695
+ type SessionPolicies = {
1696
+ maxSessionDuration: bigint;
1697
+ idleTimeout: bigint;
1698
+ concurrentSessions: number;
1699
+ };
1700
+
1701
+ /**
1702
+ * This code was AUTOGENERATED using the codama library.
1703
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1704
+ * to add features, then rerun codama to update it.
1705
+ *
1706
+ * @see https://github.com/codama-idl/codama
1707
+ */
1708
+
1709
+ /** Segregation of duties constraint */
1710
+ type SodConstraint = {
1711
+ /** Constraint name */
1712
+ name: string;
1713
+ /** Conflicting roles */
1714
+ conflictingRoles: Array<string>;
1715
+ /** Constraint type */
1716
+ constraintType: SodConstraintType;
1717
+ /** Enforcement level */
1718
+ enforcementLevel: EnforcementLevel;
1719
+ /** Exception procedures */
1720
+ exceptionProcedures: Array<string>;
1721
+ };
1722
+
1723
+ /**
1724
+ * This code was AUTOGENERATED using the codama library.
1725
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1726
+ * to add features, then rerun codama to update it.
1727
+ *
1728
+ * @see https://github.com/codama-idl/codama
1729
+ */
1730
+
1731
+ /** Types of segregation of duties constraints */
1732
+ declare enum SodConstraintType {
1733
+ Static = 0,
1734
+ Dynamic = 1,
1735
+ Temporal = 2,
1736
+ Contextual = 3
1737
+ }
1738
+
1739
+ /**
1740
+ * This code was AUTOGENERATED using the codama library.
1741
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1742
+ * to add features, then rerun codama to update it.
1743
+ *
1744
+ * @see https://github.com/codama-idl/codama
1745
+ */
1746
+
1747
+ /** Triggers for step-up authentication */
1748
+ declare enum StepUpTrigger {
1749
+ HighRiskAction = 0,
1750
+ SensitiveData = 1,
1751
+ LargeTransaction = 2,
1752
+ NewDevice = 3,
1753
+ UnusualLocation = 4,
1754
+ TimeBasedRisk = 5,
1755
+ BehaviorAnomaly = 6
1756
+ }
1757
+
1758
+ /**
1759
+ * This code was AUTOGENERATED using the codama library.
1760
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1761
+ * to add features, then rerun codama to update it.
1762
+ *
1763
+ * @see https://github.com/codama-idl/codama
1764
+ */
1765
+
1766
+ /** Time-based access constraints */
1767
+ type TimeConstraints = {
1768
+ /** Allowed hours (0-23) */
1769
+ allowedHours: ReadonlyUint8Array;
1770
+ /** Allowed days of week (1-7) */
1771
+ allowedDays: ReadonlyUint8Array;
1772
+ /** Timezone for time calculations */
1773
+ timezone: string;
1774
+ /** Maximum session duration (seconds) */
1775
+ maxSessionDuration: Option<bigint>;
1776
+ /** Role expiration timestamp */
1777
+ expiresAt: Option<bigint>;
1778
+ /** Periodic reactivation required */
1779
+ reactivationPeriod: Option<bigint>;
1780
+ };
1781
+
1782
+ /**
1783
+ * This code was AUTOGENERATED using the codama library.
1784
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1785
+ * to add features, then rerun codama to update it.
1786
+ *
1787
+ * @see https://github.com/codama-idl/codama
1788
+ */
1789
+
1790
+ /** Time lock mechanism for delayed execution */
1791
+ type TimeLock = {
1792
+ /** Lock duration in seconds */
1793
+ duration: bigint;
1794
+ /** Lock start timestamp */
1795
+ lockedAt: bigint;
1796
+ /** Unlock timestamp */
1797
+ unlocksAt: bigint;
1798
+ /** Early unlock conditions */
1799
+ earlyUnlockConditions: Array<ExecutionCondition>;
1800
+ /** Lock type */
1801
+ lockType: TimeLockType;
1802
+ /** Can be cancelled before execution */
1803
+ cancellable: boolean;
1804
+ };
1805
+
1806
+ /**
1807
+ * This code was AUTOGENERATED using the codama library.
1808
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1809
+ * to add features, then rerun codama to update it.
1810
+ *
1811
+ * @see https://github.com/codama-idl/codama
1812
+ */
1813
+
1814
+ /** Types of time locks */
1815
+ declare enum TimeLockType {
1816
+ Standard = 0,
1817
+ Vesting = 1,
1818
+ Emergency = 2,
1819
+ Governance = 3
1820
+ }
1821
+
1822
+ /**
1823
+ * This code was AUTOGENERATED using the codama library.
1824
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1825
+ * to add features, then rerun codama to update it.
1826
+ *
1827
+ * @see https://github.com/codama-idl/codama
1828
+ */
1829
+
1830
+ /** Transaction priority levels */
1831
+ declare enum TransactionPriority {
1832
+ Low = 0,
1833
+ Normal = 1,
1834
+ High = 2,
1835
+ Critical = 3,
1836
+ Emergency = 4
1837
+ }
1838
+
1839
+ /**
1840
+ * This code was AUTOGENERATED using the codama library.
1841
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1842
+ * to add features, then rerun codama to update it.
1843
+ *
1844
+ * @see https://github.com/codama-idl/codama
1845
+ */
1846
+
1847
+ /** Transaction execution status */
1848
+ declare enum TransactionStatus {
1849
+ Pending = 0,
1850
+ PartiallyApproved = 1,
1851
+ FullyApproved = 2,
1852
+ Executed = 3,
1853
+ Cancelled = 4,
1854
+ Expired = 5,
1855
+ Failed = 6
1856
+ }
1857
+
1858
+ /**
1859
+ * This code was AUTOGENERATED using the codama library.
1860
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1861
+ * to add features, then rerun codama to update it.
1862
+ *
1863
+ * @see https://github.com/codama-idl/codama
1864
+ */
1865
+
1866
+ /** Types of transactions that can be executed */
1867
+ declare enum TransactionType {
1868
+ Transfer = 0,
1869
+ Withdrawal = 1,
1870
+ EscrowRelease = 2,
1871
+ ProposalCreation = 3,
1872
+ VoteExecution = 4,
1873
+ ParameterUpdate = 5,
1874
+ SignerAddition = 6,
1875
+ SignerRemoval = 7,
1876
+ ThresholdUpdate = 8,
1877
+ ConfigUpdate = 9,
1878
+ EmergencyFreeze = 10,
1879
+ EmergencyUnfreeze = 11,
1880
+ SecurityPolicyUpdate = 12,
1881
+ ProtocolUpgrade = 13,
1882
+ FeatureToggle = 14,
1883
+ RiskParameterUpdate = 15,
1884
+ CustomInstruction = 16
1885
+ }
1886
+
1887
+ /**
1888
+ * This code was AUTOGENERATED using the codama library.
1889
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1890
+ * to add features, then rerun codama to update it.
1891
+ *
1892
+ * @see https://github.com/codama-idl/codama
1893
+ */
1894
+
1895
+ /** Methods to unlock accounts */
1896
+ declare enum UnlockMethod {
1897
+ TimeBasedAutoUnlock = 0,
1898
+ AdminUnlock = 1,
1899
+ SelfServiceUnlock = 2,
1900
+ MultiFactorUnlock = 3,
1901
+ SupervisorUnlock = 4
1902
+ }
1903
+
1904
+ /**
1905
+ * This code was AUTOGENERATED using the codama library.
1906
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1907
+ * to add features, then rerun codama to update it.
1908
+ *
1909
+ * @see https://github.com/codama-idl/codama
1910
+ */
1911
+
1912
+ /** Value types for constraint conditions */
1913
+ declare enum ValueType {
1914
+ String = 0,
1915
+ Number = 1,
1916
+ Boolean = 2,
1917
+ Date = 3,
1918
+ Time = 4,
1919
+ Duration = 5,
1920
+ List = 6,
1921
+ Object = 7
1922
+ }
1923
+
1924
+ /**
1925
+ * This code was AUTOGENERATED using the codama library.
1926
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1927
+ * to add features, then rerun codama to update it.
1928
+ *
1929
+ * @see https://github.com/codama-idl/codama
1930
+ */
1931
+
1932
+ /** Individual vote record */
1933
+ type Vote = {
1934
+ /** Voter public key */
1935
+ voter: Address;
1936
+ /** Vote choice */
1937
+ choice: VoteChoice;
1938
+ /** Voting power used */
1939
+ votingPower: bigint;
1940
+ /** Vote timestamp */
1941
+ votedAt: bigint;
1942
+ /** Vote reasoning (optional) */
1943
+ reasoning: Option<string>;
1944
+ /** Delegation info (if delegated vote) */
1945
+ delegationInfo: Option<DelegationInfo>;
1946
+ };
1947
+
1948
+ /**
1949
+ * This code was AUTOGENERATED using the codama library.
1950
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1951
+ * to add features, then rerun codama to update it.
1952
+ *
1953
+ * @see https://github.com/codama-idl/codama
1954
+ */
1955
+
1956
+ /** Vote choices */
1957
+ declare enum VoteChoice {
1958
+ For = 0,
1959
+ Against = 1,
1960
+ Abstain = 2
1961
+ }
1962
+
1963
+ /**
1964
+ * This code was AUTOGENERATED using the codama library.
1965
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1966
+ * to add features, then rerun codama to update it.
1967
+ *
1968
+ * @see https://github.com/codama-idl/codama
1969
+ */
1970
+
1971
+ /** Voting results for proposal */
1972
+ type VotingResults = {
1973
+ /** Total votes for */
1974
+ votesFor: bigint;
1975
+ /** Total votes against */
1976
+ votesAgainst: bigint;
1977
+ /** Total votes abstain */
1978
+ votesAbstain: bigint;
1979
+ /** Total voting power */
1980
+ totalVotingPower: bigint;
1981
+ /** Participation rate */
1982
+ participationRate: number;
1983
+ /** Individual votes */
1984
+ individualVotes: Array<Vote>;
1985
+ /** Weighted voting enabled */
1986
+ weightedVoting: boolean;
1987
+ /** Quorum reached */
1988
+ quorumReached: boolean;
1989
+ /** Approval threshold met */
1990
+ approvalThresholdMet: boolean;
1991
+ };
1992
+
1993
+ /**
1994
+ * This code was AUTOGENERATED using the codama library.
1995
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1996
+ * to add features, then rerun codama to update it.
1997
+ *
1998
+ * @see https://github.com/codama-idl/codama
1999
+ */
2000
+
2001
+ type GovernanceProposal = {
2002
+ discriminator: ReadonlyUint8Array;
2003
+ /** Proposal ID */
2004
+ proposalId: bigint;
2005
+ /** Proposer */
2006
+ proposer: Address;
2007
+ /** Proposal title */
2008
+ title: string;
2009
+ /** Proposal description */
2010
+ description: string;
2011
+ /** Proposal type */
2012
+ proposalType: ProposalType;
2013
+ /** Creation timestamp */
2014
+ createdAt: bigint;
2015
+ /** Voting start timestamp */
2016
+ votingStartsAt: bigint;
2017
+ /** Voting end timestamp */
2018
+ votingEndsAt: bigint;
2019
+ /** Execution timestamp (if approved) */
2020
+ executionTimestamp: Option<bigint>;
2021
+ /** Proposal status */
2022
+ status: ProposalStatus;
2023
+ /** Voting results */
2024
+ votingResults: VotingResults;
2025
+ /** Execution parameters */
2026
+ executionParams: ExecutionParams;
2027
+ /** Quorum requirements */
2028
+ quorumRequirements: QuorumRequirements;
2029
+ /** Proposal metadata */
2030
+ metadata: ProposalMetadata;
2031
+ /** Reserved space */
2032
+ reserved: ReadonlyUint8Array;
2033
+ };
2034
+
2035
+ /**
2036
+ * This code was AUTOGENERATED using the codama library.
2037
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2038
+ * to add features, then rerun codama to update it.
2039
+ *
2040
+ * @see https://github.com/codama-idl/codama
2041
+ */
2042
+
2043
+ type Multisig = {
2044
+ discriminator: ReadonlyUint8Array;
2045
+ /** Unique identifier */
2046
+ multisigId: bigint;
2047
+ /** Required number of signatures */
2048
+ threshold: number;
2049
+ /** List of authorized signers */
2050
+ signers: Array<Address>;
2051
+ /** Multisig owner (can modify signers) */
2052
+ owner: Address;
2053
+ /** Creation timestamp */
2054
+ createdAt: bigint;
2055
+ /** Last update timestamp */
2056
+ updatedAt: bigint;
2057
+ /** Current nonce (prevents replay attacks) */
2058
+ nonce: bigint;
2059
+ /** Pending transactions */
2060
+ pendingTransactions: Array<PendingTransaction>;
2061
+ /** Configuration settings */
2062
+ config: MultisigConfig;
2063
+ /** Emergency settings */
2064
+ emergencyConfig: EmergencyConfig;
2065
+ /** Reserved space for future extensions */
2066
+ reserved: ReadonlyUint8Array;
2067
+ };
2068
+
2069
+ /**
2070
+ * This code was AUTOGENERATED using the codama library.
2071
+ * Please DO NOT EDIT THIS FILE, instead use visitors
2072
+ * to add features, then rerun codama to update it.
2073
+ *
2074
+ * @see https://github.com/codama-idl/codama
2075
+ */
2076
+
2077
+ type RbacConfig = {
2078
+ discriminator: ReadonlyUint8Array;
2079
+ /** Authority for RBAC management */
2080
+ authority: Address;
2081
+ /** Creation timestamp */
2082
+ createdAt: bigint;
2083
+ /** Last update timestamp */
2084
+ updatedAt: bigint;
2085
+ /** Version for compatibility */
2086
+ version: number;
2087
+ /** Role definitions */
2088
+ roles: Array<Role>;
2089
+ /** Permission definitions */
2090
+ permissions: Array<Permission>;
2091
+ /** Access policies */
2092
+ accessPolicies: Array<AccessPolicy>;
2093
+ /** Security policies */
2094
+ securityPolicies: SecurityPolicies;
2095
+ /** Audit configuration */
2096
+ auditConfig: AccessAuditConfig;
2097
+ /** Emergency access procedures */
2098
+ emergencyAccess: EmergencyAccessConfig;
2099
+ /** Reserved space */
2100
+ reserved: ReadonlyUint8Array;
2101
+ };
2102
+
2103
+ /**
2104
+ * Proof data structure for transfer verification
2105
+ */
2106
+ interface TransferProofData {
2107
+ /** The encrypted transfer amount (ElGamal ciphertext) */
2108
+ encryptedTransferAmount: Uint8Array;
2109
+ /** Source account's new encrypted balance commitment */
2110
+ newSourceCommitment: Uint8Array;
2111
+ /** Equality proof for source balance */
2112
+ equalityProof: Uint8Array;
2113
+ /** Validity proof for the transfer */
2114
+ validityProof: Uint8Array;
2115
+ /** Range proof for the transfer amount and remaining balance */
2116
+ rangeProof: Uint8Array;
2117
+ }
2118
+
2119
+ /**
2120
+ * Complete ElGamal Encryption Module with Full ZK Proof Implementation
2121
+ *
2122
+ * This module provides production-ready ElGamal encryption on Curve25519 with
2123
+ * complete zero-knowledge proof generation for Solana's confidential transfers.
2124
+ *
2125
+ * Features:
2126
+ * - ElGamal encryption/decryption on ed25519
2127
+ * - Bulletproof range proofs for amounts (0 to 2^64)
2128
+ * - Validity proofs for well-formed ciphertexts
2129
+ * - Equality proofs for value conservation
2130
+ * - Transfer proofs combining all necessary proofs
2131
+ * - Full integration with Solana's ZK ElGamal Proof Program
2132
+ */
2133
+
2134
+ interface ElGamalKeypair$1 {
2135
+ publicKey: Uint8Array;
2136
+ secretKey: Uint8Array;
2137
+ }
2138
+
2139
+ /**
2140
+ * Token Utilities for SPL Token and Token 2022 (Token Extensions)
2141
+ *
2142
+ * Provides comprehensive token handling utilities including:
2143
+ * - Associated Token Account (ATA) derivation for both SPL Token and Token 2022
2144
+ * - Token 2022 specific features (transfer fees, confidential transfers, etc.)
2145
+ * - Token program detection and validation
2146
+ * - Account creation and management utilities
2147
+ *
2148
+ * Based on the latest SPL Token 2022 specification and @solana/kit v2.3.0
2149
+ */
2150
+
2151
+ /**
2152
+ * Token program variants supported by GhostSpeak
2153
+ */
2154
+ declare enum TokenProgram {
2155
+ /** Original SPL Token Program */
2156
+ SPL_TOKEN = "spl-token",
2157
+ /** SPL Token 2022 (Token Extensions) Program */
2158
+ TOKEN_2022 = "token-2022"
2159
+ }
2160
+ /**
2161
+ * Associated Token Account information
2162
+ */
2163
+ interface AssociatedTokenAccount {
2164
+ /** The derived ATA address */
2165
+ address: Address$1;
2166
+ /** The wallet/owner address */
2167
+ owner: Address$1;
2168
+ /** The token mint address */
2169
+ mint: Address$1;
2170
+ /** The token program used (SPL Token or Token 2022) */
2171
+ tokenProgram: Address$1;
2172
+ /** Whether this is a Token 2022 ATA */
2173
+ isToken2022: boolean;
2174
+ }
2175
+ /**
2176
+ * Token 2022 Extension Types
2177
+ * Based on the latest Token Extensions specification
2178
+ */
2179
+ declare enum TokenExtension {
2180
+ /** Uninitialized account */
2181
+ UNINITIALIZED = 0,
2182
+ /** Transfer fee extension */
2183
+ TRANSFER_FEE_CONFIG = 1,
2184
+ /** Transfer fee amount */
2185
+ TRANSFER_FEE_AMOUNT = 2,
2186
+ /** Mint close authority */
2187
+ MINT_CLOSE_AUTHORITY = 3,
2188
+ /** Confidential transfer mint */
2189
+ CONFIDENTIAL_TRANSFER_MINT = 4,
2190
+ /** Confidential transfer account */
2191
+ CONFIDENTIAL_TRANSFER_ACCOUNT = 5,
2192
+ /** Default account state */
2193
+ DEFAULT_ACCOUNT_STATE = 6,
2194
+ /** Immutable owner */
2195
+ IMMUTABLE_OWNER = 7,
2196
+ /** Memo transfer */
2197
+ MEMO_TRANSFER = 8,
2198
+ /** Non-transferable */
2199
+ NON_TRANSFERABLE = 9,
2200
+ /** Interest bearing mint */
2201
+ INTEREST_BEARING_MINT = 10,
2202
+ /** CPI guard */
2203
+ CPI_GUARD = 11,
2204
+ /** Permanent delegate */
2205
+ PERMANENT_DELEGATE = 12,
2206
+ /** Non-transferable account */
2207
+ NON_TRANSFERABLE_ACCOUNT = 13,
2208
+ /** Transfer hook */
2209
+ TRANSFER_HOOK = 14,
2210
+ /** Transfer hook account */
2211
+ TRANSFER_HOOK_ACCOUNT = 15,
2212
+ /** Metadata pointer */
2213
+ METADATA_POINTER = 16,
2214
+ /** Token metadata */
2215
+ TOKEN_METADATA = 17,
2216
+ /** Group pointer */
2217
+ GROUP_POINTER = 18,
2218
+ /** Token group */
2219
+ TOKEN_GROUP = 19,
2220
+ /** Group member pointer */
2221
+ GROUP_MEMBER_POINTER = 20,
2222
+ /** Token group member */
2223
+ TOKEN_GROUP_MEMBER = 21
2224
+ }
2225
+ /**
2226
+ * Transfer fee configuration for Token 2022
2227
+ */
2228
+ interface TransferFeeConfig {
2229
+ /** Transfer fee basis points (0-10000, where 10000 = 100%) */
2230
+ transferFeeBasisPoints: number;
2231
+ /** Maximum transfer fee in token base units */
2232
+ maximumFee: bigint;
2233
+ /** Authority that can modify transfer fee config */
2234
+ transferFeeConfigAuthority: Address$1 | null;
2235
+ /** Authority that can withdraw collected fees */
2236
+ withdrawWithheldAuthority: Address$1 | null;
2237
+ /** Amount of fees currently withheld */
2238
+ withheldAmount: bigint;
2239
+ /** Older transfer fee configuration */
2240
+ olderTransferFee: {
2241
+ epoch: bigint;
2242
+ transferFeeBasisPoints: number;
2243
+ maximumFee: bigint;
2244
+ };
2245
+ /** Newer transfer fee configuration */
2246
+ newerTransferFee: {
2247
+ epoch: bigint;
2248
+ transferFeeBasisPoints: number;
2249
+ maximumFee: bigint;
2250
+ };
2251
+ }
2252
+ /**
2253
+ * Confidential transfer configuration for Token 2022
2254
+ */
2255
+ interface ConfidentialTransferConfig$1 {
2256
+ /** Authority that can configure confidential transfers */
2257
+ authority: Address$1 | null;
2258
+ /** Automatically approve new accounts for confidential transfers */
2259
+ autoApproveNewAccounts: boolean;
2260
+ /** Public key for auditing confidential transfers */
2261
+ auditorElgamalPubkey: Uint8Array | null;
2262
+ }
2263
+ /**
2264
+ * Interest-bearing token configuration for Token 2022
2265
+ */
2266
+ interface InterestBearingConfig {
2267
+ /** Authority that can update the interest rate */
2268
+ rateAuthority: Address$1 | null;
2269
+ /** Current interest rate (basis points per year) */
2270
+ currentRate: number;
2271
+ /** Timestamp when interest bearing was initialized */
2272
+ initializationTimestamp: bigint;
2273
+ /** Timestamp of last rate update */
2274
+ lastUpdateTimestamp: bigint;
2275
+ /** Pre-computed interest rate */
2276
+ preUpdateAverageRate: number;
2277
+ }
2278
+ /**
2279
+ * Derive Associated Token Account address for any token program
2280
+ *
2281
+ * This is the core ATA derivation function that works with both
2282
+ * SPL Token and Token 2022 programs. The derivation follows the
2283
+ * standard pattern: ['owner', 'token_program', 'mint']
2284
+ *
2285
+ * @param owner - The wallet/owner address
2286
+ * @param mint - The token mint address
2287
+ * @param tokenProgram - The token program address (SPL Token or Token 2022)
2288
+ * @returns Promise<Address> - The derived ATA address
2289
+ */
2290
+ declare function deriveAssociatedTokenAddress(owner: Address$1, mint: Address$1, tokenProgram?: Address$1): Promise<Address$1>;
2291
+ /**
2292
+ * Derive Associated Token Account for SPL Token (legacy)
2293
+ *
2294
+ * @param owner - The wallet/owner address
2295
+ * @param mint - The token mint address
2296
+ * @returns Promise<Address> - The derived ATA address
2297
+ */
2298
+ declare function deriveSplTokenAssociatedTokenAddress(owner: Address$1, mint: Address$1): Promise<Address$1>;
2299
+ /**
2300
+ * Derive Associated Token Account for Token 2022
2301
+ *
2302
+ * @param owner - The wallet/owner address
2303
+ * @param mint - The token mint address
2304
+ * @returns Promise<Address> - The derived ATA address
2305
+ */
2306
+ declare function deriveToken2022AssociatedTokenAddress(owner: Address$1, mint: Address$1): Promise<Address$1>;
2307
+ /**
2308
+ * Get complete ATA information including program detection
2309
+ *
2310
+ * @param owner - The wallet/owner address
2311
+ * @param mint - The token mint address
2312
+ * @param tokenProgram - Optional: specify token program, auto-detect if not provided
2313
+ * @returns Promise<AssociatedTokenAccount> - Complete ATA information
2314
+ */
2315
+ declare function getAssociatedTokenAccount(owner: Address$1, mint: Address$1, tokenProgram?: Address$1): Promise<AssociatedTokenAccount>;
2316
+ /**
2317
+ * Detect which token program owns a given mint
2318
+ * Note: This requires RPC calls to fetch mint account data
2319
+ *
2320
+ * @param mint - The token mint address
2321
+ * @returns Promise<Address> - The token program address
2322
+ */
2323
+ declare function detectTokenProgram(mint: Address$1, rpcEndpoint?: string): Promise<Address$1>;
2324
+ /**
2325
+ * Check if a mint is a Token 2022 mint
2326
+ *
2327
+ * @param mint - The token mint address
2328
+ * @returns Promise<boolean> - True if Token 2022, false if SPL Token
2329
+ */
2330
+ declare function isToken2022Mint(mint: Address$1): Promise<boolean>;
2331
+ /**
2332
+ * Get the appropriate token program for a given mint
2333
+ *
2334
+ * @param mint - The token mint address
2335
+ * @returns Promise<TokenProgram> - The token program enum
2336
+ */
2337
+ declare function getTokenProgramType(mint: Address$1): Promise<TokenProgram>;
2338
+ /**
2339
+ * Check if a mint has the transfer fee extension
2340
+ *
2341
+ * @param mint - The token mint address
2342
+ * @param rpcEndpoint - Optional RPC endpoint
2343
+ * @returns Promise<boolean> - True if mint has transfer fee extension
2344
+ */
2345
+ declare function hasTransferFeeExtension(mint: Address$1, rpcEndpoint?: string): Promise<boolean>;
2346
+ /**
2347
+ * Check if a mint has the confidential transfer extension
2348
+ *
2349
+ * @param mint - The token mint address
2350
+ * @param rpcEndpoint - Optional RPC endpoint
2351
+ * @returns Promise<boolean> - True if mint has confidential transfer extension
2352
+ */
2353
+ declare function hasConfidentialTransferExtension(mint: Address$1, rpcEndpoint?: string): Promise<boolean>;
2354
+ /**
2355
+ * Check if a mint has the interest-bearing extension
2356
+ *
2357
+ * @param mint - The token mint address
2358
+ * @param rpcEndpoint - Optional RPC endpoint
2359
+ * @returns Promise<boolean> - True if mint has interest-bearing extension
2360
+ */
2361
+ declare function hasInterestBearingExtension(mint: Address$1, rpcEndpoint?: string): Promise<boolean>;
2362
+ /**
2363
+ * Get transfer fee configuration for a Token 2022 mint
2364
+ *
2365
+ * @param mint - The Token 2022 mint address
2366
+ * @returns Promise<TransferFeeConfig | null> - Transfer fee config or null if not configured
2367
+ */
2368
+ declare function getTransferFeeConfig(mint: Address$1, rpcEndpoint?: string): Promise<TransferFeeConfig | null>;
2369
+ /**
2370
+ * Get confidential transfer configuration for a Token 2022 mint
2371
+ *
2372
+ * @param mint - The Token 2022 mint address
2373
+ * @returns Promise<ConfidentialTransferConfig | null> - Confidential transfer config or null
2374
+ */
2375
+ declare function getConfidentialTransferConfig(mint: Address$1, rpcEndpoint?: string): Promise<ConfidentialTransferConfig$1 | null>;
2376
+ /**
2377
+ * Get interest-bearing configuration for a Token 2022 mint
2378
+ *
2379
+ * @param mint - The Token 2022 mint address
2380
+ * @returns Promise<InterestBearingConfig | null> - Interest-bearing config or null
2381
+ */
2382
+ declare function getInterestBearingConfig(mint: Address$1, rpcEndpoint?: string): Promise<InterestBearingConfig | null>;
2383
+ /**
2384
+ * Get all possible ATA addresses for a wallet/mint pair
2385
+ * Returns both SPL Token and Token 2022 ATAs
2386
+ *
2387
+ * @param owner - The wallet/owner address
2388
+ * @param mint - The token mint address
2389
+ * @returns Promise<{ splToken: Address, token2022: Address }> - Both ATA addresses
2390
+ */
2391
+ declare function getAllAssociatedTokenAddresses(owner: Address$1, mint: Address$1): Promise<{
2392
+ splToken: Address$1;
2393
+ token2022: Address$1;
2394
+ }>;
2395
+ /**
2396
+ * Validate if an address could be a valid ATA
2397
+ *
2398
+ * @param address - The address to validate
2399
+ * @param owner - The expected owner
2400
+ * @param mint - The expected mint
2401
+ * @returns Promise<{ isValid: boolean, program?: Address }> - Validation result
2402
+ */
2403
+ declare function validateAssociatedTokenAddress(address: Address$1, owner: Address$1, mint: Address$1): Promise<{
2404
+ isValid: boolean;
2405
+ program?: Address$1;
2406
+ }>;
2407
+ /**
2408
+ * Convert TokenProgram enum to program address
2409
+ *
2410
+ * @param program - The token program enum
2411
+ * @returns Address - The program address
2412
+ */
2413
+ declare function getTokenProgramAddress(program: TokenProgram): Address$1;
2414
+ /**
2415
+ * Convert program address to TokenProgram enum
2416
+ *
2417
+ * @param address - The program address
2418
+ * @returns TokenProgram - The token program enum
2419
+ */
2420
+ declare function getTokenProgramFromAddress(address: Address$1): TokenProgram;
2421
+ /**
2422
+ * Format token amount with proper decimals
2423
+ *
2424
+ * @param amount - Raw token amount (in base units)
2425
+ * @param decimals - Number of decimal places for the token
2426
+ * @returns string - Formatted amount
2427
+ */
2428
+ declare function formatTokenAmount(amount: bigint, decimals: number): string;
2429
+ /**
2430
+ * Parse formatted token amount to raw base units
2431
+ *
2432
+ * @param formatted - Formatted token amount string
2433
+ * @param decimals - Number of decimal places for the token
2434
+ * @returns bigint - Raw token amount
2435
+ */
2436
+ declare function parseTokenAmount(formatted: string, decimals: number): bigint;
2437
+
2438
+ /**
2439
+ * Token 2022 Extensions Implementation
2440
+ *
2441
+ * Implements advanced Token 2022 features including:
2442
+ * - Transfer fees with withdrawal mechanisms
2443
+ * - Confidential transfers using ElGamal encryption
2444
+ * - Interest-bearing tokens with rate calculations
2445
+ * - Transfer hooks and metadata pointers
2446
+ * - Account state management and CPI guards
2447
+ *
2448
+ * Based on the SPL Token 2022 specification and Solana Web3.js v2.3.0
2449
+ */
2450
+
2451
+ /**
2452
+ * Transfer fee calculation result
2453
+ */
2454
+ interface TransferFeeCalculation {
2455
+ /** Original transfer amount */
2456
+ transferAmount: bigint;
2457
+ /** Calculated fee amount */
2458
+ feeAmount: bigint;
2459
+ /** Amount after fee deduction */
2460
+ netAmount: bigint;
2461
+ /** Fee percentage (basis points) */
2462
+ feeBasisPoints: number;
2463
+ /** Whether fee was capped at maximum */
2464
+ wasFeeCapped: boolean;
2465
+ }
2466
+ /**
2467
+ * Calculate transfer fee for a Token 2022 transfer
2468
+ *
2469
+ * @param transferAmount - Amount being transferred (in token base units)
2470
+ * @param feeConfig - Transfer fee configuration
2471
+ * @returns TransferFeeCalculation - Detailed fee calculation
2472
+ */
2473
+ declare function calculateTransferFee(transferAmount: bigint, feeConfig: TransferFeeConfig): TransferFeeCalculation;
2474
+ /**
2475
+ * Calculate the total amount needed for a desired net transfer
2476
+ * (reverse calculation when you want to send a specific net amount)
2477
+ *
2478
+ * @param desiredNetAmount - The amount you want the recipient to receive
2479
+ * @param feeConfig - Transfer fee configuration
2480
+ * @returns TransferFeeCalculation - Required total amount and fee breakdown
2481
+ */
2482
+ declare function calculateRequiredAmountForNetTransfer(desiredNetAmount: bigint, feeConfig: TransferFeeConfig): TransferFeeCalculation;
2483
+ /**
2484
+ * Estimate accumulated fees for multiple transfers
2485
+ *
2486
+ * @param transfers - Array of transfer amounts
2487
+ * @param feeConfig - Transfer fee configuration
2488
+ * @returns { totalFees: bigint, feeBreakdown: TransferFeeCalculation[] }
2489
+ */
2490
+ declare function estimateAccumulatedFees(transfers: bigint[], feeConfig: TransferFeeConfig): {
2491
+ totalFees: bigint;
2492
+ feeBreakdown: TransferFeeCalculation[];
2493
+ };
2494
+ /**
2495
+ * Confidential transfer proof data
2496
+ * Note: This is a simplified structure - actual implementation would include
2497
+ * complex zero-knowledge proof data structures
2498
+ */
2499
+ interface ConfidentialTransferProof {
2500
+ /** Encrypted transfer amount (ElGamal ciphertext) */
2501
+ encryptedAmount: Uint8Array;
2502
+ /** Range proof for the transfer amount */
2503
+ rangeProof: Uint8Array;
2504
+ /** Validity proof for the transfer */
2505
+ validityProof: Uint8Array;
2506
+ /** Auditor proof (if auditing is enabled) */
2507
+ auditorProof?: Uint8Array;
2508
+ }
2509
+ /**
2510
+ * Confidential account state
2511
+ */
2512
+ interface ConfidentialAccountState {
2513
+ /** Whether the account is approved for confidential transfers */
2514
+ approved: boolean;
2515
+ /** Encrypted balance (ElGamal ciphertext) */
2516
+ encryptedBalance: Uint8Array;
2517
+ /** Pending balance encryption from incoming transfers */
2518
+ pendingBalanceCredits: Uint8Array;
2519
+ /** Number of pending credits */
2520
+ pendingBalanceCreditsCounter: number;
2521
+ /** Expected pending balance decryption */
2522
+ expectedPendingBalanceCredits: bigint;
2523
+ /** Actual pending balance decryption */
2524
+ actualPendingBalanceCredits: bigint;
2525
+ }
2526
+ /**
2527
+ * Generate confidential transfer proof
2528
+ *
2529
+ * Uses twisted ElGamal encryption to create confidential transfer proofs
2530
+ * compatible with Solana's ZK ElGamal Proof Program
2531
+ *
2532
+ * @param amount - Transfer amount (in token base units)
2533
+ * @param senderKeypair - Sender's ElGamal keypair
2534
+ * @param recipientPubkey - Recipient's ElGamal public key
2535
+ * @param auditorPubkey - Optional auditor public key
2536
+ * @returns Promise<ConfidentialTransferProof>
2537
+ */
2538
+ declare function generateConfidentialTransferProof(amount: bigint, senderKeypair: ElGamalKeypair$1, recipientPubkey: Uint8Array, auditorPubkey?: Uint8Array): Promise<ConfidentialTransferProof>;
2539
+ /**
2540
+ * Verify confidential transfer proof
2541
+ *
2542
+ * Note: In practice, proof verification happens on-chain via the
2543
+ * ZK ElGamal Proof Program. This is a client-side validation helper.
2544
+ *
2545
+ * @param proof - The proof to verify
2546
+ * @param publicInputs - Public inputs for verification
2547
+ * @returns Promise<boolean> - True if proof is valid
2548
+ */
2549
+ declare function verifyConfidentialTransferProof(proof: ConfidentialTransferProof, publicInputs: {
2550
+ senderPubkey: Uint8Array;
2551
+ recipientPubkey: Uint8Array;
2552
+ auditorPubkey?: Uint8Array;
2553
+ }): Promise<boolean>;
2554
+ /**
2555
+ * Interest calculation result
2556
+ */
2557
+ interface InterestCalculation {
2558
+ /** Principal amount */
2559
+ principal: bigint;
2560
+ /** Interest rate (basis points per year) */
2561
+ annualRateBasisPoints: number;
2562
+ /** Time period for calculation (seconds) */
2563
+ timePeriodSeconds: bigint;
2564
+ /** Calculated interest amount */
2565
+ interestAmount: bigint;
2566
+ /** New total balance */
2567
+ newAmount: bigint;
2568
+ /** Effective annual rate */
2569
+ effectiveAnnualRate: number;
2570
+ }
2571
+ /**
2572
+ * Calculate interest for an interest-bearing token
2573
+ *
2574
+ * @param principal - Current token balance
2575
+ * @param config - Interest-bearing configuration
2576
+ * @param currentTimestamp - Current timestamp (seconds)
2577
+ * @returns InterestCalculation - Detailed interest calculation
2578
+ */
2579
+ declare function calculateInterest(principal: bigint, config: InterestBearingConfig, currentTimestamp: bigint): InterestCalculation;
2580
+ /**
2581
+ * Calculate compound interest with custom compounding periods
2582
+ *
2583
+ * @param principal - Initial amount
2584
+ * @param annualRateBasisPoints - Annual interest rate (basis points)
2585
+ * @param compoundingPeriodsPerYear - Number of compounding periods per year (e.g., 12 for monthly)
2586
+ * @param years - Time period in years (can be fractional)
2587
+ * @returns InterestCalculation - Detailed compound interest calculation
2588
+ */
2589
+ declare function calculateCompoundInterest(principal: bigint, annualRateBasisPoints: number, compoundingPeriodsPerYear: number, years: number): InterestCalculation;
2590
+ /**
2591
+ * Transfer hook instruction data
2592
+ */
2593
+ interface TransferHookInstruction {
2594
+ /** Program ID of the hook */
2595
+ programId: Address$1;
2596
+ /** Instruction data to pass to the hook */
2597
+ instructionData: Uint8Array;
2598
+ /** Additional accounts required by the hook */
2599
+ additionalAccounts: Address$1[];
2600
+ }
2601
+ /**
2602
+ * Transfer hook context passed to hook programs
2603
+ */
2604
+ interface TransferHookContext {
2605
+ /** Source account */
2606
+ source: Address$1;
2607
+ /** Destination account */
2608
+ destination: Address$1;
2609
+ /** Authority performing the transfer */
2610
+ authority: Address$1;
2611
+ /** Transfer amount */
2612
+ amount: bigint;
2613
+ /** Token mint */
2614
+ mint: Address$1;
2615
+ /** Additional context data */
2616
+ contextData: Uint8Array;
2617
+ }
2618
+ /**
2619
+ * Validate transfer hook instruction format
2620
+ *
2621
+ * @param instruction - The hook instruction to validate
2622
+ * @returns boolean - True if instruction format is valid
2623
+ */
2624
+ declare function validateTransferHookInstruction(instruction: TransferHookInstruction): boolean;
2625
+ /**
2626
+ * Create transfer hook instruction data
2627
+ *
2628
+ * @param hookProgramId - Program ID of the transfer hook
2629
+ * @param context - Transfer context data
2630
+ * @returns TransferHookInstruction - Formatted instruction
2631
+ */
2632
+ declare function createTransferHookInstruction(hookProgramId: Address$1, context: TransferHookContext): TransferHookInstruction;
2633
+ /**
2634
+ * Token metadata structure (simplified)
2635
+ */
2636
+ interface TokenMetadata {
2637
+ /** Token name */
2638
+ name: string;
2639
+ /** Token symbol */
2640
+ symbol: string;
2641
+ /** Token description */
2642
+ description: string;
2643
+ /** Token image URI */
2644
+ image?: string;
2645
+ /** External URI for additional metadata */
2646
+ externalUri?: string;
2647
+ /** Additional attributes */
2648
+ attributes?: {
2649
+ trait_type: string;
2650
+ value: string;
2651
+ }[];
2652
+ }
2653
+ /**
2654
+ * Metadata pointer configuration
2655
+ */
2656
+ interface MetadataPointerConfig {
2657
+ /** Authority that can update metadata pointer */
2658
+ authority: Address$1 | null;
2659
+ /** Address where metadata is stored */
2660
+ metadataAddress: Address$1 | null;
2661
+ }
2662
+ /**
2663
+ * Serialize token metadata for on-chain storage
2664
+ *
2665
+ * @param metadata - Token metadata object
2666
+ * @returns Uint8Array - Serialized metadata
2667
+ */
2668
+ declare function serializeTokenMetadata(metadata: TokenMetadata): Uint8Array;
2669
+ /**
2670
+ * Deserialize token metadata from on-chain storage
2671
+ *
2672
+ * @param data - Serialized metadata bytes
2673
+ * @returns TokenMetadata - Parsed metadata object
2674
+ */
2675
+ declare function deserializeTokenMetadata(data: Uint8Array): TokenMetadata;
2676
+ /**
2677
+ * Token account state options for Token 2022
2678
+ */
2679
+ declare enum TokenAccountState {
2680
+ /** Account is uninitialized */
2681
+ UNINITIALIZED = 0,
2682
+ /** Account is initialized and usable */
2683
+ INITIALIZED = 1,
2684
+ /** Account is frozen (transfers disabled) */
2685
+ FROZEN = 2
2686
+ }
2687
+ /**
2688
+ * CPI Guard configuration
2689
+ */
2690
+ interface CpiGuardConfig {
2691
+ /** Whether CPI guard is enabled */
2692
+ enabled: boolean;
2693
+ /** Authority that can toggle CPI guard */
2694
+ authority: Address$1 | null;
2695
+ }
2696
+ /**
2697
+ * Non-transferable token configuration
2698
+ */
2699
+ interface NonTransferableConfig {
2700
+ /** Whether the token is non-transferable */
2701
+ nonTransferable: boolean;
2702
+ }
2703
+ /**
2704
+ * Immutable owner configuration
2705
+ */
2706
+ interface ImmutableOwnerConfig {
2707
+ /** Whether the account has immutable owner */
2708
+ immutable: boolean;
2709
+ }
2710
+ /**
2711
+ * Check if account state allows transfers
2712
+ *
2713
+ * @param state - Current account state
2714
+ * @param isNonTransferable - Whether token is non-transferable
2715
+ * @param isFrozen - Whether account is frozen
2716
+ * @returns boolean - True if transfers are allowed
2717
+ */
2718
+ declare function canTransfer(state: TokenAccountState, isNonTransferable?: boolean, isFrozen?: boolean): boolean;
2719
+ /**
2720
+ * Get required extensions for account creation
2721
+ *
2722
+ * @param extensions - Desired extensions
2723
+ * @returns TokenExtension[] - Required extensions in dependency order
2724
+ */
2725
+ declare function getRequiredExtensions(extensions: TokenExtension[]): TokenExtension[];
2726
+ /**
2727
+ * Convert basis points to percentage
2728
+ *
2729
+ * @param basisPoints - Basis points (10000 = 100%)
2730
+ * @returns number - Percentage as decimal (1.0 = 100%)
2731
+ */
2732
+ declare function basisPointsToPercentage(basisPoints: number): number;
2733
+ /**
2734
+ * Convert percentage to basis points
2735
+ *
2736
+ * @param percentage - Percentage as decimal (1.0 = 100%)
2737
+ * @returns number - Basis points
2738
+ */
2739
+ declare function percentageToBasisPoints(percentage: number): number;
2740
+ /**
2741
+ * Format basis points as readable percentage
2742
+ *
2743
+ * @param basisPoints - Basis points
2744
+ * @returns string - Formatted percentage (e.g., "2.50%")
2745
+ */
2746
+ declare function formatBasisPoints(basisPoints: number): string;
2747
+ /**
2748
+ * Estimate gas costs for Token 2022 operations
2749
+ *
2750
+ * @param operation - Type of operation
2751
+ * @param extensions - Extensions involved
2752
+ * @returns bigint - Estimated compute units
2753
+ */
2754
+ declare function estimateComputeUnits(operation: 'transfer' | 'create_account' | 'mint' | 'burn', extensions?: TokenExtension[]): bigint;
2755
+ /**
2756
+ * Create transfer fee configuration with validation
2757
+ */
2758
+ declare function createTransferFeeConfig(params: {
2759
+ transferFeeBasisPoints: number;
2760
+ maximumFee: bigint;
2761
+ transferFeeConfigAuthority: Address$1 | null;
2762
+ withdrawWithheldAuthority: Address$1 | null;
2763
+ }): TransferFeeConfig;
2764
+ /**
2765
+ * Create interest bearing configuration with validation
2766
+ */
2767
+ declare function createInterestBearingConfig(params: {
2768
+ rateAuthority: Address$1 | null;
2769
+ currentRate: number;
2770
+ }): InterestBearingConfig;
2771
+ /**
2772
+ * Parse token extension data from raw bytes
2773
+ */
2774
+ declare function parseTokenExtension(extensionType: 'TransferFeeConfig' | 'InterestBearingConfig' | string, data: Uint8Array): TransferFeeConfig | InterestBearingConfig;
2775
+
2776
+ type token2022Extensions_ConfidentialAccountState = ConfidentialAccountState;
2777
+ type token2022Extensions_ConfidentialTransferProof = ConfidentialTransferProof;
2778
+ type token2022Extensions_CpiGuardConfig = CpiGuardConfig;
2779
+ type token2022Extensions_ImmutableOwnerConfig = ImmutableOwnerConfig;
2780
+ type token2022Extensions_InterestCalculation = InterestCalculation;
2781
+ type token2022Extensions_MetadataPointerConfig = MetadataPointerConfig;
2782
+ type token2022Extensions_NonTransferableConfig = NonTransferableConfig;
2783
+ type token2022Extensions_TokenAccountState = TokenAccountState;
2784
+ declare const token2022Extensions_TokenAccountState: typeof TokenAccountState;
2785
+ type token2022Extensions_TokenMetadata = TokenMetadata;
2786
+ type token2022Extensions_TransferFeeCalculation = TransferFeeCalculation;
2787
+ type token2022Extensions_TransferFeeConfig = TransferFeeConfig;
2788
+ type token2022Extensions_TransferHookContext = TransferHookContext;
2789
+ type token2022Extensions_TransferHookInstruction = TransferHookInstruction;
2790
+ declare const token2022Extensions_basisPointsToPercentage: typeof basisPointsToPercentage;
2791
+ declare const token2022Extensions_calculateCompoundInterest: typeof calculateCompoundInterest;
2792
+ declare const token2022Extensions_calculateInterest: typeof calculateInterest;
2793
+ declare const token2022Extensions_calculateRequiredAmountForNetTransfer: typeof calculateRequiredAmountForNetTransfer;
2794
+ declare const token2022Extensions_calculateTransferFee: typeof calculateTransferFee;
2795
+ declare const token2022Extensions_canTransfer: typeof canTransfer;
2796
+ declare const token2022Extensions_createInterestBearingConfig: typeof createInterestBearingConfig;
2797
+ declare const token2022Extensions_createTransferFeeConfig: typeof createTransferFeeConfig;
2798
+ declare const token2022Extensions_createTransferHookInstruction: typeof createTransferHookInstruction;
2799
+ declare const token2022Extensions_deserializeTokenMetadata: typeof deserializeTokenMetadata;
2800
+ declare const token2022Extensions_estimateAccumulatedFees: typeof estimateAccumulatedFees;
2801
+ declare const token2022Extensions_estimateComputeUnits: typeof estimateComputeUnits;
2802
+ declare const token2022Extensions_formatBasisPoints: typeof formatBasisPoints;
2803
+ declare const token2022Extensions_generateConfidentialTransferProof: typeof generateConfidentialTransferProof;
2804
+ declare const token2022Extensions_getRequiredExtensions: typeof getRequiredExtensions;
2805
+ declare const token2022Extensions_parseTokenExtension: typeof parseTokenExtension;
2806
+ declare const token2022Extensions_percentageToBasisPoints: typeof percentageToBasisPoints;
2807
+ declare const token2022Extensions_serializeTokenMetadata: typeof serializeTokenMetadata;
2808
+ declare const token2022Extensions_validateTransferHookInstruction: typeof validateTransferHookInstruction;
2809
+ declare const token2022Extensions_verifyConfidentialTransferProof: typeof verifyConfidentialTransferProof;
2810
+ declare namespace token2022Extensions {
2811
+ export { type token2022Extensions_ConfidentialAccountState as ConfidentialAccountState, type token2022Extensions_ConfidentialTransferProof as ConfidentialTransferProof, type token2022Extensions_CpiGuardConfig as CpiGuardConfig, type token2022Extensions_ImmutableOwnerConfig as ImmutableOwnerConfig, type token2022Extensions_InterestCalculation as InterestCalculation, type token2022Extensions_MetadataPointerConfig as MetadataPointerConfig, type token2022Extensions_NonTransferableConfig as NonTransferableConfig, token2022Extensions_TokenAccountState as TokenAccountState, type token2022Extensions_TokenMetadata as TokenMetadata, type token2022Extensions_TransferFeeCalculation as TransferFeeCalculation, type token2022Extensions_TransferFeeConfig as TransferFeeConfig, type token2022Extensions_TransferHookContext as TransferHookContext, type token2022Extensions_TransferHookInstruction as TransferHookInstruction, token2022Extensions_basisPointsToPercentage as basisPointsToPercentage, token2022Extensions_calculateCompoundInterest as calculateCompoundInterest, token2022Extensions_calculateInterest as calculateInterest, token2022Extensions_calculateRequiredAmountForNetTransfer as calculateRequiredAmountForNetTransfer, token2022Extensions_calculateTransferFee as calculateTransferFee, token2022Extensions_canTransfer as canTransfer, token2022Extensions_createInterestBearingConfig as createInterestBearingConfig, token2022Extensions_createTransferFeeConfig as createTransferFeeConfig, token2022Extensions_createTransferHookInstruction as createTransferHookInstruction, token2022Extensions_deserializeTokenMetadata as deserializeTokenMetadata, token2022Extensions_estimateAccumulatedFees as estimateAccumulatedFees, token2022Extensions_estimateComputeUnits as estimateComputeUnits, token2022Extensions_formatBasisPoints as formatBasisPoints, token2022Extensions_generateConfidentialTransferProof as generateConfidentialTransferProof, token2022Extensions_getRequiredExtensions as getRequiredExtensions, token2022Extensions_parseTokenExtension as parseTokenExtension, token2022Extensions_percentageToBasisPoints as percentageToBasisPoints, token2022Extensions_serializeTokenMetadata as serializeTokenMetadata, token2022Extensions_validateTransferHookInstruction as validateTransferHookInstruction, token2022Extensions_verifyConfidentialTransferProof as verifyConfidentialTransferProof };
2812
+ }
2813
+
2814
+ /**
2815
+ * Discriminator Validation Utilities
2816
+ *
2817
+ * Handles discriminator validation and provides fallback mechanisms
2818
+ * for accounts with mismatched discriminators
2819
+ */
2820
+
2821
+ interface DiscriminatorValidationResult {
2822
+ isValid: boolean;
2823
+ expectedLength: number;
2824
+ actualLength: number;
2825
+ canDecode: boolean;
2826
+ needsMigration: boolean;
2827
+ errorMessage?: string;
2828
+ }
2829
+ interface AccountInspectionResult {
2830
+ address: string;
2831
+ dataLength: number;
2832
+ discriminator: Uint8Array | null;
2833
+ discriminatorLength: number;
2834
+ isAgentAccount: boolean;
2835
+ needsMigration: boolean;
2836
+ rawData: Uint8Array;
2837
+ }
2838
+ /**
2839
+ * Validates account discriminator before attempting to decode
2840
+ */
2841
+ declare function validateAccountDiscriminator(accountData: Uint8Array, expectedDiscriminator: Uint8Array): DiscriminatorValidationResult;
2842
+ /**
2843
+ * Create user-friendly error message for discriminator issues
2844
+ */
2845
+ declare function createDiscriminatorErrorMessage(validation: DiscriminatorValidationResult, accountType: string, address: string): string;
2846
+ /**
2847
+ * Safe Agent account decoding with discriminator validation
2848
+ * Returns a compatibility result with exists property
2849
+ */
2850
+ declare function safeDecodeAgent(encodedAccount: {
2851
+ address: Address$1;
2852
+ data: Uint8Array;
2853
+ }): Promise<{
2854
+ exists: boolean;
2855
+ data?: unknown;
2856
+ } | null>;
2857
+ /**
2858
+ * Inspects account data and extracts useful information about discriminator
2859
+ */
2860
+ declare function inspectAccountData(encodedAccount: EncodedAccount | MaybeEncodedAccount, address: string): AccountInspectionResult;
2861
+
2862
+ /**
2863
+ * Account Migration Utility
2864
+ *
2865
+ * Handles migration of old Agent accounts that were created with
2866
+ * different discriminator formats to the current format.
2867
+ */
2868
+
2869
+ interface MigrationPlan {
2870
+ address: string;
2871
+ currentState: 'valid' | 'needs_migration' | 'invalid' | 'not_exists';
2872
+ migrationType: 'none' | 'recreate' | 'data_conversion' | 'unsupported';
2873
+ issues: string[];
2874
+ recommendations: string[];
2875
+ canAutoMigrate: boolean;
2876
+ }
2877
+ interface MigrationResult {
2878
+ success: boolean;
2879
+ address: string;
2880
+ action: 'skipped' | 'migrated' | 'failed';
2881
+ error?: string;
2882
+ newAccountData?: Uint8Array;
2883
+ }
2884
+ interface LegacyAgentData {
2885
+ discriminator: Uint8Array;
2886
+ owner?: string;
2887
+ name?: string;
2888
+ }
2889
+ /**
2890
+ * Analyzes an account and creates a migration plan
2891
+ */
2892
+ declare function createMigrationPlan(encodedAccount: EncodedAccount | MaybeEncodedAccount, address: string): Promise<MigrationPlan>;
2893
+ /**
2894
+ * Attempts to extract meaningful data from a legacy account
2895
+ */
2896
+ declare function extractLegacyData(encodedAccount: EncodedAccount | MaybeEncodedAccount): LegacyAgentData | null;
2897
+ /**
2898
+ * Creates a detailed migration report for multiple accounts
2899
+ */
2900
+ declare function createMigrationReport(accounts: {
2901
+ address: string;
2902
+ encodedAccount: EncodedAccount | MaybeEncodedAccount;
2903
+ }[]): Promise<{
2904
+ summary: {
2905
+ total: number;
2906
+ valid: number;
2907
+ needsMigration: number;
2908
+ invalid: number;
2909
+ canAutoMigrate: number;
2910
+ };
2911
+ plans: MigrationPlan[];
2912
+ recommendations: string[];
2913
+ }>;
2914
+ /**
2915
+ * Simulates migration without actually performing it
2916
+ */
2917
+ declare function simulateMigration(encodedAccount: EncodedAccount | MaybeEncodedAccount, address: string): Promise<{
2918
+ plan: MigrationPlan;
2919
+ simulation: {
2920
+ wouldSucceed: boolean;
2921
+ estimatedSteps: string[];
2922
+ warnings: string[];
2923
+ requiredActions: string[];
2924
+ };
2925
+ }>;
2926
+ /**
2927
+ * Provides user-friendly migration instructions
2928
+ */
2929
+ declare function getMigrationInstructions(plan: MigrationPlan): string[];
2930
+
2931
+ /**
2932
+ * Account Diagnostics Utility
2933
+ *
2934
+ * Comprehensive diagnostic tools for inspecting and debugging
2935
+ * account discriminator issues and data format problems.
2936
+ */
2937
+
2938
+ interface DiagnosticReport {
2939
+ address: string;
2940
+ timestamp: string;
2941
+ accountExists: boolean;
2942
+ discriminatorValidation: ReturnType<typeof validateAccountDiscriminator>;
2943
+ inspection: AccountInspectionResult;
2944
+ migrationPlan: Awaited<ReturnType<typeof createMigrationPlan>>;
2945
+ migrationSimulation: Awaited<ReturnType<typeof simulateMigration>>;
2946
+ recommendations: string[];
2947
+ debugInfo: {
2948
+ expectedDiscriminator: number[];
2949
+ actualDiscriminator: number[] | null;
2950
+ dataPreview: number[];
2951
+ programId?: string;
2952
+ };
2953
+ }
2954
+ interface BatchDiagnosticReport {
2955
+ summary: {
2956
+ total: number;
2957
+ valid: number;
2958
+ invalid: number;
2959
+ needsMigration: number;
2960
+ notExists: number;
2961
+ };
2962
+ reports: DiagnosticReport[];
2963
+ globalRecommendations: string[];
2964
+ timestamp: string;
2965
+ }
2966
+ /**
2967
+ * Runs comprehensive diagnostics on a single account
2968
+ */
2969
+ declare function runAccountDiagnostics(encodedAccount: EncodedAccount | MaybeEncodedAccount, address: string): Promise<DiagnosticReport>;
2970
+ /**
2971
+ * Runs diagnostics on multiple accounts
2972
+ */
2973
+ declare function runBatchDiagnostics(accounts: {
2974
+ address: string;
2975
+ encodedAccount: EncodedAccount | MaybeEncodedAccount;
2976
+ }[]): Promise<BatchDiagnosticReport>;
2977
+ /**
2978
+ * Fetches and diagnoses an account directly from the blockchain
2979
+ */
2980
+ declare function diagnoseAccountFromChain(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address, options?: {
2981
+ logToConsole?: boolean;
2982
+ }): Promise<DiagnosticReport>;
2983
+ /**
2984
+ * Fetches and diagnoses multiple accounts from the blockchain
2985
+ */
2986
+ declare function diagnoseBatchFromChain(rpc: Parameters<typeof fetchEncodedAccount>[0], addresses: Address[], options?: {
2987
+ logToConsole?: boolean;
2988
+ maxConcurrent?: number;
2989
+ }): Promise<BatchDiagnosticReport>;
2990
+ /**
2991
+ * Exports a diagnostic report as JSON
2992
+ */
2993
+ declare function exportDiagnosticReport(report: DiagnosticReport | BatchDiagnosticReport, filename?: string): string;
2994
+
2995
+ type accountDiagnostics_BatchDiagnosticReport = BatchDiagnosticReport;
2996
+ type accountDiagnostics_DiagnosticReport = DiagnosticReport;
2997
+ declare const accountDiagnostics_diagnoseAccountFromChain: typeof diagnoseAccountFromChain;
2998
+ declare const accountDiagnostics_diagnoseBatchFromChain: typeof diagnoseBatchFromChain;
2999
+ declare const accountDiagnostics_exportDiagnosticReport: typeof exportDiagnosticReport;
3000
+ declare const accountDiagnostics_runAccountDiagnostics: typeof runAccountDiagnostics;
3001
+ declare const accountDiagnostics_runBatchDiagnostics: typeof runBatchDiagnostics;
3002
+ declare namespace accountDiagnostics {
3003
+ export { type accountDiagnostics_BatchDiagnosticReport as BatchDiagnosticReport, type accountDiagnostics_DiagnosticReport as DiagnosticReport, accountDiagnostics_diagnoseAccountFromChain as diagnoseAccountFromChain, accountDiagnostics_diagnoseBatchFromChain as diagnoseBatchFromChain, accountDiagnostics_exportDiagnosticReport as exportDiagnosticReport, accountDiagnostics_runAccountDiagnostics as runAccountDiagnostics, accountDiagnostics_runBatchDiagnostics as runBatchDiagnostics };
3004
+ }
3005
+
3006
+ /**
3007
+ * Utility functions for Program Derived Addresses (PDAs)
3008
+ * Based on generated patterns from Codama
3009
+ */
3010
+ /**
3011
+ * Derive agent PDA
3012
+ * Pattern: ['agent', owner, agentId]
3013
+ * NOTE: Uses raw UTF-8 bytes to match smart contract's agent_id.as_bytes()
3014
+ */
3015
+ declare function deriveAgentPda(programId: Address$1, owner: Address$1, agentId: string): Promise<Address$1>;
3016
+ /**
3017
+ * Derive service listing PDA
3018
+ * Pattern: ['service_listing', creator, listingId]
3019
+ */
3020
+ declare function deriveServiceListingPda(programId: Address$1, creator: Address$1, listingId: string): Promise<Address$1>;
3021
+ /**
3022
+ * Derive job posting PDA
3023
+ * Pattern: ['job_posting', employer, jobId]
3024
+ */
3025
+ declare function deriveJobPostingPda(programId: Address$1, employer: Address$1, jobId: string): Promise<Address$1>;
3026
+ /**
3027
+ * Derive job application PDA
3028
+ * Pattern: ['job_application', jobPosting, applicant]
3029
+ */
3030
+ declare function deriveJobApplicationPda(programId: Address$1, jobPosting: Address$1, applicant: Address$1): Promise<Address$1>;
3031
+ /**
3032
+ * Derive work order PDA (used for escrow functionality)
3033
+ * Pattern: ['work_order', client, orderId] (little-endian bytes)
3034
+ * NOTE: Smart contract expects orderId as little-endian bytes, not U64 encoded
3035
+ */
3036
+ declare function deriveWorkOrderPda(programId: Address$1, client: Address$1, orderId: bigint): Promise<Address$1>;
3037
+ /**
3038
+ * Derive work delivery PDA
3039
+ * Pattern: ['work_delivery', workOrder, provider]
3040
+ */
3041
+ declare function deriveWorkDeliveryPda(programId: Address$1, workOrder: Address$1, provider: Address$1): Promise<Address$1>;
3042
+ /**
3043
+ * Derive payment PDA
3044
+ * Pattern: ['payment', workOrder, payer]
3045
+ */
3046
+ declare function derivePaymentPda(programId: Address$1, workOrder: Address$1, payer: Address$1): Promise<Address$1>;
3047
+ /**
3048
+ * Derive A2A session PDA
3049
+ * Pattern: ['a2a_session', creator]
3050
+ */
3051
+ declare function deriveA2ASessionPda(programId: Address$1, creator: Address$1): Promise<Address$1>;
3052
+ /**
3053
+ * Derive A2A message PDA
3054
+ * Pattern: ['a2a_message', session, session.created_at]
3055
+ * NOTE: Fixed to match smart contract expectation - uses session.created_at as little-endian bytes
3056
+ */
3057
+ declare function deriveA2AMessagePda(programId: Address$1, session: Address$1, sessionCreatedAt: bigint): Promise<Address$1>;
3058
+ /**
3059
+ * Derive user registry PDA
3060
+ * Pattern: ['user_registry', signer]
3061
+ * NOTE: Fixed to match smart contract expectations - includes signer address
3062
+ */
3063
+ declare function deriveUserRegistryPda(programId: Address$1, signer: Address$1): Promise<Address$1>;
3064
+ /**
3065
+ * Derive service purchase PDA
3066
+ * Pattern: ['service_purchase', serviceListing, buyer]
3067
+ */
3068
+ declare function deriveServicePurchasePda(programId: Address$1, serviceListing: Address$1, buyer: Address$1): Promise<Address$1>;
3069
+ /**
3070
+ * Derive agent verification PDA
3071
+ * Pattern: ['agent_verification', agent, verifier]
3072
+ */
3073
+ declare function deriveAgentVerificationPda(programId: Address$1, agent: Address$1, verifier: Address$1): Promise<Address$1>;
3074
+ /**
3075
+ * Generic PDA finder for custom use cases
3076
+ * Pattern: seeds array with automatic encoding
3077
+ */
3078
+ declare function findProgramDerivedAddress(seeds: (string | Address$1 | Uint8Array)[], programId: Address$1): Promise<[Address$1, number]>;
3079
+
3080
+ /**
3081
+ * Enhanced Client Error Utilities
3082
+ *
3083
+ * Provides wrapper functions for SDK operations that automatically enhance
3084
+ * error messages with detailed instruction account information.
3085
+ */
3086
+
3087
+ /**
3088
+ * Enhanced error class for SDK operations
3089
+ */
3090
+ declare class GhostSpeakSDKError extends Error {
3091
+ readonly originalError: Error;
3092
+ readonly operation: string;
3093
+ readonly instructionName?: string;
3094
+ constructor(operation: string, originalError: Error, instructionName?: string);
3095
+ }
3096
+ /**
3097
+ * Type for account context
3098
+ */
3099
+ type AccountContext = Address$1 | {
3100
+ address: Address$1;
3101
+ name?: string;
3102
+ };
3103
+ /**
3104
+ * Wrapper for async operations that enhances errors with instruction context
3105
+ */
3106
+ declare function withEnhancedErrors<T>(operation: string, instructionName: string | undefined, fn: () => Promise<T>, debugAccounts?: AccountContext[]): Promise<T>;
3107
+ /**
3108
+ * Wrapper for synchronous operations that enhances errors with instruction context
3109
+ */
3110
+ declare function withEnhancedErrorsSync<T>(operation: string, instructionName: string | undefined, fn: () => T, debugAccounts?: AccountContext[]): T;
3111
+ /**
3112
+ * Parse and enhance transaction errors with instruction context
3113
+ */
3114
+ declare function enhanceTransactionError(error: Error, instructionName?: string, accounts?: AccountContext[]): Error;
3115
+ /**
3116
+ * Helper to log detailed error information for debugging
3117
+ */
3118
+ declare function logEnhancedError(error: Error, context?: {
3119
+ operation?: string;
3120
+ instructionName?: string;
3121
+ accounts?: AccountContext[];
3122
+ params?: Record<string, unknown>;
3123
+ }): void;
3124
+ /**
3125
+ * Error context for operations
3126
+ */
3127
+ interface ErrorContext {
3128
+ operation: string;
3129
+ instructionName?: string;
3130
+ accounts?: AccountContext[];
3131
+ params?: Record<string, unknown>;
3132
+ }
3133
+ /**
3134
+ * Create a detailed error context for operations
3135
+ */
3136
+ declare function createErrorContext(operation: string, instructionName?: string, accounts?: AccountContext[], params?: Record<string, unknown>): ErrorContext;
3137
+ /**
3138
+ * Validate common preconditions and throw enhanced errors
3139
+ */
3140
+ declare function validatePreconditions(checks: {
3141
+ condition: boolean;
3142
+ message: string;
3143
+ instructionName?: string;
3144
+ }[]): void;
3145
+ /**
3146
+ * Helper to extract instruction name from operation context
3147
+ */
3148
+ declare function extractInstructionName(operation: string): string | undefined;
3149
+
3150
+ /**
3151
+ * Governance Helper Utilities
3152
+ *
3153
+ * Comprehensive utilities for RBAC management, multi-signature wallets,
3154
+ * proposal lifecycle, and voting mechanisms.
3155
+ */
3156
+
3157
+ /**
3158
+ * Derive multisig account PDA
3159
+ */
3160
+ declare function deriveMultisigPda(programId: Address, authority: Address, multisigId: bigint): Promise<Address>;
3161
+ /**
3162
+ * Derive proposal account PDA
3163
+ */
3164
+ declare function deriveProposalPda(programId: Address, multisig: Address, proposalId: bigint): Promise<Address>;
3165
+ /**
3166
+ * Derive RBAC account PDA
3167
+ */
3168
+ declare function deriveRbacPda(programId: Address, admin: Address): Promise<Address>;
3169
+ declare class MultisigUtils {
3170
+ /**
3171
+ * Calculate if a multisig action has reached threshold
3172
+ */
3173
+ static hasReachedThreshold(multisig: Multisig, approvalCount: number): boolean;
3174
+ /**
3175
+ * Check if an address is a signer on the multisig
3176
+ */
3177
+ static isSigner(multisig: Multisig, address: Address): boolean;
3178
+ /**
3179
+ * Calculate remaining signatures needed
3180
+ */
3181
+ static remainingSignatures(multisig: Multisig, currentApprovals: number): number;
3182
+ /**
3183
+ * Validate multisig configuration
3184
+ */
3185
+ static validateConfiguration(signers: Address[], threshold: number): {
3186
+ valid: boolean;
3187
+ error?: string;
3188
+ };
3189
+ /**
3190
+ * Generate multisig configuration summary
3191
+ */
3192
+ static generateSummary(multisig: Multisig): string;
3193
+ }
3194
+ declare class ProposalUtils {
3195
+ /**
3196
+ * Check if proposal is in voting period
3197
+ */
3198
+ static isVotingOpen(proposal: GovernanceProposal): boolean;
3199
+ /**
3200
+ * Check if proposal has expired
3201
+ */
3202
+ static hasExpired(proposal: GovernanceProposal): boolean;
3203
+ /**
3204
+ * Calculate time remaining for voting
3205
+ */
3206
+ static timeRemaining(proposal: GovernanceProposal): bigint;
3207
+ /**
3208
+ * Format time remaining as human-readable string
3209
+ */
3210
+ static formatTimeRemaining(proposal: GovernanceProposal): string;
3211
+ /**
3212
+ * Calculate if proposal has reached quorum
3213
+ */
3214
+ static hasReachedQuorum(votingResults: VotingResults, quorumRequirements: QuorumRequirements, totalEligibleVoters: number): boolean;
3215
+ /**
3216
+ * Calculate voting results summary
3217
+ */
3218
+ static calculateResults(votingResults: VotingResults): {
3219
+ total: number;
3220
+ forPercentage: number;
3221
+ againstPercentage: number;
3222
+ abstainPercentage: number;
3223
+ passed: boolean;
3224
+ };
3225
+ /**
3226
+ * Validate proposal
3227
+ */
3228
+ static validateProposal(proposal: GovernanceProposal): {
3229
+ valid: boolean;
3230
+ error?: string;
3231
+ };
3232
+ }
3233
+ declare class RbacUtils {
3234
+ /**
3235
+ * Check if a user has a specific permission
3236
+ */
3237
+ static hasPermission(rbac: RbacConfig, user: Address, permission: string): boolean;
3238
+ /**
3239
+ * Get user's role
3240
+ */
3241
+ static getUserRole(rbac: RbacConfig, user: Address): Role | null;
3242
+ /**
3243
+ * Check if permission string is valid
3244
+ */
3245
+ static isValidPermission(permission: string): boolean;
3246
+ /**
3247
+ * Validate role configuration
3248
+ */
3249
+ static validateRole(role: Role): {
3250
+ valid: boolean;
3251
+ error?: string;
3252
+ };
3253
+ /**
3254
+ * Generate permission summary
3255
+ */
3256
+ static generatePermissionSummary(permissions: Permission[]): string;
3257
+ }
3258
+ declare class VotingUtils {
3259
+ /**
3260
+ * Calculate vote weight based on token holdings or other factors
3261
+ */
3262
+ static calculateVoteWeight(baseWeight: number, tokenBalance?: bigint, stakeDuration?: bigint): number;
3263
+ /**
3264
+ * Format vote choice as string
3265
+ */
3266
+ static formatVoteChoice(voteChoice: VoteChoice): string;
3267
+ /**
3268
+ * Calculate if simple majority is reached
3269
+ */
3270
+ static hasSimpleMajority(votingResults: VotingResults): boolean;
3271
+ /**
3272
+ * Calculate if supermajority is reached (2/3)
3273
+ */
3274
+ static hasSupermajority(votingResults: VotingResults): boolean;
3275
+ }
3276
+ declare const PERMISSION_TEMPLATES: {
3277
+ ADMIN: {
3278
+ CREATE_PROPOSAL: {
3279
+ action: string;
3280
+ resource: string;
3281
+ };
3282
+ EXECUTE_PROPOSAL: {
3283
+ action: string;
3284
+ resource: string;
3285
+ };
3286
+ MANAGE_ROLES: {
3287
+ action: string;
3288
+ resource: string;
3289
+ };
3290
+ MANAGE_TREASURY: {
3291
+ action: string;
3292
+ resource: string;
3293
+ };
3294
+ };
3295
+ MEMBER: {
3296
+ VOTE: {
3297
+ action: string;
3298
+ resource: string;
3299
+ };
3300
+ VIEW: {
3301
+ action: string;
3302
+ resource: string;
3303
+ };
3304
+ COMMENT: {
3305
+ action: string;
3306
+ resource: string;
3307
+ };
3308
+ };
3309
+ MODERATOR: {
3310
+ CANCEL_PROPOSAL: {
3311
+ action: string;
3312
+ resource: string;
3313
+ };
3314
+ MODERATE_COMMENTS: {
3315
+ action: string;
3316
+ resource: string;
3317
+ };
3318
+ VIEW_REPORTS: {
3319
+ action: string;
3320
+ resource: string;
3321
+ };
3322
+ };
3323
+ };
3324
+ declare const ROLE_TEMPLATES: {
3325
+ ADMIN: {
3326
+ name: string;
3327
+ description: string;
3328
+ permissions: ({
3329
+ action: string;
3330
+ resource: string;
3331
+ } | {
3332
+ action: string;
3333
+ resource: string;
3334
+ } | {
3335
+ action: string;
3336
+ resource: string;
3337
+ } | {
3338
+ action: string;
3339
+ resource: string;
3340
+ })[];
3341
+ };
3342
+ MEMBER: {
3343
+ name: string;
3344
+ description: string;
3345
+ permissions: ({
3346
+ action: string;
3347
+ resource: string;
3348
+ } | {
3349
+ action: string;
3350
+ resource: string;
3351
+ } | {
3352
+ action: string;
3353
+ resource: string;
3354
+ })[];
3355
+ };
3356
+ MODERATOR: {
3357
+ name: string;
3358
+ description: string;
3359
+ permissions: {
3360
+ action: string;
3361
+ resource: string;
3362
+ }[];
3363
+ };
3364
+ };
3365
+ interface GovernanceAnalytics {
3366
+ totalProposals: number;
3367
+ activeProposals: number;
3368
+ passedProposals: number;
3369
+ failedProposals: number;
3370
+ averageVoterTurnout: number;
3371
+ topVoters: {
3372
+ address: Address;
3373
+ voteCount: number;
3374
+ }[];
3375
+ proposalCategories: {
3376
+ category: string;
3377
+ count: number;
3378
+ }[];
3379
+ }
3380
+ declare class GovernanceAnalyticsUtils {
3381
+ /**
3382
+ * Calculate governance health score (0-100)
3383
+ */
3384
+ static calculateHealthScore(analytics: GovernanceAnalytics): number;
3385
+ /**
3386
+ * Generate governance summary report
3387
+ */
3388
+ static generateSummaryReport(analytics: GovernanceAnalytics): string;
3389
+ }
3390
+
3391
+ type governanceHelpers_GovernanceAnalytics = GovernanceAnalytics;
3392
+ type governanceHelpers_GovernanceAnalyticsUtils = GovernanceAnalyticsUtils;
3393
+ declare const governanceHelpers_GovernanceAnalyticsUtils: typeof GovernanceAnalyticsUtils;
3394
+ type governanceHelpers_MultisigUtils = MultisigUtils;
3395
+ declare const governanceHelpers_MultisigUtils: typeof MultisigUtils;
3396
+ declare const governanceHelpers_PERMISSION_TEMPLATES: typeof PERMISSION_TEMPLATES;
3397
+ type governanceHelpers_ProposalUtils = ProposalUtils;
3398
+ declare const governanceHelpers_ProposalUtils: typeof ProposalUtils;
3399
+ declare const governanceHelpers_ROLE_TEMPLATES: typeof ROLE_TEMPLATES;
3400
+ type governanceHelpers_RbacUtils = RbacUtils;
3401
+ declare const governanceHelpers_RbacUtils: typeof RbacUtils;
3402
+ type governanceHelpers_VotingUtils = VotingUtils;
3403
+ declare const governanceHelpers_VotingUtils: typeof VotingUtils;
3404
+ declare const governanceHelpers_deriveMultisigPda: typeof deriveMultisigPda;
3405
+ declare const governanceHelpers_deriveProposalPda: typeof deriveProposalPda;
3406
+ declare const governanceHelpers_deriveRbacPda: typeof deriveRbacPda;
3407
+ declare namespace governanceHelpers {
3408
+ export { type governanceHelpers_GovernanceAnalytics as GovernanceAnalytics, governanceHelpers_GovernanceAnalyticsUtils as GovernanceAnalyticsUtils, governanceHelpers_MultisigUtils as MultisigUtils, governanceHelpers_PERMISSION_TEMPLATES as PERMISSION_TEMPLATES, governanceHelpers_ProposalUtils as ProposalUtils, governanceHelpers_ROLE_TEMPLATES as ROLE_TEMPLATES, governanceHelpers_RbacUtils as RbacUtils, governanceHelpers_VotingUtils as VotingUtils, governanceHelpers_deriveMultisigPda as deriveMultisigPda, governanceHelpers_deriveProposalPda as deriveProposalPda, governanceHelpers_deriveRbacPda as deriveRbacPda };
3409
+ }
3410
+
3411
+ /**
3412
+ * IPFS client implementation with multiple provider support
3413
+ */
3414
+
3415
+ /**
3416
+ * Main IPFS client with multiple provider support and fallback
3417
+ */
3418
+ declare class IPFSClient {
3419
+ private config;
3420
+ private providers;
3421
+ private cache;
3422
+ constructor(config: IPFSConfig);
3423
+ private initializeProviders;
3424
+ private createProvider;
3425
+ /**
3426
+ * Upload content to IPFS with automatic fallback
3427
+ */
3428
+ upload(content: string | Uint8Array, options?: IPFSUploadOptions): Promise<IPFSOperationResult<IPFSUploadResult>>;
3429
+ /**
3430
+ * Retrieve content from IPFS with caching and fallback
3431
+ */
3432
+ retrieve(hash: string, options?: IPFSRetrievalOptions): Promise<IPFSOperationResult<IPFSRetrievalResult>>;
3433
+ /**
3434
+ * Pin content on IPFS
3435
+ */
3436
+ pin(hash: string): Promise<IPFSOperationResult<IPFSPinResult>>;
3437
+ /**
3438
+ * Store content with automatic IPFS decision based on size
3439
+ */
3440
+ storeContent(content: string, type: IPFSContentMetadata['type'], options?: IPFSUploadOptions & {
3441
+ forceIpfs?: boolean;
3442
+ }): Promise<ContentStorageResult>;
3443
+ /**
3444
+ * Retrieve content that may be stored inline or on IPFS
3445
+ */
3446
+ retrieveContent(uri: string): Promise<string>;
3447
+ /**
3448
+ * Retry wrapper for operations
3449
+ */
3450
+ private withRetry;
3451
+ /**
3452
+ * Calculate checksum for content integrity
3453
+ */
3454
+ private calculateChecksum;
3455
+ /**
3456
+ * Clear cache
3457
+ */
3458
+ clearCache(): void;
3459
+ /**
3460
+ * Get cache stats
3461
+ */
3462
+ getCacheStats(): {
3463
+ size: number;
3464
+ keys: string[];
3465
+ };
3466
+ }
3467
+
3468
+ type ipfsClient_IPFSClient = IPFSClient;
3469
+ declare const ipfsClient_IPFSClient: typeof IPFSClient;
3470
+ declare namespace ipfsClient {
3471
+ export { ipfsClient_IPFSClient as IPFSClient };
3472
+ }
3473
+
3474
+ /**
3475
+ * ElGamal Encryption Implementation for Token-2022 Confidential Transfers
3476
+ *
3477
+ * Implements twisted ElGamal encryption over curve25519 as specified
3478
+ * by Solana's confidential transfer extension.
3479
+ *
3480
+ * Key features:
3481
+ * - Twisted ElGamal with Pedersen commitments
3482
+ * - Homomorphic addition/subtraction of ciphertexts
3483
+ * - Efficient decryption for small values (up to 32 bits)
3484
+ * - Compatible with Solana's ZK ElGamal Proof Program
3485
+ */
3486
+
3487
+ /**
3488
+ * ElGamal public key (32 bytes)
3489
+ */
3490
+ type ElGamalPubkey = Uint8Array;
3491
+ /**
3492
+ * ElGamal secret key (32 bytes)
3493
+ */
3494
+ type ElGamalSecretKey = Uint8Array;
3495
+ /**
3496
+ * ElGamal keypair
3497
+ */
3498
+ interface ElGamalKeypair {
3499
+ publicKey: ElGamalPubkey;
3500
+ secretKey: ElGamalSecretKey;
3501
+ }
3502
+ /**
3503
+ * Pedersen commitment (curve point)
3504
+ */
3505
+ interface PedersenCommitment {
3506
+ /** Commitment to the value */
3507
+ commitment: Uint8Array;
3508
+ }
3509
+ /**
3510
+ * Decrypt handle for ElGamal ciphertext
3511
+ */
3512
+ interface DecryptHandle {
3513
+ /** Encrypted randomness */
3514
+ handle: Uint8Array;
3515
+ }
3516
+ /**
3517
+ * Twisted ElGamal ciphertext
3518
+ * Split into Pedersen commitment and decrypt handle
3519
+ */
3520
+ interface ElGamalCiphertext {
3521
+ /** Pedersen commitment (independent of pubkey) */
3522
+ commitment: PedersenCommitment;
3523
+ /** Decrypt handle (encodes randomness) */
3524
+ handle: DecryptHandle;
3525
+ }
3526
+ /**
3527
+ * Generate a new ElGamal keypair
3528
+ *
3529
+ * @param seed - Optional seed for deterministic generation
3530
+ * @returns ElGamalKeypair
3531
+ */
3532
+ declare function generateElGamalKeypair(seed?: Uint8Array): ElGamalKeypair;
3533
+
3534
+ /**
3535
+ * Client-Side Encryption Service
3536
+ *
3537
+ * Provides client-side encryption for privacy features while the
3538
+ * ZK ElGamal Proof Program is disabled. This is a temporary solution
3539
+ * that will be replaced/enhanced when ZK proofs are re-enabled.
3540
+ */
3541
+
3542
+ interface EncryptedData {
3543
+ /** Encrypted payload */
3544
+ ciphertext: ElGamalCiphertext;
3545
+ /** Public key used for encryption */
3546
+ publicKey: ElGamalPubkey;
3547
+ /** Commitment to the plaintext (for verification) */
3548
+ commitment: Uint8Array;
3549
+ /** Timestamp of encryption */
3550
+ timestamp: number;
3551
+ /** Version for future compatibility */
3552
+ version: number;
3553
+ }
3554
+ interface PrivateMetadata {
3555
+ /** Encrypted data */
3556
+ encrypted: EncryptedData;
3557
+ /** Public metadata (not encrypted) */
3558
+ public: Record<string, unknown>;
3559
+ /** IPFS hash if stored off-chain */
3560
+ ipfsHash?: string;
3561
+ /** On-chain storage hash */
3562
+ storageHash: Uint8Array;
3563
+ }
3564
+ interface ClientEncryptionOptions {
3565
+ /** Whether to generate range proofs locally */
3566
+ generateLocalProofs?: boolean;
3567
+ /** Whether to store on IPFS */
3568
+ useIpfsStorage?: boolean;
3569
+ /** Custom encryption keypair (uses ephemeral if not provided) */
3570
+ encryptionKeypair?: ElGamalKeypair;
3571
+ }
3572
+ declare class ClientEncryptionService {
3573
+ private keypair;
3574
+ private featureFlags;
3575
+ constructor(options?: ClientEncryptionOptions);
3576
+ /**
3577
+ * Encrypt an amount for a recipient
3578
+ */
3579
+ encryptAmountForRecipient(amount: bigint, recipientPubkey: ElGamalPubkey): Promise<EncryptedData>;
3580
+ /**
3581
+ * Decrypt an amount (requires private key)
3582
+ */
3583
+ decryptAmount(encrypted: EncryptedData, secretKey: Uint8Array): Promise<bigint>;
3584
+ /**
3585
+ * Encrypt arbitrary data
3586
+ */
3587
+ encryptData(data: Uint8Array, recipientPubkey: ElGamalPubkey): Promise<EncryptedData>;
3588
+ /**
3589
+ * Create private metadata with mixed public/private data
3590
+ */
3591
+ createPrivateMetadata(privateData: Record<string, unknown>, publicData: Record<string, unknown>, recipientPubkey: ElGamalPubkey): Promise<PrivateMetadata>;
3592
+ /**
3593
+ * Verify encrypted data integrity
3594
+ */
3595
+ verifyCommitment(encrypted: EncryptedData): Promise<boolean>;
3596
+ /**
3597
+ * Create a commitment to an amount
3598
+ */
3599
+ private createCommitment;
3600
+ /**
3601
+ * Create a commitment to arbitrary data
3602
+ */
3603
+ private createDataCommitment;
3604
+ /**
3605
+ * Create storage hash for on-chain reference
3606
+ */
3607
+ private createStorageHash;
3608
+ /**
3609
+ * Combine multiple ciphertext chunks
3610
+ */
3611
+ private combineChunks;
3612
+ }
3613
+ /**
3614
+ * Generate a local privacy proof (not verified on-chain)
3615
+ * This is a placeholder for when ZK proofs are unavailable
3616
+ */
3617
+ declare function generateLocalPrivacyProof(encrypted: EncryptedData, statement: string): Promise<{
3618
+ proof: Uint8Array;
3619
+ publicInputs: Uint8Array;
3620
+ timestamp: number;
3621
+ }>;
3622
+ /**
3623
+ * Verify a local privacy proof
3624
+ */
3625
+ declare function verifyLocalPrivacyProof(proof: Uint8Array, publicInputs: Uint8Array, encrypted: EncryptedData): Promise<boolean>;
3626
+ /**
3627
+ * Prepare encrypted data for future ZK proof migration
3628
+ */
3629
+ interface ZkMigrationData {
3630
+ /** Current encrypted data */
3631
+ clientEncrypted: EncryptedData;
3632
+ /** Metadata for ZK proof generation */
3633
+ zkMetadata: {
3634
+ amount?: bigint;
3635
+ randomness?: Uint8Array;
3636
+ publicKey: ElGamalPubkey;
3637
+ };
3638
+ /** Migration version */
3639
+ migrationVersion: number;
3640
+ }
3641
+ /**
3642
+ * Prepare data for future ZK proof migration
3643
+ */
3644
+ declare function prepareForZkMigration(encrypted: EncryptedData, amount?: bigint, randomness?: Uint8Array): ZkMigrationData;
3645
+
3646
+ type clientEncryption_ClientEncryptionOptions = ClientEncryptionOptions;
3647
+ type clientEncryption_ClientEncryptionService = ClientEncryptionService;
3648
+ declare const clientEncryption_ClientEncryptionService: typeof ClientEncryptionService;
3649
+ type clientEncryption_ElGamalCiphertext = ElGamalCiphertext;
3650
+ type clientEncryption_ElGamalKeypair = ElGamalKeypair;
3651
+ type clientEncryption_ElGamalPubkey = ElGamalPubkey;
3652
+ type clientEncryption_EncryptedData = EncryptedData;
3653
+ type clientEncryption_PrivateMetadata = PrivateMetadata;
3654
+ type clientEncryption_ZkMigrationData = ZkMigrationData;
3655
+ declare const clientEncryption_generateElGamalKeypair: typeof generateElGamalKeypair;
3656
+ declare const clientEncryption_generateLocalPrivacyProof: typeof generateLocalPrivacyProof;
3657
+ declare const clientEncryption_prepareForZkMigration: typeof prepareForZkMigration;
3658
+ declare const clientEncryption_verifyLocalPrivacyProof: typeof verifyLocalPrivacyProof;
3659
+ declare namespace clientEncryption {
3660
+ export { type clientEncryption_ClientEncryptionOptions as ClientEncryptionOptions, clientEncryption_ClientEncryptionService as ClientEncryptionService, type clientEncryption_ElGamalCiphertext as ElGamalCiphertext, type clientEncryption_ElGamalKeypair as ElGamalKeypair, type clientEncryption_ElGamalPubkey as ElGamalPubkey, type clientEncryption_EncryptedData as EncryptedData, type clientEncryption_PrivateMetadata as PrivateMetadata, type clientEncryption_ZkMigrationData as ZkMigrationData, clientEncryption_generateElGamalKeypair as generateElGamalKeypair, clientEncryption_generateLocalPrivacyProof as generateLocalPrivacyProof, clientEncryption_prepareForZkMigration as prepareForZkMigration, clientEncryption_verifyLocalPrivacyProof as verifyLocalPrivacyProof };
3661
+ }
3662
+
3663
+ /**
3664
+ * Private Metadata Storage
3665
+ *
3666
+ * Handles off-chain storage of encrypted data with on-chain references.
3667
+ * Supports IPFS and other storage backends for private data while
3668
+ * maintaining on-chain integrity verification.
3669
+ */
3670
+
3671
+ interface StorageProvider {
3672
+ store(data: Uint8Array): Promise<string>;
3673
+ retrieve(hash: string): Promise<Uint8Array>;
3674
+ delete(hash: string): Promise<boolean>;
3675
+ }
3676
+ interface StoredPrivateData {
3677
+ /** On-chain reference hash */
3678
+ onChainHash: Uint8Array;
3679
+ /** Storage provider identifier */
3680
+ storageProvider: 'ipfs' | 'arweave' | 'custom';
3681
+ /** Storage location (IPFS hash, Arweave ID, etc) */
3682
+ storageLocation: string;
3683
+ /** Encryption metadata */
3684
+ encryptionMetadata: {
3685
+ version: number;
3686
+ publicKey: Uint8Array;
3687
+ timestamp: number;
3688
+ };
3689
+ /** Size of stored data */
3690
+ size: number;
3691
+ /** Content type hint */
3692
+ contentType?: string;
3693
+ }
3694
+ interface PrivateDataReference {
3695
+ /** Account storing the reference */
3696
+ account: Address;
3697
+ /** Storage details */
3698
+ storage: StoredPrivateData;
3699
+ /** Access control */
3700
+ accessControl: {
3701
+ owner: Address;
3702
+ allowedReaders: Address[];
3703
+ expiresAt?: number;
3704
+ };
3705
+ }
3706
+ /**
3707
+ * Mock IPFS storage provider (for testing)
3708
+ * In production, this would use actual IPFS
3709
+ */
3710
+ declare class MockIPFSProvider implements StorageProvider {
3711
+ private storage;
3712
+ store(data: Uint8Array): Promise<string>;
3713
+ retrieve(hash: string): Promise<Uint8Array>;
3714
+ delete(hash: string): Promise<boolean>;
3715
+ }
3716
+ /**
3717
+ * Local storage provider (for development)
3718
+ */
3719
+ declare class LocalStorageProvider implements StorageProvider {
3720
+ private prefix;
3721
+ store(data: Uint8Array): Promise<string>;
3722
+ retrieve(hash: string): Promise<Uint8Array>;
3723
+ delete(hash: string): Promise<boolean>;
3724
+ }
3725
+ declare class PrivateMetadataStorage {
3726
+ private encryptionService;
3727
+ private storageProvider;
3728
+ private featureFlags;
3729
+ constructor(storageProvider?: StorageProvider, encryptionService?: ClientEncryptionService);
3730
+ /**
3731
+ * Store private data off-chain with on-chain reference
3732
+ */
3733
+ storePrivateData(data: Record<string, unknown>, publicMetadata: Record<string, unknown>, recipientPubkey: Uint8Array): Promise<StoredPrivateData>;
3734
+ /**
3735
+ * Retrieve private data from off-chain storage
3736
+ */
3737
+ retrievePrivateData(reference: StoredPrivateData, secretKey: Uint8Array): Promise<{
3738
+ privateData: Record<string, unknown>;
3739
+ publicData: Record<string, unknown>;
3740
+ }>;
3741
+ /**
3742
+ * Create a verifiable link between on-chain and off-chain data
3743
+ */
3744
+ createVerifiableLink(onChainData: Record<string, unknown>, offChainReference: StoredPrivateData): Uint8Array;
3745
+ /**
3746
+ * Batch store multiple private data items
3747
+ */
3748
+ batchStore(items: {
3749
+ data: Record<string, unknown>;
3750
+ publicMetadata: Record<string, unknown>;
3751
+ recipientPubkey: Uint8Array;
3752
+ }[]): Promise<StoredPrivateData[]>;
3753
+ private serializePrivateMetadata;
3754
+ private deserializePrivateMetadata;
3755
+ private createOnChainHash;
3756
+ private decryptPrivateData;
3757
+ }
3758
+ /**
3759
+ * Query builder for private data
3760
+ */
3761
+ declare class PrivateDataQuery {
3762
+ private conditions;
3763
+ where(field: string, operator: 'eq' | 'gt' | 'lt' | 'contains', value: unknown): this;
3764
+ whereEncrypted(field: string, commitment: Uint8Array): this;
3765
+ /**
3766
+ * Execute query against encrypted data
3767
+ * Note: This is limited compared to on-chain queries
3768
+ */
3769
+ execute(storage: PrivateMetadataStorage, references: StoredPrivateData[]): Promise<StoredPrivateData[]>;
3770
+ }
3771
+ /**
3772
+ * Calculate storage cost estimate
3773
+ */
3774
+ declare function estimateStorageCost(dataSize: number, provider: 'ipfs' | 'arweave'): {
3775
+ cost: bigint;
3776
+ currency: string;
3777
+ };
3778
+ /**
3779
+ * Create a privacy manifest for transparency
3780
+ */
3781
+ interface PrivacyManifest {
3782
+ dataTypes: string[];
3783
+ encryptionMethod: 'elgamal' | 'aes256';
3784
+ storageLocation: 'ipfs' | 'arweave' | 'on-chain';
3785
+ retentionPeriod?: number;
3786
+ accessControl: 'owner-only' | 'public-read' | 'permissioned';
3787
+ }
3788
+ declare function createPrivacyManifest(dataTypes: string[], options?: Partial<PrivacyManifest>): PrivacyManifest;
3789
+
3790
+ interface ProofGenerationResult {
3791
+ proof: Uint8Array;
3792
+ commitment?: Uint8Array;
3793
+ instruction?: IInstruction;
3794
+ requiresZkProgram: boolean;
3795
+ }
3796
+ declare enum ProofMode {
3797
+ /** Use ZK program if available, error if not */
3798
+ ZK_PROGRAM_ONLY = "zk_program_only",
3799
+ /** Use ZK program if available, fallback to local if not */
3800
+ ZK_PROGRAM_WITH_FALLBACK = "zk_program_with_fallback",
3801
+ /** Always use local verification (for testing) */
3802
+ LOCAL_ONLY = "local_only",
3803
+ /** Automatically detect based on network status */
3804
+ AUTO_DETECT = "auto_detect"
3805
+ }
3806
+ interface ProofGenerationOptions {
3807
+ mode?: ProofMode;
3808
+ connection?: Connection;
3809
+ }
3810
+ /**
3811
+ * Generate a range proof with proper commitment handling
3812
+ *
3813
+ * This creates a Pedersen commitment and bulletproof that can be
3814
+ * verified either by the ZK program or locally.
3815
+ */
3816
+ declare function generateRangeProofWithCommitment(amount: bigint, randomness: Uint8Array, options?: ProofGenerationOptions): Promise<ProofGenerationResult>;
3817
+ /**
3818
+ * Generate a complete transfer proof with all components
3819
+ */
3820
+ declare function generateTransferProofWithInstruction(sourceBalance: ElGamalCiphertext, transferAmount: bigint, sourcePubkey: ElGamalPubkey, destPubkey: ElGamalPubkey, sourceRandomness: Uint8Array, options?: ProofGenerationOptions): Promise<{
3821
+ transferProof: TransferProofData;
3822
+ newSourceBalance: ElGamalCiphertext;
3823
+ destCiphertext: ElGamalCiphertext;
3824
+ instruction?: IInstruction;
3825
+ requiresZkProgram: boolean;
3826
+ }>;
3827
+ /**
3828
+ * Check if ZK program is available
3829
+ */
3830
+ declare function isZkProgramAvailable(connection?: Connection): Promise<boolean>;
3831
+ /**
3832
+ * Get ZK program status message
3833
+ */
3834
+ declare function getZkProgramStatus(connection?: Connection): Promise<string>;
3835
+
3836
+ /**
3837
+ * Confidential Transfer Manager
3838
+ *
3839
+ * High-level interface for managing confidential transfers with Token-2022.
3840
+ * Handles proof generation, account configuration, and transfer operations
3841
+ * with proper fallback behavior while the ZK program is disabled.
3842
+ */
3843
+
3844
+ interface ConfidentialAccount {
3845
+ /** The account address */
3846
+ address: Address;
3847
+ /** The mint address */
3848
+ mint: Address;
3849
+ /** ElGamal public key for this account */
3850
+ elgamalPubkey: ElGamalPubkey;
3851
+ /** Current encrypted balance */
3852
+ encryptedBalance: ElGamalCiphertext;
3853
+ /** Decryptable available balance */
3854
+ decryptableAvailableBalance: bigint;
3855
+ /** Maximum pending balance credit counter */
3856
+ maxPendingBalanceCredits: bigint;
3857
+ /** Whether the account is configured for confidential transfers */
3858
+ configured: boolean;
3859
+ }
3860
+ interface ConfidentialTransferConfig {
3861
+ /** The mint to configure */
3862
+ mint: Address;
3863
+ /** Authority for confidential transfers */
3864
+ authority: TransactionSigner;
3865
+ /** Whether to auto-approve new accounts */
3866
+ autoApproveNewAccounts: boolean;
3867
+ /** Optional auditor ElGamal public key */
3868
+ auditorElgamalPubkey?: ElGamalPubkey;
3869
+ }
3870
+ interface ConfigureAccountParams {
3871
+ /** The token account to configure */
3872
+ account: Address;
3873
+ /** The mint address */
3874
+ mint: Address;
3875
+ /** The account's ElGamal keypair */
3876
+ elgamalKeypair: ElGamalKeypair;
3877
+ /** Initial decryptable balance (usually 0) */
3878
+ decryptableZeroBalance: bigint;
3879
+ /** Maximum pending balance credit counter */
3880
+ maxPendingBalanceCredits: bigint;
3881
+ /** Account owner/authority */
3882
+ authority: TransactionSigner;
3883
+ /** Proof mode */
3884
+ proofMode?: ProofMode;
3885
+ }
3886
+ interface DepositParams {
3887
+ /** The account to deposit to */
3888
+ account: Address;
3889
+ /** The mint address */
3890
+ mint: Address;
3891
+ /** Amount to deposit (in token units) */
3892
+ amount: bigint;
3893
+ /** Token decimals */
3894
+ decimals: number;
3895
+ /** Account authority */
3896
+ authority: TransactionSigner;
3897
+ /** Proof mode */
3898
+ proofMode?: ProofMode;
3899
+ }
3900
+ interface WithdrawParams {
3901
+ /** The account to withdraw from */
3902
+ account: Address;
3903
+ /** The mint address */
3904
+ mint: Address;
3905
+ /** Amount to withdraw (in token units) */
3906
+ amount: bigint;
3907
+ /** Token decimals */
3908
+ decimals: number;
3909
+ /** ElGamal secret key for decryption */
3910
+ elgamalSecretKey: Uint8Array;
3911
+ /** New decryptable available balance after withdrawal */
3912
+ newDecryptableBalance: bigint;
3913
+ /** Account authority */
3914
+ authority: TransactionSigner;
3915
+ /** Proof mode */
3916
+ proofMode?: ProofMode;
3917
+ }
3918
+ interface TransferParams {
3919
+ /** Source account */
3920
+ source: Address;
3921
+ /** Destination account */
3922
+ destination: Address;
3923
+ /** The mint address */
3924
+ mint: Address;
3925
+ /** Transfer amount */
3926
+ amount: bigint;
3927
+ /** Source ElGamal keypair */
3928
+ sourceKeypair: ElGamalKeypair;
3929
+ /** Destination ElGamal public key */
3930
+ destElgamalPubkey: ElGamalPubkey;
3931
+ /** New source decryptable balance */
3932
+ newSourceDecryptableBalance: bigint;
3933
+ /** Transfer authority */
3934
+ authority: TransactionSigner;
3935
+ /** Proof mode */
3936
+ proofMode?: ProofMode;
3937
+ }
3938
+ declare class ConfidentialTransferManager {
3939
+ private connection;
3940
+ private defaultProofMode;
3941
+ private clientEncryption;
3942
+ private metadataStorage;
3943
+ private featureFlags;
3944
+ constructor(connection: Connection, defaultProofMode?: ProofMode);
3945
+ /**
3946
+ * Get the current privacy mode status
3947
+ */
3948
+ getPrivacyStatus(): Promise<{
3949
+ mode: 'zk-proofs' | 'client-encryption' | 'disabled';
3950
+ available: boolean;
3951
+ message: string;
3952
+ }>;
3953
+ /**
3954
+ * Get the current status of the ZK program
3955
+ */
3956
+ getZkProgramStatus(): Promise<string>;
3957
+ /**
3958
+ * Check if ZK program is available
3959
+ */
3960
+ isZkProgramAvailable(): Promise<boolean>;
3961
+ /**
3962
+ * Generate a new ElGamal keypair for an account
3963
+ */
3964
+ generateKeypair(): ElGamalKeypair;
3965
+ /**
3966
+ * Configure a mint for confidential transfers
3967
+ */
3968
+ createConfigureMintInstruction(config: ConfidentialTransferConfig): IInstruction;
3969
+ /**
3970
+ * Configure an account for confidential transfers
3971
+ */
3972
+ createConfigureAccountInstructions(params: ConfigureAccountParams): Promise<{
3973
+ instructions: IInstruction[];
3974
+ proofInstructions: IInstruction[];
3975
+ warnings: string[];
3976
+ }>;
3977
+ /**
3978
+ * Create deposit instructions with dual-mode support
3979
+ */
3980
+ createDepositInstructions(params: DepositParams): Promise<{
3981
+ instructions: IInstruction[];
3982
+ proofInstructions: IInstruction[];
3983
+ encryptedAmount: ElGamalCiphertext;
3984
+ warnings: string[];
3985
+ metadata?: StoredPrivateData;
3986
+ }>;
3987
+ /**
3988
+ * Create transfer instructions with dual-mode support
3989
+ */
3990
+ createTransferInstructions(params: TransferParams): Promise<{
3991
+ instructions: IInstruction[];
3992
+ proofInstructions: IInstruction[];
3993
+ newSourceBalance: ElGamalCiphertext;
3994
+ destCiphertext: ElGamalCiphertext;
3995
+ warnings: string[];
3996
+ metadata?: StoredPrivateData;
3997
+ }>;
3998
+ /**
3999
+ * Generate a zero-balance proof for account configuration
4000
+ */
4001
+ private generateZeroBalanceProof;
4002
+ /**
4003
+ * Get account's ElGamal public key (placeholder)
4004
+ */
4005
+ private getAccountElGamalPubkey;
4006
+ /**
4007
+ * Get encrypted balance (placeholder)
4008
+ */
4009
+ private getEncryptedBalance;
4010
+ /**
4011
+ * Create a transfer hash for metadata reference
4012
+ */
4013
+ private createTransferHash;
4014
+ /**
4015
+ * Monitor ZK program status and switch modes when available
4016
+ */
4017
+ monitorZkProgramAvailability(callback: (status: {
4018
+ enabled: boolean;
4019
+ message: string;
4020
+ }) => void): Promise<() => void>;
4021
+ /**
4022
+ * Create a privacy-preserving work order
4023
+ */
4024
+ createPrivateWorkOrder(params: {
4025
+ title: string;
4026
+ encryptedDetails: EncryptedData;
4027
+ publicMetadata: Record<string, unknown>;
4028
+ recipientPubkey: ElGamalPubkey;
4029
+ }): Promise<{
4030
+ workOrderHash: Uint8Array;
4031
+ metadata: StoredPrivateData;
4032
+ warnings: string[];
4033
+ }>;
4034
+ /**
4035
+ * Serialize ciphertext for instruction data
4036
+ */
4037
+ private serializeCiphertext;
4038
+ }
4039
+
4040
+ type confidentialTransferManager_ConfidentialAccount = ConfidentialAccount;
4041
+ type confidentialTransferManager_ConfidentialTransferConfig = ConfidentialTransferConfig;
4042
+ type confidentialTransferManager_ConfidentialTransferManager = ConfidentialTransferManager;
4043
+ declare const confidentialTransferManager_ConfidentialTransferManager: typeof ConfidentialTransferManager;
4044
+ type confidentialTransferManager_ConfigureAccountParams = ConfigureAccountParams;
4045
+ type confidentialTransferManager_DepositParams = DepositParams;
4046
+ type confidentialTransferManager_TransferParams = TransferParams;
4047
+ type confidentialTransferManager_WithdrawParams = WithdrawParams;
4048
+ declare namespace confidentialTransferManager {
4049
+ export { type confidentialTransferManager_ConfidentialAccount as ConfidentialAccount, type confidentialTransferManager_ConfidentialTransferConfig as ConfidentialTransferConfig, confidentialTransferManager_ConfidentialTransferManager as ConfidentialTransferManager, type confidentialTransferManager_ConfigureAccountParams as ConfigureAccountParams, type confidentialTransferManager_DepositParams as DepositParams, type confidentialTransferManager_TransferParams as TransferParams, type confidentialTransferManager_WithdrawParams as WithdrawParams };
4050
+ }
4051
+
4052
+ /**
4053
+ * Feature Flags for GhostSpeak Protocol
4054
+ *
4055
+ * Centralized feature flag management for enabling/disabling features
4056
+ * based on network conditions and protocol status.
4057
+ */
4058
+ interface FeatureFlags {
4059
+ /** Enable confidential transfers (currently in beta) */
4060
+ CONFIDENTIAL_TRANSFERS_ENABLED: boolean;
4061
+ /** Use ZK proofs for verification (disabled until ZK program re-enabled) */
4062
+ USE_ZK_PROOFS: boolean;
4063
+ /** Use client-side encryption as fallback */
4064
+ USE_CLIENT_ENCRYPTION: boolean;
4065
+ /** Enable IPFS integration for private metadata */
4066
+ ENABLE_IPFS_STORAGE: boolean;
4067
+ /** Enable compressed NFTs for agents */
4068
+ ENABLE_COMPRESSED_AGENTS: boolean;
4069
+ /** Enable governance features */
4070
+ ENABLE_GOVERNANCE: boolean;
4071
+ /** Enable analytics collection */
4072
+ ENABLE_ANALYTICS: boolean;
4073
+ /** Show beta/experimental features in UI */
4074
+ SHOW_EXPERIMENTAL_FEATURES: boolean;
4075
+ }
4076
+ /**
4077
+ * Default feature flags for production
4078
+ */
4079
+ declare const DEFAULT_FLAGS: FeatureFlags;
4080
+ /**
4081
+ * Development feature flags (all features enabled)
4082
+ */
4083
+ declare const DEV_FLAGS: FeatureFlags;
4084
+ /**
4085
+ * Feature flag manager
4086
+ */
4087
+ declare class FeatureFlagManager {
4088
+ private flags;
4089
+ private overrides;
4090
+ constructor(environment?: 'production' | 'development');
4091
+ /**
4092
+ * Load flag overrides from environment variables
4093
+ */
4094
+ private loadOverridesFromEnv;
4095
+ /**
4096
+ * Get current feature flags
4097
+ */
4098
+ getFlags(): FeatureFlags;
4099
+ /**
4100
+ * Check if a specific feature is enabled
4101
+ */
4102
+ isEnabled(feature: keyof FeatureFlags): boolean;
4103
+ /**
4104
+ * Set a feature flag (runtime override)
4105
+ */
4106
+ setFlag(feature: keyof FeatureFlags, enabled: boolean): void;
4107
+ /**
4108
+ * Reset all overrides
4109
+ */
4110
+ resetOverrides(): void;
4111
+ /**
4112
+ * Get privacy feature status
4113
+ */
4114
+ getPrivacyStatus(): {
4115
+ mode: 'zk-proofs' | 'client-encryption' | 'disabled';
4116
+ beta: boolean;
4117
+ message: string;
4118
+ };
4119
+ /**
4120
+ * Check if we should use ZK proofs or client encryption
4121
+ */
4122
+ shouldUseZkProofs(): boolean;
4123
+ /**
4124
+ * Check if we should use client encryption
4125
+ */
4126
+ shouldUseClientEncryption(): boolean;
4127
+ }
4128
+ /**
4129
+ * Get or create the global feature flag manager
4130
+ */
4131
+ declare function getFeatureFlags(environment?: 'production' | 'development'): FeatureFlagManager;
4132
+ /**
4133
+ * Quick helper to check if a feature is enabled
4134
+ */
4135
+ declare function isFeatureEnabled(feature: keyof FeatureFlags): boolean;
4136
+ /**
4137
+ * Quick helper to get privacy status
4138
+ */
4139
+ declare function getPrivacyStatus(): {
4140
+ mode: "zk-proofs" | "client-encryption" | "disabled";
4141
+ beta: boolean;
4142
+ message: string;
4143
+ };
4144
+
4145
+ declare const featureFlags_DEFAULT_FLAGS: typeof DEFAULT_FLAGS;
4146
+ declare const featureFlags_DEV_FLAGS: typeof DEV_FLAGS;
4147
+ type featureFlags_FeatureFlagManager = FeatureFlagManager;
4148
+ declare const featureFlags_FeatureFlagManager: typeof FeatureFlagManager;
4149
+ type featureFlags_FeatureFlags = FeatureFlags;
4150
+ declare const featureFlags_getFeatureFlags: typeof getFeatureFlags;
4151
+ declare const featureFlags_getPrivacyStatus: typeof getPrivacyStatus;
4152
+ declare const featureFlags_isFeatureEnabled: typeof isFeatureEnabled;
4153
+ declare namespace featureFlags {
4154
+ export { featureFlags_DEFAULT_FLAGS as DEFAULT_FLAGS, featureFlags_DEV_FLAGS as DEV_FLAGS, featureFlags_FeatureFlagManager as FeatureFlagManager, type featureFlags_FeatureFlags as FeatureFlags, featureFlags_getFeatureFlags as getFeatureFlags, featureFlags_getPrivacyStatus as getPrivacyStatus, featureFlags_isFeatureEnabled as isFeatureEnabled };
4155
+ }
4156
+
4157
+ export { type MigrationResult as $, type AssociatedTokenAccount as A, PrivateMetadataStorage as B, type ConfidentialTransferProof as C, type DelegationScope as D, type ErrorContext as E, type EncryptedData as F, GhostSpeakSDKError as G, type ElGamalCiphertext as H, IPFSClient as I, safeDecodeAgent as J, validateAccountDiscriminator as K, createDiscriminatorErrorMessage as L, type MultisigConfig as M, inspectAccountData as N, type DiscriminatorValidationResult as O, ProposalType as P, type AccountInspectionResult as Q, type Role as R, createMigrationPlan as S, TokenProgram as T, createMigrationReport as U, VoteChoice as V, simulateMigration as W, getMigrationInstructions as X, extractLegacyData as Y, type ZkMigrationData as Z, type MigrationPlan as _, deriveServiceListingPda as a, type NonTransferableConfig as a$, type LegacyAgentData as a0, runAccountDiagnostics as a1, runBatchDiagnostics as a2, diagnoseAccountFromChain as a3, diagnoseBatchFromChain as a4, exportDiagnosticReport as a5, type DiagnosticReport as a6, type BatchDiagnosticReport as a7, deriveA2AMessagePda as a8, deriveA2ASessionPda as a9, type TransferFeeConfig as aA, type ConfidentialTransferConfig$1 as aB, type InterestBearingConfig as aC, calculateTransferFee as aD, calculateRequiredAmountForNetTransfer as aE, estimateAccumulatedFees as aF, generateConfidentialTransferProof as aG, verifyConfidentialTransferProof as aH, calculateInterest as aI, calculateCompoundInterest as aJ, validateTransferHookInstruction as aK, createTransferHookInstruction as aL, serializeTokenMetadata as aM, deserializeTokenMetadata as aN, canTransfer as aO, getRequiredExtensions as aP, basisPointsToPercentage as aQ, percentageToBasisPoints as aR, formatBasisPoints as aS, estimateComputeUnits as aT, TokenAccountState as aU, type InterestCalculation as aV, type TransferHookInstruction as aW, type TransferHookContext as aX, type TokenMetadata as aY, type MetadataPointerConfig as aZ, type CpiGuardConfig as a_, deriveUserRegistryPda as aa, deriveWorkOrderPda as ab, deriveJobPostingPda as ac, deriveJobApplicationPda as ad, deriveWorkDeliveryPda as ae, derivePaymentPda as af, deriveServicePurchasePda as ag, deriveAgentVerificationPda as ah, withEnhancedErrorsSync as ai, logEnhancedError as aj, validatePreconditions as ak, extractInstructionName as al, deriveSplTokenAssociatedTokenAddress as am, deriveToken2022AssociatedTokenAddress as an, getAssociatedTokenAccount as ao, getAllAssociatedTokenAddresses as ap, validateAssociatedTokenAddress as aq, getTokenProgramAddress as ar, getTokenProgramFromAddress as as, TokenExtension as at, hasTransferFeeExtension as au, hasConfidentialTransferExtension as av, hasInterestBearingExtension as aw, getTransferFeeConfig as ax, getConfidentialTransferConfig as ay, getInterestBearingConfig as az, deriveAssociatedTokenAddress as b, type ImmutableOwnerConfig as b0, deriveMultisigPda as b1, deriveProposalPda as b2, ClientEncryptionService as b3, generateLocalPrivacyProof as b4, verifyLocalPrivacyProof as b5, prepareForZkMigration as b6, type PrivateMetadata as b7, type ClientEncryptionOptions as b8, MockIPFSProvider as b9, LocalStorageProvider as ba, PrivateDataQuery as bb, estimateStorageCost as bc, createPrivacyManifest as bd, type StorageProvider as be, type StoredPrivateData as bf, type PrivateDataReference as bg, type PrivacyManifest as bh, ConfidentialTransferManager as bi, type ConfidentialAccount as bj, type ConfigureAccountParams as bk, type DepositParams as bl, type WithdrawParams as bm, type TransferParams as bn, getFeatureFlags as bo, isFeatureEnabled as bp, FeatureFlagManager as bq, type FeatureFlags as br, generateRangeProofWithCommitment as bs, generateTransferProofWithInstruction as bt, isZkProgramAvailable as bu, getZkProgramStatus as bv, ProofMode as bw, type ProofGenerationOptions as bx, type ProofGenerationResult as by, detectTokenProgram as c, deriveAgentPda as d, formatTokenAmount as e, findProgramDerivedAddress as f, getTokenProgramType as g, enhanceTransactionError as h, isToken2022Mint as i, createErrorContext as j, ipfsClient as k, clientEncryption as l, confidentialTransferManager as m, accountDiagnostics as n, governanceHelpers as o, parseTokenAmount as p, featureFlags as q, type TransferFeeCalculation as r, type ExecutionParams as s, token2022Extensions as t, type Multisig as u, type GovernanceProposal as v, withEnhancedErrors as w, type RbacConfig as x, ProposalStatus as y, type GeographicRegion as z };