@ghostspeak/sdk 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +145 -2
  2. package/dist/{GhostSpeakClient-CWmGaM9Q.d.ts → GhostSpeakClient-bnXwUPHI.d.ts} +10 -6
  3. package/dist/{StakingModule-C5rzuOWb.d.ts → StakingModule-DunDShLq.d.ts} +263 -343
  4. package/dist/{agent-5YLZ7DAC.js → agent-S42FIMR7.js} +3 -3
  5. package/dist/{agent-5YLZ7DAC.js.map → agent-S42FIMR7.js.map} +1 -1
  6. package/dist/browser-CI5_6Gzk.d.ts +234 -0
  7. package/dist/browser.d.ts +3 -64
  8. package/dist/browser.js +9 -9
  9. package/dist/{chunk-SFTSZ3LC.js → chunk-46QWY3MG.js} +3 -3
  10. package/dist/{chunk-SFTSZ3LC.js.map → chunk-46QWY3MG.js.map} +1 -1
  11. package/dist/{chunk-G7S6B6WB.js → chunk-5QBSC4T4.js} +7 -7
  12. package/dist/{chunk-G7S6B6WB.js.map → chunk-5QBSC4T4.js.map} +1 -1
  13. package/dist/{chunk-IHVDQ4YI.js → chunk-5QZVFUXB.js} +201 -256
  14. package/dist/chunk-5QZVFUXB.js.map +1 -0
  15. package/dist/{chunk-E3FD2CNY.js → chunk-6XCCMJ6M.js} +19 -23
  16. package/dist/chunk-6XCCMJ6M.js.map +1 -0
  17. package/dist/{chunk-JV2SWONF.js → chunk-A7ALCVUI.js} +3 -3
  18. package/dist/{chunk-JV2SWONF.js.map → chunk-A7ALCVUI.js.map} +1 -1
  19. package/dist/{chunk-AL3HQN73.js → chunk-AWMGX3OX.js} +172 -112
  20. package/dist/chunk-AWMGX3OX.js.map +1 -0
  21. package/dist/{chunk-S74EH3KD.js → chunk-IQM5RASO.js} +637 -25
  22. package/dist/chunk-IQM5RASO.js.map +1 -0
  23. package/dist/{chunk-SZGFSCNU.js → chunk-JYXSOXCP.js} +467 -299
  24. package/dist/chunk-JYXSOXCP.js.map +1 -0
  25. package/dist/{chunk-C5CDA3WX.js → chunk-OXA7MECJ.js} +476 -3
  26. package/dist/chunk-OXA7MECJ.js.map +1 -0
  27. package/dist/{chunk-KB6CKIUK.js → chunk-QLRWUHN2.js} +3 -3
  28. package/dist/{chunk-KB6CKIUK.js.map → chunk-QLRWUHN2.js.map} +1 -1
  29. package/dist/client.d.ts +2 -3
  30. package/dist/client.js +9 -9
  31. package/dist/{createAgentAuthorization-ULG47ZJI.js → createAgentAuthorization-KGZNXZBT.js} +4 -4
  32. package/dist/{createAgentAuthorization-ULG47ZJI.js.map → createAgentAuthorization-KGZNXZBT.js.map} +1 -1
  33. package/dist/generated-QJREJQ2C.js +9 -0
  34. package/dist/{generated-EG5USUFG.js.map → generated-QJREJQ2C.js.map} +1 -1
  35. package/dist/index.d.ts +209 -231
  36. package/dist/index.js +231 -521
  37. package/dist/index.js.map +1 -1
  38. package/dist/metafile-esm.json +1 -1
  39. package/dist/minimal/core-minimal.d.ts +266 -184
  40. package/dist/minimal/core-minimal.js +6 -6
  41. package/dist/minimal/core-minimal.js.map +1 -1
  42. package/dist/{revokeAuthorization-OK7E7OK3.js → revokeAuthorization-2ZRO6GUZ.js} +4 -4
  43. package/dist/{revokeAuthorization-OK7E7OK3.js.map → revokeAuthorization-2ZRO6GUZ.js.map} +1 -1
  44. package/dist/{updateReputationWithAuth-Y4ONEVSP.js → updateReputationWithAuth-PCEUOCFV.js} +4 -4
  45. package/dist/{updateReputationWithAuth-Y4ONEVSP.js.map → updateReputationWithAuth-PCEUOCFV.js.map} +1 -1
  46. package/dist/utils.js +9 -9
  47. package/package.json +4 -4
  48. package/dist/chunk-AL3HQN73.js.map +0 -1
  49. package/dist/chunk-C5CDA3WX.js.map +0 -1
  50. package/dist/chunk-E3FD2CNY.js.map +0 -1
  51. package/dist/chunk-IHVDQ4YI.js.map +0 -1
  52. package/dist/chunk-S74EH3KD.js.map +0 -1
  53. package/dist/chunk-SZGFSCNU.js.map +0 -1
  54. package/dist/generated-EG5USUFG.js +0 -9
