@bitgo/public-types 2.32.1 → 2.33.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/index.d.ts +1 -0
- package/dist/src/schema/mpcv2/index.js +1 -0
- package/dist/src/schema/mpcv2/index.js.map +1 -1
- package/dist/src/schema/mpcv2/smc/index.d.ts +3 -0
- package/dist/src/schema/mpcv2/smc/index.js +20 -0
- package/dist/src/schema/mpcv2/smc/index.js.map +1 -0
- package/dist/src/schema/mpcv2/smc/keygenRound.d.ts +1440 -0
- package/dist/src/schema/mpcv2/smc/keygenRound.js +234 -0
- package/dist/src/schema/mpcv2/smc/keygenRound.js.map +1 -0
- package/dist/src/schema/mpcv2/smc/keygenState.d.ts +18 -0
- package/dist/src/schema/mpcv2/smc/keygenState.js +59 -0
- package/dist/src/schema/mpcv2/smc/keygenState.js.map +1 -0
- package/dist/src/schema/mpcv2/smc/messages/broadcast.d.ts +11 -0
- package/dist/src/schema/mpcv2/smc/messages/broadcast.js +42 -0
- package/dist/src/schema/mpcv2/smc/messages/broadcast.js.map +1 -0
- package/dist/src/schema/mpcv2/smc/messages/p2p.d.ts +12 -0
- package/dist/src/schema/mpcv2/smc/messages/p2p.js +44 -0
- package/dist/src/schema/mpcv2/smc/messages/p2p.js.map +1 -0
- package/dist/src/schema/mpcv2/smc/walletType.d.ts +8 -0
- package/dist/src/schema/mpcv2/smc/walletType.js +35 -0
- package/dist/src/schema/mpcv2/smc/walletType.js.map +1 -0
- package/dist/src/schema/webhook/addWalletWebhookRequest.d.ts +2 -30
- package/dist/src/schema/webhook/enterpriseWebhooks.d.ts +3 -29
- package/dist/src/schema/webhook/webhook.d.ts +1 -21
- package/dist/src/schema/webhook/webhookNotification.d.ts +1 -21
- package/dist/src/schema/webhook/webhookType.d.ts +43 -40
- package/dist/src/schema/webhook/webhookType.js +47 -41
- package/dist/src/schema/webhook/webhookType.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/mpcv2/index.ts +1 -0
- package/src/schema/mpcv2/smc/index.ts +3 -0
- package/src/schema/mpcv2/smc/keygenRound.ts +260 -0
- package/src/schema/mpcv2/smc/keygenState.ts +35 -0
- package/src/schema/mpcv2/smc/messages/broadcast.ts +22 -0
- package/src/schema/mpcv2/smc/messages/p2p.ts +24 -0
- package/src/schema/mpcv2/smc/walletType.ts +11 -0
- package/src/schema/webhook/webhookType.ts +50 -49
@@ -1,44 +1,47 @@
|
|
1
1
|
import * as t from "io-ts";
|
2
|
-
export declare
|
3
|
-
txRequest
|
4
|
-
txRequestTransaction
|
5
|
-
transfer
|
6
|
-
transaction
|
7
|
-
transactionRemoved
|
8
|
-
transactionExpire
|
9
|
-
pendingapproval
|
10
|
-
block
|
11
|
-
admin
|
12
|
-
address_confirmation
|
13
|
-
lowFee
|
14
|
-
circuitBreaker
|
15
|
-
wallet_confirmation
|
16
|
-
wireWithdrawal
|
17
|
-
bankAccount
|
18
|
-
userKycState
|
19
|
-
enterpriseKycState
|
20
|
-
identityStatus
|
21
|
-
accessToken
|
22
|
-
}
|
2
|
+
export declare enum WebhookTypeEnum {
|
3
|
+
"txRequest" = "txRequest",
|
4
|
+
"txRequestTransaction" = "txRequestTransaction",
|
5
|
+
"transfer" = "transfer",
|
6
|
+
"transaction" = "transaction",
|
7
|
+
"transactionRemoved" = "transactionRemoved",
|
8
|
+
"transactionExpire" = "transactionExpire",
|
9
|
+
"pendingapproval" = "pendingapproval",
|
10
|
+
"block" = "block",
|
11
|
+
"admin" = "admin",
|
12
|
+
"address_confirmation" = "address_confirmation",
|
13
|
+
"lowFee" = "lowFee",
|
14
|
+
"circuitBreaker" = "circuitBreaker",
|
15
|
+
"wallet_confirmation" = "wallet_confirmation",
|
16
|
+
"wireWithdrawal" = "wireWithdrawal",
|
17
|
+
"bankAccount" = "bankAccount",
|
18
|
+
"userKycState" = "userKycState",
|
19
|
+
"enterpriseKycState" = "enterpriseKycState",
|
20
|
+
"identityStatus" = "identityStatus",
|
21
|
+
"accessToken" = "accessToken"
|
22
|
+
}
|
23
|
+
export declare const WebhookType: t.KeyofC<typeof WebhookTypeEnum>;
|
23
24
|
export type WebhookType = t.TypeOf<typeof WebhookType>;
|
24
|
-
export declare
|
25
|
-
txRequest
|
26
|
-
txRequestTransaction
|
27
|
-
transfer
|
28
|
-
transaction
|
29
|
-
transactionRemoved
|
30
|
-
transactionExpire
|
31
|
-
pendingapproval
|
32
|
-
block
|
33
|
-
admin
|
34
|
-
address_confirmation
|
35
|
-
lowFee
|
36
|
-
circuitBreaker
|
37
|
-
wireWithdrawal
|
38
|
-
}
|
25
|
+
export declare enum WalletWebhookTypeEnum {
|
26
|
+
"txRequest" = "txRequest",
|
27
|
+
"txRequestTransaction" = "txRequestTransaction",
|
28
|
+
"transfer" = "transfer",
|
29
|
+
"transaction" = "transaction",
|
30
|
+
"transactionRemoved" = "transactionRemoved",
|
31
|
+
"transactionExpire" = "transactionExpire",
|
32
|
+
"pendingapproval" = "pendingapproval",
|
33
|
+
"block" = "block",
|
34
|
+
"admin" = "admin",
|
35
|
+
"address_confirmation" = "address_confirmation",
|
36
|
+
"lowFee" = "lowFee",
|
37
|
+
"circuitBreaker" = "circuitBreaker",
|
38
|
+
"wireWithdrawal" = "wireWithdrawal"
|
39
|
+
}
|
40
|
+
export declare const WalletWebhookType: t.KeyofC<typeof WalletWebhookTypeEnum>;
|
39
41
|
export type WalletWebhookType = t.TypeOf<typeof WalletWebhookType>;
|
40
|
-
export declare
|
41
|
-
bankAccount
|
42
|
-
accessToken
|
43
|
-
}
|
42
|
+
export declare enum EnterpriseWebhookTypeEnum {
|
43
|
+
"bankAccount" = "bankAccount",
|
44
|
+
"accessToken" = "accessToken"
|
45
|
+
}
|
46
|
+
export declare const EnterpriseWebhookType: t.KeyofC<typeof EnterpriseWebhookTypeEnum>;
|
44
47
|
export type EnterpriseWebhookType = t.TypeOf<typeof EnterpriseWebhookType>;
|
@@ -23,46 +23,52 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.EnterpriseWebhookType = exports.WalletWebhookType = exports.WebhookType = void 0;
|
26
|
+
exports.EnterpriseWebhookType = exports.EnterpriseWebhookTypeEnum = exports.WalletWebhookType = exports.WalletWebhookTypeEnum = exports.WebhookType = exports.WebhookTypeEnum = void 0;
|
27
27
|
const t = __importStar(require("io-ts"));
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
exports.
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
28
|
+
var WebhookTypeEnum;
|
29
|
+
(function (WebhookTypeEnum) {
|
30
|
+
WebhookTypeEnum["txRequest"] = "txRequest";
|
31
|
+
WebhookTypeEnum["txRequestTransaction"] = "txRequestTransaction";
|
32
|
+
WebhookTypeEnum["transfer"] = "transfer";
|
33
|
+
WebhookTypeEnum["transaction"] = "transaction";
|
34
|
+
WebhookTypeEnum["transactionRemoved"] = "transactionRemoved";
|
35
|
+
WebhookTypeEnum["transactionExpire"] = "transactionExpire";
|
36
|
+
WebhookTypeEnum["pendingapproval"] = "pendingapproval";
|
37
|
+
WebhookTypeEnum["block"] = "block";
|
38
|
+
WebhookTypeEnum["admin"] = "admin";
|
39
|
+
WebhookTypeEnum["address_confirmation"] = "address_confirmation";
|
40
|
+
WebhookTypeEnum["lowFee"] = "lowFee";
|
41
|
+
WebhookTypeEnum["circuitBreaker"] = "circuitBreaker";
|
42
|
+
WebhookTypeEnum["wallet_confirmation"] = "wallet_confirmation";
|
43
|
+
WebhookTypeEnum["wireWithdrawal"] = "wireWithdrawal";
|
44
|
+
WebhookTypeEnum["bankAccount"] = "bankAccount";
|
45
|
+
WebhookTypeEnum["userKycState"] = "userKycState";
|
46
|
+
WebhookTypeEnum["enterpriseKycState"] = "enterpriseKycState";
|
47
|
+
WebhookTypeEnum["identityStatus"] = "identityStatus";
|
48
|
+
WebhookTypeEnum["accessToken"] = "accessToken";
|
49
|
+
})(WebhookTypeEnum || (exports.WebhookTypeEnum = WebhookTypeEnum = {}));
|
50
|
+
exports.WebhookType = t.keyof(WebhookTypeEnum, "WebhookType");
|
51
|
+
var WalletWebhookTypeEnum;
|
52
|
+
(function (WalletWebhookTypeEnum) {
|
53
|
+
WalletWebhookTypeEnum["txRequest"] = "txRequest";
|
54
|
+
WalletWebhookTypeEnum["txRequestTransaction"] = "txRequestTransaction";
|
55
|
+
WalletWebhookTypeEnum["transfer"] = "transfer";
|
56
|
+
WalletWebhookTypeEnum["transaction"] = "transaction";
|
57
|
+
WalletWebhookTypeEnum["transactionRemoved"] = "transactionRemoved";
|
58
|
+
WalletWebhookTypeEnum["transactionExpire"] = "transactionExpire";
|
59
|
+
WalletWebhookTypeEnum["pendingapproval"] = "pendingapproval";
|
60
|
+
WalletWebhookTypeEnum["block"] = "block";
|
61
|
+
WalletWebhookTypeEnum["admin"] = "admin";
|
62
|
+
WalletWebhookTypeEnum["address_confirmation"] = "address_confirmation";
|
63
|
+
WalletWebhookTypeEnum["lowFee"] = "lowFee";
|
64
|
+
WalletWebhookTypeEnum["circuitBreaker"] = "circuitBreaker";
|
65
|
+
WalletWebhookTypeEnum["wireWithdrawal"] = "wireWithdrawal";
|
66
|
+
})(WalletWebhookTypeEnum || (exports.WalletWebhookTypeEnum = WalletWebhookTypeEnum = {}));
|
67
|
+
exports.WalletWebhookType = t.keyof(WalletWebhookTypeEnum, "WalletWebhookType");
|
68
|
+
var EnterpriseWebhookTypeEnum;
|
69
|
+
(function (EnterpriseWebhookTypeEnum) {
|
70
|
+
EnterpriseWebhookTypeEnum["bankAccount"] = "bankAccount";
|
71
|
+
EnterpriseWebhookTypeEnum["accessToken"] = "accessToken";
|
72
|
+
})(EnterpriseWebhookTypeEnum || (exports.EnterpriseWebhookTypeEnum = EnterpriseWebhookTypeEnum = {}));
|
73
|
+
exports.EnterpriseWebhookType = t.keyof(EnterpriseWebhookTypeEnum, "EnterpriseWebhookType");
|
68
74
|
//# sourceMappingURL=webhookType.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"webhookType.js","sourceRoot":"","sources":["../../../../src/schema/webhook/webhookType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;
|
1
|
+
{"version":3,"file":"webhookType.js","sourceRoot":"","sources":["../../../../src/schema/webhook/webhookType.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,IAAY,eA0BX;AA1BD,WAAY,eAAe;IAEzB,0CAAyB,CAAA;IAEzB,gEAA+C,CAAA;IAC/C,wCAAuB,CAAA;IACvB,8CAA6B,CAAA;IAC7B,4DAA2C,CAAA;IAC3C,0DAAyC,CAAA;IACzC,sDAAqC,CAAA;IACrC,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,gEAA+C,CAAA;IAC/C,oCAAmB,CAAA;IACnB,oDAAmC,CAAA;IAGnC,8DAA6C,CAAA;IAE7C,oDAAmC,CAAA;IACnC,8CAA6B,CAAA;IAC7B,gDAA+B,CAAA;IAC/B,4DAA2C,CAAA;IAC3C,oDAAmC,CAAA;IAEnC,8CAA6B,CAAA;AAC/B,CAAC,EA1BW,eAAe,+BAAf,eAAe,QA0B1B;AAEY,QAAA,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAGnE,IAAY,qBAcX;AAdD,WAAY,qBAAqB;IAC/B,gDAAyB,CAAA;IACzB,sEAA+C,CAAA;IAC/C,8CAAuB,CAAA;IACvB,oDAA6B,CAAA;IAC7B,kEAA2C,CAAA;IAC3C,gEAAyC,CAAA;IACzC,4DAAqC,CAAA;IACrC,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,sEAA+C,CAAA;IAC/C,0CAAmB,CAAA;IACnB,0DAAmC,CAAA;IACnC,0DAAmC,CAAA;AACrC,CAAC,EAdW,qBAAqB,qCAArB,qBAAqB,QAchC;AAEY,QAAA,iBAAiB,GAAG,CAAC,CAAC,KAAK,CACtC,qBAAqB,EACrB,mBAAmB,CACpB,CAAC;AAGF,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,wDAA6B,CAAA;IAC7B,wDAA6B,CAAA;AAC/B,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC;AACY,QAAA,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAC1C,yBAAyB,EACzB,uBAAuB,CACxB,CAAC"}
|
package/package.json
CHANGED
@@ -0,0 +1,260 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { NonEmptyString } from "io-ts-types";
|
3
|
+
|
4
|
+
import { KeyCreationMPCv2State } from "./keygenState";
|
5
|
+
import { WalletType } from "./walletType";
|
6
|
+
import { AuthBroadcastMessage } from "./messages/broadcast";
|
7
|
+
import { AuthEncP2PMessage } from "./messages/p2p";
|
8
|
+
|
9
|
+
export enum OVCIndexEnum {
|
10
|
+
ONE = 1,
|
11
|
+
TWO = 2,
|
12
|
+
}
|
13
|
+
|
14
|
+
const BaseRoundPayload = t.type({
|
15
|
+
tssVersion: NonEmptyString,
|
16
|
+
walletType: WalletType,
|
17
|
+
coin: NonEmptyString,
|
18
|
+
state: KeyCreationMPCv2State,
|
19
|
+
});
|
20
|
+
|
21
|
+
type BaseRoundPayload = t.TypeOf<typeof BaseRoundPayload>;
|
22
|
+
|
23
|
+
export const OVC1ToOVC2Round1Payload = t.intersection([
|
24
|
+
BaseRoundPayload,
|
25
|
+
t.type({
|
26
|
+
ovc: t.type({
|
27
|
+
[OVCIndexEnum.ONE]: t.type({
|
28
|
+
gpgPubKey: NonEmptyString,
|
29
|
+
ovcMsg1: AuthBroadcastMessage,
|
30
|
+
}),
|
31
|
+
}),
|
32
|
+
}),
|
33
|
+
]);
|
34
|
+
|
35
|
+
export type OVC1ToOVC2Round1Payload = t.TypeOf<typeof OVC1ToOVC2Round1Payload>;
|
36
|
+
|
37
|
+
export const OVC2ToBitgoRound1Payload = t.intersection([
|
38
|
+
BaseRoundPayload,
|
39
|
+
t.type({
|
40
|
+
ovc: t.type({
|
41
|
+
[OVCIndexEnum.ONE]: t.type({
|
42
|
+
gpgPubKey: NonEmptyString,
|
43
|
+
ovcMsg1: AuthBroadcastMessage,
|
44
|
+
}),
|
45
|
+
[OVCIndexEnum.TWO]: t.type({
|
46
|
+
gpgPubKey: NonEmptyString,
|
47
|
+
ovcMsg1: AuthBroadcastMessage,
|
48
|
+
}),
|
49
|
+
}),
|
50
|
+
}),
|
51
|
+
]);
|
52
|
+
|
53
|
+
export type OVC2ToBitgoRound1Payload = t.TypeOf<
|
54
|
+
typeof OVC2ToBitgoRound1Payload
|
55
|
+
>;
|
56
|
+
|
57
|
+
export const PlatformRound1Payload = t.type({
|
58
|
+
walletGpgPubKeySigs: NonEmptyString,
|
59
|
+
sessionId: NonEmptyString,
|
60
|
+
bitgoMsg1: AuthBroadcastMessage,
|
61
|
+
ovc: t.type({
|
62
|
+
[OVCIndexEnum.ONE]: t.type({
|
63
|
+
bitgoToOvcMsg2: AuthEncP2PMessage,
|
64
|
+
}),
|
65
|
+
[OVCIndexEnum.TWO]: t.type({
|
66
|
+
bitgoToOvcMsg2: AuthEncP2PMessage,
|
67
|
+
}),
|
68
|
+
}),
|
69
|
+
});
|
70
|
+
|
71
|
+
export type PlatformRound1Payload = t.TypeOf<typeof PlatformRound1Payload>;
|
72
|
+
|
73
|
+
export const BitgoToOVC1Round1Response = t.type({
|
74
|
+
wallet: t.intersection([
|
75
|
+
OVC2ToBitgoRound1Payload,
|
76
|
+
t.type({ platform: PlatformRound1Payload }),
|
77
|
+
]),
|
78
|
+
});
|
79
|
+
|
80
|
+
export type BitgoToOVC1Round1Response = t.TypeOf<
|
81
|
+
typeof BitgoToOVC1Round1Response
|
82
|
+
>;
|
83
|
+
|
84
|
+
export const OVC1ToOVC2Round2Payload = t.intersection([
|
85
|
+
BaseRoundPayload,
|
86
|
+
t.type({
|
87
|
+
ovc: t.type({
|
88
|
+
[OVCIndexEnum.ONE]: t.type({
|
89
|
+
gpgPubKey: NonEmptyString,
|
90
|
+
ovcMsg1: AuthBroadcastMessage,
|
91
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
92
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
93
|
+
}),
|
94
|
+
[OVCIndexEnum.TWO]: t.type({
|
95
|
+
gpgPubKey: NonEmptyString,
|
96
|
+
ovcMsg1: AuthBroadcastMessage,
|
97
|
+
}),
|
98
|
+
}),
|
99
|
+
}),
|
100
|
+
]);
|
101
|
+
|
102
|
+
export type OVC1ToOVC2Round2Payload = t.TypeOf<typeof OVC1ToOVC2Round2Payload>;
|
103
|
+
|
104
|
+
export const OVC2ToBitgoRound2Payload = t.intersection([
|
105
|
+
BaseRoundPayload,
|
106
|
+
t.type({
|
107
|
+
ovc: t.type({
|
108
|
+
[OVCIndexEnum.ONE]: t.type({
|
109
|
+
gpgPubKey: NonEmptyString,
|
110
|
+
ovcMsg1: AuthBroadcastMessage,
|
111
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
112
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
113
|
+
}),
|
114
|
+
[OVCIndexEnum.TWO]: t.type({
|
115
|
+
gpgPubKey: NonEmptyString,
|
116
|
+
ovcMsg1: AuthBroadcastMessage,
|
117
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
118
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
119
|
+
}),
|
120
|
+
}),
|
121
|
+
platform: PlatformRound1Payload,
|
122
|
+
}),
|
123
|
+
]);
|
124
|
+
|
125
|
+
export type OVC2ToBitgoRound2Payload = t.TypeOf<
|
126
|
+
typeof OVC2ToBitgoRound2Payload
|
127
|
+
>;
|
128
|
+
|
129
|
+
export const PlatformRound2Payload = t.type({
|
130
|
+
sessionId: NonEmptyString,
|
131
|
+
bitgoMsg1: AuthBroadcastMessage,
|
132
|
+
bitgoCommitment2: NonEmptyString,
|
133
|
+
ovc: t.type({
|
134
|
+
[OVCIndexEnum.ONE]: t.type({
|
135
|
+
bitgoToOvcMsg2: AuthEncP2PMessage,
|
136
|
+
bitgoToOvcMsg3: AuthEncP2PMessage,
|
137
|
+
}),
|
138
|
+
[OVCIndexEnum.TWO]: t.type({
|
139
|
+
bitgoToOvcMsg2: AuthEncP2PMessage,
|
140
|
+
bitgoToOvcMsg3: AuthEncP2PMessage,
|
141
|
+
}),
|
142
|
+
}),
|
143
|
+
});
|
144
|
+
|
145
|
+
export const BitgoToOVC1Round2Response = t.type({
|
146
|
+
wallet: t.intersection([
|
147
|
+
OVC2ToBitgoRound2Payload,
|
148
|
+
t.type({ platform: PlatformRound2Payload }),
|
149
|
+
]),
|
150
|
+
});
|
151
|
+
|
152
|
+
export type BitgoToOVC1Round2Response = t.TypeOf<
|
153
|
+
typeof BitgoToOVC1Round2Response
|
154
|
+
>;
|
155
|
+
|
156
|
+
export const OVC1ToOVC2Round3Payload = t.intersection([
|
157
|
+
BaseRoundPayload,
|
158
|
+
t.type({
|
159
|
+
ovc: t.type({
|
160
|
+
[OVCIndexEnum.ONE]: t.type({
|
161
|
+
gpgPubKey: NonEmptyString,
|
162
|
+
ovcMsg1: AuthBroadcastMessage,
|
163
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
164
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
165
|
+
ovcToBitgoMsg3: AuthEncP2PMessage,
|
166
|
+
ovcToOvcMsg3: AuthEncP2PMessage,
|
167
|
+
}),
|
168
|
+
[OVCIndexEnum.TWO]: t.type({
|
169
|
+
gpgPubKey: NonEmptyString,
|
170
|
+
ovcMsg1: AuthBroadcastMessage,
|
171
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
172
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
173
|
+
}),
|
174
|
+
}),
|
175
|
+
platform: PlatformRound2Payload,
|
176
|
+
}),
|
177
|
+
]);
|
178
|
+
|
179
|
+
export type OVC1ToOVC2Round3Payload = t.TypeOf<typeof OVC1ToOVC2Round3Payload>;
|
180
|
+
|
181
|
+
export const OVC2ToOVC1Round3Payload = t.intersection([
|
182
|
+
BaseRoundPayload,
|
183
|
+
t.type({
|
184
|
+
ovc: t.type({
|
185
|
+
[OVCIndexEnum.ONE]: t.type({
|
186
|
+
gpgPubKey: NonEmptyString,
|
187
|
+
ovcMsg1: AuthBroadcastMessage,
|
188
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
189
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
190
|
+
ovcToBitgoMsg3: AuthEncP2PMessage,
|
191
|
+
ovcToOvcMsg3: AuthEncP2PMessage,
|
192
|
+
}),
|
193
|
+
[OVCIndexEnum.TWO]: t.type({
|
194
|
+
gpgPubKey: NonEmptyString,
|
195
|
+
ovcMsg1: AuthBroadcastMessage,
|
196
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
197
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
198
|
+
ovcToBitgoMsg3: AuthEncP2PMessage,
|
199
|
+
ovcToOvcMsg3: AuthEncP2PMessage,
|
200
|
+
ovcMsg4: AuthBroadcastMessage,
|
201
|
+
}),
|
202
|
+
}),
|
203
|
+
platform: PlatformRound2Payload,
|
204
|
+
}),
|
205
|
+
]);
|
206
|
+
|
207
|
+
export type OVC2ToOVC1Round3Payload = t.TypeOf<typeof OVC2ToOVC1Round3Payload>;
|
208
|
+
|
209
|
+
export const OVC1ToBitgoRound3Payload = t.intersection([
|
210
|
+
BaseRoundPayload,
|
211
|
+
t.type({
|
212
|
+
ovc: t.type({
|
213
|
+
[OVCIndexEnum.ONE]: t.type({
|
214
|
+
gpgPubKey: NonEmptyString,
|
215
|
+
ovcMsg1: AuthBroadcastMessage,
|
216
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
217
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
218
|
+
ovcToBitgoMsg3: AuthEncP2PMessage,
|
219
|
+
ovcToOvcMsg3: AuthEncP2PMessage,
|
220
|
+
ovcMsg4: AuthBroadcastMessage,
|
221
|
+
}),
|
222
|
+
[OVCIndexEnum.TWO]: t.type({
|
223
|
+
gpgPubKey: NonEmptyString,
|
224
|
+
ovcMsg1: AuthBroadcastMessage,
|
225
|
+
ovcToBitgoMsg2: AuthEncP2PMessage,
|
226
|
+
ovcToOvcMsg2: AuthEncP2PMessage,
|
227
|
+
ovcToBitgoMsg3: AuthEncP2PMessage,
|
228
|
+
ovcToOvcMsg3: AuthEncP2PMessage,
|
229
|
+
ovcMsg4: AuthBroadcastMessage,
|
230
|
+
}),
|
231
|
+
}),
|
232
|
+
platform: PlatformRound2Payload,
|
233
|
+
}),
|
234
|
+
]);
|
235
|
+
|
236
|
+
export type OVC1ToBitgoRound3Payload = t.TypeOf<
|
237
|
+
typeof OVC1ToBitgoRound3Payload
|
238
|
+
>;
|
239
|
+
|
240
|
+
export const PlatformRound3Payload = t.intersection([
|
241
|
+
PlatformRound2Payload,
|
242
|
+
t.type({
|
243
|
+
commonKeychain: NonEmptyString,
|
244
|
+
bitgoMsg4: AuthBroadcastMessage,
|
245
|
+
}),
|
246
|
+
]);
|
247
|
+
|
248
|
+
export type PlatformRound3Payload = t.TypeOf<typeof PlatformRound3Payload>;
|
249
|
+
|
250
|
+
export const BitgoToOVC1Round3Response = t.type({
|
251
|
+
bitGoKeyId: NonEmptyString,
|
252
|
+
wallet: t.intersection([
|
253
|
+
OVC1ToBitgoRound3Payload,
|
254
|
+
t.type({ platform: PlatformRound3Payload }),
|
255
|
+
]),
|
256
|
+
});
|
257
|
+
|
258
|
+
export type BitgoToOVC1Round3Response = t.TypeOf<
|
259
|
+
typeof BitgoToOVC1Round3Response
|
260
|
+
>;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
|
3
|
+
export enum KeyCreationMPCv2StateEnum {
|
4
|
+
WaitingForOVC1Round1Data = -1,
|
5
|
+
WaitingForOVC2Round1Data,
|
6
|
+
WaitingForBitgoRound1Data,
|
7
|
+
WaitingForOVC1Round2Data,
|
8
|
+
WaitingForOVC2Round2Data,
|
9
|
+
WaitingForBitgoRound2Data,
|
10
|
+
WaitingForOVC1Round3aData,
|
11
|
+
WaitingForOVC2Round3Data,
|
12
|
+
WaitingForOVC1Round3bData,
|
13
|
+
WaitingForBitgoRound3Data,
|
14
|
+
WaitingForOVC1GenerateKey,
|
15
|
+
WaitingForOVC2GenerateKey,
|
16
|
+
KeyGenerationComplete,
|
17
|
+
}
|
18
|
+
|
19
|
+
export const KeyCreationMPCv2State = t.union([
|
20
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC1Round1Data),
|
21
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC2Round1Data),
|
22
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForBitgoRound1Data),
|
23
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC1Round2Data),
|
24
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC2Round2Data),
|
25
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForBitgoRound2Data),
|
26
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC1Round3aData),
|
27
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC2Round3Data),
|
28
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC1Round3bData),
|
29
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForBitgoRound3Data),
|
30
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC1GenerateKey),
|
31
|
+
t.literal(KeyCreationMPCv2StateEnum.WaitingForOVC2GenerateKey),
|
32
|
+
t.literal(KeyCreationMPCv2StateEnum.KeyGenerationComplete),
|
33
|
+
]);
|
34
|
+
|
35
|
+
export type KeyCreationMPCv2State = t.TypeOf<typeof KeyCreationMPCv2State>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
|
3
|
+
import { MPCv2PartyFromStringOrNumber } from "../../common";
|
4
|
+
|
5
|
+
const AuthMessage = t.type({
|
6
|
+
message: t.string,
|
7
|
+
signature: t.string,
|
8
|
+
});
|
9
|
+
|
10
|
+
type AuthMessage = t.TypeOf<typeof AuthMessage>;
|
11
|
+
|
12
|
+
export const AuthBroadcastMessage = t.intersection([
|
13
|
+
t.type({
|
14
|
+
payload: AuthMessage,
|
15
|
+
from: MPCv2PartyFromStringOrNumber,
|
16
|
+
}),
|
17
|
+
t.partial({
|
18
|
+
signatureR: t.string,
|
19
|
+
}),
|
20
|
+
]);
|
21
|
+
|
22
|
+
export type AuthBroadcastMessage = t.TypeOf<typeof AuthBroadcastMessage>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { NonEmptyString } from "io-ts-types";
|
3
|
+
|
4
|
+
import { MPCv2PartyFromStringOrNumber } from "../../common";
|
5
|
+
|
6
|
+
const AuthEncMessage = t.type({
|
7
|
+
encryptedMessage: NonEmptyString,
|
8
|
+
signature: NonEmptyString,
|
9
|
+
});
|
10
|
+
|
11
|
+
type AuthEncMessage = t.TypeOf<typeof AuthEncMessage>;
|
12
|
+
|
13
|
+
export const AuthEncP2PMessage = t.intersection([
|
14
|
+
t.type({
|
15
|
+
payload: AuthEncMessage,
|
16
|
+
from: MPCv2PartyFromStringOrNumber,
|
17
|
+
to: MPCv2PartyFromStringOrNumber,
|
18
|
+
}),
|
19
|
+
t.partial({
|
20
|
+
commitment: NonEmptyString,
|
21
|
+
}),
|
22
|
+
]);
|
23
|
+
|
24
|
+
export type AuthEncP2PMessage = t.TypeOf<typeof AuthEncP2PMessage>;
|