@bitgo/public-types 6.71.0 → 6.72.1
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.
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
|
|
2
|
+
interface DerivationIndexBrand {
|
|
3
|
+
readonly DerivationIndex: unique symbol;
|
|
4
|
+
}
|
|
5
|
+
export declare const MPCv2DeriveRound1Request: t.TypeC<{
|
|
3
6
|
userGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
4
|
-
backupGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
5
7
|
userMsg1: t.TypeC<{
|
|
6
8
|
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
7
9
|
message: t.StringC;
|
|
8
10
|
signature: t.StringC;
|
|
9
11
|
}>;
|
|
10
|
-
backupMsg1: t.TypeC<{
|
|
11
|
-
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
12
|
-
message: t.StringC;
|
|
13
|
-
signature: t.StringC;
|
|
14
|
-
}>;
|
|
15
|
-
}>, t.TypeC<{
|
|
16
12
|
parentKeyId: import("io-ts-types").NonEmptyStringC;
|
|
17
|
-
derivationIndex: t.NumberC
|
|
18
|
-
}
|
|
13
|
+
derivationIndex: t.BrandC<t.NumberC, DerivationIndexBrand>;
|
|
14
|
+
}>;
|
|
19
15
|
export type MPCv2DeriveRound1Request = t.TypeOf<typeof MPCv2DeriveRound1Request>;
|
|
20
16
|
export declare const MPCv2DeriveRound1Response: t.TypeC<{
|
|
21
17
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
22
|
-
|
|
23
|
-
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
24
|
-
message: t.StringC;
|
|
25
|
-
signature: t.StringC;
|
|
26
|
-
}>;
|
|
27
|
-
bitgoBackupMsg1: t.TypeC<{
|
|
18
|
+
bitgoMsg1: t.TypeC<{
|
|
28
19
|
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
29
20
|
message: t.StringC;
|
|
30
21
|
signature: t.StringC;
|
|
@@ -38,21 +29,11 @@ export declare const MPCv2DeriveRound2Request: t.TypeC<{
|
|
|
38
29
|
message: t.StringC;
|
|
39
30
|
signature: t.StringC;
|
|
40
31
|
}>;
|
|
41
|
-
backupMsg2: t.TypeC<{
|
|
42
|
-
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
43
|
-
message: t.StringC;
|
|
44
|
-
signature: t.StringC;
|
|
45
|
-
}>;
|
|
46
32
|
}>;
|
|
47
33
|
export type MPCv2DeriveRound2Request = t.TypeOf<typeof MPCv2DeriveRound2Request>;
|
|
48
34
|
export declare const MPCv2DeriveRound2Response: t.TypeC<{
|
|
49
35
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
50
|
-
|
|
51
|
-
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
52
|
-
message: t.StringC;
|
|
53
|
-
signature: t.StringC;
|
|
54
|
-
}>;
|
|
55
|
-
bitgoBackupMsg2: t.TypeC<{
|
|
36
|
+
bitgoMsg2: t.TypeC<{
|
|
56
37
|
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
57
38
|
message: t.StringC;
|
|
58
39
|
signature: t.StringC;
|
|
@@ -68,3 +49,49 @@ export declare const MPCv2DeriveRound3Response: t.TypeC<{
|
|
|
68
49
|
commonKeychain: import("io-ts-types").NonEmptyStringC;
|
|
69
50
|
}>;
|
|
70
51
|
export type MPCv2DeriveRound3Response = t.TypeOf<typeof MPCv2DeriveRound3Response>;
|
|
52
|
+
export declare const EddsaMPCv2DeriveRound1Request: t.IntersectionC<[t.TypeC<{
|
|
53
|
+
userGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
54
|
+
backupGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
55
|
+
userMsg1: t.TypeC<{
|
|
56
|
+
message: t.StringC;
|
|
57
|
+
signature: t.StringC;
|
|
58
|
+
}>;
|
|
59
|
+
backupMsg1: t.TypeC<{
|
|
60
|
+
message: t.StringC;
|
|
61
|
+
signature: t.StringC;
|
|
62
|
+
}>;
|
|
63
|
+
}>, t.TypeC<{
|
|
64
|
+
parentKeyId: import("io-ts-types").NonEmptyStringC;
|
|
65
|
+
derivationIndex: t.BrandC<t.NumberC, DerivationIndexBrand>;
|
|
66
|
+
}>]>;
|
|
67
|
+
export type EddsaMPCv2DeriveRound1Request = t.TypeOf<typeof EddsaMPCv2DeriveRound1Request>;
|
|
68
|
+
export declare const EddsaMPCv2DeriveRound1Response: t.TypeC<{
|
|
69
|
+
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
70
|
+
bitgoMsg1: t.TypeC<{
|
|
71
|
+
message: t.StringC;
|
|
72
|
+
signature: t.StringC;
|
|
73
|
+
}>;
|
|
74
|
+
}>;
|
|
75
|
+
export type EddsaMPCv2DeriveRound1Response = t.TypeOf<typeof EddsaMPCv2DeriveRound1Response>;
|
|
76
|
+
export declare const EddsaMPCv2DeriveRound2Request: t.TypeC<{
|
|
77
|
+
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
78
|
+
userMsg2: t.TypeC<{
|
|
79
|
+
message: t.StringC;
|
|
80
|
+
signature: t.StringC;
|
|
81
|
+
}>;
|
|
82
|
+
backupMsg2: t.TypeC<{
|
|
83
|
+
message: t.StringC;
|
|
84
|
+
signature: t.StringC;
|
|
85
|
+
}>;
|
|
86
|
+
}>;
|
|
87
|
+
export type EddsaMPCv2DeriveRound2Request = t.TypeOf<typeof EddsaMPCv2DeriveRound2Request>;
|
|
88
|
+
export declare const EddsaMPCv2DeriveRound2Response: t.TypeC<{
|
|
89
|
+
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
90
|
+
commonPublicKeychain: import("io-ts-types").NonEmptyStringC;
|
|
91
|
+
bitgoMsg2: t.TypeC<{
|
|
92
|
+
message: t.StringC;
|
|
93
|
+
signature: t.StringC;
|
|
94
|
+
}>;
|
|
95
|
+
}>;
|
|
96
|
+
export type EddsaMPCv2DeriveRound2Response = t.TypeOf<typeof EddsaMPCv2DeriveRound2Response>;
|
|
97
|
+
export {};
|
|
@@ -23,32 +23,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.MPCv2DeriveRound3Response = exports.MPCv2DeriveRound3Request = exports.MPCv2DeriveRound2Response = exports.MPCv2DeriveRound2Request = exports.MPCv2DeriveRound1Response = exports.MPCv2DeriveRound1Request = void 0;
|
|
26
|
+
exports.EddsaMPCv2DeriveRound2Response = exports.EddsaMPCv2DeriveRound2Request = exports.EddsaMPCv2DeriveRound1Response = exports.EddsaMPCv2DeriveRound1Request = exports.MPCv2DeriveRound3Response = exports.MPCv2DeriveRound3Request = exports.MPCv2DeriveRound2Response = exports.MPCv2DeriveRound2Request = exports.MPCv2DeriveRound1Response = exports.MPCv2DeriveRound1Request = void 0;
|
|
27
27
|
const t = __importStar(require("io-ts"));
|
|
28
28
|
const io_ts_types_1 = require("io-ts-types");
|
|
29
29
|
const common_1 = require("../common");
|
|
30
30
|
const keygenRound_1 = require("../keyGen/keygenRound");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const DerivationIndex = t.brand(t.number, (index) => Number.isSafeInteger(index) && index >= 0, "DerivationIndex");
|
|
32
|
+
exports.MPCv2DeriveRound1Request = t.type({
|
|
33
|
+
userGpgPublicKey: io_ts_types_1.NonEmptyString,
|
|
34
|
+
userMsg1: common_1.MPCv2BroadcastMessage,
|
|
35
|
+
parentKeyId: io_ts_types_1.NonEmptyString,
|
|
36
|
+
derivationIndex: DerivationIndex,
|
|
37
|
+
}, "MPCv2DeriveRound1Request");
|
|
38
38
|
exports.MPCv2DeriveRound1Response = t.type({
|
|
39
39
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
40
|
-
|
|
41
|
-
bitgoBackupMsg1: common_1.MPCv2BroadcastMessage,
|
|
40
|
+
bitgoMsg1: common_1.MPCv2BroadcastMessage,
|
|
42
41
|
});
|
|
43
42
|
exports.MPCv2DeriveRound2Request = t.type({
|
|
44
43
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
45
44
|
userMsg2: common_1.MPCv2BroadcastMessage,
|
|
46
|
-
backupMsg2: common_1.MPCv2BroadcastMessage,
|
|
47
45
|
});
|
|
48
46
|
exports.MPCv2DeriveRound2Response = t.type({
|
|
49
47
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
50
|
-
|
|
51
|
-
bitgoBackupMsg2: common_1.MPCv2BroadcastMessage,
|
|
48
|
+
bitgoMsg2: common_1.MPCv2BroadcastMessage,
|
|
52
49
|
});
|
|
53
50
|
exports.MPCv2DeriveRound3Request = t.type({
|
|
54
51
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
@@ -57,4 +54,25 @@ exports.MPCv2DeriveRound3Response = t.type({
|
|
|
57
54
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
58
55
|
commonKeychain: io_ts_types_1.NonEmptyString,
|
|
59
56
|
});
|
|
57
|
+
exports.EddsaMPCv2DeriveRound1Request = t.intersection([
|
|
58
|
+
keygenRound_1.EddsaMPCv2KeyGenRound1Request,
|
|
59
|
+
t.type({
|
|
60
|
+
parentKeyId: io_ts_types_1.NonEmptyString,
|
|
61
|
+
derivationIndex: DerivationIndex,
|
|
62
|
+
}),
|
|
63
|
+
], "EddsaMPCv2DeriveRound1Request");
|
|
64
|
+
exports.EddsaMPCv2DeriveRound1Response = t.type({
|
|
65
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
66
|
+
bitgoMsg1: common_1.EddsaMPCv2SignedMessage,
|
|
67
|
+
});
|
|
68
|
+
exports.EddsaMPCv2DeriveRound2Request = t.type({
|
|
69
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
70
|
+
userMsg2: common_1.EddsaMPCv2SignedMessage,
|
|
71
|
+
backupMsg2: common_1.EddsaMPCv2SignedMessage,
|
|
72
|
+
});
|
|
73
|
+
exports.EddsaMPCv2DeriveRound2Response = t.type({
|
|
74
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
75
|
+
commonPublicKeychain: io_ts_types_1.NonEmptyString,
|
|
76
|
+
bitgoMsg2: common_1.EddsaMPCv2SignedMessage,
|
|
77
|
+
});
|
|
60
78
|
//# sourceMappingURL=deriveRound.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveRound.js","sourceRoot":"","sources":["../../../../../src/schema/mpcv2/derive/deriveRound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"deriveRound.js","sourceRoot":"","sources":["../../../../../src/schema/mpcv2/derive/deriveRound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA6C;AAC7C,sCAA2E;AAC3E,uDAAsE;AAMtE,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAC7B,CAAC,CAAC,MAAM,EACR,CAAC,KAAa,EAAoD,EAAE,CAClE,MAAM,CAAC,aAAa,CAAC,KAAK,CA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CAAuB;IACjC,UAAU,EAAE,gCAAuB;CACpC,CAAC,CAAC;AAMU,QAAA,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC;IACnD,SAAS,EAAE,4BAAc;IACzB,oBAAoB,EAAE,4BAAc;IACpC,SAAS,EAAE,gCAAuB;CACnC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { NonEmptyString } from "io-ts-types";
|
|
3
|
-
import { MPCv2BroadcastMessage } from "../common";
|
|
4
|
-
import {
|
|
3
|
+
import { MPCv2BroadcastMessage, EddsaMPCv2SignedMessage } from "../common";
|
|
4
|
+
import { EddsaMPCv2KeyGenRound1Request } from "../keyGen/keygenRound";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
interface DerivationIndexBrand {
|
|
7
|
+
readonly DerivationIndex: unique symbol;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const DerivationIndex = t.brand(
|
|
11
|
+
t.number,
|
|
12
|
+
(index: number): index is t.Branded<number, DerivationIndexBrand> =>
|
|
13
|
+
Number.isSafeInteger(index) && index >= 0,
|
|
14
|
+
"DerivationIndex",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const MPCv2DeriveRound1Request = t.type(
|
|
18
|
+
{
|
|
19
|
+
userGpgPublicKey: NonEmptyString,
|
|
20
|
+
userMsg1: MPCv2BroadcastMessage,
|
|
21
|
+
parentKeyId: NonEmptyString,
|
|
22
|
+
derivationIndex: DerivationIndex,
|
|
23
|
+
},
|
|
14
24
|
"MPCv2DeriveRound1Request",
|
|
15
25
|
);
|
|
16
26
|
|
|
@@ -20,8 +30,7 @@ export type MPCv2DeriveRound1Request = t.TypeOf<
|
|
|
20
30
|
|
|
21
31
|
export const MPCv2DeriveRound1Response = t.type({
|
|
22
32
|
sessionId: NonEmptyString,
|
|
23
|
-
|
|
24
|
-
bitgoBackupMsg1: MPCv2BroadcastMessage,
|
|
33
|
+
bitgoMsg1: MPCv2BroadcastMessage,
|
|
25
34
|
});
|
|
26
35
|
|
|
27
36
|
export type MPCv2DeriveRound1Response = t.TypeOf<
|
|
@@ -31,7 +40,6 @@ export type MPCv2DeriveRound1Response = t.TypeOf<
|
|
|
31
40
|
export const MPCv2DeriveRound2Request = t.type({
|
|
32
41
|
sessionId: NonEmptyString,
|
|
33
42
|
userMsg2: MPCv2BroadcastMessage,
|
|
34
|
-
backupMsg2: MPCv2BroadcastMessage,
|
|
35
43
|
});
|
|
36
44
|
|
|
37
45
|
export type MPCv2DeriveRound2Request = t.TypeOf<
|
|
@@ -40,8 +48,7 @@ export type MPCv2DeriveRound2Request = t.TypeOf<
|
|
|
40
48
|
|
|
41
49
|
export const MPCv2DeriveRound2Response = t.type({
|
|
42
50
|
sessionId: NonEmptyString,
|
|
43
|
-
|
|
44
|
-
bitgoBackupMsg2: MPCv2BroadcastMessage,
|
|
51
|
+
bitgoMsg2: MPCv2BroadcastMessage,
|
|
45
52
|
});
|
|
46
53
|
|
|
47
54
|
export type MPCv2DeriveRound2Response = t.TypeOf<
|
|
@@ -64,3 +71,47 @@ export const MPCv2DeriveRound3Response = t.type({
|
|
|
64
71
|
export type MPCv2DeriveRound3Response = t.TypeOf<
|
|
65
72
|
typeof MPCv2DeriveRound3Response
|
|
66
73
|
>;
|
|
74
|
+
|
|
75
|
+
export const EddsaMPCv2DeriveRound1Request = t.intersection(
|
|
76
|
+
[
|
|
77
|
+
EddsaMPCv2KeyGenRound1Request,
|
|
78
|
+
t.type({
|
|
79
|
+
parentKeyId: NonEmptyString,
|
|
80
|
+
derivationIndex: DerivationIndex,
|
|
81
|
+
}),
|
|
82
|
+
],
|
|
83
|
+
"EddsaMPCv2DeriveRound1Request",
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export type EddsaMPCv2DeriveRound1Request = t.TypeOf<
|
|
87
|
+
typeof EddsaMPCv2DeriveRound1Request
|
|
88
|
+
>;
|
|
89
|
+
|
|
90
|
+
export const EddsaMPCv2DeriveRound1Response = t.type({
|
|
91
|
+
sessionId: NonEmptyString,
|
|
92
|
+
bitgoMsg1: EddsaMPCv2SignedMessage,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export type EddsaMPCv2DeriveRound1Response = t.TypeOf<
|
|
96
|
+
typeof EddsaMPCv2DeriveRound1Response
|
|
97
|
+
>;
|
|
98
|
+
|
|
99
|
+
export const EddsaMPCv2DeriveRound2Request = t.type({
|
|
100
|
+
sessionId: NonEmptyString,
|
|
101
|
+
userMsg2: EddsaMPCv2SignedMessage,
|
|
102
|
+
backupMsg2: EddsaMPCv2SignedMessage,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export type EddsaMPCv2DeriveRound2Request = t.TypeOf<
|
|
106
|
+
typeof EddsaMPCv2DeriveRound2Request
|
|
107
|
+
>;
|
|
108
|
+
|
|
109
|
+
export const EddsaMPCv2DeriveRound2Response = t.type({
|
|
110
|
+
sessionId: NonEmptyString,
|
|
111
|
+
commonPublicKeychain: NonEmptyString,
|
|
112
|
+
bitgoMsg2: EddsaMPCv2SignedMessage,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
export type EddsaMPCv2DeriveRound2Response = t.TypeOf<
|
|
116
|
+
typeof EddsaMPCv2DeriveRound2Response
|
|
117
|
+
>;
|