@crediolabs/policy-synth 0.1.18 → 0.2.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/README.md +3 -2
- package/dist/install/authority-overlap.d.ts +134 -0
- package/dist/install/authority-overlap.js +0 -0
- package/dist/install/build-add-context-rule.d.ts +8 -0
- package/dist/install/build-add-context-rule.js +1 -1
- package/dist/install/build-merge-policy.d.ts +70 -0
- package/dist/install/build-merge-policy.js +130 -0
- package/dist/install/index.d.ts +2 -0
- package/dist/install/index.js +7 -0
- package/dist/install/plan-merge-policy.d.ts +49 -0
- package/dist/install/plan-merge-policy.js +86 -0
- package/dist/install/read-account-rules.d.ts +100 -0
- package/dist/install/read-account-rules.js +283 -0
- package/dist/run/index.d.ts +93 -8
- package/dist/run/index.js +282 -11
- package/dist/run/schemas.d.ts +290 -11
- package/dist/run/schemas.js +77 -11
- package/dist-cjs/install/authority-overlap.d.ts +134 -0
- package/dist-cjs/install/authority-overlap.js +0 -0
- package/dist-cjs/install/build-add-context-rule.d.ts +8 -0
- package/dist-cjs/install/build-add-context-rule.js +1 -0
- package/dist-cjs/install/build-merge-policy.d.ts +70 -0
- package/dist-cjs/install/build-merge-policy.js +134 -0
- package/dist-cjs/install/index.d.ts +2 -0
- package/dist-cjs/install/index.js +23 -2
- package/dist-cjs/install/plan-merge-policy.d.ts +49 -0
- package/dist-cjs/install/plan-merge-policy.js +90 -0
- package/dist-cjs/install/read-account-rules.d.ts +100 -0
- package/dist-cjs/install/read-account-rules.js +296 -0
- package/dist-cjs/run/index.d.ts +93 -8
- package/dist-cjs/run/index.js +283 -10
- package/dist-cjs/run/schemas.d.ts +290 -11
- package/dist-cjs/run/schemas.js +78 -12
- package/package.json +1 -1
- package/src/install/authority-overlap.ts +0 -0
- package/src/install/build-add-context-rule.ts +12 -1
- package/src/install/build-merge-policy.ts +219 -0
- package/src/install/index.ts +34 -0
- package/src/install/plan-merge-policy.ts +133 -0
- package/src/install/read-account-rules.ts +376 -0
- package/src/run/index.ts +386 -14
- package/src/run/schemas.ts +84 -11
|
@@ -505,18 +505,66 @@ export declare const ComposeUserResponsesSchema: z.ZodObject<{
|
|
|
505
505
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
506
506
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
507
507
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
508
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
509
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
510
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
511
|
+
value: z.ZodString;
|
|
512
|
+
decimals: z.ZodNumber;
|
|
513
|
+
}, "strip", z.ZodTypeAny, {
|
|
514
|
+
value: string;
|
|
515
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
516
|
+
asset: string;
|
|
517
|
+
decimals: number;
|
|
518
|
+
}, {
|
|
519
|
+
value: string;
|
|
520
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
521
|
+
asset: string;
|
|
522
|
+
decimals: number;
|
|
523
|
+
}>, "many">>;
|
|
508
524
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
509
525
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
510
526
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
511
527
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
512
528
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
513
529
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
530
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
531
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
532
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
533
|
+
value: z.ZodString;
|
|
534
|
+
decimals: z.ZodNumber;
|
|
535
|
+
}, "strip", z.ZodTypeAny, {
|
|
536
|
+
value: string;
|
|
537
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
538
|
+
asset: string;
|
|
539
|
+
decimals: number;
|
|
540
|
+
}, {
|
|
541
|
+
value: string;
|
|
542
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
543
|
+
asset: string;
|
|
544
|
+
decimals: number;
|
|
545
|
+
}>, "many">>;
|
|
514
546
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
515
547
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
516
548
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
517
549
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
518
550
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
519
551
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
552
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
553
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
554
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
555
|
+
value: z.ZodString;
|
|
556
|
+
decimals: z.ZodNumber;
|
|
557
|
+
}, "strip", z.ZodTypeAny, {
|
|
558
|
+
value: string;
|
|
559
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
560
|
+
asset: string;
|
|
561
|
+
decimals: number;
|
|
562
|
+
}, {
|
|
563
|
+
value: string;
|
|
564
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
565
|
+
asset: string;
|
|
566
|
+
decimals: number;
|
|
567
|
+
}>, "many">>;
|
|
520
568
|
}, z.ZodTypeAny, "passthrough">>;
|
|
521
569
|
/** OzAdapterConfig - the per-network OZ built-in instance addresses. */
|
|
522
570
|
export declare const OzAdapterConfigSchema: z.ZodObject<{
|
|
@@ -1126,18 +1174,66 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
|
|
|
1126
1174
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1127
1175
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1128
1176
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1177
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1178
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1179
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1180
|
+
value: z.ZodString;
|
|
1181
|
+
decimals: z.ZodNumber;
|
|
1182
|
+
}, "strip", z.ZodTypeAny, {
|
|
1183
|
+
value: string;
|
|
1184
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1185
|
+
asset: string;
|
|
1186
|
+
decimals: number;
|
|
1187
|
+
}, {
|
|
1188
|
+
value: string;
|
|
1189
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1190
|
+
asset: string;
|
|
1191
|
+
decimals: number;
|
|
1192
|
+
}>, "many">>;
|
|
1129
1193
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1130
1194
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1131
1195
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
1132
1196
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1133
1197
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1134
1198
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1199
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1200
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1201
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1202
|
+
value: z.ZodString;
|
|
1203
|
+
decimals: z.ZodNumber;
|
|
1204
|
+
}, "strip", z.ZodTypeAny, {
|
|
1205
|
+
value: string;
|
|
1206
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1207
|
+
asset: string;
|
|
1208
|
+
decimals: number;
|
|
1209
|
+
}, {
|
|
1210
|
+
value: string;
|
|
1211
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1212
|
+
asset: string;
|
|
1213
|
+
decimals: number;
|
|
1214
|
+
}>, "many">>;
|
|
1135
1215
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1136
1216
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1137
1217
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
1138
1218
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1139
1219
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1140
1220
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1221
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1222
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1223
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1224
|
+
value: z.ZodString;
|
|
1225
|
+
decimals: z.ZodNumber;
|
|
1226
|
+
}, "strip", z.ZodTypeAny, {
|
|
1227
|
+
value: string;
|
|
1228
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1229
|
+
asset: string;
|
|
1230
|
+
decimals: number;
|
|
1231
|
+
}, {
|
|
1232
|
+
value: string;
|
|
1233
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1234
|
+
asset: string;
|
|
1235
|
+
decimals: number;
|
|
1236
|
+
}>, "many">>;
|
|
1141
1237
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1142
1238
|
confidenceOverride: z.ZodOptional<z.ZodObject<{
|
|
1143
1239
|
threshold: z.ZodNumber;
|
|
@@ -1257,6 +1353,22 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
|
|
|
1257
1353
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1258
1354
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1259
1355
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1356
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1357
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1358
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1359
|
+
value: z.ZodString;
|
|
1360
|
+
decimals: z.ZodNumber;
|
|
1361
|
+
}, "strip", z.ZodTypeAny, {
|
|
1362
|
+
value: string;
|
|
1363
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1364
|
+
asset: string;
|
|
1365
|
+
decimals: number;
|
|
1366
|
+
}, {
|
|
1367
|
+
value: string;
|
|
1368
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1369
|
+
asset: string;
|
|
1370
|
+
decimals: number;
|
|
1371
|
+
}>, "many">>;
|
|
1260
1372
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1261
1373
|
confidenceOverride?: {
|
|
1262
1374
|
threshold: number;
|
|
@@ -1322,6 +1434,22 @@ export declare const SynthesizePolicyRecordingInputSchema: z.ZodObject<{
|
|
|
1322
1434
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1323
1435
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1324
1436
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1437
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1438
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1439
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1440
|
+
value: z.ZodString;
|
|
1441
|
+
decimals: z.ZodNumber;
|
|
1442
|
+
}, "strip", z.ZodTypeAny, {
|
|
1443
|
+
value: string;
|
|
1444
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1445
|
+
asset: string;
|
|
1446
|
+
decimals: number;
|
|
1447
|
+
}, {
|
|
1448
|
+
value: string;
|
|
1449
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1450
|
+
asset: string;
|
|
1451
|
+
decimals: number;
|
|
1452
|
+
}>, "many">>;
|
|
1325
1453
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1326
1454
|
confidenceOverride?: {
|
|
1327
1455
|
threshold: number;
|
|
@@ -1841,18 +1969,66 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
|
|
|
1841
1969
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1842
1970
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1843
1971
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1972
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1973
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1974
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1975
|
+
value: z.ZodString;
|
|
1976
|
+
decimals: z.ZodNumber;
|
|
1977
|
+
}, "strip", z.ZodTypeAny, {
|
|
1978
|
+
value: string;
|
|
1979
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1980
|
+
asset: string;
|
|
1981
|
+
decimals: number;
|
|
1982
|
+
}, {
|
|
1983
|
+
value: string;
|
|
1984
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
1985
|
+
asset: string;
|
|
1986
|
+
decimals: number;
|
|
1987
|
+
}>, "many">>;
|
|
1844
1988
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1845
1989
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1846
1990
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
1847
1991
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1848
1992
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1849
1993
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1994
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1995
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
1996
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
1997
|
+
value: z.ZodString;
|
|
1998
|
+
decimals: z.ZodNumber;
|
|
1999
|
+
}, "strip", z.ZodTypeAny, {
|
|
2000
|
+
value: string;
|
|
2001
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2002
|
+
asset: string;
|
|
2003
|
+
decimals: number;
|
|
2004
|
+
}, {
|
|
2005
|
+
value: string;
|
|
2006
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2007
|
+
asset: string;
|
|
2008
|
+
decimals: number;
|
|
2009
|
+
}>, "many">>;
|
|
1850
2010
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1851
2011
|
windowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1852
2012
|
validUntilLedger: z.ZodOptional<z.ZodNumber>;
|
|
1853
2013
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1854
2014
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1855
2015
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
2016
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2017
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
2018
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
2019
|
+
value: z.ZodString;
|
|
2020
|
+
decimals: z.ZodNumber;
|
|
2021
|
+
}, "strip", z.ZodTypeAny, {
|
|
2022
|
+
value: string;
|
|
2023
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2024
|
+
asset: string;
|
|
2025
|
+
decimals: number;
|
|
2026
|
+
}, {
|
|
2027
|
+
value: string;
|
|
2028
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2029
|
+
asset: string;
|
|
2030
|
+
decimals: number;
|
|
2031
|
+
}>, "many">>;
|
|
1856
2032
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1857
2033
|
confidenceOverride: z.ZodOptional<z.ZodObject<{
|
|
1858
2034
|
threshold: z.ZodNumber;
|
|
@@ -1972,6 +2148,22 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
|
|
|
1972
2148
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
1973
2149
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
1974
2150
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
2151
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2152
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
2153
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
2154
|
+
value: z.ZodString;
|
|
2155
|
+
decimals: z.ZodNumber;
|
|
2156
|
+
}, "strip", z.ZodTypeAny, {
|
|
2157
|
+
value: string;
|
|
2158
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2159
|
+
asset: string;
|
|
2160
|
+
decimals: number;
|
|
2161
|
+
}, {
|
|
2162
|
+
value: string;
|
|
2163
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2164
|
+
asset: string;
|
|
2165
|
+
decimals: number;
|
|
2166
|
+
}>, "many">>;
|
|
1975
2167
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1976
2168
|
confidenceOverride?: {
|
|
1977
2169
|
threshold: number;
|
|
@@ -2037,6 +2229,22 @@ export declare const SynthesizePolicyInputSchema: z.ZodDiscriminatedUnion<"sourc
|
|
|
2037
2229
|
limitAmount: z.ZodOptional<z.ZodString>;
|
|
2038
2230
|
invocationLimit: z.ZodOptional<z.ZodNumber>;
|
|
2039
2231
|
swapRecipientAllowlist: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
2232
|
+
oraclePriceBound: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2233
|
+
asset: z.ZodEffects<z.ZodString, string, string>;
|
|
2234
|
+
operator: z.ZodEnum<["eq", "lt", "lte", "gt", "gte"]>;
|
|
2235
|
+
value: z.ZodString;
|
|
2236
|
+
decimals: z.ZodNumber;
|
|
2237
|
+
}, "strip", z.ZodTypeAny, {
|
|
2238
|
+
value: string;
|
|
2239
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2240
|
+
asset: string;
|
|
2241
|
+
decimals: number;
|
|
2242
|
+
}, {
|
|
2243
|
+
value: string;
|
|
2244
|
+
operator: "eq" | "lt" | "lte" | "gt" | "gte";
|
|
2245
|
+
asset: string;
|
|
2246
|
+
decimals: number;
|
|
2247
|
+
}>, "many">>;
|
|
2040
2248
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
2041
2249
|
confidenceOverride?: {
|
|
2042
2250
|
threshold: number;
|
|
@@ -2817,15 +3025,24 @@ export declare const VerifyPolicyInputSchema: z.ZodObject<{
|
|
|
2817
3025
|
export type VerifyPolicyInput = z.infer<typeof VerifyPolicyInputSchema>;
|
|
2818
3026
|
/** Pinned interpreter address (testnet).
|
|
2819
3027
|
* Single source for the MCP layer; do not embed elsewhere. */
|
|
2820
|
-
export declare const PINNED_INTERPRETER_TESTNET_ADDRESS = "
|
|
2821
|
-
/** Pinned interpreter address (mainnet).
|
|
2822
|
-
*
|
|
2823
|
-
* that was exercised on testnet (same wasm sha256, see
|
|
2824
|
-
* PINNED_INTERPRETER_WASM_SHA256). The address differs because instance
|
|
2825
|
-
* ids are network-scoped. UNAUDITED at the time of writing. */
|
|
3028
|
+
export declare const PINNED_INTERPRETER_TESTNET_ADDRESS = "CALHNU4LXZRKFAXYRBODTGDANTNXHJPBTJNYGLUWLIFIP24NWSGWIE4K";
|
|
3029
|
+
/** Pinned interpreter address (mainnet), deployed 2026-08-04.
|
|
3030
|
+
* UNAUDITED at the time of writing. */
|
|
2826
3031
|
export declare const PINNED_INTERPRETER_MAINNET_ADDRESS = "CALZAMUPREIRY4TULBEXIK77AUTOEJG63XLCPUWEHHQDOVK6ZVVS7VQ2";
|
|
2827
|
-
/** Pinned interpreter wasm sha256 (hex).
|
|
3032
|
+
/** Pinned interpreter wasm sha256 (hex), mainnet.
|
|
3033
|
+
*
|
|
3034
|
+
* The two networks no longer run the same binary. Testnet carries the
|
|
3035
|
+
* selector-leaf minimum and the signer-set cap; mainnet predates both. Read
|
|
3036
|
+
* the hash through `PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK` rather than
|
|
3037
|
+
* this constant unless mainnet is specifically what is meant, or
|
|
3038
|
+
* `get_interpreter_info` will report a hash the queried network does not
|
|
3039
|
+
* run. */
|
|
2828
3040
|
export declare const PINNED_INTERPRETER_WASM_SHA256 = "6e6c13d93e197aa380303a42cd120f5ddb080dd36ef2a343ee1dbd04ca52a443";
|
|
3041
|
+
/** Pinned interpreter wasm sha256 (hex), testnet. Byte-identical to the
|
|
3042
|
+
* artifact built from `contracts/policy-interpreter` at the commit that
|
|
3043
|
+
* introduced errors 216 and 217, verified by fetching the deployed wasm back
|
|
3044
|
+
* off chain. */
|
|
3045
|
+
export declare const PINNED_INTERPRETER_WASM_SHA256_TESTNET = "a4d58bc88fd82bbb8e223941ba5889db919717fae92ced13f6f55bfe583b8e22";
|
|
2829
3046
|
/** The grammar version the interpreter enforces (matches SELF_VERSION in
|
|
2830
3047
|
* contracts/policy-interpreter/src/version.rs). */
|
|
2831
3048
|
export declare const PINNED_INTERPRETER_GRAMMAR_VERSION = 1;
|
|
@@ -2839,11 +3056,12 @@ export declare const TESTNET_RPC_URL = "https://soroban-testnet.stellar.org";
|
|
|
2839
3056
|
* RPC rather than always testnet. Public mainnet endpoint, the same one
|
|
2840
3057
|
* the deploy script hit during the 2026-08-04 mainnet rollout. */
|
|
2841
3058
|
export declare const MAINNET_RPC_URL = "https://mainnet.sorobanrpc.com";
|
|
2842
|
-
/** Pin + RPC lookup for the gate enforcement.
|
|
2843
|
-
*
|
|
2844
|
-
*
|
|
2845
|
-
*
|
|
3059
|
+
/** Pin + RPC lookup for the gate enforcement. Addresses, RPCs and wasm
|
|
3060
|
+
* hashes are all network-scoped: the networks diverged when the
|
|
3061
|
+
* selector-leaf and signer-cap controls were deployed to testnet ahead of
|
|
3062
|
+
* mainnet. */
|
|
2846
3063
|
export declare const PINNED_INTERPRETER_ADDRESS_BY_NETWORK: Record<Network, string>;
|
|
3064
|
+
export declare const PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK: Record<Network, string>;
|
|
2847
3065
|
export declare const RPC_URL_BY_NETWORK: Record<Network, string>;
|
|
2848
3066
|
/** Soroban `valid_until` window (ledgers) added to the latest ledger when
|
|
2849
3067
|
* building the auth entry. ~25 minutes at 5s/ledger. */
|
|
@@ -3337,6 +3555,17 @@ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3337
3555
|
* everything. Selecting `network: 'mainnet'` is NOT an opt-in -
|
|
3338
3556
|
* the mainnet pin is its own deny-by-default anchor. */
|
|
3339
3557
|
allowUnpinnedInterpreter: z.ZodOptional<z.ZodBoolean>;
|
|
3558
|
+
/** Opt-in to installing when a signer of this rule can already reach the
|
|
3559
|
+
* same calls through a context rule that has NO policy attached. OZ lets
|
|
3560
|
+
* the signer choose which rule authorises a call and enforces only that
|
|
3561
|
+
* rule's policies, so an unpoliced rule covering the same calls makes
|
|
3562
|
+
* this policy decorative. Default-deny, because the caller almost
|
|
3563
|
+
* certainly believes they are restricting something. */
|
|
3564
|
+
allowAuthorityOverlap: z.ZodOptional<z.ZodBoolean>;
|
|
3565
|
+
/** Skip the cross-rule authority scan entirely. The scan costs one RPC
|
|
3566
|
+
* read per rule on the account; skipping it means the response carries
|
|
3567
|
+
* no statement about what the signers can already do. */
|
|
3568
|
+
skipAuthorityScan: z.ZodOptional<z.ZodBoolean>;
|
|
3340
3569
|
/** Base fee in stroops; defaults to BASE_FEE (100). */
|
|
3341
3570
|
baseFee: z.ZodOptional<z.ZodNumber>;
|
|
3342
3571
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -3382,6 +3611,8 @@ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3382
3611
|
rpcUrl?: string | undefined;
|
|
3383
3612
|
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3384
3613
|
allowUnpinnedInterpreter?: boolean | undefined;
|
|
3614
|
+
allowAuthorityOverlap?: boolean | undefined;
|
|
3615
|
+
skipAuthorityScan?: boolean | undefined;
|
|
3385
3616
|
baseFee?: number | undefined;
|
|
3386
3617
|
}, {
|
|
3387
3618
|
installNonce: number;
|
|
@@ -3426,6 +3657,8 @@ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3426
3657
|
rpcUrl?: string | undefined;
|
|
3427
3658
|
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3428
3659
|
allowUnpinnedInterpreter?: boolean | undefined;
|
|
3660
|
+
allowAuthorityOverlap?: boolean | undefined;
|
|
3661
|
+
skipAuthorityScan?: boolean | undefined;
|
|
3429
3662
|
baseFee?: number | undefined;
|
|
3430
3663
|
}>, {
|
|
3431
3664
|
installNonce: number;
|
|
@@ -3470,6 +3703,8 @@ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3470
3703
|
rpcUrl?: string | undefined;
|
|
3471
3704
|
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3472
3705
|
allowUnpinnedInterpreter?: boolean | undefined;
|
|
3706
|
+
allowAuthorityOverlap?: boolean | undefined;
|
|
3707
|
+
skipAuthorityScan?: boolean | undefined;
|
|
3473
3708
|
baseFee?: number | undefined;
|
|
3474
3709
|
}, {
|
|
3475
3710
|
installNonce: number;
|
|
@@ -3514,9 +3749,53 @@ export declare const InstallPolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3514
3749
|
rpcUrl?: string | undefined;
|
|
3515
3750
|
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3516
3751
|
allowUnpinnedInterpreter?: boolean | undefined;
|
|
3752
|
+
allowAuthorityOverlap?: boolean | undefined;
|
|
3753
|
+
skipAuthorityScan?: boolean | undefined;
|
|
3517
3754
|
baseFee?: number | undefined;
|
|
3518
3755
|
}>;
|
|
3519
3756
|
export type InstallPolicyInput = z.infer<typeof InstallPolicyInputSchema>;
|
|
3757
|
+
/** `merge_policy` input.
|
|
3758
|
+
*
|
|
3759
|
+
* The tightening remedy for a cross-rule overlap: replace a rule's predicate
|
|
3760
|
+
* with the conjunction of it and a new one. Two transactions, in order,
|
|
3761
|
+
* because OZ refuses to re-attach a policy already on the rule - so the
|
|
3762
|
+
* caller runs `detach`, waits for it to confirm, then runs `reinstall`. */
|
|
3763
|
+
export declare const MergePolicyInputSchema: z.ZodObject<{
|
|
3764
|
+
smartAccount: z.ZodString;
|
|
3765
|
+
sourceAccount: z.ZodString;
|
|
3766
|
+
/** The rule whose predicate is being tightened. */
|
|
3767
|
+
ruleId: z.ZodNumber;
|
|
3768
|
+
/** The predicate to conjoin, base64 canonical ScVal, as emitted by
|
|
3769
|
+
* `synthesize_policy`. */
|
|
3770
|
+
incomingPredicateBlobBase64: z.ZodString;
|
|
3771
|
+
/** Which half of the remedy to build. */
|
|
3772
|
+
step: z.ZodEnum<["detach", "reinstall"]>;
|
|
3773
|
+
network: z.ZodOptional<z.ZodEnum<["mainnet", "testnet"]>>;
|
|
3774
|
+
rpcUrl: z.ZodOptional<z.ZodString>;
|
|
3775
|
+
allowUnpinnedRpcUrl: z.ZodOptional<z.ZodBoolean>;
|
|
3776
|
+
baseFee: z.ZodOptional<z.ZodNumber>;
|
|
3777
|
+
}, "strict", z.ZodTypeAny, {
|
|
3778
|
+
smartAccount: string;
|
|
3779
|
+
sourceAccount: string;
|
|
3780
|
+
step: "detach" | "reinstall";
|
|
3781
|
+
ruleId: number;
|
|
3782
|
+
incomingPredicateBlobBase64: string;
|
|
3783
|
+
network?: "mainnet" | "testnet" | undefined;
|
|
3784
|
+
rpcUrl?: string | undefined;
|
|
3785
|
+
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3786
|
+
baseFee?: number | undefined;
|
|
3787
|
+
}, {
|
|
3788
|
+
smartAccount: string;
|
|
3789
|
+
sourceAccount: string;
|
|
3790
|
+
step: "detach" | "reinstall";
|
|
3791
|
+
ruleId: number;
|
|
3792
|
+
incomingPredicateBlobBase64: string;
|
|
3793
|
+
network?: "mainnet" | "testnet" | undefined;
|
|
3794
|
+
rpcUrl?: string | undefined;
|
|
3795
|
+
allowUnpinnedRpcUrl?: boolean | undefined;
|
|
3796
|
+
baseFee?: number | undefined;
|
|
3797
|
+
}>;
|
|
3798
|
+
export type MergePolicyInput = z.infer<typeof MergePolicyInputSchema>;
|
|
3520
3799
|
export declare const RevokePolicyInputSchema: z.ZodEffects<z.ZodObject<{
|
|
3521
3800
|
/** The smart account contract address (C...). */
|
|
3522
3801
|
smartAccount: z.ZodString;
|
package/dist-cjs/run/schemas.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// imports them here so its tool-shape bindings stay in step; the CLI imports
|
|
17
17
|
// them here so it can build the same args envelope the MCP transport builds.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ToolErrorSchema = exports.GetInterpreterInfoInputSchema = exports.RevokePolicyInputSchema = exports.InstallPolicyInputSchema = exports.NETWORK_PASSPHRASES = exports.DEFAULT_AUTH_VALID_UNTIL_LEDGERS = exports.RPC_URL_BY_NETWORK = exports.PINNED_INTERPRETER_ADDRESS_BY_NETWORK = exports.MAINNET_RPC_URL = exports.TESTNET_RPC_URL = exports.PINNED_INTERPRETER_GRAMMAR_VERSION = exports.PINNED_INTERPRETER_WASM_SHA256 = exports.PINNED_INTERPRETER_MAINNET_ADDRESS = exports.PINNED_INTERPRETER_TESTNET_ADDRESS = exports.VerifyPolicyInputSchema = exports.SimulatePolicyInputSchema = exports.OraclePriceFixtureSchema = exports.PredicateNodeSchema = exports.PredicateLeafSchema = exports.SynthesizePolicyInputSchema = exports.SynthesizePolicyRecordingInputSchema = exports.InterpreterOptionsSchema = exports.SynthesizePolicyMandateInputSchema = exports.RecordTransactionInputSchema = exports.OzAdapterConfigSchema = exports.ComposeUserResponsesSchema = exports.MandateSpecSchema = exports.RecordedTransactionSchema = exports.ParseConfidenceSchema = exports.OnChainEventSchema = exports.TokenMovementSchema = exports.ContractInvocationSchema = exports.ScValSchema = exports.NetworkSchema = void 0;
|
|
19
|
+
exports.ToolErrorSchema = exports.GetInterpreterInfoInputSchema = exports.RevokePolicyInputSchema = exports.MergePolicyInputSchema = exports.InstallPolicyInputSchema = exports.NETWORK_PASSPHRASES = exports.DEFAULT_AUTH_VALID_UNTIL_LEDGERS = exports.RPC_URL_BY_NETWORK = exports.PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK = exports.PINNED_INTERPRETER_ADDRESS_BY_NETWORK = exports.MAINNET_RPC_URL = exports.TESTNET_RPC_URL = exports.PINNED_INTERPRETER_GRAMMAR_VERSION = exports.PINNED_INTERPRETER_WASM_SHA256_TESTNET = exports.PINNED_INTERPRETER_WASM_SHA256 = exports.PINNED_INTERPRETER_MAINNET_ADDRESS = exports.PINNED_INTERPRETER_TESTNET_ADDRESS = exports.VerifyPolicyInputSchema = exports.SimulatePolicyInputSchema = exports.OraclePriceFixtureSchema = exports.PredicateNodeSchema = exports.PredicateLeafSchema = exports.SynthesizePolicyInputSchema = exports.SynthesizePolicyRecordingInputSchema = exports.InterpreterOptionsSchema = exports.SynthesizePolicyMandateInputSchema = exports.RecordTransactionInputSchema = exports.OzAdapterConfigSchema = exports.ComposeUserResponsesSchema = exports.MandateSpecSchema = exports.RecordedTransactionSchema = exports.ParseConfidenceSchema = exports.OnChainEventSchema = exports.TokenMovementSchema = exports.ContractInvocationSchema = exports.ScValSchema = exports.NetworkSchema = void 0;
|
|
20
20
|
const zod_1 = require("zod");
|
|
21
21
|
const address_ts_1 = require("../synth/address.js");
|
|
22
22
|
/** Soroban `valid_until` is a u32 ledger sequence; a value above this cannot be
|
|
@@ -158,6 +158,21 @@ exports.ComposeUserResponsesSchema = zod_1.z
|
|
|
158
158
|
swapRecipientAllowlist: zod_1.z
|
|
159
159
|
.array(zod_1.z.string().refine(address_ts_1.isStellarAddress, 'must be a Stellar address (G... or C...)'))
|
|
160
160
|
.optional(),
|
|
161
|
+
// Per-asset oracle-price bound, one entry per asset. Reaches
|
|
162
|
+
// `compose-from-recording` and emits an `oracle_price` compare. Declared
|
|
163
|
+
// here because the object is `.passthrough()`: the field already worked
|
|
164
|
+
// undeclared, which left the accepted surface wider than the documented
|
|
165
|
+
// one. `decimals` is REQUIRED - oracle prices normalise to 9 dp and a
|
|
166
|
+
// threshold silently assumed to share that basis is what let a raw 14-dp
|
|
167
|
+
// bound permit everything.
|
|
168
|
+
oraclePriceBound: zod_1.z
|
|
169
|
+
.array(zod_1.z.object({
|
|
170
|
+
asset: zod_1.z.string().refine(address_ts_1.isStellarAddress, 'must be a Stellar address (G... or C...)'),
|
|
171
|
+
operator: zod_1.z.enum(['eq', 'lt', 'lte', 'gt', 'gte']),
|
|
172
|
+
value: zod_1.z.string().regex(/^[0-9]+$/),
|
|
173
|
+
decimals: zod_1.z.number().int().min(0).max(U32_MAX),
|
|
174
|
+
}))
|
|
175
|
+
.optional(),
|
|
161
176
|
})
|
|
162
177
|
.passthrough();
|
|
163
178
|
/** OzAdapterConfig - the per-network OZ built-in instance addresses. */
|
|
@@ -448,15 +463,24 @@ const MandateSpecSchemaForRule = zod_1.z
|
|
|
448
463
|
// existing four.
|
|
449
464
|
/** Pinned interpreter address (testnet).
|
|
450
465
|
* Single source for the MCP layer; do not embed elsewhere. */
|
|
451
|
-
exports.PINNED_INTERPRETER_TESTNET_ADDRESS = '
|
|
452
|
-
/** Pinned interpreter address (mainnet).
|
|
453
|
-
*
|
|
454
|
-
* that was exercised on testnet (same wasm sha256, see
|
|
455
|
-
* PINNED_INTERPRETER_WASM_SHA256). The address differs because instance
|
|
456
|
-
* ids are network-scoped. UNAUDITED at the time of writing. */
|
|
466
|
+
exports.PINNED_INTERPRETER_TESTNET_ADDRESS = 'CALHNU4LXZRKFAXYRBODTGDANTNXHJPBTJNYGLUWLIFIP24NWSGWIE4K';
|
|
467
|
+
/** Pinned interpreter address (mainnet), deployed 2026-08-04.
|
|
468
|
+
* UNAUDITED at the time of writing. */
|
|
457
469
|
exports.PINNED_INTERPRETER_MAINNET_ADDRESS = 'CALZAMUPREIRY4TULBEXIK77AUTOEJG63XLCPUWEHHQDOVK6ZVVS7VQ2';
|
|
458
|
-
/** Pinned interpreter wasm sha256 (hex).
|
|
470
|
+
/** Pinned interpreter wasm sha256 (hex), mainnet.
|
|
471
|
+
*
|
|
472
|
+
* The two networks no longer run the same binary. Testnet carries the
|
|
473
|
+
* selector-leaf minimum and the signer-set cap; mainnet predates both. Read
|
|
474
|
+
* the hash through `PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK` rather than
|
|
475
|
+
* this constant unless mainnet is specifically what is meant, or
|
|
476
|
+
* `get_interpreter_info` will report a hash the queried network does not
|
|
477
|
+
* run. */
|
|
459
478
|
exports.PINNED_INTERPRETER_WASM_SHA256 = '6e6c13d93e197aa380303a42cd120f5ddb080dd36ef2a343ee1dbd04ca52a443';
|
|
479
|
+
/** Pinned interpreter wasm sha256 (hex), testnet. Byte-identical to the
|
|
480
|
+
* artifact built from `contracts/policy-interpreter` at the commit that
|
|
481
|
+
* introduced errors 216 and 217, verified by fetching the deployed wasm back
|
|
482
|
+
* off chain. */
|
|
483
|
+
exports.PINNED_INTERPRETER_WASM_SHA256_TESTNET = 'a4d58bc88fd82bbb8e223941ba5889db919717fae92ced13f6f55bfe583b8e22';
|
|
460
484
|
/** The grammar version the interpreter enforces (matches SELF_VERSION in
|
|
461
485
|
* contracts/policy-interpreter/src/version.rs). */
|
|
462
486
|
exports.PINNED_INTERPRETER_GRAMMAR_VERSION = 1;
|
|
@@ -470,14 +494,18 @@ exports.TESTNET_RPC_URL = 'https://soroban-testnet.stellar.org';
|
|
|
470
494
|
* RPC rather than always testnet. Public mainnet endpoint, the same one
|
|
471
495
|
* the deploy script hit during the 2026-08-04 mainnet rollout. */
|
|
472
496
|
exports.MAINNET_RPC_URL = 'https://mainnet.sorobanrpc.com';
|
|
473
|
-
/** Pin + RPC lookup for the gate enforcement.
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
497
|
+
/** Pin + RPC lookup for the gate enforcement. Addresses, RPCs and wasm
|
|
498
|
+
* hashes are all network-scoped: the networks diverged when the
|
|
499
|
+
* selector-leaf and signer-cap controls were deployed to testnet ahead of
|
|
500
|
+
* mainnet. */
|
|
477
501
|
exports.PINNED_INTERPRETER_ADDRESS_BY_NETWORK = {
|
|
478
502
|
testnet: exports.PINNED_INTERPRETER_TESTNET_ADDRESS,
|
|
479
503
|
mainnet: exports.PINNED_INTERPRETER_MAINNET_ADDRESS,
|
|
480
504
|
};
|
|
505
|
+
exports.PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK = {
|
|
506
|
+
testnet: exports.PINNED_INTERPRETER_WASM_SHA256_TESTNET,
|
|
507
|
+
mainnet: exports.PINNED_INTERPRETER_WASM_SHA256,
|
|
508
|
+
};
|
|
481
509
|
exports.RPC_URL_BY_NETWORK = {
|
|
482
510
|
testnet: exports.TESTNET_RPC_URL,
|
|
483
511
|
mainnet: exports.MAINNET_RPC_URL,
|
|
@@ -541,12 +569,50 @@ exports.InstallPolicyInputSchema = zod_1.z
|
|
|
541
569
|
* everything. Selecting `network: 'mainnet'` is NOT an opt-in -
|
|
542
570
|
* the mainnet pin is its own deny-by-default anchor. */
|
|
543
571
|
allowUnpinnedInterpreter: zod_1.z.boolean().optional(),
|
|
572
|
+
/** Opt-in to installing when a signer of this rule can already reach the
|
|
573
|
+
* same calls through a context rule that has NO policy attached. OZ lets
|
|
574
|
+
* the signer choose which rule authorises a call and enforces only that
|
|
575
|
+
* rule's policies, so an unpoliced rule covering the same calls makes
|
|
576
|
+
* this policy decorative. Default-deny, because the caller almost
|
|
577
|
+
* certainly believes they are restricting something. */
|
|
578
|
+
allowAuthorityOverlap: zod_1.z.boolean().optional(),
|
|
579
|
+
/** Skip the cross-rule authority scan entirely. The scan costs one RPC
|
|
580
|
+
* read per rule on the account; skipping it means the response carries
|
|
581
|
+
* no statement about what the signers can already do. */
|
|
582
|
+
skipAuthorityScan: zod_1.z.boolean().optional(),
|
|
544
583
|
/** Base fee in stroops; defaults to BASE_FEE (100). */
|
|
545
584
|
baseFee: zod_1.z.number().int().positive().optional(),
|
|
546
585
|
})
|
|
547
586
|
.refine((v) => Boolean(v.smartAccount) && Boolean(v.sourceAccount), {
|
|
548
587
|
message: 'smartAccount and sourceAccount are required',
|
|
549
588
|
});
|
|
589
|
+
/** `merge_policy` input.
|
|
590
|
+
*
|
|
591
|
+
* The tightening remedy for a cross-rule overlap: replace a rule's predicate
|
|
592
|
+
* with the conjunction of it and a new one. Two transactions, in order,
|
|
593
|
+
* because OZ refuses to re-attach a policy already on the rule - so the
|
|
594
|
+
* caller runs `detach`, waits for it to confirm, then runs `reinstall`. */
|
|
595
|
+
exports.MergePolicyInputSchema = zod_1.z
|
|
596
|
+
.object({
|
|
597
|
+
smartAccount: zod_1.z
|
|
598
|
+
.string()
|
|
599
|
+
.regex(STELLAR_CONTRACT_ADDRESS, 'smartAccount must be a Stellar contract address (C...)'),
|
|
600
|
+
sourceAccount: zod_1.z
|
|
601
|
+
.string()
|
|
602
|
+
.regex(STELLAR_ACCOUNT_ADDRESS, 'sourceAccount must be a Stellar account address (G...)'),
|
|
603
|
+
/** The rule whose predicate is being tightened. */
|
|
604
|
+
ruleId: zod_1.z.number().int().nonnegative(),
|
|
605
|
+
/** The predicate to conjoin, base64 canonical ScVal, as emitted by
|
|
606
|
+
* `synthesize_policy`. */
|
|
607
|
+
incomingPredicateBlobBase64: zod_1.z.string().min(1),
|
|
608
|
+
/** Which half of the remedy to build. */
|
|
609
|
+
step: zod_1.z.enum(['detach', 'reinstall']),
|
|
610
|
+
network: exports.NetworkSchema.optional(),
|
|
611
|
+
rpcUrl: zod_1.z.string().url().optional(),
|
|
612
|
+
allowUnpinnedRpcUrl: zod_1.z.boolean().optional(),
|
|
613
|
+
baseFee: zod_1.z.number().int().positive().optional(),
|
|
614
|
+
})
|
|
615
|
+
.strict();
|
|
550
616
|
exports.RevokePolicyInputSchema = zod_1.z
|
|
551
617
|
.object({
|
|
552
618
|
/** The smart account contract address (C...). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crediolabs/policy-synth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Off-chain TypeScript synthesis core for the OZ Accounts Policy Builder. Records Soroban transactions, synthesises the minimal policy that permits exactly that flow, verifies it, and returns an unsigned install transaction.",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -318,7 +318,18 @@ function encodeI128(value: string): xdr.ScVal {
|
|
|
318
318
|
)
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
/** The `PolicyInstallParams` ScVal an interpreter policy receives.
|
|
322
|
+
*
|
|
323
|
+
* Exported so the merge remedy can re-install a policy through `add_policy`
|
|
324
|
+
* using the SAME encoder as a fresh install. Re-implementing it would risk
|
|
325
|
+
* exactly the drift this file warns about: the field order is ABI-significant
|
|
326
|
+
* and a differing encoding yields a rule that denies every call. */
|
|
327
|
+
export type PolicyInstallParamArgs = Pick<
|
|
328
|
+
BuildAddContextRuleArgs,
|
|
329
|
+
'encodedPredicate' | 'predicateHash' | 'installNonce' | 'oracleParams' | 'grammarVersion'
|
|
330
|
+
>
|
|
331
|
+
|
|
332
|
+
export function encodePolicyInstallParams(args: PolicyInstallParamArgs): xdr.ScVal {
|
|
322
333
|
const predicate = Buffer.from(args.encodedPredicate, 'base64')
|
|
323
334
|
const computedHash = createHash('sha256').update(predicate).digest('hex')
|
|
324
335
|
if (computedHash !== args.predicateHash) {
|