@bitgo/public-types 6.49.0 → 6.50.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/schema/safe/requests.d.ts +10 -3
- package/dist/src/schema/safe/requests.js +4 -1
- package/dist/src/schema/safe/requests.js.map +1 -1
- package/dist/src/schema/safe/rootKeys.d.ts +2 -2
- package/dist/src/schema/safe/rootKeys.js +1 -1
- package/dist/src/schema/safe/rootKeys.js.map +1 -1
- package/dist/src/schema/safe/safe.d.ts +1 -1
- package/package.json +1 -1
- package/src/schema/safe/requests.ts +12 -4
- package/src/schema/safe/rootKeys.ts +4 -2
|
@@ -3,14 +3,21 @@ export declare const InitializeSafeBody: t.TypeC<{
|
|
|
3
3
|
label: t.StringC;
|
|
4
4
|
}>;
|
|
5
5
|
export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
|
|
6
|
-
export declare const InitializeSafeResponse: t.TypeC<{
|
|
6
|
+
export declare const InitializeSafeResponse: t.IntersectionC<[t.TypeC<{
|
|
7
7
|
id: t.StringC;
|
|
8
8
|
status: t.LiteralC<"initializing">;
|
|
9
|
-
}
|
|
9
|
+
}>, t.PartialC<{
|
|
10
|
+
enabledRootSlots: t.ArrayC<t.KeyofC<{
|
|
11
|
+
secp256k1Multisig: null;
|
|
12
|
+
ecdsaMpc: null;
|
|
13
|
+
eddsaMpc: null;
|
|
14
|
+
ed25519Multisig: null;
|
|
15
|
+
}>>;
|
|
16
|
+
}>]>;
|
|
10
17
|
export type InitializeSafeResponse = t.TypeOf<typeof InitializeSafeResponse>;
|
|
11
18
|
export declare const FinalizeSafeBody: t.TypeC<{
|
|
12
19
|
rootKeys: t.TypeC<{
|
|
13
|
-
hot: t.
|
|
20
|
+
hot: t.PartialC<{
|
|
14
21
|
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
15
22
|
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
16
23
|
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
@@ -28,7 +28,10 @@ const t = __importStar(require("io-ts"));
|
|
|
28
28
|
const io_ts_types_1 = require("io-ts-types");
|
|
29
29
|
const rootKeys_1 = require("./rootKeys");
|
|
30
30
|
exports.InitializeSafeBody = t.type({ label: t.string }, "InitializeSafeBody");
|
|
31
|
-
exports.InitializeSafeResponse = t.
|
|
31
|
+
exports.InitializeSafeResponse = t.intersection([
|
|
32
|
+
t.type({ id: t.string, status: t.literal("initializing") }),
|
|
33
|
+
t.partial({ enabledRootSlots: t.array(rootKeys_1.RootKeyType) }),
|
|
34
|
+
], "InitializeSafeResponse");
|
|
32
35
|
exports.FinalizeSafeBody = t.type({ rootKeys: rootKeys_1.SafeRootKeys }, "FinalizeSafeBody");
|
|
33
36
|
exports.FreezeSafeBody = t.partial({ expires: io_ts_types_1.DateFromISOString, reason: t.string }, "FreezeSafeBody");
|
|
34
37
|
//# sourceMappingURL=requests.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/safe/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/safe/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgD;AAChD,yCAAuD;AAM1C,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CACtC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EACnB,oBAAoB,CACrB,CAAC;AAcW,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAW,CAAC,EAAE,CAAC;CACtD,EACD,wBAAwB,CACzB,CAAC;AAQW,QAAA,gBAAgB,GAAG,CAAC,CAAC,IAAI,CACpC,EAAE,QAAQ,EAAE,uBAAY,EAAE,EAC1B,kBAAkB,CACnB,CAAC;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,OAAO,CACrC,EAAE,OAAO,EAAE,+BAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAChD,gBAAgB,CACjB,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare const RootKeyType: t.KeyofC<{
|
|
|
8
8
|
export type RootKeyType = t.TypeOf<typeof RootKeyType>;
|
|
9
9
|
export declare const RootKeyTriplet: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
10
10
|
export type RootKeyTriplet = t.TypeOf<typeof RootKeyTriplet>;
|
|
11
|
-
export declare const RootKeysByType: t.
|
|
11
|
+
export declare const RootKeysByType: t.PartialC<{
|
|
12
12
|
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
13
13
|
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
14
14
|
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
@@ -22,7 +22,7 @@ export declare const SafeCustodyType: t.KeyofC<{
|
|
|
22
22
|
}>;
|
|
23
23
|
export type SafeCustodyType = t.TypeOf<typeof SafeCustodyType>;
|
|
24
24
|
export declare const SafeRootKeys: t.TypeC<{
|
|
25
|
-
hot: t.
|
|
25
|
+
hot: t.PartialC<{
|
|
26
26
|
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
27
27
|
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
28
28
|
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
@@ -32,7 +32,7 @@ exports.RootKeyType = t.keyof({
|
|
|
32
32
|
ed25519Multisig: null,
|
|
33
33
|
}, "RootKeyType");
|
|
34
34
|
exports.RootKeyTriplet = t.tuple([t.string, t.string, t.string], "RootKeyTriplet");
|
|
35
|
-
exports.RootKeysByType = t.
|
|
35
|
+
exports.RootKeysByType = t.partial({
|
|
36
36
|
secp256k1Multisig: exports.RootKeyTriplet,
|
|
37
37
|
ecdsaMpc: exports.RootKeyTriplet,
|
|
38
38
|
eddsaMpc: exports.RootKeyTriplet,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootKeys.js","sourceRoot":"","sources":["../../../../src/schema/safe/rootKeys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAUd,QAAA,WAAW,GAAG,CAAC,CAAC,KAAK,CAChC;IACE,iBAAiB,EAAE,IAAI;IACvB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,eAAe,EAAE,IAAI;CACtB,EACD,aAAa,CACd,CAAC;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,KAAK,CACnC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAC9B,gBAAgB,CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"rootKeys.js","sourceRoot":"","sources":["../../../../src/schema/safe/rootKeys.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAUd,QAAA,WAAW,GAAG,CAAC,CAAC,KAAK,CAChC;IACE,iBAAiB,EAAE,IAAI;IACvB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,eAAe,EAAE,IAAI;CACtB,EACD,aAAa,CACd,CAAC;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,KAAK,CACnC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAC9B,gBAAgB,CACjB,CAAC;AAUW,QAAA,cAAc,GAAG,CAAC,CAAC,OAAO,CACrC;IACE,iBAAiB,EAAE,sBAAc;IACjC,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,eAAe,EAAE,sBAAc;CAChC,EACD,gBAAgB,CACjB,CAAC;AASW,QAAA,eAAe,GAAG,CAAC,CAAC,KAAK,CACpC;IACE,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;CAChB,EACD,iBAAiB,CAClB,CAAC;AAQW,QAAA,YAAY,GAAG,CAAC,CAAC,IAAI,CAChC;IACE,GAAG,EAAE,sBAAc;CACpB,EACD,cAAc,CACf,CAAC"}
|
|
@@ -80,7 +80,7 @@ export declare const SafeData: t.IntersectionC<[t.TypeC<{
|
|
|
80
80
|
reason: t.StringC;
|
|
81
81
|
}>;
|
|
82
82
|
rootKeys: t.TypeC<{
|
|
83
|
-
hot: t.
|
|
83
|
+
hot: t.PartialC<{
|
|
84
84
|
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
85
85
|
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
86
86
|
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { DateFromISOString } from "io-ts-types";
|
|
3
|
-
import { SafeRootKeys } from "./rootKeys";
|
|
3
|
+
import { RootKeyType, SafeRootKeys } from "./rootKeys";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* POST /enterprise/:eId/safes — Phase 1 carries no key material.
|
|
@@ -15,11 +15,19 @@ export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Response for POST /enterprise/:eId/safes — Phase 1 creates metadata only, so the response
|
|
18
|
-
* carries just the new safe's id and its always-`initializing` status (not a full `SafeData`)
|
|
18
|
+
* carries just the new safe's id and its always-`initializing` status (not a full `SafeData`),
|
|
19
|
+
* optionally with `enabledRootSlots`: the root-key slots the server enabled for this safe
|
|
20
|
+
* (evaluated once at initialize, per-enterprise). When present, the client MUST run key
|
|
21
|
+
* ceremonies for exactly these slots and finalize with exactly these triplets; a slot omitted
|
|
22
|
+
* from the list is gated off for this safe. When ABSENT (older servers that predate the gating
|
|
23
|
+
* feature), the client MUST fall back to generating all four slots — hence the field is optional.
|
|
19
24
|
* @experimental
|
|
20
25
|
*/
|
|
21
|
-
export const InitializeSafeResponse = t.
|
|
22
|
-
|
|
26
|
+
export const InitializeSafeResponse = t.intersection(
|
|
27
|
+
[
|
|
28
|
+
t.type({ id: t.string, status: t.literal("initializing") }),
|
|
29
|
+
t.partial({ enabledRootSlots: t.array(RootKeyType) }),
|
|
30
|
+
],
|
|
23
31
|
"InitializeSafeResponse",
|
|
24
32
|
);
|
|
25
33
|
/** @experimental */
|
|
@@ -32,10 +32,12 @@ export const RootKeyTriplet = t.tuple(
|
|
|
32
32
|
export type RootKeyTriplet = t.TypeOf<typeof RootKeyTriplet>;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
35
|
+
* The root key ids for a single custody model, keyed by (curve, scheme). Each slot is optional:
|
|
36
|
+
* a safe carries only the triplets for the slots that were enabled at creation time (see
|
|
37
|
+
* `InitializeSafeResponse.enabledRootSlots`), so a subset of the four slots is valid.
|
|
36
38
|
* @experimental
|
|
37
39
|
*/
|
|
38
|
-
export const RootKeysByType = t.
|
|
40
|
+
export const RootKeysByType = t.partial(
|
|
39
41
|
{
|
|
40
42
|
secp256k1Multisig: RootKeyTriplet,
|
|
41
43
|
ecdsaMpc: RootKeyTriplet,
|