@bitgo/public-types 6.86.0 → 6.88.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/mpcv2/keyGen/keygenRound.d.ts +49 -8
- package/dist/src/schema/mpcv2/keyGen/keygenRound.js +49 -26
- package/dist/src/schema/mpcv2/keyGen/keygenRound.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/icpPaymentIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/icpSignatures.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/mpcv2/keyGen/keygenRound.ts +76 -26
- package/src/schema/transactionRequest/intents/icpPaymentIntent.ts +11 -0
- package/src/schema/transactionRequest/intents/icpSignatures.ts +14 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
export declare const MPCv2KeyGenRound1Request: t.TypeC<{
|
|
2
|
+
export declare const MPCv2KeyGenRound1Request: t.IntersectionC<[t.TypeC<{
|
|
3
3
|
userGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
4
4
|
backupGpgPublicKey: import("io-ts-types").NonEmptyStringC;
|
|
5
5
|
userMsg1: t.TypeC<{
|
|
@@ -12,9 +12,20 @@ export declare const MPCv2KeyGenRound1Request: t.TypeC<{
|
|
|
12
12
|
message: t.StringC;
|
|
13
13
|
signature: t.StringC;
|
|
14
14
|
}>;
|
|
15
|
-
}
|
|
15
|
+
}>, t.PartialC<{
|
|
16
|
+
userVrfMsg1: t.TypeC<{
|
|
17
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
18
|
+
message: t.StringC;
|
|
19
|
+
signature: t.StringC;
|
|
20
|
+
}>;
|
|
21
|
+
backupVrfMsg1: t.TypeC<{
|
|
22
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
23
|
+
message: t.StringC;
|
|
24
|
+
signature: t.StringC;
|
|
25
|
+
}>;
|
|
26
|
+
}>]>;
|
|
16
27
|
export type MPCv2KeyGenRound1Request = t.TypeOf<typeof MPCv2KeyGenRound1Request>;
|
|
17
|
-
export declare const MPCv2KeyGenRound1Response: t.TypeC<{
|
|
28
|
+
export declare const MPCv2KeyGenRound1Response: t.IntersectionC<[t.TypeC<{
|
|
18
29
|
walletGpgPubKeySigs: import("io-ts-types").NonEmptyStringC;
|
|
19
30
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
20
31
|
bitgoMsg1: t.TypeC<{
|
|
@@ -34,9 +45,15 @@ export declare const MPCv2KeyGenRound1Response: t.TypeC<{
|
|
|
34
45
|
encryptedMessage: t.StringC;
|
|
35
46
|
signature: t.StringC;
|
|
36
47
|
}>;
|
|
37
|
-
}
|
|
48
|
+
}>, t.PartialC<{
|
|
49
|
+
bitgoVrfMsg1: t.TypeC<{
|
|
50
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
51
|
+
message: t.StringC;
|
|
52
|
+
signature: t.StringC;
|
|
53
|
+
}>;
|
|
54
|
+
}>]>;
|
|
38
55
|
export type MPCv2KeyGenRound1Response = t.TypeOf<typeof MPCv2KeyGenRound1Response>;
|
|
39
|
-
export declare const MPCv2KeyGenRound2Request: t.TypeC<{
|
|
56
|
+
export declare const MPCv2KeyGenRound2Request: t.IntersectionC<[t.TypeC<{
|
|
40
57
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
41
58
|
userMsg2: t.TypeC<{
|
|
42
59
|
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
@@ -52,9 +69,20 @@ export declare const MPCv2KeyGenRound2Request: t.TypeC<{
|
|
|
52
69
|
signature: t.StringC;
|
|
53
70
|
}>;
|
|
54
71
|
backupCommitment2: import("io-ts-types").NonEmptyStringC;
|
|
55
|
-
}
|
|
72
|
+
}>, t.PartialC<{
|
|
73
|
+
userVrfMsg2: t.TypeC<{
|
|
74
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
75
|
+
message: t.StringC;
|
|
76
|
+
signature: t.StringC;
|
|
77
|
+
}>;
|
|
78
|
+
backupVrfMsg2: t.TypeC<{
|
|
79
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
80
|
+
message: t.StringC;
|
|
81
|
+
signature: t.StringC;
|
|
82
|
+
}>;
|
|
83
|
+
}>]>;
|
|
56
84
|
export type MPCv2KeyGenRound2Request = t.TypeOf<typeof MPCv2KeyGenRound2Request>;
|
|
57
|
-
export declare const MPCv2KeyGenRound2Response: t.TypeC<{
|
|
85
|
+
export declare const MPCv2KeyGenRound2Response: t.IntersectionC<[t.TypeC<{
|
|
58
86
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
59
87
|
bitgoCommitment2: import("io-ts-types").NonEmptyStringC;
|
|
60
88
|
bitgoToUserMsg3: t.TypeC<{
|
|
@@ -69,7 +97,20 @@ export declare const MPCv2KeyGenRound2Response: t.TypeC<{
|
|
|
69
97
|
encryptedMessage: t.StringC;
|
|
70
98
|
signature: t.StringC;
|
|
71
99
|
}>;
|
|
72
|
-
}
|
|
100
|
+
}>, t.PartialC<{
|
|
101
|
+
bitgoVrfMsgToUser: t.TypeC<{
|
|
102
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
103
|
+
to: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
104
|
+
encryptedMessage: t.StringC;
|
|
105
|
+
signature: t.StringC;
|
|
106
|
+
}>;
|
|
107
|
+
bitgoVrfMsgToBackup: t.TypeC<{
|
|
108
|
+
from: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
109
|
+
to: t.UnionC<[t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>, t.Type<0 | 2 | 1, string, unknown>]>;
|
|
110
|
+
encryptedMessage: t.StringC;
|
|
111
|
+
signature: t.StringC;
|
|
112
|
+
}>;
|
|
113
|
+
}>]>;
|
|
73
114
|
export type MPCv2KeyGenRound2Response = t.TypeOf<typeof MPCv2KeyGenRound2Response>;
|
|
74
115
|
export declare const MPCv2KeyGenRound3Request: t.TypeC<{
|
|
75
116
|
sessionId: import("io-ts-types").NonEmptyStringC;
|
|
@@ -27,32 +27,55 @@ exports.RedpallasMPCv2KeyGenRound2Response = exports.RedpallasMPCv2KeyGenRound2R
|
|
|
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
|
-
exports.MPCv2KeyGenRound1Request = t.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
30
|
+
exports.MPCv2KeyGenRound1Request = t.intersection([
|
|
31
|
+
t.type({
|
|
32
|
+
userGpgPublicKey: io_ts_types_1.NonEmptyString,
|
|
33
|
+
backupGpgPublicKey: io_ts_types_1.NonEmptyString,
|
|
34
|
+
userMsg1: common_1.MPCv2BroadcastMessage,
|
|
35
|
+
backupMsg1: common_1.MPCv2BroadcastMessage,
|
|
36
|
+
}),
|
|
37
|
+
t.partial({
|
|
38
|
+
userVrfMsg1: common_1.MPCv2BroadcastMessage,
|
|
39
|
+
backupVrfMsg1: common_1.MPCv2BroadcastMessage,
|
|
40
|
+
}),
|
|
41
|
+
], "MPCv2KeyGenRound1Request");
|
|
42
|
+
exports.MPCv2KeyGenRound1Response = t.intersection([
|
|
43
|
+
t.type({
|
|
44
|
+
walletGpgPubKeySigs: io_ts_types_1.NonEmptyString,
|
|
45
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
46
|
+
bitgoMsg1: common_1.MPCv2BroadcastMessage,
|
|
47
|
+
bitgoToUserMsg2: common_1.MPCv2P2PMessage,
|
|
48
|
+
bitgoToBackupMsg2: common_1.MPCv2P2PMessage,
|
|
49
|
+
}),
|
|
50
|
+
t.partial({
|
|
51
|
+
bitgoVrfMsg1: common_1.MPCv2BroadcastMessage,
|
|
52
|
+
}),
|
|
53
|
+
], "MPCv2KeyGenRound1Response");
|
|
54
|
+
exports.MPCv2KeyGenRound2Request = t.intersection([
|
|
55
|
+
t.type({
|
|
56
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
57
|
+
userMsg2: common_1.MPCv2P2PMessage,
|
|
58
|
+
userCommitment2: io_ts_types_1.NonEmptyString,
|
|
59
|
+
backupMsg2: common_1.MPCv2P2PMessage,
|
|
60
|
+
backupCommitment2: io_ts_types_1.NonEmptyString,
|
|
61
|
+
}),
|
|
62
|
+
t.partial({
|
|
63
|
+
userVrfMsg2: common_1.MPCv2BroadcastMessage,
|
|
64
|
+
backupVrfMsg2: common_1.MPCv2BroadcastMessage,
|
|
65
|
+
}),
|
|
66
|
+
], "MPCv2KeyGenRound2Request");
|
|
67
|
+
exports.MPCv2KeyGenRound2Response = t.intersection([
|
|
68
|
+
t.type({
|
|
69
|
+
sessionId: io_ts_types_1.NonEmptyString,
|
|
70
|
+
bitgoCommitment2: io_ts_types_1.NonEmptyString,
|
|
71
|
+
bitgoToUserMsg3: common_1.MPCv2P2PMessage,
|
|
72
|
+
bitgoToBackupMsg3: common_1.MPCv2P2PMessage,
|
|
73
|
+
}),
|
|
74
|
+
t.partial({
|
|
75
|
+
bitgoVrfMsgToUser: common_1.MPCv2P2PMessage,
|
|
76
|
+
bitgoVrfMsgToBackup: common_1.MPCv2P2PMessage,
|
|
77
|
+
}),
|
|
78
|
+
], "MPCv2KeyGenRound2Response");
|
|
56
79
|
exports.MPCv2KeyGenRound3Request = t.type({
|
|
57
80
|
sessionId: io_ts_types_1.NonEmptyString,
|
|
58
81
|
userMsg3: common_1.MPCv2P2PMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keygenRound.js","sourceRoot":"","sources":["../../../../../src/schema/mpcv2/keyGen/keygenRound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA6C;AAC7C,sCAImB;
|
|
1
|
+
{"version":3,"file":"keygenRound.js","sourceRoot":"","sources":["../../../../../src/schema/mpcv2/keyGen/keygenRound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA6C;AAC7C,sCAImB;AAYN,QAAA,wBAAwB,GAAG,CAAC,CAAC,YAAY,CACpD;IACE,CAAC,CAAC,IAAI,CAAC;QACL,gBAAgB,EAAE,4BAAc;QAChC,kBAAkB,EAAE,4BAAc;QAClC,QAAQ,EAAE,8BAAqB;QAC/B,UAAU,EAAE,8BAAqB;KAClC,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,WAAW,EAAE,8BAAqB;QAClC,aAAa,EAAE,8BAAqB;KACrC,CAAC;CACH,EACD,0BAA0B,CAC3B,CAAC;AAMW,QAAA,yBAAyB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CACjC,CAAC;AAOW,QAAA,iCAAiC,GAAG,CAAC,CAAC,IAAI,CAAC;IACtD,gBAAgB,EAAE,4BAAc;IAChC,kBAAkB,EAAE,4BAAc;IAClC,QAAQ,EAAE,gCAAuB;IACjC,UAAU,EAAE,gCAAuB;CACpC,CAAC,CAAC;AAKU,QAAA,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC;IACvD,SAAS,EAAE,4BAAc;IACzB,SAAS,EAAE,gCAAuB;CACnC,CAAC,CAAC;AAKU,QAAA,iCAAiC,GAAG,CAAC,CAAC,IAAI,CAAC;IACtD,SAAS,EAAE,4BAAc;IACzB,QAAQ,EAAE,gCAAuB;IACjC,UAAU,EAAE,gCAAuB;CACpC,CAAC,CAAC;AAKU,QAAA,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC;IACvD,SAAS,EAAE,4BAAc;IACzB,oBAAoB,EAAE,4BAAc;IACpC,SAAS,EAAE,gCAAuB;CACnC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icpPaymentIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/icpPaymentIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,mDAAgD;AAChD,0CAAgD;
|
|
1
|
+
{"version":3,"file":"icpPaymentIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/icpPaymentIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,mDAAgD;AAChD,0CAAgD;AAUnC,QAAA,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,6BAAa;IACb,CAAC,CAAC,OAAO,CAAC;QAOR,IAAI,EAAE,sBAAc;KACrB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icpSignatures.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/icpSignatures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,MAAM,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"icpSignatures.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/icpSignatures.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,MAAM,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;AAKU,QAAA,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC;IAEtC,kBAAkB,EAAE,oBAAoB;IAExC,SAAS,EAAE,CAAC,CAAC,MAAM;IAEnB,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,CAAC,OAAO,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM;CACrB,CAAC,CAAC;AAMU,QAAA,UAAU,GAAG,CAAC,CAAC,OAAO,CAAC;IAElC,eAAe,EAAE,sBAAc;IAE/B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IAElC,UAAU,EAAE,YAAY;IAExB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,47 +6,97 @@ import {
|
|
|
6
6
|
EddsaMPCv2SignedMessage,
|
|
7
7
|
} from "../common";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
// DKLS MPCv2 (3-round) keygen codecs
|
|
10
|
+
//
|
|
11
|
+
// Safe roots also run a VRF DKG over keygen rounds 1 and 2. Every VRF field is optional and additive:
|
|
12
|
+
// ordinary keygen omits them and is unchanged. The HSM keys VRF mode off the presence of the VRF
|
|
13
|
+
// messages, and requires them all-or-none per round (R1: userVrfMsg1 + backupVrfMsg1; R2: userVrfMsg2 +
|
|
14
|
+
// backupVrfMsg2), so the HSM, not these codecs, enforces the grouping. The HSM's opaque VRF state is not
|
|
15
|
+
// part of these client contracts: the server keeps it between rounds, like the signing-DKG state. Round 3
|
|
16
|
+
// carries no VRF message; the finished VRF share rides inside the HSM's keygen state.
|
|
17
|
+
// Client messages are signed by the sending party's GPG key, like userMsg1/userMsg2.
|
|
18
|
+
|
|
19
|
+
export const MPCv2KeyGenRound1Request = t.intersection(
|
|
20
|
+
[
|
|
21
|
+
t.type({
|
|
22
|
+
userGpgPublicKey: NonEmptyString,
|
|
23
|
+
backupGpgPublicKey: NonEmptyString,
|
|
24
|
+
userMsg1: MPCv2BroadcastMessage,
|
|
25
|
+
backupMsg1: MPCv2BroadcastMessage,
|
|
26
|
+
}),
|
|
27
|
+
t.partial({
|
|
28
|
+
userVrfMsg1: MPCv2BroadcastMessage,
|
|
29
|
+
backupVrfMsg1: MPCv2BroadcastMessage,
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
"MPCv2KeyGenRound1Request",
|
|
33
|
+
);
|
|
15
34
|
|
|
16
35
|
export type MPCv2KeyGenRound1Request = t.TypeOf<
|
|
17
36
|
typeof MPCv2KeyGenRound1Request
|
|
18
37
|
>;
|
|
19
38
|
|
|
20
|
-
export const MPCv2KeyGenRound1Response = t.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
export const MPCv2KeyGenRound1Response = t.intersection(
|
|
40
|
+
[
|
|
41
|
+
t.type({
|
|
42
|
+
walletGpgPubKeySigs: NonEmptyString,
|
|
43
|
+
sessionId: NonEmptyString,
|
|
44
|
+
bitgoMsg1: MPCv2BroadcastMessage,
|
|
45
|
+
bitgoToUserMsg2: MPCv2P2PMessage,
|
|
46
|
+
bitgoToBackupMsg2: MPCv2P2PMessage,
|
|
47
|
+
}),
|
|
48
|
+
t.partial({
|
|
49
|
+
bitgoVrfMsg1: MPCv2BroadcastMessage,
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
"MPCv2KeyGenRound1Response",
|
|
53
|
+
);
|
|
27
54
|
|
|
28
55
|
export type MPCv2KeyGenRound1Response = t.TypeOf<
|
|
29
56
|
typeof MPCv2KeyGenRound1Response
|
|
30
57
|
>;
|
|
31
58
|
|
|
32
|
-
export const MPCv2KeyGenRound2Request = t.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
59
|
+
export const MPCv2KeyGenRound2Request = t.intersection(
|
|
60
|
+
[
|
|
61
|
+
t.type({
|
|
62
|
+
sessionId: NonEmptyString,
|
|
63
|
+
userMsg2: MPCv2P2PMessage,
|
|
64
|
+
userCommitment2: NonEmptyString,
|
|
65
|
+
backupMsg2: MPCv2P2PMessage,
|
|
66
|
+
backupCommitment2: NonEmptyString,
|
|
67
|
+
}),
|
|
68
|
+
t.partial({
|
|
69
|
+
userVrfMsg2: MPCv2BroadcastMessage,
|
|
70
|
+
backupVrfMsg2: MPCv2BroadcastMessage,
|
|
71
|
+
}),
|
|
72
|
+
],
|
|
73
|
+
"MPCv2KeyGenRound2Request",
|
|
74
|
+
);
|
|
39
75
|
|
|
40
76
|
export type MPCv2KeyGenRound2Request = t.TypeOf<
|
|
41
77
|
typeof MPCv2KeyGenRound2Request
|
|
42
78
|
>;
|
|
43
79
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
80
|
+
/**
|
|
81
|
+
* `bitgoVrfMsgToUser` / `bitgoVrfMsgToBackup` are BitGo's VRF openings, each PGP-encrypted to the
|
|
82
|
+
* recipient party's GPG key (`encryptedMessage` is the armored ciphertext) with BitGo's signature over
|
|
83
|
+
* the plaintext. Intermediaries must relay them unread.
|
|
84
|
+
*/
|
|
85
|
+
export const MPCv2KeyGenRound2Response = t.intersection(
|
|
86
|
+
[
|
|
87
|
+
t.type({
|
|
88
|
+
sessionId: NonEmptyString,
|
|
89
|
+
bitgoCommitment2: NonEmptyString,
|
|
90
|
+
bitgoToUserMsg3: MPCv2P2PMessage,
|
|
91
|
+
bitgoToBackupMsg3: MPCv2P2PMessage,
|
|
92
|
+
}),
|
|
93
|
+
t.partial({
|
|
94
|
+
bitgoVrfMsgToUser: MPCv2P2PMessage,
|
|
95
|
+
bitgoVrfMsgToBackup: MPCv2P2PMessage,
|
|
96
|
+
}),
|
|
97
|
+
],
|
|
98
|
+
"MPCv2KeyGenRound2Response",
|
|
99
|
+
);
|
|
50
100
|
|
|
51
101
|
export type MPCv2KeyGenRound2Response = t.TypeOf<
|
|
52
102
|
typeof MPCv2KeyGenRound2Response
|
|
@@ -3,11 +3,22 @@ import { PaymentIntent } from "./paymentIntent";
|
|
|
3
3
|
import { optionalString } from "../../../utils";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Transfer ICP tokens to a single recipient on the Internet Computer network.
|
|
7
|
+
* The wallet's root account identifier is the sender. Supports an optional
|
|
8
|
+
* numeric memo for sub-address routing (e.g. exchange deposit tags). Only one
|
|
9
|
+
* recipient is supported per transaction.
|
|
10
|
+
*
|
|
6
11
|
* @title ICP Payment Intent
|
|
7
12
|
*/
|
|
8
13
|
export const IcpPaymentIntent = t.intersection([
|
|
9
14
|
PaymentIntent,
|
|
10
15
|
t.partial({
|
|
16
|
+
/**
|
|
17
|
+
* Numeric sub-address memo encoded as a string (e.g. "42"). Used to
|
|
18
|
+
* distinguish deposits to the same root account identifier, similar to
|
|
19
|
+
* exchange deposit tags. Must parse as a non-negative integer —
|
|
20
|
+
* non-numeric strings are rejected at transaction build time.
|
|
21
|
+
*/
|
|
11
22
|
memo: optionalString,
|
|
12
23
|
}),
|
|
13
24
|
]);
|
|
@@ -4,9 +4,15 @@ const IcpAccountIdentifier = t.partial({
|
|
|
4
4
|
address: t.string,
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The payload submitted for signing in the ICP transaction flow.
|
|
9
|
+
*/
|
|
7
10
|
export const SigningPayload = t.partial({
|
|
11
|
+
/** Account identifier of the signing account. */
|
|
8
12
|
account_identifier: IcpAccountIdentifier,
|
|
13
|
+
/** Raw hex bytes of the payload. */
|
|
9
14
|
hex_bytes: t.string,
|
|
15
|
+
/** Signature scheme used to sign the payload. Always "ecdsa". */
|
|
10
16
|
signature_type: t.literal("ecdsa"),
|
|
11
17
|
});
|
|
12
18
|
|
|
@@ -15,10 +21,18 @@ const IcpPublicKey = t.partial({
|
|
|
15
21
|
curve_type: t.string,
|
|
16
22
|
});
|
|
17
23
|
|
|
24
|
+
/**
|
|
25
|
+
* ECDSA signature produced by the ICP signing flow. Contains the raw hex
|
|
26
|
+
* bytes, the public key of the signer, and the payload that was signed.
|
|
27
|
+
*/
|
|
18
28
|
export const Signatures = t.partial({
|
|
29
|
+
/** The payload that was signed. */
|
|
19
30
|
signing_payload: SigningPayload,
|
|
31
|
+
/** Signature scheme used. Always "ecdsa". */
|
|
20
32
|
signature_type: t.literal("ecdsa"),
|
|
33
|
+
/** Public key of the signer. */
|
|
21
34
|
public_key: IcpPublicKey,
|
|
35
|
+
/** Raw hex bytes of the signature. */
|
|
22
36
|
hex_bytes: t.string,
|
|
23
37
|
});
|
|
24
38
|
|