@bitgo/public-types 4.0.1 → 4.0.2
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/smc/dsgType.d.ts +59 -0
- package/dist/src/schema/mpcv2/smc/dsgType.js +3 -0
- package/dist/src/schema/mpcv2/smc/dsgType.js.map +1 -0
- package/dist/src/schema/tss/baseTypes.d.ts +99 -0
- package/dist/src/schema/tss/baseTypes.js +3 -0
- package/dist/src/schema/tss/baseTypes.js.map +1 -0
- package/package.json +1 -1
- package/src/schema/mpcv2/smc/dsgType.ts +67 -0
- package/src/schema/tss/baseTypes.ts +137 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
import { Signature, SignatureShareRecord, EncryptedSignerShareRecord, CommitmentShareRecord, TxRequest } from "../../tss/baseTypes";
|
2
|
+
export type MpcSigningOutput = {
|
3
|
+
tssVersion: string;
|
4
|
+
txRequest: TxRequest;
|
5
|
+
ovc: {
|
6
|
+
rShare?: SignatureShareRecord;
|
7
|
+
kShare?: SignatureShareRecord;
|
8
|
+
sShare?: SignatureShareRecord;
|
9
|
+
muDeltaShare?: SignatureShareRecord;
|
10
|
+
eddsaSignature?: Signature;
|
11
|
+
signerShare?: string;
|
12
|
+
gShare?: SignatureShareRecord;
|
13
|
+
commitmentShare?: CommitmentShareRecord;
|
14
|
+
encryptedSignerShare?: EncryptedSignerShareRecord;
|
15
|
+
mpcv2Round1Message?: SignatureShareRecord;
|
16
|
+
mpcv2Round2Message?: SignatureShareRecord;
|
17
|
+
mpcv2Round3Message?: SignatureShareRecord;
|
18
|
+
signerGpgKey?: string;
|
19
|
+
signerPublicShare?: string;
|
20
|
+
}[];
|
21
|
+
};
|
22
|
+
export type OvcStepOneSignedTx = {
|
23
|
+
signatureShares: [
|
24
|
+
{
|
25
|
+
txRequest: TxRequest;
|
26
|
+
ovc: [
|
27
|
+
{
|
28
|
+
commitmentShare: CommitmentShareRecord;
|
29
|
+
encryptedSignerShare: EncryptedSignerShareRecord;
|
30
|
+
}
|
31
|
+
];
|
32
|
+
}
|
33
|
+
];
|
34
|
+
};
|
35
|
+
export type OvcStepTwoSignedTx = {
|
36
|
+
signatureShares: [
|
37
|
+
{
|
38
|
+
txRequest: TxRequest;
|
39
|
+
ovc: [
|
40
|
+
{
|
41
|
+
rShare: SignatureShareRecord;
|
42
|
+
signerShare: string;
|
43
|
+
}
|
44
|
+
];
|
45
|
+
}
|
46
|
+
];
|
47
|
+
};
|
48
|
+
export type OvcStepThreeSignedTx = {
|
49
|
+
signatureShares: [
|
50
|
+
{
|
51
|
+
txRequest: TxRequest;
|
52
|
+
ovc: [
|
53
|
+
{
|
54
|
+
gShare: SignatureShareRecord;
|
55
|
+
}
|
56
|
+
];
|
57
|
+
}
|
58
|
+
];
|
59
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dsgType.js","sourceRoot":"","sources":["../../../../../src/schema/mpcv2/smc/dsgType.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
export declare enum SignatureShareType {
|
2
|
+
USER = "user",
|
3
|
+
BACKUP = "backup",
|
4
|
+
BITGO = "bitgo"
|
5
|
+
}
|
6
|
+
export declare enum EncryptedSignerShareType {
|
7
|
+
ENCRYPTED_SIGNER_SHARE = "encryptedSignerShare",
|
8
|
+
ENCRYPTED_R_SHARE = "encryptedRShare"
|
9
|
+
}
|
10
|
+
export declare enum CommitmentType {
|
11
|
+
COMMITMENT = "commitment",
|
12
|
+
DECOMMITMENT = "decommitment"
|
13
|
+
}
|
14
|
+
interface ShareBaseRecord {
|
15
|
+
from: SignatureShareType;
|
16
|
+
to: SignatureShareType;
|
17
|
+
share: string;
|
18
|
+
}
|
19
|
+
export interface SignatureShareRecord extends ShareBaseRecord {
|
20
|
+
vssProof?: string;
|
21
|
+
privateShareProof?: string;
|
22
|
+
publicShare?: string;
|
23
|
+
}
|
24
|
+
export interface EncryptedSignerShareRecord extends ShareBaseRecord {
|
25
|
+
type: EncryptedSignerShareType;
|
26
|
+
}
|
27
|
+
export interface CommitmentShareRecord extends ShareBaseRecord {
|
28
|
+
type: CommitmentType;
|
29
|
+
}
|
30
|
+
export interface Signature {
|
31
|
+
y: string;
|
32
|
+
R: string;
|
33
|
+
sigma: string;
|
34
|
+
}
|
35
|
+
export type WalletType = "backing" | "cold" | "custodial" | "custodialPaired" | "hot" | "trading";
|
36
|
+
export type TxRequestState = "pendingCommitment" | "pendingApproval" | "canceled" | "rejected" | "initialized" | "pendingDelivery" | "delivered" | "pendingUserSignature" | "signed";
|
37
|
+
export type UnsignedMessageTss = {
|
38
|
+
derivationPath: string;
|
39
|
+
message: string;
|
40
|
+
};
|
41
|
+
export type SignableTransaction = {
|
42
|
+
serializedTxHex: string;
|
43
|
+
signableHex: string;
|
44
|
+
};
|
45
|
+
export type UnsignedTransactionTss = SignableTransaction & {
|
46
|
+
derivationPath: string;
|
47
|
+
feeInfo?: {
|
48
|
+
fee: number;
|
49
|
+
feeString: string;
|
50
|
+
};
|
51
|
+
coinSpecific?: Record<string, unknown>;
|
52
|
+
parsedTx?: unknown;
|
53
|
+
};
|
54
|
+
export type TransactionState = "initialized" | "pendingCommitment" | "pendingSignature" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected";
|
55
|
+
export type SignedTx = {
|
56
|
+
id: string;
|
57
|
+
tx: string;
|
58
|
+
publicKey?: string;
|
59
|
+
signature?: string;
|
60
|
+
};
|
61
|
+
export type TxRequestVersion = "full" | "lite";
|
62
|
+
export type TxRequest = {
|
63
|
+
txRequestId: string;
|
64
|
+
walletId: string;
|
65
|
+
walletType: WalletType;
|
66
|
+
version: number;
|
67
|
+
enterpriseId?: string;
|
68
|
+
state: TxRequestState;
|
69
|
+
date: string;
|
70
|
+
userId: string;
|
71
|
+
intent: unknown;
|
72
|
+
pendingApprovalId?: string;
|
73
|
+
policiesChecked: boolean;
|
74
|
+
signatureShares?: SignatureShareRecord[];
|
75
|
+
commitmentShares?: CommitmentShareRecord[];
|
76
|
+
pendingTxHashes?: string[];
|
77
|
+
txHashes?: string[];
|
78
|
+
unsignedMessages?: UnsignedMessageTss[];
|
79
|
+
unsignedTxs: UnsignedTransactionTss[];
|
80
|
+
transactions?: {
|
81
|
+
state: TransactionState;
|
82
|
+
unsignedTx: UnsignedTransactionTss;
|
83
|
+
signatureShares: SignatureShareRecord[];
|
84
|
+
signedTx?: SignedTx;
|
85
|
+
commitmentShares?: CommitmentShareRecord[];
|
86
|
+
}[];
|
87
|
+
messages?: {
|
88
|
+
state: TransactionState;
|
89
|
+
signatureShares: SignatureShareRecord[];
|
90
|
+
messageRaw: string;
|
91
|
+
messageEncoded?: string;
|
92
|
+
derivationPath: string;
|
93
|
+
combineSigShare?: string;
|
94
|
+
txHash?: string;
|
95
|
+
}[];
|
96
|
+
apiVersion?: TxRequestVersion;
|
97
|
+
latest: boolean;
|
98
|
+
};
|
99
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../../../../src/schema/tss/baseTypes.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
@@ -0,0 +1,67 @@
|
|
1
|
+
import {
|
2
|
+
Signature,
|
3
|
+
SignatureShareRecord,
|
4
|
+
EncryptedSignerShareRecord,
|
5
|
+
CommitmentShareRecord,
|
6
|
+
TxRequest,
|
7
|
+
} from "../../tss/baseTypes";
|
8
|
+
|
9
|
+
export type MpcSigningOutput = {
|
10
|
+
tssVersion: string;
|
11
|
+
txRequest: TxRequest;
|
12
|
+
ovc: {
|
13
|
+
rShare?: SignatureShareRecord;
|
14
|
+
kShare?: SignatureShareRecord;
|
15
|
+
sShare?: SignatureShareRecord;
|
16
|
+
muDeltaShare?: SignatureShareRecord;
|
17
|
+
eddsaSignature?: Signature;
|
18
|
+
signerShare?: string;
|
19
|
+
gShare?: SignatureShareRecord;
|
20
|
+
commitmentShare?: CommitmentShareRecord;
|
21
|
+
encryptedSignerShare?: EncryptedSignerShareRecord;
|
22
|
+
mpcv2Round1Message?: SignatureShareRecord;
|
23
|
+
mpcv2Round2Message?: SignatureShareRecord;
|
24
|
+
mpcv2Round3Message?: SignatureShareRecord;
|
25
|
+
signerGpgKey?: string;
|
26
|
+
signerPublicShare?: string;
|
27
|
+
}[];
|
28
|
+
};
|
29
|
+
|
30
|
+
export type OvcStepOneSignedTx = {
|
31
|
+
signatureShares: [
|
32
|
+
{
|
33
|
+
txRequest: TxRequest;
|
34
|
+
ovc: [
|
35
|
+
{
|
36
|
+
commitmentShare: CommitmentShareRecord;
|
37
|
+
encryptedSignerShare: EncryptedSignerShareRecord;
|
38
|
+
},
|
39
|
+
];
|
40
|
+
},
|
41
|
+
];
|
42
|
+
};
|
43
|
+
export type OvcStepTwoSignedTx = {
|
44
|
+
signatureShares: [
|
45
|
+
{
|
46
|
+
txRequest: TxRequest;
|
47
|
+
ovc: [
|
48
|
+
{
|
49
|
+
rShare: SignatureShareRecord;
|
50
|
+
signerShare: string;
|
51
|
+
},
|
52
|
+
];
|
53
|
+
},
|
54
|
+
];
|
55
|
+
};
|
56
|
+
export type OvcStepThreeSignedTx = {
|
57
|
+
signatureShares: [
|
58
|
+
{
|
59
|
+
txRequest: TxRequest;
|
60
|
+
ovc: [
|
61
|
+
{
|
62
|
+
gShare: SignatureShareRecord;
|
63
|
+
},
|
64
|
+
];
|
65
|
+
},
|
66
|
+
];
|
67
|
+
};
|
@@ -0,0 +1,137 @@
|
|
1
|
+
export declare enum SignatureShareType {
|
2
|
+
USER = "user",
|
3
|
+
BACKUP = "backup",
|
4
|
+
BITGO = "bitgo",
|
5
|
+
}
|
6
|
+
|
7
|
+
export declare enum EncryptedSignerShareType {
|
8
|
+
ENCRYPTED_SIGNER_SHARE = "encryptedSignerShare",
|
9
|
+
ENCRYPTED_R_SHARE = "encryptedRShare",
|
10
|
+
}
|
11
|
+
|
12
|
+
export declare enum CommitmentType {
|
13
|
+
COMMITMENT = "commitment",
|
14
|
+
DECOMMITMENT = "decommitment",
|
15
|
+
}
|
16
|
+
|
17
|
+
interface ShareBaseRecord {
|
18
|
+
from: SignatureShareType;
|
19
|
+
to: SignatureShareType;
|
20
|
+
share: string;
|
21
|
+
}
|
22
|
+
|
23
|
+
export interface SignatureShareRecord extends ShareBaseRecord {
|
24
|
+
vssProof?: string;
|
25
|
+
privateShareProof?: string;
|
26
|
+
publicShare?: string;
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface EncryptedSignerShareRecord extends ShareBaseRecord {
|
30
|
+
type: EncryptedSignerShareType;
|
31
|
+
}
|
32
|
+
|
33
|
+
export interface CommitmentShareRecord extends ShareBaseRecord {
|
34
|
+
type: CommitmentType;
|
35
|
+
}
|
36
|
+
|
37
|
+
export interface Signature {
|
38
|
+
y: string;
|
39
|
+
R: string;
|
40
|
+
sigma: string;
|
41
|
+
}
|
42
|
+
|
43
|
+
export type WalletType =
|
44
|
+
| "backing"
|
45
|
+
| "cold"
|
46
|
+
| "custodial"
|
47
|
+
| "custodialPaired"
|
48
|
+
| "hot"
|
49
|
+
| "trading";
|
50
|
+
|
51
|
+
export type TxRequestState =
|
52
|
+
| "pendingCommitment"
|
53
|
+
| "pendingApproval"
|
54
|
+
| "canceled"
|
55
|
+
| "rejected"
|
56
|
+
| "initialized"
|
57
|
+
| "pendingDelivery"
|
58
|
+
| "delivered"
|
59
|
+
| "pendingUserSignature"
|
60
|
+
| "signed";
|
61
|
+
|
62
|
+
export type UnsignedMessageTss = {
|
63
|
+
derivationPath: string;
|
64
|
+
message: string;
|
65
|
+
};
|
66
|
+
|
67
|
+
export type SignableTransaction = {
|
68
|
+
serializedTxHex: string;
|
69
|
+
signableHex: string;
|
70
|
+
};
|
71
|
+
|
72
|
+
export type UnsignedTransactionTss = SignableTransaction & {
|
73
|
+
derivationPath: string;
|
74
|
+
feeInfo?: {
|
75
|
+
fee: number;
|
76
|
+
feeString: string;
|
77
|
+
};
|
78
|
+
coinSpecific?: Record<string, unknown>;
|
79
|
+
parsedTx?: unknown;
|
80
|
+
};
|
81
|
+
|
82
|
+
export type TransactionState =
|
83
|
+
| "initialized"
|
84
|
+
| "pendingCommitment"
|
85
|
+
| "pendingSignature"
|
86
|
+
| "signed"
|
87
|
+
| "held"
|
88
|
+
| "delivered"
|
89
|
+
| "invalidSignature"
|
90
|
+
| "rejected";
|
91
|
+
|
92
|
+
export type SignedTx = {
|
93
|
+
id: string;
|
94
|
+
tx: string;
|
95
|
+
publicKey?: string;
|
96
|
+
signature?: string;
|
97
|
+
};
|
98
|
+
|
99
|
+
export type TxRequestVersion = "full" | "lite";
|
100
|
+
|
101
|
+
export type TxRequest = {
|
102
|
+
txRequestId: string;
|
103
|
+
walletId: string;
|
104
|
+
walletType: WalletType;
|
105
|
+
version: number;
|
106
|
+
enterpriseId?: string;
|
107
|
+
state: TxRequestState;
|
108
|
+
date: string;
|
109
|
+
userId: string;
|
110
|
+
intent: unknown;
|
111
|
+
pendingApprovalId?: string;
|
112
|
+
policiesChecked: boolean;
|
113
|
+
signatureShares?: SignatureShareRecord[];
|
114
|
+
commitmentShares?: CommitmentShareRecord[];
|
115
|
+
pendingTxHashes?: string[];
|
116
|
+
txHashes?: string[];
|
117
|
+
unsignedMessages?: UnsignedMessageTss[];
|
118
|
+
unsignedTxs: UnsignedTransactionTss[];
|
119
|
+
transactions?: {
|
120
|
+
state: TransactionState;
|
121
|
+
unsignedTx: UnsignedTransactionTss;
|
122
|
+
signatureShares: SignatureShareRecord[];
|
123
|
+
signedTx?: SignedTx;
|
124
|
+
commitmentShares?: CommitmentShareRecord[];
|
125
|
+
}[];
|
126
|
+
messages?: {
|
127
|
+
state: TransactionState;
|
128
|
+
signatureShares: SignatureShareRecord[];
|
129
|
+
messageRaw: string;
|
130
|
+
messageEncoded?: string;
|
131
|
+
derivationPath: string;
|
132
|
+
combineSigShare?: string;
|
133
|
+
txHash?: string;
|
134
|
+
}[];
|
135
|
+
apiVersion?: TxRequestVersion;
|
136
|
+
latest: boolean;
|
137
|
+
};
|