@bitgo/public-types 6.87.0 → 6.89.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/solConfidentialTransferIntent.d.ts +21 -27
- package/dist/src/schema/transactionRequest/intents/solConfidentialTransferIntent.js +21 -12
- package/dist/src/schema/transactionRequest/intents/solConfidentialTransferIntent.js.map +1 -1
- package/dist/src/schema/webhook/organizationWebhooks.d.ts +2 -2
- package/package.json +1 -1
- package/src/schema/mpcv2/keyGen/keygenRound.ts +76 -26
- package/src/schema/transactionRequest/intents/solConfidentialTransferIntent.ts +55 -20
|
@@ -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,8BAA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AuB;QAC1C,mBAAmB,EAAE,gCAAuB;KAC7C,CAAC;CACH,EACD,gCAAgC,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,4 +1,13 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
+
export declare const SolV1TransactionConfig: t.TypeC<{
|
|
3
|
+
computeUnitLimit: t.UnionC<[t.NumberC, t.NullC]>;
|
|
4
|
+
heapSize: t.UnionC<[t.NumberC, t.NullC]>;
|
|
5
|
+
loadedAccountsDataSizeLimit: t.UnionC<[t.NumberC, t.NullC]>;
|
|
6
|
+
priorityFee: t.UnionC<[t.NumberC, t.NullC]>;
|
|
7
|
+
}>;
|
|
8
|
+
export type SolV1TransactionConfig = t.TypeOf<typeof SolV1TransactionConfig>;
|
|
9
|
+
export declare const SolConfidentialTransferOperation: t.UnionC<[t.LiteralC<"deposit">, t.LiteralC<"applyPendingBalance">, t.LiteralC<"transfer">, t.LiteralC<"withdraw">]>;
|
|
10
|
+
export type SolConfidentialTransferOperation = t.TypeOf<typeof SolConfidentialTransferOperation>;
|
|
2
11
|
export declare const SolConfidentialTransferIntent: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
3
12
|
intentType: t.KeyofC<{
|
|
4
13
|
payment: t.LiteralC<"payment">;
|
|
@@ -92,32 +101,17 @@ export declare const SolConfidentialTransferIntent: t.IntersectionC<[t.Intersect
|
|
|
92
101
|
memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
93
102
|
}>]>, t.TypeC<{
|
|
94
103
|
intentType: t.LiteralC<"confidentialTransfer">;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
accountKey: t.StringC;
|
|
108
|
-
writableIndexes: t.ArrayC<t.NumberC>;
|
|
109
|
-
readonlyIndexes: t.ArrayC<t.NumberC>;
|
|
110
|
-
}>>;
|
|
111
|
-
staticAccountKeys: t.ArrayC<t.StringC>;
|
|
112
|
-
messageHeader: t.TypeC<{
|
|
113
|
-
numRequiredSignatures: t.NumberC;
|
|
114
|
-
numReadonlySignedAccounts: t.NumberC;
|
|
115
|
-
numReadonlyUnsignedAccounts: t.NumberC;
|
|
116
|
-
}>;
|
|
117
|
-
}>, t.PartialC<{
|
|
118
|
-
recentBlockhash: t.StringC;
|
|
119
|
-
version: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>]>;
|
|
120
|
-
}>]>;
|
|
121
|
-
}>]>;
|
|
104
|
+
token: t.StringC;
|
|
105
|
+
operation: t.UnionC<[t.LiteralC<"deposit">, t.LiteralC<"applyPendingBalance">, t.LiteralC<"transfer">, t.LiteralC<"withdraw">]>;
|
|
106
|
+
amount: t.StringC;
|
|
107
|
+
}>, t.PartialC<{
|
|
108
|
+
version: t.LiteralC<1>;
|
|
109
|
+
transactionConfig: t.TypeC<{
|
|
110
|
+
computeUnitLimit: t.UnionC<[t.NumberC, t.NullC]>;
|
|
111
|
+
heapSize: t.UnionC<[t.NumberC, t.NullC]>;
|
|
112
|
+
loadedAccountsDataSizeLimit: t.UnionC<[t.NumberC, t.NullC]>;
|
|
113
|
+
priorityFee: t.UnionC<[t.NumberC, t.NullC]>;
|
|
114
|
+
}>;
|
|
115
|
+
recipientAddress: t.StringC;
|
|
122
116
|
}>]>;
|
|
123
117
|
export type SolConfidentialTransferIntent = t.TypeOf<typeof SolConfidentialTransferIntent>;
|
|
@@ -23,27 +23,36 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.SolConfidentialTransferIntent = void 0;
|
|
26
|
+
exports.SolConfidentialTransferIntent = exports.SolConfidentialTransferOperation = exports.SolV1TransactionConfig = void 0;
|
|
27
27
|
const t = __importStar(require("io-ts"));
|
|
28
28
|
const baseIntent_1 = require("./baseIntent");
|
|
29
29
|
const solBuildOptions_1 = require("./solBuildOptions");
|
|
30
|
-
const solVersionedTransactionData_1 = require("./solVersionedTransactionData");
|
|
31
30
|
const intentType_1 = require("./intentType");
|
|
31
|
+
exports.SolV1TransactionConfig = t.type({
|
|
32
|
+
computeUnitLimit: t.union([t.number, t.null]),
|
|
33
|
+
heapSize: t.union([t.number, t.null]),
|
|
34
|
+
loadedAccountsDataSizeLimit: t.union([t.number, t.null]),
|
|
35
|
+
priorityFee: t.union([t.number, t.null]),
|
|
36
|
+
});
|
|
37
|
+
exports.SolConfidentialTransferOperation = t.union([
|
|
38
|
+
t.literal("deposit"),
|
|
39
|
+
t.literal("applyPendingBalance"),
|
|
40
|
+
t.literal("transfer"),
|
|
41
|
+
t.literal("withdraw"),
|
|
42
|
+
]);
|
|
32
43
|
exports.SolConfidentialTransferIntent = t.intersection([
|
|
33
44
|
baseIntent_1.BaseIntent,
|
|
34
45
|
solBuildOptions_1.SolBuildOptions,
|
|
35
46
|
t.type({
|
|
36
47
|
intentType: intentType_1.intentTypes.confidentialTransfer,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
]),
|
|
48
|
+
token: t.string,
|
|
49
|
+
operation: exports.SolConfidentialTransferOperation,
|
|
50
|
+
amount: t.string,
|
|
51
|
+
}),
|
|
52
|
+
t.partial({
|
|
53
|
+
version: t.literal(1),
|
|
54
|
+
transactionConfig: exports.SolV1TransactionConfig,
|
|
55
|
+
recipientAddress: t.string,
|
|
47
56
|
}),
|
|
48
57
|
]);
|
|
49
58
|
//# sourceMappingURL=solConfidentialTransferIntent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solConfidentialTransferIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solConfidentialTransferIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,uDAAoD;AACpD
|
|
1
|
+
{"version":3,"file":"solConfidentialTransferIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solConfidentialTransferIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,uDAAoD;AACpD,6CAA2C;AAU9B,QAAA,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrC,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACxD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;CACzC,CAAC,CAAC;AAWU,QAAA,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACpB,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAChC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACrB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;CACtB,CAAC,CAAC;AAiBU,QAAA,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,uBAAU;IACV,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QAEL,UAAU,EAAE,wBAAW,CAAC,oBAAoB;QAE5C,KAAK,EAAE,CAAC,CAAC,MAAM;QAEf,SAAS,EAAE,wCAAgC;QAE3C,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QAER,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAErB,iBAAiB,EAAE,8BAAsB;QAEzC,gBAAgB,EAAE,CAAC,CAAC,MAAM;KAC3B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -11,12 +11,12 @@ export declare const AddOrganizationWebhookRequestBodyC: t.TypeC<{
|
|
|
11
11
|
}>;
|
|
12
12
|
export type AddOrganizationWebhookRequestBody = t.TypeOf<typeof AddOrganizationWebhookRequestBodyC>;
|
|
13
13
|
export declare const ListOrganizationWebhooksRequestBody: {
|
|
14
|
-
type: t.UnionC<[t.Type<"
|
|
14
|
+
type: t.UnionC<[t.Type<"transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
|
|
15
15
|
limit: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16
16
|
prevId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
17
17
|
};
|
|
18
18
|
export declare const ListOrganizationWebhooksRequestBodyC: t.TypeC<{
|
|
19
|
-
type: t.UnionC<[t.Type<"
|
|
19
|
+
type: t.UnionC<[t.Type<"transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
|
|
20
20
|
limit: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
21
21
|
prevId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
22
22
|
}>;
|
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
|
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { BaseIntent } from "./baseIntent";
|
|
3
3
|
import { SolBuildOptions } from "./solBuildOptions";
|
|
4
|
-
import { SolVersionedTransactionData } from "./solVersionedTransactionData";
|
|
5
4
|
import { intentTypes } from "./intentType";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
* Solana Token-2022 confidential-transfer (CT) transaction config carried on a
|
|
8
|
+
* structured v1 intent. Mirrors the SDK `SolV1TransactionConfig` shape so a
|
|
9
|
+
* client-supplied config (compute budget / priority fee) round-trips through
|
|
10
|
+
* the v1 (SIMD-0296/0385) serializer. Absent fields are coerced to null by the
|
|
11
|
+
* SDK; clients may omit the config entirely (the server fixes it from
|
|
12
|
+
* `V1_TRANSACTION_CONFIG`).
|
|
13
|
+
*/
|
|
14
|
+
export const SolV1TransactionConfig = t.type({
|
|
15
|
+
computeUnitLimit: t.union([t.number, t.null]),
|
|
16
|
+
heapSize: t.union([t.number, t.null]),
|
|
17
|
+
loadedAccountsDataSizeLimit: t.union([t.number, t.null]),
|
|
18
|
+
priorityFee: t.union([t.number, t.null]),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type SolV1TransactionConfig = t.TypeOf<typeof SolV1TransactionConfig>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Solana confidential-transfer operation. Deposit moves public SPL tokens into
|
|
25
|
+
* confidential pending balance; applyPendingBalance credits pending balance
|
|
26
|
+
* into available balance; transfer moves confidential balance to another
|
|
27
|
+
* confidential account; withdraw moves confidential available balance back to
|
|
28
|
+
* public SPL balance.
|
|
29
|
+
*/
|
|
30
|
+
export const SolConfidentialTransferOperation = t.union([
|
|
31
|
+
t.literal("deposit"),
|
|
32
|
+
t.literal("applyPendingBalance"),
|
|
33
|
+
t.literal("transfer"),
|
|
34
|
+
t.literal("withdraw"),
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
export type SolConfidentialTransferOperation = t.TypeOf<
|
|
38
|
+
typeof SolConfidentialTransferOperation
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Structured Solana Token-2022 confidential-transfer intent.
|
|
9
43
|
*
|
|
10
|
-
* Clients supply structured fields (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
44
|
+
* Clients supply structured fields (token, operation, amount, recipient); the
|
|
45
|
+
* platform assembles the v1 (SIMD-0296/0385) transaction server-side via the
|
|
46
|
+
* SDK ConfidentialTransferBuilder — zk proofs are generated by the KMS and
|
|
47
|
+
* never client-supplied. The sender's and (for transfer/withdraw) recipient's
|
|
48
|
+
* Associated Token Accounts must already exist and be CT-configured on-chain.
|
|
14
49
|
*
|
|
15
50
|
* @title SOL Confidential Transfer Intent
|
|
16
51
|
*/
|
|
@@ -20,20 +55,20 @@ export const SolConfidentialTransferIntent = t.intersection([
|
|
|
20
55
|
t.type({
|
|
21
56
|
/** Must be "confidentialTransfer". */
|
|
22
57
|
intentType: intentTypes.confidentialTransfer,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
/** The confidential token to operate on, as a statics token name (e.g. "sol:usdc"). */
|
|
59
|
+
token: t.string,
|
|
60
|
+
/** The confidential-transfer operation to build. */
|
|
61
|
+
operation: SolConfidentialTransferOperation,
|
|
62
|
+
/** The amount in atomic units (base units of the token's decimalPlaces). */
|
|
63
|
+
amount: t.string,
|
|
64
|
+
}),
|
|
65
|
+
t.partial({
|
|
66
|
+
/** Wire version marker; CT is v1-only, so the only valid value is 1. */
|
|
67
|
+
version: t.literal(1),
|
|
68
|
+
/** v1 transaction config (compute budget / priority fee); server-fixed if absent. */
|
|
69
|
+
transactionConfig: SolV1TransactionConfig,
|
|
70
|
+
/** Recipient address (ATA) — required for transfer and withdraw operations. */
|
|
71
|
+
recipientAddress: t.string,
|
|
37
72
|
}),
|
|
38
73
|
]);
|
|
39
74
|
|