@glowlabs-org/events-sdk 1.0.14 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,6 +68,9 @@ Currently supported event types and versions:
68
68
  | `application.price.quote` | "v2-alpha" | `ApplicationPriceQuoteV2AlphaPayload` | Price quote for application |
69
69
  | `gctl.minted` | "v2-alpha" | `GctlMintedV2AlphaPayload` | GCTL minted amount and metadata |
70
70
  | `auditor.fees.paid` | "v2-alpha" | `AuditorFeesPaidV2AlphaPayload` | Auditor fee paid (by applicationId) |
71
+ | `fraction.created` | "v2-alpha" | `FractionCreatedV2AlphaPayload` | Fraction created with token and ownership details |
72
+ | `fraction.sold` | "v2-alpha" | `FractionSoldV2AlphaPayload` | Fraction sold between creator and buyer |
73
+ | `fraction.closed` | "v2-alpha" | `FractionClosedV2AlphaPayload` | Fraction closed/cancelled |
71
74
 
72
75
  ---
73
76
 
@@ -183,7 +186,7 @@ export interface AuditPushedV2AlphaPayload {
183
186
  ### `audit.pfees.paid` v2-alpha
184
187
 
185
188
  ```ts
186
- export type PaymentCurrency = "GCTL" | "USDC" | "USDG" | "GLW";
189
+ export type PaymentCurrency = "GCTL" | "USDC" | "USDG" | "GLW" | "SGCTL";
187
190
  export interface AuditPfeesPaidV2AlphaPayload {
188
191
  applicationId: string; // UUID string
189
192
  payer: string; // Ethereum address (0x...)
@@ -229,6 +232,51 @@ export interface AuditorFeesPaidV2AlphaPayload {
229
232
  }
230
233
  ```
231
234
 
235
+ ### `fraction.created` v2-alpha
236
+
237
+ ```ts
238
+ export interface FractionCreatedV2AlphaPayload {
239
+ fractionId: string;
240
+ transactionHash: string; // bytes32 hex string (0x...)
241
+ blockNumber: string; // uint256 (decimal)
242
+ logIndex: number;
243
+ token: string; // Ethereum address (0x...)
244
+ owner: string; // Ethereum address (0x...)
245
+ step: string; // uint256 (decimal)
246
+ totalSteps: string; // uint256 (decimal)
247
+ }
248
+ ```
249
+
250
+ ### `fraction.sold` v2-alpha
251
+
252
+ ```ts
253
+ export interface FractionSoldV2AlphaPayload {
254
+ fractionId: string;
255
+ transactionHash: string; // bytes32 hex string (0x...)
256
+ blockNumber: string; // uint256 (decimal)
257
+ logIndex: number;
258
+ creator: string; // Ethereum address (0x...)
259
+ buyer: string; // Ethereum address (0x...)
260
+ step: string; // uint256 (decimal)
261
+ amount: string; // uint256 (decimal)
262
+ timestamp: number;
263
+ }
264
+ ```
265
+
266
+ ### `fraction.closed` v2-alpha
267
+
268
+ ```ts
269
+ export interface FractionClosedV2AlphaPayload {
270
+ fractionId: string;
271
+ transactionHash: string; // bytes32 hex string (0x...)
272
+ blockNumber: string; // uint256 (decimal)
273
+ logIndex: number;
274
+ token: string; // Ethereum address (0x...)
275
+ owner: string; // Ethereum address (0x...)
276
+ timestamp: number;
277
+ }
278
+ ```
279
+
232
280
  ````
233
281
 
234
282
  **Validation:**
@@ -102,4 +102,28 @@ export interface BaseEventAuditorFeesPaidV2Alpha {
102
102
  eventType: "auditor.fees.paid";
103
103
  timeStamp: number;
104
104
  }
105
- export type BaseEvent = BaseEventAuditPushedV1 | BaseEventAuditSlashedV1 | BaseEventAuditPfeesPaidV1 | BaseEventAuditPfeesPaidV2 | BaseEventAuditPfeesPaidV2Alpha | BaseEventApplicationCreatedV1 | BaseEventApplicationCreatedV2Alpha | BaseEventApplicationPriceQuoteV2Alpha | BaseEventGctlMintedV2Alpha | BaseEventAuditorFeesPaidV2Alpha;
105
+ export interface BaseEventFractionCreatedV2Alpha {
106
+ id: string;
107
+ zoneId: number;
108
+ zoneName: string;
109
+ schemaVersion: "v2-alpha";
110
+ eventType: "fraction.created";
111
+ timeStamp: number;
112
+ }
113
+ export interface BaseEventFractionSoldV2Alpha {
114
+ id: string;
115
+ zoneId: number;
116
+ zoneName: string;
117
+ schemaVersion: "v2-alpha";
118
+ eventType: "fraction.sold";
119
+ timeStamp: number;
120
+ }
121
+ export interface BaseEventFractionClosedV2Alpha {
122
+ id: string;
123
+ zoneId: number;
124
+ zoneName: string;
125
+ schemaVersion: "v2-alpha";
126
+ eventType: "fraction.closed";
127
+ timeStamp: number;
128
+ }
129
+ export type BaseEvent = BaseEventAuditPushedV1 | BaseEventAuditSlashedV1 | BaseEventAuditPfeesPaidV1 | BaseEventAuditPfeesPaidV2 | BaseEventAuditPfeesPaidV2Alpha | BaseEventApplicationCreatedV1 | BaseEventApplicationCreatedV2Alpha | BaseEventApplicationPriceQuoteV2Alpha | BaseEventGctlMintedV2Alpha | BaseEventAuditorFeesPaidV2Alpha | BaseEventFractionCreatedV2Alpha | BaseEventFractionSoldV2Alpha | BaseEventFractionClosedV2Alpha;
@@ -15,6 +15,9 @@ const audit_pushed_v2_alpha_1 = require("./schemas/audit-pushed.v2-alpha");
15
15
  const gctl_minted_v2_alpha_1 = require("./schemas/gctl-minted.v2-alpha");
16
16
  const auditor_fees_paid_v2_alpha_1 = require("./schemas/auditor-fees-paid.v2-alpha");
17
17
  const application_created_v2_alpha_1 = require("./schemas/application-created.v2-alpha");
18
+ const fraction_created_v2_alpha_1 = require("./schemas/fraction-created.v2-alpha");
19
+ const fraction_sold_v2_alpha_1 = require("./schemas/fraction-sold.v2-alpha");
20
+ const fraction_closed_v2_alpha_1 = require("./schemas/fraction-closed.v2-alpha");
18
21
  const eventTypeRegistry = {
19
22
  [`${event_types_1.eventTypes.auditPushed}:v1`]: base_event_1.baseEventZ.extend({
20
23
  payload: audit_pushed_v1_1.auditPushedV1PayloadZ,
@@ -52,6 +55,15 @@ const eventTypeRegistry = {
52
55
  [`${event_types_1.eventTypes.auditorFeesPaid}:v2-alpha`]: base_event_1.baseEventZ.extend({
53
56
  payload: auditor_fees_paid_v2_alpha_1.auditorFeesPaidV2AlphaPayloadZ,
54
57
  }),
58
+ [`${event_types_1.eventTypes.fractionCreated}:v2-alpha`]: base_event_1.baseEventZ.extend({
59
+ payload: fraction_created_v2_alpha_1.fractionCreatedV2AlphaPayloadZ,
60
+ }),
61
+ [`${event_types_1.eventTypes.fractionSold}:v2-alpha`]: base_event_1.baseEventZ.extend({
62
+ payload: fraction_sold_v2_alpha_1.fractionSoldV2AlphaPayloadZ,
63
+ }),
64
+ [`${event_types_1.eventTypes.fractionClosed}:v2-alpha`]: base_event_1.baseEventZ.extend({
65
+ payload: fraction_closed_v2_alpha_1.fractionClosedV2AlphaPayloadZ,
66
+ }),
55
67
  // Add more event types/versions here
56
68
  };
57
69
  function getEventSchema(eventType, version) {
@@ -6,5 +6,8 @@ export declare const eventTypes: {
6
6
  readonly applicationPriceQuote: "application.price.quote";
7
7
  readonly gctlMinted: "gctl.minted";
8
8
  readonly auditorFeesPaid: "auditor.fees.paid";
9
+ readonly fractionCreated: "fraction.created";
10
+ readonly fractionSold: "fraction.sold";
11
+ readonly fractionClosed: "fraction.closed";
9
12
  };
10
13
  export type EventType = (typeof eventTypes)[keyof typeof eventTypes];
@@ -9,4 +9,7 @@ exports.eventTypes = {
9
9
  applicationPriceQuote: "application.price.quote",
10
10
  gctlMinted: "gctl.minted",
11
11
  auditorFeesPaid: "auditor.fees.paid",
12
+ fractionCreated: "fraction.created",
13
+ fractionSold: "fraction.sold",
14
+ fractionClosed: "fraction.closed",
12
15
  };
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
- export type PaymentCurrency = "GCTL" | "USDC" | "USDG" | "GLW";
2
+ export type PaymentCurrency = "GCTL" | "USDC" | "USDG" | "GLW" | "SGCTL";
3
3
  export declare const auditPfeesPaidV2AlphaPayloadZ: z.ZodObject<{
4
4
  applicationId: z.ZodString;
5
5
  payer: z.ZodString;
6
6
  amount_6Decimals: z.ZodString;
7
7
  txHash: z.ZodString;
8
8
  } & {
9
- paymentCurrency: z.ZodEnum<["GCTL", "USDC", "USDG", "GLW"]>;
9
+ paymentCurrency: z.ZodEnum<["GCTL", "USDC", "USDG", "GLW", "SGCTL"]>;
10
10
  paymentEventType: z.ZodString;
11
11
  isSponsored: z.ZodBoolean;
12
12
  }, "strip", z.ZodTypeAny, {
@@ -14,7 +14,7 @@ export declare const auditPfeesPaidV2AlphaPayloadZ: z.ZodObject<{
14
14
  applicationId: string;
15
15
  payer: string;
16
16
  amount_6Decimals: string;
17
- paymentCurrency: "GCTL" | "GLW" | "USDC" | "USDG";
17
+ paymentCurrency: "GCTL" | "GLW" | "USDC" | "USDG" | "SGCTL";
18
18
  paymentEventType: string;
19
19
  isSponsored: boolean;
20
20
  }, {
@@ -22,7 +22,7 @@ export declare const auditPfeesPaidV2AlphaPayloadZ: z.ZodObject<{
22
22
  applicationId: string;
23
23
  payer: string;
24
24
  amount_6Decimals: string;
25
- paymentCurrency: "GCTL" | "GLW" | "USDC" | "USDG";
25
+ paymentCurrency: "GCTL" | "GLW" | "USDC" | "USDG" | "SGCTL";
26
26
  paymentEventType: string;
27
27
  isSponsored: boolean;
28
28
  }>;
@@ -4,7 +4,7 @@ exports.auditPfeesPaidV2AlphaPayloadZ = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const audit_pfees_paid_v1_1 = require("./audit-pfees-paid.v1");
6
6
  exports.auditPfeesPaidV2AlphaPayloadZ = audit_pfees_paid_v1_1.auditPfeesPaidV1PayloadZ.extend({
7
- paymentCurrency: zod_1.z.enum(["GCTL", "USDC", "USDG", "GLW"]),
7
+ paymentCurrency: zod_1.z.enum(["GCTL", "USDC", "USDG", "GLW", "SGCTL"]),
8
8
  paymentEventType: zod_1.z.string(),
9
9
  isSponsored: zod_1.z.boolean(),
10
10
  });
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ export declare const fractionClosedV2AlphaPayloadZ: z.ZodObject<{
3
+ fractionId: z.ZodString;
4
+ transactionHash: z.ZodString;
5
+ blockNumber: z.ZodString;
6
+ logIndex: z.ZodNumber;
7
+ token: z.ZodString;
8
+ owner: z.ZodString;
9
+ timestamp: z.ZodNumber;
10
+ }, "strip", z.ZodTypeAny, {
11
+ timestamp: number;
12
+ fractionId: string;
13
+ transactionHash: string;
14
+ blockNumber: string;
15
+ logIndex: number;
16
+ token: string;
17
+ owner: string;
18
+ }, {
19
+ timestamp: number;
20
+ fractionId: string;
21
+ transactionHash: string;
22
+ blockNumber: string;
23
+ logIndex: number;
24
+ token: string;
25
+ owner: string;
26
+ }>;
27
+ export type FractionClosedV2AlphaPayload = z.infer<typeof fractionClosedV2AlphaPayloadZ>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fractionClosedV2AlphaPayloadZ = void 0;
4
+ const zod_1 = require("zod");
5
+ const patterns_1 = require("../patterns");
6
+ exports.fractionClosedV2AlphaPayloadZ = zod_1.z.object({
7
+ fractionId: zod_1.z.string(),
8
+ transactionHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
9
+ blockNumber: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
10
+ logIndex: zod_1.z.number().int(),
11
+ token: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
12
+ owner: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
13
+ timestamp: zod_1.z.number().int(),
14
+ });
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export declare const fractionCreatedV2AlphaPayloadZ: z.ZodObject<{
3
+ fractionId: z.ZodString;
4
+ transactionHash: z.ZodString;
5
+ blockNumber: z.ZodString;
6
+ logIndex: z.ZodNumber;
7
+ token: z.ZodString;
8
+ owner: z.ZodString;
9
+ step: z.ZodString;
10
+ totalSteps: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ fractionId: string;
13
+ transactionHash: string;
14
+ blockNumber: string;
15
+ logIndex: number;
16
+ token: string;
17
+ owner: string;
18
+ step: string;
19
+ totalSteps: string;
20
+ }, {
21
+ fractionId: string;
22
+ transactionHash: string;
23
+ blockNumber: string;
24
+ logIndex: number;
25
+ token: string;
26
+ owner: string;
27
+ step: string;
28
+ totalSteps: string;
29
+ }>;
30
+ export type FractionCreatedV2AlphaPayload = z.infer<typeof fractionCreatedV2AlphaPayloadZ>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fractionCreatedV2AlphaPayloadZ = void 0;
4
+ const zod_1 = require("zod");
5
+ const patterns_1 = require("../patterns");
6
+ exports.fractionCreatedV2AlphaPayloadZ = zod_1.z.object({
7
+ fractionId: zod_1.z.string(),
8
+ transactionHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
9
+ blockNumber: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
10
+ logIndex: zod_1.z.number().int(),
11
+ token: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
12
+ owner: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
13
+ step: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
14
+ totalSteps: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
15
+ });
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const fractionSoldV2AlphaPayloadZ: z.ZodObject<{
3
+ fractionId: z.ZodString;
4
+ transactionHash: z.ZodString;
5
+ blockNumber: z.ZodString;
6
+ logIndex: z.ZodNumber;
7
+ creator: z.ZodString;
8
+ buyer: z.ZodString;
9
+ step: z.ZodString;
10
+ amount: z.ZodString;
11
+ timestamp: z.ZodNumber;
12
+ }, "strip", z.ZodTypeAny, {
13
+ timestamp: number;
14
+ fractionId: string;
15
+ transactionHash: string;
16
+ blockNumber: string;
17
+ logIndex: number;
18
+ step: string;
19
+ creator: string;
20
+ buyer: string;
21
+ amount: string;
22
+ }, {
23
+ timestamp: number;
24
+ fractionId: string;
25
+ transactionHash: string;
26
+ blockNumber: string;
27
+ logIndex: number;
28
+ step: string;
29
+ creator: string;
30
+ buyer: string;
31
+ amount: string;
32
+ }>;
33
+ export type FractionSoldV2AlphaPayload = z.infer<typeof fractionSoldV2AlphaPayloadZ>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fractionSoldV2AlphaPayloadZ = void 0;
4
+ const zod_1 = require("zod");
5
+ const patterns_1 = require("../patterns");
6
+ exports.fractionSoldV2AlphaPayloadZ = zod_1.z.object({
7
+ fractionId: zod_1.z.string(),
8
+ transactionHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
9
+ blockNumber: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
10
+ logIndex: zod_1.z.number().int(),
11
+ creator: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
12
+ buyer: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
13
+ step: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
14
+ amount: zod_1.z.string().regex(patterns_1.uint256, "uint256 (decimal)"),
15
+ timestamp: zod_1.z.number().int(),
16
+ });
package/dist/types.d.ts CHANGED
@@ -12,6 +12,9 @@ import type { AuditPushedV2AlphaPayload } from "./schemas/audit-pushed.v2-alpha"
12
12
  import { eventTypes, EventType } from "./event-types";
13
13
  import type { AuditorFeesPaidV2AlphaPayload } from "./schemas/auditor-fees-paid.v2-alpha";
14
14
  import type { GctlMintedV2AlphaPayload } from "./schemas/gctl-minted.v2-alpha";
15
+ import type { FractionCreatedV2AlphaPayload } from "./schemas/fraction-created.v2-alpha";
16
+ import type { FractionSoldV2AlphaPayload } from "./schemas/fraction-sold.v2-alpha";
17
+ import type { FractionClosedV2AlphaPayload } from "./schemas/fraction-closed.v2-alpha";
15
18
  export { EventType, eventTypes };
16
19
  export type EventVersion = "v1" | "v2" | "v2-alpha";
17
20
  export interface EventPayloadMap {
@@ -41,6 +44,15 @@ export interface EventPayloadMap {
41
44
  [eventTypes.auditorFeesPaid]: {
42
45
  "v2-alpha": AuditorFeesPaidV2AlphaPayload;
43
46
  };
47
+ [eventTypes.fractionCreated]: {
48
+ "v2-alpha": FractionCreatedV2AlphaPayload;
49
+ };
50
+ [eventTypes.fractionSold]: {
51
+ "v2-alpha": FractionSoldV2AlphaPayload;
52
+ };
53
+ [eventTypes.fractionClosed]: {
54
+ "v2-alpha": FractionClosedV2AlphaPayload;
55
+ };
44
56
  }
45
57
  export type EventPayload<T extends EventType, V extends keyof EventPayloadMap[T]> = T extends keyof EventPayloadMap ? V extends keyof EventPayloadMap[T] ? EventPayloadMap[T][V] : never : never;
46
58
  export interface GlowEvent<TPayload> extends Omit<BaseEvent, "payload"> {
package/dist/zones.d.ts CHANGED
@@ -1,14 +1,18 @@
1
1
  export declare const zoneMap: {
2
2
  readonly 0: "All Zones";
3
3
  readonly 1: "Clean Grid Project";
4
- readonly 2: "Coming Soon Zone ";
4
+ readonly 2: "Utah";
5
+ readonly 3: "Missouri";
6
+ readonly 4: "Colorado";
5
7
  };
6
8
  export type ZoneId = keyof typeof zoneMap;
7
9
  export type ZoneName = (typeof zoneMap)[ZoneId];
8
10
  export declare const zoneKeyToId: {
9
11
  readonly AllZones: 0;
10
12
  readonly CleanGridProject: 1;
11
- readonly ComingSoonZone: 2;
13
+ readonly Utah: 2;
14
+ readonly Missouri: 3;
15
+ readonly Colorado: 4;
12
16
  };
13
17
  export type ZoneKey = keyof typeof zoneKeyToId;
14
18
  export declare function getZoneId(name: ZoneKey): number;
package/dist/zones.js CHANGED
@@ -5,13 +5,17 @@ exports.getZoneId = getZoneId;
5
5
  exports.zoneMap = {
6
6
  0: "All Zones",
7
7
  1: "Clean Grid Project",
8
- 2: "Coming Soon Zone ",
8
+ 2: "Utah",
9
+ 3: "Missouri",
10
+ 4: "Colorado",
9
11
  };
10
12
  // Stable keys for zone lookup (do not change these keys, only the display names in zoneMap)
11
13
  exports.zoneKeyToId = {
12
14
  AllZones: 0,
13
15
  CleanGridProject: 1,
14
- ComingSoonZone: 2,
16
+ Utah: 2,
17
+ Missouri: 3,
18
+ Colorado: 4,
15
19
  };
16
20
  function getZoneId(name) {
17
21
  return exports.zoneKeyToId[name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowlabs-org/events-sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "description": "Typed event SDK for Glow, powered by RabbitMQ and Zod.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",