@glowlabs-org/events-sdk 1.0.6 → 1.0.8
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
@@ -90,7 +90,7 @@ Use these in your code to avoid hardcoding event names and to benefit from autoc
|
|
90
90
|
```ts
|
91
91
|
export interface AuditPushedV1Payload {
|
92
92
|
farmId: string; // UUID string
|
93
|
-
|
93
|
+
protocolFeeUSDPrice_6Decimals: string; // uint256 (decimal) − 12 implied decimals
|
94
94
|
expectedProduction_12Decimals: string; // uint256 (decimal) − 12 implied decimals
|
95
95
|
txHash: string; // bytes32 hex string (0x...)
|
96
96
|
}
|
@@ -99,7 +99,7 @@ export interface AuditPushedV1Payload {
|
|
99
99
|
**Validation:**
|
100
100
|
|
101
101
|
- `farmId` must be a valid UUID string (e.g., `afbc56b6-0b16-4119-b144-025728067ba6`).
|
102
|
-
- `
|
102
|
+
- `protocolFeeUSDPrice_6Decimals` and `expectedProduction_12Decimals` must be decimal strings representing unsigned big integers.
|
103
103
|
- `txHash` must be a 32-byte hex string (e.g., `0x...`).
|
104
104
|
|
105
105
|
### `audit.slashed` v1
|
@@ -124,7 +124,7 @@ export interface AuditSlashedV1Payload {
|
|
124
124
|
export interface AuditPfeesPaidV1Payload {
|
125
125
|
applicationId: string; // UUID string
|
126
126
|
payer: string; // Ethereum address (0x...)
|
127
|
-
|
127
|
+
amount_6Decimals: string; // uint256 (decimal) − 6 implied decimals
|
128
128
|
txHash: string; // bytes32 hex string (0x...)
|
129
129
|
}
|
130
130
|
```
|
@@ -133,7 +133,7 @@ export interface AuditPfeesPaidV1Payload {
|
|
133
133
|
|
134
134
|
- `applicationId` must be a valid UUID string (e.g., `3ed964b1-4f02-475a-9789-fb74b3466c70`).
|
135
135
|
- `payer` must be a valid Ethereum address (0x...40 hex chars).
|
136
|
-
- `
|
136
|
+
- `amount_6Decimals` must be a decimal string representing an unsigned big integer (6 implied decimals).
|
137
137
|
- `txHash` must be a 32-byte hex string (e.g., `0x...`).
|
138
138
|
|
139
139
|
### `audit.pfees.paid` v2 (by farmId)
|
@@ -233,7 +233,7 @@ listener.onEvent("audit.pfees.paid", "v1", (event) => {
|
|
233
233
|
"Received audit.pfees.paid v1:",
|
234
234
|
event.payload.applicationId,
|
235
235
|
event.payload.payer,
|
236
|
-
event.payload.
|
236
|
+
event.payload.amount_6Decimals
|
237
237
|
);
|
238
238
|
});
|
239
239
|
|
@@ -283,7 +283,7 @@ await emitter.emit({
|
|
283
283
|
schemaVersion: "v1",
|
284
284
|
payload: {
|
285
285
|
farmId: "afbc56b6-0b16-4119-b144-025728067ba6", // UUID string
|
286
|
-
|
286
|
+
protocolFeeUSDPrice_6Decimals: "...",
|
287
287
|
expectedProduction_12Decimals: "...",
|
288
288
|
txHash: "0x...",
|
289
289
|
},
|
@@ -305,7 +305,7 @@ await emitter.emit({
|
|
305
305
|
payload: {
|
306
306
|
applicationId: "3ed964b1-4f02-475a-9789-fb74b3466c70", // UUID string
|
307
307
|
payer: "0x...",
|
308
|
-
|
308
|
+
amount_6Decimals: "1000000000000",
|
309
309
|
txHash: "0x...",
|
310
310
|
},
|
311
311
|
});
|
@@ -2,17 +2,17 @@ import { z } from "zod";
|
|
2
2
|
export declare const auditPfeesPaidV1PayloadZ: z.ZodObject<{
|
3
3
|
applicationId: z.ZodString;
|
4
4
|
payer: z.ZodString;
|
5
|
-
|
5
|
+
amount_6Decimals: z.ZodString;
|
6
6
|
txHash: z.ZodString;
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
8
8
|
txHash: string;
|
9
9
|
applicationId: string;
|
10
10
|
payer: string;
|
11
|
-
|
11
|
+
amount_6Decimals: string;
|
12
12
|
}, {
|
13
13
|
txHash: string;
|
14
14
|
applicationId: string;
|
15
15
|
payer: string;
|
16
|
-
|
16
|
+
amount_6Decimals: string;
|
17
17
|
}>;
|
18
18
|
export type AuditPfeesPaidV1Payload = z.infer<typeof auditPfeesPaidV1PayloadZ>;
|
@@ -6,8 +6,8 @@ const patterns_1 = require("../patterns");
|
|
6
6
|
exports.auditPfeesPaidV1PayloadZ = zod_1.z.object({
|
7
7
|
applicationId: zod_1.z.string().uuid("UUID string"),
|
8
8
|
payer: zod_1.z.string().regex(patterns_1.ethAddress, "Ethereum address"),
|
9
|
-
|
9
|
+
amount_6Decimals: zod_1.z
|
10
10
|
.string()
|
11
|
-
.regex(patterns_1.uint256, "uint256 (decimal) −
|
11
|
+
.regex(patterns_1.uint256, "uint256 (decimal) − 6 implied decimals"),
|
12
12
|
txHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
|
13
13
|
});
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { z } from "zod";
|
2
2
|
export declare const auditPushedV1PayloadZ: z.ZodObject<{
|
3
3
|
farmId: z.ZodString;
|
4
|
-
|
4
|
+
protocolFeeUSDPrice_6Decimals: z.ZodString;
|
5
5
|
expectedProduction_12Decimals: z.ZodString;
|
6
6
|
txHash: z.ZodString;
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
8
8
|
farmId: string;
|
9
|
-
|
9
|
+
protocolFeeUSDPrice_6Decimals: string;
|
10
10
|
expectedProduction_12Decimals: string;
|
11
11
|
txHash: string;
|
12
12
|
}, {
|
13
13
|
farmId: string;
|
14
|
-
|
14
|
+
protocolFeeUSDPrice_6Decimals: string;
|
15
15
|
expectedProduction_12Decimals: string;
|
16
16
|
txHash: string;
|
17
17
|
}>;
|
@@ -5,9 +5,9 @@ const zod_1 = require("zod");
|
|
5
5
|
const patterns_1 = require("../patterns");
|
6
6
|
exports.auditPushedV1PayloadZ = zod_1.z.object({
|
7
7
|
farmId: zod_1.z.string().uuid(),
|
8
|
-
|
8
|
+
protocolFeeUSDPrice_6Decimals: zod_1.z
|
9
9
|
.string()
|
10
|
-
.regex(patterns_1.uint256, "uint256 (decimal) −
|
10
|
+
.regex(patterns_1.uint256, "uint256 (decimal) − 6 implied decimals"),
|
11
11
|
expectedProduction_12Decimals: zod_1.z.string().regex(patterns_1.uint256),
|
12
12
|
txHash: zod_1.z.string().regex(patterns_1.hexBytes32, "bytes32 hex string"),
|
13
13
|
});
|
@@ -6,13 +6,13 @@ export declare const auditPushedV2PayloadZ: z.ZodObject<{
|
|
6
6
|
txHash: z.ZodString;
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
8
8
|
farmId: string;
|
9
|
-
protocolFeeUSDPrice_12Decimals: string;
|
10
9
|
expectedProduction_12Decimals: string;
|
11
10
|
txHash: string;
|
11
|
+
protocolFeeUSDPrice_12Decimals: string;
|
12
12
|
}, {
|
13
13
|
farmId: string;
|
14
|
-
protocolFeeUSDPrice_12Decimals: string;
|
15
14
|
expectedProduction_12Decimals: string;
|
16
15
|
txHash: string;
|
16
|
+
protocolFeeUSDPrice_12Decimals: string;
|
17
17
|
}>;
|
18
18
|
export type AuditPushedV2Payload = z.infer<typeof auditPushedV2PayloadZ>;
|