@glowlabs-org/events-sdk 1.0.11 → 1.0.13
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 +12 -1
- package/dist/base-event.d.ts +9 -1
- package/dist/event-registry.js +4 -0
- package/dist/event-types.d.ts +1 -0
- package/dist/event-types.js +1 -0
- package/dist/schemas/auditor-fees-paid.v2-alpha.d.ts +18 -0
- package/dist/schemas/auditor-fees-paid.v2-alpha.js +13 -0
- package/dist/schemas/gctl-minted.v2-alpha.d.ts +0 -3
- package/dist/schemas/gctl-minted.v2-alpha.js +0 -3
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,6 +66,7 @@ Currently supported event types and versions:
|
|
|
66
66
|
| `audit.pushed` | "v2-alpha" | `AuditPushedV2AlphaPayload` | Same as v1 but without protocol fee |
|
|
67
67
|
| `application.price.quote` | "v2-alpha" | `ApplicationPriceQuoteV2AlphaPayload` | Price quote for application |
|
|
68
68
|
| `gctl.minted` | "v2-alpha" | `GctlMintedV2AlphaPayload` | GCTL minted amount and metadata |
|
|
69
|
+
| `auditor.fees.paid` | "v2-alpha" | `AuditorFeesPaidV2AlphaPayload` | Auditor fee paid (by applicationId) |
|
|
69
70
|
|
|
70
71
|
---
|
|
71
72
|
|
|
@@ -209,7 +210,6 @@ export interface ApplicationPriceQuoteV2AlphaPayload {
|
|
|
209
210
|
|
|
210
211
|
```ts
|
|
211
212
|
export interface GctlMintedV2AlphaPayload {
|
|
212
|
-
usdcAmount_6Decimals: string; // uint256 (decimal) − 6 implied decimals
|
|
213
213
|
gctlAmount_6Decimals: string; // uint256 (decimal) − 6 implied decimals
|
|
214
214
|
timestamp: string; // ISO-8601 datetime string
|
|
215
215
|
minter: string; // Ethereum address (0x...)
|
|
@@ -217,6 +217,17 @@ export interface GctlMintedV2AlphaPayload {
|
|
|
217
217
|
}
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
+
### `auditor.fees.paid` v2-alpha
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
export interface AuditorFeesPaidV2AlphaPayload {
|
|
224
|
+
applicationId: string; // UUID string
|
|
225
|
+
payer: string; // Ethereum address (0x...)
|
|
226
|
+
amount_6Decimals: string; // uint256 (decimal) − 6 implied decimals
|
|
227
|
+
txHash: string; // bytes32 hex string (0x...)
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
220
231
|
````
|
|
221
232
|
|
|
222
233
|
**Validation:**
|
package/dist/base-event.d.ts
CHANGED
|
@@ -86,4 +86,12 @@ export interface BaseEventGctlMintedV2Alpha {
|
|
|
86
86
|
eventType: "gctl.minted";
|
|
87
87
|
timeStamp: number;
|
|
88
88
|
}
|
|
89
|
-
export
|
|
89
|
+
export interface BaseEventAuditorFeesPaidV2Alpha {
|
|
90
|
+
id: string;
|
|
91
|
+
zoneId: number;
|
|
92
|
+
zoneName: string;
|
|
93
|
+
schemaVersion: "v2-alpha";
|
|
94
|
+
eventType: "auditor.fees.paid";
|
|
95
|
+
timeStamp: number;
|
|
96
|
+
}
|
|
97
|
+
export type BaseEvent = BaseEventAuditPushedV1 | BaseEventAuditSlashedV1 | BaseEventAuditPfeesPaidV1 | BaseEventAuditPfeesPaidV2 | BaseEventAuditPfeesPaidV2Alpha | BaseEventApplicationCreatedV1 | BaseEventApplicationPriceQuoteV2Alpha | BaseEventGctlMintedV2Alpha | BaseEventAuditorFeesPaidV2Alpha;
|
package/dist/event-registry.js
CHANGED
|
@@ -13,6 +13,7 @@ const application_price_quote_v2_alpha_1 = require("./schemas/application-price-
|
|
|
13
13
|
const audit_pfees_paid_v2_alpha_1 = require("./schemas/audit-pfees-paid.v2-alpha");
|
|
14
14
|
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
|
+
const auditor_fees_paid_v2_alpha_1 = require("./schemas/auditor-fees-paid.v2-alpha");
|
|
16
17
|
const eventTypeRegistry = {
|
|
17
18
|
[`${event_types_1.eventTypes.auditPushed}:v1`]: base_event_1.baseEventZ.extend({
|
|
18
19
|
payload: audit_pushed_v1_1.auditPushedV1PayloadZ,
|
|
@@ -44,6 +45,9 @@ const eventTypeRegistry = {
|
|
|
44
45
|
[`${event_types_1.eventTypes.gctlMinted}:v2-alpha`]: base_event_1.baseEventZ.extend({
|
|
45
46
|
payload: gctl_minted_v2_alpha_1.gctlMintedV2AlphaPayloadZ,
|
|
46
47
|
}),
|
|
48
|
+
[`${event_types_1.eventTypes.auditorFeesPaid}:v2-alpha`]: base_event_1.baseEventZ.extend({
|
|
49
|
+
payload: auditor_fees_paid_v2_alpha_1.auditorFeesPaidV2AlphaPayloadZ,
|
|
50
|
+
}),
|
|
47
51
|
// Add more event types/versions here
|
|
48
52
|
};
|
|
49
53
|
function getEventSchema(eventType, version) {
|
package/dist/event-types.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export declare const eventTypes: {
|
|
|
5
5
|
readonly applicationCreated: "application.created";
|
|
6
6
|
readonly applicationPriceQuote: "application.price.quote";
|
|
7
7
|
readonly gctlMinted: "gctl.minted";
|
|
8
|
+
readonly auditorFeesPaid: "auditor.fees.paid";
|
|
8
9
|
};
|
|
9
10
|
export type EventType = (typeof eventTypes)[keyof typeof eventTypes];
|
package/dist/event-types.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const auditorFeesPaidV2AlphaPayloadZ: z.ZodObject<{
|
|
3
|
+
applicationId: z.ZodString;
|
|
4
|
+
payer: z.ZodString;
|
|
5
|
+
amount_6Decimals: z.ZodString;
|
|
6
|
+
txHash: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
txHash: string;
|
|
9
|
+
applicationId: string;
|
|
10
|
+
payer: string;
|
|
11
|
+
amount_6Decimals: string;
|
|
12
|
+
}, {
|
|
13
|
+
txHash: string;
|
|
14
|
+
applicationId: string;
|
|
15
|
+
payer: string;
|
|
16
|
+
amount_6Decimals: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type AuditorFeesPaidV2AlphaPayload = z.infer<typeof auditorFeesPaidV2AlphaPayloadZ>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.auditorFeesPaidV2AlphaPayloadZ = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const patterns_1 = require("../patterns");
|
|
6
|
+
exports.auditorFeesPaidV2AlphaPayloadZ = zod_1.z.object({
|
|
7
|
+
applicationId: zod_1.z.string().uuid("UUID string"),
|
|
8
|
+
payer: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
|
|
9
|
+
amount_6Decimals: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.regex(patterns_1.uint256, "uint256 (decimal) − 6 implied decimals"),
|
|
12
|
+
txHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
|
|
13
|
+
});
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const gctlMintedV2AlphaPayloadZ: z.ZodObject<{
|
|
3
|
-
usdcAmount_6Decimals: z.ZodString;
|
|
4
3
|
gctlAmount_6Decimals: z.ZodString;
|
|
5
4
|
timestamp: z.ZodString;
|
|
6
5
|
minter: z.ZodString;
|
|
7
6
|
txHash: z.ZodString;
|
|
8
7
|
}, "strip", z.ZodTypeAny, {
|
|
9
8
|
txHash: string;
|
|
10
|
-
usdcAmount_6Decimals: string;
|
|
11
9
|
gctlAmount_6Decimals: string;
|
|
12
10
|
timestamp: string;
|
|
13
11
|
minter: string;
|
|
14
12
|
}, {
|
|
15
13
|
txHash: string;
|
|
16
|
-
usdcAmount_6Decimals: string;
|
|
17
14
|
gctlAmount_6Decimals: string;
|
|
18
15
|
timestamp: string;
|
|
19
16
|
minter: string;
|
|
@@ -4,9 +4,6 @@ exports.gctlMintedV2AlphaPayloadZ = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const patterns_1 = require("../patterns");
|
|
6
6
|
exports.gctlMintedV2AlphaPayloadZ = zod_1.z.object({
|
|
7
|
-
usdcAmount_6Decimals: zod_1.z
|
|
8
|
-
.string()
|
|
9
|
-
.regex(patterns_1.uint256, "uint256 (decimal) − 6 implied decimals"),
|
|
10
7
|
gctlAmount_6Decimals: zod_1.z
|
|
11
8
|
.string()
|
|
12
9
|
.regex(patterns_1.uint256, "uint256 (decimal) − 6 implied decimals"),
|
package/dist/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ApplicationPriceQuoteV2AlphaPayload } from "./schemas/application-
|
|
|
9
9
|
import type { AuditPushedV2Payload } from "./schemas/audit-pushed.v2";
|
|
10
10
|
import type { AuditPushedV2AlphaPayload } from "./schemas/audit-pushed.v2-alpha";
|
|
11
11
|
import { eventTypes, EventType } from "./event-types";
|
|
12
|
+
import type { AuditorFeesPaidV2AlphaPayload } from "./schemas/auditor-fees-paid.v2-alpha";
|
|
12
13
|
import type { GctlMintedV2AlphaPayload } from "./schemas/gctl-minted.v2-alpha";
|
|
13
14
|
export { EventType, eventTypes };
|
|
14
15
|
export type EventVersion = "v1" | "v2" | "v2-alpha";
|
|
@@ -35,6 +36,9 @@ export interface EventPayloadMap {
|
|
|
35
36
|
[eventTypes.gctlMinted]: {
|
|
36
37
|
"v2-alpha": GctlMintedV2AlphaPayload;
|
|
37
38
|
};
|
|
39
|
+
[eventTypes.auditorFeesPaid]: {
|
|
40
|
+
"v2-alpha": AuditorFeesPaidV2AlphaPayload;
|
|
41
|
+
};
|
|
38
42
|
}
|
|
39
43
|
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;
|
|
40
44
|
export interface GlowEvent<TPayload> extends Omit<BaseEvent, "payload"> {
|