@@ -0,0 +1,234 @@
1
+ import './StakingModule-DunDShLq.js';
2
+ import * as _solana_addresses from '@solana/addresses';
3
+ import { Address } from '@solana/addresses';
4
+ import './pda-Ce7VYg4T.js';
5
+ import './reputation-types-Yebf0Rm_.js';
6
+
7
+ /**
8
+ * Solana Attestation Service (SAS) Helper
9
+ *
10
+ * Provides utilities for creating and managing SAS attestations for Ghost ownership claims.
11
+ *
12
+ * @module SASAttestationHelper
13
+ */
14
+
15
+ /**
16
+ * SAS Program ID (official Solana Foundation attestation service)
17
+ */
18
+ declare const SAS_PROGRAM_ID: Address<"22zoJMtdu4tQc2PzL74ZUT7FrwgB1Udec8DdW4yw4BdG">;
19
+ /**
20
+ * Attestation PDA seed prefix
21
+ */
22
+ declare const ATTESTATION_SEED = "attestation";
23
+ /**
24
+ * Credential PDA seed prefix
25
+ */
26
+ declare const CREDENTIAL_SEED = "credential";
27
+ /**
28
+ * Schema PDA seed prefix
29
+ */
30
+ declare const SCHEMA_SEED = "schema";
31
+ /**
32
+ * GhostSpeak ownership credential configuration
33
+ */
34
+ interface GhostSpeakCredentialConfig {
35
+ /** Credential issuer (typically the GhostSpeak program or a trusted authority) */
36
+ issuer: Address;
37
+ /** Credential name */
38
+ name: string;
39
+ /** Credential description */
40
+ description: string;
41
+ /** Schema definition URI (JSON schema for attestation data) */
42
+ schemaUri: string;
43
+ }
44
+ /**
45
+ * SAS Attestation data for Ghost ownership
46
+ */
47
+ interface GhostOwnershipAttestationData {
48
+ /** x402 payment address being claimed */
49
+ x402PaymentAddress: Address;
50
+ /** Network identifier (devnet, mainnet-beta, etc.) */
51
+ network: string;
52
+ /** Optional GitHub username for verification */
53
+ githubUsername?: string;
54
+ /** Optional Twitter handle for verification */
55
+ twitterHandle?: string;
56
+ /** Timestamp of attestation creation */
57
+ timestamp: bigint;
58
+ }
59
+ /**
60
+ * Result of attestation PDA derivation
61
+ */
62
+ interface AttestationPDAResult {
63
+ /** Derived attestation PDA */
64
+ attestationPda: Address;
65
+ /** Bump seed for PDA */
66
+ bump: number;
67
+ }
68
+ /**
69
+ * Configuration for creating a Ghost ownership attestation
70
+ */
71
+ interface CreateAttestationConfig {
72
+ /** SAS Credential address (issuer of attestations) */
73
+ credentialAddress: Address;
74
+ /** SAS Schema address (defines attestation structure) */
75
+ schemaAddress: Address;
76
+ /** x402 payment address to attest ownership of */
77
+ x402PaymentAddress: Address;
78
+ /** Network identifier */
79
+ network: string;
80
+ /** Optional social proof */
81
+ githubUsername?: string;
82
+ twitterHandle?: string;
83
+ /** Attestation expiry (Unix timestamp) - defaults to 1 year */
84
+ expiryTimestamp?: bigint;
85
+ }
86
+ /**
87
+ * SASAttestationHelper - Utilities for creating and managing SAS attestations
88
+ */
89
+ declare class SASAttestationHelper {
90
+ /**
91
+ * Derive attestation PDA for a given credential, schema, and nonce
92
+ *
93
+ * PDA seeds: ["attestation", credential, schema, nonce]
94
+ *
95
+ * @param credentialAddress - SAS Credential address (issuer)
96
+ * @param schemaAddress - SAS Schema address (defines structure)
97
+ * @param nonce - Unique nonce (typically the x402_payment_address)
98
+ * @returns Attestation PDA and bump
99
+ */
100
+ static deriveAttestationPda(credentialAddress: Address, schemaAddress: Address, nonce: Address): Promise<AttestationPDAResult>;
101
+ /**
102
+ * Derive credential PDA for an issuer
103
+ *
104
+ * PDA seeds: ["credential", issuer]
105
+ *
106
+ * @param issuer - Issuer's public key
107
+ * @returns Credential PDA and bump
108
+ */
109
+ static deriveCredentialPda(issuer: Address): Promise<AttestationPDAResult>;
110
+ /**
111
+ * Derive schema PDA for a credential
112
+ *
113
+ * PDA seeds: ["schema", credential, schema_name]
114
+ *
115
+ * @param credentialAddress - Credential address
116
+ * @param schemaName - Schema identifier
117
+ * @returns Schema PDA and bump
118
+ */
119
+ static deriveSchemaPda(credentialAddress: Address, schemaName: string): Promise<AttestationPDAResult>;
120
+ /**
121
+ * Serialize Ghost ownership attestation data for on-chain storage
122
+ *
123
+ * Format: Borsh serialization
124
+ * - x402_payment_address: 32 bytes
125
+ * - network: String (length-prefixed)
126
+ * - github_username: Option<String>
127
+ * - twitter_handle: Option<String>
128
+ * - timestamp: i64 (8 bytes)
129
+ *
130
+ * @param data - Attestation data to serialize
131
+ * @returns Serialized buffer
132
+ */
133
+ static serializeAttestationData(data: GhostOwnershipAttestationData): Uint8Array;
134
+ /**
135
+ * Get GhostSpeak default credential configuration
136
+ *
137
+ * This returns the official GhostSpeak credential issuer settings
138
+ * for production use.
139
+ *
140
+ * @param issuer - Credential issuer address (typically the GhostSpeak program authority)
141
+ * @returns Default credential configuration
142
+ */
143
+ static getDefaultCredentialConfig(issuer: Address): GhostSpeakCredentialConfig;
144
+ /**
145
+ * Check if an attestation is expired
146
+ *
147
+ * @param expiryTimestamp - Expiry timestamp (Unix seconds)
148
+ * @param currentTimestamp - Current timestamp (defaults to now)
149
+ * @returns True if expired
150
+ */
151
+ static isAttestationExpired(expiryTimestamp: bigint, currentTimestamp?: bigint): boolean;
152
+ /**
153
+ * Calculate default expiry timestamp (1 year from now)
154
+ *
155
+ * @param fromTimestamp - Starting timestamp (defaults to now)
156
+ * @returns Expiry timestamp
157
+ */
158
+ static calculateDefaultExpiry(fromTimestamp?: bigint): bigint;
159
+ /**
160
+ * Create attestation instruction data
161
+ *
162
+ * NOTE: This is a helper for building the SAS create_attestation instruction.
163
+ * The actual instruction building should be done using the SAS SDK or program IDL.
164
+ *
165
+ * @param config - Attestation configuration
166
+ * @returns Prepared attestation data and PDA
167
+ */
168
+ static prepareAttestation(config: CreateAttestationConfig): Promise<{
169
+ attestationData: Uint8Array;
170
+ attestationPda: Address;
171
+ bump: number;
172
+ expiryTimestamp: bigint;
173
+ }>;
174
+ }
175
+
176
+ /**
177
+ * GhostSpeak Protocol Constants
178
+ * July 2025 Implementation
179
+ */
180
+ /**
181
+ * Program ID for GhostSpeak Marketplace on Solana
182
+ * Deployed on devnet - December 30, 2025
183
+ * Deployment signature: 5zdU8HdtenhgwDmeEJu2ZPrQwoG9gztHHM5Ft6URxCzTj7m4y9ZkvmVKrpvMK41skcHvh8xa7ckNuUkQwPsierJr
184
+ */
185
+ declare const GHOSTSPEAK_PROGRAM_ID: _solana_addresses.Address<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">;
186
+ /**
187
+ * Network-specific configurations
188
+ */
189
+ declare const NETWORK_CONFIG: {
190
+ readonly devnet: {
191
+ readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
192
+ readonly rpcUrl: "https://api.devnet.solana.com";
193
+ };
194
+ readonly testnet: {
195
+ readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
196
+ readonly rpcUrl: "https://api.testnet.solana.com";
197
+ };
198
+ readonly mainnet: {
199
+ readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
200
+ readonly rpcUrl: "https://api.mainnet-beta.solana.com";
201
+ };
202
+ };
203
+
204
+ /**
205
+ * System Program Addresses for Solana
206
+ *
207
+ * These are the standard system program addresses used across Solana.
208
+ * Using constants instead of hardcoded values improves maintainability
209
+ * and ensures consistency across the SDK.
210
+ */
211
+
212
+ /**
213
+ * SPL Token Program
214
+ * The standard SPL Token program
215
+ */
216
+ declare const TOKEN_PROGRAM_ADDRESS: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
217
+ /**
218
+ * SPL Token 2022 Program (Token Extensions)
219
+ * The new token program with extended functionality
220
+ */
221
+ declare const TOKEN_2022_PROGRAM_ADDRESS: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
222
+ /**
223
+ * Associated Token Account Program
224
+ * Manages associated token accounts
225
+ */
226
+ declare const ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address<"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL">;
227
+ /**
228
+ * Native SOL Mint Address (wSOL) - Token 2022 Program
229
+ * The mint address for wrapped SOL on Token 2022
230
+ * This is the one used by GhostSpeak escrow operations
231
+ */
232
+ declare const NATIVE_MINT_ADDRESS: Address<"9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP">;
233
+
234
+ export { ATTESTATION_SEED as A, CREDENTIAL_SEED as C, type GhostSpeakCredentialConfig as G, NATIVE_MINT_ADDRESS as N, SASAttestationHelper as S, TOKEN_PROGRAM_ADDRESS as T, SAS_PROGRAM_ID as a, SCHEMA_SEED as b, type GhostOwnershipAttestationData as c, type AttestationPDAResult as d, type CreateAttestationConfig as e, GHOSTSPEAK_PROGRAM_ID as f, TOKEN_2022_PROGRAM_ADDRESS as g, ASSOCIATED_TOKEN_PROGRAM_ADDRESS as h, NETWORK_CONFIG as i };
package/dist/browser.d.ts CHANGED
@@ -1,68 +1,7 @@
1
- export { aG as Agent, A as AgentModule, q as CredentialsModule, G as GhostSpeakConfig, a as GovernanceModule, M as MultisigModule, P as PayAIClient, a6 as ReputationData, R as ReputationModule, S as StakingModule } from './StakingModule-C5rzuOWb.js';
2
- import * as _solana_addresses from '@solana/addresses';
3
- import { Address } from '@solana/addresses';
1
+ export { av as Agent, A as AgentModule, k as CredentialsModule, a as GhostModule, G as GhostSpeakConfig, b as GovernanceModule, M as MultisigModule, a1 as ReputationData, R as ReputationModule, S as StakingModule } from './StakingModule-DunDShLq.js';
2
+ export { h as ASSOCIATED_TOKEN_PROGRAM_ADDRESS, f as GHOSTSPEAK_PROGRAM_ID, N as NATIVE_MINT_ADDRESS, i as NETWORK_CONFIG, S as SASAttestationHelper, g as TOKEN_2022_PROGRAM_ADDRESS, T as TOKEN_PROGRAM_ADDRESS } from './browser-CI5_6Gzk.js';
4
3
  export { d as deriveAgentPda, a as deriveUserRegistryPda } from './pda-Ce7VYg4T.js';
