@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,4 +1,5 @@
1
1
  import { __esm, __export } from './chunk-UP2VWCW5.js';
2
+ import { createSolanaClient } from 'gill';
2
3
  import { address } from '@solana/addresses';
3
4
  import '@solana/sysvars';
4
5
 
@@ -780,6 +781,57 @@ function isIPFSUploadResponse(data) {
780
781
  const obj = data;
781
782
  return typeof obj.IpfsHash === "string";
782
783
  }
784
+ var DEFAULT_ENDPOINTS = {
785
+ devnet: "https://api.devnet.solana.com",
786
+ mainnet: "https://api.mainnet-beta.solana.com",
787
+ localnet: "http://127.0.0.1:8899",
788
+ testnet: "https://api.testnet.solana.com"
789
+ };
790
+ var _defaultClient = null;
791
+ var _cachedEndpoint = null;
792
+ function createSolanaClient2(config) {
793
+ return createSolanaClient({ urlOrMoniker: config.urlOrMoniker });
794
+ }
795
+ function getDefaultSolanaClient(endpoint) {
796
+ const targetEndpoint = endpoint || DEFAULT_ENDPOINTS.devnet;
797
+ if (_cachedEndpoint !== targetEndpoint) {
798
+ _defaultClient = null;
799
+ _cachedEndpoint = targetEndpoint;
800
+ }
801
+ if (!_defaultClient) {
802
+ _defaultClient = createSolanaClient({ urlOrMoniker: targetEndpoint });
803
+ }
804
+ return _defaultClient;
805
+ }
806
+ function resetDefaultClient() {
807
+ _defaultClient = null;
808
+ _cachedEndpoint = null;
809
+ }
810
+ function createNetworkClient(network) {
811
+ return createSolanaClient({ urlOrMoniker: network });
812
+ }
813
+ function isNetworkMoniker(endpoint) {
814
+ return ["devnet", "mainnet", "localnet", "testnet"].includes(endpoint);
815
+ }
816
+ function getDefaultEndpoint(network) {
817
+ return DEFAULT_ENDPOINTS[network];
818
+ }
819
+ function detectNetworkFromEndpoint(endpoint) {
820
+ const lowerEndpoint = endpoint.toLowerCase();
821
+ if (lowerEndpoint.includes("devnet") || lowerEndpoint.includes("api.devnet.solana.com")) {
822
+ return "devnet";
823
+ }
824
+ if (lowerEndpoint.includes("mainnet") || lowerEndpoint.includes("api.mainnet-beta.solana.com")) {
825
+ return "mainnet";
826
+ }
827
+ if (lowerEndpoint.includes("testnet") || lowerEndpoint.includes("api.testnet.solana.com")) {
828
+ return "testnet";
829
+ }
830
+ if (lowerEndpoint.includes("localhost") || lowerEndpoint.includes("127.0.0.1")) {
831
+ return "localnet";
832
+ }
833
+ return "unknown";
834
+ }
783
835
 
784
836
  // src/generated/instruction-mappings.ts
785
837
  var instructionAccountMappings = {
@@ -7489,7 +7541,7 @@ var ReputationCalculator = class {
7489
7541
  detect: (data) => {
7490
7542
  if (data.categoryReputations.length < 5) return false;
7491
7543
  const recentCategories = data.categoryReputations.sort((a, b) => b.lastActivity - a.lastActivity).slice(0, 5);
7492
- const daysSinceOldest = (Date.now() - recentCategories[4].lastActivity) / (1e3 * 60 * 60 * 24);
7544
+ const daysSinceOldest = (Date.now() / 1e3 - recentCategories[4].lastActivity) / 86400;
7493
7545
  return daysSinceOldest < 7;
7494
7546
  }
7495
7547
  },
@@ -7782,6 +7834,6 @@ var ReputationCalculator = class {
7782
7834
  }
7783
7835
  };
7784
7836
 
7785
- export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, ExternalIdNotFoundError, GhostNotFoundError, GhostSpeakError, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, debugInstructionCall, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, logEnhancedError, reputation_tag_engine_exports, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
7786
- //# sourceMappingURL=chunk-OXA7MECJ.js.map
7787
- //# sourceMappingURL=chunk-OXA7MECJ.js.map
7837
+ export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, ExternalIdNotFoundError, GhostNotFoundError, GhostSpeakError, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, createNetworkClient, createSolanaClient2 as createSolanaClient, debugInstructionCall, detectNetworkFromEndpoint, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getDefaultEndpoint, getDefaultSolanaClient, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, isNetworkMoniker, logEnhancedError, reputation_tag_engine_exports, resetDefaultClient, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
7838
+ //# sourceMappingURL=chunk-HIDBANFS.js.map
7839
+ //# sourceMappingURL=chunk-HIDBANFS.js.map