@bitgo/public-types 6.40.1 → 6.41.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/index.d.ts +1 -0
- package/dist/src/schema/index.js +1 -0
- package/dist/src/schema/index.js.map +1 -1
- package/dist/src/schema/safe/index.d.ts +4 -0
- package/dist/src/schema/safe/index.js +21 -0
- package/dist/src/schema/safe/index.js.map +1 -0
- package/dist/src/schema/safe/requests.d.ts +21 -0
- package/dist/src/schema/safe/requests.js +33 -0
- package/dist/src/schema/safe/requests.js.map +1 -0
- package/dist/src/schema/safe/rootKeys.d.ts +32 -0
- package/dist/src/schema/safe/rootKeys.js +49 -0
- package/dist/src/schema/safe/rootKeys.js.map +1 -0
- package/dist/src/schema/safe/safe.d.ts +92 -0
- package/dist/src/schema/safe/safe.js +77 -0
- package/dist/src/schema/safe/safe.js.map +1 -0
- package/dist/src/schema/safe/safeShare.d.ts +163 -0
- package/dist/src/schema/safe/safeShare.js +71 -0
- package/dist/src/schema/safe/safeShare.js.map +1 -0
- package/package.json +1 -1
- package/src/schema/index.ts +1 -0
- package/src/schema/safe/index.ts +4 -0
- package/src/schema/safe/requests.ts +36 -0
- package/src/schema/safe/rootKeys.ts +77 -0
- package/src/schema/safe/safe.ts +99 -0
- package/src/schema/safe/safeShare.ts +87 -0
package/dist/src/schema/index.js
CHANGED
|
@@ -25,4 +25,5 @@ __exportStar(require("./lightning"), exports);
|
|
|
25
25
|
__exportStar(require("./enterprise"), exports);
|
|
26
26
|
__exportStar(require("./webauthn"), exports);
|
|
27
27
|
__exportStar(require("./defi"), exports);
|
|
28
|
+
__exportStar(require("./safe"), exports);
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rootKeys"), exports);
|
|
18
|
+
__exportStar(require("./safe"), exports);
|
|
19
|
+
__exportStar(require("./safeShare"), exports);
|
|
20
|
+
__exportStar(require("./requests"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/safe/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const InitializeSafeBody: t.TypeC<{
|
|
3
|
+
label: t.StringC;
|
|
4
|
+
}>;
|
|
5
|
+
export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
|
|
6
|
+
export declare const FinalizeSafeBody: t.TypeC<{
|
|
7
|
+
rootKeys: t.TypeC<{
|
|
8
|
+
hot: t.TypeC<{
|
|
9
|
+
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
10
|
+
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
11
|
+
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
12
|
+
ed25519Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
}>;
|
|
16
|
+
export type FinalizeSafeBody = t.TypeOf<typeof FinalizeSafeBody>;
|
|
17
|
+
export declare const FreezeSafeBody: t.PartialC<{
|
|
18
|
+
expires: import("io-ts-types").DateFromISOStringC;
|
|
19
|
+
reason: t.StringC;
|
|
20
|
+
}>;
|
|
21
|
+
export type FreezeSafeBody = t.TypeOf<typeof FreezeSafeBody>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FreezeSafeBody = exports.FinalizeSafeBody = exports.InitializeSafeBody = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
29
|
+
const rootKeys_1 = require("./rootKeys");
|
|
30
|
+
exports.InitializeSafeBody = t.type({ label: t.string }, "InitializeSafeBody");
|
|
31
|
+
exports.FinalizeSafeBody = t.type({ rootKeys: rootKeys_1.SafeRootKeys }, "FinalizeSafeBody");
|
|
32
|
+
exports.FreezeSafeBody = t.partial({ expires: io_ts_types_1.DateFromISOString, reason: t.string }, "FreezeSafeBody");
|
|
33
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/schema/safe/requests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgD;AAChD,yCAA0C;AAM7B,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CACtC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EACnB,oBAAoB,CACrB,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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const RootKeyType: t.KeyofC<{
|
|
3
|
+
secp256k1Multisig: null;
|
|
4
|
+
ecdsaMpc: null;
|
|
5
|
+
eddsaMpc: null;
|
|
6
|
+
ed25519Multisig: null;
|
|
7
|
+
}>;
|
|
8
|
+
export type RootKeyType = t.TypeOf<typeof RootKeyType>;
|
|
9
|
+
export declare const RootKeyTriplet: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
10
|
+
export type RootKeyTriplet = t.TypeOf<typeof RootKeyTriplet>;
|
|
11
|
+
export declare const RootKeysByType: t.TypeC<{
|
|
12
|
+
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
13
|
+
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
14
|
+
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
15
|
+
ed25519Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
16
|
+
}>;
|
|
17
|
+
export type RootKeysByType = t.TypeOf<typeof RootKeysByType>;
|
|
18
|
+
export declare const SafeCustodyType: t.KeyofC<{
|
|
19
|
+
hot: null;
|
|
20
|
+
cold: null;
|
|
21
|
+
custodial: null;
|
|
22
|
+
}>;
|
|
23
|
+
export type SafeCustodyType = t.TypeOf<typeof SafeCustodyType>;
|
|
24
|
+
export declare const SafeRootKeys: t.TypeC<{
|
|
25
|
+
hot: t.TypeC<{
|
|
26
|
+
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
27
|
+
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
28
|
+
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
29
|
+
ed25519Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
export type SafeRootKeys = t.TypeOf<typeof SafeRootKeys>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SafeRootKeys = exports.SafeCustodyType = exports.RootKeysByType = exports.RootKeyTriplet = exports.RootKeyType = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
exports.RootKeyType = t.keyof({
|
|
29
|
+
secp256k1Multisig: null,
|
|
30
|
+
ecdsaMpc: null,
|
|
31
|
+
eddsaMpc: null,
|
|
32
|
+
ed25519Multisig: null,
|
|
33
|
+
}, "RootKeyType");
|
|
34
|
+
exports.RootKeyTriplet = t.tuple([t.string, t.string, t.string], "RootKeyTriplet");
|
|
35
|
+
exports.RootKeysByType = t.type({
|
|
36
|
+
secp256k1Multisig: exports.RootKeyTriplet,
|
|
37
|
+
ecdsaMpc: exports.RootKeyTriplet,
|
|
38
|
+
eddsaMpc: exports.RootKeyTriplet,
|
|
39
|
+
ed25519Multisig: exports.RootKeyTriplet,
|
|
40
|
+
}, "RootKeysByType");
|
|
41
|
+
exports.SafeCustodyType = t.keyof({
|
|
42
|
+
hot: null,
|
|
43
|
+
cold: null,
|
|
44
|
+
custodial: null,
|
|
45
|
+
}, "SafeCustodyType");
|
|
46
|
+
exports.SafeRootKeys = t.type({
|
|
47
|
+
hot: exports.RootKeysByType,
|
|
48
|
+
}, "SafeRootKeys");
|
|
49
|
+
//# sourceMappingURL=rootKeys.js.map
|
|
@@ -0,0 +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;AAQW,QAAA,cAAc,GAAG,CAAC,CAAC,IAAI,CAClC;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"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const SafePermission: t.KeyofC<{
|
|
3
|
+
view: null;
|
|
4
|
+
spend: null;
|
|
5
|
+
admin: null;
|
|
6
|
+
dapp: null;
|
|
7
|
+
}>;
|
|
8
|
+
export type SafePermission = t.TypeOf<typeof SafePermission>;
|
|
9
|
+
export declare const SafeStatus: t.KeyofC<{
|
|
10
|
+
initializing: null;
|
|
11
|
+
active: null;
|
|
12
|
+
archived: null;
|
|
13
|
+
}>;
|
|
14
|
+
export type SafeStatus = t.TypeOf<typeof SafeStatus>;
|
|
15
|
+
export declare const SafeMembershipData: t.IntersectionC<[t.TypeC<{
|
|
16
|
+
userId: t.StringC;
|
|
17
|
+
permissions: import("io-ts-types").NonEmptyArrayC<t.KeyofC<{
|
|
18
|
+
view: null;
|
|
19
|
+
spend: null;
|
|
20
|
+
admin: null;
|
|
21
|
+
dapp: null;
|
|
22
|
+
}>>;
|
|
23
|
+
}>, t.PartialC<{
|
|
24
|
+
needsRecovery: t.BooleanC;
|
|
25
|
+
}>]>;
|
|
26
|
+
export type SafeMembershipData = t.TypeOf<typeof SafeMembershipData>;
|
|
27
|
+
export declare const SafeShareRequest: t.TypeC<{
|
|
28
|
+
userId: t.StringC;
|
|
29
|
+
permissions: import("io-ts-types").NonEmptyArrayC<t.KeyofC<{
|
|
30
|
+
view: null;
|
|
31
|
+
spend: null;
|
|
32
|
+
admin: null;
|
|
33
|
+
dapp: null;
|
|
34
|
+
}>>;
|
|
35
|
+
createdAt: import("io-ts-types").DateFromISOStringC;
|
|
36
|
+
}>;
|
|
37
|
+
export type SafeShareRequest = t.TypeOf<typeof SafeShareRequest>;
|
|
38
|
+
export declare const SafeFreeze: t.PartialC<{
|
|
39
|
+
time: import("io-ts-types").DateFromISOStringC;
|
|
40
|
+
expires: import("io-ts-types").DateFromISOStringC;
|
|
41
|
+
reason: t.StringC;
|
|
42
|
+
}>;
|
|
43
|
+
export type SafeFreeze = t.TypeOf<typeof SafeFreeze>;
|
|
44
|
+
export declare const SafeData: t.IntersectionC<[t.TypeC<{
|
|
45
|
+
id: t.StringC;
|
|
46
|
+
enterpriseId: t.StringC;
|
|
47
|
+
label: t.StringC;
|
|
48
|
+
status: t.KeyofC<{
|
|
49
|
+
initializing: null;
|
|
50
|
+
active: null;
|
|
51
|
+
archived: null;
|
|
52
|
+
}>;
|
|
53
|
+
creator: t.StringC;
|
|
54
|
+
users: t.ArrayC<t.IntersectionC<[t.TypeC<{
|
|
55
|
+
userId: t.StringC;
|
|
56
|
+
permissions: import("io-ts-types").NonEmptyArrayC<t.KeyofC<{
|
|
57
|
+
view: null;
|
|
58
|
+
spend: null;
|
|
59
|
+
admin: null;
|
|
60
|
+
dapp: null;
|
|
61
|
+
}>>;
|
|
62
|
+
}>, t.PartialC<{
|
|
63
|
+
needsRecovery: t.BooleanC;
|
|
64
|
+
}>]>>;
|
|
65
|
+
createdAt: import("io-ts-types").DateFromISOStringC;
|
|
66
|
+
}>, t.PartialC<{
|
|
67
|
+
safeShareRequests: t.ArrayC<t.TypeC<{
|
|
68
|
+
userId: t.StringC;
|
|
69
|
+
permissions: import("io-ts-types").NonEmptyArrayC<t.KeyofC<{
|
|
70
|
+
view: null;
|
|
71
|
+
spend: null;
|
|
72
|
+
admin: null;
|
|
73
|
+
dapp: null;
|
|
74
|
+
}>>;
|
|
75
|
+
createdAt: import("io-ts-types").DateFromISOStringC;
|
|
76
|
+
}>>;
|
|
77
|
+
freeze: t.PartialC<{
|
|
78
|
+
time: import("io-ts-types").DateFromISOStringC;
|
|
79
|
+
expires: import("io-ts-types").DateFromISOStringC;
|
|
80
|
+
reason: t.StringC;
|
|
81
|
+
}>;
|
|
82
|
+
rootKeys: t.TypeC<{
|
|
83
|
+
hot: t.TypeC<{
|
|
84
|
+
secp256k1Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
85
|
+
ecdsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
86
|
+
eddsaMpc: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
87
|
+
ed25519Multisig: t.TupleC<[t.StringC, t.StringC, t.StringC]>;
|
|
88
|
+
}>;
|
|
89
|
+
}>;
|
|
90
|
+
archivedAt: import("io-ts-types").DateFromISOStringC;
|
|
91
|
+
}>]>;
|
|
92
|
+
export type SafeData = t.TypeOf<typeof SafeData>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SafeData = exports.SafeFreeze = exports.SafeShareRequest = exports.SafeMembershipData = exports.SafeStatus = exports.SafePermission = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
29
|
+
const rootKeys_1 = require("./rootKeys");
|
|
30
|
+
exports.SafePermission = t.keyof({
|
|
31
|
+
view: null,
|
|
32
|
+
spend: null,
|
|
33
|
+
admin: null,
|
|
34
|
+
dapp: null,
|
|
35
|
+
}, "SafePermission");
|
|
36
|
+
exports.SafeStatus = t.keyof({
|
|
37
|
+
initializing: null,
|
|
38
|
+
active: null,
|
|
39
|
+
archived: null,
|
|
40
|
+
}, "SafeStatus");
|
|
41
|
+
exports.SafeMembershipData = t.intersection([
|
|
42
|
+
t.type({
|
|
43
|
+
userId: t.string,
|
|
44
|
+
permissions: (0, io_ts_types_1.nonEmptyArray)(exports.SafePermission),
|
|
45
|
+
}),
|
|
46
|
+
t.partial({
|
|
47
|
+
needsRecovery: t.boolean,
|
|
48
|
+
}),
|
|
49
|
+
], "SafeMembershipData");
|
|
50
|
+
exports.SafeShareRequest = t.type({
|
|
51
|
+
userId: t.string,
|
|
52
|
+
permissions: (0, io_ts_types_1.nonEmptyArray)(exports.SafePermission),
|
|
53
|
+
createdAt: io_ts_types_1.DateFromISOString,
|
|
54
|
+
}, "SafeShareRequest");
|
|
55
|
+
exports.SafeFreeze = t.partial({
|
|
56
|
+
time: io_ts_types_1.DateFromISOString,
|
|
57
|
+
expires: io_ts_types_1.DateFromISOString,
|
|
58
|
+
reason: t.string,
|
|
59
|
+
}, "SafeFreeze");
|
|
60
|
+
exports.SafeData = t.intersection([
|
|
61
|
+
t.type({
|
|
62
|
+
id: t.string,
|
|
63
|
+
enterpriseId: t.string,
|
|
64
|
+
label: t.string,
|
|
65
|
+
status: exports.SafeStatus,
|
|
66
|
+
creator: t.string,
|
|
67
|
+
users: t.array(exports.SafeMembershipData),
|
|
68
|
+
createdAt: io_ts_types_1.DateFromISOString,
|
|
69
|
+
}),
|
|
70
|
+
t.partial({
|
|
71
|
+
safeShareRequests: t.array(exports.SafeShareRequest),
|
|
72
|
+
freeze: exports.SafeFreeze,
|
|
73
|
+
rootKeys: rootKeys_1.SafeRootKeys,
|
|
74
|
+
archivedAt: io_ts_types_1.DateFromISOString,
|
|
75
|
+
}),
|
|
76
|
+
], "SafeData");
|
|
77
|
+
//# sourceMappingURL=safe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe.js","sourceRoot":"","sources":["../../../../src/schema/safe/safe.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+D;AAC/D,yCAA0C;AAG7B,QAAA,cAAc,GAAG,CAAC,CAAC,KAAK,CACnC;IACE,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;CACX,EACD,gBAAgB,CACjB,CAAC;AASW,QAAA,UAAU,GAAG,CAAC,CAAC,KAAK,CAC/B;IACE,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;CACf,EACD,YAAY,CACb,CAAC;AAKW,QAAA,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAC9C;IACE,CAAC,CAAC,IAAI,CAAC;QACL,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,WAAW,EAAE,IAAA,2BAAa,EAAC,sBAAc,CAAC;KAC3C,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,aAAa,EAAE,CAAC,CAAC,OAAO;KACzB,CAAC;CACH,EACD,oBAAoB,CACrB,CAAC;AAQW,QAAA,gBAAgB,GAAG,CAAC,CAAC,IAAI,CACpC;IACE,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,WAAW,EAAE,IAAA,2BAAa,EAAC,sBAAc,CAAC;IAC1C,SAAS,EAAE,+BAAiB;CAC7B,EACD,kBAAkB,CACnB,CAAC;AAKW,QAAA,UAAU,GAAG,CAAC,CAAC,OAAO,CACjC;IACE,IAAI,EAAE,+BAAiB;IACvB,OAAO,EAAE,+BAAiB;IAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,EACD,YAAY,CACb,CAAC;AAKW,QAAA,QAAQ,GAAG,CAAC,CAAC,YAAY,CACpC;IACE,CAAC,CAAC,IAAI,CAAC;QACL,EAAE,EAAE,CAAC,CAAC,MAAM;QACZ,YAAY,EAAE,CAAC,CAAC,MAAM;QACtB,KAAK,EAAE,CAAC,CAAC,MAAM;QACf,MAAM,EAAE,kBAAU;QAClB,OAAO,EAAE,CAAC,CAAC,MAAM;QACjB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,0BAAkB,CAAC;QAClC,SAAS,EAAE,+BAAiB;KAC7B,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAgB,CAAC;QAC5C,MAAM,EAAE,kBAAU;QAClB,QAAQ,EAAE,uBAAY;QACtB,UAAU,EAAE,+BAAiB;KAC9B,CAAC;CACH,EACD,UAAU,CACX,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const SafeShareState: t.KeyofC<{
|
|
3
|
+
pendingapproval: null;
|
|
4
|
+
active: null;
|
|
5
|
+
accepted: null;
|
|
6
|
+
canceled: null;
|
|
7
|
+
rejected: null;
|
|
8
|
+
}>;
|
|
9
|
+
export type SafeShareState = t.TypeOf<typeof SafeShareState>;
|
|
10
|
+
export declare const SafeShareKeychain: t.TypeC<{
|
|
11
|
+
rootKeyType: t.KeyofC<{
|
|
12
|
+
secp256k1Multisig: null;
|
|
13
|
+
ecdsaMpc: null;
|
|
14
|
+
eddsaMpc: null;
|
|
15
|
+
ed25519Multisig: null;
|
|
16
|
+
}>;
|
|
17
|
+
rootKeyId: t.StringC;
|
|
18
|
+
encryptedPrv: t.StringC;
|
|
19
|
+
publicIdentifier: t.StringC;
|
|
20
|
+
fromPubKey: t.StringC;
|
|
21
|
+
toPubKey: t.StringC;
|
|
22
|
+
path: t.StringC;
|
|
23
|
+
}>;
|
|
24
|
+
export type SafeShareKeychain = t.TypeOf<typeof SafeShareKeychain>;
|
|
25
|
+
export declare const SafeShareKeychains: t.TypeC<{
|
|
26
|
+
hot: t.TupleC<[t.TypeC<{
|
|
27
|
+
rootKeyType: t.KeyofC<{
|
|
28
|
+
secp256k1Multisig: null;
|
|
29
|
+
ecdsaMpc: null;
|
|
30
|
+
eddsaMpc: null;
|
|
31
|
+
ed25519Multisig: null;
|
|
32
|
+
}>;
|
|
33
|
+
rootKeyId: t.StringC;
|
|
34
|
+
encryptedPrv: t.StringC;
|
|
35
|
+
publicIdentifier: t.StringC;
|
|
36
|
+
fromPubKey: t.StringC;
|
|
37
|
+
toPubKey: t.StringC;
|
|
38
|
+
path: t.StringC;
|
|
39
|
+
}>, t.TypeC<{
|
|
40
|
+
rootKeyType: t.KeyofC<{
|
|
41
|
+
secp256k1Multisig: null;
|
|
42
|
+
ecdsaMpc: null;
|
|
43
|
+
eddsaMpc: null;
|
|
44
|
+
ed25519Multisig: null;
|
|
45
|
+
}>;
|
|
46
|
+
rootKeyId: t.StringC;
|
|
47
|
+
encryptedPrv: t.StringC;
|
|
48
|
+
publicIdentifier: t.StringC;
|
|
49
|
+
fromPubKey: t.StringC;
|
|
50
|
+
toPubKey: t.StringC;
|
|
51
|
+
path: t.StringC;
|
|
52
|
+
}>, t.TypeC<{
|
|
53
|
+
rootKeyType: t.KeyofC<{
|
|
54
|
+
secp256k1Multisig: null;
|
|
55
|
+
ecdsaMpc: null;
|
|
56
|
+
eddsaMpc: null;
|
|
57
|
+
ed25519Multisig: null;
|
|
58
|
+
}>;
|
|
59
|
+
rootKeyId: t.StringC;
|
|
60
|
+
encryptedPrv: t.StringC;
|
|
61
|
+
publicIdentifier: t.StringC;
|
|
62
|
+
fromPubKey: t.StringC;
|
|
63
|
+
toPubKey: t.StringC;
|
|
64
|
+
path: t.StringC;
|
|
65
|
+
}>, t.TypeC<{
|
|
66
|
+
rootKeyType: t.KeyofC<{
|
|
67
|
+
secp256k1Multisig: null;
|
|
68
|
+
ecdsaMpc: null;
|
|
69
|
+
eddsaMpc: null;
|
|
70
|
+
ed25519Multisig: null;
|
|
71
|
+
}>;
|
|
72
|
+
rootKeyId: t.StringC;
|
|
73
|
+
encryptedPrv: t.StringC;
|
|
74
|
+
publicIdentifier: t.StringC;
|
|
75
|
+
fromPubKey: t.StringC;
|
|
76
|
+
toPubKey: t.StringC;
|
|
77
|
+
path: t.StringC;
|
|
78
|
+
}>]>;
|
|
79
|
+
}>;
|
|
80
|
+
export type SafeShareKeychains = t.TypeOf<typeof SafeShareKeychains>;
|
|
81
|
+
export declare const SafeShareData: t.IntersectionC<[t.TypeC<{
|
|
82
|
+
id: t.StringC;
|
|
83
|
+
enterpriseId: t.StringC;
|
|
84
|
+
safeId: t.StringC;
|
|
85
|
+
fromUser: t.StringC;
|
|
86
|
+
toUser: t.StringC;
|
|
87
|
+
permissions: import("io-ts-types").NonEmptyArrayC<t.KeyofC<{
|
|
88
|
+
view: null;
|
|
89
|
+
spend: null;
|
|
90
|
+
admin: null;
|
|
91
|
+
dapp: null;
|
|
92
|
+
}>>;
|
|
93
|
+
state: t.KeyofC<{
|
|
94
|
+
pendingapproval: null;
|
|
95
|
+
active: null;
|
|
96
|
+
accepted: null;
|
|
97
|
+
canceled: null;
|
|
98
|
+
rejected: null;
|
|
99
|
+
}>;
|
|
100
|
+
createdAt: import("io-ts-types").DateFromISOStringC;
|
|
101
|
+
}>, t.PartialC<{
|
|
102
|
+
safeLabel: t.StringC;
|
|
103
|
+
message: t.StringC;
|
|
104
|
+
pendingApprovalId: t.StringC;
|
|
105
|
+
isUMSInitiated: t.BooleanC;
|
|
106
|
+
keychains: t.TypeC<{
|
|
107
|
+
hot: t.TupleC<[t.TypeC<{
|
|
108
|
+
rootKeyType: t.KeyofC<{
|
|
109
|
+
secp256k1Multisig: null;
|
|
110
|
+
ecdsaMpc: null;
|
|
111
|
+
eddsaMpc: null;
|
|
112
|
+
ed25519Multisig: null;
|
|
113
|
+
}>;
|
|
114
|
+
rootKeyId: t.StringC;
|
|
115
|
+
encryptedPrv: t.StringC;
|
|
116
|
+
publicIdentifier: t.StringC;
|
|
117
|
+
fromPubKey: t.StringC;
|
|
118
|
+
toPubKey: t.StringC;
|
|
119
|
+
path: t.StringC;
|
|
120
|
+
}>, t.TypeC<{
|
|
121
|
+
rootKeyType: t.KeyofC<{
|
|
122
|
+
secp256k1Multisig: null;
|
|
123
|
+
ecdsaMpc: null;
|
|
124
|
+
eddsaMpc: null;
|
|
125
|
+
ed25519Multisig: null;
|
|
126
|
+
}>;
|
|
127
|
+
rootKeyId: t.StringC;
|
|
128
|
+
encryptedPrv: t.StringC;
|
|
129
|
+
publicIdentifier: t.StringC;
|
|
130
|
+
fromPubKey: t.StringC;
|
|
131
|
+
toPubKey: t.StringC;
|
|
132
|
+
path: t.StringC;
|
|
133
|
+
}>, t.TypeC<{
|
|
134
|
+
rootKeyType: t.KeyofC<{
|
|
135
|
+
secp256k1Multisig: null;
|
|
136
|
+
ecdsaMpc: null;
|
|
137
|
+
eddsaMpc: null;
|
|
138
|
+
ed25519Multisig: null;
|
|
139
|
+
}>;
|
|
140
|
+
rootKeyId: t.StringC;
|
|
141
|
+
encryptedPrv: t.StringC;
|
|
142
|
+
publicIdentifier: t.StringC;
|
|
143
|
+
fromPubKey: t.StringC;
|
|
144
|
+
toPubKey: t.StringC;
|
|
145
|
+
path: t.StringC;
|
|
146
|
+
}>, t.TypeC<{
|
|
147
|
+
rootKeyType: t.KeyofC<{
|
|
148
|
+
secp256k1Multisig: null;
|
|
149
|
+
ecdsaMpc: null;
|
|
150
|
+
eddsaMpc: null;
|
|
151
|
+
ed25519Multisig: null;
|
|
152
|
+
}>;
|
|
153
|
+
rootKeyId: t.StringC;
|
|
154
|
+
encryptedPrv: t.StringC;
|
|
155
|
+
publicIdentifier: t.StringC;
|
|
156
|
+
fromPubKey: t.StringC;
|
|
157
|
+
toPubKey: t.StringC;
|
|
158
|
+
path: t.StringC;
|
|
159
|
+
}>]>;
|
|
160
|
+
}>;
|
|
161
|
+
updatedAt: import("io-ts-types").DateFromISOStringC;
|
|
162
|
+
}>]>;
|
|
163
|
+
export type SafeShareData = t.TypeOf<typeof SafeShareData>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SafeShareData = exports.SafeShareKeychains = exports.SafeShareKeychain = exports.SafeShareState = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
29
|
+
const rootKeys_1 = require("./rootKeys");
|
|
30
|
+
const safe_1 = require("./safe");
|
|
31
|
+
exports.SafeShareState = t.keyof({
|
|
32
|
+
pendingapproval: null,
|
|
33
|
+
active: null,
|
|
34
|
+
accepted: null,
|
|
35
|
+
canceled: null,
|
|
36
|
+
rejected: null,
|
|
37
|
+
}, "SafeShareState");
|
|
38
|
+
exports.SafeShareKeychain = t.type({
|
|
39
|
+
rootKeyType: rootKeys_1.RootKeyType,
|
|
40
|
+
rootKeyId: t.string,
|
|
41
|
+
encryptedPrv: t.string,
|
|
42
|
+
publicIdentifier: t.string,
|
|
43
|
+
fromPubKey: t.string,
|
|
44
|
+
toPubKey: t.string,
|
|
45
|
+
path: t.string,
|
|
46
|
+
}, "SafeShareKeychain");
|
|
47
|
+
const SafeShareKeychainQuad = t.tuple([exports.SafeShareKeychain, exports.SafeShareKeychain, exports.SafeShareKeychain, exports.SafeShareKeychain], "SafeShareKeychainQuad");
|
|
48
|
+
exports.SafeShareKeychains = t.type({
|
|
49
|
+
hot: SafeShareKeychainQuad,
|
|
50
|
+
}, "SafeShareKeychains");
|
|
51
|
+
exports.SafeShareData = t.intersection([
|
|
52
|
+
t.type({
|
|
53
|
+
id: t.string,
|
|
54
|
+
enterpriseId: t.string,
|
|
55
|
+
safeId: t.string,
|
|
56
|
+
fromUser: t.string,
|
|
57
|
+
toUser: t.string,
|
|
58
|
+
permissions: (0, io_ts_types_1.nonEmptyArray)(safe_1.SafePermission),
|
|
59
|
+
state: exports.SafeShareState,
|
|
60
|
+
createdAt: io_ts_types_1.DateFromISOString,
|
|
61
|
+
}),
|
|
62
|
+
t.partial({
|
|
63
|
+
safeLabel: t.string,
|
|
64
|
+
message: t.string,
|
|
65
|
+
pendingApprovalId: t.string,
|
|
66
|
+
isUMSInitiated: t.boolean,
|
|
67
|
+
keychains: exports.SafeShareKeychains,
|
|
68
|
+
updatedAt: io_ts_types_1.DateFromISOString,
|
|
69
|
+
}),
|
|
70
|
+
], "SafeShareData");
|
|
71
|
+
//# sourceMappingURL=safeShare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safeShare.js","sourceRoot":"","sources":["../../../../src/schema/safe/safeShare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+D;AAC/D,yCAAyC;AACzC,iCAAwC;AAM3B,QAAA,cAAc,GAAG,CAAC,CAAC,KAAK,CACnC;IACE,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;CACf,EACD,gBAAgB,CACjB,CAAC;AAQW,QAAA,iBAAiB,GAAG,CAAC,CAAC,IAAI,CACrC;IACE,WAAW,EAAE,sBAAW;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM;IACtB,gBAAgB,EAAE,CAAC,CAAC,MAAM;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM;CACf,EACD,mBAAmB,CACpB,CAAC;AAKF,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CACnC,CAAC,yBAAiB,EAAE,yBAAiB,EAAE,yBAAiB,EAAE,yBAAiB,CAAC,EAC5E,uBAAuB,CACxB,CAAC;AAOW,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CACtC;IACE,GAAG,EAAE,qBAAqB;CAC3B,EACD,oBAAoB,CACrB,CAAC;AAKW,QAAA,aAAa,GAAG,CAAC,CAAC,YAAY,CACzC;IACE,CAAC,CAAC,IAAI,CAAC;QACL,EAAE,EAAE,CAAC,CAAC,MAAM;QACZ,YAAY,EAAE,CAAC,CAAC,MAAM;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,QAAQ,EAAE,CAAC,CAAC,MAAM;QAClB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,WAAW,EAAE,IAAA,2BAAa,EAAC,qBAAc,CAAC;QAC1C,KAAK,EAAE,sBAAc;QACrB,SAAS,EAAE,+BAAiB;KAC7B,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,SAAS,EAAE,CAAC,CAAC,MAAM;QACnB,OAAO,EAAE,CAAC,CAAC,MAAM;QACjB,iBAAiB,EAAE,CAAC,CAAC,MAAM;QAC3B,cAAc,EAAE,CAAC,CAAC,OAAO;QACzB,SAAS,EAAE,0BAAkB;QAC7B,SAAS,EAAE,+BAAiB;KAC7B,CAAC;CACH,EACD,eAAe,CAChB,CAAC"}
|
package/package.json
CHANGED
package/src/schema/index.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { DateFromISOString } from "io-ts-types";
|
|
3
|
+
import { SafeRootKeys } from "./rootKeys";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* POST /enterprise/:eId/safes — Phase 1 carries no key material.
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export const InitializeSafeBody = t.type(
|
|
10
|
+
{ label: t.string },
|
|
11
|
+
"InitializeSafeBody",
|
|
12
|
+
);
|
|
13
|
+
/** @experimental */
|
|
14
|
+
export type InitializeSafeBody = t.TypeOf<typeof InitializeSafeBody>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* POST /enterprise/:eId/safes/:safeId/finalize — the 12 key ids as 4 ordered triplets.
|
|
18
|
+
* @experimental
|
|
19
|
+
*/
|
|
20
|
+
export const FinalizeSafeBody = t.type(
|
|
21
|
+
{ rootKeys: SafeRootKeys },
|
|
22
|
+
"FinalizeSafeBody",
|
|
23
|
+
);
|
|
24
|
+
/** @experimental */
|
|
25
|
+
export type FinalizeSafeBody = t.TypeOf<typeof FinalizeSafeBody>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* POST / DELETE /enterprise/:eId/safes/:safeId/freeze
|
|
29
|
+
* @experimental
|
|
30
|
+
*/
|
|
31
|
+
export const FreezeSafeBody = t.partial(
|
|
32
|
+
{ expires: DateFromISOString, reason: t.string },
|
|
33
|
+
"FreezeSafeBody",
|
|
34
|
+
);
|
|
35
|
+
/** @experimental */
|
|
36
|
+
export type FreezeSafeBody = t.TypeOf<typeof FreezeSafeBody>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The four static root-key slots of a safe, keyed by (curve, scheme):
|
|
5
|
+
* - secp256k1Multisig — ex. UTXO/XRP/XTZ/TRX/EOS
|
|
6
|
+
* - ecdsaMpc — ex. EVM/Cosmos (DKLS)
|
|
7
|
+
* - eddsaMpc — ex. SOL/SUI/NEAR/TON/APT/DOT
|
|
8
|
+
* - ed25519Multisig — ex. ALGO/XLM/HBAR
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
export const RootKeyType = t.keyof(
|
|
12
|
+
{
|
|
13
|
+
secp256k1Multisig: null,
|
|
14
|
+
ecdsaMpc: null,
|
|
15
|
+
eddsaMpc: null,
|
|
16
|
+
ed25519Multisig: null,
|
|
17
|
+
},
|
|
18
|
+
"RootKeyType",
|
|
19
|
+
);
|
|
20
|
+
/** @experimental */
|
|
21
|
+
export type RootKeyType = t.TypeOf<typeof RootKeyType>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An ordered [userKeyId, backupKeyId, bitgoKeyId] triplet — same shape/order as wallet.keys[].
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export const RootKeyTriplet = t.tuple(
|
|
28
|
+
[t.string, t.string, t.string],
|
|
29
|
+
"RootKeyTriplet",
|
|
30
|
+
);
|
|
31
|
+
/** @experimental */
|
|
32
|
+
export type RootKeyTriplet = t.TypeOf<typeof RootKeyTriplet>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The 12 root key ids for a single custody model, keyed by (curve, scheme).
|
|
36
|
+
* @experimental
|
|
37
|
+
*/
|
|
38
|
+
export const RootKeysByType = t.type(
|
|
39
|
+
{
|
|
40
|
+
secp256k1Multisig: RootKeyTriplet,
|
|
41
|
+
ecdsaMpc: RootKeyTriplet,
|
|
42
|
+
eddsaMpc: RootKeyTriplet,
|
|
43
|
+
ed25519Multisig: RootKeyTriplet,
|
|
44
|
+
},
|
|
45
|
+
"RootKeysByType",
|
|
46
|
+
);
|
|
47
|
+
/** @experimental */
|
|
48
|
+
export type RootKeysByType = t.TypeOf<typeof RootKeysByType>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Custody models a safe's roots can be created under. v1 implements `hot` only; this is a subset
|
|
52
|
+
* of the broader wallet `WalletTypes`.
|
|
53
|
+
* @experimental
|
|
54
|
+
*/
|
|
55
|
+
export const SafeCustodyType = t.keyof(
|
|
56
|
+
{
|
|
57
|
+
hot: null,
|
|
58
|
+
cold: null,
|
|
59
|
+
custodial: null,
|
|
60
|
+
},
|
|
61
|
+
"SafeCustodyType",
|
|
62
|
+
);
|
|
63
|
+
/** @experimental */
|
|
64
|
+
export type SafeCustodyType = t.TypeOf<typeof SafeCustodyType>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A safe's root keys — the set of 4 (curve, scheme) root triplets.
|
|
68
|
+
* @experimental
|
|
69
|
+
*/
|
|
70
|
+
export const SafeRootKeys = t.type(
|
|
71
|
+
{
|
|
72
|
+
hot: RootKeysByType,
|
|
73
|
+
},
|
|
74
|
+
"SafeRootKeys",
|
|
75
|
+
);
|
|
76
|
+
/** @experimental */
|
|
77
|
+
export type SafeRootKeys = t.TypeOf<typeof SafeRootKeys>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { DateFromISOString, nonEmptyArray } from "io-ts-types";
|
|
3
|
+
import { SafeRootKeys } from "./rootKeys";
|
|
4
|
+
|
|
5
|
+
/** @experimental */
|
|
6
|
+
export const SafePermission = t.keyof(
|
|
7
|
+
{
|
|
8
|
+
view: null,
|
|
9
|
+
spend: null,
|
|
10
|
+
admin: null,
|
|
11
|
+
dapp: null,
|
|
12
|
+
},
|
|
13
|
+
"SafePermission",
|
|
14
|
+
);
|
|
15
|
+
/** @experimental */
|
|
16
|
+
export type SafePermission = t.TypeOf<typeof SafePermission>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A safe's lifecycle status. freeze is NOT a status — a frozen safe stays `active` with the freeze
|
|
20
|
+
* field set (wallet precedent).
|
|
21
|
+
* @experimental
|
|
22
|
+
*/
|
|
23
|
+
export const SafeStatus = t.keyof(
|
|
24
|
+
{
|
|
25
|
+
initializing: null,
|
|
26
|
+
active: null,
|
|
27
|
+
archived: null,
|
|
28
|
+
},
|
|
29
|
+
"SafeStatus",
|
|
30
|
+
);
|
|
31
|
+
/** @experimental */
|
|
32
|
+
export type SafeStatus = t.TypeOf<typeof SafeStatus>;
|
|
33
|
+
|
|
34
|
+
/** @experimental */
|
|
35
|
+
export const SafeMembershipData = t.intersection(
|
|
36
|
+
[
|
|
37
|
+
t.type({
|
|
38
|
+
userId: t.string,
|
|
39
|
+
permissions: nonEmptyArray(SafePermission),
|
|
40
|
+
}),
|
|
41
|
+
t.partial({
|
|
42
|
+
needsRecovery: t.boolean,
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
"SafeMembershipData",
|
|
46
|
+
);
|
|
47
|
+
/** @experimental */
|
|
48
|
+
export type SafeMembershipData = t.TypeOf<typeof SafeMembershipData>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A pending UMS spend grant awaiting a key share — mirror of the wallet's walletShareRequests[].
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
export const SafeShareRequest = t.type(
|
|
55
|
+
{
|
|
56
|
+
userId: t.string,
|
|
57
|
+
permissions: nonEmptyArray(SafePermission),
|
|
58
|
+
createdAt: DateFromISOString,
|
|
59
|
+
},
|
|
60
|
+
"SafeShareRequest",
|
|
61
|
+
);
|
|
62
|
+
/** @experimental */
|
|
63
|
+
export type SafeShareRequest = t.TypeOf<typeof SafeShareRequest>;
|
|
64
|
+
|
|
65
|
+
/** @experimental */
|
|
66
|
+
export const SafeFreeze = t.partial(
|
|
67
|
+
{
|
|
68
|
+
time: DateFromISOString,
|
|
69
|
+
expires: DateFromISOString,
|
|
70
|
+
reason: t.string,
|
|
71
|
+
},
|
|
72
|
+
"SafeFreeze",
|
|
73
|
+
);
|
|
74
|
+
/** @experimental */
|
|
75
|
+
export type SafeFreeze = t.TypeOf<typeof SafeFreeze>;
|
|
76
|
+
|
|
77
|
+
/** @experimental */
|
|
78
|
+
export const SafeData = t.intersection(
|
|
79
|
+
[
|
|
80
|
+
t.type({
|
|
81
|
+
id: t.string,
|
|
82
|
+
enterpriseId: t.string,
|
|
83
|
+
label: t.string,
|
|
84
|
+
status: SafeStatus,
|
|
85
|
+
creator: t.string,
|
|
86
|
+
users: t.array(SafeMembershipData),
|
|
87
|
+
createdAt: DateFromISOString,
|
|
88
|
+
}),
|
|
89
|
+
t.partial({
|
|
90
|
+
safeShareRequests: t.array(SafeShareRequest),
|
|
91
|
+
freeze: SafeFreeze,
|
|
92
|
+
rootKeys: SafeRootKeys,
|
|
93
|
+
archivedAt: DateFromISOString,
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
"SafeData",
|
|
97
|
+
);
|
|
98
|
+
/** @experimental */
|
|
99
|
+
export type SafeData = t.TypeOf<typeof SafeData>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { DateFromISOString, nonEmptyArray } from "io-ts-types";
|
|
3
|
+
import { RootKeyType } from "./rootKeys";
|
|
4
|
+
import { SafePermission } from "./safe";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Safe key-share states — identical to WalletShare states, no new states.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export const SafeShareState = t.keyof(
|
|
11
|
+
{
|
|
12
|
+
pendingapproval: null,
|
|
13
|
+
active: null,
|
|
14
|
+
accepted: null,
|
|
15
|
+
canceled: null,
|
|
16
|
+
rejected: null,
|
|
17
|
+
},
|
|
18
|
+
"SafeShareState",
|
|
19
|
+
);
|
|
20
|
+
/** @experimental */
|
|
21
|
+
export type SafeShareState = t.TypeOf<typeof SafeShareState>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* One of the 4 root USER keyshares carried on a SafeShare, ECDH-re-encrypted to the recipient.
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export const SafeShareKeychain = t.type(
|
|
28
|
+
{
|
|
29
|
+
rootKeyType: RootKeyType,
|
|
30
|
+
rootKeyId: t.string,
|
|
31
|
+
encryptedPrv: t.string,
|
|
32
|
+
publicIdentifier: t.string,
|
|
33
|
+
fromPubKey: t.string,
|
|
34
|
+
toPubKey: t.string,
|
|
35
|
+
path: t.string,
|
|
36
|
+
},
|
|
37
|
+
"SafeShareKeychain",
|
|
38
|
+
);
|
|
39
|
+
/** @experimental */
|
|
40
|
+
export type SafeShareKeychain = t.TypeOf<typeof SafeShareKeychain>;
|
|
41
|
+
|
|
42
|
+
/** Exactly 4 keyshares — one per (curve, scheme) root. */
|
|
43
|
+
const SafeShareKeychainQuad = t.tuple(
|
|
44
|
+
[SafeShareKeychain, SafeShareKeychain, SafeShareKeychain, SafeShareKeychain],
|
|
45
|
+
"SafeShareKeychainQuad",
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A safe's keyshares grouped by custody model — mirrors the SafeRootKeys structure so callers
|
|
50
|
+
* can correlate keychains with the correct custody root.
|
|
51
|
+
* @experimental
|
|
52
|
+
*/
|
|
53
|
+
export const SafeShareKeychains = t.type(
|
|
54
|
+
{
|
|
55
|
+
hot: SafeShareKeychainQuad,
|
|
56
|
+
},
|
|
57
|
+
"SafeShareKeychains",
|
|
58
|
+
);
|
|
59
|
+
/** @experimental */
|
|
60
|
+
export type SafeShareKeychains = t.TypeOf<typeof SafeShareKeychains>;
|
|
61
|
+
|
|
62
|
+
/** @experimental */
|
|
63
|
+
export const SafeShareData = t.intersection(
|
|
64
|
+
[
|
|
65
|
+
t.type({
|
|
66
|
+
id: t.string,
|
|
67
|
+
enterpriseId: t.string,
|
|
68
|
+
safeId: t.string,
|
|
69
|
+
fromUser: t.string,
|
|
70
|
+
toUser: t.string,
|
|
71
|
+
permissions: nonEmptyArray(SafePermission),
|
|
72
|
+
state: SafeShareState,
|
|
73
|
+
createdAt: DateFromISOString,
|
|
74
|
+
}),
|
|
75
|
+
t.partial({
|
|
76
|
+
safeLabel: t.string,
|
|
77
|
+
message: t.string,
|
|
78
|
+
pendingApprovalId: t.string,
|
|
79
|
+
isUMSInitiated: t.boolean,
|
|
80
|
+
keychains: SafeShareKeychains,
|
|
81
|
+
updatedAt: DateFromISOString,
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
"SafeShareData",
|
|
85
|
+
);
|
|
86
|
+
/** @experimental */
|
|
87
|
+
export type SafeShareData = t.TypeOf<typeof SafeShareData>;
|