5
4
  export { B as BadgeType, o as CategoryReputation, G as GovernanceProposal, J as JobPerformance, s as REPUTATION_CONSTANTS, a as ReputationCalculationResult, p as ReputationTier } from './reputation-types-Yebf0Rm_.js';
5
+ import '@solana/addresses';
6
6
  import '@solana/kit';
7
- import 'node:events';
8
7
  import './types.js';
9
-
10
- /**
11
- * GhostSpeak Protocol Constants
12
- * July 2025 Implementation
13
- */
14
- /**
15
- * Program ID for GhostSpeak Marketplace on Solana
16
- * Deployed on devnet - December 30, 2025
17
- * Deployment signature: 5zdU8HdtenhgwDmeEJu2ZPrQwoG9gztHHM5Ft6URxCzTj7m4y9ZkvmVKrpvMK41skcHvh8xa7ckNuUkQwPsierJr
18
- */
19
- declare const GHOSTSPEAK_PROGRAM_ID: _solana_addresses.Address<"4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB">;
20
- /**
21
- * Network-specific configurations
22
- */
23
- declare const NETWORK_CONFIG: {
24
- readonly devnet: {
25
- readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
26
- readonly rpcUrl: "https://api.devnet.solana.com";
27
- };
28
- readonly testnet: {
29
- readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
30
- readonly rpcUrl: "https://api.testnet.solana.com";
31
- };
32
- readonly mainnet: {
33
- readonly programId: "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB";
34
- readonly rpcUrl: "https://api.mainnet-beta.solana.com";
35
- };
36
- };
37
-
38
- /**
39
- * System Program Addresses for Solana
40
- *
41
- * These are the standard system program addresses used across Solana.
42
- * Using constants instead of hardcoded values improves maintainability
43
- * and ensures consistency across the SDK.
44
- */
45
-
46
- /**
47
- * SPL Token Program
48
- * The standard SPL Token program
49
- */
50
- declare const TOKEN_PROGRAM_ADDRESS: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
51
- /**
52
- * SPL Token 2022 Program (Token Extensions)
53
- * The new token program with extended functionality
54
- */
55
- declare const TOKEN_2022_PROGRAM_ADDRESS: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
56
- /**
57
- * Associated Token Account Program
58
- * Manages associated token accounts
59
- */
60
- declare const ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address<"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL">;
61
- /**
62
- * Native SOL Mint Address (wSOL) - Token 2022 Program
63
- * The mint address for wrapped SOL on Token 2022
64
- * This is the one used by GhostSpeak escrow operations
65
- */
66
- declare const NATIVE_MINT_ADDRESS: Address<"9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP">;
67
-
68
- export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, GHOSTSPEAK_PROGRAM_ID, NATIVE_MINT_ADDRESS, NETWORK_CONFIG, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS };
package/dist/browser.js CHANGED
@@ -1,14 +1,14 @@
1
1
  export { GHOSTSPEAK_PROGRAM_ID, NETWORK_CONFIG } from './chunk-TTB4OS2D.js';
