@secondlayer/shared 7.2.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +17 -109
- package/dist/src/index.js +100 -227
- package/dist/src/index.js.map +4 -5
- package/dist/src/schemas/index.d.ts +14 -107
- package/dist/src/schemas/index.js +95 -213
- package/dist/src/schemas/index.js.map +3 -4
- package/migrations/0082_contracts_registry.ts +4 -2
- package/migrations/0083_burnchain_rewards.ts +4 -2
- package/migrations/0107_burnchain_drop_canonical.ts +4 -2
- package/package.json +3 -6
- package/dist/src/schemas/filters.d.ts +0 -94
- package/dist/src/schemas/filters.js +0 -138
- package/dist/src/schemas/filters.js.map +0 -10
package/dist/src/index.js
CHANGED
|
@@ -1008,128 +1008,24 @@ function getErrorMessage(err) {
|
|
|
1008
1008
|
return err instanceof Error ? err.message : String(err);
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
|
-
// src/schemas/filters.ts
|
|
1012
|
-
import { isValidAddress as _isValidAddress } from "@secondlayer/stacks";
|
|
1013
|
-
import { z as z2 } from "zod";
|
|
1014
|
-
var isValidAddress = _isValidAddress;
|
|
1015
|
-
var stacksPrincipal = z2.string().refine((val) => {
|
|
1016
|
-
const parts = val.split(".");
|
|
1017
|
-
if (parts.length > 2)
|
|
1018
|
-
return false;
|
|
1019
|
-
return isValidAddress(parts[0]);
|
|
1020
|
-
}, "Invalid Stacks principal address");
|
|
1021
|
-
var baseFilter = {
|
|
1022
|
-
sender: stacksPrincipal.optional(),
|
|
1023
|
-
recipient: stacksPrincipal.optional()
|
|
1024
|
-
};
|
|
1025
|
-
var StxTransferFilterSchema = z2.object({
|
|
1026
|
-
type: z2.literal("stx_transfer"),
|
|
1027
|
-
...baseFilter,
|
|
1028
|
-
minAmount: z2.coerce.number().int().positive().optional(),
|
|
1029
|
-
maxAmount: z2.coerce.number().int().positive().optional()
|
|
1030
|
-
});
|
|
1031
|
-
var StxMintFilterSchema = z2.object({
|
|
1032
|
-
type: z2.literal("stx_mint"),
|
|
1033
|
-
recipient: stacksPrincipal.optional(),
|
|
1034
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1035
|
-
});
|
|
1036
|
-
var StxBurnFilterSchema = z2.object({
|
|
1037
|
-
type: z2.literal("stx_burn"),
|
|
1038
|
-
sender: stacksPrincipal.optional(),
|
|
1039
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1040
|
-
});
|
|
1041
|
-
var StxLockFilterSchema = z2.object({
|
|
1042
|
-
type: z2.literal("stx_lock"),
|
|
1043
|
-
lockedAddress: stacksPrincipal.optional(),
|
|
1044
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1045
|
-
});
|
|
1046
|
-
var FtTransferFilterSchema = z2.object({
|
|
1047
|
-
type: z2.literal("ft_transfer"),
|
|
1048
|
-
...baseFilter,
|
|
1049
|
-
assetIdentifier: z2.string().optional(),
|
|
1050
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1051
|
-
});
|
|
1052
|
-
var FtMintFilterSchema = z2.object({
|
|
1053
|
-
type: z2.literal("ft_mint"),
|
|
1054
|
-
recipient: stacksPrincipal.optional(),
|
|
1055
|
-
assetIdentifier: z2.string().optional(),
|
|
1056
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1057
|
-
});
|
|
1058
|
-
var FtBurnFilterSchema = z2.object({
|
|
1059
|
-
type: z2.literal("ft_burn"),
|
|
1060
|
-
sender: stacksPrincipal.optional(),
|
|
1061
|
-
assetIdentifier: z2.string().optional(),
|
|
1062
|
-
minAmount: z2.coerce.number().int().positive().optional()
|
|
1063
|
-
});
|
|
1064
|
-
var NftTransferFilterSchema = z2.object({
|
|
1065
|
-
type: z2.literal("nft_transfer"),
|
|
1066
|
-
...baseFilter,
|
|
1067
|
-
assetIdentifier: z2.string().optional(),
|
|
1068
|
-
tokenId: z2.string().optional()
|
|
1069
|
-
});
|
|
1070
|
-
var NftMintFilterSchema = z2.object({
|
|
1071
|
-
type: z2.literal("nft_mint"),
|
|
1072
|
-
recipient: stacksPrincipal.optional(),
|
|
1073
|
-
assetIdentifier: z2.string().optional(),
|
|
1074
|
-
tokenId: z2.string().optional()
|
|
1075
|
-
});
|
|
1076
|
-
var NftBurnFilterSchema = z2.object({
|
|
1077
|
-
type: z2.literal("nft_burn"),
|
|
1078
|
-
sender: stacksPrincipal.optional(),
|
|
1079
|
-
assetIdentifier: z2.string().optional(),
|
|
1080
|
-
tokenId: z2.string().optional()
|
|
1081
|
-
});
|
|
1082
|
-
var ContractCallFilterSchema = z2.object({
|
|
1083
|
-
type: z2.literal("contract_call"),
|
|
1084
|
-
contractId: stacksPrincipal.optional(),
|
|
1085
|
-
functionName: z2.string().optional(),
|
|
1086
|
-
caller: stacksPrincipal.optional()
|
|
1087
|
-
});
|
|
1088
|
-
var ContractDeployFilterSchema = z2.object({
|
|
1089
|
-
type: z2.literal("contract_deploy"),
|
|
1090
|
-
deployer: stacksPrincipal.optional(),
|
|
1091
|
-
contractName: z2.string().optional()
|
|
1092
|
-
});
|
|
1093
|
-
var PrintEventFilterSchema = z2.object({
|
|
1094
|
-
type: z2.literal("print_event"),
|
|
1095
|
-
contractId: stacksPrincipal.optional(),
|
|
1096
|
-
topic: z2.string().optional(),
|
|
1097
|
-
contains: z2.string().optional()
|
|
1098
|
-
});
|
|
1099
|
-
var EventFilterSchema = z2.discriminatedUnion("type", [
|
|
1100
|
-
StxTransferFilterSchema,
|
|
1101
|
-
StxMintFilterSchema,
|
|
1102
|
-
StxBurnFilterSchema,
|
|
1103
|
-
StxLockFilterSchema,
|
|
1104
|
-
FtTransferFilterSchema,
|
|
1105
|
-
FtMintFilterSchema,
|
|
1106
|
-
FtBurnFilterSchema,
|
|
1107
|
-
NftTransferFilterSchema,
|
|
1108
|
-
NftMintFilterSchema,
|
|
1109
|
-
NftBurnFilterSchema,
|
|
1110
|
-
ContractCallFilterSchema,
|
|
1111
|
-
ContractDeployFilterSchema,
|
|
1112
|
-
PrintEventFilterSchema
|
|
1113
|
-
]);
|
|
1114
|
-
|
|
1115
1011
|
// src/schemas/subgraphs.ts
|
|
1116
|
-
import { z as
|
|
1117
|
-
var DeploySubgraphRequestSchema =
|
|
1118
|
-
name:
|
|
1119
|
-
version:
|
|
1120
|
-
description:
|
|
1121
|
-
sources:
|
|
1122
|
-
schema:
|
|
1123
|
-
handlerCode:
|
|
1124
|
-
startBlock:
|
|
1125
|
-
sourceCode:
|
|
1126
|
-
databaseUrl:
|
|
1127
|
-
dryRun:
|
|
1128
|
-
visibility:
|
|
1012
|
+
import { z as z2 } from "zod";
|
|
1013
|
+
var DeploySubgraphRequestSchema = z2.object({
|
|
1014
|
+
name: z2.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").max(63),
|
|
1015
|
+
version: z2.string().optional(),
|
|
1016
|
+
description: z2.string().optional(),
|
|
1017
|
+
sources: z2.record(z2.string(), z2.record(z2.string(), z2.unknown())).refine((s) => Object.keys(s).length > 0, "Must have at least one source"),
|
|
1018
|
+
schema: z2.record(z2.string(), z2.unknown()),
|
|
1019
|
+
handlerCode: z2.string().max(1048576, "handler code exceeds 1MB limit"),
|
|
1020
|
+
startBlock: z2.number().int().nonnegative().optional(),
|
|
1021
|
+
sourceCode: z2.string().max(1048576, "source code exceeds 1MB limit").optional(),
|
|
1022
|
+
databaseUrl: z2.string().url().refine((u) => u.startsWith("postgres://") || u.startsWith("postgresql://"), "must be a postgres:// connection string").optional(),
|
|
1023
|
+
dryRun: z2.boolean().optional(),
|
|
1024
|
+
visibility: z2.enum(["public", "private"]).optional()
|
|
1129
1025
|
});
|
|
1130
1026
|
|
|
1131
1027
|
// src/schemas/subscriptions.ts
|
|
1132
|
-
import { z as
|
|
1028
|
+
import { z as z3 } from "zod";
|
|
1133
1029
|
var SUBSCRIPTION_FORMATS = [
|
|
1134
1030
|
"standard-webhooks",
|
|
1135
1031
|
"inngest",
|
|
@@ -1154,29 +1050,29 @@ var SUBSCRIPTION_FILTER_OPERATORS = [
|
|
|
1154
1050
|
"lte",
|
|
1155
1051
|
"in"
|
|
1156
1052
|
];
|
|
1157
|
-
var webhookUrl =
|
|
1158
|
-
var name =
|
|
1159
|
-
var resourceName =
|
|
1160
|
-
var SubscriptionStatusSchema =
|
|
1161
|
-
var SubscriptionFormatSchema =
|
|
1162
|
-
var SubscriptionRuntimeSchema =
|
|
1163
|
-
var SubscriptionFilterPrimitiveSchema =
|
|
1164
|
-
var SubscriptionFilterOperatorSchema =
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
in:
|
|
1053
|
+
var webhookUrl = z3.string().trim().min(1).refine((value) => value.startsWith("http://") || value.startsWith("https://"), "must be an http(s) URL");
|
|
1054
|
+
var name = z3.string().trim().min(1).max(128);
|
|
1055
|
+
var resourceName = z3.string().trim().min(1).max(128);
|
|
1056
|
+
var SubscriptionStatusSchema = z3.enum(SUBSCRIPTION_STATUSES);
|
|
1057
|
+
var SubscriptionFormatSchema = z3.enum(SUBSCRIPTION_FORMATS);
|
|
1058
|
+
var SubscriptionRuntimeSchema = z3.enum(SUBSCRIPTION_RUNTIMES);
|
|
1059
|
+
var SubscriptionFilterPrimitiveSchema = z3.union([z3.string(), z3.number().finite(), z3.boolean()]);
|
|
1060
|
+
var SubscriptionFilterOperatorSchema = z3.union([
|
|
1061
|
+
z3.object({ eq: SubscriptionFilterPrimitiveSchema }).strict(),
|
|
1062
|
+
z3.object({ neq: SubscriptionFilterPrimitiveSchema }).strict(),
|
|
1063
|
+
z3.object({ gt: z3.union([z3.string(), z3.number().finite()]) }).strict(),
|
|
1064
|
+
z3.object({ gte: z3.union([z3.string(), z3.number().finite()]) }).strict(),
|
|
1065
|
+
z3.object({ lt: z3.union([z3.string(), z3.number().finite()]) }).strict(),
|
|
1066
|
+
z3.object({ lte: z3.union([z3.string(), z3.number().finite()]) }).strict(),
|
|
1067
|
+
z3.object({
|
|
1068
|
+
in: z3.array(SubscriptionFilterPrimitiveSchema).min(1)
|
|
1173
1069
|
}).strict()
|
|
1174
1070
|
]);
|
|
1175
|
-
var SubscriptionFilterClauseSchema =
|
|
1071
|
+
var SubscriptionFilterClauseSchema = z3.union([
|
|
1176
1072
|
SubscriptionFilterPrimitiveSchema,
|
|
1177
1073
|
SubscriptionFilterOperatorSchema
|
|
1178
1074
|
]);
|
|
1179
|
-
var SubscriptionFilterSchema =
|
|
1075
|
+
var SubscriptionFilterSchema = z3.record(z3.string().min(1), SubscriptionFilterClauseSchema);
|
|
1180
1076
|
var CHAIN_TRIGGER_TYPES = [
|
|
1181
1077
|
"stx_transfer",
|
|
1182
1078
|
"stx_mint",
|
|
@@ -1197,131 +1093,131 @@ var CHAIN_TRIGGER_TYPES = [
|
|
|
1197
1093
|
"sbtc_withdrawal_reject",
|
|
1198
1094
|
"sbtc_withdrawal_swept_confirmed"
|
|
1199
1095
|
];
|
|
1200
|
-
var triggerAmount =
|
|
1201
|
-
|
|
1202
|
-
|
|
1096
|
+
var triggerAmount = z3.union([
|
|
1097
|
+
z3.string().trim().regex(/^\d+$/, "must be a non-negative integer string"),
|
|
1098
|
+
z3.number().int().nonnegative()
|
|
1203
1099
|
]);
|
|
1204
|
-
var triggerPattern =
|
|
1205
|
-
var trait =
|
|
1206
|
-
var ChainTriggerSchema =
|
|
1207
|
-
|
|
1208
|
-
type:
|
|
1100
|
+
var triggerPattern = z3.string().trim().min(1);
|
|
1101
|
+
var trait = z3.string().trim().min(1);
|
|
1102
|
+
var ChainTriggerSchema = z3.discriminatedUnion("type", [
|
|
1103
|
+
z3.object({
|
|
1104
|
+
type: z3.literal("stx_transfer"),
|
|
1209
1105
|
sender: triggerPattern.optional(),
|
|
1210
1106
|
recipient: triggerPattern.optional(),
|
|
1211
1107
|
minAmount: triggerAmount.optional(),
|
|
1212
1108
|
maxAmount: triggerAmount.optional()
|
|
1213
1109
|
}).strict(),
|
|
1214
|
-
|
|
1215
|
-
type:
|
|
1110
|
+
z3.object({
|
|
1111
|
+
type: z3.literal("stx_mint"),
|
|
1216
1112
|
recipient: triggerPattern.optional(),
|
|
1217
1113
|
minAmount: triggerAmount.optional()
|
|
1218
1114
|
}).strict(),
|
|
1219
|
-
|
|
1220
|
-
type:
|
|
1115
|
+
z3.object({
|
|
1116
|
+
type: z3.literal("stx_burn"),
|
|
1221
1117
|
sender: triggerPattern.optional(),
|
|
1222
1118
|
minAmount: triggerAmount.optional()
|
|
1223
1119
|
}).strict(),
|
|
1224
|
-
|
|
1225
|
-
type:
|
|
1120
|
+
z3.object({
|
|
1121
|
+
type: z3.literal("stx_lock"),
|
|
1226
1122
|
lockedAddress: triggerPattern.optional(),
|
|
1227
1123
|
minAmount: triggerAmount.optional()
|
|
1228
1124
|
}).strict(),
|
|
1229
|
-
|
|
1230
|
-
type:
|
|
1125
|
+
z3.object({
|
|
1126
|
+
type: z3.literal("ft_transfer"),
|
|
1231
1127
|
assetIdentifier: triggerPattern.optional(),
|
|
1232
1128
|
sender: triggerPattern.optional(),
|
|
1233
1129
|
recipient: triggerPattern.optional(),
|
|
1234
1130
|
minAmount: triggerAmount.optional(),
|
|
1235
1131
|
trait: trait.optional()
|
|
1236
1132
|
}).strict(),
|
|
1237
|
-
|
|
1238
|
-
type:
|
|
1133
|
+
z3.object({
|
|
1134
|
+
type: z3.literal("ft_mint"),
|
|
1239
1135
|
assetIdentifier: triggerPattern.optional(),
|
|
1240
1136
|
recipient: triggerPattern.optional(),
|
|
1241
1137
|
minAmount: triggerAmount.optional(),
|
|
1242
1138
|
trait: trait.optional()
|
|
1243
1139
|
}).strict(),
|
|
1244
|
-
|
|
1245
|
-
type:
|
|
1140
|
+
z3.object({
|
|
1141
|
+
type: z3.literal("ft_burn"),
|
|
1246
1142
|
assetIdentifier: triggerPattern.optional(),
|
|
1247
1143
|
sender: triggerPattern.optional(),
|
|
1248
1144
|
minAmount: triggerAmount.optional(),
|
|
1249
1145
|
trait: trait.optional()
|
|
1250
1146
|
}).strict(),
|
|
1251
|
-
|
|
1252
|
-
type:
|
|
1147
|
+
z3.object({
|
|
1148
|
+
type: z3.literal("nft_transfer"),
|
|
1253
1149
|
assetIdentifier: triggerPattern.optional(),
|
|
1254
1150
|
sender: triggerPattern.optional(),
|
|
1255
1151
|
recipient: triggerPattern.optional(),
|
|
1256
1152
|
trait: trait.optional()
|
|
1257
1153
|
}).strict(),
|
|
1258
|
-
|
|
1259
|
-
type:
|
|
1154
|
+
z3.object({
|
|
1155
|
+
type: z3.literal("nft_mint"),
|
|
1260
1156
|
assetIdentifier: triggerPattern.optional(),
|
|
1261
1157
|
recipient: triggerPattern.optional(),
|
|
1262
1158
|
trait: trait.optional()
|
|
1263
1159
|
}).strict(),
|
|
1264
|
-
|
|
1265
|
-
type:
|
|
1160
|
+
z3.object({
|
|
1161
|
+
type: z3.literal("nft_burn"),
|
|
1266
1162
|
assetIdentifier: triggerPattern.optional(),
|
|
1267
1163
|
sender: triggerPattern.optional(),
|
|
1268
1164
|
trait: trait.optional()
|
|
1269
1165
|
}).strict(),
|
|
1270
|
-
|
|
1271
|
-
type:
|
|
1166
|
+
z3.object({
|
|
1167
|
+
type: z3.literal("contract_call"),
|
|
1272
1168
|
contractId: triggerPattern.optional(),
|
|
1273
1169
|
functionName: triggerPattern.optional(),
|
|
1274
1170
|
caller: triggerPattern.optional(),
|
|
1275
1171
|
trait: trait.optional()
|
|
1276
1172
|
}).strict(),
|
|
1277
|
-
|
|
1278
|
-
type:
|
|
1173
|
+
z3.object({
|
|
1174
|
+
type: z3.literal("contract_deploy"),
|
|
1279
1175
|
deployer: triggerPattern.optional(),
|
|
1280
1176
|
contractName: triggerPattern.optional()
|
|
1281
1177
|
}).strict(),
|
|
1282
|
-
|
|
1283
|
-
type:
|
|
1178
|
+
z3.object({
|
|
1179
|
+
type: z3.literal("print_event"),
|
|
1284
1180
|
contractId: triggerPattern.optional(),
|
|
1285
1181
|
topic: triggerPattern.optional(),
|
|
1286
1182
|
trait: trait.optional()
|
|
1287
1183
|
}).strict(),
|
|
1288
|
-
|
|
1289
|
-
type:
|
|
1184
|
+
z3.object({
|
|
1185
|
+
type: z3.literal("sbtc_deposit"),
|
|
1290
1186
|
sender: triggerPattern.optional(),
|
|
1291
1187
|
minAmount: triggerAmount.optional(),
|
|
1292
1188
|
maxAmount: triggerAmount.optional(),
|
|
1293
1189
|
bitcoinTxid: triggerPattern.optional(),
|
|
1294
|
-
requestId:
|
|
1190
|
+
requestId: z3.number().int().nonnegative().optional()
|
|
1295
1191
|
}).strict(),
|
|
1296
|
-
|
|
1297
|
-
type:
|
|
1192
|
+
z3.object({
|
|
1193
|
+
type: z3.literal("sbtc_withdrawal_create"),
|
|
1298
1194
|
sender: triggerPattern.optional(),
|
|
1299
1195
|
minAmount: triggerAmount.optional(),
|
|
1300
1196
|
maxAmount: triggerAmount.optional(),
|
|
1301
|
-
requestId:
|
|
1197
|
+
requestId: z3.number().int().nonnegative().optional()
|
|
1302
1198
|
}).strict(),
|
|
1303
|
-
|
|
1304
|
-
type:
|
|
1305
|
-
requestId:
|
|
1199
|
+
z3.object({
|
|
1200
|
+
type: z3.literal("sbtc_withdrawal_accept"),
|
|
1201
|
+
requestId: z3.number().int().nonnegative().optional(),
|
|
1306
1202
|
sweepTxid: triggerPattern.optional()
|
|
1307
1203
|
}).strict(),
|
|
1308
|
-
|
|
1309
|
-
type:
|
|
1310
|
-
requestId:
|
|
1204
|
+
z3.object({
|
|
1205
|
+
type: z3.literal("sbtc_withdrawal_reject"),
|
|
1206
|
+
requestId: z3.number().int().nonnegative().optional()
|
|
1311
1207
|
}).strict(),
|
|
1312
|
-
|
|
1313
|
-
type:
|
|
1314
|
-
requestId:
|
|
1208
|
+
z3.object({
|
|
1209
|
+
type: z3.literal("sbtc_withdrawal_swept_confirmed"),
|
|
1210
|
+
requestId: z3.number().int().nonnegative().optional(),
|
|
1315
1211
|
sweepTxid: triggerPattern.optional()
|
|
1316
1212
|
}).strict()
|
|
1317
1213
|
]);
|
|
1318
|
-
var ChainTriggersSchema =
|
|
1214
|
+
var ChainTriggersSchema = z3.array(ChainTriggerSchema).min(1).max(50);
|
|
1319
1215
|
var CHAIN_TRIGGER_FIELDS = Object.fromEntries(ChainTriggerSchema._zod.def.options.map((opt) => {
|
|
1320
1216
|
const shape = opt._zod.def.shape;
|
|
1321
1217
|
const type = shape.type._zod.def.values[0];
|
|
1322
1218
|
return [type, Object.keys(shape).filter((k) => k !== "type")];
|
|
1323
1219
|
}));
|
|
1324
|
-
var CreateSubscriptionRequestSchema =
|
|
1220
|
+
var CreateSubscriptionRequestSchema = z3.object({
|
|
1325
1221
|
name,
|
|
1326
1222
|
subgraphName: resourceName.optional(),
|
|
1327
1223
|
tableName: resourceName.optional(),
|
|
@@ -1330,10 +1226,10 @@ var CreateSubscriptionRequestSchema = z4.object({
|
|
|
1330
1226
|
url: webhookUrl,
|
|
1331
1227
|
format: SubscriptionFormatSchema.default("standard-webhooks"),
|
|
1332
1228
|
runtime: SubscriptionRuntimeSchema.nullable().optional(),
|
|
1333
|
-
authConfig:
|
|
1334
|
-
maxRetries:
|
|
1335
|
-
timeoutMs:
|
|
1336
|
-
concurrency:
|
|
1229
|
+
authConfig: z3.record(z3.string(), z3.unknown()).optional(),
|
|
1230
|
+
maxRetries: z3.number().int().min(0).max(100).optional(),
|
|
1231
|
+
timeoutMs: z3.number().int().min(100).max(300000).optional(),
|
|
1232
|
+
concurrency: z3.number().int().min(1).max(100).optional()
|
|
1337
1233
|
}).refine((v) => {
|
|
1338
1234
|
const subgraphMode = v.subgraphName !== undefined || v.tableName !== undefined;
|
|
1339
1235
|
const chainMode = v.triggers !== undefined;
|
|
@@ -1348,23 +1244,23 @@ var CreateSubscriptionRequestSchema = z4.object({
|
|
|
1348
1244
|
message: "`filter` applies to subgraph subscriptions; chain subscriptions use `triggers`",
|
|
1349
1245
|
path: ["filter"]
|
|
1350
1246
|
});
|
|
1351
|
-
var UpdateSubscriptionRequestSchema =
|
|
1247
|
+
var UpdateSubscriptionRequestSchema = z3.object({
|
|
1352
1248
|
name: name.optional(),
|
|
1353
1249
|
url: webhookUrl.optional(),
|
|
1354
1250
|
filter: SubscriptionFilterSchema.optional(),
|
|
1355
1251
|
format: SubscriptionFormatSchema.optional(),
|
|
1356
1252
|
runtime: SubscriptionRuntimeSchema.nullable().optional(),
|
|
1357
|
-
authConfig:
|
|
1358
|
-
maxRetries:
|
|
1359
|
-
timeoutMs:
|
|
1360
|
-
concurrency:
|
|
1253
|
+
authConfig: z3.record(z3.string(), z3.unknown()).optional(),
|
|
1254
|
+
maxRetries: z3.number().int().min(0).max(100).optional(),
|
|
1255
|
+
timeoutMs: z3.number().int().min(100).max(300000).optional(),
|
|
1256
|
+
concurrency: z3.number().int().min(1).max(100).optional()
|
|
1361
1257
|
}).refine((value) => Object.keys(value).length > 0, {
|
|
1362
1258
|
message: "At least one field must be provided"
|
|
1363
1259
|
});
|
|
1364
|
-
var ReplaySubscriptionRequestSchema =
|
|
1365
|
-
fromBlock:
|
|
1366
|
-
toBlock:
|
|
1367
|
-
force:
|
|
1260
|
+
var ReplaySubscriptionRequestSchema = z3.object({
|
|
1261
|
+
fromBlock: z3.number().int().nonnegative(),
|
|
1262
|
+
toBlock: z3.number().int().nonnegative(),
|
|
1263
|
+
force: z3.string().trim().min(1).max(64).optional()
|
|
1368
1264
|
}).refine((value) => value.fromBlock <= value.toBlock, {
|
|
1369
1265
|
message: "fromBlock must be less than or equal to toBlock",
|
|
1370
1266
|
path: ["toBlock"]
|
|
@@ -1992,19 +1888,10 @@ function verifyEd25519(payload, signatureBase64, publicKey) {
|
|
|
1992
1888
|
}
|
|
1993
1889
|
}
|
|
1994
1890
|
// src/event-types.ts
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
"stx_lock",
|
|
2000
|
-
"ft_transfer",
|
|
2001
|
-
"ft_mint",
|
|
2002
|
-
"ft_burn",
|
|
2003
|
-
"nft_transfer",
|
|
2004
|
-
"nft_mint",
|
|
2005
|
-
"nft_burn",
|
|
2006
|
-
"print"
|
|
2007
|
-
];
|
|
1891
|
+
import { DECODED_EVENT_TYPES } from "@secondlayer/stacks/filters";
|
|
1892
|
+
import {
|
|
1893
|
+
DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2
|
|
1894
|
+
} from "@secondlayer/stacks/filters";
|
|
2008
1895
|
var STREAMS_EVENT_TYPES = DECODED_EVENT_TYPES;
|
|
2009
1896
|
// src/db-event-types.ts
|
|
2010
1897
|
var STREAMS_DB_EVENT_TYPES = [
|
|
@@ -2122,10 +2009,6 @@ export {
|
|
|
2122
2009
|
SubscriptionFilterPrimitiveSchema,
|
|
2123
2010
|
SubscriptionFilterOperatorSchema,
|
|
2124
2011
|
SubscriptionFilterClauseSchema,
|
|
2125
|
-
StxTransferFilterSchema,
|
|
2126
|
-
StxMintFilterSchema,
|
|
2127
|
-
StxLockFilterSchema,
|
|
2128
|
-
StxBurnFilterSchema,
|
|
2129
2012
|
SecondLayerError,
|
|
2130
2013
|
SUBSCRIPTION_STATUSES,
|
|
2131
2014
|
SUBSCRIPTION_RUNTIMES,
|
|
@@ -2139,28 +2022,18 @@ export {
|
|
|
2139
2022
|
SOURCE_READ_COLUMNS,
|
|
2140
2023
|
ReplaySubscriptionRequestSchema,
|
|
2141
2024
|
RateLimitError,
|
|
2142
|
-
PrintEventFilterSchema,
|
|
2143
2025
|
PaymentRequiredError,
|
|
2144
2026
|
NotFoundError,
|
|
2145
|
-
NftTransferFilterSchema,
|
|
2146
|
-
NftMintFilterSchema,
|
|
2147
|
-
NftBurnFilterSchema,
|
|
2148
2027
|
KeyRotatedError,
|
|
2149
|
-
FtTransferFilterSchema,
|
|
2150
|
-
FtMintFilterSchema,
|
|
2151
|
-
FtBurnFilterSchema,
|
|
2152
2028
|
ForbiddenError,
|
|
2153
|
-
EventFilterSchema,
|
|
2154
2029
|
ErrorCodes,
|
|
2155
2030
|
EMPTY_RANGE_EVENT_INDEX_SENTINEL,
|
|
2156
2031
|
DeploySubgraphRequestSchema,
|
|
2157
2032
|
DatabaseError,
|
|
2158
2033
|
DEFAULT_BTC_CONFIRMATIONS,
|
|
2159
|
-
DECODED_EVENT_TYPES,
|
|
2034
|
+
DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES,
|
|
2160
2035
|
DB_TO_STREAMS_EVENT_TYPE,
|
|
2161
2036
|
CreateSubscriptionRequestSchema,
|
|
2162
|
-
ContractDeployFilterSchema,
|
|
2163
|
-
ContractCallFilterSchema,
|
|
2164
2037
|
CODE_TO_STATUS,
|
|
2165
2038
|
CHAIN_TRIGGER_TYPES,
|
|
2166
2039
|
CHAIN_TRIGGER_FIELDS,
|
|
@@ -2168,5 +2041,5 @@ export {
|
|
|
2168
2041
|
AuthenticationError
|
|
2169
2042
|
};
|
|
2170
2043
|
|
|
2171
|
-
//# debugId=
|
|
2044
|
+
//# debugId=AC8B47A9AE2433B764756E2164756E21
|
|
2172
2045
|
//# sourceMappingURL=index.js.map
|