@oobe-protocol-labs/synapse-sap-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +882 -0
- package/dist/cjs/constants/index.js +43 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/limits.js +161 -0
- package/dist/cjs/constants/limits.js.map +1 -0
- package/dist/cjs/constants/programs.js +78 -0
- package/dist/cjs/constants/programs.js.map +1 -0
- package/dist/cjs/constants/seeds.js +57 -0
- package/dist/cjs/constants/seeds.js.map +1 -0
- package/dist/cjs/core/client.js +391 -0
- package/dist/cjs/core/client.js.map +1 -0
- package/dist/cjs/core/connection.js +319 -0
- package/dist/cjs/core/connection.js.map +1 -0
- package/dist/cjs/core/index.js +24 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/errors/index.js +334 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/events/index.js +136 -0
- package/dist/cjs/events/index.js.map +1 -0
- package/dist/cjs/idl/index.js +63 -0
- package/dist/cjs/idl/index.js.map +1 -0
- package/dist/cjs/idl/synapse_agent_sap.json +9710 -0
- package/dist/cjs/index.js +147 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/agent.js +272 -0
- package/dist/cjs/modules/agent.js.map +1 -0
- package/dist/cjs/modules/attestation.js +147 -0
- package/dist/cjs/modules/attestation.js.map +1 -0
- package/dist/cjs/modules/base.js +128 -0
- package/dist/cjs/modules/base.js.map +1 -0
- package/dist/cjs/modules/escrow.js +246 -0
- package/dist/cjs/modules/escrow.js.map +1 -0
- package/dist/cjs/modules/feedback.js +166 -0
- package/dist/cjs/modules/feedback.js.map +1 -0
- package/dist/cjs/modules/index.js +35 -0
- package/dist/cjs/modules/index.js.map +1 -0
- package/dist/cjs/modules/indexing.js +375 -0
- package/dist/cjs/modules/indexing.js.map +1 -0
- package/dist/cjs/modules/ledger.js +234 -0
- package/dist/cjs/modules/ledger.js.map +1 -0
- package/dist/cjs/modules/tools.js +319 -0
- package/dist/cjs/modules/tools.js.map +1 -0
- package/dist/cjs/modules/vault.js +410 -0
- package/dist/cjs/modules/vault.js.map +1 -0
- package/dist/cjs/pda/index.js +377 -0
- package/dist/cjs/pda/index.js.map +1 -0
- package/dist/cjs/plugin/index.js +934 -0
- package/dist/cjs/plugin/index.js.map +1 -0
- package/dist/cjs/plugin/protocols.js +282 -0
- package/dist/cjs/plugin/protocols.js.map +1 -0
- package/dist/cjs/plugin/schemas.js +831 -0
- package/dist/cjs/plugin/schemas.js.map +1 -0
- package/dist/cjs/postgres/adapter.js +715 -0
- package/dist/cjs/postgres/adapter.js.map +1 -0
- package/dist/cjs/postgres/index.js +50 -0
- package/dist/cjs/postgres/index.js.map +1 -0
- package/dist/cjs/postgres/serializers.js +381 -0
- package/dist/cjs/postgres/serializers.js.map +1 -0
- package/dist/cjs/postgres/sync.js +221 -0
- package/dist/cjs/postgres/sync.js.map +1 -0
- package/dist/cjs/postgres/types.js +44 -0
- package/dist/cjs/postgres/types.js.map +1 -0
- package/dist/cjs/registries/builder.js +414 -0
- package/dist/cjs/registries/builder.js.map +1 -0
- package/dist/cjs/registries/discovery.js +362 -0
- package/dist/cjs/registries/discovery.js.map +1 -0
- package/dist/cjs/registries/index.js +51 -0
- package/dist/cjs/registries/index.js.map +1 -0
- package/dist/cjs/registries/session.js +433 -0
- package/dist/cjs/registries/session.js.map +1 -0
- package/dist/cjs/registries/x402.js +577 -0
- package/dist/cjs/registries/x402.js.map +1 -0
- package/dist/cjs/types/accounts.js +13 -0
- package/dist/cjs/types/accounts.js.map +1 -0
- package/dist/cjs/types/common.js +13 -0
- package/dist/cjs/types/common.js.map +1 -0
- package/dist/cjs/types/enums.js +174 -0
- package/dist/cjs/types/enums.js.map +1 -0
- package/dist/cjs/types/index.js +36 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/instructions.js +92 -0
- package/dist/cjs/types/instructions.js.map +1 -0
- package/dist/cjs/utils/hash.js +58 -0
- package/dist/cjs/utils/hash.js.map +1 -0
- package/dist/cjs/utils/index.js +27 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/serialization.js +105 -0
- package/dist/cjs/utils/serialization.js.map +1 -0
- package/dist/cjs/utils/validation.js +36 -0
- package/dist/cjs/utils/validation.js.map +1 -0
- package/dist/esm/constants/index.js +29 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/limits.js +158 -0
- package/dist/esm/constants/limits.js.map +1 -0
- package/dist/esm/constants/programs.js +75 -0
- package/dist/esm/constants/programs.js.map +1 -0
- package/dist/esm/constants/seeds.js +54 -0
- package/dist/esm/constants/seeds.js.map +1 -0
- package/dist/esm/core/client.js +384 -0
- package/dist/esm/core/client.js.map +1 -0
- package/dist/esm/core/connection.js +315 -0
- package/dist/esm/core/connection.js.map +1 -0
- package/dist/esm/core/index.js +19 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/errors/index.js +325 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/events/index.js +132 -0
- package/dist/esm/events/index.js.map +1 -0
- package/dist/esm/idl/index.js +57 -0
- package/dist/esm/idl/index.js.map +1 -0
- package/dist/esm/idl/synapse_agent_sap.json +9710 -0
- package/dist/esm/index.js +70 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/modules/agent.js +268 -0
- package/dist/esm/modules/agent.js.map +1 -0
- package/dist/esm/modules/attestation.js +143 -0
- package/dist/esm/modules/attestation.js.map +1 -0
- package/dist/esm/modules/base.js +124 -0
- package/dist/esm/modules/base.js.map +1 -0
- package/dist/esm/modules/escrow.js +242 -0
- package/dist/esm/modules/escrow.js.map +1 -0
- package/dist/esm/modules/feedback.js +162 -0
- package/dist/esm/modules/feedback.js.map +1 -0
- package/dist/esm/modules/index.js +23 -0
- package/dist/esm/modules/index.js.map +1 -0
- package/dist/esm/modules/indexing.js +371 -0
- package/dist/esm/modules/indexing.js.map +1 -0
- package/dist/esm/modules/ledger.js +230 -0
- package/dist/esm/modules/ledger.js.map +1 -0
- package/dist/esm/modules/tools.js +315 -0
- package/dist/esm/modules/tools.js.map +1 -0
- package/dist/esm/modules/vault.js +406 -0
- package/dist/esm/modules/vault.js.map +1 -0
- package/dist/esm/pda/index.js +357 -0
- package/dist/esm/pda/index.js.map +1 -0
- package/dist/esm/plugin/index.js +927 -0
- package/dist/esm/plugin/index.js.map +1 -0
- package/dist/esm/plugin/protocols.js +279 -0
- package/dist/esm/plugin/protocols.js.map +1 -0
- package/dist/esm/plugin/schemas.js +828 -0
- package/dist/esm/plugin/schemas.js.map +1 -0
- package/dist/esm/postgres/adapter.js +678 -0
- package/dist/esm/postgres/adapter.js.map +1 -0
- package/dist/esm/postgres/index.js +27 -0
- package/dist/esm/postgres/index.js.map +1 -0
- package/dist/esm/postgres/serializers.js +362 -0
- package/dist/esm/postgres/serializers.js.map +1 -0
- package/dist/esm/postgres/sync.js +217 -0
- package/dist/esm/postgres/sync.js.map +1 -0
- package/dist/esm/postgres/types.js +41 -0
- package/dist/esm/postgres/types.js.map +1 -0
- package/dist/esm/registries/builder.js +410 -0
- package/dist/esm/registries/builder.js.map +1 -0
- package/dist/esm/registries/discovery.js +358 -0
- package/dist/esm/registries/discovery.js.map +1 -0
- package/dist/esm/registries/index.js +44 -0
- package/dist/esm/registries/index.js.map +1 -0
- package/dist/esm/registries/session.js +429 -0
- package/dist/esm/registries/session.js.map +1 -0
- package/dist/esm/registries/x402.js +573 -0
- package/dist/esm/registries/x402.js.map +1 -0
- package/dist/esm/types/accounts.js +12 -0
- package/dist/esm/types/accounts.js.map +1 -0
- package/dist/esm/types/common.js +12 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/enums.js +171 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/index.js +25 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/instructions.js +89 -0
- package/dist/esm/types/instructions.js.map +1 -0
- package/dist/esm/utils/hash.js +53 -0
- package/dist/esm/utils/hash.js.map +1 -0
- package/dist/esm/utils/index.js +19 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/serialization.js +98 -0
- package/dist/esm/utils/serialization.js.map +1 -0
- package/dist/esm/utils/validation.js +33 -0
- package/dist/esm/utils/validation.js.map +1 -0
- package/dist/types/constants/index.d.ts +27 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/constants/limits.d.ts +149 -0
- package/dist/types/constants/limits.d.ts.map +1 -0
- package/dist/types/constants/programs.d.ts +69 -0
- package/dist/types/constants/programs.d.ts.map +1 -0
- package/dist/types/constants/seeds.d.ts +61 -0
- package/dist/types/constants/seeds.d.ts.map +1 -0
- package/dist/types/core/client.d.ts +323 -0
- package/dist/types/core/client.d.ts.map +1 -0
- package/dist/types/core/connection.d.ts +279 -0
- package/dist/types/core/connection.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +20 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +276 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/events/index.d.ts +248 -0
- package/dist/types/events/index.d.ts.map +1 -0
- package/dist/types/idl/index.d.ts +70 -0
- package/dist/types/idl/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +68 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/agent.d.ts +166 -0
- package/dist/types/modules/agent.d.ts.map +1 -0
- package/dist/types/modules/attestation.d.ts +96 -0
- package/dist/types/modules/attestation.d.ts.map +1 -0
- package/dist/types/modules/base.d.ts +126 -0
- package/dist/types/modules/base.d.ts.map +1 -0
- package/dist/types/modules/escrow.d.ts +151 -0
- package/dist/types/modules/escrow.d.ts.map +1 -0
- package/dist/types/modules/feedback.d.ts +105 -0
- package/dist/types/modules/feedback.d.ts.map +1 -0
- package/dist/types/modules/index.d.ts +24 -0
- package/dist/types/modules/index.d.ts.map +1 -0
- package/dist/types/modules/indexing.d.ts +200 -0
- package/dist/types/modules/indexing.d.ts.map +1 -0
- package/dist/types/modules/ledger.d.ts +150 -0
- package/dist/types/modules/ledger.d.ts.map +1 -0
- package/dist/types/modules/tools.d.ts +182 -0
- package/dist/types/modules/tools.d.ts.map +1 -0
- package/dist/types/modules/vault.d.ts +240 -0
- package/dist/types/modules/vault.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +296 -0
- package/dist/types/pda/index.d.ts.map +1 -0
- package/dist/types/plugin/index.d.ts +171 -0
- package/dist/types/plugin/index.d.ts.map +1 -0
- package/dist/types/plugin/protocols.d.ts +152 -0
- package/dist/types/plugin/protocols.d.ts.map +1 -0
- package/dist/types/plugin/schemas.d.ts +823 -0
- package/dist/types/plugin/schemas.d.ts.map +1 -0
- package/dist/types/postgres/adapter.d.ts +355 -0
- package/dist/types/postgres/adapter.d.ts.map +1 -0
- package/dist/types/postgres/index.d.ts +24 -0
- package/dist/types/postgres/index.d.ts.map +1 -0
- package/dist/types/postgres/serializers.d.ts +30 -0
- package/dist/types/postgres/serializers.d.ts.map +1 -0
- package/dist/types/postgres/sync.d.ts +132 -0
- package/dist/types/postgres/sync.d.ts.map +1 -0
- package/dist/types/postgres/types.d.ts +167 -0
- package/dist/types/postgres/types.d.ts.map +1 -0
- package/dist/types/registries/builder.d.ts +340 -0
- package/dist/types/registries/builder.d.ts.map +1 -0
- package/dist/types/registries/discovery.d.ts +333 -0
- package/dist/types/registries/discovery.d.ts.map +1 -0
- package/dist/types/registries/index.d.ts +48 -0
- package/dist/types/registries/index.d.ts.map +1 -0
- package/dist/types/registries/session.d.ts +323 -0
- package/dist/types/registries/session.d.ts.map +1 -0
- package/dist/types/registries/x402.d.ts +463 -0
- package/dist/types/registries/x402.d.ts.map +1 -0
- package/dist/types/types/accounts.d.ts +565 -0
- package/dist/types/types/accounts.d.ts.map +1 -0
- package/dist/types/types/common.d.ts +166 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/enums.d.ts +238 -0
- package/dist/types/types/enums.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +28 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/instructions.d.ts +366 -0
- package/dist/types/types/instructions.d.ts.map +1 -0
- package/dist/types/utils/hash.d.ts +48 -0
- package/dist/types/utils/hash.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +19 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/serialization.d.ts +69 -0
- package/dist/types/utils/serialization.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +29 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/package.json +178 -0
- package/src/constants/index.ts +44 -0
- package/src/constants/limits.ts +165 -0
- package/src/constants/programs.ts +83 -0
- package/src/constants/seeds.ts +66 -0
- package/src/core/client.ts +416 -0
- package/src/core/connection.ts +409 -0
- package/src/core/index.ts +20 -0
- package/src/errors/index.ts +346 -0
- package/src/events/index.ts +335 -0
- package/src/idl/index.ts +76 -0
- package/src/idl/synapse_agent_sap.json +9710 -0
- package/src/index.ts +253 -0
- package/src/modules/agent.ts +319 -0
- package/src/modules/attestation.ts +168 -0
- package/src/modules/base.ts +158 -0
- package/src/modules/escrow.ts +308 -0
- package/src/modules/feedback.ts +186 -0
- package/src/modules/index.ts +24 -0
- package/src/modules/indexing.ts +444 -0
- package/src/modules/ledger.ts +262 -0
- package/src/modules/tools.ts +411 -0
- package/src/modules/vault.ts +533 -0
- package/src/pda/index.ts +512 -0
- package/src/plugin/index.ts +1202 -0
- package/src/plugin/protocols.ts +404 -0
- package/src/plugin/schemas.ts +909 -0
- package/src/postgres/adapter.ts +904 -0
- package/src/postgres/index.ts +59 -0
- package/src/postgres/schema.sql +683 -0
- package/src/postgres/serializers.ts +485 -0
- package/src/postgres/sync.ts +254 -0
- package/src/postgres/types.ts +245 -0
- package/src/registries/builder.ts +607 -0
- package/src/registries/discovery.ts +572 -0
- package/src/registries/index.ts +77 -0
- package/src/registries/session.ts +613 -0
- package/src/registries/x402.ts +906 -0
- package/src/types/accounts.ts +618 -0
- package/src/types/common.ts +187 -0
- package/src/types/enums.ts +214 -0
- package/src/types/index.ts +92 -0
- package/src/types/instructions.ts +413 -0
- package/src/utils/hash.ts +57 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/serialization.ts +98 -0
- package/src/utils/validation.ts +36 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module events
|
|
3
|
+
* @description Decode SAP v2 events from transaction logs.
|
|
4
|
+
*
|
|
5
|
+
* Uses Anchor's event parser under the hood. Provides a
|
|
6
|
+
* strongly-typed, filterable event stream.
|
|
7
|
+
*
|
|
8
|
+
* @category Events
|
|
9
|
+
* @since v0.1.0
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { EventParser } from "@synapse-sap/sdk/events";
|
|
14
|
+
*
|
|
15
|
+
* const events = client.events.parseLogs(txLogs);
|
|
16
|
+
* for (const event of events) {
|
|
17
|
+
* if (event.name === "PaymentSettledEvent") {
|
|
18
|
+
* console.log(event.data);
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import { type Program, BN } from "@coral-xyz/anchor";
|
|
24
|
+
import type { PublicKey } from "@solana/web3.js";
|
|
25
|
+
/**
|
|
26
|
+
* Decoded payload for the `RegisteredEvent` emitted when a new agent is registered.
|
|
27
|
+
*
|
|
28
|
+
* @interface RegisteredEventData
|
|
29
|
+
* @name RegisteredEventData
|
|
30
|
+
* @description Contains the agent PDA, owner wallet, display name, capabilities list, and timestamp.
|
|
31
|
+
* @category Events
|
|
32
|
+
* @since v0.1.0
|
|
33
|
+
* @see {@link SapEvent}
|
|
34
|
+
*/
|
|
35
|
+
export interface RegisteredEventData {
|
|
36
|
+
readonly name: "RegisteredEvent";
|
|
37
|
+
readonly data: {
|
|
38
|
+
agent: PublicKey;
|
|
39
|
+
wallet: PublicKey;
|
|
40
|
+
name: string;
|
|
41
|
+
capabilities: string[];
|
|
42
|
+
timestamp: BN;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Decoded payload for the `UpdatedEvent` emitted when an agent’s profile is modified.
|
|
47
|
+
*
|
|
48
|
+
* @interface UpdatedEventData
|
|
49
|
+
* @name UpdatedEventData
|
|
50
|
+
* @description Contains the agent PDA, owner wallet, a list of changed field names, and timestamp.
|
|
51
|
+
* @category Events
|
|
52
|
+
* @since v0.1.0
|
|
53
|
+
* @see {@link SapEvent}
|
|
54
|
+
*/
|
|
55
|
+
export interface UpdatedEventData {
|
|
56
|
+
readonly name: "UpdatedEvent";
|
|
57
|
+
readonly data: {
|
|
58
|
+
agent: PublicKey;
|
|
59
|
+
wallet: PublicKey;
|
|
60
|
+
updatedFields: string[];
|
|
61
|
+
timestamp: BN;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Decoded payload for the `FeedbackEvent` emitted when a reviewer submits feedback.
|
|
66
|
+
*
|
|
67
|
+
* @interface FeedbackEventData
|
|
68
|
+
* @name FeedbackEventData
|
|
69
|
+
* @description Contains the agent PDA, reviewer wallet, numeric score, tag, and timestamp.
|
|
70
|
+
* @category Events
|
|
71
|
+
* @since v0.1.0
|
|
72
|
+
* @see {@link SapEvent}
|
|
73
|
+
*/
|
|
74
|
+
export interface FeedbackEventData {
|
|
75
|
+
readonly name: "FeedbackEvent";
|
|
76
|
+
readonly data: {
|
|
77
|
+
agent: PublicKey;
|
|
78
|
+
reviewer: PublicKey;
|
|
79
|
+
score: number;
|
|
80
|
+
tag: string;
|
|
81
|
+
timestamp: BN;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Decoded payload for the `MemoryInscribedEvent` emitted when data is written to a vault.
|
|
86
|
+
*
|
|
87
|
+
* @interface MemoryInscribedEventData
|
|
88
|
+
* @name MemoryInscribedEventData
|
|
89
|
+
* @description Contains vault/session PDAs, sequence info, encrypted data, nonce, content hash,
|
|
90
|
+
* fragment metadata, compression flag, and timestamp.
|
|
91
|
+
* @category Events
|
|
92
|
+
* @since v0.1.0
|
|
93
|
+
* @see {@link SapEvent}
|
|
94
|
+
*/
|
|
95
|
+
export interface MemoryInscribedEventData {
|
|
96
|
+
readonly name: "MemoryInscribedEvent";
|
|
97
|
+
readonly data: {
|
|
98
|
+
vault: PublicKey;
|
|
99
|
+
session: PublicKey;
|
|
100
|
+
sequence: number;
|
|
101
|
+
epochIndex: number;
|
|
102
|
+
encryptedData: number[];
|
|
103
|
+
nonce: number[];
|
|
104
|
+
contentHash: number[];
|
|
105
|
+
totalFragments: number;
|
|
106
|
+
fragmentIndex: number;
|
|
107
|
+
compression: number;
|
|
108
|
+
dataLen: number;
|
|
109
|
+
nonceVersion: number;
|
|
110
|
+
timestamp: BN;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Decoded payload for the `PaymentSettledEvent` emitted when an escrow settlement occurs.
|
|
115
|
+
*
|
|
116
|
+
* @interface PaymentSettledEventData
|
|
117
|
+
* @name PaymentSettledEventData
|
|
118
|
+
* @description Contains escrow/agent/depositor PDAs, settlement counts, amounts, service hash,
|
|
119
|
+
* and remaining balance.
|
|
120
|
+
* @category Events
|
|
121
|
+
* @since v0.1.0
|
|
122
|
+
* @see {@link SapEvent}
|
|
123
|
+
*/
|
|
124
|
+
export interface PaymentSettledEventData {
|
|
125
|
+
readonly name: "PaymentSettledEvent";
|
|
126
|
+
readonly data: {
|
|
127
|
+
escrow: PublicKey;
|
|
128
|
+
agent: PublicKey;
|
|
129
|
+
depositor: PublicKey;
|
|
130
|
+
callsSettled: BN;
|
|
131
|
+
amount: BN;
|
|
132
|
+
serviceHash: number[];
|
|
133
|
+
totalCallsSettled: BN;
|
|
134
|
+
remainingBalance: BN;
|
|
135
|
+
timestamp: BN;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Decoded payload for the `LedgerEntryEvent` emitted when data is appended to a ledger.
|
|
140
|
+
*
|
|
141
|
+
* @interface LedgerEntryEventData
|
|
142
|
+
* @name LedgerEntryEventData
|
|
143
|
+
* @description Contains session/ledger PDAs, entry index, raw data, content hash,
|
|
144
|
+
* Merkle root, and timestamp.
|
|
145
|
+
* @category Events
|
|
146
|
+
* @since v0.1.0
|
|
147
|
+
* @see {@link SapEvent}
|
|
148
|
+
*/
|
|
149
|
+
export interface LedgerEntryEventData {
|
|
150
|
+
readonly name: "LedgerEntryEvent";
|
|
151
|
+
readonly data: {
|
|
152
|
+
session: PublicKey;
|
|
153
|
+
ledger: PublicKey;
|
|
154
|
+
entryIndex: number;
|
|
155
|
+
data: number[];
|
|
156
|
+
contentHash: number[];
|
|
157
|
+
dataLen: number;
|
|
158
|
+
merkleRoot: number[];
|
|
159
|
+
timestamp: BN;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Discriminated union of all known SAP v2 event types.
|
|
164
|
+
*
|
|
165
|
+
* @name SapEvent
|
|
166
|
+
* @description Use the `name` discriminant to narrow to a specific event payload.
|
|
167
|
+
* @category Events
|
|
168
|
+
* @since v0.1.0
|
|
169
|
+
*/
|
|
170
|
+
export type SapEvent = RegisteredEventData | UpdatedEventData | FeedbackEventData | MemoryInscribedEventData | PaymentSettledEventData | LedgerEntryEventData;
|
|
171
|
+
/**
|
|
172
|
+
* Exhaustive list of all SAP v2 event name strings.
|
|
173
|
+
*
|
|
174
|
+
* @name SAP_EVENT_NAMES
|
|
175
|
+
* @description Frozen array of every event discriminant emitted by the program.
|
|
176
|
+
* Useful for log filtering and exhaustive switch checks.
|
|
177
|
+
* @category Events
|
|
178
|
+
* @since v0.1.0
|
|
179
|
+
* @see {@link SapEventName}
|
|
180
|
+
*/
|
|
181
|
+
export declare const SAP_EVENT_NAMES: readonly ["RegisteredEvent", "UpdatedEvent", "DeactivatedEvent", "ReactivatedEvent", "ClosedEvent", "FeedbackEvent", "FeedbackUpdatedEvent", "FeedbackRevokedEvent", "ReputationUpdatedEvent", "CallsReportedEvent", "VaultInitializedEvent", "SessionOpenedEvent", "MemoryInscribedEvent", "EpochOpenedEvent", "SessionClosedEvent", "VaultClosedEvent", "SessionPdaClosedEvent", "EpochPageClosedEvent", "VaultNonceRotatedEvent", "DelegateAddedEvent", "DelegateRevokedEvent", "ToolPublishedEvent", "ToolSchemaInscribedEvent", "ToolUpdatedEvent", "ToolDeactivatedEvent", "ToolReactivatedEvent", "ToolClosedEvent", "ToolInvocationReportedEvent", "CheckpointCreatedEvent", "EscrowCreatedEvent", "EscrowDepositedEvent", "PaymentSettledEvent", "EscrowWithdrawnEvent", "BatchSettledEvent", "AttestationCreatedEvent", "AttestationRevokedEvent", "LedgerEntryEvent", "LedgerSealedEvent"];
|
|
182
|
+
/**
|
|
183
|
+
* String literal union of all SAP v2 event names.
|
|
184
|
+
*
|
|
185
|
+
* @name SapEventName
|
|
186
|
+
* @description Derived from {@link SAP_EVENT_NAMES} for compile-time exhaustiveness.
|
|
187
|
+
* @category Events
|
|
188
|
+
* @since v0.1.0
|
|
189
|
+
*/
|
|
190
|
+
export type SapEventName = (typeof SAP_EVENT_NAMES)[number];
|
|
191
|
+
/**
|
|
192
|
+
* A single parsed event extracted from transaction logs.
|
|
193
|
+
*
|
|
194
|
+
* @interface ParsedEvent
|
|
195
|
+
* @name ParsedEvent
|
|
196
|
+
* @description Lightweight container with a `name` discriminant and untyped `data` record.
|
|
197
|
+
* Narrow via {@link SapEventName} for type-safe access.
|
|
198
|
+
* @category Events
|
|
199
|
+
* @since v0.1.0
|
|
200
|
+
*/
|
|
201
|
+
export interface ParsedEvent {
|
|
202
|
+
readonly name: string;
|
|
203
|
+
readonly data: Record<string, any>;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Typed wrapper around Anchor’s `EventParser` for SAP v2 programs.
|
|
207
|
+
*
|
|
208
|
+
* Extracts strongly-typed {@link ParsedEvent} objects from raw
|
|
209
|
+
* transaction log lines.
|
|
210
|
+
*
|
|
211
|
+
* @name EventParser
|
|
212
|
+
* @description Instantiate with an Anchor `Program` and call {@link EventParser.parseLogs}
|
|
213
|
+
* to decode events, or {@link EventParser.filterByName} to narrow results.
|
|
214
|
+
* @category Events
|
|
215
|
+
* @since v0.1.0
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* const parser = new EventParser(program);
|
|
220
|
+
* const events = parser.parseLogs(txLogs);
|
|
221
|
+
* const settled = parser.filterByName(events, "PaymentSettledEvent");
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export declare class EventParser {
|
|
225
|
+
private readonly parser;
|
|
226
|
+
/**
|
|
227
|
+
* Create a new `EventParser`.
|
|
228
|
+
*
|
|
229
|
+
* @param program - An Anchor `Program` instance whose IDL defines the events to decode.
|
|
230
|
+
*/
|
|
231
|
+
constructor(program: Program<any>);
|
|
232
|
+
/**
|
|
233
|
+
* Parse raw transaction log lines into typed events.
|
|
234
|
+
*
|
|
235
|
+
* @param logs - Array of log strings from a confirmed transaction.
|
|
236
|
+
* @returns {ParsedEvent[]} Decoded events found in the logs.
|
|
237
|
+
*/
|
|
238
|
+
parseLogs(logs: string[]): ParsedEvent[];
|
|
239
|
+
/**
|
|
240
|
+
* Filter a list of parsed events by event name.
|
|
241
|
+
*
|
|
242
|
+
* @param events - The full array of {@link ParsedEvent} objects to filter.
|
|
243
|
+
* @param name - The {@link SapEventName} to match against.
|
|
244
|
+
* @returns {ParsedEvent[]} Only events whose `name` matches.
|
|
245
|
+
*/
|
|
246
|
+
filterByName<N extends SapEventName>(events: ParsedEvent[], name: N): ParsedEvent[];
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":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AwB,GACxB,uBAAuB,GACvB,oBAAoB,CAAC;AAMzB;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,u2BAuClB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAM5D;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C;;;;OAIG;gBAES,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;IAIjC;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE;IASxC;;;;;;OAMG;IACH,YAAY,CAAC,CAAC,SAAS,YAAY,EACjC,MAAM,EAAE,WAAW,EAAE,EACrB,IAAI,EAAE,CAAC,GACN,WAAW,EAAE;CAGjB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module idl
|
|
3
|
+
* @description Embedded IDL for the SAP v2 program.
|
|
4
|
+
*
|
|
5
|
+
* The JSON artifact is bundled with the SDK so it works as a
|
|
6
|
+
* standalone package without needing the program workspace.
|
|
7
|
+
*
|
|
8
|
+
* ### Updating the IDL
|
|
9
|
+
*
|
|
10
|
+
* After rebuilding the Anchor program, run:
|
|
11
|
+
* ```sh
|
|
12
|
+
* yarn sync-idl # copies from ../target/idl/
|
|
13
|
+
* ```
|
|
14
|
+
* or manually copy the file into `src/idl/synapse_agent_sap.json`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { SAP_IDL, type SynapseAgentSapIDL } from "@synapse-sap/sdk/idl";
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @category IDL
|
|
22
|
+
* @since v0.1.0
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* TypeScript type representing the Anchor IDL for the `synapse_agent_sap` program.
|
|
26
|
+
*
|
|
27
|
+
* @name SynapseAgentSapIDL
|
|
28
|
+
* @description Anchor IDL type derived from the bundled JSON artifact.
|
|
29
|
+
* Automatically stays in sync with the program — no manual maintenance needed.
|
|
30
|
+
* @category IDL
|
|
31
|
+
* @since v0.1.0
|
|
32
|
+
*/
|
|
33
|
+
export type SynapseAgentSapIDL = any;
|
|
34
|
+
/**
|
|
35
|
+
* The complete Anchor IDL object for the `synapse_agent_sap` program.
|
|
36
|
+
*
|
|
37
|
+
* @name SAP_IDL
|
|
38
|
+
* @description Pre-loaded IDL JSON artifact bundled with the SDK.
|
|
39
|
+
* Can be passed directly to `new anchor.Program()` or used for
|
|
40
|
+
* instruction introspection.
|
|
41
|
+
* @category IDL
|
|
42
|
+
* @since v0.1.0
|
|
43
|
+
*/
|
|
44
|
+
export declare const SAP_IDL: any;
|
|
45
|
+
/**
|
|
46
|
+
* Program address embedded in the IDL metadata.
|
|
47
|
+
*
|
|
48
|
+
* @name IDL_PROGRAM_ADDRESS
|
|
49
|
+
* @description The deployed program address as declared in the Anchor IDL.
|
|
50
|
+
* @category IDL
|
|
51
|
+
* @since v0.1.0
|
|
52
|
+
*/
|
|
53
|
+
export declare const IDL_PROGRAM_ADDRESS: string;
|
|
54
|
+
/**
|
|
55
|
+
* IDL metadata block (name, version, spec, description).
|
|
56
|
+
*
|
|
57
|
+
* @name IDL_METADATA
|
|
58
|
+
* @description Anchor IDL metadata containing program name, version string,
|
|
59
|
+
* spec version, and human-readable description.
|
|
60
|
+
* @category IDL
|
|
61
|
+
* @since v0.1.0
|
|
62
|
+
*/
|
|
63
|
+
export declare const IDL_METADATA: {
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
spec: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
export default SAP_IDL;
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/idl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH;;;;;;;;GAQG;AAEH,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAErC;;;;;;;;;GASG;AAEH,eAAO,MAAM,OAAO,EAAc,GAAG,CAAC;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;;;;;CAAmB,CAAC;AAE7C,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synapse-sap/sdk — TypeScript SDK for SAP v2 (Solana Agent Protocol)
|
|
3
|
+
*
|
|
4
|
+
* Modular architecture:
|
|
5
|
+
*
|
|
6
|
+
* | Path | Description |
|
|
7
|
+
* |-------------------|-----------------------------------------------|
|
|
8
|
+
* | `core/` | SapClient, SapConnection (RPC factory) |
|
|
9
|
+
* | `types/` | On-chain enums, account data, instruction DTOs|
|
|
10
|
+
* | `constants/` | Program IDs, PDA seeds, size limits |
|
|
11
|
+
* | `pda/` | Deterministic PDA derivation helpers |
|
|
12
|
+
* | `events/` | Transaction-log event parser |
|
|
13
|
+
* | `errors/` | Typed SDK error classes |
|
|
14
|
+
* | `utils/` | Hashing, validation, serialization |
|
|
15
|
+
* | `modules/` | Low-level per-domain instruction wrappers |
|
|
16
|
+
* | `registries/` | High-level abstractions (discovery, x402, …) |
|
|
17
|
+
* | `plugin/` | SynapseAgentKit adapter (52 tools) |
|
|
18
|
+
* | `idl/` | Embedded Anchor IDL |
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { SapClient, SapConnection } from "@synapse-sap/sdk";
|
|
23
|
+
*
|
|
24
|
+
* // Quick start — from Anchor provider
|
|
25
|
+
* const client = SapClient.from(provider);
|
|
26
|
+
*
|
|
27
|
+
* // Or from RPC URL (synapse-client-sdk compatible)
|
|
28
|
+
* const conn = SapConnection.devnet();
|
|
29
|
+
* const client2 = conn.fromKeypair(keypair);
|
|
30
|
+
*
|
|
31
|
+
* // Use domain modules:
|
|
32
|
+
* await client.agent.register({ ... });
|
|
33
|
+
* await client.escrow.create(agentWallet, { ... });
|
|
34
|
+
* await client.ledger.write(sessionPda, data, contentHash);
|
|
35
|
+
*
|
|
36
|
+
* // Use registries (high-level):
|
|
37
|
+
* const agents = await client.discovery.findAgentsByProtocol("jupiter");
|
|
38
|
+
* const ctx = await client.session.start("conv-123");
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @packageDocumentation
|
|
42
|
+
* @category SDK
|
|
43
|
+
* @since v0.1.0
|
|
44
|
+
*/
|
|
45
|
+
export { SapClient, SapConnection } from "./core";
|
|
46
|
+
export type { SapCluster, SapConnectionConfig } from "./core";
|
|
47
|
+
export type { TokenTypeKind, PluginTypeKind, SettlementModeKind, ToolHttpMethodKind, ToolCategoryKind, DelegatePermissionBit, SchemaTypeValue, CompressionTypeValue, Capability, VolumeCurveBreakpoint, PricingTier, PluginRef, Settlement, AgentAccountData, FeedbackAccountData, CapabilityIndexData, ProtocolIndexData, GlobalRegistryData, MemoryVaultData, SessionLedgerData, EpochPageData, VaultDelegateData, ToolDescriptorData, SessionCheckpointData, EscrowAccountData, AgentStatsData, ToolCategoryIndexData, AgentAttestationData, MemoryLedgerData, LedgerPageData, RegisterAgentArgs, UpdateAgentArgs, GiveFeedbackArgs, UpdateFeedbackArgs, PublishToolArgs, UpdateToolArgs, InscribeMemoryArgs, CompactInscribeArgs, CreateEscrowArgs, CreateAttestationArgs, InscribeToolSchemaArgs, } from "./types";
|
|
48
|
+
export { TokenType, PluginType, SettlementMode, ToolHttpMethod, ToolCategory, DelegatePermission, SchemaType, CompressionType, } from "./types";
|
|
49
|
+
export { SAP_PROGRAM_ADDRESS, SAP_PROGRAM_ID, MAINNET_SAP_PROGRAM_ID, DEVNET_SAP_PROGRAM_ID, LOCALNET_SAP_PROGRAM_ID, SEEDS, LIMITS, AGENT_VERSION, VAULT_PROTOCOL_VERSION, TOOL_CATEGORY_VALUES, HTTP_METHOD_VALUES, } from "./constants";
|
|
50
|
+
export { SAP_IDL, IDL_PROGRAM_ADDRESS, IDL_METADATA } from "./idl/index";
|
|
51
|
+
export type { SynapseAgentSapIDL } from "./idl/index";
|
|
52
|
+
export { deriveGlobalRegistry, deriveAgent, deriveAgentStats, deriveFeedback, deriveCapabilityIndex, deriveProtocolIndex, deriveToolCategoryIndex, deriveVault, deriveSession, deriveEpochPage, deriveVaultDelegate, deriveCheckpoint, deriveTool, deriveEscrow, deriveAttestation, deriveLedger, deriveLedgerPage, } from "./pda";
|
|
53
|
+
export { sha256, hashToArray, assert } from "./utils";
|
|
54
|
+
export { serializeAccount, serializeValue } from "./utils";
|
|
55
|
+
export { SapError, SapValidationError, SapRpcError, SapAccountNotFoundError, SapTimeoutError, SapPermissionError, } from "./errors";
|
|
56
|
+
export { EventParser, SAP_EVENT_NAMES } from "./events";
|
|
57
|
+
export type { SapEvent, SapEventName, ParsedEvent, RegisteredEventData, UpdatedEventData, FeedbackEventData, MemoryInscribedEventData, PaymentSettledEventData, LedgerEntryEventData, } from "./events";
|
|
58
|
+
export { AgentModule, FeedbackModule, IndexingModule, ToolsModule, VaultModule, EscrowModule, AttestationModule, LedgerModule, BaseModule, } from "./modules/index";
|
|
59
|
+
export type { SapProgram, SapTransactionResult } from "./modules/base";
|
|
60
|
+
export { createSAPPlugin, SAPPlugin } from "./plugin/index";
|
|
61
|
+
export type { SAPPluginConfig, SynapsePlugin, PluginMeta, PluginContext, PluginInstallResult, } from "./plugin/index";
|
|
62
|
+
export type { ProtocolMethod, PluginProtocol, } from "./plugin/protocols";
|
|
63
|
+
export { SAP_PROTOCOLS } from "./plugin/protocols";
|
|
64
|
+
export { SapPostgres, SapSyncEngine, SAP_TABLE_MAP } from "./postgres";
|
|
65
|
+
export type { PgClient, SyncAllResult, SapAccountType, SyncMeta, AgentRow, EscrowRow, ToolRow, LedgerRow, EventRow, SyncCursorRow, SyncOptions, } from "./postgres";
|
|
66
|
+
export { DiscoveryRegistry, X402Registry, SessionManager, AgentBuilder, } from "./registries/index";
|
|
67
|
+
export type { DiscoveredAgent, AgentProfile, DiscoveredTool, NetworkOverview, ToolCategoryName, CostEstimate, PaymentContext, PreparePaymentOptions, X402Headers, EscrowBalance, SettlementResult, BatchSettlementResult, SessionContext, WriteResult, SealResult, RingBufferEntry, SessionStatus, CapabilityInput, PricingTierInput, ToolInput, RegisterResult, RegisterWithToolsResult, } from "./registries/index";
|
|
68
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAG9D,YAAY,EAEV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EAEpB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,UAAU,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,o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
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module agent
|
|
3
|
+
* @description Agent lifecycle operations for the Solana Agent Protocol.
|
|
4
|
+
*
|
|
5
|
+
* Covers: register, update, deactivate, reactivate, close,
|
|
6
|
+
* report calls, update reputation metrics, and account fetching.
|
|
7
|
+
*
|
|
8
|
+
* @category Modules
|
|
9
|
+
* @since v0.1.0
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import { type PublicKey, type TransactionSignature } from "@solana/web3.js";
|
|
13
|
+
import { BaseModule } from "./base";
|
|
14
|
+
import type { AgentAccountData, AgentStatsData, RegisterAgentArgs, UpdateAgentArgs } from "../types";
|
|
15
|
+
/**
|
|
16
|
+
* @name AgentModule
|
|
17
|
+
* @description Manages the full agent lifecycle on the Solana Agent Protocol.
|
|
18
|
+
* Provides methods to register, update, deactivate, reactivate, and close
|
|
19
|
+
* agent identities, as well as self-report call metrics and reputation data.
|
|
20
|
+
*
|
|
21
|
+
* @category Modules
|
|
22
|
+
* @since v0.1.0
|
|
23
|
+
* @extends BaseModule
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const sap = new SapClient(provider);
|
|
28
|
+
* // Register a new agent
|
|
29
|
+
* const sig = await sap.agent.register({
|
|
30
|
+
* name: "my-agent",
|
|
31
|
+
* description: "An example agent",
|
|
32
|
+
* capabilities: [0, 1],
|
|
33
|
+
* pricing: { free: {} },
|
|
34
|
+
* protocols: [0],
|
|
35
|
+
* });
|
|
36
|
+
* // Fetch agent data
|
|
37
|
+
* const data = await sap.agent.fetch();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class AgentModule extends BaseModule {
|
|
41
|
+
/**
|
|
42
|
+
* @name deriveAgent
|
|
43
|
+
* @description Derive the `AgentAccount` PDA for a wallet.
|
|
44
|
+
* @param wallet - The wallet public key. Defaults to the connected wallet.
|
|
45
|
+
* @returns A tuple of `[PublicKey, bump]` for the agent PDA.
|
|
46
|
+
* @see {@link deriveAgent} from `pda/` module for the underlying derivation.
|
|
47
|
+
* @since v0.1.0
|
|
48
|
+
*/
|
|
49
|
+
deriveAgent(wallet?: PublicKey): readonly [PublicKey, number];
|
|
50
|
+
/**
|
|
51
|
+
* @name deriveStats
|
|
52
|
+
* @description Derive the `AgentStats` PDA for a given agent.
|
|
53
|
+
* @param agentPda - The agent account PDA.
|
|
54
|
+
* @returns A tuple of `[PublicKey, bump]` for the stats PDA.
|
|
55
|
+
* @see {@link deriveAgentStats} from `pda/` module for the underlying derivation.
|
|
56
|
+
* @since v0.1.0
|
|
57
|
+
*/
|
|
58
|
+
deriveStats(agentPda: PublicKey): readonly [PublicKey, number];
|
|
59
|
+
/**
|
|
60
|
+
* @name register
|
|
61
|
+
* @description Register a new agent identity on-chain. Creates the
|
|
62
|
+
* `AgentAccount`, `AgentStats`, and updates the `GlobalRegistry`.
|
|
63
|
+
* @param args - Registration parameters (name, description, capabilities, pricing, protocols, etc.).
|
|
64
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
65
|
+
* @since v0.1.0
|
|
66
|
+
*/
|
|
67
|
+
register(args: RegisterAgentArgs): Promise<TransactionSignature>;
|
|
68
|
+
/**
|
|
69
|
+
* @name update
|
|
70
|
+
* @description Update an existing agent's metadata fields. All fields
|
|
71
|
+
* are optional — only non-null values are written.
|
|
72
|
+
* @param args - Partial update parameters.
|
|
73
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
74
|
+
* @since v0.1.0
|
|
75
|
+
*/
|
|
76
|
+
update(args: UpdateAgentArgs): Promise<TransactionSignature>;
|
|
77
|
+
/**
|
|
78
|
+
* @name deactivate
|
|
79
|
+
* @description Deactivate an agent, setting `is_active = false`.
|
|
80
|
+
* The agent remains on-chain but is excluded from active discovery.
|
|
81
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
82
|
+
* @since v0.1.0
|
|
83
|
+
*/
|
|
84
|
+
deactivate(): Promise<TransactionSignature>;
|
|
85
|
+
/**
|
|
86
|
+
* @name reactivate
|
|
87
|
+
* @description Reactivate a previously deactivated agent, restoring
|
|
88
|
+
* it to active status.
|
|
89
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
90
|
+
* @since v0.1.0
|
|
91
|
+
*/
|
|
92
|
+
reactivate(): Promise<TransactionSignature>;
|
|
93
|
+
/**
|
|
94
|
+
* @name close
|
|
95
|
+
* @description Close an agent PDA and its associated stats PDA.
|
|
96
|
+
* Rent is returned to the owner wallet.
|
|
97
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
98
|
+
* @since v0.1.0
|
|
99
|
+
*/
|
|
100
|
+
close(): Promise<TransactionSignature>;
|
|
101
|
+
/**
|
|
102
|
+
* @name reportCalls
|
|
103
|
+
* @description Self-report call metrics for the agent. This updates the
|
|
104
|
+
* `AgentStats` counter but does not affect on-chain reputation.
|
|
105
|
+
* @param callsServed - The number of calls to report.
|
|
106
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
107
|
+
* @since v0.1.0
|
|
108
|
+
*/
|
|
109
|
+
reportCalls(callsServed: number | bigint): Promise<TransactionSignature>;
|
|
110
|
+
/**
|
|
111
|
+
* @name updateReputation
|
|
112
|
+
* @description Update self-reported latency and uptime metrics.
|
|
113
|
+
* These are informational and do not affect on-chain reputation scoring.
|
|
114
|
+
* @param avgLatencyMs - Average response latency in milliseconds.
|
|
115
|
+
* @param uptimePercent - Uptime percentage (0–100).
|
|
116
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
117
|
+
* @since v0.1.0
|
|
118
|
+
*/
|
|
119
|
+
updateReputation(avgLatencyMs: number, uptimePercent: number): Promise<TransactionSignature>;
|
|
120
|
+
/**
|
|
121
|
+
* @name fetch
|
|
122
|
+
* @description Fetch the deserialized `AgentAccount` data for a wallet.
|
|
123
|
+
* @param wallet - The wallet public key. Defaults to the connected wallet.
|
|
124
|
+
* @returns {Promise<AgentAccountData>} The agent account data.
|
|
125
|
+
* @throws Will throw if the agent account does not exist.
|
|
126
|
+
* @since v0.1.0
|
|
127
|
+
*/
|
|
128
|
+
fetch(wallet?: PublicKey): Promise<AgentAccountData>;
|
|
129
|
+
/**
|
|
130
|
+
* @name fetchNullable
|
|
131
|
+
* @description Fetch the deserialized `AgentAccount` data, or `null`
|
|
132
|
+
* if the account doesn't exist on-chain.
|
|
133
|
+
* @param wallet - The wallet public key. Defaults to the connected wallet.
|
|
134
|
+
* @returns {Promise<AgentAccountData | null>} The agent data or `null`.
|
|
135
|
+
* @since v0.1.0
|
|
136
|
+
*/
|
|
137
|
+
fetchNullable(wallet?: PublicKey): Promise<AgentAccountData | null>;
|
|
138
|
+
/**
|
|
139
|
+
* @name fetchStats
|
|
140
|
+
* @description Fetch the deserialized `AgentStats` data for an agent.
|
|
141
|
+
* @param agentPda - The agent account PDA.
|
|
142
|
+
* @returns {Promise<AgentStatsData>} The agent stats data.
|
|
143
|
+
* @throws Will throw if the stats account does not exist.
|
|
144
|
+
* @since v0.1.0
|
|
145
|
+
*/
|
|
146
|
+
fetchStats(agentPda: PublicKey): Promise<AgentStatsData>;
|
|
147
|
+
/**
|
|
148
|
+
* @name fetchStatsNullable
|
|
149
|
+
* @description Fetch the deserialized `AgentStats` data, or `null`
|
|
150
|
+
* if the account doesn't exist on-chain.
|
|
151
|
+
* @param agentPda - The agent account PDA.
|
|
152
|
+
* @returns {Promise<AgentStatsData | null>} The stats data or `null`.
|
|
153
|
+
* @since v0.1.0
|
|
154
|
+
*/
|
|
155
|
+
fetchStatsNullable(agentPda: PublicKey): Promise<AgentStatsData | null>;
|
|
156
|
+
/**
|
|
157
|
+
* @name fetchGlobalRegistry
|
|
158
|
+
* @description Fetch the `GlobalRegistry` singleton account that tracks
|
|
159
|
+
* aggregate protocol statistics.
|
|
160
|
+
* @returns {Promise<GlobalRegistryData>} The global registry data.
|
|
161
|
+
* @throws Will throw if the registry has not been initialized.
|
|
162
|
+
* @since v0.1.0
|
|
163
|
+
*/
|
|
164
|
+
fetchGlobalRegistry(): Promise<import("../types").GlobalRegistryData>;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/modules/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,WAAY,SAAQ,UAAU;IAGzC;;;;;;;OAOG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAI7D;;;;;;;OAOG;IACH,WAAW,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAM9D;;;;;;;OAOG;IACG,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA0BtE;;;;;;;OAOG;IACG,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsBlE;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAcjD;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAcjD;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAiB5C;;;;;;;OAOG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAc9E;;;;;;;;OAQG;IACG,gBAAgB,CACpB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,CAAC;IAchC;;;;;;;OAOG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAK1D;;;;;;;OAOG;IACG,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAKzE;;;;;;;OAOG;IACG,UAAU,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC;IAK9D;;;;;;;OAOG;IACG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAK7E;;;;;;;OAOG;IACG,mBAAmB,IAAI,OAAO,CAAC,OAAO,UAAU,EAAE,kBAAkB,CAAC;CAI5E"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module attestation
|
|
3
|
+
* @description Web-of-trust attestations — create, revoke, and close
|
|
4
|
+
* on-chain attestations that vouch for agent trustworthiness.
|
|
5
|
+
*
|
|
6
|
+
* Attestations are signed endorsements from one wallet to an agent,
|
|
7
|
+
* forming a composable trust graph on Solana.
|
|
8
|
+
*
|
|
9
|
+
* @category Modules
|
|
10
|
+
* @since v0.1.0
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { type PublicKey, type TransactionSignature } from "@solana/web3.js";
|
|
14
|
+
import { BaseModule } from "./base";
|
|
15
|
+
import type { AgentAttestationData, CreateAttestationArgs } from "../types";
|
|
16
|
+
/**
|
|
17
|
+
* @name AttestationModule
|
|
18
|
+
* @description Manages on-chain attestations for the Solana Agent Protocol.
|
|
19
|
+
* Provides methods to create, revoke, close, and fetch attestation PDAs
|
|
20
|
+
* that form the web-of-trust layer.
|
|
21
|
+
*
|
|
22
|
+
* @category Modules
|
|
23
|
+
* @since v0.1.0
|
|
24
|
+
* @extends BaseModule
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const sap = new SapClient(provider);
|
|
29
|
+
* // Create an attestation for an agent
|
|
30
|
+
* const sig = await sap.attestation.create(agentWallet, {
|
|
31
|
+
* attestationType: { identity: {} },
|
|
32
|
+
* metadataHash: [...],
|
|
33
|
+
* expiresAt: null,
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare class AttestationModule extends BaseModule {
|
|
38
|
+
/**
|
|
39
|
+
* @name deriveAttestation
|
|
40
|
+
* @description Derive the `AgentAttestation` PDA for a given agent and attester.
|
|
41
|
+
* @param agentPda - The agent account PDA to attest.
|
|
42
|
+
* @param attester - The attester wallet. Defaults to the connected wallet.
|
|
43
|
+
* @returns A tuple of `[PublicKey, bump]` for the attestation PDA.
|
|
44
|
+
* @see {@link deriveAttestation} from `pda/` module for the underlying derivation.
|
|
45
|
+
* @since v0.1.0
|
|
46
|
+
*/
|
|
47
|
+
deriveAttestation(agentPda: PublicKey, attester?: PublicKey): readonly [PublicKey, number];
|
|
48
|
+
/**
|
|
49
|
+
* @name create
|
|
50
|
+
* @description Create an on-chain attestation vouching for an agent.
|
|
51
|
+
* The connected wallet becomes the attester.
|
|
52
|
+
* @param agentWallet - The wallet that owns the target agent.
|
|
53
|
+
* @param args - Attestation parameters (type, metadata hash, optional expiry).
|
|
54
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
55
|
+
* @since v0.1.0
|
|
56
|
+
*/
|
|
57
|
+
create(agentWallet: PublicKey, args: CreateAttestationArgs): Promise<TransactionSignature>;
|
|
58
|
+
/**
|
|
59
|
+
* @name revoke
|
|
60
|
+
* @description Revoke a previously issued attestation. Only the original
|
|
61
|
+
* attester may revoke.
|
|
62
|
+
* @param agentWallet - The wallet of the attested agent.
|
|
63
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
64
|
+
* @since v0.1.0
|
|
65
|
+
*/
|
|
66
|
+
revoke(agentWallet: PublicKey): Promise<TransactionSignature>;
|
|
67
|
+
/**
|
|
68
|
+
* @name close
|
|
69
|
+
* @description Close a revoked attestation PDA and reclaim rent to the attester.
|
|
70
|
+
* @param agentWallet - The wallet of the attested agent.
|
|
71
|
+
* @returns {Promise<TransactionSignature>} The transaction signature.
|
|
72
|
+
* @since v0.1.0
|
|
73
|
+
*/
|
|
74
|
+
close(agentWallet: PublicKey): Promise<TransactionSignature>;
|
|
75
|
+
/**
|
|
76
|
+
* @name fetch
|
|
77
|
+
* @description Fetch a deserialized `AgentAttestation` account.
|
|
78
|
+
* @param agentPda - The agent account PDA.
|
|
79
|
+
* @param attester - The attester wallet. Defaults to the connected wallet.
|
|
80
|
+
* @returns {Promise<AgentAttestationData>} The attestation account data.
|
|
81
|
+
* @throws Will throw if the attestation account does not exist.
|
|
82
|
+
* @since v0.1.0
|
|
83
|
+
*/
|
|
84
|
+
fetch(agentPda: PublicKey, attester?: PublicKey): Promise<AgentAttestationData>;
|
|
85
|
+
/**
|
|
86
|
+
* @name fetchNullable
|
|
87
|
+
* @description Fetch a deserialized `AgentAttestation` account, or `null`
|
|
88
|
+
* if it does not exist on-chain.
|
|
89
|
+
* @param agentPda - The agent account PDA.
|
|
90
|
+
* @param attester - The attester wallet. Defaults to the connected wallet.
|
|
91
|
+
* @returns {Promise<AgentAttestationData | null>} The attestation data or `null`.
|
|
92
|
+
* @since v0.1.0
|
|
93
|
+
*/
|
|
94
|
+
fetchNullable(agentPda: PublicKey, attester?: PublicKey): Promise<AgentAttestationData | null>;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=attestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../../../src/modules/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAG/C;;;;;;;;OAQG;IACH,iBAAiB,CACf,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,SAAS,GACnB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAM/B;;;;;;;;OAQG;IACG,MAAM,CACV,WAAW,EAAE,SAAS,EACtB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,oBAAoB,CAAC;IAiBhC;;;;;;;OAOG;IACG,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAanE;;;;;;OAMG;IACG,KAAK,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAiBlE;;;;;;;;OAQG;IACG,KAAK,CACT,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,SAAS,GACnB,OAAO,CAAC,oBAAoB,CAAC;IAKhC;;;;;;;;OAQG;IACG,aAAa,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,SAAS,GACnB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAIxC"}
|