@oobe-protocol-labs/synapse-sap-sdk 0.6.2 → 0.7.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/dist/cjs/constants/seeds.js +7 -0
- package/dist/cjs/constants/seeds.js.map +1 -1
- package/dist/cjs/core/client.js +42 -0
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/events/geyser.js +295 -0
- package/dist/cjs/events/geyser.js.map +1 -0
- package/dist/cjs/idl/synapse_agent_sap.json +7545 -3501
- package/dist/cjs/index.js +28 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/escrow-v2.js +241 -0
- package/dist/cjs/modules/escrow-v2.js.map +1 -0
- package/dist/cjs/modules/escrow.js +4 -0
- package/dist/cjs/modules/escrow.js.map +1 -1
- package/dist/cjs/modules/index.js +7 -1
- package/dist/cjs/modules/index.js.map +1 -1
- package/dist/cjs/modules/staking.js +94 -0
- package/dist/cjs/modules/staking.js.map +1 -0
- package/dist/cjs/modules/subscription.js +96 -0
- package/dist/cjs/modules/subscription.js.map +1 -0
- package/dist/cjs/pda/index.js +143 -1
- package/dist/cjs/pda/index.js.map +1 -1
- package/dist/cjs/postgres/sync.js +72 -4
- package/dist/cjs/postgres/sync.js.map +1 -1
- package/dist/cjs/registries/x402.js +88 -51
- package/dist/cjs/registries/x402.js.map +1 -1
- package/dist/cjs/types/enums.js +51 -1
- package/dist/cjs/types/enums.js.map +1 -1
- package/dist/cjs/types/index.js +4 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/instructions.js.map +1 -1
- package/dist/cjs/utils/escrow-validation.js +219 -0
- package/dist/cjs/utils/escrow-validation.js.map +1 -0
- package/dist/cjs/utils/index.js +12 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/merchant-validator.js +246 -0
- package/dist/cjs/utils/merchant-validator.js.map +1 -0
- package/dist/cjs/utils/x402-direct.js +231 -0
- package/dist/cjs/utils/x402-direct.js.map +1 -0
- package/dist/esm/constants/seeds.js +7 -0
- package/dist/esm/constants/seeds.js.map +1 -1
- package/dist/esm/core/client.js +42 -0
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/events/geyser.js +258 -0
- package/dist/esm/events/geyser.js.map +1 -0
- package/dist/esm/idl/synapse_agent_sap.json +7545 -3501
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/escrow-v2.js +237 -0
- package/dist/esm/modules/escrow-v2.js.map +1 -0
- package/dist/esm/modules/escrow.js +4 -0
- package/dist/esm/modules/escrow.js.map +1 -1
- package/dist/esm/modules/index.js +3 -0
- package/dist/esm/modules/index.js.map +1 -1
- package/dist/esm/modules/staking.js +90 -0
- package/dist/esm/modules/staking.js.map +1 -0
- package/dist/esm/modules/subscription.js +92 -0
- package/dist/esm/modules/subscription.js.map +1 -0
- package/dist/esm/pda/index.js +135 -0
- package/dist/esm/pda/index.js.map +1 -1
- package/dist/esm/postgres/sync.js +72 -4
- package/dist/esm/postgres/sync.js.map +1 -1
- package/dist/esm/registries/x402.js +89 -52
- package/dist/esm/registries/x402.js.map +1 -1
- package/dist/esm/types/enums.js +50 -0
- package/dist/esm/types/enums.js.map +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/instructions.js.map +1 -1
- package/dist/esm/utils/escrow-validation.js +212 -0
- package/dist/esm/utils/escrow-validation.js.map +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/merchant-validator.js +241 -0
- package/dist/esm/utils/merchant-validator.js.map +1 -0
- package/dist/esm/utils/x402-direct.js +228 -0
- package/dist/esm/utils/x402-direct.js.map +1 -0
- package/dist/types/constants/seeds.d.ts +7 -0
- package/dist/types/constants/seeds.d.ts.map +1 -1
- package/dist/types/core/client.d.ts +33 -0
- package/dist/types/core/client.d.ts.map +1 -1
- package/dist/types/events/geyser.d.ts +150 -0
- package/dist/types/events/geyser.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/escrow-v2.d.ts +51 -0
- package/dist/types/modules/escrow-v2.d.ts.map +1 -0
- package/dist/types/modules/escrow.d.ts +4 -0
- package/dist/types/modules/escrow.d.ts.map +1 -1
- package/dist/types/modules/index.d.ts +3 -0
- package/dist/types/modules/index.d.ts.map +1 -1
- package/dist/types/modules/staking.d.ts +32 -0
- package/dist/types/modules/staking.d.ts.map +1 -0
- package/dist/types/modules/subscription.d.ts +33 -0
- package/dist/types/modules/subscription.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +99 -0
- package/dist/types/pda/index.d.ts.map +1 -1
- package/dist/types/plugin/schemas.d.ts +2 -2
- package/dist/types/postgres/sync.d.ts +26 -2
- package/dist/types/postgres/sync.d.ts.map +1 -1
- package/dist/types/registries/x402.d.ts +14 -12
- package/dist/types/registries/x402.d.ts.map +1 -1
- package/dist/types/types/accounts.d.ts +157 -1
- package/dist/types/types/accounts.d.ts.map +1 -1
- package/dist/types/types/enums.d.ts +64 -0
- package/dist/types/types/enums.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +4 -4
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/instructions.d.ts +34 -0
- package/dist/types/types/instructions.d.ts.map +1 -1
- package/dist/types/utils/escrow-validation.d.ts +145 -0
- package/dist/types/utils/escrow-validation.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/merchant-validator.d.ts +176 -0
- package/dist/types/utils/merchant-validator.d.ts.map +1 -0
- package/dist/types/utils/x402-direct.d.ts +114 -0
- package/dist/types/utils/x402-direct.d.ts.map +1 -0
- package/package.json +5 -1
- package/src/constants/seeds.ts +7 -0
- package/src/core/client.ts +45 -0
- package/src/events/geyser.ts +384 -0
- package/src/events/yellowstone.d.ts +7 -0
- package/src/idl/synapse_agent_sap.json +7545 -3501
- package/src/index.ts +51 -0
- package/src/modules/escrow-v2.ts +396 -0
- package/src/modules/escrow.ts +4 -0
- package/src/modules/index.ts +3 -0
- package/src/modules/staking.ts +122 -0
- package/src/modules/subscription.ts +147 -0
- package/src/pda/index.ts +196 -0
- package/src/postgres/sync.ts +90 -4
- package/src/registries/x402.ts +108 -69
- package/src/types/accounts.ts +192 -1
- package/src/types/enums.ts +65 -0
- package/src/types/index.ts +15 -0
- package/src/types/instructions.ts +40 -0
- package/src/utils/escrow-validation.ts +301 -0
- package/src/utils/index.ts +28 -0
- package/src/utils/merchant-validator.ts +359 -0
- package/src/utils/x402-direct.ts +370 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module events/geyser
|
|
3
|
+
* @description Yellowstone gRPC (Geyser) event stream for SAP v2.
|
|
4
|
+
*
|
|
5
|
+
* Drop-in alternative to the WebSocket `connection.onLogs()` pipeline.
|
|
6
|
+
* Uses Triton / Helius / any Yellowstone-compatible gRPC endpoint to
|
|
7
|
+
* receive program transaction updates with sub-second latency and
|
|
8
|
+
* automatic reconnection.
|
|
9
|
+
*
|
|
10
|
+
* @category Events
|
|
11
|
+
* @since v0.6.3
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { GeyserEventStream } from "@oobe-protocol-labs/synapse-sap-sdk";
|
|
16
|
+
* import { EventParser } from "@oobe-protocol-labs/synapse-sap-sdk";
|
|
17
|
+
*
|
|
18
|
+
* const stream = new GeyserEventStream({
|
|
19
|
+
* endpoint: "https://grpc.triton.one",
|
|
20
|
+
* token: process.env.GEYSER_TOKEN!,
|
|
21
|
+
* programId: "SAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const parser = new EventParser(program);
|
|
25
|
+
*
|
|
26
|
+
* stream.on("logs", (logs, signature, slot) => {
|
|
27
|
+
* const events = parser.parseLogs(logs);
|
|
28
|
+
* for (const event of events) {
|
|
29
|
+
* console.log(event.name, event.data);
|
|
30
|
+
* }
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* stream.on("error", (err) => console.error("gRPC error:", err));
|
|
34
|
+
*
|
|
35
|
+
* await stream.connect();
|
|
36
|
+
* // ... later
|
|
37
|
+
* await stream.disconnect();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
import { EventEmitter } from "events";
|
|
41
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
42
|
+
// Constants
|
|
43
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
44
|
+
const SAP_PROGRAM_ID = "SAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ";
|
|
45
|
+
const COMMITMENT_MAP = {
|
|
46
|
+
processed: 0,
|
|
47
|
+
confirmed: 1,
|
|
48
|
+
finalized: 2,
|
|
49
|
+
};
|
|
50
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
51
|
+
// GeyserEventStream
|
|
52
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
53
|
+
/**
|
|
54
|
+
* Yellowstone gRPC event stream for SAP v2 programs.
|
|
55
|
+
*
|
|
56
|
+
* Wraps `@triton-one/yellowstone-grpc` and emits parsed log lines
|
|
57
|
+
* compatible with the existing {@link EventParser}.
|
|
58
|
+
*
|
|
59
|
+
* @name GeyserEventStream
|
|
60
|
+
* @category Events
|
|
61
|
+
* @since v0.6.3
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const stream = new GeyserEventStream({
|
|
66
|
+
* endpoint: "https://grpc.triton.one",
|
|
67
|
+
* token: process.env.GEYSER_TOKEN!,
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* stream.on("logs", (logs, sig, slot) => {
|
|
71
|
+
* const events = parser.parseLogs(logs);
|
|
72
|
+
* events.forEach(e => db.insertEvent(e));
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* await stream.connect();
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export class GeyserEventStream extends EventEmitter {
|
|
79
|
+
config;
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
client = null;
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
+
stream = null;
|
|
84
|
+
reconnectAttempts = 0;
|
|
85
|
+
_connected = false;
|
|
86
|
+
_stopped = false;
|
|
87
|
+
constructor(config) {
|
|
88
|
+
super();
|
|
89
|
+
this.config = {
|
|
90
|
+
endpoint: config.endpoint,
|
|
91
|
+
token: config.token,
|
|
92
|
+
programId: config.programId ?? SAP_PROGRAM_ID,
|
|
93
|
+
commitment: config.commitment ?? "confirmed",
|
|
94
|
+
autoReconnect: config.autoReconnect ?? true,
|
|
95
|
+
reconnectDelayMs: config.reconnectDelayMs ?? 3_000,
|
|
96
|
+
maxReconnectAttempts: config.maxReconnectAttempts ?? 0,
|
|
97
|
+
includeFailedTxs: config.includeFailedTxs ?? false,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** Whether the gRPC stream is currently connected. */
|
|
101
|
+
get connected() {
|
|
102
|
+
return this._connected;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Connect to the Yellowstone gRPC endpoint and start streaming.
|
|
106
|
+
*
|
|
107
|
+
* @throws If `@triton-one/yellowstone-grpc` is not installed.
|
|
108
|
+
*/
|
|
109
|
+
async connect() {
|
|
110
|
+
this._stopped = false;
|
|
111
|
+
this.reconnectAttempts = 0;
|
|
112
|
+
// Dynamic import — yellowstone is an optional peer dependency
|
|
113
|
+
let YellowstoneClient;
|
|
114
|
+
try {
|
|
115
|
+
const mod = await import("@triton-one/yellowstone-grpc");
|
|
116
|
+
YellowstoneClient = mod.default ?? mod.Client;
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
throw new Error("Missing dependency: @triton-one/yellowstone-grpc\n" +
|
|
120
|
+
"Install it with: npm i @triton-one/yellowstone-grpc");
|
|
121
|
+
}
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
123
|
+
this.client = new YellowstoneClient(this.config.endpoint, this.config.token, undefined);
|
|
124
|
+
await this.subscribe();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Disconnect from the gRPC stream and stop reconnection.
|
|
128
|
+
*/
|
|
129
|
+
async disconnect() {
|
|
130
|
+
this._stopped = true;
|
|
131
|
+
this._connected = false;
|
|
132
|
+
if (this.stream) {
|
|
133
|
+
try {
|
|
134
|
+
this.stream.cancel?.();
|
|
135
|
+
this.stream = null;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// ignore cancel errors
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
this.emit("disconnected", "manual");
|
|
142
|
+
}
|
|
143
|
+
// ─── Internal ──────────────────────────────────────
|
|
144
|
+
async subscribe() {
|
|
145
|
+
if (!this.client || this._stopped)
|
|
146
|
+
return;
|
|
147
|
+
try {
|
|
148
|
+
this.stream = await this.client.subscribe();
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
this.emit("error", err instanceof Error ? err : new Error(String(err)));
|
|
152
|
+
await this.maybeReconnect();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// Build the subscription request
|
|
156
|
+
const request = {
|
|
157
|
+
accounts: {},
|
|
158
|
+
slots: {},
|
|
159
|
+
transactions: {
|
|
160
|
+
sap: {
|
|
161
|
+
vote: false,
|
|
162
|
+
failed: this.config.includeFailedTxs,
|
|
163
|
+
signature: undefined,
|
|
164
|
+
accountInclude: [this.config.programId],
|
|
165
|
+
accountExclude: [],
|
|
166
|
+
accountRequired: [],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
transactionsStatus: {},
|
|
170
|
+
blocks: {},
|
|
171
|
+
blocksMeta: {},
|
|
172
|
+
entry: {},
|
|
173
|
+
commitment: COMMITMENT_MAP[this.config.commitment] ?? 1,
|
|
174
|
+
accountsDataSlice: [],
|
|
175
|
+
ping: { id: 1 },
|
|
176
|
+
};
|
|
177
|
+
// Send subscription
|
|
178
|
+
try {
|
|
179
|
+
await new Promise((resolve, reject) => {
|
|
180
|
+
this.stream.write(request, (err) => {
|
|
181
|
+
if (err)
|
|
182
|
+
reject(err);
|
|
183
|
+
else
|
|
184
|
+
resolve();
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
this.emit("error", err instanceof Error ? err : new Error(String(err)));
|
|
190
|
+
await this.maybeReconnect();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this._connected = true;
|
|
194
|
+
this.reconnectAttempts = 0;
|
|
195
|
+
this.emit("connected");
|
|
196
|
+
// Listen for data
|
|
197
|
+
this.stream.on("data", (data) => {
|
|
198
|
+
try {
|
|
199
|
+
this.handleMessage(data);
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
this.emit("error", err instanceof Error ? err : new Error(String(err)));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
this.stream.on("error", (err) => {
|
|
206
|
+
this.emit("error", err);
|
|
207
|
+
});
|
|
208
|
+
this.stream.on("end", () => {
|
|
209
|
+
this._connected = false;
|
|
210
|
+
this.emit("disconnected", "stream-end");
|
|
211
|
+
this.maybeReconnect();
|
|
212
|
+
});
|
|
213
|
+
this.stream.on("close", () => {
|
|
214
|
+
this._connected = false;
|
|
215
|
+
this.emit("disconnected", "stream-close");
|
|
216
|
+
this.maybeReconnect();
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
handleMessage(data) {
|
|
220
|
+
// Respond to pings to keep the stream alive
|
|
221
|
+
if (data.ping) {
|
|
222
|
+
this.stream?.write({ ping: { id: data.ping.id } }, () => { });
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
// Extract transaction data
|
|
226
|
+
const tx = data.transaction;
|
|
227
|
+
if (!tx?.transaction?.transaction)
|
|
228
|
+
return;
|
|
229
|
+
const meta = tx.transaction.meta;
|
|
230
|
+
if (!meta)
|
|
231
|
+
return;
|
|
232
|
+
// Extract log messages from the transaction meta
|
|
233
|
+
const logs = meta.logMessages ?? [];
|
|
234
|
+
if (logs.length === 0)
|
|
235
|
+
return;
|
|
236
|
+
const signature = tx.transaction.signature
|
|
237
|
+
? Buffer.from(tx.transaction.signature).toString("base64")
|
|
238
|
+
: "unknown";
|
|
239
|
+
const slot = Number(tx.slot ?? 0);
|
|
240
|
+
this.emit("logs", logs, signature, slot);
|
|
241
|
+
}
|
|
242
|
+
async maybeReconnect() {
|
|
243
|
+
if (this._stopped || !this.config.autoReconnect)
|
|
244
|
+
return;
|
|
245
|
+
const max = this.config.maxReconnectAttempts;
|
|
246
|
+
if (max > 0 && this.reconnectAttempts >= max) {
|
|
247
|
+
this.emit("error", new Error(`Max reconnect attempts (${max}) exceeded`));
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.reconnectAttempts++;
|
|
251
|
+
this.emit("reconnecting", this.reconnectAttempts);
|
|
252
|
+
await new Promise((r) => setTimeout(r, this.config.reconnectDelayMs));
|
|
253
|
+
if (!this._stopped) {
|
|
254
|
+
await this.subscribe();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=geyser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geyser.js","sourceRoot":"","sources":["../../../src/events/geyser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AA+EtC,sEAAsE;AACtE,aAAa;AACb,sEAAsE;AAEtE,MAAM,cAAc,GAAG,6CAA6C,CAAC;AAErE,MAAM,cAAc,GAA2B;IAC7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