@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.
- package/README.md +145 -2
- package/dist/{GhostSpeakClient-CWmGaM9Q.d.ts → GhostSpeakClient-bnXwUPHI.d.ts} +10 -6
- package/dist/{StakingModule-C5rzuOWb.d.ts → StakingModule-DunDShLq.d.ts} +263 -343
- package/dist/{agent-5YLZ7DAC.js → agent-S42FIMR7.js} +3 -3
- package/dist/{agent-5YLZ7DAC.js.map → agent-S42FIMR7.js.map} +1 -1
- package/dist/browser-CI5_6Gzk.d.ts +234 -0
- package/dist/browser.d.ts +3 -64
- package/dist/browser.js +9 -9
- package/dist/{chunk-SFTSZ3LC.js → chunk-46QWY3MG.js} +3 -3
- package/dist/{chunk-SFTSZ3LC.js.map → chunk-46QWY3MG.js.map} +1 -1
- package/dist/{chunk-G7S6B6WB.js → chunk-5QBSC4T4.js} +7 -7
- package/dist/{chunk-G7S6B6WB.js.map → chunk-5QBSC4T4.js.map} +1 -1
- package/dist/{chunk-IHVDQ4YI.js → chunk-5QZVFUXB.js} +201 -256
- package/dist/chunk-5QZVFUXB.js.map +1 -0
- package/dist/{chunk-E3FD2CNY.js → chunk-6XCCMJ6M.js} +19 -23
- package/dist/chunk-6XCCMJ6M.js.map +1 -0
- package/dist/{chunk-JV2SWONF.js → chunk-A7ALCVUI.js} +3 -3
- package/dist/{chunk-JV2SWONF.js.map → chunk-A7ALCVUI.js.map} +1 -1
- package/dist/{chunk-AL3HQN73.js → chunk-AWMGX3OX.js} +172 -112
- package/dist/chunk-AWMGX3OX.js.map +1 -0
- package/dist/{chunk-S74EH3KD.js → chunk-IQM5RASO.js} +637 -25
- package/dist/chunk-IQM5RASO.js.map +1 -0
- package/dist/{chunk-SZGFSCNU.js → chunk-JYXSOXCP.js} +467 -299
- package/dist/chunk-JYXSOXCP.js.map +1 -0
- package/dist/{chunk-C5CDA3WX.js → chunk-OXA7MECJ.js} +476 -3
- package/dist/chunk-OXA7MECJ.js.map +1 -0
- package/dist/{chunk-KB6CKIUK.js → chunk-QLRWUHN2.js} +3 -3
- package/dist/{chunk-KB6CKIUK.js.map → chunk-QLRWUHN2.js.map} +1 -1
- package/dist/client.d.ts +2 -3
- package/dist/client.js +9 -9
- package/dist/{createAgentAuthorization-ULG47ZJI.js → createAgentAuthorization-KGZNXZBT.js} +4 -4
- package/dist/{createAgentAuthorization-ULG47ZJI.js.map → createAgentAuthorization-KGZNXZBT.js.map} +1 -1
- package/dist/generated-QJREJQ2C.js +9 -0
- package/dist/{generated-EG5USUFG.js.map → generated-QJREJQ2C.js.map} +1 -1
- package/dist/index.d.ts +209 -231
- package/dist/index.js +231 -521
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/minimal/core-minimal.d.ts +266 -184
- package/dist/minimal/core-minimal.js +6 -6
- package/dist/minimal/core-minimal.js.map +1 -1
- package/dist/{revokeAuthorization-OK7E7OK3.js → revokeAuthorization-2ZRO6GUZ.js} +4 -4
- package/dist/{revokeAuthorization-OK7E7OK3.js.map → revokeAuthorization-2ZRO6GUZ.js.map} +1 -1
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js → updateReputationWithAuth-PCEUOCFV.js} +4 -4
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js.map → updateReputationWithAuth-PCEUOCFV.js.map} +1 -1
- package/dist/utils.js +9 -9
- package/package.json +4 -4
- package/dist/chunk-AL3HQN73.js.map +0 -1
- package/dist/chunk-C5CDA3WX.js.map +0 -1
- package/dist/chunk-E3FD2CNY.js.map +0 -1
- package/dist/chunk-IHVDQ4YI.js.map +0 -1
- package/dist/chunk-S74EH3KD.js.map +0 -1
- package/dist/chunk-SZGFSCNU.js.map +0 -1
- package/dist/generated-EG5USUFG.js +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { P as PrivacyMode, R as ReputationTier, S as ScoreRange, a as PrivacySettings, M as MetricVisibility, V as VisibleReputation
|
|
2
|
-
export { j as ApplyPresetParams, G as GhostSpeakClient, h as GrantAccessParams, I as InitializePrivacyParams, n as IssuedCredentialResult, e as PRIVACY_CONSTANTS, b as PrivacyModule, f as PrivacyPreset, d as PrivacyPresets, i as RevokeAccessParams, g as SetMetricVisibilityParams, m as UnifiedCredentialConfig, k as UnifiedCredentialService, U as UpdatePrivacyModeParams, c as VisibilityLevel, G as default, l as lamportsToSol, s as sol } from './GhostSpeakClient-
|
|
3
|
-
import { Address, ReadonlyUint8Array, Option, Decoder, TransactionSigner, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, ReadonlySignerAccount, AccountSignerMeta, ReadonlyAccount,
|
|
1
|
+
import { P as PrivacyMode, R as ReputationTier, S as ScoreRange, a as PrivacySettings, M as MetricVisibility, V as VisibleReputation } from './GhostSpeakClient-bnXwUPHI.js';
|
|
2
|
+
export { j as ApplyPresetParams, A as AuthorizationModule, G as GhostSpeakClient, h as GrantAccessParams, I as InitializePrivacyParams, n as IssuedCredentialResult, e as PRIVACY_CONSTANTS, b as PrivacyModule, f as PrivacyPreset, d as PrivacyPresets, i as RevokeAccessParams, g as SetMetricVisibilityParams, m as UnifiedCredentialConfig, k as UnifiedCredentialService, U as UpdatePrivacyModeParams, c as VisibilityLevel, G as default, l as lamportsToSol, s as sol } from './GhostSpeakClient-bnXwUPHI.js';
|
|
3
|
+
import { Address, ReadonlyUint8Array, Option, Decoder, TransactionSigner, AccountMeta, Instruction, InstructionWithData, InstructionWithAccounts, WritableAccount, ReadonlySignerAccount, AccountSignerMeta, ReadonlyAccount, OptionOrNullable, WritableSignerAccount, Slot, Lamports, Epoch, Base58EncodedBytes, Base64EncodedBytes, TransactionError, Base64EncodedWireTransaction, Signature, TransactionMessageBytesBase64, Commitment as Commitment$1, KeyPairSigner } from '@solana/kit';
|
|
4
4
|
export { TransactionSigner, address, createKeyPairSignerFromBytes, createSolanaRpc, generateKeyPairSigner } from '@solana/kit';
|
|
5
5
|
export { AddressOf, Agent, AgentCreationParams, AgentEvent, AgentMetadata, AgentType, Attachment, Channel, ChannelCreationParams, ChannelEvent, ChannelType, CommunicationMessage, CommunicationSession, ConfidentialBalance, ConfidentialTransfer, CreateCommunicationSessionParams, DeepPartial, ErrorCode, Escrow, EscrowCreationParams, EscrowEvent, Event, FilterOptions, Message, MessageType, Milestone, PaginationOptions, ParticipantStatus, ParticipantType, QueryResult, Rating, Reaction, Reputation, Result, SDKError, SendCommunicationMessageParams, SimulationResult, Transaction, TransferProof, UpdateParticipantStatusParams, WithAddress, isError, isSuccess, unwrap } from './types.js';
|
|
6
6
|
export { AccountNotFoundError, ErrorFactory, ErrorHandler, InsufficientBalanceError, InvalidInputError, NetworkError, SimulationFailedError, TimeoutError, TransactionFailedError, ValidationError } from './errors.js';
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
7
|
+
import { c as AccessTier, d as GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, P as PricingModelArgs, E as ExtendedRpcApi } from './StakingModule-DunDShLq.js';
|
|
8
|
+
export { a5 as AgentAccount, A as AgentModule, a4 as AgentRegistrationData, a3 as AgentWithAddress, B as BaseModule, e as CacheConfig, C as CacheManager, f as ClaimGhostParams, aj as Commitment, Z as CreateDidDocumentParams, h as CreateProposalParams, n as Credential, l as CredentialKind, k as CredentialModule, m as CredentialStatus, o as CredentialTemplate, $ as DeactivateDidDocumentParams, Q as DidDocument, r as DidError, s as DidErrorClass, D as DidModule, X as DidResolutionMetadata, ai as EmergencyConfig, j as ExecutionParams, a as GhostModule, G as GhostSpeakConfig, a7 as GhostSpeakError, b as GovernanceModule, I as InstructionBuilder, M as MultisigModule, N as Network, a2 as PayAIReputationRecordInput, g as PreparedClaimResult, a6 as PricingModel, i as ProposalType, a8 as RegisterAgentParams, a1 as ReputationData, R as ReputationModule, a0 as ResolveDidDocumentParams, ak as RetryConfig, aa as RpcAccountInfo, ad as RpcAccountInfoResponse, al as RpcApi, ae as RpcMultipleAccountsResponse, ab as RpcProgramAccount, ac as RpcProgramAccountsResponse, a9 as RpcResponse, am as RpcSubscriptionApi, U as ServiceEndpoint, q as ServiceEndpointType, ag as SimulatedTransactionResponse, ah as SolanaRpcClient, an as StakingAccount, ao as StakingConfig, af as TransactionResponse, _ as UpdateDidDocumentParams, T as VerificationMethod, V as VerificationMethodType, p as VerificationRelationship, Y as W3CDidDocument, W as W3CVerifiableCredential, J as canPerformAction, y as createEd25519VerificationMethod, z as createServiceEndpoint, aq as decodeAgent, t as deriveDidDocumentPda, K as didDocumentToJson, x as exportAsW3CDidDocument, ar as fetchAgent, as as fetchMaybeAgent, u as generateDidString, ap as getAgentDecoder, O as getIdentifierFromDid, H as getMethodsForRelationship, L as getNetworkFromDid, at as getStakingAccountDecoder, au as getStakingConfigDecoder, F as isDidActive, w as parseDidString, v as validateDidString } from './StakingModule-DunDShLq.js';
|
|
9
9
|
import { Address as Address$1 } from '@solana/addresses';
|
|
10
10
|
export { l as AuthorizationFilter, p as AuthorizationInvalidReason, q as AuthorizationMessage, n as AuthorizationMetadata, o as AuthorizationProof, u as AuthorizationRevocation, A as AuthorizationStatus, t as AuthorizationUsage, k as AuthorizationWithStatus, B as BatchAuthorizationVerification, C as CreateAuthorizationParams, R as ReputationAuthorization, m as SolanaNetwork, V as VerificationDetails, r as VerifyAuthorizationParams, c as createAuthorizationMessage, b as createSignedAuthorization, e as deserializeAuthorization, g as generateNonce, f as getAuthorizationId, h as isAuthorizationExhausted, i as isAuthorizationExpired, d as serializeAuthorization, a as signAuthorizationMessage, j as validateAuthorizationNetwork, v as verifyAuthorizationSignature } from './signature-verification-DGxR4aYQ.js';
|
|
11
|
+
export { h as ASSOCIATED_TOKEN_PROGRAM_ADDRESS, A as ATTESTATION_SEED, d as AttestationPDAResult, C as CREDENTIAL_SEED, e as CreateAttestationConfig, f as GHOSTSPEAK_PROGRAM_ID, c as GhostOwnershipAttestationData, G as GhostSpeakCredentialConfig, N as NATIVE_MINT_ADDRESS, S as SASAttestationHelper, a as SAS_PROGRAM_ID, b as SCHEMA_SEED, g as TOKEN_2022_PROGRAM_ADDRESS, T as TOKEN_PROGRAM_ADDRESS } from './browser-CI5_6Gzk.js';
|
|
11
12
|
import { I as IPFSClient, C as ClientEncryptionService } from './feature-flags-B1g0DCPe.js';
|
|
12
13
|
export { A as AccountInspectionResult, a5 as AssociatedTokenAccount, K as BatchDiagnosticReport, af as ClientEncryptionOptions, a7 as ConfidentialTransferConfig, J as DiagnosticReport, D as DiscriminatorValidationResult, ad as EncryptedData, ai as FeatureFlagManager, aj as FeatureFlags, G as GhostSpeakSDKError, a8 as InterestBearingConfig, L as LegacyAgentData, M as MigrationPlan, x as MigrationResult, ae as PrivateMetadata, R as ReputationTagEngine, _ as TokenExtension, T as TokenProgram, a6 as TransferFeeConfig, m as createDiscriminatorErrorMessage, c as createErrorContext, o as createMigrationPlan, q as createMigrationReport, d as deriveAssociatedTokenAddress, a9 as deriveMultisigPda, aa as deriveProposalPda, S as deriveSplTokenAssociatedTokenAddress, U as deriveToken2022AssociatedTokenAddress, a as detectTokenProgram, B as diagnoseAccountFromChain, F as diagnoseBatchFromChain, e as enhanceTransactionError, H as exportDiagnosticReport, Q as extractInstructionName, u as extractLegacyData, f as formatTokenAmount, ab as generateLocalPrivacyProof, W as getAllAssociatedTokenAddresses, V as getAssociatedTokenAccount, a3 as getConfidentialTransferConfig, ag as getFeatureFlags, a4 as getInterestBearingConfig, t as getMigrationInstructions, Y as getTokenProgramAddress, Z as getTokenProgramFromAddress, g as getTokenProgramType, a2 as getTransferFeeConfig, a0 as hasConfidentialTransferExtension, a1 as hasInterestBearingExtension, $ as hasTransferFeeExtension, n as inspectAccountData, ah as isFeatureEnabled, i as isToken2022Mint, O as logEnhancedError, p as parseTokenAmount, y as runAccountDiagnostics, z as runBatchDiagnostics, s as safeDecodeAgent, r as simulateMigration, v as validateAccountDiscriminator, X as validateAssociatedTokenAddress, P as validatePreconditions, ac as verifyLocalPrivacyProof, w as withEnhancedErrors, N as withEnhancedErrorsSync } from './feature-flags-B1g0DCPe.js';
|
|
13
14
|
import { Rpc, GetSignaturesForAddressApi, GetTransactionApi, GetAccountInfoApi } from '@solana/rpc';
|
|
14
15
|
import { I as IPFSConfig, g as IPFSUploadOptions, C as ContentStorageResult, m as IPFSContentMetadata, h as IPFSOperationResult, r as IPFSError } from './reputation-types-Yebf0Rm_.js';
|
|
15
16
|
export { B as BadgeType, t as BehaviorTag, A as BulkTagUpdateRequest, o as CategoryReputation, u as ComplianceTag, D as DEFAULT_TAG_DECAY, K as FlexibleContent, l as IPFSPinResult, H as IPFSProviderConfig, j as IPFSRetrievalOptions, k as IPFSRetrievalResult, i as IPFSUploadResult, J as JobPerformance, F as ProposalStatus, s as REPUTATION_CONSTANTS, a as ReputationCalculationResult, p as ReputationTier, S as SkillTag, v as TAG_CONSTANTS, q as TagCategory, w as TagConfidenceLevel, x as TagCriteria, T as TagDecayConfig, y as TagEvaluation, d as TagFilters, e as TagQueryResult, b as TagReputationMetrics, c as TagScoreType, z as TagUpdateRequest } from './reputation-types-Yebf0Rm_.js';
|
|
16
17
|
export { CrossmintClientOptions, CredentialType as CrossmintCredentialType, IssuedCredential as CrossmintIssuedCredential, CrossmintVCClient, GHOSTSPEAK_CREDENTIAL_TYPES } from './credentials.js';
|
|
17
|
-
import { EventEmitter } from 'node:events';
|
|
18
18
|
export { ElGamalCiphertext, ElGamalKeypair, TransferProof as ElGamalTransferProof, WasmModule, WithdrawProof, decrypt, elgamal, encrypt, generateKeypair, generateTransferProof, generateWithdrawProof, isWasmAvailable, loadWasmModule, wasmBridge } from './crypto.js';
|
|
19
19
|
export { d as deriveAgentPda, b as deriveAgentVerificationPda, a as deriveUserRegistryPda, f as findProgramDerivedAddress } from './pda-Ce7VYg4T.js';
|
|
20
|
-
export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, GHOSTSPEAK_PROGRAM_ID, NATIVE_MINT_ADDRESS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS } from './browser.js';
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -454,6 +453,52 @@ declare function getArbitrateDisputeInstruction<TAccountEscrow extends string, T
|
|
|
454
453
|
programAddress?: TProgramAddress;
|
|
455
454
|
}): ArbitrateDisputeInstruction<TProgramAddress, TAccountEscrow, TAccountEscrowVault, TAccountAgentTokenAccount, TAccountClientTokenAccount, TAccountAgentStaking, TAccountArbitrator, TAccountTokenProgram>;
|
|
456
455
|
|
|
456
|
+
/**
|
|
457
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
458
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
459
|
+
* to add features, then rerun Codama to update it.
|
|
460
|
+
*
|
|
461
|
+
* @see https://github.com/codama-idl/codama
|
|
462
|
+
*/
|
|
463
|
+
|
|
464
|
+
type ClaimGhostInstruction<TProgram extends string = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, TAccountAgentAccount extends string | AccountMeta<string> = string, TAccountDidDocument extends string | AccountMeta<string> = string, TAccountSasAttestation extends string | AccountMeta<string> = string, TAccountClaimer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
465
|
+
TAccountAgentAccount extends string ? WritableAccount<TAccountAgentAccount> : TAccountAgentAccount,
|
|
466
|
+
TAccountDidDocument extends string ? WritableAccount<TAccountDidDocument> : TAccountDidDocument,
|
|
467
|
+
TAccountSasAttestation extends string ? ReadonlyAccount<TAccountSasAttestation> : TAccountSasAttestation,
|
|
468
|
+
TAccountClaimer extends string ? WritableSignerAccount<TAccountClaimer> & AccountSignerMeta<TAccountClaimer> : TAccountClaimer,
|
|
469
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
470
|
+
...TRemainingAccounts
|
|
471
|
+
]>;
|
|
472
|
+
type ClaimGhostInstructionDataArgs = {
|
|
473
|
+
sasCredential: Address;
|
|
474
|
+
sasSchema: Address;
|
|
475
|
+
ipfsMetadataUri: OptionOrNullable<string>;
|
|
476
|
+
network: string;
|
|
477
|
+
};
|
|
478
|
+
type ClaimGhostInput<TAccountAgentAccount extends string = string, TAccountDidDocument extends string = string, TAccountSasAttestation extends string = string, TAccountClaimer extends string = string, TAccountSystemProgram extends string = string> = {
|
|
479
|
+
agentAccount: Address<TAccountAgentAccount>;
|
|
480
|
+
/**
|
|
481
|
+
* DID document to create for this Ghost
|
|
482
|
+
* Seeds: [b"did_document", agent_account.x402_payment_address.as_ref()]
|
|
483
|
+
*/
|
|
484
|
+
didDocument: Address<TAccountDidDocument>;
|
|
485
|
+
/**
|
|
486
|
+
* SAS Attestation proving ownership of x402_payment_address
|
|
487
|
+
* PDA: [b"attestation", sas_credential, sas_schema, x402_payment_address]
|
|
488
|
+
*/
|
|
489
|
+
sasAttestation: Address<TAccountSasAttestation>;
|
|
490
|
+
/** The claimer must have created a SAS attestation proving they own x402_payment_address */
|
|
491
|
+
claimer: TransactionSigner<TAccountClaimer>;
|
|
492
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
493
|
+
sasCredential: ClaimGhostInstructionDataArgs["sasCredential"];
|
|
494
|
+
sasSchema: ClaimGhostInstructionDataArgs["sasSchema"];
|
|
495
|
+
ipfsMetadataUri: ClaimGhostInstructionDataArgs["ipfsMetadataUri"];
|
|
496
|
+
network: ClaimGhostInstructionDataArgs["network"];
|
|
497
|
+
};
|
|
498
|
+
declare function getClaimGhostInstruction<TAccountAgentAccount extends string, TAccountDidDocument extends string, TAccountSasAttestation extends string, TAccountClaimer extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS>(input: ClaimGhostInput<TAccountAgentAccount, TAccountDidDocument, TAccountSasAttestation, TAccountClaimer, TAccountSystemProgram>, config?: {
|
|
499
|
+
programAddress?: TProgramAddress;
|
|
500
|
+
}): ClaimGhostInstruction<TProgramAddress, TAccountAgentAccount, TAccountDidDocument, TAccountSasAttestation, TAccountClaimer, TAccountSystemProgram>;
|
|
501
|
+
|
|
457
502
|
/**
|
|
458
503
|
* This code was AUTOGENERATED using the Codama library.
|
|
459
504
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -995,6 +1040,70 @@ interface SendTransactionOptions {
|
|
|
995
1040
|
minContextSlot?: Slot;
|
|
996
1041
|
}
|
|
997
1042
|
|
|
1043
|
+
/**
|
|
1044
|
+
* API Response Types for GhostSpeak Public API
|
|
1045
|
+
*
|
|
1046
|
+
* These types match the REST API responses from packages/api
|
|
1047
|
+
*/
|
|
1048
|
+
interface ApiGhost {
|
|
1049
|
+
address: string;
|
|
1050
|
+
owner: string | null;
|
|
1051
|
+
status: string;
|
|
1052
|
+
firstTxSignature: string;
|
|
1053
|
+
firstSeenTimestamp: number;
|
|
1054
|
+
discoverySource: string;
|
|
1055
|
+
claimedAt: number | null;
|
|
1056
|
+
agentId: string;
|
|
1057
|
+
name: string;
|
|
1058
|
+
description: string;
|
|
1059
|
+
metadataUri: string;
|
|
1060
|
+
serviceEndpoint: string;
|
|
1061
|
+
externalIdentifiers: Array<{
|
|
1062
|
+
platform: string;
|
|
1063
|
+
externalId: string;
|
|
1064
|
+
verified: boolean;
|
|
1065
|
+
verifiedAt: number;
|
|
1066
|
+
}>;
|
|
1067
|
+
ghostScore: number;
|
|
1068
|
+
reputationScore: number;
|
|
1069
|
+
reputationComponents: Array<{
|
|
1070
|
+
source: string;
|
|
1071
|
+
score: number;
|
|
1072
|
+
weight: number;
|
|
1073
|
+
lastUpdated: number;
|
|
1074
|
+
}>;
|
|
1075
|
+
didAddress: string | null;
|
|
1076
|
+
credentials: string[];
|
|
1077
|
+
isActive: boolean;
|
|
1078
|
+
isVerified: boolean;
|
|
1079
|
+
verificationTimestamp: number;
|
|
1080
|
+
createdAt: number;
|
|
1081
|
+
updatedAt: number;
|
|
1082
|
+
}
|
|
1083
|
+
interface ApiGhostScore {
|
|
1084
|
+
address: string;
|
|
1085
|
+
score: number;
|
|
1086
|
+
maxScore: number;
|
|
1087
|
+
components: Array<{
|
|
1088
|
+
source: string;
|
|
1089
|
+
score: number;
|
|
1090
|
+
weight: number;
|
|
1091
|
+
lastUpdated: number;
|
|
1092
|
+
}>;
|
|
1093
|
+
lastUpdated: number;
|
|
1094
|
+
}
|
|
1095
|
+
interface ApiExternalIdLookup {
|
|
1096
|
+
mapping: {
|
|
1097
|
+
platform: string;
|
|
1098
|
+
externalId: string;
|
|
1099
|
+
ghostAddress: string;
|
|
1100
|
+
verified: boolean;
|
|
1101
|
+
verifiedAt: number | null;
|
|
1102
|
+
createdAt: number;
|
|
1103
|
+
};
|
|
1104
|
+
ghost: ApiGhost | null;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
998
1107
|
/**
|
|
999
1108
|
* Calculate visible score based on privacy settings
|
|
1000
1109
|
*
|
|
@@ -1313,6 +1422,98 @@ declare function createBatchFetcher(rpc: ExtendedRpcApi, defaultConfig?: BatchFe
|
|
|
1313
1422
|
getWithRetry: <T>(addresses: Address$1[], config?: BatchFetchConfig, maxRetries?: number) => Promise<(T | null)[]>;
|
|
1314
1423
|
};
|
|
1315
1424
|
|
|
1425
|
+
/**
|
|
1426
|
+
* ExternalIdResolver - Cross-Platform Identity Lookup
|
|
1427
|
+
*
|
|
1428
|
+
* Resolves platform-specific IDs (PayAI, ElizaOS, etc.) to Ghost addresses
|
|
1429
|
+
* Uses GhostSpeak Public API for fast lookups
|
|
1430
|
+
*/
|
|
1431
|
+
|
|
1432
|
+
interface ApiResolverConfig {
|
|
1433
|
+
apiUrl?: string;
|
|
1434
|
+
cluster?: 'mainnet-beta' | 'devnet' | 'testnet' | 'localnet';
|
|
1435
|
+
}
|
|
1436
|
+
declare class ExternalIdResolver {
|
|
1437
|
+
private apiUrl;
|
|
1438
|
+
constructor(config?: ApiResolverConfig);
|
|
1439
|
+
/**
|
|
1440
|
+
* Resolve external ID to Ghost address
|
|
1441
|
+
*
|
|
1442
|
+
* @example
|
|
1443
|
+
* const address = await resolver.resolve('payai', 'agent-123');
|
|
1444
|
+
*/
|
|
1445
|
+
resolve(platform: string, externalId: string): Promise<Address$1>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Lookup external ID with full Ghost data
|
|
1448
|
+
*
|
|
1449
|
+
* @example
|
|
1450
|
+
* const { mapping, ghost } = await resolver.lookup('payai', 'agent-123');
|
|
1451
|
+
*/
|
|
1452
|
+
lookup(platform: string, externalId: string): Promise<ApiExternalIdLookup>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Get Ghost by Solana address via API
|
|
1455
|
+
*
|
|
1456
|
+
* Faster than on-chain lookup for read operations
|
|
1457
|
+
*/
|
|
1458
|
+
getGhost(ghostAddress: Address$1 | string): Promise<ApiGhost>;
|
|
1459
|
+
/**
|
|
1460
|
+
* Get Ghost Score via API
|
|
1461
|
+
*/
|
|
1462
|
+
getGhostScore(ghostAddress: Address$1 | string): Promise<ApiGhostScore>;
|
|
1463
|
+
/**
|
|
1464
|
+
* Get detailed reputation breakdown via API
|
|
1465
|
+
*/
|
|
1466
|
+
getGhostReputation(ghostAddress: Address$1 | string): Promise<any>;
|
|
1467
|
+
/**
|
|
1468
|
+
* Batch resolve multiple external IDs
|
|
1469
|
+
*/
|
|
1470
|
+
resolveBatch(identifiers: Array<{
|
|
1471
|
+
platform: string;
|
|
1472
|
+
externalId: string;
|
|
1473
|
+
}>): Promise<Array<Address$1 | null>>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Check if external ID exists
|
|
1476
|
+
*/
|
|
1477
|
+
exists(platform: string, externalId: string): Promise<boolean>;
|
|
1478
|
+
/**
|
|
1479
|
+
* Get all external IDs for a Ghost
|
|
1480
|
+
*
|
|
1481
|
+
* Fetches Ghost data and returns external identifiers
|
|
1482
|
+
*/
|
|
1483
|
+
getExternalIds(ghostAddress: Address$1 | string): Promise<Array<{
|
|
1484
|
+
platform: string;
|
|
1485
|
+
externalId: string;
|
|
1486
|
+
verified: boolean;
|
|
1487
|
+
verifiedAt: number;
|
|
1488
|
+
}>>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Search for Ghost by partial platform ID
|
|
1491
|
+
*
|
|
1492
|
+
* Note: This is a client-side filter, not server-side search
|
|
1493
|
+
* For production, implement server-side search endpoint
|
|
1494
|
+
*/
|
|
1495
|
+
searchByExternalId(platform: string, partialId: string): Promise<ApiExternalIdLookup[]>;
|
|
1496
|
+
/**
|
|
1497
|
+
* Set custom API URL
|
|
1498
|
+
*/
|
|
1499
|
+
setApiUrl(apiUrl: string): void;
|
|
1500
|
+
/**
|
|
1501
|
+
* Get current API URL
|
|
1502
|
+
*/
|
|
1503
|
+
getApiUrl(): string;
|
|
1504
|
+
/**
|
|
1505
|
+
* Check API health
|
|
1506
|
+
*/
|
|
1507
|
+
checkHealth(): Promise<{
|
|
1508
|
+
status: string;
|
|
1509
|
+
network: string;
|
|
1510
|
+
rpc: {
|
|
1511
|
+
connected: boolean;
|
|
1512
|
+
latency: number;
|
|
1513
|
+
};
|
|
1514
|
+
}>;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1316
1517
|
/**
|
|
1317
1518
|
* X402 Transaction Indexer
|
|
1318
1519
|
*
|
|
@@ -1708,229 +1909,6 @@ declare class MultiSourceAggregator {
|
|
|
1708
1909
|
isSourceEnabled(source: ReputationSource): boolean;
|
|
1709
1910
|
}
|
|
1710
1911
|
|
|
1711
|
-
/**
|
|
1712
|
-
* PayAI Webhook Handler
|
|
1713
|
-
*
|
|
1714
|
-
* Handles incoming webhooks from PayAI facilitator for payment events.
|
|
1715
|
-
* Converts payment data to reputation records for GhostSpeak's
|
|
1716
|
-
* reputation system.
|
|
1717
|
-
*
|
|
1718
|
-
* @module payai/PayAIWebhookHandler
|
|
1719
|
-
* @see https://docs.payai.network/x402/introduction
|
|
1720
|
-
*/
|
|
1721
|
-
|
|
1722
|
-
/**
|
|
1723
|
-
* PayAI Webhook Handler
|
|
1724
|
-
*
|
|
1725
|
-
* Processes incoming PayAI webhooks and converts payment events
|
|
1726
|
-
* to reputation records for the GhostSpeak reputation system.
|
|
1727
|
-
*
|
|
1728
|
-
* @example
|
|
1729
|
-
* ```typescript
|
|
1730
|
-
* const handler = new PayAIWebhookHandler({
|
|
1731
|
-
* webhookSecret: process.env.PAYAI_WEBHOOK_SECRET,
|
|
1732
|
-
* onRecordReputation: async (record) => {
|
|
1733
|
-
* await reputationModule.recordPayAIPayment(record);
|
|
1734
|
-
* }
|
|
1735
|
-
* });
|
|
1736
|
-
*
|
|
1737
|
-
* // In your API route
|
|
1738
|
-
* const result = await handler.handleWebhook(request);
|
|
1739
|
-
* ```
|
|
1740
|
-
*/
|
|
1741
|
-
declare class PayAIWebhookHandler extends EventEmitter {
|
|
1742
|
-
private readonly options;
|
|
1743
|
-
private readonly verifySignatures;
|
|
1744
|
-
private readonly authorizationModule?;
|
|
1745
|
-
private readonly payAIFacilitatorAddress?;
|
|
1746
|
-
constructor(options?: PayAIWebhookHandlerOptions, authorizationModule?: AuthorizationModule, payAIFacilitatorAddress?: Address$1);
|
|
1747
|
-
/**
|
|
1748
|
-
* Handle an incoming webhook request
|
|
1749
|
-
*
|
|
1750
|
-
* @param request - The incoming HTTP request (must have headers and body)
|
|
1751
|
-
* @returns Processing result
|
|
1752
|
-
*/
|
|
1753
|
-
handleWebhook(request: {
|
|
1754
|
-
headers: Headers | Record<string, string | undefined>;
|
|
1755
|
-
body: string | PayAIWebhookPayload;
|
|
1756
|
-
}): Promise<PayAIWebhookResult>;
|
|
1757
|
-
/**
|
|
1758
|
-
* Verify webhook signature
|
|
1759
|
-
*/
|
|
1760
|
-
verifySignature(headers: Headers | Record<string, string | undefined>, body: string): Promise<PayAIWebhookVerification>;
|
|
1761
|
-
/**
|
|
1762
|
-
* Convert a PayAI payment to a reputation record
|
|
1763
|
-
*/
|
|
1764
|
-
paymentToReputationRecord(data: PayAIPaymentData): PayAIReputationRecord;
|
|
1765
|
-
/**
|
|
1766
|
-
* Process a verified webhook payload
|
|
1767
|
-
*/
|
|
1768
|
-
private processPayload;
|
|
1769
|
-
/**
|
|
1770
|
-
* Verify on-chain authorization for an agent
|
|
1771
|
-
*
|
|
1772
|
-
* Checks if the agent has pre-authorized the PayAI facilitator
|
|
1773
|
-
* to update their reputation on-chain.
|
|
1774
|
-
*/
|
|
1775
|
-
private verifyOnChainAuthorization;
|
|
1776
|
-
/**
|
|
1777
|
-
* Compute HMAC-SHA256 signature for a webhook payload
|
|
1778
|
-
*/
|
|
1779
|
-
private computeSignature;
|
|
1780
|
-
}
|
|
1781
|
-
/**
|
|
1782
|
-
* Create a new PayAI webhook handler
|
|
1783
|
-
*
|
|
1784
|
-
* @param options - Handler configuration
|
|
1785
|
-
* @returns Configured webhook handler
|
|
1786
|
-
*/
|
|
1787
|
-
declare function createPayAIWebhookHandler(options?: PayAIWebhookHandlerOptions): PayAIWebhookHandler;
|
|
1788
|
-
/**
|
|
1789
|
-
* Generate a webhook signature for testing
|
|
1790
|
-
* (Useful for local development and testing)
|
|
1791
|
-
*/
|
|
1792
|
-
declare function generateTestWebhookSignature(body: string, secret: string, timestamp?: number): {
|
|
1793
|
-
signature: string;
|
|
1794
|
-
timestamp: string;
|
|
1795
|
-
};
|
|
1796
|
-
/**
|
|
1797
|
-
* Create a mock PayAI webhook payload for testing
|
|
1798
|
-
*/
|
|
1799
|
-
declare function createMockPayAIWebhook(overrides?: Partial<PayAIPaymentData>): PayAIWebhookPayload;
|
|
1800
|
-
|
|
1801
|
-
/**
|
|
1802
|
-
* PayAI Agent Sync
|
|
1803
|
-
*
|
|
1804
|
-
* Utility for syncing GhostSpeak agents with PayAI marketplace.
|
|
1805
|
-
* Allows agents registered in GhostSpeak to be discovered via
|
|
1806
|
-
* PayAI's facilitator network.
|
|
1807
|
-
*
|
|
1808
|
-
* @module payai/PayAIAgentSync
|
|
1809
|
-
*/
|
|
1810
|
-
|
|
1811
|
-
/**
|
|
1812
|
-
* Agent sync configuration
|
|
1813
|
-
*/
|
|
1814
|
-
interface PayAIAgentSyncConfig {
|
|
1815
|
-
/** PayAI marketplace API URL */
|
|
1816
|
-
marketplaceUrl?: string;
|
|
1817
|
-
/** API key for PayAI marketplace (if required) */
|
|
1818
|
-
apiKey?: string;
|
|
1819
|
-
/** Network to register agents on */
|
|
1820
|
-
network?: PayAINetwork;
|
|
1821
|
-
/** Request timeout in milliseconds */
|
|
1822
|
-
timeout?: number;
|
|
1823
|
-
}
|
|
1824
|
-
/**
|
|
1825
|
-
* Agent sync result
|
|
1826
|
-
*/
|
|
1827
|
-
interface AgentSyncResult {
|
|
1828
|
-
success: boolean;
|
|
1829
|
-
agentId?: string;
|
|
1830
|
-
marketplaceUrl?: string;
|
|
1831
|
-
error?: string;
|
|
1832
|
-
}
|
|
1833
|
-
/**
|
|
1834
|
-
* Agent data from GhostSpeak
|
|
1835
|
-
*/
|
|
1836
|
-
interface GhostSpeakAgentData {
|
|
1837
|
-
/** Agent's Solana address */
|
|
1838
|
-
address: Address$1;
|
|
1839
|
-
/** Agent name */
|
|
1840
|
-
name: string;
|
|
1841
|
-
/** Agent description */
|
|
1842
|
-
description?: string;
|
|
1843
|
-
/** Service capabilities/tags */
|
|
1844
|
-
capabilities: string[];
|
|
1845
|
-
/** x402-enabled service endpoint */
|
|
1846
|
-
serviceEndpoint: string;
|
|
1847
|
-
/** Accepted payment tokens (e.g., USDC, SOL) */
|
|
1848
|
-
acceptedTokens: string[];
|
|
1849
|
-
/** Pricing in USDC (min, max) */
|
|
1850
|
-
pricing?: {
|
|
1851
|
-
minPrice: string;
|
|
1852
|
-
maxPrice: string;
|
|
1853
|
-
currency: string;
|
|
1854
|
-
};
|
|
1855
|
-
/** Agent logo URL */
|
|
1856
|
-
logo?: string;
|
|
1857
|
-
/** Agent website */
|
|
1858
|
-
website?: string;
|
|
1859
|
-
/** Reputation score (0-10000) */
|
|
1860
|
-
reputationScore?: number;
|
|
1861
|
-
}
|
|
1862
|
-
/**
|
|
1863
|
-
* PayAI Agent Sync Manager
|
|
1864
|
-
*
|
|
1865
|
-
* Synchronizes GhostSpeak agents with PayAI marketplace for discovery.
|
|
1866
|
-
*/
|
|
1867
|
-
declare class PayAIAgentSync extends EventEmitter {
|
|
1868
|
-
private readonly config;
|
|
1869
|
-
constructor(config?: PayAIAgentSyncConfig);
|
|
1870
|
-
/**
|
|
1871
|
-
* Register a GhostSpeak agent with PayAI marketplace
|
|
1872
|
-
*
|
|
1873
|
-
* @param agent - Agent data from GhostSpeak
|
|
1874
|
-
* @returns Registration result
|
|
1875
|
-
*/
|
|
1876
|
-
registerAgent(agent: GhostSpeakAgentData): Promise<AgentSyncResult>;
|
|
1877
|
-
/**
|
|
1878
|
-
* Update an agent's registration on PayAI marketplace
|
|
1879
|
-
*
|
|
1880
|
-
* @param agentId - PayAI agent ID
|
|
1881
|
-
* @param agent - Updated agent data
|
|
1882
|
-
* @returns Update result
|
|
1883
|
-
*/
|
|
1884
|
-
updateAgent(agentId: string, agent: Partial<GhostSpeakAgentData>): Promise<AgentSyncResult>;
|
|
1885
|
-
/**
|
|
1886
|
-
* Remove an agent from PayAI marketplace
|
|
1887
|
-
*
|
|
1888
|
-
* @param agentId - PayAI agent ID
|
|
1889
|
-
* @returns Removal result
|
|
1890
|
-
*/
|
|
1891
|
-
removeAgent(agentId: string): Promise<AgentSyncResult>;
|
|
1892
|
-
/**
|
|
1893
|
-
* Check if an agent is registered on PayAI marketplace
|
|
1894
|
-
*
|
|
1895
|
-
* @param agentAddress - Agent's Solana address
|
|
1896
|
-
* @returns Whether agent is registered
|
|
1897
|
-
*/
|
|
1898
|
-
isAgentRegistered(agentAddress: Address$1): Promise<boolean>;
|
|
1899
|
-
/**
|
|
1900
|
-
* Get agent's PayAI marketplace listing
|
|
1901
|
-
*
|
|
1902
|
-
* @param agentAddress - Agent's Solana address
|
|
1903
|
-
* @returns Agent listing or null
|
|
1904
|
-
*/
|
|
1905
|
-
getAgentListing(agentAddress: Address$1): Promise<PayAIAgentRegistration | null>;
|
|
1906
|
-
/**
|
|
1907
|
-
* Sync reputation score to PayAI marketplace
|
|
1908
|
-
*
|
|
1909
|
-
* Updates the agent's reputation score on PayAI based on
|
|
1910
|
-
* GhostSpeak reputation calculations.
|
|
1911
|
-
*
|
|
1912
|
-
* @param agentId - PayAI agent ID
|
|
1913
|
-
* @param reputationScore - New reputation score (0-10000)
|
|
1914
|
-
* @returns Update result
|
|
1915
|
-
*/
|
|
1916
|
-
syncReputationScore(agentId: string, reputationScore: number): Promise<AgentSyncResult>;
|
|
1917
|
-
/**
|
|
1918
|
-
* Convert GhostSpeak agent data to PayAI registration format
|
|
1919
|
-
*/
|
|
1920
|
-
private toPayAIRegistration;
|
|
1921
|
-
/**
|
|
1922
|
-
* Make an authenticated request to PayAI marketplace
|
|
1923
|
-
*/
|
|
1924
|
-
private makeRequest;
|
|
1925
|
-
}
|
|
1926
|
-
/**
|
|
1927
|
-
* Create a PayAI agent sync manager
|
|
1928
|
-
*
|
|
1929
|
-
* @param config - Sync configuration
|
|
1930
|
-
* @returns Configured sync manager
|
|
1931
|
-
*/
|
|
1932
|
-
declare function createPayAIAgentSync(config?: PayAIAgentSyncConfig): PayAIAgentSync;
|
|
1933
|
-
|
|
1934
1912
|
/**
|
|
1935
1913
|
* This file is auto-generated by scripts/generate-mappings.ts
|
|
1936
1914
|
* Do not edit this file manually.
|
|
@@ -2605,4 +2583,4 @@ declare function checkFeatureGate(rpc: Rpc<GetAccountInfoApi>, featureGate: Addr
|
|
|
2605
2583
|
*/
|
|
2606
2584
|
declare function clearFeatureGateCache(): void;
|
|
2607
2585
|
|
|
2608
|
-
export { type
|
|
2586
|
+
export { type AggregatedReputation, type ApiResolverConfig, type ArbitratorDecision, BaseReputationAdapter, type BatchFetchConfig, type BatchProgressCallback, CircuitBreaker, ClientEncryptionService, ContentStorageResult, DEFAULT_IPFS_CONFIG, DEFAULT_RETRY_CONFIG, type DeliverySubmittedEvent, type DisputeFiledEvent, type DisputeResolvedEvent, type EscrowCompletedEvent, type EscrowCreatedEvent, EscrowStatus, ExtendedRpcApi, ExternalIdResolver, FEATURE_GATES, FallbackHandler, type FeatureStatus, type FundingResult, type FundingStrategyOptions, GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, type GhostProtectEscrow, type GhostSlashedEvent, type GhostStakedEvent, type GhostUnstakedEvent, INSTRUCTION_MAPPINGS, IPFSClient, IPFSConfig, IPFSContentMetadata, IPFSError, IPFSErrorHandler, IPFSOperationError, IPFSOperationResult, IPFSProvider, IPFSUploadOptions, IPFSUtils, InstructionValidationError, LocalStorageProvider, MetricVisibility, MultiSourceAggregator, type PrivacyManifest, PrivacyMode, PrivacySettings, PrivateDataQuery, type PrivateDataReference, PrivateMetadataStorage, ReputationSource, type ReputationSourceAdapter, type ReputationSourceConfig, type ReputationTagsUpdatedEvent, RetryHandler, RpcClient, ScoreRange, type SignatureInfo, SlashReason, type SourceReputationData, type SourceScoreBreakdown, type StorageProvider, type StoredPrivateData, TEST_IPFS_CONFIG, type TagDecayAppliedEvent, type TagScore, VisibleReputation, WalletFundingService, type X402IndexerConfig, type X402PaymentData, X402TransactionIndexer, batchGetAccounts, batchGetAccountsWithRetry, batchGetAndMap, batchGetExistingAccounts, calculateVisibleScore, canViewerAccess, checkFeatureGate, clearFeatureGateCache, createAccountMismatchError, createBatchFetcher, createIPFSErrorHandler, createIPFSUtils, createMetadataUri, createPrivacyManifest, createTestIPFSConfig, debugInstructionCall, defaultFundingService, determineStorageMethod, enhanceErrorMessage, ensureMinimumBalance, estimateStorageCost, filterMetricsByVisibility, fundWallet, generateAccountValidationError, getAccountRequirements, getApproveDeliveryInstruction, getArbitrateDisputeInstruction, getClaimGhostInstruction, getCreateDidDocumentInstructionAsync, getCreateEscrowInstructionAsync, getDeactivateDidDocumentInstructionAsync, getDefaultMetricVisibility, getFileDisputeInstruction, getGhostProtectEscrowDecoder, getInitializeStakingConfigInstructionAsync, getInstructionMapping, getPDAAccounts, getRangeDisplayString, getRegisterAgentInstructionAsync, getReputationTier, getRequiredSigners, getResolveDidDocumentInstructionAsync, getScoreRange, getSlashStakeInstructionAsync, getStakeGhostInstructionAsync, getSubmitDeliveryInstruction, getTierDisplayName, getUnstakeGhostInstructionAsync, getUpdateDidDocumentInstructionAsync, getUpdateReputationTagsInstructionAsync, getWritableAccounts, isIPFSError, isKnownInstruction, validateInstructionAccounts, validatePrivacySettings, withIPFSErrorHandling };
|