@inodra/sui 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.
Files changed (91) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +237 -0
  3. package/bin/inodra-sui.mjs +2 -0
  4. package/dist/chunk-3CBLVI6J.js +426 -0
  5. package/dist/chunk-3CBLVI6J.js.map +1 -0
  6. package/dist/chunk-4HKKW5QN.js +80 -0
  7. package/dist/chunk-4HKKW5QN.js.map +1 -0
  8. package/dist/chunk-74XGJJJI.js +33 -0
  9. package/dist/chunk-74XGJJJI.js.map +1 -0
  10. package/dist/chunk-D6FZYWG7.js +99 -0
  11. package/dist/chunk-D6FZYWG7.js.map +1 -0
  12. package/dist/chunk-LZZMTSLH.js +31 -0
  13. package/dist/chunk-LZZMTSLH.js.map +1 -0
  14. package/dist/chunk-M3M2L6BW.js +29 -0
  15. package/dist/chunk-M3M2L6BW.js.map +1 -0
  16. package/dist/chunk-NSXRC5XW.js +298 -0
  17. package/dist/chunk-NSXRC5XW.js.map +1 -0
  18. package/dist/chunk-OGMBYWTG.js +537 -0
  19. package/dist/chunk-OGMBYWTG.js.map +1 -0
  20. package/dist/chunk-U6D5LGNF.js +111 -0
  21. package/dist/chunk-U6D5LGNF.js.map +1 -0
  22. package/dist/chunk-ZSW3EWGF.js +539 -0
  23. package/dist/chunk-ZSW3EWGF.js.map +1 -0
  24. package/dist/cli.js +665 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/events.cjs +3273 -0
  27. package/dist/events.cjs.map +1 -0
  28. package/dist/events.d.cts +47 -0
  29. package/dist/events.d.ts +47 -0
  30. package/dist/events.js +2578 -0
  31. package/dist/events.js.map +1 -0
  32. package/dist/graphql.cjs +129 -0
  33. package/dist/graphql.cjs.map +1 -0
  34. package/dist/graphql.d.cts +36 -0
  35. package/dist/graphql.d.ts +36 -0
  36. package/dist/graphql.js +10 -0
  37. package/dist/graphql.js.map +1 -0
  38. package/dist/grpc-web.cjs +129 -0
  39. package/dist/grpc-web.cjs.map +1 -0
  40. package/dist/grpc-web.d.cts +31 -0
  41. package/dist/grpc-web.d.ts +31 -0
  42. package/dist/grpc-web.js +10 -0
  43. package/dist/grpc-web.js.map +1 -0
  44. package/dist/grpc.cjs +131 -0
  45. package/dist/grpc.cjs.map +1 -0
  46. package/dist/grpc.d.cts +34 -0
  47. package/dist/grpc.d.ts +34 -0
  48. package/dist/grpc.js +10 -0
  49. package/dist/grpc.js.map +1 -0
  50. package/dist/index-CGBN_EI5.d.ts +4800 -0
  51. package/dist/index-CVO2Kj8a.d.cts +4800 -0
  52. package/dist/index.cjs +4723 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.d.cts +504 -0
  55. package/dist/index.d.ts +504 -0
  56. package/dist/index.js +59 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/manage.cjs +376 -0
  59. package/dist/manage.cjs.map +1 -0
  60. package/dist/manage.d.cts +2 -0
  61. package/dist/manage.d.ts +2 -0
  62. package/dist/manage.js +8 -0
  63. package/dist/manage.js.map +1 -0
  64. package/dist/network-CEg2MJY3.d.cts +60 -0
  65. package/dist/network-CEg2MJY3.d.ts +60 -0
  66. package/dist/node.cjs +4759 -0
  67. package/dist/node.cjs.map +1 -0
  68. package/dist/node.d.cts +28 -0
  69. package/dist/node.d.ts +28 -0
  70. package/dist/node.js +73 -0
  71. package/dist/node.js.map +1 -0
  72. package/dist/reflection-Bx44-Fs1.d.ts +4639 -0
  73. package/dist/reflection-Cf7WFH6H.d.cts +4639 -0
  74. package/dist/reflection-FEGYA7DU.js +9 -0
  75. package/dist/reflection-FEGYA7DU.js.map +1 -0
  76. package/dist/runtime-OWKF3LZ7.js +37 -0
  77. package/dist/runtime-OWKF3LZ7.js.map +1 -0
  78. package/dist/warp.cjs +633 -0
  79. package/dist/warp.cjs.map +1 -0
  80. package/dist/warp.d.cts +195 -0
  81. package/dist/warp.d.ts +195 -0
  82. package/dist/warp.js +12 -0
  83. package/dist/warp.js.map +1 -0
  84. package/dist/webhooks.cjs +104 -0
  85. package/dist/webhooks.cjs.map +1 -0
  86. package/dist/webhooks.d.cts +35 -0
  87. package/dist/webhooks.d.ts +35 -0
  88. package/dist/webhooks.js +7 -0
  89. package/dist/webhooks.js.map +1 -0
  90. package/llms.txt +189 -0
  91. package/package.json +119 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,4723 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __esm = (fn, res) => function __init() {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ };
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+
23
+ // src/core/auth.ts
24
+ function resolveAuth(auth) {
25
+ if (typeof auth === "string") {
26
+ return staticAuth(apiKeyCredentials(auth));
27
+ }
28
+ if ("apiKey" in auth) {
29
+ return staticAuth(apiKeyCredentials(auth.apiKey));
30
+ }
31
+ if ("sessionToken" in auth) {
32
+ return staticAuth({
33
+ headers: { authorization: `Bearer ${auth.sessionToken}` }
34
+ });
35
+ }
36
+ return {
37
+ credentials: async () => auth.getCredentials(),
38
+ staticCredentials: () => void 0
39
+ };
40
+ }
41
+ function authFromOptions(options, context) {
42
+ if (options.auth !== void 0) {
43
+ return resolveAuth(options.auth);
44
+ }
45
+ if (options.apiKey) {
46
+ return resolveAuth(options.apiKey);
47
+ }
48
+ throw new Error(`${context} requires auth (or the apiKey shorthand)`);
49
+ }
50
+ function staticAuthHeaders(options, context) {
51
+ const credentials = authFromOptions(options, context).staticCredentials();
52
+ if (!credentials) {
53
+ throw new Error(
54
+ `${context} does not support dynamic credential providers \u2014 pass an apiKey or sessionToken`
55
+ );
56
+ }
57
+ return credentials.headers;
58
+ }
59
+ function apiKeyCredentials(apiKey) {
60
+ if (!apiKey) {
61
+ throw new Error("Inodra auth: apiKey must be a non-empty string");
62
+ }
63
+ return {
64
+ headers: { "x-api-key": apiKey },
65
+ queryParams: { api_key: apiKey }
66
+ };
67
+ }
68
+ function staticAuth(credentials) {
69
+ return {
70
+ credentials: async () => credentials,
71
+ staticCredentials: () => credentials
72
+ };
73
+ }
74
+ var init_auth = __esm({
75
+ "src/core/auth.ts"() {
76
+ "use strict";
77
+ }
78
+ });
79
+
80
+ // src/core/network.ts
81
+ function restBaseUrl(network) {
82
+ return INODRA_ENDPOINTS[network].rest;
83
+ }
84
+ function graphqlUrl(network) {
85
+ return INODRA_ENDPOINTS[network].graphql;
86
+ }
87
+ function grpcBaseUrl(network) {
88
+ return INODRA_ENDPOINTS[network].grpcWeb;
89
+ }
90
+ function warpStreamUrl(network, subscriptionId) {
91
+ return `${INODRA_ENDPOINTS[network].rest}/warp/${subscriptionId}/stream`;
92
+ }
93
+ function warpWebSocketUrl(network, subscriptionId) {
94
+ return `${INODRA_ENDPOINTS[network].warpWs}/warp/${subscriptionId}/ws`;
95
+ }
96
+ var INODRA_ENDPOINTS;
97
+ var init_network = __esm({
98
+ "src/core/network.ts"() {
99
+ "use strict";
100
+ INODRA_ENDPOINTS = {
101
+ mainnet: {
102
+ rest: "https://mainnet-api.inodra.com/v1",
103
+ graphql: "https://mainnet-api.inodra.com/v1/graphql",
104
+ /** host:port for native gRPC transports */
105
+ grpc: "mainnet-grpc.inodra.com:443",
106
+ /** base URL for gRPC-Web transports */
107
+ grpcWeb: "https://mainnet-grpc.inodra.com",
108
+ warpWs: "wss://mainnet-api.inodra.com/v1"
109
+ },
110
+ testnet: {
111
+ rest: "https://testnet-api.inodra.com/v1",
112
+ graphql: "https://testnet-api.inodra.com/v1/graphql",
113
+ grpc: "testnet-grpc.inodra.com:443",
114
+ grpcWeb: "https://testnet-grpc.inodra.com",
115
+ warpWs: "wss://testnet-api.inodra.com/v1"
116
+ }
117
+ };
118
+ }
119
+ });
120
+
121
+ // src/core/version.ts
122
+ var SDK_VERSION, SDK_HEADER_NAME, SDK_HEADER_VALUE;
123
+ var init_version = __esm({
124
+ "src/core/version.ts"() {
125
+ "use strict";
126
+ SDK_VERSION = "0.1.0";
127
+ SDK_HEADER_NAME = "x-inodra-sdk";
128
+ SDK_HEADER_VALUE = `inodra-sdk-ts/${SDK_VERSION}`;
129
+ }
130
+ });
131
+
132
+ // src/events/runtime.ts
133
+ var runtime_exports = {};
134
+ __export(runtime_exports, {
135
+ baseEventType: () => baseEventType,
136
+ eventTypeMatches: () => eventTypeMatches,
137
+ innerEventType: () => innerEventType,
138
+ moveAddress: () => moveAddress,
139
+ moveBalance: () => moveBalance,
140
+ moveBool: () => moveBool,
141
+ moveBytes: () => moveBytes,
142
+ moveSmallUint: () => moveSmallUint,
143
+ moveString: () => moveString,
144
+ moveTypeName: () => moveTypeName,
145
+ moveUint: () => moveUint,
146
+ warpAddressPayloadSchema: () => warpAddressPayloadSchema,
147
+ warpCoinPayloadSchema: () => warpCoinPayloadSchema,
148
+ warpEventPayloadSchema: () => warpEventPayloadSchema,
149
+ warpObjectPayloadSchema: () => warpObjectPayloadSchema,
150
+ webhookEventBodySchema: () => webhookEventBodySchema
151
+ });
152
+ function baseEventType(eventType) {
153
+ const idx = eventType.indexOf("<");
154
+ return idx === -1 ? eventType : eventType.slice(0, idx);
155
+ }
156
+ function innerEventType(eventType) {
157
+ const start = eventType.indexOf("<");
158
+ if (start === -1 || !eventType.endsWith(">")) {
159
+ return void 0;
160
+ }
161
+ return eventType.slice(start + 1, -1);
162
+ }
163
+ function eventTypeMatches(rawEventType, deployment, generic) {
164
+ if (generic) {
165
+ return baseEventType(rawEventType) === deployment.eventType;
166
+ }
167
+ return rawEventType === deployment.eventType;
168
+ }
169
+ var import_zod, moveSmallUint, moveUint, moveBool, moveAddress, moveString, moveTypeName, moveBalance, moveBytes, warpEventPayloadSchema, warpAddressPayloadSchema, warpCoinPayloadSchema, warpObjectPayloadSchema, webhookEventBodySchema;
170
+ var init_runtime = __esm({
171
+ "src/events/runtime.ts"() {
172
+ "use strict";
173
+ import_zod = require("zod");
174
+ moveSmallUint = import_zod.z.number();
175
+ moveUint = import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).transform((value) => String(value));
176
+ moveBool = import_zod.z.boolean();
177
+ moveAddress = import_zod.z.string();
178
+ moveString = import_zod.z.string();
179
+ moveTypeName = import_zod.z.union([import_zod.z.string(), import_zod.z.looseObject({ name: import_zod.z.string() })]).transform((value) => typeof value === "string" ? value : value.name);
180
+ moveBalance = import_zod.z.union([
181
+ import_zod.z.string(),
182
+ import_zod.z.number(),
183
+ import_zod.z.looseObject({ value: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]) })
184
+ ]).transform(
185
+ (value) => typeof value === "object" ? String(value.value) : String(value)
186
+ );
187
+ moveBytes = import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.number())]);
188
+ warpEventPayloadSchema = import_zod.z.looseObject({
189
+ activityType: import_zod.z.literal("package_event"),
190
+ txDigest: import_zod.z.string(),
191
+ eventSequence: import_zod.z.number(),
192
+ checkpoint: import_zod.z.number(),
193
+ timestamp: import_zod.z.number(),
194
+ /** Full concrete Move event type. */
195
+ type: import_zod.z.string(),
196
+ sender: import_zod.z.string(),
197
+ /** Decoded Move event payload — type with the generated catalog schemas. */
198
+ data: import_zod.z.unknown()
199
+ });
200
+ warpAddressPayloadSchema = import_zod.z.looseObject({
201
+ address: import_zod.z.string(),
202
+ activityType: import_zod.z.string(),
203
+ txDigest: import_zod.z.string(),
204
+ checkpoint: import_zod.z.number(),
205
+ timestamp: import_zod.z.number(),
206
+ objectId: import_zod.z.string().optional(),
207
+ objectType: import_zod.z.string().optional()
208
+ });
209
+ warpCoinPayloadSchema = import_zod.z.looseObject({
210
+ activityType: import_zod.z.literal("balance_change"),
211
+ address: import_zod.z.string(),
212
+ coin_type: import_zod.z.string(),
213
+ /** Signed amount, string for precision. */
214
+ amount: import_zod.z.string(),
215
+ txDigest: import_zod.z.string(),
216
+ checkpoint: import_zod.z.number(),
217
+ timestamp: import_zod.z.number()
218
+ });
219
+ warpObjectPayloadSchema = import_zod.z.looseObject({
220
+ activityType: import_zod.z.literal("object_change"),
221
+ object_id: import_zod.z.string(),
222
+ transactionDirection: import_zod.z.string(),
223
+ writeKind: import_zod.z.string(),
224
+ owner: import_zod.z.string().optional(),
225
+ previousOwner: import_zod.z.string().optional(),
226
+ txDigest: import_zod.z.string(),
227
+ checkpoint: import_zod.z.number(),
228
+ timestamp: import_zod.z.number()
229
+ });
230
+ webhookEventBodySchema = import_zod.z.looseObject({
231
+ payloadVersion: import_zod.z.number(),
232
+ payload: warpEventPayloadSchema.extend({ webhookId: import_zod.z.string() })
233
+ });
234
+ }
235
+ });
236
+
237
+ // src/events/move-types.ts
238
+ function splitArgs(inner) {
239
+ const parts = [];
240
+ let depth = 0;
241
+ let current = "";
242
+ for (const char of inner) {
243
+ if (char === "<") depth++;
244
+ if (char === ">") depth--;
245
+ if (char === "," && depth === 0) {
246
+ parts.push(current.trim());
247
+ current = "";
248
+ continue;
249
+ }
250
+ current += char;
251
+ }
252
+ if (current.trim()) parts.push(current.trim());
253
+ return parts;
254
+ }
255
+ function parseMoveType(input) {
256
+ const type = input.trim();
257
+ if (PRIMITIVES.has(type)) {
258
+ return { kind: "prim", prim: type };
259
+ }
260
+ if (type.startsWith("vector<") && type.endsWith(">")) {
261
+ return { kind: "vector", inner: parseMoveType(type.slice(7, -1)) };
262
+ }
263
+ const param = /^\$(\d+)$/.exec(type);
264
+ if (param) {
265
+ return { kind: "param", index: Number(param[1]) };
266
+ }
267
+ const generic = type.indexOf("<");
268
+ const base = generic === -1 ? type : type.slice(0, generic);
269
+ const args = generic === -1 || !type.endsWith(">") ? [] : splitArgs(type.slice(generic + 1, -1)).map(parseMoveType);
270
+ const [address, module2, name, ...rest] = base.split("::");
271
+ if (address?.startsWith("0x") && module2 && name && rest.length === 0) {
272
+ return {
273
+ kind: "struct",
274
+ address: normalizeAddress(address),
275
+ module: module2,
276
+ name,
277
+ args
278
+ };
279
+ }
280
+ return { kind: "opaque", raw: type };
281
+ }
282
+ function normalizeAddress(address) {
283
+ return address.replace(/^0x0+(?=[0-9a-fA-F])/, "0x");
284
+ }
285
+ function formatMoveType(node) {
286
+ switch (node.kind) {
287
+ case "prim":
288
+ return node.prim;
289
+ case "vector":
290
+ return `vector<${formatMoveType(node.inner)}>`;
291
+ case "param":
292
+ return `$${node.index}`;
293
+ case "opaque":
294
+ return node.raw;
295
+ case "struct": {
296
+ const base = `${node.address}::${node.module}::${node.name}`;
297
+ return node.args.length === 0 ? base : `${base}<${node.args.map(formatMoveType).join(", ")}>`;
298
+ }
299
+ }
300
+ }
301
+ function substituteTypeParams(node, args) {
302
+ switch (node.kind) {
303
+ case "param":
304
+ return args[node.index] ?? node;
305
+ case "vector":
306
+ return { kind: "vector", inner: substituteTypeParams(node.inner, args) };
307
+ case "struct":
308
+ return {
309
+ ...node,
310
+ args: node.args.map((a) => substituteTypeParams(a, args))
311
+ };
312
+ default:
313
+ return node;
314
+ }
315
+ }
316
+ async function resolveShape(node, resolveStruct, depth = 0, stack = []) {
317
+ switch (node.kind) {
318
+ case "prim":
319
+ switch (node.prim) {
320
+ case "u8":
321
+ case "u16":
322
+ case "u32":
323
+ return { kind: "smallUint" };
324
+ case "u64":
325
+ case "u128":
326
+ case "u256":
327
+ return { kind: "uint" };
328
+ case "bool":
329
+ return { kind: "bool" };
330
+ case "address":
331
+ case "signer":
332
+ return { kind: "address" };
333
+ default:
334
+ return { kind: "unknown" };
335
+ }
336
+ case "vector":
337
+ if (node.inner.kind === "prim" && node.inner.prim === "u8") {
338
+ return { kind: "bytes" };
339
+ }
340
+ return {
341
+ kind: "vector",
342
+ inner: await resolveShape(node.inner, resolveStruct, depth, stack)
343
+ };
344
+ case "param":
345
+ case "opaque":
346
+ return { kind: "unknown" };
347
+ case "struct": {
348
+ const base = `${node.address}::${node.module}::${node.name}`;
349
+ switch (base) {
350
+ case "0x1::string::String":
351
+ case "0x1::ascii::String":
352
+ case "0x2::url::Url":
353
+ return { kind: "string" };
354
+ case "0x1::type_name::TypeName":
355
+ return { kind: "typeName" };
356
+ case "0x2::object::ID":
357
+ return { kind: "address" };
358
+ case "0x2::balance::Balance":
359
+ return { kind: "balance" };
360
+ case "0x1::option::Option": {
361
+ const inner = node.args[0];
362
+ if (node.args.length === 1 && inner) {
363
+ return {
364
+ kind: "option",
365
+ inner: await resolveShape(inner, resolveStruct, depth, stack)
366
+ };
367
+ }
368
+ return { kind: "unknown" };
369
+ }
370
+ }
371
+ const key = formatMoveType(node);
372
+ if (depth >= MAX_DEPTH || stack.includes(key)) {
373
+ return { kind: "unknown" };
374
+ }
375
+ const definition = await resolveStruct(node);
376
+ if (!definition) {
377
+ return { kind: "unknown" };
378
+ }
379
+ const fields = await Promise.all(
380
+ definition.map(async (field) => ({
381
+ name: field.name,
382
+ value: await resolveShape(
383
+ substituteTypeParams(field.type, node.args),
384
+ resolveStruct,
385
+ depth + 1,
386
+ [...stack, key]
387
+ )
388
+ }))
389
+ );
390
+ return { kind: "object", fields };
391
+ }
392
+ }
393
+ }
394
+ function shapeToZod(shape) {
395
+ switch (shape.kind) {
396
+ case "smallUint":
397
+ return moveSmallUint;
398
+ case "uint":
399
+ return moveUint;
400
+ case "bool":
401
+ return moveBool;
402
+ case "address":
403
+ return moveAddress;
404
+ case "string":
405
+ return moveString;
406
+ case "typeName":
407
+ return moveTypeName;
408
+ case "balance":
409
+ return moveBalance;
410
+ case "bytes":
411
+ return moveBytes;
412
+ case "option":
413
+ return shapeToZod(shape.inner).nullable();
414
+ case "vector":
415
+ return import_zod2.z.array(shapeToZod(shape.inner));
416
+ case "object":
417
+ return import_zod2.z.looseObject(
418
+ Object.fromEntries(
419
+ shape.fields.map((f) => [f.name, shapeToZod(f.value)])
420
+ )
421
+ );
422
+ case "unknown":
423
+ return import_zod2.z.unknown();
424
+ }
425
+ }
426
+ function shapeToExpr(shape, used, indent = "") {
427
+ const primitive = PRIMITIVE_EXPRS[shape.kind];
428
+ if (primitive) {
429
+ used.add(primitive);
430
+ return primitive;
431
+ }
432
+ switch (shape.kind) {
433
+ case "option":
434
+ return `${shapeToExpr(shape.inner, used, indent)}.nullable()`;
435
+ case "vector":
436
+ return `z.array(${shapeToExpr(shape.inner, used, indent)})`;
437
+ case "object": {
438
+ const lines = ["z.looseObject({"];
439
+ for (const field of shape.fields) {
440
+ lines.push(
441
+ `${indent} ${JSON.stringify(field.name)}: ${shapeToExpr(field.value, used, `${indent} `)},`
442
+ );
443
+ }
444
+ lines.push(`${indent}})`);
445
+ return lines.join("\n");
446
+ }
447
+ default:
448
+ return "z.unknown()";
449
+ }
450
+ }
451
+ var import_zod2, PRIMITIVES, MAX_DEPTH, PRIMITIVE_EXPRS;
452
+ var init_move_types = __esm({
453
+ "src/events/move-types.ts"() {
454
+ "use strict";
455
+ import_zod2 = require("zod");
456
+ init_runtime();
457
+ PRIMITIVES = /* @__PURE__ */ new Set([
458
+ "u8",
459
+ "u16",
460
+ "u32",
461
+ "u64",
462
+ "u128",
463
+ "u256",
464
+ "bool",
465
+ "address",
466
+ "signer"
467
+ ]);
468
+ MAX_DEPTH = 6;
469
+ PRIMITIVE_EXPRS = {
470
+ smallUint: "moveSmallUint",
471
+ uint: "moveUint",
472
+ bool: "moveBool",
473
+ address: "moveAddress",
474
+ string: "moveString",
475
+ typeName: "moveTypeName",
476
+ balance: "moveBalance",
477
+ bytes: "moveBytes"
478
+ };
479
+ }
480
+ });
481
+
482
+ // src/events/reflection.ts
483
+ var reflection_exports = {};
484
+ __export(reflection_exports, {
485
+ EventSchemaReflector: () => EventSchemaReflector
486
+ });
487
+ function extractEventPayload(input, depth = 0) {
488
+ if (depth > 3 || typeof input !== "object" || input === null) {
489
+ return void 0;
490
+ }
491
+ const record = input;
492
+ if (typeof record.type === "string" && record.type.includes("::") && "data" in record) {
493
+ return { type: record.type, data: record.data };
494
+ }
495
+ return extractEventPayload(record.payload, depth + 1) ?? extractEventPayload(record.data, depth + 1);
496
+ }
497
+ var STRUCT_QUERY, EventSchemaReflector;
498
+ var init_reflection = __esm({
499
+ "src/events/reflection.ts"() {
500
+ "use strict";
501
+ init_auth();
502
+ init_network();
503
+ init_version();
504
+ init_move_types();
505
+ init_runtime();
506
+ STRUCT_QUERY = `query($pkg: SuiAddress!, $module: String!, $struct: String!) {
507
+ package(address: $pkg) {
508
+ module(name: $module) { struct(name: $struct) { fields { name type { repr } } } }
509
+ }
510
+ }`;
511
+ EventSchemaReflector = class {
512
+ url;
513
+ headers;
514
+ fetchImpl;
515
+ /** Struct-definition cache, keyed by `address::module::name`. */
516
+ structs = /* @__PURE__ */ new Map();
517
+ /** Resolved shape cache, keyed by the canonical concrete type string. */
518
+ shapes = /* @__PURE__ */ new Map();
519
+ schemas = /* @__PURE__ */ new Map();
520
+ constructor(options = {}) {
521
+ this.url = options.url ?? graphqlUrl(options.network ?? "mainnet");
522
+ this.fetchImpl = options.fetch ?? globalThis.fetch;
523
+ const headers = {
524
+ "content-type": "application/json",
525
+ [SDK_HEADER_NAME]: SDK_HEADER_VALUE
526
+ };
527
+ if (options.auth !== void 0 || options.apiKey) {
528
+ const credentials = authFromOptions(
529
+ options,
530
+ "EventSchemaReflector"
531
+ ).staticCredentials();
532
+ if (!credentials) {
533
+ throw new Error(
534
+ "EventSchemaReflector does not support dynamic credential providers"
535
+ );
536
+ }
537
+ Object.assign(headers, credentials.headers);
538
+ }
539
+ this.headers = headers;
540
+ }
541
+ /**
542
+ * Resolved schema shape for a concrete Move type (cached). Useful for
543
+ * codegen and introspection; most callers want {@link schemaFor}.
544
+ */
545
+ shapeFor(type) {
546
+ const node = parseMoveType(type);
547
+ const key = formatMoveType(node);
548
+ let pending = this.shapes.get(key);
549
+ if (!pending) {
550
+ pending = resolveShape(node, (struct) => this.structFields(struct));
551
+ this.shapes.set(key, pending);
552
+ pending.catch(() => this.shapes.delete(key));
553
+ }
554
+ return pending;
555
+ }
556
+ /**
557
+ * Build (and cache) a loose, normalizing zod schema for any concrete Move
558
+ * event type. Same encoding rules as the generated catalog schemas.
559
+ */
560
+ schemaFor(type) {
561
+ const key = formatMoveType(parseMoveType(type));
562
+ let pending = this.schemas.get(key);
563
+ if (!pending) {
564
+ pending = this.shapeFor(type).then((shape) => {
565
+ if (shape.kind !== "object") {
566
+ throw new Error(
567
+ `${type} did not resolve to a struct \u2014 is it a Move event type on this network?`
568
+ );
569
+ }
570
+ return shapeToZod(shape);
571
+ });
572
+ this.schemas.set(key, pending);
573
+ pending.catch(() => this.schemas.delete(key));
574
+ }
575
+ return pending;
576
+ }
577
+ /**
578
+ * Validate + normalize an event payload against the reflected schema.
579
+ * Accepts a Warp stream message, a bare `{type, data}` event payload, or
580
+ * a webhook body. Returns undefined when the message carries a different
581
+ * event type; throws when the payload doesn't fit the reflected schema.
582
+ *
583
+ * Matching: exact when `type` is fully instantiated; base-type when
584
+ * `type` has no generics (all instantiations match).
585
+ */
586
+ async parseEvent(message, type) {
587
+ const payload = extractEventPayload(message);
588
+ if (!payload) {
589
+ return void 0;
590
+ }
591
+ const canonical = (t) => formatMoveType(parseMoveType(t));
592
+ const requested = canonical(type);
593
+ const matches2 = type.includes("<") ? canonical(payload.type) === requested : canonical(baseEventType(payload.type)) === requested;
594
+ if (!matches2) {
595
+ return void 0;
596
+ }
597
+ const schema = await this.schemaFor(
598
+ type.includes("<") ? type : payload.type
599
+ );
600
+ return schema.parse(payload.data);
601
+ }
602
+ structFields(struct) {
603
+ const key = `${struct.address}::${struct.module}::${struct.name}`;
604
+ let pending = this.structs.get(key);
605
+ if (!pending) {
606
+ pending = this.fetchStruct(struct);
607
+ this.structs.set(key, pending);
608
+ pending.catch(() => this.structs.delete(key));
609
+ }
610
+ return pending;
611
+ }
612
+ async fetchStruct(struct) {
613
+ let lastError;
614
+ for (let attempt = 0; attempt < 3; attempt++) {
615
+ try {
616
+ const response = await this.fetchImpl(this.url, {
617
+ method: "POST",
618
+ headers: this.headers,
619
+ body: JSON.stringify({
620
+ query: STRUCT_QUERY,
621
+ variables: {
622
+ pkg: struct.address,
623
+ module: struct.module,
624
+ struct: struct.name
625
+ }
626
+ })
627
+ });
628
+ if (!response.ok) {
629
+ throw new Error(`GraphQL reflection failed: HTTP ${response.status}`);
630
+ }
631
+ const body = await response.json();
632
+ if (body.errors) {
633
+ throw new Error(
634
+ `GraphQL reflection errors: ${JSON.stringify(body.errors)}`
635
+ );
636
+ }
637
+ const fields = body.data?.package?.module?.struct?.fields;
638
+ if (!fields) {
639
+ return void 0;
640
+ }
641
+ return fields.map((field) => ({
642
+ name: field.name,
643
+ type: parseMoveType(field.type.repr)
644
+ }));
645
+ } catch (error) {
646
+ lastError = error;
647
+ await new Promise((r) => setTimeout(r, 300 * 2 ** attempt));
648
+ }
649
+ }
650
+ throw lastError;
651
+ }
652
+ };
653
+ }
654
+ });
655
+
656
+ // src/generated/events.ts
657
+ var import_zod3, _7kConfirmSwapSchema, _7kSwapSchema, AftermathDepositSchema, AftermathPerpFundingSchema, AftermathPerpLiquidatedSchema, AftermathSwapSchema, AlphafiLiquidityChangeSchema, AlphafiRewardSchema, BluefinFeeCollectedSchema, BluefinLiquidityProvidedSchema, BluefinLiquidityRemovedSchema, BluefinPoolCreatedSchema, BluefinPositionClosedSchema, BluefinPositionOpenedSchema, BluefinRewardCollectedSchema, BluefinSwapSchema, BucketBorrowSchema, BucketDepositCollateralSchema, BucketPositionUpdatedSchema, BucketRedeemSchema, BucketRepaySchema, BucketSbuckDepositSchema, BucketSbuckRewardsSchema, BucketWithdrawCollateralSchema, CetusAddLiquiditySchema, CetusClosePositionSchema, CetusCollectFeeSchema, CetusCreatePoolSchema, CetusOpenPositionSchema, CetusRemoveLiquiditySchema, CetusSwapSchema, CurrentBorrowSchema, CurrentDepositSchema, CurrentLiquidateSchema, CurrentRepaySchema, CurrentWithdrawSchema, DeepbookBalanceSchema, DeepbookFlashLoanSchema, DeepbookOrderCanceledSchema, DeepbookOrderFilledSchema, DeepbookOrderInfoSchema, DeepbookOrderPlacedSchema, EmberDepositSchema, EmberRateUpdatedSchema, EmberRedeemProcessedSchema, EmberRedeemRequestSchema, FlowxAmmPairCreatedSchema, FlowxAmmSwapSchema, FlowxClmmPoolCreatedSchema, FlowxClmmSwapSchema, HaedalInstantUnstakedSchema, HaedalStakedSchema, HaedalUnstakedSchema, KaiAddLiquiditySchema, KaiDeleverageSchema, KaiLiquidationSchema, KaiPositionOpenSchema, KaiReduceSchema, KaiSupplySchema, KaiSupplyWithdrawSchema, KriyaAddLiquiditySchema, KriyaSwapSchema, MagmaAddLiquiditySchema, MagmaCollectFeeSchema, MagmaCollectRewardSchema, MagmaCreatePoolSchema, MagmaRemoveLiquiditySchema, MagmaSwapSchema, MoleAddDebtSchema, MoleDepositSchema, MoleHarvestSchema, MoleKillSchema, MoleWithdrawSchema, MoleWorkSchema, MomentumAddLiquiditySchema, MomentumCollectFeeSchema, MomentumCollectRewardSchema, MomentumPoolCreatedSchema, MomentumRemoveLiquiditySchema, MomentumRepayFlashSwapSchema, MomentumSwapSchema, NaviBorrowSchema, NaviDepositSchema, NaviLiquidationSchema, NaviRepaySchema, NaviWithdrawSchema, PythPriceFeedUpdateSchema, ScallopBorrowSchema, ScallopCollateralDepositSchema, ScallopCollateralWithdrawSchema, ScallopLiquidationSchema, ScallopRepaySchema, SpringsuiEpochChangedSchema, SpringsuiStakeSchema, SpringsuiUnstakeSchema, SteammBankDepositSchema, SteammBankWithdrawSchema, SuilendBorrowSchema, SuilendClaimRewardSchema, SuilendDepositSchema, SuilendLiquidateSchema, SuilendRepaySchema, SuilendWithdrawSchema, SupraPriceUpdateSchema, TurbosAddLiquiditySchema, TurbosPoolCreatedSchema, TurbosRemoveLiquiditySchema, TurbosSwapSchema, TypusDovAuctionSchema, TypusDovBidSchema, TypusDovSettleSchema, TypusPerpFundingSchema, TypusPerpLiquidateSchema, TypusPerpLpBurnSchema, TypusPerpLpMintSchema, TypusPerpOrderSchema, VoloStakedSchema, VoloUnstakedSchema, WalrusBlobCertifiedSchema, WalrusBlobDeletedSchema, WalrusBlobRegisteredSchema, catalogEvents;
658
+ var init_events = __esm({
659
+ "src/generated/events.ts"() {
660
+ "use strict";
661
+ import_zod3 = require("zod");
662
+ init_runtime();
663
+ _7kConfirmSwapSchema = import_zod3.z.looseObject({
664
+ "quote_id": moveString,
665
+ "from": moveTypeName,
666
+ "target": moveTypeName,
667
+ "amount_in": moveUint,
668
+ "amount_out": moveUint,
669
+ "fee_amount": moveUint,
670
+ "fee_rate": moveSmallUint,
671
+ "fee_recipient": moveAddress,
672
+ "expect_amount_out": moveUint,
673
+ "amount_out_limit": moveUint
674
+ });
675
+ _7kSwapSchema = import_zod3.z.looseObject({
676
+ "quote_id": moveString,
677
+ "pool_id": moveAddress,
678
+ "dex": moveString,
679
+ "from": moveTypeName,
680
+ "target": moveTypeName,
681
+ "amount_in": moveUint,
682
+ "amount_out": moveUint,
683
+ "amount_in_remaining": moveUint
684
+ });
685
+ AftermathDepositSchema = import_zod3.z.looseObject({
686
+ "pool_id": moveAddress,
687
+ "issuer": moveAddress,
688
+ "referrer": moveAddress.nullable(),
689
+ "types": import_zod3.z.array(moveString),
690
+ "deposits": import_zod3.z.array(moveUint),
691
+ "reserves": import_zod3.z.array(moveUint),
692
+ "lp_coins_minted": moveUint
693
+ });
694
+ AftermathPerpFundingSchema = import_zod3.z.looseObject({
695
+ "ch_id": moveAddress,
696
+ "account_id": moveUint,
697
+ "collateral_change_usd": moveUint,
698
+ "collateral_after": moveUint
699
+ });
700
+ AftermathPerpLiquidatedSchema = import_zod3.z.looseObject({
701
+ "ch_id": moveAddress,
702
+ "liqee_account_id": moveUint,
703
+ "liqor_account_id": moveUint,
704
+ "is_liqee_long": moveBool,
705
+ "base_liquidated": moveUint,
706
+ "quote_liquidated": moveUint,
707
+ "bad_debt": moveUint
708
+ });
709
+ AftermathSwapSchema = import_zod3.z.looseObject({
710
+ "pool_id": moveAddress,
711
+ "issuer": moveAddress,
712
+ "referrer": moveAddress.nullable(),
713
+ "types_in": import_zod3.z.array(moveString),
714
+ "amounts_in": import_zod3.z.array(moveUint),
715
+ "types_out": import_zod3.z.array(moveString),
716
+ "amounts_out": import_zod3.z.array(moveUint),
717
+ "reserves": import_zod3.z.array(moveUint)
718
+ });
719
+ AlphafiLiquidityChangeSchema = import_zod3.z.looseObject({
720
+ "pool_id": moveAddress,
721
+ "event_type": moveSmallUint,
722
+ "amount_a": moveUint,
723
+ "amount_b": moveUint,
724
+ "total_amount_a": moveUint,
725
+ "total_amount_b": moveUint,
726
+ "fee_collected_a": moveUint,
727
+ "fee_collected_b": moveUint,
728
+ "tokens_invested": moveUint,
729
+ "sender": moveAddress
730
+ });
731
+ AlphafiRewardSchema = import_zod3.z.looseObject({
732
+ "coin_type": moveTypeName,
733
+ "amount": moveUint,
734
+ "investor_id": moveAddress,
735
+ "fee_collected": moveUint,
736
+ "total_amount_a": moveUint,
737
+ "total_amount_b": moveUint,
738
+ "sender": moveAddress
739
+ });
740
+ BluefinFeeCollectedSchema = import_zod3.z.looseObject({
741
+ "pool_id": moveAddress,
742
+ "position_id": moveAddress,
743
+ "coin_a_amount": moveUint,
744
+ "coin_b_amount": moveUint
745
+ });
746
+ BluefinLiquidityProvidedSchema = import_zod3.z.looseObject({
747
+ "pool_id": moveAddress,
748
+ "position_id": moveAddress,
749
+ "coin_a_amount": moveUint,
750
+ "coin_b_amount": moveUint,
751
+ "liquidity": moveUint
752
+ });
753
+ BluefinLiquidityRemovedSchema = import_zod3.z.looseObject({
754
+ "pool_id": moveAddress,
755
+ "position_id": moveAddress,
756
+ "coin_a_amount": moveUint,
757
+ "coin_b_amount": moveUint,
758
+ "liquidity": moveUint
759
+ });
760
+ BluefinPoolCreatedSchema = import_zod3.z.looseObject({
761
+ "id": moveAddress,
762
+ "coin_a": moveString,
763
+ "coin_b": moveString,
764
+ "fee_rate": moveUint,
765
+ "tick_spacing": moveSmallUint
766
+ });
767
+ BluefinPositionClosedSchema = import_zod3.z.looseObject({
768
+ "pool_id": moveAddress,
769
+ "position_id": moveAddress
770
+ });
771
+ BluefinPositionOpenedSchema = import_zod3.z.looseObject({
772
+ "pool_id": moveAddress,
773
+ "position_id": moveAddress
774
+ });
775
+ BluefinRewardCollectedSchema = import_zod3.z.looseObject({
776
+ "pool_id": moveAddress,
777
+ "position_id": moveAddress,
778
+ "reward_type": moveString,
779
+ "reward_symbol": moveString,
780
+ "reward_amount": moveUint
781
+ });
782
+ BluefinSwapSchema = import_zod3.z.looseObject({
783
+ "pool_id": moveAddress,
784
+ "a2b": moveBool,
785
+ "amount_in": moveUint,
786
+ "amount_out": moveUint,
787
+ "fee": moveUint,
788
+ "after_sqrt_price": moveUint,
789
+ "sequence_number": moveUint
790
+ });
791
+ BucketBorrowSchema = import_zod3.z.looseObject({
792
+ "collateral_type": moveString,
793
+ "buck_amount": moveUint
794
+ });
795
+ BucketDepositCollateralSchema = import_zod3.z.looseObject({
796
+ "collateral_type": moveString,
797
+ "collateral_amount": moveUint
798
+ });
799
+ BucketPositionUpdatedSchema = import_zod3.z.looseObject({
800
+ "collateral_type": moveString,
801
+ "debtor": moveAddress,
802
+ "bottle_id": moveAddress,
803
+ "collateral_amount": moveUint,
804
+ "buck_amount": moveUint
805
+ });
806
+ BucketRedeemSchema = import_zod3.z.looseObject({
807
+ "collateral_type": moveString,
808
+ "input_buck_amount": moveUint,
809
+ "output_collateral_amount": moveUint
810
+ });
811
+ BucketRepaySchema = import_zod3.z.looseObject({
812
+ "collateral_type": moveString,
813
+ "buck_amount": moveUint
814
+ });
815
+ BucketSbuckDepositSchema = import_zod3.z.looseObject({
816
+ "buck_amount": moveUint,
817
+ "sbuck_share": moveUint
818
+ });
819
+ BucketSbuckRewardsSchema = import_zod3.z.looseObject({
820
+ "buck_amount": moveUint
821
+ });
822
+ BucketWithdrawCollateralSchema = import_zod3.z.looseObject({
823
+ "collateral_type": moveString,
824
+ "collateral_amount": moveUint
825
+ });
826
+ CetusAddLiquiditySchema = import_zod3.z.looseObject({
827
+ "pool": moveAddress,
828
+ "position": moveAddress,
829
+ "liquidity": moveUint,
830
+ "after_liquidity": moveUint,
831
+ "amount_a": moveUint,
832
+ "amount_b": moveUint
833
+ });
834
+ CetusClosePositionSchema = import_zod3.z.looseObject({
835
+ "pool": moveAddress,
836
+ "position": moveAddress
837
+ });
838
+ CetusCollectFeeSchema = import_zod3.z.looseObject({
839
+ "position": moveAddress,
840
+ "pool": moveAddress,
841
+ "amount_a": moveUint,
842
+ "amount_b": moveUint
843
+ });
844
+ CetusCreatePoolSchema = import_zod3.z.looseObject({
845
+ "pool_id": moveAddress,
846
+ "coin_type_a": moveString,
847
+ "coin_type_b": moveString,
848
+ "tick_spacing": moveSmallUint
849
+ });
850
+ CetusOpenPositionSchema = import_zod3.z.looseObject({
851
+ "pool": moveAddress,
852
+ "position": moveAddress
853
+ });
854
+ CetusRemoveLiquiditySchema = import_zod3.z.looseObject({
855
+ "pool": moveAddress,
856
+ "position": moveAddress,
857
+ "liquidity": moveUint,
858
+ "after_liquidity": moveUint,
859
+ "amount_a": moveUint,
860
+ "amount_b": moveUint
861
+ });
862
+ CetusSwapSchema = import_zod3.z.looseObject({
863
+ "atob": moveBool,
864
+ "pool": moveAddress,
865
+ "partner": moveAddress,
866
+ "amount_in": moveUint,
867
+ "amount_out": moveUint,
868
+ "fee_amount": moveUint,
869
+ "before_sqrt_price": moveUint,
870
+ "after_sqrt_price": moveUint,
871
+ "steps": moveUint
872
+ });
873
+ CurrentBorrowSchema = import_zod3.z.looseObject({
874
+ "borrower": moveAddress,
875
+ "market": moveTypeName,
876
+ "obligation": moveAddress,
877
+ "asset": moveTypeName,
878
+ "amount": moveUint,
879
+ "time": moveUint
880
+ });
881
+ CurrentDepositSchema = import_zod3.z.looseObject({
882
+ "minter": moveAddress,
883
+ "market": moveTypeName,
884
+ "obligation": moveAddress,
885
+ "deposit_asset": moveTypeName,
886
+ "deposit_amount": moveUint,
887
+ "ctoken_amount": moveUint,
888
+ "time": moveUint
889
+ });
890
+ CurrentLiquidateSchema = import_zod3.z.looseObject({
891
+ "liquidator": moveAddress,
892
+ "market": moveTypeName,
893
+ "obligation": moveAddress,
894
+ "collateral_type": moveTypeName,
895
+ "debt_type": moveTypeName,
896
+ "seized_collateral_amount": moveUint,
897
+ "repay_amount": moveUint,
898
+ "refund_amount": moveUint,
899
+ "timestamp": moveUint
900
+ });
901
+ CurrentRepaySchema = import_zod3.z.looseObject({
902
+ "repayer": moveAddress,
903
+ "market": moveTypeName,
904
+ "obligation": moveAddress,
905
+ "asset": moveTypeName,
906
+ "amount": moveUint,
907
+ "refund": moveUint,
908
+ "time": moveUint
909
+ });
910
+ CurrentWithdrawSchema = import_zod3.z.looseObject({
911
+ "redeemer": moveAddress,
912
+ "market": moveTypeName,
913
+ "obligation": moveAddress,
914
+ "withdraw_asset": moveTypeName,
915
+ "withdraw_amount": moveUint,
916
+ "time": moveUint
917
+ });
918
+ DeepbookBalanceSchema = import_zod3.z.looseObject({
919
+ "balance_manager_id": moveAddress,
920
+ "asset": moveTypeName,
921
+ "amount": moveUint,
922
+ "deposit": moveBool
923
+ });
924
+ DeepbookFlashLoanSchema = import_zod3.z.looseObject({
925
+ "pool_id": moveAddress,
926
+ "borrow_quantity": moveUint,
927
+ "type_name": moveTypeName
928
+ });
929
+ DeepbookOrderCanceledSchema = import_zod3.z.looseObject({
930
+ "balance_manager_id": moveAddress,
931
+ "pool_id": moveAddress,
932
+ "order_id": moveUint,
933
+ "trader": moveAddress,
934
+ "price": moveUint,
935
+ "is_bid": moveBool,
936
+ "original_quantity": moveUint,
937
+ "base_asset_quantity_canceled": moveUint,
938
+ "timestamp": moveUint
939
+ });
940
+ DeepbookOrderFilledSchema = import_zod3.z.looseObject({
941
+ "pool_id": moveAddress,
942
+ "maker_order_id": moveUint,
943
+ "taker_order_id": moveUint,
944
+ "price": moveUint,
945
+ "taker_is_bid": moveBool,
946
+ "base_quantity": moveUint,
947
+ "quote_quantity": moveUint,
948
+ "taker_fee": moveUint,
949
+ "maker_fee": moveUint,
950
+ "timestamp": moveUint
951
+ });
952
+ DeepbookOrderInfoSchema = import_zod3.z.looseObject({
953
+ "pool_id": moveAddress,
954
+ "order_id": moveUint,
955
+ "balance_manager_id": moveAddress,
956
+ "client_order_id": moveUint,
957
+ "trader": moveAddress,
958
+ "order_type": moveSmallUint,
959
+ "price": moveUint,
960
+ "is_bid": moveBool,
961
+ "original_quantity": moveUint,
962
+ "executed_quantity": moveUint,
963
+ "status": moveSmallUint,
964
+ "timestamp": moveUint
965
+ });
966
+ DeepbookOrderPlacedSchema = import_zod3.z.looseObject({
967
+ "balance_manager_id": moveAddress,
968
+ "pool_id": moveAddress,
969
+ "order_id": moveUint,
970
+ "client_order_id": moveUint,
971
+ "trader": moveAddress,
972
+ "price": moveUint,
973
+ "is_bid": moveBool,
974
+ "placed_quantity": moveUint,
975
+ "expire_timestamp": moveUint,
976
+ "timestamp": moveUint
977
+ });
978
+ EmberDepositSchema = import_zod3.z.looseObject({
979
+ "vault_id": moveAddress,
980
+ "owner": moveAddress,
981
+ "total_amount": moveUint,
982
+ "shares_minted": moveUint,
983
+ "current_balance": moveUint,
984
+ "total_shares": moveUint,
985
+ "sequence_number": moveUint
986
+ });
987
+ EmberRateUpdatedSchema = import_zod3.z.looseObject({
988
+ "vault_id": moveAddress,
989
+ "previous_rate": moveUint,
990
+ "new_rate": moveUint,
991
+ "sequence_number": moveUint
992
+ });
993
+ EmberRedeemProcessedSchema = import_zod3.z.looseObject({
994
+ "vault_id": moveAddress,
995
+ "owner": moveAddress,
996
+ "receiver": moveAddress,
997
+ "shares": moveUint,
998
+ "withdraw_amount": moveUint,
999
+ "skipped": moveBool,
1000
+ "cancelled": moveBool,
1001
+ "sequence_number": moveUint
1002
+ });
1003
+ EmberRedeemRequestSchema = import_zod3.z.looseObject({
1004
+ "vault_id": moveAddress,
1005
+ "owner": moveAddress,
1006
+ "receiver": moveAddress,
1007
+ "shares": moveUint,
1008
+ "total_shares": moveUint,
1009
+ "sequence_number": moveUint
1010
+ });
1011
+ FlowxAmmPairCreatedSchema = import_zod3.z.looseObject({
1012
+ "user": moveAddress,
1013
+ "coin_x": moveString,
1014
+ "coin_y": moveString
1015
+ });
1016
+ FlowxAmmSwapSchema = import_zod3.z.looseObject({
1017
+ "user": moveAddress,
1018
+ "coin_x": moveString,
1019
+ "coin_y": moveString,
1020
+ "amount_x_in": moveUint,
1021
+ "amount_y_in": moveUint,
1022
+ "amount_x_out": moveUint,
1023
+ "amount_y_out": moveUint
1024
+ });
1025
+ FlowxClmmPoolCreatedSchema = import_zod3.z.looseObject({
1026
+ "sender": moveAddress,
1027
+ "pool_id": moveAddress,
1028
+ "coin_type_x": moveTypeName,
1029
+ "coin_type_y": moveTypeName,
1030
+ "fee_rate": moveUint,
1031
+ "tick_spacing": moveSmallUint
1032
+ });
1033
+ FlowxClmmSwapSchema = import_zod3.z.looseObject({
1034
+ "sender": moveAddress,
1035
+ "pool_id": moveAddress,
1036
+ "x_for_y": moveBool,
1037
+ "amount_x": moveUint,
1038
+ "amount_y": moveUint,
1039
+ "liquidity": moveUint,
1040
+ "fee_amount": moveUint
1041
+ });
1042
+ HaedalInstantUnstakedSchema = import_zod3.z.looseObject({
1043
+ "owner": moveAddress,
1044
+ "sui_amount": moveUint,
1045
+ "st_amount": moveUint
1046
+ });
1047
+ HaedalStakedSchema = import_zod3.z.looseObject({
1048
+ "owner": moveAddress,
1049
+ "sui_amount": moveUint,
1050
+ "st_amount": moveUint,
1051
+ "validator": moveAddress
1052
+ });
1053
+ HaedalUnstakedSchema = import_zod3.z.looseObject({
1054
+ "owner": moveAddress,
1055
+ "epoch": moveUint,
1056
+ "sui_amount": moveUint,
1057
+ "st_amount": moveUint
1058
+ });
1059
+ KaiAddLiquiditySchema = import_zod3.z.looseObject({
1060
+ "position_id": moveAddress,
1061
+ "sqrt_pool_price_x64": moveUint,
1062
+ "delta_l": moveUint,
1063
+ "delta_x": moveUint,
1064
+ "delta_y": moveUint
1065
+ });
1066
+ KaiDeleverageSchema = import_zod3.z.looseObject({
1067
+ "position_id": moveAddress,
1068
+ "delta_l": moveUint,
1069
+ "delta_x": moveUint,
1070
+ "delta_y": moveUint,
1071
+ "x_repaid": moveUint,
1072
+ "y_repaid": moveUint
1073
+ });
1074
+ KaiLiquidationSchema = import_zod3.z.looseObject({
1075
+ "position_id": moveAddress,
1076
+ "x_repaid": moveUint,
1077
+ "y_repaid": moveUint,
1078
+ "liquidator_reward_x": moveUint,
1079
+ "liquidator_reward_y": moveUint,
1080
+ "liquidation_fee_x": moveUint,
1081
+ "liquidation_fee_y": moveUint
1082
+ });
1083
+ KaiPositionOpenSchema = import_zod3.z.looseObject({
1084
+ "position_id": moveAddress,
1085
+ "config_id": moveAddress,
1086
+ "x0": moveUint,
1087
+ "y0": moveUint,
1088
+ "cx": moveUint,
1089
+ "cy": moveUint,
1090
+ "dx": moveUint,
1091
+ "dy": moveUint,
1092
+ "l": moveUint,
1093
+ "creation_fee_amt_sui": moveUint
1094
+ });
1095
+ KaiReduceSchema = import_zod3.z.looseObject({
1096
+ "position_id": moveAddress,
1097
+ "delta_l": moveUint,
1098
+ "delta_x": moveUint,
1099
+ "delta_y": moveUint,
1100
+ "withdrawn_x": moveUint,
1101
+ "withdrawn_y": moveUint,
1102
+ "x_repaid": moveUint,
1103
+ "y_repaid": moveUint
1104
+ });
1105
+ KaiSupplySchema = import_zod3.z.looseObject({
1106
+ "supply_pool_id": moveAddress,
1107
+ "deposited": moveUint,
1108
+ "share_balance": moveUint
1109
+ });
1110
+ KaiSupplyWithdrawSchema = import_zod3.z.looseObject({
1111
+ "supply_pool_id": moveAddress,
1112
+ "share_balance": moveUint,
1113
+ "withdrawn": moveUint
1114
+ });
1115
+ KriyaAddLiquiditySchema = import_zod3.z.looseObject({
1116
+ "pool_id": moveAddress,
1117
+ "liquidity_provider": moveAddress,
1118
+ "amount_x": moveUint,
1119
+ "amount_y": moveUint,
1120
+ "lsp_minted": moveUint
1121
+ });
1122
+ KriyaSwapSchema = import_zod3.z.looseObject({
1123
+ "pool_id": moveAddress,
1124
+ "user": moveAddress,
1125
+ "reserve_x": moveUint,
1126
+ "reserve_y": moveUint,
1127
+ "amount_in": moveUint,
1128
+ "amount_out": moveUint
1129
+ });
1130
+ MagmaAddLiquiditySchema = import_zod3.z.looseObject({
1131
+ "pool": moveAddress,
1132
+ "position": moveAddress,
1133
+ "liquidity": moveUint,
1134
+ "after_liquidity": moveUint,
1135
+ "amount_a": moveUint,
1136
+ "amount_b": moveUint
1137
+ });
1138
+ MagmaCollectFeeSchema = import_zod3.z.looseObject({
1139
+ "position": moveAddress,
1140
+ "pool": moveAddress,
1141
+ "amount_a": moveUint,
1142
+ "amount_b": moveUint
1143
+ });
1144
+ MagmaCollectRewardSchema = import_zod3.z.looseObject({
1145
+ "position": moveAddress,
1146
+ "pool": moveAddress,
1147
+ "amount": moveUint
1148
+ });
1149
+ MagmaCreatePoolSchema = import_zod3.z.looseObject({
1150
+ "pool_id": moveAddress,
1151
+ "coin_type_a": moveString,
1152
+ "coin_type_b": moveString,
1153
+ "tick_spacing": moveSmallUint
1154
+ });
1155
+ MagmaRemoveLiquiditySchema = import_zod3.z.looseObject({
1156
+ "pool": moveAddress,
1157
+ "position": moveAddress,
1158
+ "liquidity": moveUint,
1159
+ "after_liquidity": moveUint,
1160
+ "amount_a": moveUint,
1161
+ "amount_b": moveUint
1162
+ });
1163
+ MagmaSwapSchema = import_zod3.z.looseObject({
1164
+ "atob": moveBool,
1165
+ "pool": moveAddress,
1166
+ "partner": moveAddress,
1167
+ "amount_in": moveUint,
1168
+ "amount_out": moveUint,
1169
+ "fee_amount": moveUint,
1170
+ "before_sqrt_price": moveUint,
1171
+ "after_sqrt_price": moveUint,
1172
+ "steps": moveUint
1173
+ });
1174
+ MoleAddDebtSchema = import_zod3.z.looseObject({
1175
+ "id": moveUint,
1176
+ "debt_share": moveUint
1177
+ });
1178
+ MoleDepositSchema = import_zod3.z.looseObject({
1179
+ "account": moveAddress,
1180
+ "amount": moveUint,
1181
+ "share": moveUint
1182
+ });
1183
+ MoleHarvestSchema = import_zod3.z.looseObject({
1184
+ "user": moveAddress,
1185
+ "pid": moveUint,
1186
+ "amount": moveUint,
1187
+ "action_type": moveUint
1188
+ });
1189
+ MoleKillSchema = import_zod3.z.looseObject({
1190
+ "id": moveUint,
1191
+ "killer": moveAddress,
1192
+ "owner": moveAddress,
1193
+ "posVal": moveUint,
1194
+ "debt": moveUint,
1195
+ "prize": moveUint,
1196
+ "left": moveUint
1197
+ });
1198
+ MoleWithdrawSchema = import_zod3.z.looseObject({
1199
+ "account": moveAddress,
1200
+ "share": moveUint,
1201
+ "amount": moveUint
1202
+ });
1203
+ MoleWorkSchema = import_zod3.z.looseObject({
1204
+ "id": moveUint,
1205
+ "loan": moveUint
1206
+ });
1207
+ MomentumAddLiquiditySchema = import_zod3.z.looseObject({
1208
+ "sender": moveAddress,
1209
+ "pool_id": moveAddress,
1210
+ "position_id": moveAddress,
1211
+ "liquidity": moveUint,
1212
+ "amount_x": moveUint,
1213
+ "amount_y": moveUint
1214
+ });
1215
+ MomentumCollectFeeSchema = import_zod3.z.looseObject({
1216
+ "sender": moveAddress,
1217
+ "pool_id": moveAddress,
1218
+ "position_id": moveAddress,
1219
+ "amount_x": moveUint,
1220
+ "amount_y": moveUint
1221
+ });
1222
+ MomentumCollectRewardSchema = import_zod3.z.looseObject({
1223
+ "sender": moveAddress,
1224
+ "pool_id": moveAddress,
1225
+ "position_id": moveAddress,
1226
+ "reward_coin_type": moveTypeName,
1227
+ "amount": moveUint
1228
+ });
1229
+ MomentumPoolCreatedSchema = import_zod3.z.looseObject({
1230
+ "sender": moveAddress,
1231
+ "pool_id": moveAddress,
1232
+ "type_x": moveTypeName,
1233
+ "type_y": moveTypeName,
1234
+ "fee_rate": moveUint,
1235
+ "tick_spacing": moveSmallUint
1236
+ });
1237
+ MomentumRemoveLiquiditySchema = import_zod3.z.looseObject({
1238
+ "sender": moveAddress,
1239
+ "pool_id": moveAddress,
1240
+ "position_id": moveAddress,
1241
+ "liquidity": moveUint,
1242
+ "amount_x": moveUint,
1243
+ "amount_y": moveUint
1244
+ });
1245
+ MomentumRepayFlashSwapSchema = import_zod3.z.looseObject({
1246
+ "sender": moveAddress,
1247
+ "pool_id": moveAddress,
1248
+ "amount_x_debt": moveUint,
1249
+ "amount_y_debt": moveUint,
1250
+ "paid_x": moveUint,
1251
+ "paid_y": moveUint,
1252
+ "reserve_x": moveUint,
1253
+ "reserve_y": moveUint
1254
+ });
1255
+ MomentumSwapSchema = import_zod3.z.looseObject({
1256
+ "sender": moveAddress,
1257
+ "pool_id": moveAddress,
1258
+ "x_for_y": moveBool,
1259
+ "amount_x": moveUint,
1260
+ "amount_y": moveUint,
1261
+ "fee_amount": moveUint,
1262
+ "liquidity": moveUint
1263
+ });
1264
+ NaviBorrowSchema = import_zod3.z.looseObject({
1265
+ "reserve": moveSmallUint,
1266
+ "sender": moveAddress,
1267
+ "amount": moveUint,
1268
+ "market_id": moveUint
1269
+ });
1270
+ NaviDepositSchema = import_zod3.z.looseObject({
1271
+ "reserve": moveSmallUint,
1272
+ "sender": moveAddress,
1273
+ "amount": moveUint,
1274
+ "market_id": moveUint
1275
+ });
1276
+ NaviLiquidationSchema = import_zod3.z.looseObject({
1277
+ "sender": moveAddress,
1278
+ "user": moveAddress,
1279
+ "collateral_asset": moveSmallUint,
1280
+ "collateral_amount": moveUint,
1281
+ "debt_asset": moveSmallUint,
1282
+ "debt_amount": moveUint,
1283
+ "market_id": moveUint
1284
+ });
1285
+ NaviRepaySchema = import_zod3.z.looseObject({
1286
+ "reserve": moveSmallUint,
1287
+ "sender": moveAddress,
1288
+ "amount": moveUint,
1289
+ "market_id": moveUint
1290
+ });
1291
+ NaviWithdrawSchema = import_zod3.z.looseObject({
1292
+ "reserve": moveSmallUint,
1293
+ "sender": moveAddress,
1294
+ "to": moveAddress,
1295
+ "amount": moveUint,
1296
+ "market_id": moveUint
1297
+ });
1298
+ PythPriceFeedUpdateSchema = import_zod3.z.looseObject({
1299
+ "price_feed": import_zod3.z.unknown(),
1300
+ "timestamp": moveUint
1301
+ });
1302
+ ScallopBorrowSchema = import_zod3.z.looseObject({
1303
+ "borrower": moveAddress,
1304
+ "obligation": moveAddress,
1305
+ "asset": moveTypeName,
1306
+ "amount": moveUint,
1307
+ "borrow_fee": moveUint,
1308
+ "time": moveUint
1309
+ });
1310
+ ScallopCollateralDepositSchema = import_zod3.z.looseObject({
1311
+ "provider": moveAddress,
1312
+ "obligation": moveAddress,
1313
+ "deposit_asset": moveTypeName,
1314
+ "deposit_amount": moveUint
1315
+ });
1316
+ ScallopCollateralWithdrawSchema = import_zod3.z.looseObject({
1317
+ "taker": moveAddress,
1318
+ "obligation": moveAddress,
1319
+ "withdraw_asset": moveTypeName,
1320
+ "withdraw_amount": moveUint
1321
+ });
1322
+ ScallopLiquidationSchema = import_zod3.z.looseObject({
1323
+ "liquidator": moveAddress,
1324
+ "obligation": moveAddress,
1325
+ "debt_type": moveTypeName,
1326
+ "collateral_type": moveTypeName,
1327
+ "repay_on_behalf": moveUint,
1328
+ "liq_amount": moveUint,
1329
+ "timestamp": moveUint
1330
+ });
1331
+ ScallopRepaySchema = import_zod3.z.looseObject({
1332
+ "repayer": moveAddress,
1333
+ "obligation": moveAddress,
1334
+ "asset": moveTypeName,
1335
+ "amount": moveUint,
1336
+ "time": moveUint
1337
+ });
1338
+ SpringsuiEpochChangedSchema = import_zod3.z.looseObject({
1339
+ "event": import_zod3.z.looseObject({
1340
+ "typename": moveTypeName,
1341
+ "old_sui_supply": moveUint,
1342
+ "new_sui_supply": moveUint,
1343
+ "lst_supply": moveUint,
1344
+ "spread_fee": moveUint
1345
+ })
1346
+ });
1347
+ SpringsuiStakeSchema = import_zod3.z.looseObject({
1348
+ "event": import_zod3.z.looseObject({
1349
+ "typename": moveTypeName,
1350
+ "sui_amount_in": moveUint,
1351
+ "lst_amount_out": moveUint,
1352
+ "fee_amount": moveUint
1353
+ })
1354
+ });
1355
+ SpringsuiUnstakeSchema = import_zod3.z.looseObject({
1356
+ "event": import_zod3.z.looseObject({
1357
+ "typename": moveTypeName,
1358
+ "lst_amount_in": moveUint,
1359
+ "sui_amount_out": moveUint,
1360
+ "fee_amount": moveUint
1361
+ })
1362
+ });
1363
+ SteammBankDepositSchema = import_zod3.z.looseObject({
1364
+ "event": import_zod3.z.looseObject({
1365
+ "user": moveAddress,
1366
+ "bank_id": moveAddress,
1367
+ "lending_market_id": moveAddress,
1368
+ "deposited_amount": moveUint,
1369
+ "minted_amount": moveUint
1370
+ })
1371
+ });
1372
+ SteammBankWithdrawSchema = import_zod3.z.looseObject({
1373
+ "event": import_zod3.z.looseObject({
1374
+ "user": moveAddress,
1375
+ "bank_id": moveAddress,
1376
+ "lending_market_id": moveAddress,
1377
+ "withdrawn_amount": moveUint,
1378
+ "burned_amount": moveUint
1379
+ })
1380
+ });
1381
+ SuilendBorrowSchema = import_zod3.z.looseObject({
1382
+ "lending_market_id": moveAddress,
1383
+ "coin_type": moveTypeName,
1384
+ "reserve_id": moveAddress,
1385
+ "obligation_id": moveAddress,
1386
+ "liquidity_amount": moveUint,
1387
+ "origination_fee_amount": moveUint
1388
+ });
1389
+ SuilendClaimRewardSchema = import_zod3.z.looseObject({
1390
+ "lending_market_id": moveAddress,
1391
+ "reserve_id": moveAddress,
1392
+ "obligation_id": moveAddress,
1393
+ "is_deposit_reward": moveBool,
1394
+ "coin_type": moveTypeName,
1395
+ "liquidity_amount": moveUint
1396
+ });
1397
+ SuilendDepositSchema = import_zod3.z.looseObject({
1398
+ "lending_market_id": moveAddress,
1399
+ "coin_type": moveTypeName,
1400
+ "reserve_id": moveAddress,
1401
+ "obligation_id": moveAddress,
1402
+ "ctoken_amount": moveUint
1403
+ });
1404
+ SuilendLiquidateSchema = import_zod3.z.looseObject({
1405
+ "lending_market_id": moveAddress,
1406
+ "obligation_id": moveAddress,
1407
+ "repay_amount": moveUint,
1408
+ "withdraw_amount": moveUint,
1409
+ "protocol_fee_amount": moveUint,
1410
+ "liquidator_bonus_amount": moveUint
1411
+ });
1412
+ SuilendRepaySchema = import_zod3.z.looseObject({
1413
+ "lending_market_id": moveAddress,
1414
+ "coin_type": moveTypeName,
1415
+ "reserve_id": moveAddress,
1416
+ "obligation_id": moveAddress,
1417
+ "liquidity_amount": moveUint
1418
+ });
1419
+ SuilendWithdrawSchema = import_zod3.z.looseObject({
1420
+ "lending_market_id": moveAddress,
1421
+ "coin_type": moveTypeName,
1422
+ "reserve_id": moveAddress,
1423
+ "obligation_id": moveAddress,
1424
+ "ctoken_amount": moveUint
1425
+ });
1426
+ SupraPriceUpdateSchema = import_zod3.z.looseObject({
1427
+ "pair": moveSmallUint,
1428
+ "value": moveUint,
1429
+ "decimal": moveSmallUint,
1430
+ "timestamp": moveUint,
1431
+ "round": moveUint
1432
+ });
1433
+ TurbosAddLiquiditySchema = import_zod3.z.looseObject({
1434
+ "pool": moveAddress,
1435
+ "owner": moveAddress,
1436
+ "amount_a": moveUint,
1437
+ "amount_b": moveUint,
1438
+ "liquidity_delta": moveUint
1439
+ });
1440
+ TurbosPoolCreatedSchema = import_zod3.z.looseObject({
1441
+ "account": moveAddress,
1442
+ "pool": moveAddress,
1443
+ "fee": moveSmallUint,
1444
+ "tick_spacing": moveSmallUint,
1445
+ "sqrt_price": moveUint
1446
+ });
1447
+ TurbosRemoveLiquiditySchema = import_zod3.z.looseObject({
1448
+ "pool": moveAddress,
1449
+ "owner": moveAddress,
1450
+ "amount_a": moveUint,
1451
+ "amount_b": moveUint,
1452
+ "liquidity_delta": moveUint
1453
+ });
1454
+ TurbosSwapSchema = import_zod3.z.looseObject({
1455
+ "pool": moveAddress,
1456
+ "recipient": moveAddress,
1457
+ "amount_a": moveUint,
1458
+ "amount_b": moveUint,
1459
+ "liquidity": moveUint,
1460
+ "sqrt_price": moveUint,
1461
+ "fee_amount": moveUint,
1462
+ "a_to_b": moveBool
1463
+ });
1464
+ TypusDovAuctionSchema = import_zod3.z.looseObject({
1465
+ "signer": moveAddress,
1466
+ "index": moveUint,
1467
+ "round": moveUint,
1468
+ "start_ts_ms": moveUint,
1469
+ "end_ts_ms": moveUint,
1470
+ "size": moveUint
1471
+ });
1472
+ TypusDovBidSchema = import_zod3.z.looseObject({
1473
+ "signer": moveAddress,
1474
+ "index": moveUint,
1475
+ "bid_index": moveUint,
1476
+ "price": moveUint,
1477
+ "size": moveUint,
1478
+ "ts_ms": moveUint
1479
+ });
1480
+ TypusDovSettleSchema = import_zod3.z.looseObject({
1481
+ "signer": moveAddress,
1482
+ "index": moveUint,
1483
+ "round": moveUint,
1484
+ "oracle_price": moveUint,
1485
+ "settle_balance": moveUint,
1486
+ "settled_balance": moveUint
1487
+ });
1488
+ TypusPerpFundingSchema = import_zod3.z.looseObject({
1489
+ "base_token": moveTypeName,
1490
+ "new_funding_ts_ms": moveUint,
1491
+ "cumulative_funding_rate_index": moveUint
1492
+ });
1493
+ TypusPerpLiquidateSchema = import_zod3.z.looseObject({
1494
+ "user": moveAddress,
1495
+ "position_id": moveUint,
1496
+ "collateral_price": moveUint,
1497
+ "trading_price": moveUint,
1498
+ "realized_liquidator_fee": moveUint
1499
+ });
1500
+ TypusPerpLpBurnSchema = import_zod3.z.looseObject({
1501
+ "sender": moveAddress,
1502
+ "index": moveUint,
1503
+ "burn_lp_amount": moveUint,
1504
+ "withdraw_token_amount": moveUint
1505
+ });
1506
+ TypusPerpLpMintSchema = import_zod3.z.looseObject({
1507
+ "sender": moveAddress,
1508
+ "index": moveUint,
1509
+ "deposit_amount": moveUint,
1510
+ "minted_lp_amount": moveUint
1511
+ });
1512
+ TypusPerpOrderSchema = import_zod3.z.looseObject({
1513
+ "user": moveAddress,
1514
+ "market_index": moveUint,
1515
+ "pool_index": moveUint,
1516
+ "order_id": moveUint,
1517
+ "collateral_amount": moveUint,
1518
+ "leverage_mbp": moveUint,
1519
+ "is_long": moveBool,
1520
+ "size": moveUint,
1521
+ "trigger_price": moveUint
1522
+ });
1523
+ VoloStakedSchema = import_zod3.z.looseObject({
1524
+ "staker": moveAddress,
1525
+ "sui_amount": moveUint,
1526
+ "cert_amount": moveUint
1527
+ });
1528
+ VoloUnstakedSchema = import_zod3.z.looseObject({
1529
+ "staker": moveAddress,
1530
+ "cert_amount": moveUint,
1531
+ "sui_amount": moveUint
1532
+ });
1533
+ WalrusBlobCertifiedSchema = import_zod3.z.looseObject({
1534
+ "epoch": moveSmallUint,
1535
+ "blob_id": moveUint,
1536
+ "end_epoch": moveSmallUint,
1537
+ "deletable": moveBool,
1538
+ "object_id": moveAddress
1539
+ });
1540
+ WalrusBlobDeletedSchema = import_zod3.z.looseObject({
1541
+ "epoch": moveSmallUint,
1542
+ "blob_id": moveUint,
1543
+ "end_epoch": moveSmallUint,
1544
+ "object_id": moveAddress,
1545
+ "was_certified": moveBool
1546
+ });
1547
+ WalrusBlobRegisteredSchema = import_zod3.z.looseObject({
1548
+ "epoch": moveSmallUint,
1549
+ "blob_id": moveUint,
1550
+ "size": moveUint,
1551
+ "end_epoch": moveSmallUint,
1552
+ "deletable": moveBool,
1553
+ "object_id": moveAddress
1554
+ });
1555
+ catalogEvents = {
1556
+ "7k.confirm-swap": {
1557
+ id: "7k.confirm-swap",
1558
+ protocolId: "7k",
1559
+ label: "7K \u2014 Swap confirmed",
1560
+ category: "swap",
1561
+ description: "A completed 7K aggregator trade (per-trade settlement summary).",
1562
+ generic: false,
1563
+ schema: _7kConfirmSwapSchema,
1564
+ deployments: [
1565
+ { network: "mainnet", eventType: "0x33ec64e9bb369bf045ddc198c81adbf2acab424da37465d95296ee02045d2b17::router::ConfirmSwapEvent", primary: true }
1566
+ ]
1567
+ },
1568
+ "7k.swap": {
1569
+ id: "7k.swap",
1570
+ protocolId: "7k",
1571
+ label: "7K \u2014 Swap (route leg)",
1572
+ category: "swap",
1573
+ description: "A single routing-leg swap on the 7K aggregator (per pool/DEX).",
1574
+ generic: false,
1575
+ schema: _7kSwapSchema,
1576
+ deployments: [
1577
+ { network: "mainnet", eventType: "0x33ec64e9bb369bf045ddc198c81adbf2acab424da37465d95296ee02045d2b17::router::SwapEvent", primary: true }
1578
+ ]
1579
+ },
1580
+ "aftermath.deposit": {
1581
+ id: "aftermath.deposit",
1582
+ protocolId: "aftermath",
1583
+ label: "Aftermath \u2014 Add liquidity",
1584
+ category: "liquidity",
1585
+ description: "Liquidity was deposited into an Aftermath AMM pool.",
1586
+ generic: false,
1587
+ schema: AftermathDepositSchema,
1588
+ deployments: [
1589
+ { network: "mainnet", eventType: "0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd::events::DepositEventV2", primary: true }
1590
+ ]
1591
+ },
1592
+ "aftermath.perp-funding": {
1593
+ id: "aftermath.perp-funding",
1594
+ protocolId: "aftermath",
1595
+ label: "Aftermath \u2014 Funding settled (Perps)",
1596
+ category: "funding",
1597
+ description: "Funding was settled for an Aftermath perpetuals account.",
1598
+ generic: false,
1599
+ schema: AftermathPerpFundingSchema,
1600
+ deployments: [
1601
+ { network: "mainnet", eventType: "0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068::events::SettledFunding", primary: true }
1602
+ ]
1603
+ },
1604
+ "aftermath.perp-liquidated": {
1605
+ id: "aftermath.perp-liquidated",
1606
+ protocolId: "aftermath",
1607
+ label: "Aftermath \u2014 Position liquidated (Perps)",
1608
+ category: "liquidation",
1609
+ description: "A perpetuals position was liquidated on Aftermath.",
1610
+ generic: false,
1611
+ schema: AftermathPerpLiquidatedSchema,
1612
+ deployments: [
1613
+ { network: "mainnet", eventType: "0x21d001e8b07da2e3facb3e2d636bbaef43ba3c978bd84810368840b7d57c5068::events::LiquidatedPosition", primary: true }
1614
+ ]
1615
+ },
1616
+ "aftermath.swap": {
1617
+ id: "aftermath.swap",
1618
+ protocolId: "aftermath",
1619
+ label: "Aftermath \u2014 Swap",
1620
+ category: "swap",
1621
+ description: "A swap was executed on an Aftermath AMM pool.",
1622
+ generic: false,
1623
+ schema: AftermathSwapSchema,
1624
+ deployments: [
1625
+ { network: "mainnet", eventType: "0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd::events::SwapEventV2", primary: true }
1626
+ ]
1627
+ },
1628
+ "alphafi.liquidity-change": {
1629
+ id: "alphafi.liquidity-change",
1630
+ protocolId: "alphafi",
1631
+ label: "AlphaFi \u2014 Vault deposit/withdraw",
1632
+ category: "vault",
1633
+ description: "A deposit or withdrawal on an AlphaFi vault (event_type: 1 = deposit, 0 = withdraw).",
1634
+ generic: false,
1635
+ schema: AlphafiLiquidityChangeSchema,
1636
+ deployments: [
1637
+ { network: "mainnet", eventType: "0x754afbce8c72c8e491e3b9d536aa9d9766fdbc68650224ce01072189b235eee3::alphafi_bluefin_type_1_pool::LiquidityChangeEvent", primary: true }
1638
+ ]
1639
+ },
1640
+ "alphafi.reward": {
1641
+ id: "alphafi.reward",
1642
+ protocolId: "alphafi",
1643
+ label: "AlphaFi \u2014 Reward harvest",
1644
+ category: "reward",
1645
+ description: "An AlphaFi vault auto-compounded its rewards.",
1646
+ generic: false,
1647
+ schema: AlphafiRewardSchema,
1648
+ deployments: [
1649
+ { network: "mainnet", eventType: "0x830ce657bd8547460bdb1a5e5a7607d4641a73593a23165c8630c0d310a3f306::alphafi_bluefin_type_1_pool::RewardEvent", primary: true }
1650
+ ]
1651
+ },
1652
+ "bluefin.fee-collected": {
1653
+ id: "bluefin.fee-collected",
1654
+ protocolId: "bluefin",
1655
+ label: "Bluefin \u2014 Fee collected",
1656
+ category: "fee",
1657
+ description: "Trading fees were collected from a Bluefin position.",
1658
+ generic: false,
1659
+ schema: BluefinFeeCollectedSchema,
1660
+ deployments: [
1661
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::UserFeeCollected", primary: true }
1662
+ ]
1663
+ },
1664
+ "bluefin.liquidity-provided": {
1665
+ id: "bluefin.liquidity-provided",
1666
+ protocolId: "bluefin",
1667
+ label: "Bluefin \u2014 Liquidity provided",
1668
+ category: "liquidity",
1669
+ description: "Liquidity was provided to a Bluefin position.",
1670
+ generic: false,
1671
+ schema: BluefinLiquidityProvidedSchema,
1672
+ deployments: [
1673
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::LiquidityProvided", primary: true }
1674
+ ]
1675
+ },
1676
+ "bluefin.liquidity-removed": {
1677
+ id: "bluefin.liquidity-removed",
1678
+ protocolId: "bluefin",
1679
+ label: "Bluefin \u2014 Liquidity removed",
1680
+ category: "liquidity",
1681
+ description: "Liquidity was removed from a Bluefin position.",
1682
+ generic: false,
1683
+ schema: BluefinLiquidityRemovedSchema,
1684
+ deployments: [
1685
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::LiquidityRemoved", primary: true }
1686
+ ]
1687
+ },
1688
+ "bluefin.pool-created": {
1689
+ id: "bluefin.pool-created",
1690
+ protocolId: "bluefin",
1691
+ label: "Bluefin \u2014 Pool created",
1692
+ category: "pool",
1693
+ description: "A new Bluefin spot pool was created.",
1694
+ generic: false,
1695
+ schema: BluefinPoolCreatedSchema,
1696
+ deployments: [
1697
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::PoolCreated", primary: true }
1698
+ ]
1699
+ },
1700
+ "bluefin.position-closed": {
1701
+ id: "bluefin.position-closed",
1702
+ protocolId: "bluefin",
1703
+ label: "Bluefin \u2014 Position closed",
1704
+ category: "position",
1705
+ description: "A Bluefin liquidity position was closed.",
1706
+ generic: false,
1707
+ schema: BluefinPositionClosedSchema,
1708
+ deployments: [
1709
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::PositionClosed", primary: true }
1710
+ ]
1711
+ },
1712
+ "bluefin.position-opened": {
1713
+ id: "bluefin.position-opened",
1714
+ protocolId: "bluefin",
1715
+ label: "Bluefin \u2014 Position opened",
1716
+ category: "position",
1717
+ description: "A new Bluefin liquidity position was opened.",
1718
+ generic: false,
1719
+ schema: BluefinPositionOpenedSchema,
1720
+ deployments: [
1721
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::PositionOpened", primary: true }
1722
+ ]
1723
+ },
1724
+ "bluefin.reward-collected": {
1725
+ id: "bluefin.reward-collected",
1726
+ protocolId: "bluefin",
1727
+ label: "Bluefin \u2014 Reward collected",
1728
+ category: "reward",
1729
+ description: "Incentive rewards were collected from a Bluefin position.",
1730
+ generic: false,
1731
+ schema: BluefinRewardCollectedSchema,
1732
+ deployments: [
1733
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::UserRewardCollected", primary: true }
1734
+ ]
1735
+ },
1736
+ "bluefin.swap": {
1737
+ id: "bluefin.swap",
1738
+ protocolId: "bluefin",
1739
+ label: "Bluefin \u2014 Swap",
1740
+ category: "swap",
1741
+ description: "An asset swap was executed on a Bluefin spot pool.",
1742
+ generic: false,
1743
+ schema: BluefinSwapSchema,
1744
+ deployments: [
1745
+ { network: "mainnet", eventType: "0x3492c874c1e3b3e2984e8c41b589e642d4d0a5d6459e5a9cfc2d52fd7c89c267::events::AssetSwap", primary: true }
1746
+ ]
1747
+ },
1748
+ "bucket.borrow": {
1749
+ id: "bucket.borrow",
1750
+ protocolId: "bucket",
1751
+ label: "Bucket \u2014 Borrow (mint BUCK)",
1752
+ category: "borrow",
1753
+ description: "BUCK was minted against collateral in a Bucket CDP.",
1754
+ generic: false,
1755
+ schema: BucketBorrowSchema,
1756
+ deployments: [
1757
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck_events::BuckMinted", primary: true }
1758
+ ]
1759
+ },
1760
+ "bucket.deposit-collateral": {
1761
+ id: "bucket.deposit-collateral",
1762
+ protocolId: "bucket",
1763
+ label: "Bucket \u2014 Deposit collateral",
1764
+ category: "supply",
1765
+ description: "Collateral was added to a Bucket CDP.",
1766
+ generic: false,
1767
+ schema: BucketDepositCollateralSchema,
1768
+ deployments: [
1769
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck_events::CollateralIncreased", primary: true }
1770
+ ]
1771
+ },
1772
+ "bucket.position-updated": {
1773
+ id: "bucket.position-updated",
1774
+ protocolId: "bucket",
1775
+ label: "Bucket \u2014 Position updated",
1776
+ category: "position",
1777
+ description: "A Bucket CDP position (bottle) changed state.",
1778
+ generic: false,
1779
+ schema: BucketPositionUpdatedSchema,
1780
+ deployments: [
1781
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bucket_events::BottleUpdated", primary: true }
1782
+ ]
1783
+ },
1784
+ "bucket.redeem": {
1785
+ id: "bucket.redeem",
1786
+ protocolId: "bucket",
1787
+ label: "Bucket \u2014 Redeem",
1788
+ category: "liquidation",
1789
+ description: "BUCK was redeemed for collateral on a Bucket CDP.",
1790
+ generic: false,
1791
+ schema: BucketRedeemSchema,
1792
+ deployments: [
1793
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::bucket_events::Redeem", primary: true }
1794
+ ]
1795
+ },
1796
+ "bucket.repay": {
1797
+ id: "bucket.repay",
1798
+ protocolId: "bucket",
1799
+ label: "Bucket \u2014 Repay (burn BUCK)",
1800
+ category: "repay",
1801
+ description: "BUCK was burned to repay debt in a Bucket CDP.",
1802
+ generic: false,
1803
+ schema: BucketRepaySchema,
1804
+ deployments: [
1805
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck_events::BuckBurnt", primary: true }
1806
+ ]
1807
+ },
1808
+ "bucket.sbuck-deposit": {
1809
+ id: "bucket.sbuck-deposit",
1810
+ protocolId: "bucket",
1811
+ label: "Bucket \u2014 sBUCK deposit",
1812
+ category: "supply",
1813
+ description: "BUCK was deposited into the sBUCK savings vault.",
1814
+ generic: false,
1815
+ schema: BucketSbuckDepositSchema,
1816
+ deployments: [
1817
+ { network: "mainnet", eventType: "0x1798f84ee72176114ddbf5525a6d964c5f8ea1b3738d08d50d0d3de4cf584884::event::Deposit", primary: true }
1818
+ ]
1819
+ },
1820
+ "bucket.sbuck-rewards": {
1821
+ id: "bucket.sbuck-rewards",
1822
+ protocolId: "bucket",
1823
+ label: "Bucket \u2014 sBUCK rewards collected",
1824
+ category: "reward",
1825
+ description: "Rewards were collected from the sBUCK savings vault.",
1826
+ generic: false,
1827
+ schema: BucketSbuckRewardsSchema,
1828
+ deployments: [
1829
+ { network: "mainnet", eventType: "0x1798f84ee72176114ddbf5525a6d964c5f8ea1b3738d08d50d0d3de4cf584884::event::CollectRewards", primary: true }
1830
+ ]
1831
+ },
1832
+ "bucket.withdraw-collateral": {
1833
+ id: "bucket.withdraw-collateral",
1834
+ protocolId: "bucket",
1835
+ label: "Bucket \u2014 Withdraw collateral",
1836
+ category: "withdraw",
1837
+ description: "Collateral was removed from a Bucket CDP.",
1838
+ generic: false,
1839
+ schema: BucketWithdrawCollateralSchema,
1840
+ deployments: [
1841
+ { network: "mainnet", eventType: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck_events::CollateralDecreased", primary: true }
1842
+ ]
1843
+ },
1844
+ "cetus.add-liquidity": {
1845
+ id: "cetus.add-liquidity",
1846
+ protocolId: "cetus",
1847
+ label: "Cetus \u2014 Add liquidity",
1848
+ category: "liquidity",
1849
+ description: "Liquidity was added to a Cetus position.",
1850
+ generic: false,
1851
+ schema: CetusAddLiquiditySchema,
1852
+ deployments: [
1853
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::AddLiquidityEvent", primary: true }
1854
+ ]
1855
+ },
1856
+ "cetus.close-position": {
1857
+ id: "cetus.close-position",
1858
+ protocolId: "cetus",
1859
+ label: "Cetus \u2014 Close position",
1860
+ category: "position",
1861
+ description: "A Cetus liquidity position was closed.",
1862
+ generic: false,
1863
+ schema: CetusClosePositionSchema,
1864
+ deployments: [
1865
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::ClosePositionEvent", primary: true }
1866
+ ]
1867
+ },
1868
+ "cetus.collect-fee": {
1869
+ id: "cetus.collect-fee",
1870
+ protocolId: "cetus",
1871
+ label: "Cetus \u2014 Collect fee",
1872
+ category: "fee",
1873
+ description: "Accrued swap fees were collected from a Cetus position.",
1874
+ generic: false,
1875
+ schema: CetusCollectFeeSchema,
1876
+ deployments: [
1877
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::CollectFeeEvent", primary: true }
1878
+ ]
1879
+ },
1880
+ "cetus.create-pool": {
1881
+ id: "cetus.create-pool",
1882
+ protocolId: "cetus",
1883
+ label: "Cetus \u2014 Create pool",
1884
+ category: "pool",
1885
+ description: "A new Cetus CLMM pool was created via the factory.",
1886
+ generic: false,
1887
+ schema: CetusCreatePoolSchema,
1888
+ deployments: [
1889
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::factory::CreatePoolEvent", primary: true }
1890
+ ]
1891
+ },
1892
+ "cetus.open-position": {
1893
+ id: "cetus.open-position",
1894
+ protocolId: "cetus",
1895
+ label: "Cetus \u2014 Open position",
1896
+ category: "position",
1897
+ description: "A new Cetus liquidity position was opened.",
1898
+ generic: false,
1899
+ schema: CetusOpenPositionSchema,
1900
+ deployments: [
1901
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::OpenPositionEvent", primary: true }
1902
+ ]
1903
+ },
1904
+ "cetus.remove-liquidity": {
1905
+ id: "cetus.remove-liquidity",
1906
+ protocolId: "cetus",
1907
+ label: "Cetus \u2014 Remove liquidity",
1908
+ category: "liquidity",
1909
+ description: "Liquidity was removed from a Cetus position.",
1910
+ generic: false,
1911
+ schema: CetusRemoveLiquiditySchema,
1912
+ deployments: [
1913
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::RemoveLiquidityEvent", primary: true }
1914
+ ]
1915
+ },
1916
+ "cetus.swap": {
1917
+ id: "cetus.swap",
1918
+ protocolId: "cetus",
1919
+ label: "Cetus \u2014 Swap",
1920
+ category: "swap",
1921
+ description: "A token swap was executed on a Cetus CLMM pool.",
1922
+ generic: false,
1923
+ schema: CetusSwapSchema,
1924
+ deployments: [
1925
+ { network: "mainnet", eventType: "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::pool::SwapEvent", primary: true }
1926
+ ]
1927
+ },
1928
+ "current.borrow": {
1929
+ id: "current.borrow",
1930
+ protocolId: "current",
1931
+ label: "Current \u2014 Borrow",
1932
+ category: "borrow",
1933
+ description: "Assets were borrowed from a Current lending market.",
1934
+ generic: false,
1935
+ schema: CurrentBorrowSchema,
1936
+ deployments: [
1937
+ { network: "mainnet", eventType: "0xfe1d8929d13b00aaecd7642dec1c6d41cab82882a1b139efa46bf61dfd6380bf::borrow::BorrowEvent", primary: true }
1938
+ ]
1939
+ },
1940
+ "current.deposit": {
1941
+ id: "current.deposit",
1942
+ protocolId: "current",
1943
+ label: "Current \u2014 Deposit",
1944
+ category: "supply",
1945
+ description: "Assets were deposited (supplied) to a Current lending market.",
1946
+ generic: false,
1947
+ schema: CurrentDepositSchema,
1948
+ deployments: [
1949
+ { network: "mainnet", eventType: "0xfe1d8929d13b00aaecd7642dec1c6d41cab82882a1b139efa46bf61dfd6380bf::deposit::DepositEvent", primary: true }
1950
+ ]
1951
+ },
1952
+ "current.liquidate": {
1953
+ id: "current.liquidate",
1954
+ protocolId: "current",
1955
+ label: "Current \u2014 Liquidation",
1956
+ category: "liquidation",
1957
+ description: "A Current obligation was liquidated.",
1958
+ generic: false,
1959
+ schema: CurrentLiquidateSchema,
1960
+ deployments: [
1961
+ { network: "mainnet", eventType: "0xfe1d8929d13b00aaecd7642dec1c6d41cab82882a1b139efa46bf61dfd6380bf::liquidate::LiquidateEvent", primary: true }
1962
+ ]
1963
+ },
1964
+ "current.repay": {
1965
+ id: "current.repay",
1966
+ protocolId: "current",
1967
+ label: "Current \u2014 Repay",
1968
+ category: "repay",
1969
+ description: "A Current loan was repaid.",
1970
+ generic: false,
1971
+ schema: CurrentRepaySchema,
1972
+ deployments: [
1973
+ { network: "mainnet", eventType: "0xfe1d8929d13b00aaecd7642dec1c6d41cab82882a1b139efa46bf61dfd6380bf::repay::RepayEvent", primary: true }
1974
+ ]
1975
+ },
1976
+ "current.withdraw": {
1977
+ id: "current.withdraw",
1978
+ protocolId: "current",
1979
+ label: "Current \u2014 Withdraw",
1980
+ category: "withdraw",
1981
+ description: "Assets were withdrawn from a Current lending market.",
1982
+ generic: false,
1983
+ schema: CurrentWithdrawSchema,
1984
+ deployments: [
1985
+ { network: "mainnet", eventType: "0xfe1d8929d13b00aaecd7642dec1c6d41cab82882a1b139efa46bf61dfd6380bf::withdraw::WithdrawEvent", primary: true }
1986
+ ]
1987
+ },
1988
+ "deepbook.balance": {
1989
+ id: "deepbook.balance",
1990
+ protocolId: "deepbook",
1991
+ label: "DeepBook \u2014 Balance change",
1992
+ category: "fee",
1993
+ description: "A deposit or withdrawal on a DeepBook balance manager.",
1994
+ generic: false,
1995
+ schema: DeepbookBalanceSchema,
1996
+ deployments: [
1997
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::balance_manager::BalanceEvent", primary: true }
1998
+ ]
1999
+ },
2000
+ "deepbook.flash-loan": {
2001
+ id: "deepbook.flash-loan",
2002
+ protocolId: "deepbook",
2003
+ label: "DeepBook \u2014 Flash loan borrowed",
2004
+ category: "fee",
2005
+ description: "A flash loan was borrowed from a DeepBook pool.",
2006
+ generic: false,
2007
+ schema: DeepbookFlashLoanSchema,
2008
+ deployments: [
2009
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::vault::FlashLoanBorrowed", primary: true }
2010
+ ]
2011
+ },
2012
+ "deepbook.order-canceled": {
2013
+ id: "deepbook.order-canceled",
2014
+ protocolId: "deepbook",
2015
+ label: "DeepBook \u2014 Order canceled",
2016
+ category: "order",
2017
+ description: "A DeepBook maker order was canceled.",
2018
+ generic: false,
2019
+ schema: DeepbookOrderCanceledSchema,
2020
+ deployments: [
2021
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::order::OrderCanceled", primary: true }
2022
+ ]
2023
+ },
2024
+ "deepbook.order-filled": {
2025
+ id: "deepbook.order-filled",
2026
+ protocolId: "deepbook",
2027
+ label: "DeepBook \u2014 Order filled",
2028
+ category: "order",
2029
+ description: "A DeepBook order was filled (partially or fully).",
2030
+ generic: false,
2031
+ schema: DeepbookOrderFilledSchema,
2032
+ deployments: [
2033
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::order_info::OrderFilled", primary: true }
2034
+ ]
2035
+ },
2036
+ "deepbook.order-info": {
2037
+ id: "deepbook.order-info",
2038
+ protocolId: "deepbook",
2039
+ label: "DeepBook \u2014 Order update",
2040
+ category: "order",
2041
+ description: "An order's lifecycle update on a DeepBook pool (placed/filled/status).",
2042
+ generic: false,
2043
+ schema: DeepbookOrderInfoSchema,
2044
+ deployments: [
2045
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::order_info::OrderInfo", primary: true }
2046
+ ]
2047
+ },
2048
+ "deepbook.order-placed": {
2049
+ id: "deepbook.order-placed",
2050
+ protocolId: "deepbook",
2051
+ label: "DeepBook \u2014 Order placed",
2052
+ category: "order",
2053
+ description: "A maker limit order was placed on a DeepBook pool.",
2054
+ generic: false,
2055
+ schema: DeepbookOrderPlacedSchema,
2056
+ deployments: [
2057
+ { network: "mainnet", eventType: "0x2c8d603bc51326b8c13cef9dd07031a408a48dddb541963357661df5d3204809::order_info::OrderPlaced", primary: true }
2058
+ ]
2059
+ },
2060
+ "ember.deposit": {
2061
+ id: "ember.deposit",
2062
+ protocolId: "ember",
2063
+ label: "Ember \u2014 Vault deposit",
2064
+ category: "vault",
2065
+ description: "A deposit into an Ember vault (matches all deposit coin types).",
2066
+ generic: true,
2067
+ schema: EmberDepositSchema,
2068
+ deployments: [
2069
+ { network: "mainnet", eventType: "0xc83d5406fd355f34d3ce87b35ab2c0b099af9d309ba96c17e40309502a49976f::events::VaultDepositEvent", primary: true }
2070
+ ]
2071
+ },
2072
+ "ember.rate-updated": {
2073
+ id: "ember.rate-updated",
2074
+ protocolId: "ember",
2075
+ label: "Ember \u2014 Vault rate updated",
2076
+ category: "reward",
2077
+ description: "An Ember vault's share rate (price) was updated.",
2078
+ generic: false,
2079
+ schema: EmberRateUpdatedSchema,
2080
+ deployments: [
2081
+ { network: "mainnet", eventType: "0xc83d5406fd355f34d3ce87b35ab2c0b099af9d309ba96c17e40309502a49976f::events::VaultRateUpdatedEvent", primary: true }
2082
+ ]
2083
+ },
2084
+ "ember.redeem-processed": {
2085
+ id: "ember.redeem-processed",
2086
+ protocolId: "ember",
2087
+ label: "Ember \u2014 Redeem processed",
2088
+ category: "withdraw",
2089
+ description: "A queued Ember redeem request was processed.",
2090
+ generic: true,
2091
+ schema: EmberRedeemProcessedSchema,
2092
+ deployments: [
2093
+ { network: "mainnet", eventType: "0xc83d5406fd355f34d3ce87b35ab2c0b099af9d309ba96c17e40309502a49976f::events::RequestProcessedEvent", primary: true }
2094
+ ]
2095
+ },
2096
+ "ember.redeem-request": {
2097
+ id: "ember.redeem-request",
2098
+ protocolId: "ember",
2099
+ label: "Ember \u2014 Redeem requested",
2100
+ category: "withdraw",
2101
+ description: "A redeem (withdrawal) was requested from an Ember vault.",
2102
+ generic: true,
2103
+ schema: EmberRedeemRequestSchema,
2104
+ deployments: [
2105
+ { network: "mainnet", eventType: "0xc83d5406fd355f34d3ce87b35ab2c0b099af9d309ba96c17e40309502a49976f::events::RequestRedeemedEvent", primary: true }
2106
+ ]
2107
+ },
2108
+ "flowx.amm-pair-created": {
2109
+ id: "flowx.amm-pair-created",
2110
+ protocolId: "flowx",
2111
+ label: "FlowX \u2014 Pair created (AMM)",
2112
+ category: "pool",
2113
+ description: "A new FlowX AMM trading pair was created.",
2114
+ generic: false,
2115
+ schema: FlowxAmmPairCreatedSchema,
2116
+ deployments: [
2117
+ { network: "mainnet", eventType: "0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0::factory::PairCreated", primary: true }
2118
+ ]
2119
+ },
2120
+ "flowx.amm-swap": {
2121
+ id: "flowx.amm-swap",
2122
+ protocolId: "flowx",
2123
+ label: "FlowX \u2014 Swap (AMM)",
2124
+ category: "swap",
2125
+ description: "A swap was executed on a FlowX AMM pair.",
2126
+ generic: false,
2127
+ schema: FlowxAmmSwapSchema,
2128
+ deployments: [
2129
+ { network: "mainnet", eventType: "0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0::pair::Swapped", primary: true }
2130
+ ]
2131
+ },
2132
+ "flowx.clmm-pool-created": {
2133
+ id: "flowx.clmm-pool-created",
2134
+ protocolId: "flowx",
2135
+ label: "FlowX \u2014 Pool created (CLMM)",
2136
+ category: "pool",
2137
+ description: "A new FlowX CLMM pool was created.",
2138
+ generic: false,
2139
+ schema: FlowxClmmPoolCreatedSchema,
2140
+ deployments: [
2141
+ { network: "mainnet", eventType: "0x25929e7f29e0a30eb4e692952ba1b5b65a3a4d65ab5f2a32e1ba3edcb587f26d::pool_manager::PoolCreated", primary: true }
2142
+ ]
2143
+ },
2144
+ "flowx.clmm-swap": {
2145
+ id: "flowx.clmm-swap",
2146
+ protocolId: "flowx",
2147
+ label: "FlowX \u2014 Swap (CLMM)",
2148
+ category: "swap",
2149
+ description: "A swap was executed on a FlowX CLMM pool.",
2150
+ generic: false,
2151
+ schema: FlowxClmmSwapSchema,
2152
+ deployments: [
2153
+ { network: "mainnet", eventType: "0x25929e7f29e0a30eb4e692952ba1b5b65a3a4d65ab5f2a32e1ba3edcb587f26d::pool::Swap", primary: true }
2154
+ ]
2155
+ },
2156
+ "haedal.instant-unstaked": {
2157
+ id: "haedal.instant-unstaked",
2158
+ protocolId: "haedal",
2159
+ label: "Haedal \u2014 Instant unstaked",
2160
+ category: "unstake",
2161
+ description: "An instant unstake was performed on Haedal.",
2162
+ generic: false,
2163
+ schema: HaedalInstantUnstakedSchema,
2164
+ deployments: [
2165
+ { network: "mainnet", eventType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::staking::UserInstantUnstaked", primary: true }
2166
+ ]
2167
+ },
2168
+ "haedal.staked": {
2169
+ id: "haedal.staked",
2170
+ protocolId: "haedal",
2171
+ label: "Haedal \u2014 Staked",
2172
+ category: "stake",
2173
+ description: "SUI was staked with Haedal in exchange for haSUI.",
2174
+ generic: false,
2175
+ schema: HaedalStakedSchema,
2176
+ deployments: [
2177
+ { network: "mainnet", eventType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::staking::UserStaked", primary: true }
2178
+ ]
2179
+ },
2180
+ "haedal.unstaked": {
2181
+ id: "haedal.unstaked",
2182
+ protocolId: "haedal",
2183
+ label: "Haedal \u2014 Unstaked",
2184
+ category: "unstake",
2185
+ description: "A delayed unstake was initiated on Haedal.",
2186
+ generic: false,
2187
+ schema: HaedalUnstakedSchema,
2188
+ deployments: [
2189
+ { network: "mainnet", eventType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::staking::UserNormalUnstaked", primary: true }
2190
+ ]
2191
+ },
2192
+ "kai.add-liquidity": {
2193
+ id: "kai.add-liquidity",
2194
+ protocolId: "kai",
2195
+ label: "Kai \u2014 Increase position",
2196
+ category: "liquidity",
2197
+ description: "Liquidity was added to a Kai leveraged position.",
2198
+ generic: false,
2199
+ schema: KaiAddLiquiditySchema,
2200
+ deployments: [
2201
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::AddLiquidityInfo", primary: true }
2202
+ ]
2203
+ },
2204
+ "kai.deleverage": {
2205
+ id: "kai.deleverage",
2206
+ protocolId: "kai",
2207
+ label: "Kai \u2014 Deleverage",
2208
+ category: "repay",
2209
+ description: "A Kai leveraged position was deleveraged (debt repaid).",
2210
+ generic: false,
2211
+ schema: KaiDeleverageSchema,
2212
+ deployments: [
2213
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::DeleverageInfo", primary: true }
2214
+ ]
2215
+ },
2216
+ "kai.liquidation": {
2217
+ id: "kai.liquidation",
2218
+ protocolId: "kai",
2219
+ label: "Kai \u2014 Liquidation",
2220
+ category: "liquidation",
2221
+ description: "A Kai leveraged position was liquidated.",
2222
+ generic: false,
2223
+ schema: KaiLiquidationSchema,
2224
+ deployments: [
2225
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::LiquidationInfo", primary: true }
2226
+ ]
2227
+ },
2228
+ "kai.position-open": {
2229
+ id: "kai.position-open",
2230
+ protocolId: "kai",
2231
+ label: "Kai \u2014 Open leveraged position",
2232
+ category: "borrow",
2233
+ description: "A new Kai leveraged CLMM position was opened.",
2234
+ generic: false,
2235
+ schema: KaiPositionOpenSchema,
2236
+ deployments: [
2237
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::PositionCreationInfo", primary: true }
2238
+ ]
2239
+ },
2240
+ "kai.reduce": {
2241
+ id: "kai.reduce",
2242
+ protocolId: "kai",
2243
+ label: "Kai \u2014 Reduce position",
2244
+ category: "withdraw",
2245
+ description: "A Kai leveraged position was reduced / partially withdrawn.",
2246
+ generic: false,
2247
+ schema: KaiReduceSchema,
2248
+ deployments: [
2249
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::position_core_clmm::ReductionInfo", primary: true }
2250
+ ]
2251
+ },
2252
+ "kai.supply": {
2253
+ id: "kai.supply",
2254
+ protocolId: "kai",
2255
+ label: "Kai \u2014 Supply to pool",
2256
+ category: "lend",
2257
+ description: "Liquidity was supplied to a Kai lending pool.",
2258
+ generic: false,
2259
+ schema: KaiSupplySchema,
2260
+ deployments: [
2261
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::supply_pool::SupplyInfo", primary: true }
2262
+ ]
2263
+ },
2264
+ "kai.supply-withdraw": {
2265
+ id: "kai.supply-withdraw",
2266
+ protocolId: "kai",
2267
+ label: "Kai \u2014 Withdraw from pool",
2268
+ category: "withdraw",
2269
+ description: "Supplied liquidity was withdrawn from a Kai lending pool.",
2270
+ generic: false,
2271
+ schema: KaiSupplyWithdrawSchema,
2272
+ deployments: [
2273
+ { network: "mainnet", eventType: "0x51e0ccce48f0763f98f1cb4856847c2e1531adacada99cdd7626ab999db57523::supply_pool::WithdrawInfo", primary: true }
2274
+ ]
2275
+ },
2276
+ "kriya.add-liquidity": {
2277
+ id: "kriya.add-liquidity",
2278
+ protocolId: "kriya",
2279
+ label: "Kriya \u2014 Add liquidity",
2280
+ category: "liquidity",
2281
+ description: "Liquidity was provided to a Kriya pool.",
2282
+ generic: false,
2283
+ schema: KriyaAddLiquiditySchema,
2284
+ deployments: [
2285
+ { network: "mainnet", eventType: "0xa0eba10b173538c8fecca1dff298e488402cc9ff374f8a12ca7758eebe830b66::spot_dex::LiquidityAddedEvent", primary: true }
2286
+ ]
2287
+ },
2288
+ "kriya.swap": {
2289
+ id: "kriya.swap",
2290
+ protocolId: "kriya",
2291
+ label: "Kriya \u2014 Swap",
2292
+ category: "swap",
2293
+ description: "A token swap was executed on a Kriya spot pool (matches all token types).",
2294
+ generic: true,
2295
+ schema: KriyaSwapSchema,
2296
+ deployments: [
2297
+ { network: "mainnet", eventType: "0xa0eba10b173538c8fecca1dff298e488402cc9ff374f8a12ca7758eebe830b66::spot_dex::SwapEvent", primary: true }
2298
+ ]
2299
+ },
2300
+ "magma.add-liquidity": {
2301
+ id: "magma.add-liquidity",
2302
+ protocolId: "magma",
2303
+ label: "Magma \u2014 Add liquidity",
2304
+ category: "liquidity",
2305
+ description: "Liquidity was added to a Magma CLMM pool.",
2306
+ generic: false,
2307
+ schema: MagmaAddLiquiditySchema,
2308
+ deployments: [
2309
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::pool::AddLiquidityEvent", primary: true }
2310
+ ]
2311
+ },
2312
+ "magma.collect-fee": {
2313
+ id: "magma.collect-fee",
2314
+ protocolId: "magma",
2315
+ label: "Magma \u2014 Collect fee",
2316
+ category: "fee",
2317
+ description: "Trading fees were collected from a Magma position.",
2318
+ generic: false,
2319
+ schema: MagmaCollectFeeSchema,
2320
+ deployments: [
2321
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::pool::CollectFeeEvent", primary: true }
2322
+ ]
2323
+ },
2324
+ "magma.collect-reward": {
2325
+ id: "magma.collect-reward",
2326
+ protocolId: "magma",
2327
+ label: "Magma \u2014 Collect reward",
2328
+ category: "reward",
2329
+ description: "Incentive rewards were collected from a Magma position.",
2330
+ generic: false,
2331
+ schema: MagmaCollectRewardSchema,
2332
+ deployments: [
2333
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::pool::CollectRewardEvent", primary: true }
2334
+ ]
2335
+ },
2336
+ "magma.create-pool": {
2337
+ id: "magma.create-pool",
2338
+ protocolId: "magma",
2339
+ label: "Magma \u2014 Create pool",
2340
+ category: "pool",
2341
+ description: "A new Magma CLMM pool was created.",
2342
+ generic: false,
2343
+ schema: MagmaCreatePoolSchema,
2344
+ deployments: [
2345
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::factory::CreatePoolEvent", primary: true }
2346
+ ]
2347
+ },
2348
+ "magma.remove-liquidity": {
2349
+ id: "magma.remove-liquidity",
2350
+ protocolId: "magma",
2351
+ label: "Magma \u2014 Remove liquidity",
2352
+ category: "liquidity",
2353
+ description: "Liquidity was removed from a Magma CLMM pool.",
2354
+ generic: false,
2355
+ schema: MagmaRemoveLiquiditySchema,
2356
+ deployments: [
2357
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::pool::RemoveLiquidityEvent", primary: true }
2358
+ ]
2359
+ },
2360
+ "magma.swap": {
2361
+ id: "magma.swap",
2362
+ protocolId: "magma",
2363
+ label: "Magma \u2014 Swap",
2364
+ category: "swap",
2365
+ description: "A token swap was executed on a Magma CLMM pool.",
2366
+ generic: false,
2367
+ schema: MagmaSwapSchema,
2368
+ deployments: [
2369
+ { network: "mainnet", eventType: "0x4a35d3dfef55ed3631b7158544c6322a23bc434fe4fca1234cb680ce0505f82d::pool::SwapEvent", primary: true }
2370
+ ]
2371
+ },
2372
+ "mole.add-debt": {
2373
+ id: "mole.add-debt",
2374
+ protocolId: "mole",
2375
+ label: "Mole \u2014 Add debt (leverage)",
2376
+ category: "borrow",
2377
+ description: "Debt was added to a Mole leveraged-farm position.",
2378
+ generic: true,
2379
+ schema: MoleAddDebtSchema,
2380
+ deployments: [
2381
+ { network: "mainnet", eventType: "0x5ffa69ee4ee14d899dcc750df92de12bad4bacf81efa1ae12ee76406804dda7f::vault::AddDebtEvent", primary: true }
2382
+ ]
2383
+ },
2384
+ "mole.deposit": {
2385
+ id: "mole.deposit",
2386
+ protocolId: "mole",
2387
+ label: "Mole \u2014 Vault deposit",
2388
+ category: "vault",
2389
+ description: "A deposit into a Mole savings vault (matches all coin types).",
2390
+ generic: true,
2391
+ schema: MoleDepositSchema,
2392
+ deployments: [
2393
+ { network: "mainnet", eventType: "0x5ffa69ee4ee14d899dcc750df92de12bad4bacf81efa1ae12ee76406804dda7f::vault::DepositEvent", primary: true }
2394
+ ]
2395
+ },
2396
+ "mole.harvest": {
2397
+ id: "mole.harvest",
2398
+ protocolId: "mole",
2399
+ label: "Mole \u2014 Harvest rewards",
2400
+ category: "reward",
2401
+ description: "Rewards were harvested from a Mole vault/farm.",
2402
+ generic: true,
2403
+ schema: MoleHarvestSchema,
2404
+ deployments: [
2405
+ { network: "mainnet", eventType: "0xc4dc6948a7d0a58f32fadd44e45efb201f44383bfab1cb6c48b9c186a92cc762::sui_incentive::HarvestEvent", primary: true }
2406
+ ]
2407
+ },
2408
+ "mole.kill": {
2409
+ id: "mole.kill",
2410
+ protocolId: "mole",
2411
+ label: "Mole \u2014 Position liquidation (kill)",
2412
+ category: "liquidation",
2413
+ description: "A Mole leveraged-farm position was liquidated.",
2414
+ generic: true,
2415
+ schema: MoleKillSchema,
2416
+ deployments: [
2417
+ { network: "mainnet", eventType: "0x5ffa69ee4ee14d899dcc750df92de12bad4bacf81efa1ae12ee76406804dda7f::vault::KillEvent", primary: true }
2418
+ ]
2419
+ },
2420
+ "mole.withdraw": {
2421
+ id: "mole.withdraw",
2422
+ protocolId: "mole",
2423
+ label: "Mole \u2014 Vault withdraw",
2424
+ category: "withdraw",
2425
+ description: "A withdrawal from a Mole savings vault (matches all coin types).",
2426
+ generic: true,
2427
+ schema: MoleWithdrawSchema,
2428
+ deployments: [
2429
+ { network: "mainnet", eventType: "0x5ffa69ee4ee14d899dcc750df92de12bad4bacf81efa1ae12ee76406804dda7f::vault::WithdrawEvent", primary: true }
2430
+ ]
2431
+ },
2432
+ "mole.work": {
2433
+ id: "mole.work",
2434
+ protocolId: "mole",
2435
+ label: "Mole \u2014 Open/adjust farm position",
2436
+ category: "liquidity",
2437
+ description: "A Mole leveraged-farm position was opened or adjusted.",
2438
+ generic: true,
2439
+ schema: MoleWorkSchema,
2440
+ deployments: [
2441
+ { network: "mainnet", eventType: "0x5ffa69ee4ee14d899dcc750df92de12bad4bacf81efa1ae12ee76406804dda7f::vault::WorkEvent", primary: true }
2442
+ ]
2443
+ },
2444
+ "momentum.add-liquidity": {
2445
+ id: "momentum.add-liquidity",
2446
+ protocolId: "momentum",
2447
+ label: "Momentum \u2014 Add liquidity",
2448
+ category: "liquidity",
2449
+ description: "Liquidity was added to a Momentum position.",
2450
+ generic: false,
2451
+ schema: MomentumAddLiquiditySchema,
2452
+ deployments: [
2453
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::liquidity::AddLiquidityEvent", primary: true }
2454
+ ]
2455
+ },
2456
+ "momentum.collect-fee": {
2457
+ id: "momentum.collect-fee",
2458
+ protocolId: "momentum",
2459
+ label: "Momentum \u2014 Collect fee",
2460
+ category: "fee",
2461
+ description: "Trading fees were collected from a Momentum position.",
2462
+ generic: false,
2463
+ schema: MomentumCollectFeeSchema,
2464
+ deployments: [
2465
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::collect::FeeCollectedEvent", primary: true }
2466
+ ]
2467
+ },
2468
+ "momentum.collect-reward": {
2469
+ id: "momentum.collect-reward",
2470
+ protocolId: "momentum",
2471
+ label: "Momentum \u2014 Collect reward",
2472
+ category: "reward",
2473
+ description: "Incentive rewards were collected from a Momentum position.",
2474
+ generic: false,
2475
+ schema: MomentumCollectRewardSchema,
2476
+ deployments: [
2477
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::collect::CollectPoolRewardEvent", primary: true }
2478
+ ]
2479
+ },
2480
+ "momentum.pool-created": {
2481
+ id: "momentum.pool-created",
2482
+ protocolId: "momentum",
2483
+ label: "Momentum \u2014 Pool created",
2484
+ category: "pool",
2485
+ description: "A new Momentum pool was created.",
2486
+ generic: false,
2487
+ schema: MomentumPoolCreatedSchema,
2488
+ deployments: [
2489
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::create_pool::PoolCreatedEvent", primary: true }
2490
+ ]
2491
+ },
2492
+ "momentum.remove-liquidity": {
2493
+ id: "momentum.remove-liquidity",
2494
+ protocolId: "momentum",
2495
+ label: "Momentum \u2014 Remove liquidity",
2496
+ category: "liquidity",
2497
+ description: "Liquidity was removed from a Momentum position.",
2498
+ generic: false,
2499
+ schema: MomentumRemoveLiquiditySchema,
2500
+ deployments: [
2501
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::liquidity::RemoveLiquidityEvent", primary: true }
2502
+ ]
2503
+ },
2504
+ "momentum.repay-flash-swap": {
2505
+ id: "momentum.repay-flash-swap",
2506
+ protocolId: "momentum",
2507
+ label: "Momentum \u2014 Repay flash swap",
2508
+ category: "fee",
2509
+ description: "A Momentum flash swap was repaid.",
2510
+ generic: false,
2511
+ schema: MomentumRepayFlashSwapSchema,
2512
+ deployments: [
2513
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::trade::RepayFlashSwapEvent", primary: true }
2514
+ ]
2515
+ },
2516
+ "momentum.swap": {
2517
+ id: "momentum.swap",
2518
+ protocolId: "momentum",
2519
+ label: "Momentum \u2014 Swap",
2520
+ category: "swap",
2521
+ description: "A swap was executed on a Momentum CLMM pool.",
2522
+ generic: false,
2523
+ schema: MomentumSwapSchema,
2524
+ deployments: [
2525
+ { network: "mainnet", eventType: "0x70285592c97965e811e0c6f98dccc3a9c2b4ad854b3594faab9597ada267b860::trade::SwapEvent", primary: true }
2526
+ ]
2527
+ },
2528
+ "navi.borrow": {
2529
+ id: "navi.borrow",
2530
+ protocolId: "navi",
2531
+ label: "NAVI \u2014 Borrow",
2532
+ category: "borrow",
2533
+ description: "Assets were borrowed from a NAVI pool.",
2534
+ generic: false,
2535
+ schema: NaviBorrowSchema,
2536
+ deployments: [
2537
+ { network: "mainnet", eventType: "0x1e4a13a0494d5facdbe8473e74127b838c2d446ecec0ce262e2eddafa77259cb::event::BorrowEvent", primary: true }
2538
+ ]
2539
+ },
2540
+ "navi.deposit": {
2541
+ id: "navi.deposit",
2542
+ protocolId: "navi",
2543
+ label: "NAVI \u2014 Deposit",
2544
+ category: "supply",
2545
+ description: "Assets were supplied to a NAVI lending pool.",
2546
+ generic: false,
2547
+ schema: NaviDepositSchema,
2548
+ deployments: [
2549
+ { network: "mainnet", eventType: "0x1e4a13a0494d5facdbe8473e74127b838c2d446ecec0ce262e2eddafa77259cb::event::DepositEvent", primary: true }
2550
+ ]
2551
+ },
2552
+ "navi.liquidation": {
2553
+ id: "navi.liquidation",
2554
+ protocolId: "navi",
2555
+ label: "NAVI \u2014 Liquidation",
2556
+ category: "liquidation",
2557
+ description: "An undercollateralized NAVI position was liquidated.",
2558
+ generic: false,
2559
+ schema: NaviLiquidationSchema,
2560
+ deployments: [
2561
+ { network: "mainnet", eventType: "0x1e4a13a0494d5facdbe8473e74127b838c2d446ecec0ce262e2eddafa77259cb::event::LiquidationEvent", primary: true }
2562
+ ]
2563
+ },
2564
+ "navi.repay": {
2565
+ id: "navi.repay",
2566
+ protocolId: "navi",
2567
+ label: "NAVI \u2014 Repay",
2568
+ category: "repay",
2569
+ description: "Borrowed assets were repaid to a NAVI pool.",
2570
+ generic: false,
2571
+ schema: NaviRepaySchema,
2572
+ deployments: [
2573
+ { network: "mainnet", eventType: "0x1e4a13a0494d5facdbe8473e74127b838c2d446ecec0ce262e2eddafa77259cb::event::RepayEvent", primary: true }
2574
+ ]
2575
+ },
2576
+ "navi.withdraw": {
2577
+ id: "navi.withdraw",
2578
+ protocolId: "navi",
2579
+ label: "NAVI \u2014 Withdraw",
2580
+ category: "withdraw",
2581
+ description: "Supplied assets were withdrawn from a NAVI pool.",
2582
+ generic: false,
2583
+ schema: NaviWithdrawSchema,
2584
+ deployments: [
2585
+ { network: "mainnet", eventType: "0x1e4a13a0494d5facdbe8473e74127b838c2d446ecec0ce262e2eddafa77259cb::event::WithdrawEvent", primary: true }
2586
+ ]
2587
+ },
2588
+ "pyth.price-feed-update": {
2589
+ id: "pyth.price-feed-update",
2590
+ protocolId: "pyth",
2591
+ label: "Pyth \u2014 Price feed update",
2592
+ category: "oracle",
2593
+ description: "A Pyth price feed was updated with new price data.",
2594
+ generic: false,
2595
+ schema: PythPriceFeedUpdateSchema,
2596
+ deployments: [
2597
+ { network: "mainnet", eventType: "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::event::PriceFeedUpdateEvent", primary: true },
2598
+ { network: "testnet", eventType: "0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837::event::PriceFeedUpdateEvent", primary: true }
2599
+ ]
2600
+ },
2601
+ "scallop.borrow": {
2602
+ id: "scallop.borrow",
2603
+ protocolId: "scallop",
2604
+ label: "Scallop \u2014 Borrow",
2605
+ category: "borrow",
2606
+ description: "Assets were borrowed from a Scallop lending market.",
2607
+ generic: false,
2608
+ schema: ScallopBorrowSchema,
2609
+ deployments: [
2610
+ { network: "mainnet", eventType: "0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e::borrow::BorrowEventV3", primary: true }
2611
+ ]
2612
+ },
2613
+ "scallop.collateral-deposit": {
2614
+ id: "scallop.collateral-deposit",
2615
+ protocolId: "scallop",
2616
+ label: "Scallop \u2014 Deposit collateral",
2617
+ category: "supply",
2618
+ description: "Collateral was deposited into a Scallop obligation.",
2619
+ generic: false,
2620
+ schema: ScallopCollateralDepositSchema,
2621
+ deployments: [
2622
+ { network: "mainnet", eventType: "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::deposit_collateral::CollateralDepositEvent", primary: true }
2623
+ ]
2624
+ },
2625
+ "scallop.collateral-withdraw": {
2626
+ id: "scallop.collateral-withdraw",
2627
+ protocolId: "scallop",
2628
+ label: "Scallop \u2014 Withdraw collateral",
2629
+ category: "withdraw",
2630
+ description: "Collateral was withdrawn from a Scallop obligation.",
2631
+ generic: false,
2632
+ schema: ScallopCollateralWithdrawSchema,
2633
+ deployments: [
2634
+ { network: "mainnet", eventType: "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::withdraw_collateral::CollateralWithdrawEvent", primary: true }
2635
+ ]
2636
+ },
2637
+ "scallop.liquidation": {
2638
+ id: "scallop.liquidation",
2639
+ protocolId: "scallop",
2640
+ label: "Scallop \u2014 Liquidation",
2641
+ category: "liquidation",
2642
+ description: "A Scallop obligation was liquidated.",
2643
+ generic: false,
2644
+ schema: ScallopLiquidationSchema,
2645
+ deployments: [
2646
+ { network: "mainnet", eventType: "0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e::liquidate::LiquidateEventV2", primary: true }
2647
+ ]
2648
+ },
2649
+ "scallop.repay": {
2650
+ id: "scallop.repay",
2651
+ protocolId: "scallop",
2652
+ label: "Scallop \u2014 Repay",
2653
+ category: "repay",
2654
+ description: "Borrowed assets were repaid to a Scallop market.",
2655
+ generic: false,
2656
+ schema: ScallopRepaySchema,
2657
+ deployments: [
2658
+ { network: "mainnet", eventType: "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf::repay::RepayEvent", primary: true }
2659
+ ]
2660
+ },
2661
+ "springsui.epoch-changed": {
2662
+ id: "springsui.epoch-changed",
2663
+ protocolId: "springsui",
2664
+ label: "SpringSui \u2014 Epoch changed (rewards)",
2665
+ category: "reward",
2666
+ description: "SpringSui accrued staking rewards at an epoch change.",
2667
+ generic: false,
2668
+ schema: SpringsuiEpochChangedSchema,
2669
+ deployments: [
2670
+ { network: "mainnet", eventType: "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::events::Event<0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::liquid_staking::EpochChangedEvent>", primary: true }
2671
+ ]
2672
+ },
2673
+ "springsui.stake": {
2674
+ id: "springsui.stake",
2675
+ protocolId: "springsui",
2676
+ label: "SpringSui \u2014 Stake (mint LST)",
2677
+ category: "stake",
2678
+ description: "SUI was staked to mint a SpringSui liquid-staking token.",
2679
+ generic: false,
2680
+ schema: SpringsuiStakeSchema,
2681
+ deployments: [
2682
+ { network: "mainnet", eventType: "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::events::Event<0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::liquid_staking::MintEvent>", primary: true }
2683
+ ]
2684
+ },
2685
+ "springsui.unstake": {
2686
+ id: "springsui.unstake",
2687
+ protocolId: "springsui",
2688
+ label: "SpringSui \u2014 Unstake (redeem LST)",
2689
+ category: "unstake",
2690
+ description: "A SpringSui liquid-staking token was redeemed for SUI.",
2691
+ generic: false,
2692
+ schema: SpringsuiUnstakeSchema,
2693
+ deployments: [
2694
+ { network: "mainnet", eventType: "0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::events::Event<0xb0575765166030556a6eafd3b1b970eba8183ff748860680245b9edd41c716e7::liquid_staking::RedeemEvent>", primary: true }
2695
+ ]
2696
+ },
2697
+ "steamm.bank-deposit": {
2698
+ id: "steamm.bank-deposit",
2699
+ protocolId: "steamm",
2700
+ label: "Steamm \u2014 Bank deposit (mint bToken)",
2701
+ category: "supply",
2702
+ description: "Funds were deposited into a Steamm bank, minting bTokens.",
2703
+ generic: false,
2704
+ schema: SteammBankDepositSchema,
2705
+ deployments: [
2706
+ { network: "mainnet", eventType: "0x4fb1cf45dffd6230305f1d269dd1816678cc8e3ba0b747a813a556921219f261::events::Event<0x4fb1cf45dffd6230305f1d269dd1816678cc8e3ba0b747a813a556921219f261::bank::MintBTokenEvent>", primary: true }
2707
+ ]
2708
+ },
2709
+ "steamm.bank-withdraw": {
2710
+ id: "steamm.bank-withdraw",
2711
+ protocolId: "steamm",
2712
+ label: "Steamm \u2014 Bank withdraw (burn bToken)",
2713
+ category: "withdraw",
2714
+ description: "bTokens were burned to withdraw funds from a Steamm bank.",
2715
+ generic: false,
2716
+ schema: SteammBankWithdrawSchema,
2717
+ deployments: [
2718
+ { network: "mainnet", eventType: "0x4fb1cf45dffd6230305f1d269dd1816678cc8e3ba0b747a813a556921219f261::events::Event<0x4fb1cf45dffd6230305f1d269dd1816678cc8e3ba0b747a813a556921219f261::bank::BurnBTokenEvent>", primary: true }
2719
+ ]
2720
+ },
2721
+ "suilend.borrow": {
2722
+ id: "suilend.borrow",
2723
+ protocolId: "suilend",
2724
+ label: "Suilend \u2014 Borrow",
2725
+ category: "borrow",
2726
+ description: "Assets were borrowed from a Suilend market.",
2727
+ generic: false,
2728
+ schema: SuilendBorrowSchema,
2729
+ deployments: [
2730
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::BorrowEvent", primary: true }
2731
+ ]
2732
+ },
2733
+ "suilend.claim-reward": {
2734
+ id: "suilend.claim-reward",
2735
+ protocolId: "suilend",
2736
+ label: "Suilend \u2014 Claim reward",
2737
+ category: "reward",
2738
+ description: "Rewards were claimed from a Suilend market.",
2739
+ generic: false,
2740
+ schema: SuilendClaimRewardSchema,
2741
+ deployments: [
2742
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::ClaimRewardEvent", primary: true }
2743
+ ]
2744
+ },
2745
+ "suilend.deposit": {
2746
+ id: "suilend.deposit",
2747
+ protocolId: "suilend",
2748
+ label: "Suilend \u2014 Deposit",
2749
+ category: "supply",
2750
+ description: "Assets were deposited into a Suilend reserve.",
2751
+ generic: false,
2752
+ schema: SuilendDepositSchema,
2753
+ deployments: [
2754
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::DepositEvent", primary: true }
2755
+ ]
2756
+ },
2757
+ "suilend.liquidate": {
2758
+ id: "suilend.liquidate",
2759
+ protocolId: "suilend",
2760
+ label: "Suilend \u2014 Liquidation",
2761
+ category: "liquidation",
2762
+ description: "A Suilend obligation was liquidated.",
2763
+ generic: false,
2764
+ schema: SuilendLiquidateSchema,
2765
+ deployments: [
2766
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::LiquidateEvent", primary: true }
2767
+ ]
2768
+ },
2769
+ "suilend.repay": {
2770
+ id: "suilend.repay",
2771
+ protocolId: "suilend",
2772
+ label: "Suilend \u2014 Repay",
2773
+ category: "repay",
2774
+ description: "Borrowed assets were repaid to a Suilend market.",
2775
+ generic: false,
2776
+ schema: SuilendRepaySchema,
2777
+ deployments: [
2778
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::RepayEvent", primary: true }
2779
+ ]
2780
+ },
2781
+ "suilend.withdraw": {
2782
+ id: "suilend.withdraw",
2783
+ protocolId: "suilend",
2784
+ label: "Suilend \u2014 Withdraw",
2785
+ category: "withdraw",
2786
+ description: "Assets were withdrawn from a Suilend reserve.",
2787
+ generic: false,
2788
+ schema: SuilendWithdrawSchema,
2789
+ deployments: [
2790
+ { network: "mainnet", eventType: "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::WithdrawEvent", primary: true }
2791
+ ]
2792
+ },
2793
+ "supra.price-update": {
2794
+ id: "supra.price-update",
2795
+ protocolId: "supra",
2796
+ label: "Supra \u2014 Price update",
2797
+ category: "oracle",
2798
+ description: "A Supra oracle price feed (pair) was updated.",
2799
+ generic: false,
2800
+ schema: SupraPriceUpdateSchema,
2801
+ deployments: [
2802
+ { network: "mainnet", eventType: "0x4979543452f609ff272d504755966ff5e70122256101c17adbe8bd27d35116c3::SupraSValueFeed::PairDataUpdateEvent", primary: true }
2803
+ ]
2804
+ },
2805
+ "turbos.add-liquidity": {
2806
+ id: "turbos.add-liquidity",
2807
+ protocolId: "turbos",
2808
+ label: "Turbos \u2014 Add liquidity",
2809
+ category: "liquidity",
2810
+ description: "Liquidity was minted into a Turbos position.",
2811
+ generic: false,
2812
+ schema: TurbosAddLiquiditySchema,
2813
+ deployments: [
2814
+ { network: "mainnet", eventType: "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::pool::MintEvent", primary: true }
2815
+ ]
2816
+ },
2817
+ "turbos.pool-created": {
2818
+ id: "turbos.pool-created",
2819
+ protocolId: "turbos",
2820
+ label: "Turbos \u2014 Pool created",
2821
+ category: "pool",
2822
+ description: "A new Turbos CLMM pool was created.",
2823
+ generic: false,
2824
+ schema: TurbosPoolCreatedSchema,
2825
+ deployments: [
2826
+ { network: "mainnet", eventType: "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::pool_factory::PoolCreatedEvent", primary: true }
2827
+ ]
2828
+ },
2829
+ "turbos.remove-liquidity": {
2830
+ id: "turbos.remove-liquidity",
2831
+ protocolId: "turbos",
2832
+ label: "Turbos \u2014 Remove liquidity",
2833
+ category: "liquidity",
2834
+ description: "Liquidity was burned from a Turbos position.",
2835
+ generic: false,
2836
+ schema: TurbosRemoveLiquiditySchema,
2837
+ deployments: [
2838
+ { network: "mainnet", eventType: "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::pool::BurnEvent", primary: true }
2839
+ ]
2840
+ },
2841
+ "turbos.swap": {
2842
+ id: "turbos.swap",
2843
+ protocolId: "turbos",
2844
+ label: "Turbos \u2014 Swap",
2845
+ category: "swap",
2846
+ description: "A swap was executed on a Turbos CLMM pool.",
2847
+ generic: false,
2848
+ schema: TurbosSwapSchema,
2849
+ deployments: [
2850
+ { network: "mainnet", eventType: "0x91bfbc386a41afcfd9b2533058d7e915a1d3829089cc268ff4333d54d6339ca1::pool::SwapEvent", primary: true }
2851
+ ]
2852
+ },
2853
+ "typus.dov-auction": {
2854
+ id: "typus.dov-auction",
2855
+ protocolId: "typus",
2856
+ label: "Typus \u2014 DOV auction started",
2857
+ category: "option",
2858
+ description: "A new Typus options-vault (DOV) auction round started.",
2859
+ generic: false,
2860
+ schema: TypusDovAuctionSchema,
2861
+ deployments: [
2862
+ { network: "mainnet", eventType: "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a::typus_dov_single::NewAuctionEvent", primary: true }
2863
+ ]
2864
+ },
2865
+ "typus.dov-bid": {
2866
+ id: "typus.dov-bid",
2867
+ protocolId: "typus",
2868
+ label: "Typus \u2014 DOV bid",
2869
+ category: "option",
2870
+ description: "A bid was placed in a Typus options-vault auction.",
2871
+ generic: false,
2872
+ schema: TypusDovBidSchema,
2873
+ deployments: [
2874
+ { network: "mainnet", eventType: "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a::typus_dov_single::NewBidEvent", primary: true }
2875
+ ]
2876
+ },
2877
+ "typus.dov-settle": {
2878
+ id: "typus.dov-settle",
2879
+ protocolId: "typus",
2880
+ label: "Typus \u2014 DOV settled",
2881
+ category: "option",
2882
+ description: "A Typus options-vault round was settled.",
2883
+ generic: false,
2884
+ schema: TypusDovSettleSchema,
2885
+ deployments: [
2886
+ { network: "mainnet", eventType: "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a::typus_dov_single::SettleEvent", primary: true }
2887
+ ]
2888
+ },
2889
+ "typus.perp-funding": {
2890
+ id: "typus.perp-funding",
2891
+ protocolId: "typus",
2892
+ label: "Typus \u2014 Perp funding update",
2893
+ category: "funding",
2894
+ description: "A Typus perps market funding rate was updated.",
2895
+ generic: false,
2896
+ schema: TypusPerpFundingSchema,
2897
+ deployments: [
2898
+ { network: "mainnet", eventType: "0x9003219180252ae6b81d2893b41d430488669027219537236675c0c2924c94d9::trading::UpdateFundingRateEvent", primary: true }
2899
+ ]
2900
+ },
2901
+ "typus.perp-liquidate": {
2902
+ id: "typus.perp-liquidate",
2903
+ protocolId: "typus",
2904
+ label: "Typus \u2014 Perp liquidation",
2905
+ category: "liquidation",
2906
+ description: "A Typus perps position was liquidated.",
2907
+ generic: false,
2908
+ schema: TypusPerpLiquidateSchema,
2909
+ deployments: [
2910
+ { network: "mainnet", eventType: "0x9003219180252ae6b81d2893b41d430488669027219537236675c0c2924c94d9::trading::LiquidateEvent", primary: true }
2911
+ ]
2912
+ },
2913
+ "typus.perp-lp-burn": {
2914
+ id: "typus.perp-lp-burn",
2915
+ protocolId: "typus",
2916
+ label: "Typus \u2014 TLP burn",
2917
+ category: "liquidity",
2918
+ description: "Liquidity was removed from the Typus perps LP (TLP).",
2919
+ generic: false,
2920
+ schema: TypusPerpLpBurnSchema,
2921
+ deployments: [
2922
+ { network: "mainnet", eventType: "0x9003219180252ae6b81d2893b41d430488669027219537236675c0c2924c94d9::lp_pool::BurnLpEvent", primary: true }
2923
+ ]
2924
+ },
2925
+ "typus.perp-lp-mint": {
2926
+ id: "typus.perp-lp-mint",
2927
+ protocolId: "typus",
2928
+ label: "Typus \u2014 TLP mint",
2929
+ category: "liquidity",
2930
+ description: "Liquidity was added to the Typus perps LP (TLP).",
2931
+ generic: false,
2932
+ schema: TypusPerpLpMintSchema,
2933
+ deployments: [
2934
+ { network: "mainnet", eventType: "0x9003219180252ae6b81d2893b41d430488669027219537236675c0c2924c94d9::lp_pool::MintLpEvent", primary: true }
2935
+ ]
2936
+ },
2937
+ "typus.perp-order": {
2938
+ id: "typus.perp-order",
2939
+ protocolId: "typus",
2940
+ label: "Typus \u2014 Perp order created",
2941
+ category: "perp",
2942
+ description: "A trading order was created on Typus perps.",
2943
+ generic: false,
2944
+ schema: TypusPerpOrderSchema,
2945
+ deployments: [
2946
+ { network: "mainnet", eventType: "0x9003219180252ae6b81d2893b41d430488669027219537236675c0c2924c94d9::trading::CreateTradingOrderEvent", primary: true }
2947
+ ]
2948
+ },
2949
+ "volo.staked": {
2950
+ id: "volo.staked",
2951
+ protocolId: "volo",
2952
+ label: "Volo \u2014 Staked",
2953
+ category: "stake",
2954
+ description: "SUI was staked with Volo in exchange for vSUI.",
2955
+ generic: false,
2956
+ schema: VoloStakedSchema,
2957
+ deployments: [
2958
+ { network: "mainnet", eventType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::native_pool::StakedEvent", primary: true }
2959
+ ]
2960
+ },
2961
+ "volo.unstaked": {
2962
+ id: "volo.unstaked",
2963
+ protocolId: "volo",
2964
+ label: "Volo \u2014 Unstaked",
2965
+ category: "unstake",
2966
+ description: "vSUI was burned to unstake SUI on Volo.",
2967
+ generic: false,
2968
+ schema: VoloUnstakedSchema,
2969
+ deployments: [
2970
+ { network: "mainnet", eventType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::native_pool::UnstakedEvent", primary: true }
2971
+ ]
2972
+ },
2973
+ "walrus.blob-certified": {
2974
+ id: "walrus.blob-certified",
2975
+ protocolId: "walrus",
2976
+ label: "Walrus \u2014 Blob certified",
2977
+ category: "storage",
2978
+ description: "A Walrus blob was certified available.",
2979
+ generic: false,
2980
+ schema: WalrusBlobCertifiedSchema,
2981
+ deployments: [
2982
+ { network: "mainnet", eventType: "0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::events::BlobCertified", primary: true }
2983
+ ]
2984
+ },
2985
+ "walrus.blob-deleted": {
2986
+ id: "walrus.blob-deleted",
2987
+ protocolId: "walrus",
2988
+ label: "Walrus \u2014 Blob deleted",
2989
+ category: "storage",
2990
+ description: "A Walrus blob was deleted.",
2991
+ generic: false,
2992
+ schema: WalrusBlobDeletedSchema,
2993
+ deployments: [
2994
+ { network: "mainnet", eventType: "0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::events::BlobDeleted", primary: true }
2995
+ ]
2996
+ },
2997
+ "walrus.blob-registered": {
2998
+ id: "walrus.blob-registered",
2999
+ protocolId: "walrus",
3000
+ label: "Walrus \u2014 Blob registered",
3001
+ category: "storage",
3002
+ description: "A new blob was registered for storage on Walrus.",
3003
+ generic: false,
3004
+ schema: WalrusBlobRegisteredSchema,
3005
+ deployments: [
3006
+ { network: "mainnet", eventType: "0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::events::BlobRegistered", primary: true }
3007
+ ]
3008
+ }
3009
+ };
3010
+ }
3011
+ });
3012
+
3013
+ // src/events/index.ts
3014
+ var events_exports = {};
3015
+ __export(events_exports, {
3016
+ AftermathDepositSchema: () => AftermathDepositSchema,
3017
+ AftermathPerpFundingSchema: () => AftermathPerpFundingSchema,
3018
+ AftermathPerpLiquidatedSchema: () => AftermathPerpLiquidatedSchema,
3019
+ AftermathSwapSchema: () => AftermathSwapSchema,
3020
+ AlphafiLiquidityChangeSchema: () => AlphafiLiquidityChangeSchema,
3021
+ AlphafiRewardSchema: () => AlphafiRewardSchema,
3022
+ BluefinFeeCollectedSchema: () => BluefinFeeCollectedSchema,
3023
+ BluefinLiquidityProvidedSchema: () => BluefinLiquidityProvidedSchema,
3024
+ BluefinLiquidityRemovedSchema: () => BluefinLiquidityRemovedSchema,
3025
+ BluefinPoolCreatedSchema: () => BluefinPoolCreatedSchema,
3026
+ BluefinPositionClosedSchema: () => BluefinPositionClosedSchema,
3027
+ BluefinPositionOpenedSchema: () => BluefinPositionOpenedSchema,
3028
+ BluefinRewardCollectedSchema: () => BluefinRewardCollectedSchema,
3029
+ BluefinSwapSchema: () => BluefinSwapSchema,
3030
+ BucketBorrowSchema: () => BucketBorrowSchema,
3031
+ BucketDepositCollateralSchema: () => BucketDepositCollateralSchema,
3032
+ BucketPositionUpdatedSchema: () => BucketPositionUpdatedSchema,
3033
+ BucketRedeemSchema: () => BucketRedeemSchema,
3034
+ BucketRepaySchema: () => BucketRepaySchema,
3035
+ BucketSbuckDepositSchema: () => BucketSbuckDepositSchema,
3036
+ BucketSbuckRewardsSchema: () => BucketSbuckRewardsSchema,
3037
+ BucketWithdrawCollateralSchema: () => BucketWithdrawCollateralSchema,
3038
+ CetusAddLiquiditySchema: () => CetusAddLiquiditySchema,
3039
+ CetusClosePositionSchema: () => CetusClosePositionSchema,
3040
+ CetusCollectFeeSchema: () => CetusCollectFeeSchema,
3041
+ CetusCreatePoolSchema: () => CetusCreatePoolSchema,
3042
+ CetusOpenPositionSchema: () => CetusOpenPositionSchema,
3043
+ CetusRemoveLiquiditySchema: () => CetusRemoveLiquiditySchema,
3044
+ CetusSwapSchema: () => CetusSwapSchema,
3045
+ CurrentBorrowSchema: () => CurrentBorrowSchema,
3046
+ CurrentDepositSchema: () => CurrentDepositSchema,
3047
+ CurrentLiquidateSchema: () => CurrentLiquidateSchema,
3048
+ CurrentRepaySchema: () => CurrentRepaySchema,
3049
+ CurrentWithdrawSchema: () => CurrentWithdrawSchema,
3050
+ DeepbookBalanceSchema: () => DeepbookBalanceSchema,
3051
+ DeepbookFlashLoanSchema: () => DeepbookFlashLoanSchema,
3052
+ DeepbookOrderCanceledSchema: () => DeepbookOrderCanceledSchema,
3053
+ DeepbookOrderFilledSchema: () => DeepbookOrderFilledSchema,
3054
+ DeepbookOrderInfoSchema: () => DeepbookOrderInfoSchema,
3055
+ DeepbookOrderPlacedSchema: () => DeepbookOrderPlacedSchema,
3056
+ EmberDepositSchema: () => EmberDepositSchema,
3057
+ EmberRateUpdatedSchema: () => EmberRateUpdatedSchema,
3058
+ EmberRedeemProcessedSchema: () => EmberRedeemProcessedSchema,
3059
+ EmberRedeemRequestSchema: () => EmberRedeemRequestSchema,
3060
+ EventSchemaReflector: () => EventSchemaReflector,
3061
+ FlowxAmmPairCreatedSchema: () => FlowxAmmPairCreatedSchema,
3062
+ FlowxAmmSwapSchema: () => FlowxAmmSwapSchema,
3063
+ FlowxClmmPoolCreatedSchema: () => FlowxClmmPoolCreatedSchema,
3064
+ FlowxClmmSwapSchema: () => FlowxClmmSwapSchema,
3065
+ HaedalInstantUnstakedSchema: () => HaedalInstantUnstakedSchema,
3066
+ HaedalStakedSchema: () => HaedalStakedSchema,
3067
+ HaedalUnstakedSchema: () => HaedalUnstakedSchema,
3068
+ KaiAddLiquiditySchema: () => KaiAddLiquiditySchema,
3069
+ KaiDeleverageSchema: () => KaiDeleverageSchema,
3070
+ KaiLiquidationSchema: () => KaiLiquidationSchema,
3071
+ KaiPositionOpenSchema: () => KaiPositionOpenSchema,
3072
+ KaiReduceSchema: () => KaiReduceSchema,
3073
+ KaiSupplySchema: () => KaiSupplySchema,
3074
+ KaiSupplyWithdrawSchema: () => KaiSupplyWithdrawSchema,
3075
+ KriyaAddLiquiditySchema: () => KriyaAddLiquiditySchema,
3076
+ KriyaSwapSchema: () => KriyaSwapSchema,
3077
+ MagmaAddLiquiditySchema: () => MagmaAddLiquiditySchema,
3078
+ MagmaCollectFeeSchema: () => MagmaCollectFeeSchema,
3079
+ MagmaCollectRewardSchema: () => MagmaCollectRewardSchema,
3080
+ MagmaCreatePoolSchema: () => MagmaCreatePoolSchema,
3081
+ MagmaRemoveLiquiditySchema: () => MagmaRemoveLiquiditySchema,
3082
+ MagmaSwapSchema: () => MagmaSwapSchema,
3083
+ MoleAddDebtSchema: () => MoleAddDebtSchema,
3084
+ MoleDepositSchema: () => MoleDepositSchema,
3085
+ MoleHarvestSchema: () => MoleHarvestSchema,
3086
+ MoleKillSchema: () => MoleKillSchema,
3087
+ MoleWithdrawSchema: () => MoleWithdrawSchema,
3088
+ MoleWorkSchema: () => MoleWorkSchema,
3089
+ MomentumAddLiquiditySchema: () => MomentumAddLiquiditySchema,
3090
+ MomentumCollectFeeSchema: () => MomentumCollectFeeSchema,
3091
+ MomentumCollectRewardSchema: () => MomentumCollectRewardSchema,
3092
+ MomentumPoolCreatedSchema: () => MomentumPoolCreatedSchema,
3093
+ MomentumRemoveLiquiditySchema: () => MomentumRemoveLiquiditySchema,
3094
+ MomentumRepayFlashSwapSchema: () => MomentumRepayFlashSwapSchema,
3095
+ MomentumSwapSchema: () => MomentumSwapSchema,
3096
+ NaviBorrowSchema: () => NaviBorrowSchema,
3097
+ NaviDepositSchema: () => NaviDepositSchema,
3098
+ NaviLiquidationSchema: () => NaviLiquidationSchema,
3099
+ NaviRepaySchema: () => NaviRepaySchema,
3100
+ NaviWithdrawSchema: () => NaviWithdrawSchema,
3101
+ PythPriceFeedUpdateSchema: () => PythPriceFeedUpdateSchema,
3102
+ ScallopBorrowSchema: () => ScallopBorrowSchema,
3103
+ ScallopCollateralDepositSchema: () => ScallopCollateralDepositSchema,
3104
+ ScallopCollateralWithdrawSchema: () => ScallopCollateralWithdrawSchema,
3105
+ ScallopLiquidationSchema: () => ScallopLiquidationSchema,
3106
+ ScallopRepaySchema: () => ScallopRepaySchema,
3107
+ SpringsuiEpochChangedSchema: () => SpringsuiEpochChangedSchema,
3108
+ SpringsuiStakeSchema: () => SpringsuiStakeSchema,
3109
+ SpringsuiUnstakeSchema: () => SpringsuiUnstakeSchema,
3110
+ SteammBankDepositSchema: () => SteammBankDepositSchema,
3111
+ SteammBankWithdrawSchema: () => SteammBankWithdrawSchema,
3112
+ SuilendBorrowSchema: () => SuilendBorrowSchema,
3113
+ SuilendClaimRewardSchema: () => SuilendClaimRewardSchema,
3114
+ SuilendDepositSchema: () => SuilendDepositSchema,
3115
+ SuilendLiquidateSchema: () => SuilendLiquidateSchema,
3116
+ SuilendRepaySchema: () => SuilendRepaySchema,
3117
+ SuilendWithdrawSchema: () => SuilendWithdrawSchema,
3118
+ SupraPriceUpdateSchema: () => SupraPriceUpdateSchema,
3119
+ TurbosAddLiquiditySchema: () => TurbosAddLiquiditySchema,
3120
+ TurbosPoolCreatedSchema: () => TurbosPoolCreatedSchema,
3121
+ TurbosRemoveLiquiditySchema: () => TurbosRemoveLiquiditySchema,
3122
+ TurbosSwapSchema: () => TurbosSwapSchema,
3123
+ TypusDovAuctionSchema: () => TypusDovAuctionSchema,
3124
+ TypusDovBidSchema: () => TypusDovBidSchema,
3125
+ TypusDovSettleSchema: () => TypusDovSettleSchema,
3126
+ TypusPerpFundingSchema: () => TypusPerpFundingSchema,
3127
+ TypusPerpLiquidateSchema: () => TypusPerpLiquidateSchema,
3128
+ TypusPerpLpBurnSchema: () => TypusPerpLpBurnSchema,
3129
+ TypusPerpLpMintSchema: () => TypusPerpLpMintSchema,
3130
+ TypusPerpOrderSchema: () => TypusPerpOrderSchema,
3131
+ VoloStakedSchema: () => VoloStakedSchema,
3132
+ VoloUnstakedSchema: () => VoloUnstakedSchema,
3133
+ WalrusBlobCertifiedSchema: () => WalrusBlobCertifiedSchema,
3134
+ WalrusBlobDeletedSchema: () => WalrusBlobDeletedSchema,
3135
+ WalrusBlobRegisteredSchema: () => WalrusBlobRegisteredSchema,
3136
+ _7kConfirmSwapSchema: () => _7kConfirmSwapSchema,
3137
+ _7kSwapSchema: () => _7kSwapSchema,
3138
+ baseEventType: () => baseEventType,
3139
+ catalogEvents: () => catalogEvents,
3140
+ eventTypeMatches: () => eventTypeMatches,
3141
+ formatMoveType: () => formatMoveType,
3142
+ innerEventType: () => innerEventType,
3143
+ matchCatalogEvent: () => matchCatalogEvent,
3144
+ moveAddress: () => moveAddress,
3145
+ moveBalance: () => moveBalance,
3146
+ moveBool: () => moveBool,
3147
+ moveBytes: () => moveBytes,
3148
+ moveSmallUint: () => moveSmallUint,
3149
+ moveString: () => moveString,
3150
+ moveTypeName: () => moveTypeName,
3151
+ moveUint: () => moveUint,
3152
+ normalizeAddress: () => normalizeAddress,
3153
+ parseCatalogEvent: () => parseCatalogEvent,
3154
+ parseMoveType: () => parseMoveType,
3155
+ resolveCatalogEvent: () => resolveCatalogEvent,
3156
+ resolveShape: () => resolveShape,
3157
+ shapeToExpr: () => shapeToExpr,
3158
+ shapeToZod: () => shapeToZod,
3159
+ substituteTypeParams: () => substituteTypeParams,
3160
+ warpAddressPayloadSchema: () => warpAddressPayloadSchema,
3161
+ warpCoinPayloadSchema: () => warpCoinPayloadSchema,
3162
+ warpEventPayloadSchema: () => warpEventPayloadSchema,
3163
+ warpObjectPayloadSchema: () => warpObjectPayloadSchema,
3164
+ webhookEventBodySchema: () => webhookEventBodySchema
3165
+ });
3166
+ function resolveCatalogEvent(rawEventType, options = {}) {
3167
+ for (const event of Object.values(catalogEvents)) {
3168
+ for (const deployment of event.deployments) {
3169
+ if (options.network && deployment.network !== options.network) {
3170
+ continue;
3171
+ }
3172
+ if (eventTypeMatches(rawEventType, deployment, event.generic)) {
3173
+ return event;
3174
+ }
3175
+ }
3176
+ }
3177
+ return void 0;
3178
+ }
3179
+ function extractEventPayload2(input, depth = 0) {
3180
+ if (depth > 3 || typeof input !== "object" || input === null) {
3181
+ return void 0;
3182
+ }
3183
+ const record = input;
3184
+ if (typeof record.type === "string" && record.type.includes("::") && "data" in record) {
3185
+ return { type: record.type, data: record.data };
3186
+ }
3187
+ return extractEventPayload2(record.payload, depth + 1) ?? extractEventPayload2(record.data, depth + 1);
3188
+ }
3189
+ function matches(rawEventType, id, options) {
3190
+ const event = catalogEvents[id];
3191
+ return event.deployments.some(
3192
+ (deployment) => (!options.network || deployment.network === options.network) && eventTypeMatches(rawEventType, deployment, event.generic)
3193
+ );
3194
+ }
3195
+ function matchCatalogEvent(message, id, options = {}) {
3196
+ const payload = extractEventPayload2(message);
3197
+ if (!payload || !matches(payload.type, id, options)) {
3198
+ return void 0;
3199
+ }
3200
+ return payload.data;
3201
+ }
3202
+ function parseCatalogEvent(message, id, options = {}) {
3203
+ const payload = extractEventPayload2(message);
3204
+ if (!payload || !matches(payload.type, id, options)) {
3205
+ return void 0;
3206
+ }
3207
+ return catalogEvents[id].schema.parse(
3208
+ payload.data
3209
+ );
3210
+ }
3211
+ var init_events2 = __esm({
3212
+ "src/events/index.ts"() {
3213
+ "use strict";
3214
+ init_events();
3215
+ init_runtime();
3216
+ init_runtime();
3217
+ init_events();
3218
+ init_move_types();
3219
+ init_reflection();
3220
+ }
3221
+ });
3222
+
3223
+ // src/index.ts
3224
+ var src_exports = {};
3225
+ __export(src_exports, {
3226
+ AccountNamespace: () => AccountNamespace,
3227
+ CatalogNamespace: () => CatalogNamespace,
3228
+ DataNamespace: () => DataNamespace,
3229
+ EventsNamespace: () => EventsNamespace,
3230
+ INODRA_ENDPOINTS: () => INODRA_ENDPOINTS,
3231
+ Inodra: () => Inodra,
3232
+ InodraAuthenticationError: () => InodraAuthenticationError,
3233
+ InodraError: () => InodraError,
3234
+ InodraHttpClient: () => InodraHttpClient,
3235
+ InodraManagementClient: () => InodraManagementClient,
3236
+ InodraRateLimitError: () => InodraRateLimitError,
3237
+ InodraTimeoutError: () => InodraTimeoutError,
3238
+ InodraWebhookSignatureError: () => InodraWebhookSignatureError,
3239
+ SDK_VERSION: () => SDK_VERSION,
3240
+ WarpNamespace: () => WarpNamespace,
3241
+ WarpSseStream: () => WarpSseStream,
3242
+ WarpWebSocketStream: () => WarpWebSocketStream,
3243
+ WebhooksNamespace: () => WebhooksNamespace,
3244
+ iterateStream: () => iterateStream,
3245
+ paginate: () => paginate,
3246
+ resolveAuth: () => resolveAuth,
3247
+ verifyWebhookSignature: () => verifyWebhookSignature
3248
+ });
3249
+ module.exports = __toCommonJS(src_exports);
3250
+
3251
+ // src/client.ts
3252
+ init_auth();
3253
+
3254
+ // src/core/http.ts
3255
+ init_auth();
3256
+
3257
+ // src/core/errors.ts
3258
+ var InodraError = class extends Error {
3259
+ status;
3260
+ requestId;
3261
+ body;
3262
+ /** Stable machine-readable error code from the API (e.g. "QUOTA_EXCEEDED"). */
3263
+ code;
3264
+ constructor(message, options) {
3265
+ super(message);
3266
+ this.name = "InodraError";
3267
+ this.status = options.status;
3268
+ this.requestId = options.requestId;
3269
+ this.body = options.body;
3270
+ this.code = options.code;
3271
+ }
3272
+ };
3273
+ var InodraAuthenticationError = class extends InodraError {
3274
+ constructor(options) {
3275
+ super(
3276
+ options.message ?? (options.status === 403 ? "Forbidden \u2014 the API key is valid but not allowed to do this" : "Invalid or missing API key"),
3277
+ options
3278
+ );
3279
+ this.name = "InodraAuthenticationError";
3280
+ }
3281
+ };
3282
+ var InodraRateLimitError = class extends InodraError {
3283
+ retryAfterSeconds;
3284
+ constructor(options) {
3285
+ super(options.message ?? "Rate limit exceeded", options);
3286
+ this.name = "InodraRateLimitError";
3287
+ this.retryAfterSeconds = options.retryAfterSeconds;
3288
+ }
3289
+ };
3290
+ var InodraTimeoutError = class extends Error {
3291
+ constructor(timeoutMs) {
3292
+ super(`Request timed out after ${timeoutMs}ms`);
3293
+ this.name = "InodraTimeoutError";
3294
+ }
3295
+ };
3296
+ var InodraWebhookSignatureError = class extends Error {
3297
+ constructor() {
3298
+ super("Webhook signature verification failed (bad, missing, or expired)");
3299
+ this.name = "InodraWebhookSignatureError";
3300
+ }
3301
+ };
3302
+
3303
+ // src/core/http.ts
3304
+ init_network();
3305
+ init_version();
3306
+ var InodraHttpClient = class {
3307
+ baseUrl;
3308
+ /** Rate-limit/credit info from the most recent response, if any. */
3309
+ lastResponseMeta;
3310
+ auth;
3311
+ maxRetries;
3312
+ timeoutMs;
3313
+ fetchImpl;
3314
+ onResponseMeta;
3315
+ constructor(options) {
3316
+ this.auth = authFromOptions(options, "InodraHttpClient");
3317
+ this.baseUrl = (options.baseUrl ?? restBaseUrl(options.network ?? "mainnet")).replace(/\/$/, "");
3318
+ this.maxRetries = options.maxRetries ?? 2;
3319
+ this.timeoutMs = options.timeoutMs ?? 3e4;
3320
+ this.fetchImpl = options.fetch ?? globalThis.fetch;
3321
+ this.onResponseMeta = options.onResponseMeta;
3322
+ }
3323
+ async request(method, path, options = {}) {
3324
+ const url = new URL(this.baseUrl + path);
3325
+ for (const [key, value] of Object.entries(options.query ?? {})) {
3326
+ if (value !== void 0) {
3327
+ url.searchParams.set(key, String(value));
3328
+ }
3329
+ }
3330
+ const retryOn5xx = options.idempotent ?? !(method === "POST" || method === "PATCH");
3331
+ let attempt = 0;
3332
+ for (; ; ) {
3333
+ const response = await this.send(url, method, options);
3334
+ this.captureMeta(response);
3335
+ if (response.ok) {
3336
+ if (response.status === 204) {
3337
+ return void 0;
3338
+ }
3339
+ return await response.json();
3340
+ }
3341
+ const retryable = response.status === 429 || retryOn5xx && response.status >= 500;
3342
+ if (retryable && attempt < this.maxRetries) {
3343
+ attempt += 1;
3344
+ await sleep(retryDelayMs(response, attempt));
3345
+ continue;
3346
+ }
3347
+ throw await toError(response);
3348
+ }
3349
+ }
3350
+ async send(url, method, options) {
3351
+ const timeoutSignal = AbortSignal.timeout(this.timeoutMs);
3352
+ const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
3353
+ const { headers: authHeaders } = await this.auth.credentials();
3354
+ try {
3355
+ return await this.fetchImpl(url, {
3356
+ method,
3357
+ headers: {
3358
+ ...authHeaders,
3359
+ [SDK_HEADER_NAME]: SDK_HEADER_VALUE,
3360
+ "content-type": "application/json",
3361
+ accept: "application/json"
3362
+ },
3363
+ body: options.body === void 0 ? void 0 : JSON.stringify(options.body),
3364
+ signal
3365
+ });
3366
+ } catch (error) {
3367
+ if (timeoutSignal.aborted && !options.signal?.aborted) {
3368
+ throw new InodraTimeoutError(this.timeoutMs);
3369
+ }
3370
+ throw error;
3371
+ }
3372
+ }
3373
+ captureMeta(response) {
3374
+ const meta = parseResponseMeta(response);
3375
+ if (meta) {
3376
+ this.lastResponseMeta = meta;
3377
+ this.onResponseMeta?.(meta);
3378
+ }
3379
+ }
3380
+ };
3381
+ function parseResponseMeta(response) {
3382
+ const meta = {};
3383
+ const limit = header(response, "x-ratelimit-limit");
3384
+ const remaining = header(response, "x-ratelimit-remaining");
3385
+ const reset = header(response, "x-ratelimit-reset");
3386
+ if (limit !== void 0 && remaining !== void 0) {
3387
+ meta.rateLimit = {
3388
+ limit,
3389
+ remaining,
3390
+ reset: reset ?? 0,
3391
+ throttled: response.headers.get("x-ratelimit-throttle") !== null
3392
+ };
3393
+ }
3394
+ const creditRemaining = header(response, "x-inodra-credit-remaining");
3395
+ const creditLimit = header(response, "x-inodra-credit-limit");
3396
+ if (creditRemaining !== void 0 && creditLimit !== void 0) {
3397
+ meta.credits = {
3398
+ remaining: creditRemaining,
3399
+ limit: creditLimit,
3400
+ replenishDate: response.headers.get("x-inodra-credit-replenish-date") ?? void 0,
3401
+ degraded: response.headers.get("x-inodra-credit-degraded") === "true"
3402
+ };
3403
+ }
3404
+ const requestId = response.headers.get("x-request-id");
3405
+ if (requestId) {
3406
+ meta.requestId = requestId;
3407
+ }
3408
+ if (!meta.rateLimit && !meta.credits && !meta.requestId) {
3409
+ return void 0;
3410
+ }
3411
+ return meta;
3412
+ }
3413
+ function header(response, name) {
3414
+ const raw = response.headers.get(name);
3415
+ if (raw === null) {
3416
+ return void 0;
3417
+ }
3418
+ const value = Number(raw);
3419
+ return Number.isFinite(value) ? value : void 0;
3420
+ }
3421
+ async function toError(response) {
3422
+ const requestId = response.headers.get("x-request-id") ?? void 0;
3423
+ let body;
3424
+ try {
3425
+ body = await response.json();
3426
+ } catch {
3427
+ body = void 0;
3428
+ }
3429
+ const serverMessage = extractField(body, ["message", "error"]);
3430
+ const code = extractField(body, ["code"]);
3431
+ if (response.status === 401 || response.status === 403) {
3432
+ return new InodraAuthenticationError({
3433
+ status: response.status,
3434
+ requestId,
3435
+ body,
3436
+ code,
3437
+ message: serverMessage
3438
+ });
3439
+ }
3440
+ if (response.status === 429) {
3441
+ const retryAfter = response.headers.get("retry-after");
3442
+ return new InodraRateLimitError({
3443
+ status: response.status,
3444
+ requestId,
3445
+ body,
3446
+ code,
3447
+ retryAfterSeconds: retryAfter ? Number(retryAfter) : void 0,
3448
+ message: serverMessage
3449
+ });
3450
+ }
3451
+ return new InodraError(
3452
+ serverMessage ?? `Request failed with status ${response.status}`,
3453
+ { status: response.status, requestId, body, code }
3454
+ );
3455
+ }
3456
+ function extractField(body, keys) {
3457
+ if (typeof body !== "object" || body === null) {
3458
+ return void 0;
3459
+ }
3460
+ for (const key of keys) {
3461
+ const value = body[key];
3462
+ if (typeof value === "string" && value.length > 0) {
3463
+ return value;
3464
+ }
3465
+ }
3466
+ return void 0;
3467
+ }
3468
+ function retryDelayMs(response, attempt) {
3469
+ const retryAfter = response.headers.get("retry-after");
3470
+ if (retryAfter) {
3471
+ const seconds = Number(retryAfter);
3472
+ if (Number.isFinite(seconds)) {
3473
+ return seconds * 1e3;
3474
+ }
3475
+ }
3476
+ return 250 * 2 ** (attempt - 1) + Math.random() * 100;
3477
+ }
3478
+ function sleep(ms) {
3479
+ return new Promise((resolve) => setTimeout(resolve, ms));
3480
+ }
3481
+
3482
+ // src/client.ts
3483
+ init_network();
3484
+
3485
+ // src/graphql/index.ts
3486
+ var import_graphql = require("@mysten/sui/graphql");
3487
+ init_auth();
3488
+ init_network();
3489
+ init_version();
3490
+ var import_graphql2 = require("@mysten/sui/graphql");
3491
+ function createInodraGraphQLClient(options) {
3492
+ const network = options.network ?? "mainnet";
3493
+ return new import_graphql.SuiGraphQLClient({
3494
+ network,
3495
+ url: options.url ?? graphqlUrl(network),
3496
+ headers: {
3497
+ ...staticAuthHeaders(options, "createInodraGraphQLClient"),
3498
+ [SDK_HEADER_NAME]: SDK_HEADER_VALUE,
3499
+ ...options.headers
3500
+ },
3501
+ queries: options.queries
3502
+ });
3503
+ }
3504
+
3505
+ // src/grpc-web/index.ts
3506
+ var import_grpc = require("@mysten/sui/grpc");
3507
+ var import_grpcweb_transport = require("@protobuf-ts/grpcweb-transport");
3508
+ init_auth();
3509
+ init_network();
3510
+ init_version();
3511
+ var import_grpc2 = require("@mysten/sui/grpc");
3512
+ function createInodraGrpcWebClient(options) {
3513
+ const network = options.network ?? "mainnet";
3514
+ const transport = new import_grpcweb_transport.GrpcWebFetchTransport({
3515
+ baseUrl: options.baseUrl ?? grpcBaseUrl(network),
3516
+ meta: {
3517
+ ...staticAuthHeaders(options, "createInodraGrpcWebClient"),
3518
+ [SDK_HEADER_NAME]: SDK_HEADER_VALUE,
3519
+ ...options.metadata
3520
+ }
3521
+ });
3522
+ return new import_grpc.SuiGrpcClient({ network, transport });
3523
+ }
3524
+
3525
+ // src/namespaces/account.ts
3526
+ var AccountNamespace = class {
3527
+ http;
3528
+ constructor(http) {
3529
+ this.http = http;
3530
+ }
3531
+ /** Who am I — key, organization, project, network, tier, subscription. */
3532
+ me() {
3533
+ return this.http.request("GET", "/auth/me");
3534
+ }
3535
+ /** Usage stats for the current billing period (CU, requests, latency). */
3536
+ usage() {
3537
+ return this.http.request("GET", "/usage/stats");
3538
+ }
3539
+ };
3540
+
3541
+ // src/namespaces/catalog.ts
3542
+ var CatalogNamespace = class {
3543
+ http;
3544
+ constructor(http) {
3545
+ this.http = http;
3546
+ }
3547
+ protocols(query) {
3548
+ return this.http.request("GET", "/catalog/protocols", { query });
3549
+ }
3550
+ events(query) {
3551
+ return this.http.request("GET", "/catalog/events", { query });
3552
+ }
3553
+ };
3554
+
3555
+ // src/core/openapi.ts
3556
+ async function* paginate(fetchPage) {
3557
+ let cursor;
3558
+ for (; ; ) {
3559
+ const page = await fetchPage(cursor);
3560
+ yield* page.data;
3561
+ if (!page.pagination.hasNext || !page.pagination.cursor) {
3562
+ return;
3563
+ }
3564
+ cursor = page.pagination.cursor;
3565
+ }
3566
+ }
3567
+
3568
+ // src/namespaces/data.ts
3569
+ var DataNamespace = class {
3570
+ http;
3571
+ constructor(http) {
3572
+ this.http = http;
3573
+ }
3574
+ accounts = {
3575
+ get: (address) => this.http.request("GET", `/accounts/${encodeURIComponent(address)}`),
3576
+ balance: (address) => this.http.request(
3577
+ "GET",
3578
+ `/accounts/${encodeURIComponent(address)}/balance`
3579
+ ),
3580
+ objects: (address, query) => this.http.request(
3581
+ "GET",
3582
+ `/accounts/${encodeURIComponent(address)}/objects`,
3583
+ { query }
3584
+ ),
3585
+ /** Every owned object, walking all pages lazily. */
3586
+ iterateObjects: (address, query) => paginate(
3587
+ (cursor) => this.accounts.objects(address, { ...query, cursor })
3588
+ ),
3589
+ transactions: (address, query) => this.http.request(
3590
+ "GET",
3591
+ `/accounts/${encodeURIComponent(address)}/transactions`,
3592
+ { query }
3593
+ ),
3594
+ /** Every transaction, walking all pages lazily. */
3595
+ iterateTransactions: (address, query) => paginate(
3596
+ (cursor) => this.accounts.transactions(address, { ...query, cursor })
3597
+ ),
3598
+ delegations: (address) => this.http.request(
3599
+ "GET",
3600
+ `/accounts/${encodeURIComponent(address)}/delegations`
3601
+ )
3602
+ };
3603
+ coins = {
3604
+ /** Coin denomination (supply, holders, decimals, …). */
3605
+ get: (coinType) => this.http.request("GET", `/coins/${encodeURIComponent(coinType)}`),
3606
+ /** Display metadata: name, symbol, icon, description, links. */
3607
+ metadata: (coinType) => this.http.request("GET", `/coins/type/${encodeURIComponent(coinType)}`)
3608
+ };
3609
+ objects = {
3610
+ /** Metadata (type, name, image, project) for one object id. */
3611
+ metadata: (input) => this.http.request("POST", "/objects/metadata", {
3612
+ body: input,
3613
+ idempotent: true
3614
+ }),
3615
+ transactions: (objectId, query) => this.http.request(
3616
+ "GET",
3617
+ `/objects/${encodeURIComponent(objectId)}/transactions`,
3618
+ { query }
3619
+ ),
3620
+ /** Every transaction touching the object, walking all pages lazily. */
3621
+ iterateTransactions: (objectId, query) => paginate(
3622
+ (cursor) => this.objects.transactions(objectId, { ...query, cursor })
3623
+ )
3624
+ };
3625
+ packages = {
3626
+ get: (packageId) => this.http.request("GET", `/packages/${encodeURIComponent(packageId)}`)
3627
+ };
3628
+ chain = {
3629
+ info: () => this.http.request("GET", "/chain/info"),
3630
+ staking: () => this.http.request("GET", "/chain/staking"),
3631
+ stats: () => this.http.request("GET", "/chain/stats")
3632
+ };
3633
+ validators = {
3634
+ list: (query) => this.http.request("GET", "/validators", { query }),
3635
+ apy: () => this.http.request("GET", "/validators/apy"),
3636
+ commission: () => this.http.request("GET", "/validators/commission"),
3637
+ get: (validatorAddress) => this.http.request(
3638
+ "GET",
3639
+ `/validators/${encodeURIComponent(validatorAddress)}`
3640
+ )
3641
+ };
3642
+ suins = {
3643
+ /** SuiNS name → address. */
3644
+ resolve: (name) => this.http.request("GET", `/suins/resolve/${encodeURIComponent(name)}`),
3645
+ /** Address → primary SuiNS name. */
3646
+ reverse: (address) => this.http.request(
3647
+ "GET",
3648
+ `/suins/reverse/${encodeURIComponent(address)}`
3649
+ ),
3650
+ resolveBatch: (input) => this.http.request("POST", "/suins/resolve/batch", {
3651
+ body: input,
3652
+ idempotent: true
3653
+ }),
3654
+ availability: (name) => this.http.request(
3655
+ "GET",
3656
+ `/suins/availability/${encodeURIComponent(name)}`
3657
+ )
3658
+ };
3659
+ };
3660
+
3661
+ // src/namespaces/events.ts
3662
+ var EventsNamespace = class {
3663
+ ctx;
3664
+ reflectorPromise;
3665
+ constructor(ctx) {
3666
+ this.ctx = ctx;
3667
+ }
3668
+ /** The underlying reflector (shared cache across calls). */
3669
+ reflector() {
3670
+ this.reflectorPromise ??= Promise.resolve().then(() => (init_reflection(), reflection_exports)).then(
3671
+ (module2) => new module2.EventSchemaReflector({
3672
+ auth: this.ctx.auth,
3673
+ network: this.ctx.network,
3674
+ url: this.ctx.graphqlUrl,
3675
+ fetch: this.ctx.fetch
3676
+ })
3677
+ );
3678
+ return this.reflectorPromise;
3679
+ }
3680
+ /**
3681
+ * Build (and cache) a loose, normalizing zod schema for any concrete
3682
+ * Move event type, by reflecting its struct layout on-chain. Generic
3683
+ * types are typed concretely from their instantiation.
3684
+ */
3685
+ async schemaFor(type) {
3686
+ return (await this.reflector()).schemaFor(type);
3687
+ }
3688
+ /**
3689
+ * Validate + normalize an event payload against the reflected schema.
3690
+ * Accepts a Warp stream message, a bare event payload, or a webhook
3691
+ * body. Returns undefined for other event types; throws on schema
3692
+ * mismatch. Pass a base type (no `<…>`) to match every instantiation —
3693
+ * each is reflected and typed concretely.
3694
+ */
3695
+ async parseEvent(message, type) {
3696
+ return (await this.reflector()).parseEvent(message, type);
3697
+ }
3698
+ };
3699
+
3700
+ // src/warp/iterate.ts
3701
+ async function* iterateStream(stream, options = {}) {
3702
+ const queue = [];
3703
+ let notify;
3704
+ let closed = false;
3705
+ let failure;
3706
+ const unsubscribes = [
3707
+ stream.on("message", (event) => {
3708
+ queue.push(event);
3709
+ notify?.();
3710
+ }),
3711
+ stream.on("close", ({ reason }) => {
3712
+ closed = true;
3713
+ if (reason !== "client closed") {
3714
+ failure = new Error(`Warp stream closed: ${reason}`);
3715
+ }
3716
+ notify?.();
3717
+ })
3718
+ ];
3719
+ try {
3720
+ for (; ; ) {
3721
+ while (queue.length > 0) {
3722
+ yield queue.shift();
3723
+ }
3724
+ if (closed) {
3725
+ if (failure) {
3726
+ throw failure;
3727
+ }
3728
+ return;
3729
+ }
3730
+ await new Promise((resolve) => {
3731
+ notify = resolve;
3732
+ });
3733
+ notify = void 0;
3734
+ }
3735
+ } finally {
3736
+ for (const unsubscribe of unsubscribes) {
3737
+ unsubscribe();
3738
+ }
3739
+ if (options.closeOnReturn ?? true) {
3740
+ stream.close();
3741
+ }
3742
+ }
3743
+ }
3744
+
3745
+ // src/warp/sse.ts
3746
+ init_auth();
3747
+ init_version();
3748
+ init_network();
3749
+
3750
+ // src/warp/emitter.ts
3751
+ var Emitter = class {
3752
+ handlers = /* @__PURE__ */ new Map();
3753
+ on(event, handler) {
3754
+ let set = this.handlers.get(event);
3755
+ if (!set) {
3756
+ set = /* @__PURE__ */ new Set();
3757
+ this.handlers.set(event, set);
3758
+ }
3759
+ set.add(handler);
3760
+ return () => set?.delete(handler);
3761
+ }
3762
+ off(event, handler) {
3763
+ this.handlers.get(event)?.delete(handler);
3764
+ }
3765
+ /** Returns false if any handler threw. */
3766
+ emit(event, payload) {
3767
+ let ok = true;
3768
+ for (const handler of this.handlers.get(event) ?? []) {
3769
+ try {
3770
+ handler(payload);
3771
+ } catch {
3772
+ ok = false;
3773
+ }
3774
+ }
3775
+ return ok;
3776
+ }
3777
+ };
3778
+
3779
+ // src/warp/sse-parser.ts
3780
+ var SseParser = class {
3781
+ buffer = "";
3782
+ eventName = "";
3783
+ dataLines = [];
3784
+ id;
3785
+ retryMs;
3786
+ feed(chunk) {
3787
+ this.buffer += chunk;
3788
+ const messages = [];
3789
+ for (; ; ) {
3790
+ const newline = this.buffer.search(/\r\n|\r|\n/);
3791
+ if (newline === -1) {
3792
+ break;
3793
+ }
3794
+ const line = this.buffer.slice(0, newline);
3795
+ const sep = this.buffer.slice(newline, newline + 2);
3796
+ this.buffer = this.buffer.slice(newline + (sep === "\r\n" ? 2 : 1));
3797
+ if (line === "") {
3798
+ const message = this.flush();
3799
+ if (message) {
3800
+ messages.push(message);
3801
+ }
3802
+ continue;
3803
+ }
3804
+ this.parseLine(line);
3805
+ }
3806
+ return messages;
3807
+ }
3808
+ parseLine(line) {
3809
+ if (line.startsWith(":")) {
3810
+ return;
3811
+ }
3812
+ const colon = line.indexOf(":");
3813
+ const field = colon === -1 ? line : line.slice(0, colon);
3814
+ let value = colon === -1 ? "" : line.slice(colon + 1);
3815
+ if (value.startsWith(" ")) {
3816
+ value = value.slice(1);
3817
+ }
3818
+ switch (field) {
3819
+ case "event":
3820
+ this.eventName = value;
3821
+ break;
3822
+ case "data":
3823
+ this.dataLines.push(value);
3824
+ break;
3825
+ case "id":
3826
+ if (!value.includes("\0")) {
3827
+ this.id = value;
3828
+ }
3829
+ break;
3830
+ case "retry": {
3831
+ const ms = Number(value);
3832
+ if (Number.isInteger(ms) && ms >= 0) {
3833
+ this.retryMs = ms;
3834
+ }
3835
+ break;
3836
+ }
3837
+ default:
3838
+ break;
3839
+ }
3840
+ }
3841
+ flush() {
3842
+ if (this.dataLines.length === 0 && this.eventName === "") {
3843
+ const retryOnly = this.retryMs;
3844
+ this.retryMs = void 0;
3845
+ return retryOnly === void 0 ? void 0 : { event: "", data: "", retryMs: retryOnly };
3846
+ }
3847
+ const message = {
3848
+ event: this.eventName || "message",
3849
+ data: this.dataLines.join("\n"),
3850
+ id: this.id,
3851
+ retryMs: this.retryMs
3852
+ };
3853
+ this.eventName = "";
3854
+ this.dataLines = [];
3855
+ this.retryMs = void 0;
3856
+ return message;
3857
+ }
3858
+ };
3859
+
3860
+ // src/warp/types.ts
3861
+ var CONTROL_EVENTS = /* @__PURE__ */ new Set(["connected", "error", "quota_exceeded"]);
3862
+ function backoffDelayMs(attempt) {
3863
+ return Math.min(1e3 * 2 ** (attempt - 1), 3e4) + Math.random() * 250;
3864
+ }
3865
+
3866
+ // src/warp/sse.ts
3867
+ var WarpSseStream = class extends Emitter {
3868
+ lastEventId;
3869
+ options;
3870
+ auth;
3871
+ url;
3872
+ fetchImpl;
3873
+ abort;
3874
+ reconnectAttempt = 0;
3875
+ serverRetryMs;
3876
+ closed = false;
3877
+ closeEmitted = false;
3878
+ constructor(options) {
3879
+ super();
3880
+ this.options = options;
3881
+ this.auth = authFromOptions(options, "WarpSseStream");
3882
+ const base = options.url ?? warpStreamUrl(options.network ?? "mainnet", options.subscriptionId);
3883
+ if (options.mode !== void 0) {
3884
+ const url = new URL(base);
3885
+ url.searchParams.set("mode", options.mode);
3886
+ this.url = url.toString();
3887
+ } else {
3888
+ this.url = base;
3889
+ }
3890
+ this.fetchImpl = options.fetch ?? globalThis.fetch;
3891
+ this.lastEventId = options.lastEventId;
3892
+ }
3893
+ connect() {
3894
+ if (this.abort) {
3895
+ return;
3896
+ }
3897
+ this.closed = false;
3898
+ this.closeEmitted = false;
3899
+ this.abort = new AbortController();
3900
+ void this.run(this.abort.signal);
3901
+ }
3902
+ close() {
3903
+ const wasActive = this.abort !== void 0;
3904
+ this.closed = true;
3905
+ this.abort?.abort();
3906
+ this.abort = void 0;
3907
+ if (wasActive) {
3908
+ this.emitClose("client closed");
3909
+ }
3910
+ }
3911
+ /** Emit "close" exactly once per connection lifecycle. */
3912
+ emitClose(reason) {
3913
+ if (this.closeEmitted) {
3914
+ return;
3915
+ }
3916
+ this.closeEmitted = true;
3917
+ this.emit("close", { reason });
3918
+ }
3919
+ /** Iterate data events; ends when the stream closes (throws unless client-initiated). */
3920
+ [Symbol.asyncIterator]() {
3921
+ return iterateStream(this);
3922
+ }
3923
+ async run(signal) {
3924
+ for (; ; ) {
3925
+ try {
3926
+ await this.consume(signal);
3927
+ if (this.closed || signal.aborted) {
3928
+ return;
3929
+ }
3930
+ } catch (error) {
3931
+ if (this.closed || signal.aborted) {
3932
+ return;
3933
+ }
3934
+ if (error instanceof TerminalStreamError) {
3935
+ this.emit("error", error);
3936
+ this.emitClose(error.message);
3937
+ this.close();
3938
+ return;
3939
+ }
3940
+ this.emit(
3941
+ "error",
3942
+ error instanceof Error ? error : new Error(String(error))
3943
+ );
3944
+ }
3945
+ if (!(this.options.reconnect ?? true)) {
3946
+ this.emitClose("disconnected");
3947
+ this.close();
3948
+ return;
3949
+ }
3950
+ this.reconnectAttempt += 1;
3951
+ if (this.reconnectAttempt > (this.options.maxReconnectAttempts ?? 10)) {
3952
+ this.emitClose("max reconnect attempts exceeded");
3953
+ this.close();
3954
+ return;
3955
+ }
3956
+ const delayMs = this.serverRetryMs ?? backoffDelayMs(this.reconnectAttempt);
3957
+ this.emit("reconnecting", { attempt: this.reconnectAttempt, delayMs });
3958
+ await sleep2(delayMs);
3959
+ if (this.closed || signal.aborted) {
3960
+ return;
3961
+ }
3962
+ }
3963
+ }
3964
+ async consume(signal) {
3965
+ const { headers: authHeaders } = await this.auth.credentials();
3966
+ const headers = {
3967
+ accept: "text/event-stream",
3968
+ ...authHeaders,
3969
+ [SDK_HEADER_NAME]: SDK_HEADER_VALUE
3970
+ };
3971
+ if (this.lastEventId !== void 0) {
3972
+ headers["Last-Event-ID"] = this.lastEventId;
3973
+ }
3974
+ const response = await this.fetchImpl(this.url, { headers, signal });
3975
+ if (!response.ok || !response.body) {
3976
+ const retryable = response.status >= 500;
3977
+ const message = `SSE connection failed with status ${response.status}`;
3978
+ if (retryable) {
3979
+ throw new Error(message);
3980
+ }
3981
+ throw new TerminalStreamError(message);
3982
+ }
3983
+ const parser = new SseParser();
3984
+ const decoder = new TextDecoder();
3985
+ const reader = response.body.getReader();
3986
+ for (; ; ) {
3987
+ const { done, value } = await reader.read();
3988
+ if (done) {
3989
+ return;
3990
+ }
3991
+ for (const message of parser.feed(decoder.decode(value, { stream: true }))) {
3992
+ if (message.retryMs !== void 0) {
3993
+ this.serverRetryMs = message.retryMs;
3994
+ }
3995
+ if (message.event === "" && message.data === "") {
3996
+ continue;
3997
+ }
3998
+ this.dispatch(message.event, message.id, message.data);
3999
+ }
4000
+ }
4001
+ }
4002
+ dispatch(event, id, raw) {
4003
+ let data = raw;
4004
+ try {
4005
+ data = JSON.parse(raw);
4006
+ } catch {
4007
+ }
4008
+ if (id !== void 0) {
4009
+ this.lastEventId = id;
4010
+ }
4011
+ switch (event) {
4012
+ case "connected":
4013
+ this.reconnectAttempt = 0;
4014
+ this.emit("connected", data);
4015
+ return;
4016
+ case "quota_exceeded":
4017
+ this.emit("quota_exceeded", data);
4018
+ this.emitClose("quota_exceeded");
4019
+ this.close();
4020
+ return;
4021
+ case "error": {
4022
+ const message = typeof data === "object" && data !== null && "error" in data ? String(data.error) : raw;
4023
+ this.emit("error", new Error(message));
4024
+ return;
4025
+ }
4026
+ default:
4027
+ if (!CONTROL_EVENTS.has(event)) {
4028
+ this.emit("message", { type: event, id, data });
4029
+ }
4030
+ }
4031
+ }
4032
+ };
4033
+ var TerminalStreamError = class extends Error {
4034
+ };
4035
+ function sleep2(ms) {
4036
+ return new Promise((resolve) => setTimeout(resolve, ms));
4037
+ }
4038
+
4039
+ // src/warp/ws.ts
4040
+ init_auth();
4041
+ init_network();
4042
+ var WarpWebSocketStream = class extends Emitter {
4043
+ lastEventId;
4044
+ options;
4045
+ auth;
4046
+ wsCtor;
4047
+ ws;
4048
+ reconnectAttempt = 0;
4049
+ closed = false;
4050
+ constructor(options) {
4051
+ super();
4052
+ this.options = options;
4053
+ this.auth = authFromOptions(options, "WarpWebSocketStream");
4054
+ const ctor = options.webSocket ?? globalThis.WebSocket;
4055
+ if (!ctor) {
4056
+ throw new Error(
4057
+ "No WebSocket implementation available \u2014 pass one via the webSocket option"
4058
+ );
4059
+ }
4060
+ this.wsCtor = ctor;
4061
+ this.lastEventId = options.lastEventId;
4062
+ }
4063
+ connect() {
4064
+ if (this.ws) {
4065
+ return;
4066
+ }
4067
+ this.closed = false;
4068
+ this.open();
4069
+ }
4070
+ close() {
4071
+ this.closed = true;
4072
+ this.ws?.close(1e3, "client closed");
4073
+ this.ws = void 0;
4074
+ }
4075
+ /** Acknowledge an event by ID (only needed with autoAck: false). */
4076
+ ack(id) {
4077
+ this.ws?.send(JSON.stringify({ type: "ack", id }));
4078
+ }
4079
+ /** Iterate data events; ends when the stream closes (throws unless client-initiated). */
4080
+ [Symbol.asyncIterator]() {
4081
+ return iterateStream(this);
4082
+ }
4083
+ buildUrl(authParams) {
4084
+ const base = this.options.url ?? warpWebSocketUrl(
4085
+ this.options.network ?? "mainnet",
4086
+ this.options.subscriptionId
4087
+ );
4088
+ const url = new URL(base);
4089
+ for (const [key, value] of Object.entries(authParams)) {
4090
+ url.searchParams.set(key, value);
4091
+ }
4092
+ if (this.options.mode !== void 0) {
4093
+ url.searchParams.set("mode", this.options.mode);
4094
+ }
4095
+ if (this.lastEventId !== void 0) {
4096
+ url.searchParams.set("lastEventId", this.lastEventId);
4097
+ }
4098
+ return url.toString();
4099
+ }
4100
+ open() {
4101
+ const credentials = this.auth.staticCredentials();
4102
+ if (credentials) {
4103
+ this.openWith(credentials.queryParams);
4104
+ return;
4105
+ }
4106
+ void this.auth.credentials().then(
4107
+ (resolved) => {
4108
+ if (!this.closed && !this.ws) {
4109
+ this.openWith(resolved.queryParams);
4110
+ }
4111
+ },
4112
+ (error) => {
4113
+ this.failTerminally(
4114
+ error instanceof Error ? error : new Error(String(error)),
4115
+ "credential resolution failed"
4116
+ );
4117
+ }
4118
+ );
4119
+ }
4120
+ failTerminally(error, reason) {
4121
+ this.closed = true;
4122
+ this.emit("error", error);
4123
+ this.emit("close", { reason });
4124
+ }
4125
+ openWith(authParams) {
4126
+ if (!authParams) {
4127
+ this.failTerminally(
4128
+ new Error(
4129
+ "These credentials cannot authenticate a WebSocket (no header support on upgrades) \u2014 use an API key or the SSE stream"
4130
+ ),
4131
+ "unsupported credentials"
4132
+ );
4133
+ return;
4134
+ }
4135
+ const ws = new this.wsCtor(this.buildUrl(authParams));
4136
+ this.ws = ws;
4137
+ ws.addEventListener("message", (event) => {
4138
+ this.handleMessage(event);
4139
+ });
4140
+ ws.addEventListener("error", () => {
4141
+ this.emit("error", new Error("WebSocket transport error"));
4142
+ });
4143
+ ws.addEventListener("close", (event) => {
4144
+ if (this.ws !== ws) {
4145
+ return;
4146
+ }
4147
+ this.ws = void 0;
4148
+ this.handleClose(event.code, event.reason);
4149
+ });
4150
+ }
4151
+ handleMessage(event) {
4152
+ let parsed;
4153
+ try {
4154
+ parsed = JSON.parse(
4155
+ typeof event.data === "string" ? event.data : String(event.data)
4156
+ );
4157
+ } catch {
4158
+ this.emit("error", new Error("Received malformed WebSocket message"));
4159
+ return;
4160
+ }
4161
+ const type = typeof parsed.event === "string" ? parsed.event : "message";
4162
+ const id = typeof parsed.id === "string" ? parsed.id : void 0;
4163
+ switch (type) {
4164
+ case "connected":
4165
+ this.reconnectAttempt = 0;
4166
+ this.emit("connected", parsed.data);
4167
+ return;
4168
+ case "quota_exceeded":
4169
+ this.emit("quota_exceeded", parsed.data);
4170
+ return;
4171
+ // server closes with 1008; handleClose makes it terminal
4172
+ case "error": {
4173
+ const message = typeof parsed.data === "object" && parsed.data !== null && "error" in parsed.data ? String(parsed.data.error) : "Server error";
4174
+ this.emit("error", new Error(message));
4175
+ return;
4176
+ }
4177
+ default: {
4178
+ if (id !== void 0) {
4179
+ this.lastEventId = id;
4180
+ }
4181
+ const handlersSucceeded = this.emit("message", {
4182
+ type,
4183
+ id,
4184
+ data: parsed.data
4185
+ });
4186
+ if ((this.options.autoAck ?? true) && id !== void 0) {
4187
+ if (handlersSucceeded) {
4188
+ this.ack(id);
4189
+ } else {
4190
+ this.emit(
4191
+ "error",
4192
+ new Error(
4193
+ `Message handler threw; event ${id} not acked and will be redelivered`
4194
+ )
4195
+ );
4196
+ }
4197
+ }
4198
+ }
4199
+ }
4200
+ }
4201
+ handleClose(code, reason) {
4202
+ if (this.closed) {
4203
+ this.emit("close", { reason: "client closed" });
4204
+ return;
4205
+ }
4206
+ if (code === 1008) {
4207
+ this.emit("close", { reason: reason || "policy violation" });
4208
+ this.closed = true;
4209
+ return;
4210
+ }
4211
+ if (!(this.options.reconnect ?? true)) {
4212
+ this.emit("close", { reason: reason || "disconnected" });
4213
+ this.closed = true;
4214
+ return;
4215
+ }
4216
+ this.reconnectAttempt += 1;
4217
+ if (this.reconnectAttempt > (this.options.maxReconnectAttempts ?? 10)) {
4218
+ this.emit("close", { reason: "max reconnect attempts exceeded" });
4219
+ this.closed = true;
4220
+ return;
4221
+ }
4222
+ const delayMs = backoffDelayMs(this.reconnectAttempt);
4223
+ this.emit("reconnecting", { attempt: this.reconnectAttempt, delayMs });
4224
+ setTimeout(() => {
4225
+ if (!this.closed && !this.ws) {
4226
+ this.open();
4227
+ }
4228
+ }, delayMs);
4229
+ }
4230
+ };
4231
+
4232
+ // src/namespaces/warp.ts
4233
+ var WarpNamespace = class {
4234
+ ctx;
4235
+ constructor(ctx) {
4236
+ this.ctx = ctx;
4237
+ }
4238
+ createEventStream(input) {
4239
+ return this.ctx.http.request("POST", "/warp/events", { body: input });
4240
+ }
4241
+ createAddressStream(input) {
4242
+ return this.ctx.http.request("POST", "/warp/addresses", { body: input });
4243
+ }
4244
+ createCoinStream(input) {
4245
+ return this.ctx.http.request("POST", "/warp/coins", { body: input });
4246
+ }
4247
+ createObjectStream(input) {
4248
+ return this.ctx.http.request("POST", "/warp/objects", { body: input });
4249
+ }
4250
+ list() {
4251
+ return this.ctx.http.request("GET", "/warp");
4252
+ }
4253
+ get(id) {
4254
+ return this.ctx.http.request("GET", `/warp/${encodeURIComponent(id)}`);
4255
+ }
4256
+ update(id, input) {
4257
+ return this.ctx.http.request("PUT", `/warp/${encodeURIComponent(id)}`, {
4258
+ body: input
4259
+ });
4260
+ }
4261
+ delete(id) {
4262
+ return this.ctx.http.request("DELETE", `/warp/${encodeURIComponent(id)}`);
4263
+ }
4264
+ /**
4265
+ * Open an SSE connection to a Warp subscription and start it.
4266
+ * At-least-once delivery; reconnects resume from the last event ID.
4267
+ */
4268
+ connect(subscriptionId, options = {}) {
4269
+ const stream = new WarpSseStream({
4270
+ ...options,
4271
+ auth: this.ctx.auth,
4272
+ subscriptionId,
4273
+ network: this.ctx.network,
4274
+ url: options.url ?? this.sseUrl(subscriptionId),
4275
+ fetch: options.fetch ?? this.ctx.fetch
4276
+ });
4277
+ stream.connect();
4278
+ return stream;
4279
+ }
4280
+ /**
4281
+ * Open a WebSocket connection to a Warp subscription and start it.
4282
+ * Exactly-once delivery via acks (automatic by default).
4283
+ */
4284
+ connectWebSocket(subscriptionId, options = {}) {
4285
+ const stream = new WarpWebSocketStream({
4286
+ ...options,
4287
+ auth: this.ctx.auth,
4288
+ subscriptionId,
4289
+ network: this.ctx.network,
4290
+ url: options.url ?? this.wsUrl(subscriptionId)
4291
+ });
4292
+ stream.connect();
4293
+ return stream;
4294
+ }
4295
+ /**
4296
+ * One call from catalog id to typed live events: resolves the event's
4297
+ * canonical type for this network, creates the subscription, connects,
4298
+ * and yields validated payloads.
4299
+ *
4300
+ * ```ts
4301
+ * const swaps = await inodra.warp.streamCatalogEvent("cetus.swap", {
4302
+ * ephemeral: true,
4303
+ * });
4304
+ * for await (const { payload, envelope } of swaps) {
4305
+ * console.log(envelope.txDigest, payload.amount_in);
4306
+ * }
4307
+ * ```
4308
+ */
4309
+ async streamCatalogEvent(id, options = {}) {
4310
+ const events = await Promise.resolve().then(() => (init_events2(), events_exports));
4311
+ const event = events.catalogEvents[id];
4312
+ if (!event) {
4313
+ throw new Error(`Unknown catalog event id: ${String(id)}`);
4314
+ }
4315
+ const deployments = event.deployments;
4316
+ const deployment = deployments.find(
4317
+ (d) => d.network === this.ctx.network && d.primary
4318
+ ) ?? deployments.find((d) => d.network === this.ctx.network);
4319
+ if (!deployment) {
4320
+ throw new Error(
4321
+ `Catalog event ${String(id)} has no verified deployment on ${this.ctx.network}`
4322
+ );
4323
+ }
4324
+ const { sender, eventFieldFilters, transport, ephemeral, ...connectOptions } = options;
4325
+ const created = await this.createEventStream({
4326
+ eventType: deployment.eventType,
4327
+ sender,
4328
+ eventFieldFilters
4329
+ });
4330
+ const subscription = created.data;
4331
+ let stream;
4332
+ try {
4333
+ stream = transport === "ws" ? this.connectWebSocket(subscription.id, connectOptions) : this.connect(subscription.id, connectOptions);
4334
+ } catch (error) {
4335
+ if (ephemeral) {
4336
+ await this.delete(subscription.id).catch(() => {
4337
+ });
4338
+ }
4339
+ throw error;
4340
+ }
4341
+ let cleaned = false;
4342
+ const close = async () => {
4343
+ stream.close();
4344
+ if (ephemeral && !cleaned) {
4345
+ cleaned = true;
4346
+ await this.delete(subscription.id);
4347
+ }
4348
+ };
4349
+ const network = this.ctx.network;
4350
+ return {
4351
+ subscription,
4352
+ stream,
4353
+ close,
4354
+ async *[Symbol.asyncIterator]() {
4355
+ try {
4356
+ for await (const raw of iterateStream(stream, {
4357
+ closeOnReturn: false
4358
+ })) {
4359
+ const payload = events.parseCatalogEvent(raw, id, { network });
4360
+ if (payload === void 0) {
4361
+ continue;
4362
+ }
4363
+ const envelope = events.warpEventPayloadSchema.parse(raw.data);
4364
+ yield { payload, envelope };
4365
+ }
4366
+ } finally {
4367
+ await close();
4368
+ }
4369
+ }
4370
+ };
4371
+ }
4372
+ sseUrl(subscriptionId) {
4373
+ if (!this.ctx.restBaseUrl) {
4374
+ return void 0;
4375
+ }
4376
+ return `${this.ctx.restBaseUrl}/warp/${encodeURIComponent(subscriptionId)}/stream`;
4377
+ }
4378
+ wsUrl(subscriptionId) {
4379
+ if (!this.ctx.warpWsBaseUrl) {
4380
+ return void 0;
4381
+ }
4382
+ return `${this.ctx.warpWsBaseUrl}/warp/${encodeURIComponent(subscriptionId)}/ws`;
4383
+ }
4384
+ };
4385
+
4386
+ // src/webhooks/index.ts
4387
+ async function verifyWebhookSignature(options) {
4388
+ const parsed = parseSignatureHeader(options.signature);
4389
+ if (!parsed) {
4390
+ return false;
4391
+ }
4392
+ const now = options.now ?? Math.floor(Date.now() / 1e3);
4393
+ const tolerance = options.toleranceSeconds ?? 300;
4394
+ if (Math.abs(now - parsed.timestamp) > tolerance) {
4395
+ return false;
4396
+ }
4397
+ const expected = await hmacSha256Hex(
4398
+ options.secret,
4399
+ `${parsed.timestamp}.${options.payload}`
4400
+ );
4401
+ return parsed.signatures.some(
4402
+ (candidate) => timingSafeEqualHex(candidate, expected)
4403
+ );
4404
+ }
4405
+ function parseSignatureHeader(header2) {
4406
+ if (typeof header2 !== "string" || header2.length === 0) {
4407
+ return void 0;
4408
+ }
4409
+ let timestamp;
4410
+ const signatures = [];
4411
+ for (const part of header2.split(",")) {
4412
+ const eq = part.indexOf("=");
4413
+ if (eq === -1) {
4414
+ continue;
4415
+ }
4416
+ const key = part.slice(0, eq).trim();
4417
+ const value = part.slice(eq + 1).trim();
4418
+ if (key === "t") {
4419
+ const ts = Number(value);
4420
+ if (Number.isInteger(ts)) {
4421
+ timestamp = ts;
4422
+ }
4423
+ } else if (key === "v1" && /^[0-9a-f]+$/i.test(value)) {
4424
+ signatures.push(value.toLowerCase());
4425
+ }
4426
+ }
4427
+ if (timestamp === void 0 || signatures.length === 0) {
4428
+ return void 0;
4429
+ }
4430
+ return { timestamp, signatures };
4431
+ }
4432
+ async function hmacSha256Hex(secret, message) {
4433
+ const encoder = new TextEncoder();
4434
+ const key = await crypto.subtle.importKey(
4435
+ "raw",
4436
+ encoder.encode(secret),
4437
+ { name: "HMAC", hash: "SHA-256" },
4438
+ false,
4439
+ ["sign"]
4440
+ );
4441
+ const signature = await crypto.subtle.sign(
4442
+ "HMAC",
4443
+ key,
4444
+ encoder.encode(message)
4445
+ );
4446
+ return Array.from(
4447
+ new Uint8Array(signature),
4448
+ (byte) => byte.toString(16).padStart(2, "0")
4449
+ ).join("");
4450
+ }
4451
+ function timingSafeEqualHex(a, b) {
4452
+ if (a.length !== b.length) {
4453
+ return false;
4454
+ }
4455
+ let diff = 0;
4456
+ for (let i = 0; i < a.length; i++) {
4457
+ diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
4458
+ }
4459
+ return diff === 0;
4460
+ }
4461
+
4462
+ // src/namespaces/webhooks.ts
4463
+ var WebhooksNamespace = class {
4464
+ http;
4465
+ constructor(http) {
4466
+ this.http = http;
4467
+ }
4468
+ createEvent(input) {
4469
+ return this.http.request("POST", "/webhooks/events", { body: input });
4470
+ }
4471
+ createAddress(input) {
4472
+ return this.http.request("POST", "/webhooks/addresses", { body: input });
4473
+ }
4474
+ createCoin(input) {
4475
+ return this.http.request("POST", "/webhooks/coins", { body: input });
4476
+ }
4477
+ createObject(input) {
4478
+ return this.http.request("POST", "/webhooks/objects", { body: input });
4479
+ }
4480
+ list() {
4481
+ return this.http.request("GET", "/webhooks");
4482
+ }
4483
+ get(id) {
4484
+ return this.http.request("GET", `/webhooks/${encodeURIComponent(id)}`);
4485
+ }
4486
+ update(id, input) {
4487
+ return this.http.request("PUT", `/webhooks/${encodeURIComponent(id)}`, {
4488
+ body: input
4489
+ });
4490
+ }
4491
+ delete(id) {
4492
+ return this.http.request("DELETE", `/webhooks/${encodeURIComponent(id)}`);
4493
+ }
4494
+ /** Verify an incoming webhook delivery's X-Inodra-Signature header. */
4495
+ verifySignature(options) {
4496
+ return verifyWebhookSignature(options);
4497
+ }
4498
+ /**
4499
+ * Verify and parse an incoming event-webhook delivery in one step
4500
+ * (Stripe's constructEvent pattern). Throws InodraWebhookSignatureError
4501
+ * on a bad or expired signature, and a zod error if the body doesn't
4502
+ * look like an Inodra delivery.
4503
+ *
4504
+ * Pair with `matchCatalogEvent`/`parseCatalogEvent` from
4505
+ * `@inodra/sui/events` to narrow the payload to a catalog event type.
4506
+ *
4507
+ * ```ts
4508
+ * const body = await inodra.webhooks.constructEvent({
4509
+ * payload: rawBody, // exact raw string — do not JSON.parse first
4510
+ * signature: req.headers["x-inodra-signature"],
4511
+ * secret: process.env.INODRA_WEBHOOK_SECRET,
4512
+ * });
4513
+ * const swap = parseCatalogEvent(body, "cetus.swap");
4514
+ * ```
4515
+ */
4516
+ async constructEvent(options) {
4517
+ const valid = await verifyWebhookSignature(options);
4518
+ if (!valid) {
4519
+ throw new InodraWebhookSignatureError();
4520
+ }
4521
+ const { webhookEventBodySchema: webhookEventBodySchema2 } = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
4522
+ return webhookEventBodySchema2.parse(JSON.parse(options.payload));
4523
+ }
4524
+ };
4525
+
4526
+ // src/client.ts
4527
+ var Inodra = class {
4528
+ network;
4529
+ /** The underlying REST transport (shared by all REST namespaces). */
4530
+ http;
4531
+ options;
4532
+ auth;
4533
+ memo = /* @__PURE__ */ new Map();
4534
+ constructor(options) {
4535
+ authFromOptions(options, "Inodra");
4536
+ this.options = options;
4537
+ this.auth = options.auth ?? { apiKey: options.apiKey };
4538
+ this.network = options.network ?? "mainnet";
4539
+ this.http = new InodraHttpClient({
4540
+ auth: this.auth,
4541
+ network: this.network,
4542
+ baseUrl: options.endpoints?.rest,
4543
+ maxRetries: options.maxRetries,
4544
+ timeoutMs: options.timeoutMs,
4545
+ fetch: options.fetch,
4546
+ onResponseMeta: options.onResponseMeta
4547
+ });
4548
+ }
4549
+ /** Rate-limit/credit info from the most recent REST response. */
4550
+ get lastResponseMeta() {
4551
+ return this.http.lastResponseMeta;
4552
+ }
4553
+ /**
4554
+ * Sui gRPC client (@mysten/sui) over Inodra's authenticated gateway.
4555
+ * Uses a fetch-based gRPC-Web transport — works in browsers, edge
4556
+ * runtimes, and Node. For native HTTP/2 gRPC on Node, use
4557
+ * `@inodra/sui/node`.
4558
+ */
4559
+ get grpc() {
4560
+ return this.lazy("grpc", () => this.createGrpcClient());
4561
+ }
4562
+ /** Sui GraphQL client (@mysten/sui) over Inodra's authenticated gateway. */
4563
+ get graphql() {
4564
+ return this.lazy(
4565
+ "graphql",
4566
+ () => createInodraGraphQLClient({
4567
+ auth: this.auth,
4568
+ network: this.network,
4569
+ url: this.options.endpoints?.graphql
4570
+ })
4571
+ );
4572
+ }
4573
+ /** Warp streams: subscription CRUD + live SSE/WebSocket delivery. */
4574
+ get warp() {
4575
+ return this.lazy(
4576
+ "warp",
4577
+ () => new WarpNamespace({
4578
+ http: this.http,
4579
+ auth: this.auth,
4580
+ network: this.network,
4581
+ restBaseUrl: this.options.endpoints?.rest,
4582
+ warpWsBaseUrl: this.options.endpoints?.warpWs,
4583
+ fetch: this.options.fetch
4584
+ })
4585
+ );
4586
+ }
4587
+ /** Webhooks: subscription CRUD + delivery signature verification. */
4588
+ get webhooks() {
4589
+ return this.lazy("webhooks", () => new WebhooksNamespace(this.http));
4590
+ }
4591
+ /** Indexer-backed data: accounts, coins, packages, validators, SuiNS, …. */
4592
+ get data() {
4593
+ return this.lazy("data", () => new DataNamespace(this.http));
4594
+ }
4595
+ /** Curated protocol event catalog (live view). */
4596
+ get catalog() {
4597
+ return this.lazy("catalog", () => new CatalogNamespace(this.http));
4598
+ }
4599
+ /** The authenticated principal: key introspection + usage stats. */
4600
+ get account() {
4601
+ return this.lazy("account", () => new AccountNamespace(this.http));
4602
+ }
4603
+ /** Reflection-based typed payloads for arbitrary (uncataloged) events. */
4604
+ get events() {
4605
+ return this.lazy(
4606
+ "events",
4607
+ () => new EventsNamespace({
4608
+ auth: this.auth,
4609
+ network: this.network,
4610
+ graphqlUrl: this.options.endpoints?.graphql,
4611
+ fetch: this.options.fetch
4612
+ })
4613
+ );
4614
+ }
4615
+ /** Default endpoints for this client's network. */
4616
+ get endpoints() {
4617
+ return INODRA_ENDPOINTS[this.network];
4618
+ }
4619
+ createGrpcClient() {
4620
+ return createInodraGrpcWebClient({
4621
+ auth: this.auth,
4622
+ network: this.network,
4623
+ baseUrl: this.options.endpoints?.grpcWeb
4624
+ });
4625
+ }
4626
+ lazy(key, create) {
4627
+ let value = this.memo.get(key);
4628
+ if (value === void 0) {
4629
+ value = create();
4630
+ this.memo.set(key, value);
4631
+ }
4632
+ return value;
4633
+ }
4634
+ };
4635
+
4636
+ // src/index.ts
4637
+ init_auth();
4638
+ init_network();
4639
+ init_version();
4640
+
4641
+ // src/manage/index.ts
4642
+ var InodraManagementClient = class {
4643
+ http;
4644
+ constructor(options) {
4645
+ this.http = new InodraHttpClient(options);
4646
+ }
4647
+ webhooks = {
4648
+ createEvent: (input) => this.http.request("POST", "/webhooks/events", {
4649
+ body: input
4650
+ }),
4651
+ createAddress: (input) => this.http.request("POST", "/webhooks/addresses", {
4652
+ body: input
4653
+ }),
4654
+ createCoin: (input) => this.http.request("POST", "/webhooks/coins", {
4655
+ body: input
4656
+ }),
4657
+ createObject: (input) => this.http.request("POST", "/webhooks/objects", {
4658
+ body: input
4659
+ }),
4660
+ list: () => this.http.request("GET", "/webhooks"),
4661
+ get: (id) => this.http.request("GET", `/webhooks/${encodeURIComponent(id)}`),
4662
+ update: (id, input) => this.http.request(
4663
+ "PUT",
4664
+ `/webhooks/${encodeURIComponent(id)}`,
4665
+ { body: input }
4666
+ ),
4667
+ delete: (id) => this.http.request(
4668
+ "DELETE",
4669
+ `/webhooks/${encodeURIComponent(id)}`
4670
+ )
4671
+ };
4672
+ warp = {
4673
+ createEventStream: (input) => this.http.request("POST", "/warp/events", {
4674
+ body: input
4675
+ }),
4676
+ createAddressStream: (input) => this.http.request("POST", "/warp/addresses", {
4677
+ body: input
4678
+ }),
4679
+ createCoinStream: (input) => this.http.request("POST", "/warp/coins", {
4680
+ body: input
4681
+ }),
4682
+ createObjectStream: (input) => this.http.request("POST", "/warp/objects", {
4683
+ body: input
4684
+ }),
4685
+ list: () => this.http.request("GET", "/warp"),
4686
+ get: (id) => this.http.request("GET", `/warp/${encodeURIComponent(id)}`),
4687
+ update: (id, input) => this.http.request(
4688
+ "PUT",
4689
+ `/warp/${encodeURIComponent(id)}`,
4690
+ { body: input }
4691
+ ),
4692
+ delete: (id) => this.http.request(
4693
+ "DELETE",
4694
+ `/warp/${encodeURIComponent(id)}`
4695
+ )
4696
+ };
4697
+ };
4698
+ // Annotate the CommonJS export names for ESM import in node:
4699
+ 0 && (module.exports = {
4700
+ AccountNamespace,
4701
+ CatalogNamespace,
4702
+ DataNamespace,
4703
+ EventsNamespace,
4704
+ INODRA_ENDPOINTS,
4705
+ Inodra,
4706
+ InodraAuthenticationError,
4707
+ InodraError,
4708
+ InodraHttpClient,
4709
+ InodraManagementClient,
4710
+ InodraRateLimitError,
4711
+ InodraTimeoutError,
4712
+ InodraWebhookSignatureError,
4713
+ SDK_VERSION,
4714
+ WarpNamespace,
4715
+ WarpSseStream,
4716
+ WarpWebSocketStream,
4717
+ WebhooksNamespace,
4718
+ iterateStream,
4719
+ paginate,
4720
+ resolveAuth,
4721
+ verifyWebhookSignature
4722
+ });
4723
+ //# sourceMappingURL=index.cjs.map