@ghostspeak/sdk 2.0.8 → 2.0.10

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 (33) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/{GhostSpeakClient-bnXwUPHI.d.ts → GhostSpeakClient-qdLGyuDp.d.ts} +2 -2
  3. package/dist/{StakingModule-DunDShLq.d.ts → StakingModule-CPhp_ZY0.d.ts} +1 -1
  4. package/dist/{browser-CI5_6Gzk.d.ts → browser-D1TpjbjZ.d.ts} +3 -3
  5. package/dist/browser.d.ts +3 -2
  6. package/dist/browser.js +3 -3
  7. package/dist/{chunk-6XCCMJ6M.js → chunk-5SS3OL4B.js} +5 -5
  8. package/dist/{chunk-6XCCMJ6M.js.map → chunk-5SS3OL4B.js.map} +1 -1
  9. package/dist/{chunk-JYXSOXCP.js → chunk-63A7F2YP.js} +42 -32
  10. package/dist/chunk-63A7F2YP.js.map +1 -0
  11. package/dist/{chunk-5QBSC4T4.js → chunk-EU6PHSM5.js} +3 -3
  12. package/dist/{chunk-5QBSC4T4.js.map → chunk-EU6PHSM5.js.map} +1 -1
  13. package/dist/{chunk-OXA7MECJ.js → chunk-HIDBANFS.js} +56 -4
  14. package/dist/chunk-HIDBANFS.js.map +1 -0
  15. package/dist/{chunk-BQDGRTVP.js → chunk-QWQTPTZ4.js} +39 -51
  16. package/dist/chunk-QWQTPTZ4.js.map +1 -0
  17. package/dist/client.d.ts +3 -3
  18. package/dist/client.js +4 -4
  19. package/dist/index.d.ts +142 -11
  20. package/dist/index.js +149 -24
  21. package/dist/index.js.map +1 -1
  22. package/dist/metafile-esm.json +1 -1
  23. package/dist/minimal/core-minimal.d.ts +0 -5
  24. package/dist/minimal/core-minimal.js +6 -6
  25. package/dist/minimal/core-minimal.js.map +1 -1
  26. package/dist/{signature-verification-DGxR4aYQ.d.ts → signature-verification-BDzoR1MG.d.ts} +0 -5
  27. package/dist/utils.d.ts +143 -2
  28. package/dist/utils.js +4 -4
  29. package/dist/utils.js.map +1 -1
  30. package/package.json +5 -3
  31. package/dist/chunk-BQDGRTVP.js.map +0 -1
  32. package/dist/chunk-JYXSOXCP.js.map +0 -1
  33. package/dist/chunk-OXA7MECJ.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { init_reputation_tag_engine, createErrorContext, logEnhancedError, IPFSClient, SYSTEM_PROGRAM_ADDRESS, ReputationCalculator, ReputationTagEngine, REPUTATION_CONSTANTS } from './chunk-OXA7MECJ.js';
1
+ import { init_reputation_tag_engine, createSolanaClient, createErrorContext, logEnhancedError, IPFSClient, SYSTEM_PROGRAM_ADDRESS, ReputationCalculator, ReputationTagEngine, REPUTATION_CONSTANTS } from './chunk-HIDBANFS.js';
2
2
  import { getInitializeGovernanceProposalInstructionAsync, getInitializeStakingConfigInstructionAsync, getStakeGhostInstructionAsync, getUnstakeGhostInstructionAsync, getRegisterAgentInstructionAsync, getRegisterAgentCompressedInstructionAsync, getUpdateAgentInstruction, getVerifyAgentInstructionAsync, getDeactivateAgentInstruction, getActivateAgentInstruction, getClaimGhostInstruction } from './chunk-IQM5RASO.js';
3
3
  import { __export, __esm } from './chunk-UP2VWCW5.js';
4
- import { createSolanaRpc, createSolanaRpcSubscriptions, lamports, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, setTransactionMessageFeePayer, compileTransactionMessage, getBase64EncodedWireTransaction, getProgramDerivedAddress, getUtf8Encoder, getAddressEncoder } from '@solana/kit';
4
+ import { lamports, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, setTransactionMessageFeePayer, compileTransactionMessage, getBase64EncodedWireTransaction, getProgramDerivedAddress, getUtf8Encoder, getAddressEncoder } from '@solana/kit';
5
5
  import { LRUCache } from 'lru-cache';
6
6
  import { address } from '@solana/addresses';
7
7
  import bs58 from 'bs58';
@@ -261,8 +261,7 @@ var init_MultiSourceAggregator = __esm({
261
261
  }
262
262
  });
