Skip to content

Commit 8ee3d50

Browse files
authored
Merge pull request #5429 from BitGo/aloe/fixTypeEnums
2 parents 2074e44 + 553c936 commit 8ee3d50

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,13 @@ export type CreateKeychainParamsBase = {
360360

361361
export type CreateBitGoKeychainParamsBase = Omit<CreateKeychainParamsBase, 'bitgoKeychain'>;
362362

363-
export enum SignatureShareType {
364-
USER = 'user',
365-
BACKUP = 'backup',
366-
BITGO = 'bitgo',
367-
}
363+
export const SignatureShareType = {
364+
USER: 'user',
365+
BACKUP: 'backup',
366+
BITGO: 'bitgo',
367+
} as const;
368+
369+
export type SignatureShareType = (typeof SignatureShareType)[keyof typeof SignatureShareType];
368370

369371
interface ShareBaseRecord {
370372
from: SignatureShareType;
@@ -378,10 +380,13 @@ export interface SignatureShareRecord extends ShareBaseRecord {
378380
publicShare?: string;
379381
}
380382

381-
export enum CommitmentType {
382-
COMMITMENT = 'commitment',
383-
DECOMMITMENT = 'decommitment',
384-
}
383+
export const CommitmentType = {
384+
COMMITMENT: 'commitment',
385+
DECOMMITMENT: 'decommitment',
386+
} as const;
387+
388+
export type CommitmentType = (typeof CommitmentType)[keyof typeof CommitmentType];
389+
385390
export interface CommitmentShareRecord extends ShareBaseRecord {
386391
type: CommitmentType;
387392
}
@@ -390,10 +395,13 @@ export interface ExchangeCommitmentResponse {
390395
commitmentShare: CommitmentShareRecord;
391396
}
392397

393-
export enum EncryptedSignerShareType {
394-
ENCRYPTED_SIGNER_SHARE = 'encryptedSignerShare',
395-
ENCRYPTED_R_SHARE = 'encryptedRShare',
396-
}
398+
export const EncryptedSignerShareType = {
399+
ENCRYPTED_SIGNER_SHARE: 'encryptedSignerShare',
400+
ENCRYPTED_R_SHARE: 'encryptedRShare',
401+
} as const;
402+
403+
export type EncryptedSignerShareType = (typeof EncryptedSignerShareType)[keyof typeof EncryptedSignerShareType];
404+
397405
export interface EncryptedSignerShareRecord extends ShareBaseRecord {
398406
type: EncryptedSignerShareType;
399407
}

0 commit comments

Comments
 (0)