2
- import { init_MultiSourceAggregator } from './chunk-SZGFSCNU.js';
3
- export { AgentModule, CredentialModule as CredentialsModule, GovernanceModule, MultisigModule, PayAIClient, ReputationModule, StakingModule } from './chunk-SZGFSCNU.js';
2
+ import { init_MultiSourceAggregator } from './chunk-JYXSOXCP.js';
3
+ export { AgentModule, CredentialModule as CredentialsModule, GhostModule, GovernanceModule, MultisigModule, ReputationModule, SASAttestationHelper, StakingModule } from './chunk-JYXSOXCP.js';
4
4
  export { deriveAgentPda, deriveUserRegistryPda } from './chunk-BF3IQ35I.js';
5
- export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, NATIVE_MINT_ADDRESS, REPUTATION_CONSTANTS, ReputationTier, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS } from './chunk-C5CDA3WX.js';
6
- import './chunk-S74EH3KD.js';
7
- import './chunk-IHVDQ4YI.js';
8
- import './chunk-SFTSZ3LC.js';
9
- import './chunk-JV2SWONF.js';
10
- import './chunk-KB6CKIUK.js';
11
- import './chunk-AL3HQN73.js';
5
+ export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, NATIVE_MINT_ADDRESS, REPUTATION_CONSTANTS, ReputationTier, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS } from './chunk-OXA7MECJ.js';
6
+ import './chunk-IQM5RASO.js';
7
+ import './chunk-5QZVFUXB.js';
8
+ import './chunk-46QWY3MG.js';
9
+ import './chunk-A7ALCVUI.js';
10
+ import './chunk-QLRWUHN2.js';
11
+ import './chunk-AWMGX3OX.js';
12
12
  import './chunk-SRS2SKFS.js';
13
13
  import './chunk-UP2VWCW5.js';
14
14
  import 'crypto';
@@ -1,4 +1,4 @@
1
- import { GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, expectAddress, expectSome, getAccountMetaFactory } from './chunk-AL3HQN73.js';
1
+ import { GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, expectAddress, expectSome, getAccountMetaFactory } from './chunk-AWMGX3OX.js';
2
2
  import { fixEncoderSize, getBytesEncoder, transformEncoder, getStructEncoder, getAddressEncoder, getU64Encoder, getI64Encoder, getU8Encoder, getOptionEncoder, addEncoderSizePrefix, getUtf8Encoder, getU32Encoder, getStructDecoder, fixDecoderSize, getAddressDecoder, getU64Decoder, getI64Decoder, getU8Decoder, getOptionDecoder, getBytesDecoder, addDecoderSizePrefix, getUtf8Decoder, getU32Decoder, combineCodec, getProgramDerivedAddress } from '@solana/kit';
3
3
 