263
263
  var RpcClient = class {
264
- rpc;
265
- rpcSubscriptions;
264
+ client;
266
265
  commitment;
267
266
  endpoint;
268
267
  maxRetries;
@@ -270,21 +269,25 @@ var RpcClient = class {
270
269
  timeout;
271
270
  constructor(config) {
272
271
  this.endpoint = config.endpoint;
273
- this.rpc = createSolanaRpc(config.endpoint);
272
+ this.client = createSolanaClient({ urlOrMoniker: config.endpoint });
274
273
  this.commitment = config.commitment ?? "confirmed";
275
274
  this.maxRetries = config.maxRetries ?? 3;
276
275
  this.retryDelay = config.retryDelay ?? 1e3;
277
276
  this.timeout = config.timeout ?? 6e4;
278
- if (config.wsEndpoint) {
279
- this.rpcSubscriptions = createSolanaRpcSubscriptions(config.wsEndpoint);
280
- }
277
+ }
278
+ /**
279
+ * Get the underlying RPC client for direct access
280
+ * This provides access to Gill's rpc object for advanced operations
281
+ */
282
+ get rpc() {
283
+ return this.client.rpc;
281
284
  }
282
285
  /**
283
286
  * Get account information with automatic retries
284
287
  */
285
288
  async getAccountInfo(address2, options) {
286
289
  return this.withRetry(async () => {
287
- const result = await this.rpc.getAccountInfo(address2, {
290
+ const result = await this.client.rpc.getAccountInfo(address2, {
288
291
  commitment: options?.commitment ?? this.commitment,
289
292
  encoding: "base64"
290
293
  }).send();
@@ -297,7 +300,7 @@ var RpcClient = class {
297
300
  */
298
301
  async getMultipleAccounts(addresses, options) {
299
302
  return this.withRetry(async () => {
300
- const result = await this.rpc.getMultipleAccounts(addresses, {
303
+ const result = await this.client.rpc.getMultipleAccounts(addresses, {
301
304
  commitment: options?.commitment ?? this.commitment,
302
305
  encoding: "base64"
303
306
  }).send();
@@ -311,7 +314,7 @@ var RpcClient = class {
311
314
  */
312
315
  async getProgramAccounts(programId, options) {
313
316
  return this.withRetry(async () => {
314
- const result = await this.rpc.getProgramAccounts(programId, {
317
+ const result = await this.client.rpc.getProgramAccounts(programId, {
315
318
  commitment: options?.commitment ?? this.commitment,
316
319
  encoding: "base64",
317
320
  filters: options?.filters
@@ -335,7 +338,7 @@ var RpcClient = class {
335
338
  return this.blockhashCache.value;
336
339
  }
337
340
  const result = await this.withRetry(async () => {
338
- const response = await this.rpc.getLatestBlockhash({
341
+ const response = await this.client.rpc.getLatestBlockhash({
339
342
  commitment: this.commitment
340
343
  }).send();
341
344
  return {
@@ -351,7 +354,7 @@ var RpcClient = class {
351
354
  */
352
355
  async sendTransaction(transaction, options) {
353
356
  return this.withRetry(async () => {
354
- const result = await this.rpc.sendTransaction(transaction, {
357
+ const result = await this.client.rpc.sendTransaction(transaction, {
355
358
  encoding: "base64",
356
359
  skipPreflight: options?.skipPreflight ?? false,
357
360
  preflightCommitment: options?.preflightCommitment ?? this.commitment,
@@ -365,7 +368,7 @@ var RpcClient = class {
365
368
  */
366
369
  async getSignatureStatuses(signatures) {
367
370
  return this.withRetry(async () => {
368
- const result = await this.rpc.getSignatureStatuses(signatures).send();
371
+ const result = await this.client.rpc.getSignatureStatuses(signatures).send();
369
372
  return result.value.map((status) => {
370
373
  if (!status) return null;
371
374
  const typedStatus = status;
@@ -383,7 +386,7 @@ var RpcClient = class {
383
386
  */
384
387
  async simulateTransaction(transaction, options) {
385
388
  return this.withRetry(async () => {
386
- const result = await this.rpc.simulateTransaction(transaction, {
389
+ const result = await this.client.rpc.simulateTransaction(transaction, {
387
390
  encoding: "base64",
388
391
  commitment: options?.commitment ?? this.commitment,
389
392
  replaceRecentBlockhash: options?.replaceRecentBlockhash ?? false
@@ -401,7 +404,7 @@ var RpcClient = class {
401
404
  */
402
405
  async getFeeForMessage(encodedMessage) {
403
406
  return this.withRetry(async () => {
404
- const result = await this.rpc.getFeeForMessage(encodedMessage, {
407
+ const result = await this.client.rpc.getFeeForMessage(encodedMessage, {
405
408
  commitment: this.commitment
406
409
  }).send();
407
410
  return result.value ? BigInt(result.value) : null;
@@ -412,7 +415,7 @@ var RpcClient = class {
412
415
  */
413
416
  async isHealthy() {
414
417
  try {
415
- await this.rpc.getHealth().send();
418
+ await this.client.rpc.getHealth().send();
416
419
  return true;
417
420
  } catch {
418
421
  return false;
@@ -422,18 +425,18 @@ var RpcClient = class {
422
425
  * Get RPC node version
423
426
  */
424
427
  async getVersion() {
425
- const result = await this.rpc.getVersion().send();
428
+ const result = await this.client.rpc.getVersion().send();
426
429
  return result;
427
430
  }
428
431
  /**
429
- * Subscribe to account changes (WebSocket)
430
- * Note: This is a placeholder implementation. In production, you would use the actual subscription API
432
+ * Subscribe to account changes (WebSocket)
433
+ *
434
+ * Note: This is a polling-based implementation for backward compatibility.
435
+ * For production use with real-time subscriptions, access the rpcSubscriptions
436
+ * directly via client.rpcSubscriptions from Gill.
431
437
  */
432
438
  async subscribeToAccount(address2, callback) {
433
- if (!this.rpcSubscriptions) {
434
- throw new Error("WebSocket endpoint not configured");
435
- }
436
- console.warn("Account subscription is not fully implemented in this version");
439
+ console.warn("Account subscription using polling fallback. For real-time subscriptions, use client.rpcSubscriptions directly.");
437
440
  const intervalId = setInterval(async () => {
438
441
  try {
439
442
  const accountInfo = await this.getAccountInfo(address2);
@@ -446,6 +449,15 @@ var RpcClient = class {
446
449
  clearInterval(intervalId);
447
450
  };
448
451
  }
452
+ /**
453
+ * Get the underlying Gill client for advanced operations
454
+ * This provides direct access to Gill's SolanaClient for features like:
455
+ * - rpcSubscriptions for WebSocket subscriptions
456
+ * - sendAndConfirmTransaction for transaction handling
457
+ */
458
+ getGillClient() {
459
+ return this.client;
460
+ }
449
461
  // Private helper methods
450
462
  async withRetry(operation, retries = this.maxRetries) {
451
463
  let lastError;
@@ -1148,9 +1160,8 @@ var InstructionBuilder = class {
1148
1160
  } else {
1149
1161
  console.log("\u{1F50D} No status found, trying transaction details...");
1150
1162
  try {
1151
- const { createSolanaRpc: createSolanaRpc2 } = await import('@solana/kit');
1152
- const directRpc = createSolanaRpc2(this.config.rpcEndpoint ?? "https://api.devnet.solana.com");
1153
- const transaction = await directRpc.getTransaction(signature, {
1163
+ const directClient = createSolanaClient({ urlOrMoniker: this.config.rpcEndpoint ?? "https://api.devnet.solana.com" });
1164
+ const transaction = await directClient.rpc.getTransaction(signature, {
1154
1165
  commitment: this.config.commitment ?? "confirmed",
1155
1166
  encoding: "json",
1156
1167
  maxSupportedTransactionVersion: 0
@@ -1182,9 +1193,8 @@ var InstructionBuilder = class {
1182
1193
  if (!confirmed) {
1183
1194
  console.log("\u{1F50D} Final confirmation attempt via transaction lookup...");
1184
1195
  try {
1185
- const { createSolanaRpc: createSolanaRpc2 } = await import('@solana/kit');
1186
- const directRpc = createSolanaRpc2(this.config.rpcEndpoint ?? "https://api.devnet.solana.com");
1187
- const transaction = await directRpc.getTransaction(signature, {
1196
+ const directClient = createSolanaClient({ urlOrMoniker: this.config.rpcEndpoint ?? "https://api.devnet.solana.com" });
1197
+ const transaction = await directClient.rpc.getTransaction(signature, {
1188
1198
  commitment: this.config.commitment ?? "confirmed",
1189
1199
  encoding: "json",
1190
1200
  maxSupportedTransactionVersion: 0
@@ -3846,5 +3856,5 @@ var StakingModule = class extends BaseModule {
3846
3856
  };
3847
3857
 
3848
3858
  export { ATTESTATION_SEED, AgentModule, BaseModule, CREDENTIAL_SEED, CacheManager, CredentialKind, CredentialModule, CredentialStatus, DEFAULT_IPFS_CONFIG, DidError, DidErrorClass, GhostModule, GovernanceModule, IPFSUtils, InstructionBuilder, MultiSourceAggregator, MultiSourceAggregator_exports, MultisigModule, ReputationModule, RpcClient, SASAttestationHelper, SAS_PROGRAM_ID, SCHEMA_SEED, ServiceEndpointType, StakingModule, VerificationMethodType, VerificationRelationship, canPerformAction, createEd25519VerificationMethod, createIPFSUtils, createMetadataUri, createServiceEndpoint, deriveDidDocumentPda, determineStorageMethod, didDocumentToJson, exportAsW3CDidDocument, generateDidString, getIdentifierFromDid, getMethodsForRelationship, getNetworkFromDid, init_MultiSourceAggregator, isDidActive, parseDidString, validateDidString };
3849
- //# sourceMappingURL=chunk-JYXSOXCP.js.map
3850
- //# sourceMappingURL=chunk-JYXSOXCP.js.map
3859
+ //# sourceMappingURL=chunk-63A7F2YP.js.map
3860
+ //# sourceMappingURL=chunk-63A7F2YP.js.map