Skip to content

Commit 5155cad

Browse files
feat(abstract-utxo): add isUtxoWalletData function
Issue: BTC-1801
1 parent 7ca28b5 commit 5155cad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/abstract-utxo/src/wallet.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
import { Wallet, WalletData } from '@bitgo/sdk-core';
22

3+
import { isUtxoCoinName, UtxoCoinName } from './names';
4+
35
// parseTransactions' return type makes use of WalletData's type but with customChangeKeySignatures as required.
46
export interface UtxoWalletData extends WalletData {
7+
coin: UtxoCoinName;
58
customChangeKeySignatures: {
69
user: string;
710
backup: string;
811
bitgo: string;
912
};
1013
}
1114

15+
export function isUtxoWalletData(obj: WalletData): obj is UtxoWalletData {
16+
return isUtxoCoinName(obj.coin);
17+
}
18+
1219
export interface UtxoWallet extends Wallet {
1320
_wallet: UtxoWalletData;
1421
}

0 commit comments

Comments
 (0)