4
4
  var CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR = new Uint8Array([
@@ -152,5 +152,5 @@ function parseCreateAgentAuthorizationInstruction(instruction) {
152
152
  }
153
153
 
154
154
  export { CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR, getCreateAgentAuthorizationDiscriminatorBytes, getCreateAgentAuthorizationInstruction, getCreateAgentAuthorizationInstructionAsync, getCreateAgentAuthorizationInstructionDataCodec, getCreateAgentAuthorizationInstructionDataDecoder, getCreateAgentAuthorizationInstructionDataEncoder, parseCreateAgentAuthorizationInstruction };
155
- //# sourceMappingURL=chunk-SFTSZ3LC.js.map
156
- //# sourceMappingURL=chunk-SFTSZ3LC.js.map
155
+ //# sourceMappingURL=chunk-46QWY3MG.js.map
156
+ //# sourceMappingURL=chunk-46QWY3MG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generated/instructions/createAgentAuthorization.ts"],"names":[],"mappings":";;;AA2DO,IAAM,wCAAA,GAA2C,IAAI,UAAA,CAAW;AAAA,EACrE,EAAA;AAAA,EAAI,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,EAAA;AAAA,EAAI,GAAA;AAAA,EAAK;AACnC,CAAC;AAEM,SAAS,6CAAA,GAAgD;AAC9D,EAAA,OAAO,cAAA,CAAe,eAAA,EAAgB,EAAG,CAAC,CAAA,CAAE,MAAA;AAAA,IAC1C;AAAA,GACF;AACF;AAkDO,SAAS,iDAAA,GAA0G;AACxH,EAAA,OAAO,gBAAA;AAAA,IACL,gBAAA,CAAiB;AAAA,MACf,CAAC,eAAA,EAAiB,cAAA,CAAe,eAAA,EAAgB,EAAG,CAAC,CAAC,CAAA;AAAA,MACtD,CAAC,kBAAA,EAAoB,iBAAA,EAAmB,CAAA;AAAA,MACxC,CAAC,YAAA,EAAc,aAAA,EAAe,CAAA;AAAA,MAC9B,CAAC,WAAA,EAAa,aAAA,EAAe,CAAA;AAAA,MAC7B,CAAC,SAAA,EAAW,YAAA,EAAc,CAAA;AAAA,MAC1B,CAAC,WAAA,EAAa,cAAA,CAAe,eAAA,EAAgB,EAAG,EAAE,CAAC,CAAA;AAAA,MACnD;AAAA,QACE,OAAA;AAAA,QACA,gBAAA;AAAA,UACE,oBAAA,CAAqB,cAAA,EAAe,EAAG,aAAA,EAAe;AAAA;AACxD;AACF,KACD,C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AS,yCAId,WAAA,EAGoE;AACpE,EAAA,IAAI,WAAA,CAAY,QAAA,CAAS,MAAA,GAAS,CAAA,EAAG;AAEnC,IAAA,MAAM,IAAI,MAAM,qBAAqB,CAAA;AAAA,EACvC;AACA,EAAA,IAAI,YAAA,GAAe,CAAA;AACnB,EAAA,MAAM,iBAAiB,MAAM;AAC3B,IAAA,MAAM,WAAA,GAAe,WAAA,CAAY,QAAA,CAA2B,YAAY,CAAA;AACxE,IAAA,YAAA,IAAgB,CAAA;AAChB,IAAA,OAAO,WAAA;AAAA,EACT,CAAA;AACA,EAAA,OAAO;AAAA,IACL,gBAAgB,WAAA,CAAY,cAAA;AAAA,IAC5B,QAAA,EAAU;AAAA,MACR,OAAO,cAAA,EAAe;AAAA,MACtB,eAAe,cAAA,EAAe;AAAA,MAC9B,WAAW,cAAA,EAAe;AAAA,MAC1B,eAAe,cAAA;AAAe,KAChC;AAAA,IACA,IAAA,EAAM,mDAAkD,CAAE,MAAA;AAAA,MACxD,WAAA,CAAY;AAAA;AACd,GACF;AACF","file":"chunk-SFTSZ3LC.js","sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getOptionDecoder,\n getOptionEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type Option,\n type OptionOrNullable,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport { GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n expectAddress,\n expectSome,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from \"../shared\";\n\nexport const CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR = new Uint8Array([\n 48, 219, 232, 202, 151, 97, 230, 20,\n]);\n\nexport function getCreateAgentAuthorizationDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR,\n );\n}\n\nexport type CreateAgentAuthorizationInstruction<\n TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n TAccountAgent extends string | AccountMeta<string> = string,\n TAccountAuthorization extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAgent extends string\n ? ReadonlyAccount<TAccountAgent>\n : TAccountAgent,\n TAccountAuthorization extends string\n ? WritableAccount<TAccountAuthorization>\n : TAccountAuthorization,\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateAgentAuthorizationInstructionData = {\n discriminator: ReadonlyUint8Array;\n authorizedSource: Address;\n indexLimit: bigint;\n expiresAt: bigint;\n network: number;\n signature: ReadonlyUint8Array;\n nonce: Option<string>;\n};\n\nexport type CreateAgentAuthorizationInstructionDataArgs = {\n authorizedSource: Address;\n indexLimit: number | bigint;\n expiresAt: number | bigint;\n network: number;\n signature: ReadonlyUint8Array;\n nonce: OptionOrNullable<string>;\n};\n\nexport function getCreateAgentAuthorizationInstructionDataEncoder(): Encoder<CreateAgentAuthorizationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"authorizedSource\", getAddressEncoder()],\n [\"indexLimit\", getU64Encoder()],\n [\"expiresAt\", getI64Encoder()],\n [\"network\", getU8Encoder()],\n [\"signature\", fixEncoderSize(getBytesEncoder(), 64)],\n [\n \"nonce\",\n getOptionEncoder(\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ),\n ],\n ]),\n (value) => ({\n ...value,\n discriminator: CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getCreateAgentAuthorizationInstructionDataDecoder(): Decoder<CreateAgentAuthorizationInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"authorizedSource\", getAddressDecoder()],\n [\"indexLimit\", getU64Decoder()],\n [\"expiresAt\", getI64Decoder()],\n [\"network\", getU8Decoder()],\n [\"signature\", fixDecoderSize(getBytesDecoder(), 64)],\n [\n \"nonce\",\n getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())),\n ],\n ]);\n}\n\nexport function getCreateAgentAuthorizationInstructionDataCodec(): Codec<\n CreateAgentAuthorizationInstructionDataArgs,\n CreateAgentAuthorizationInstructionData\n> {\n return combineCodec(\n getCreateAgentAuthorizationInstructionDataEncoder(),\n getCreateAgentAuthorizationInstructionDataDecoder(),\n );\n}\n\nexport type CreateAgentAuthorizationAsyncInput<\n TAccountAgent extends string = string,\n TAccountAuthorization extends string = string,\n TAccountAuthority extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Agent granting authorization */\n agent: Address<TAccountAgent>;\n /** Authorization account (PDA) */\n authorization?: Address<TAccountAuthorization>;\n /** Authority (agent owner) */\n authority: TransactionSigner<TAccountAuthority>;\n /** System program */\n systemProgram?: Address<TAccountSystemProgram>;\n authorizedSource: CreateAgentAuthorizationInstructionDataArgs[\"authorizedSource\"];\n indexLimit: CreateAgentAuthorizationInstructionDataArgs[\"indexLimit\"];\n expiresAt: CreateAgentAuthorizationInstructionDataArgs[\"expiresAt\"];\n network: CreateAgentAuthorizationInstructionDataArgs[\"network\"];\n signature: CreateAgentAuthorizationInstructionDataArgs[\"signature\"];\n nonce: CreateAgentAuthorizationInstructionDataArgs[\"nonce\"];\n};\n\nexport async function getCreateAgentAuthorizationInstructionAsync<\n TAccountAgent extends string,\n TAccountAuthorization extends string,\n TAccountAuthority extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address =\n typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n>(\n input: CreateAgentAuthorizationAsyncInput<\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n agent: { value: input.agent ?? null, isWritable: false },\n authorization: { value: input.authorization ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.authorization.value) {\n accounts.authorization.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([97, 103, 101, 110, 116, 95, 97, 117, 116, 104]),\n ),\n getAddressEncoder().encode(expectAddress(accounts.agent.value)),\n getAddressEncoder().encode(expectSome(args.authorizedSource)),\n getOptionEncoder(\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ).encode(expectSome(args.nonce)),\n ],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(accounts.agent),\n getAccountMeta(accounts.authorization),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.systemProgram),\n ],\n data: getCreateAgentAuthorizationInstructionDataEncoder().encode(\n args as CreateAgentAuthorizationInstructionDataArgs,\n ),\n programAddress,\n } as CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateAgentAuthorizationInput<\n TAccountAgent extends string = string,\n TAccountAuthorization extends string = string,\n TAccountAuthority extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Agent granting authorization */\n agent: Address<TAccountAgent>;\n /** Authorization account (PDA) */\n authorization: Address<TAccountAuthorization>;\n /** Authority (agent owner) */\n authority: TransactionSigner<TAccountAuthority>;\n /** System program */\n systemProgram?: Address<TAccountSystemProgram>;\n authorizedSource: CreateAgentAuthorizationInstructionDataArgs[\"authorizedSource\"];\n indexLimit: CreateAgentAuthorizationInstructionDataArgs[\"indexLimit\"];\n expiresAt: CreateAgentAuthorizationInstructionDataArgs[\"expiresAt\"];\n network: CreateAgentAuthorizationInstructionDataArgs[\"network\"];\n signature: CreateAgentAuthorizationInstructionDataArgs[\"signature\"];\n nonce: CreateAgentAuthorizationInstructionDataArgs[\"nonce\"];\n};\n\nexport function getCreateAgentAuthorizationInstruction<\n TAccountAgent extends string,\n TAccountAuthorization extends string,\n TAccountAuthority extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address =\n typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n>(\n input: CreateAgentAuthorizationInput<\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n agent: { value: input.agent ?? null, isWritable: false },\n authorization: { value: input.authorization ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(accounts.agent),\n getAccountMeta(accounts.authorization),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.systemProgram),\n ],\n data: getCreateAgentAuthorizationInstructionDataEncoder().encode(\n args as CreateAgentAuthorizationInstructionDataArgs,\n ),\n programAddress,\n } as CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateAgentAuthorizationInstruction<\n TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Agent granting authorization */\n agent: TAccountMetas[0];\n /** Authorization account (PDA) */\n authorization: TAccountMetas[1];\n /** Authority (agent owner) */\n authority: TAccountMetas[2];\n /** System program */\n systemProgram: TAccountMetas[3];\n };\n data: CreateAgentAuthorizationInstructionData;\n};\n\nexport function parseCreateAgentAuthorizationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateAgentAuthorizationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error(\"Not enough accounts\");\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n agent: getNextAccount(),\n authorization: getNextAccount(),\n authority: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateAgentAuthorizationInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/generated/instructions/createAgentAuthorization.ts"],"names":[],"mappings":";;;AA2DO,IAAM,wCAAA,GAA2C,IAAI,UAAA,CAAW;AAAA,EACrE,EAAA;AAAA,EAAI,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,GAAA;AAAA,EAAK,EAAA;AAAA,EAAI,GAAA;AAAA,EAAK;AACnC,CAAC;AAEM,SAAS,6CAAA,GAAgD;AAC9D,EAAA,OAAO,cAAA,CAAe,eAAA,EAAgB,EAAG,CAAC,CAAA,CAAE,MAAA;AAAA,IAC1C;AAAA,GACF;AACF;AAkDO,SAAS,iDAAA,GAA0G;AACxH,EAAA,OAAO,gBAAA;AAAA,IACL,gBAAA,CAAiB;AAAA,MACf,CAAC,eAAA,EAAiB,cAAA,CAAe,eAAA,EAAgB,EAAG,CAAC,CAAC,CAAA;AAAA,MACtD,CAAC,kBAAA,EAAoB,iBAAA,EAAm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AgB,WAAW,CAAA;AACxE,EAAA,OAAO,OAAO,MAAA,CAAO;AAAA,IACnB,QAAA,EAAU;AAAA,MACR,cAAA,CAAe,SAAS,KAAK,CAAA;AAAA,MAC7B,cAAA,CAAe,SAAS,aAAa,CAAA;AAAA,MACrC,cAAA,CAAe,SAAS,SAAS,CAAA;AAAA,MACjC,cAAA,CAAe,SAAS,aAAa;AAAA,KACvC;AAAA,IACA,IAAA,EAAM,mDAAkD,CAAE,MAAA;AAAA,MACxD;AAAA,KACF;AAAA,IACA;AAAA,GAOD,CAAA;AACH;AAoBO,SAAS,yCAId,WAAA,EAGoE;AACpE,EAAA,IAAI,WAAA,CAAY,QAAA,CAAS,MAAA,GAAS,CAAA,EAAG;AAEnC,IAAA,MAAM,IAAI,MAAM,qBAAqB,CAAA;AAAA,EACvC;AACA,EAAA,IAAI,YAAA,GAAe,CAAA;AACnB,EAAA,MAAM,iBAAiB,MAAM;AAC3B,IAAA,MAAM,WAAA,GAAe,WAAA,CAAY,QAAA,CAA2B,YAAY,CAAA;AACxE,IAAA,YAAA,IAAgB,CAAA;AAChB,IAAA,OAAO,WAAA;AAAA,EACT,CAAA;AACA,EAAA,OAAO;AAAA,IACL,gBAAgB,WAAA,CAAY,cAAA;AAAA,IAC5B,QAAA,EAAU;AAAA,MACR,OAAO,cAAA,EAAe;AAAA,MACtB,eAAe,cAAA,EAAe;AAAA,MAC9B,WAAW,cAAA,EAAe;AAAA,MAC1B,eAAe,cAAA;AAAe,KAChC;AAAA,IACA,IAAA,EAAM,mDAAkD,CAAE,MAAA;AAAA,MACxD,WAAA,CAAY;AAAA;AACd,GACF;AACF","file":"chunk-46QWY3MG.js","sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getOptionDecoder,\n getOptionEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type Option,\n type OptionOrNullable,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport { GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n expectAddress,\n expectSome,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from \"../shared\";\n\nexport const CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR = new Uint8Array([\n 48, 219, 232, 202, 151, 97, 230, 20,\n]);\n\nexport function getCreateAgentAuthorizationDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR,\n );\n}\n\nexport type CreateAgentAuthorizationInstruction<\n TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n TAccountAgent extends string | AccountMeta<string> = string,\n TAccountAuthorization extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAgent extends string\n ? ReadonlyAccount<TAccountAgent>\n : TAccountAgent,\n TAccountAuthorization extends string\n ? WritableAccount<TAccountAuthorization>\n : TAccountAuthorization,\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateAgentAuthorizationInstructionData = {\n discriminator: ReadonlyUint8Array;\n authorizedSource: Address;\n indexLimit: bigint;\n expiresAt: bigint;\n network: number;\n signature: ReadonlyUint8Array;\n nonce: Option<string>;\n};\n\nexport type CreateAgentAuthorizationInstructionDataArgs = {\n authorizedSource: Address;\n indexLimit: number | bigint;\n expiresAt: number | bigint;\n network: number;\n signature: ReadonlyUint8Array;\n nonce: OptionOrNullable<string>;\n};\n\nexport function getCreateAgentAuthorizationInstructionDataEncoder(): Encoder<CreateAgentAuthorizationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"authorizedSource\", getAddressEncoder()],\n [\"indexLimit\", getU64Encoder()],\n [\"expiresAt\", getI64Encoder()],\n [\"network\", getU8Encoder()],\n [\"signature\", fixEncoderSize(getBytesEncoder(), 64)],\n [\n \"nonce\",\n getOptionEncoder(\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ),\n ],\n ]),\n (value) => ({\n ...value,\n discriminator: CREATE_AGENT_AUTHORIZATION_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getCreateAgentAuthorizationInstructionDataDecoder(): Decoder<CreateAgentAuthorizationInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"authorizedSource\", getAddressDecoder()],\n [\"indexLimit\", getU64Decoder()],\n [\"expiresAt\", getI64Decoder()],\n [\"network\", getU8Decoder()],\n [\"signature\", fixDecoderSize(getBytesDecoder(), 64)],\n [\n \"nonce\",\n getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())),\n ],\n ]);\n}\n\nexport function getCreateAgentAuthorizationInstructionDataCodec(): Codec<\n CreateAgentAuthorizationInstructionDataArgs,\n CreateAgentAuthorizationInstructionData\n> {\n return combineCodec(\n getCreateAgentAuthorizationInstructionDataEncoder(),\n getCreateAgentAuthorizationInstructionDataDecoder(),\n );\n}\n\nexport type CreateAgentAuthorizationAsyncInput<\n TAccountAgent extends string = string,\n TAccountAuthorization extends string = string,\n TAccountAuthority extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Agent granting authorization */\n agent: Address<TAccountAgent>;\n /** Authorization account (PDA) */\n authorization?: Address<TAccountAuthorization>;\n /** Authority (agent owner) */\n authority: TransactionSigner<TAccountAuthority>;\n /** System program */\n systemProgram?: Address<TAccountSystemProgram>;\n authorizedSource: CreateAgentAuthorizationInstructionDataArgs[\"authorizedSource\"];\n indexLimit: CreateAgentAuthorizationInstructionDataArgs[\"indexLimit\"];\n expiresAt: CreateAgentAuthorizationInstructionDataArgs[\"expiresAt\"];\n network: CreateAgentAuthorizationInstructionDataArgs[\"network\"];\n signature: CreateAgentAuthorizationInstructionDataArgs[\"signature\"];\n nonce: CreateAgentAuthorizationInstructionDataArgs[\"nonce\"];\n};\n\nexport async function getCreateAgentAuthorizationInstructionAsync<\n TAccountAgent extends string,\n TAccountAuthorization extends string,\n TAccountAuthority extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address =\n typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n>(\n input: CreateAgentAuthorizationAsyncInput<\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n agent: { value: input.agent ?? null, isWritable: false },\n authorization: { value: input.authorization ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.authorization.value) {\n accounts.authorization.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([97, 103, 101, 110, 116, 95, 97, 117, 116, 104]),\n ),\n getAddressEncoder().encode(expectAddress(accounts.agent.value)),\n getAddressEncoder().encode(expectSome(args.authorizedSource)),\n getOptionEncoder(\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ).encode(expectSome(args.nonce)),\n ],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(accounts.agent),\n getAccountMeta(accounts.authorization),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.systemProgram),\n ],\n data: getCreateAgentAuthorizationInstructionDataEncoder().encode(\n args as CreateAgentAuthorizationInstructionDataArgs,\n ),\n programAddress,\n } as CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateAgentAuthorizationInput<\n TAccountAgent extends string = string,\n TAccountAuthorization extends string = string,\n TAccountAuthority extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Agent granting authorization */\n agent: Address<TAccountAgent>;\n /** Authorization account (PDA) */\n authorization: Address<TAccountAuthorization>;\n /** Authority (agent owner) */\n authority: TransactionSigner<TAccountAuthority>;\n /** System program */\n systemProgram?: Address<TAccountSystemProgram>;\n authorizedSource: CreateAgentAuthorizationInstructionDataArgs[\"authorizedSource\"];\n indexLimit: CreateAgentAuthorizationInstructionDataArgs[\"indexLimit\"];\n expiresAt: CreateAgentAuthorizationInstructionDataArgs[\"expiresAt\"];\n network: CreateAgentAuthorizationInstructionDataArgs[\"network\"];\n signature: CreateAgentAuthorizationInstructionDataArgs[\"signature\"];\n nonce: CreateAgentAuthorizationInstructionDataArgs[\"nonce\"];\n};\n\nexport function getCreateAgentAuthorizationInstruction<\n TAccountAgent extends string,\n TAccountAuthorization extends string,\n TAccountAuthority extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address =\n typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n>(\n input: CreateAgentAuthorizationInput<\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n agent: { value: input.agent ?? null, isWritable: false },\n authorization: { value: input.authorization ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(accounts.agent),\n getAccountMeta(accounts.authorization),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.systemProgram),\n ],\n data: getCreateAgentAuthorizationInstructionDataEncoder().encode(\n args as CreateAgentAuthorizationInstructionDataArgs,\n ),\n programAddress,\n } as CreateAgentAuthorizationInstruction<\n TProgramAddress,\n TAccountAgent,\n TAccountAuthorization,\n TAccountAuthority,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateAgentAuthorizationInstruction<\n TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Agent granting authorization */\n agent: TAccountMetas[0];\n /** Authorization account (PDA) */\n authorization: TAccountMetas[1];\n /** Authority (agent owner) */\n authority: TAccountMetas[2];\n /** System program */\n systemProgram: TAccountMetas[3];\n };\n data: CreateAgentAuthorizationInstructionData;\n};\n\nexport function parseCreateAgentAuthorizationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateAgentAuthorizationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error(\"Not enough accounts\");\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n agent: getNextAccount(),\n authorization: getNextAccount(),\n authority: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateAgentAuthorizationInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { TOKEN_PROGRAM_ADDRESS, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, TOKEN_2022_PROGRAM_ADDRESS } from './chunk-C5CDA3WX.js';
2
- import { AGENT_DISCRIMINATOR } from './chunk-IHVDQ4YI.js';
1
+ import { TOKEN_PROGRAM_ADDRESS, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, TOKEN_2022_PROGRAM_ADDRESS } from './chunk-OXA7MECJ.js';
2
+ import { AGENT_DISCRIMINATOR } from './chunk-5QZVFUXB.js';
3
3
  import { __export } from './chunk-UP2VWCW5.js';
4
4
  import { fetchEncodedAccount, getProgramDerivedAddress, getBytesEncoder, getAddressEncoder } from '@solana/kit';
5
5
  import { sha256 } from '@noble/hashes/sha256';
@@ -72,7 +72,7 @@ function createDiscriminatorErrorMessage(validation, accountType, address) {
72
72
  }
73
73
  async function safeDecodeAgent(encodedAccount) {
74
74
  try {
75
- const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2, getAgentDecoder } = await import('./agent-5YLZ7DAC.js');
75
+ const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2, getAgentDecoder } = await import('./agent-S42FIMR7.js');
76
76
  const validation = validateAccountDiscriminator(encodedAccount.data, AGENT_DISCRIMINATOR2);
77
77
  if (validation.canDecode) {
78
78
  try {
@@ -131,7 +131,7 @@ async function createMigrationPlan(encodedAccount, address) {
131
131
  plan.recommendations.push("Account does not exist - no migration needed");
132
132
  return plan;
133
133
  }
134
- const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2 } = await import('./agent-5YLZ7DAC.js');
134
+ const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2 } = await import('./agent-S42FIMR7.js');
135
135
  const validation = validateAccountDiscriminator(encodedAccount.data, AGENT_DISCRIMINATOR2);
136
136
  const inspection = inspectAccountData(encodedAccount, address);
137
137
  if (validation.isValid) {
@@ -306,7 +306,7 @@ async function runAccountDiagnostics(encodedAccount, address) {
306
306
  const accountExists = "exists" in encodedAccount && encodedAccount.exists;
307
307
  let discriminatorValidation, inspection, migrationPlan, migrationSimulation;
308
308
  if (accountExists) {
309
- const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2 } = await import('./agent-5YLZ7DAC.js');
309
+ const { AGENT_DISCRIMINATOR: AGENT_DISCRIMINATOR2 } = await import('./agent-S42FIMR7.js');
310
310
  discriminatorValidation = validateAccountDiscriminator(encodedAccount.data, AGENT_DISCRIMINATOR2);
311
311
  inspection = inspectAccountData(encodedAccount, address);
312
312
  migrationPlan = await createMigrationPlan(encodedAccount, address);
@@ -1402,5 +1402,5 @@ async function verifyLocalPrivacyProof(proof, publicInputs, encrypted) {
1402
1402
  }
1403
1403
 
1404
1404
  export { ClientEncryptionService, FeatureFlagManager, TokenExtension, TokenProgram, account_diagnostics_exports, client_encryption_exports, createDiscriminatorErrorMessage, createMigrationPlan, createMigrationReport, deriveAssociatedTokenAddress, deriveMultisigPda, deriveProposalPda, deriveSplTokenAssociatedTokenAddress, deriveToken2022AssociatedTokenAddress, detectTokenProgram, diagnoseAccountFromChain, diagnoseBatchFromChain, exportDiagnosticReport, extractLegacyData, feature_flags_exports, formatTokenAmount, generateLocalPrivacyProof, getAllAssociatedTokenAddresses, getAssociatedTokenAccount, getConfidentialTransferConfig, getFeatureFlags, getInterestBearingConfig, getMigrationInstructions, getTokenProgramAddress, getTokenProgramFromAddress, getTokenProgramType, getTransferFeeConfig, governance_helpers_exports, hasConfidentialTransferExtension, hasInterestBearingExtension, hasTransferFeeExtension, inspectAccountData, isFeatureEnabled, isToken2022Mint, parseTokenAmount, runAccountDiagnostics, runBatchDiagnostics, safeDecodeAgent, simulateMigration, validateAccountDiscriminator, validateAssociatedTokenAddress, verifyLocalPrivacyProof };
1405
- //# sourceMappingURL=chunk-G7S6B6WB.js.map
1406
- //# sourceMappingURL=chunk-G7S6B6WB.js.map
1405
+ //# sourceMappingURL=chunk-5QBSC4T4.js.map
1406
+ //# sourceMappingURL=chunk-5QBSC4T4.js.map