Skip to content

Commit 6e39f3e

Browse files
fix: use publicKey for cold wallet recovery
TICKET: COIN-5418
1 parent b91eee8 commit 6e39f3e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/abstract-cosmos/src/cosmosCoin.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CosmosCoin<CustomMessage = never> extends BaseCoin {
169169
messages,
170170
chainId,
171171
accountDetails,
172-
publicKey: publicKey || params.bitgoKey || '',
172+
publicKey: publicKey || '',
173173
isUnsignedSweep,
174174
keyShares,
175175
});
@@ -208,11 +208,15 @@ export class CosmosCoin<CustomMessage = never> extends BaseCoin {
208208
publicKey?: string;
209209
keyShares?: KeyShares;
210210
}> {
211+
const MPC = new Ecdsa();
212+
211213
if (isUnsignedSweep) {
212-
return { senderAddress: params.rootAddress as string };
214+
return {
215+
senderAddress: params.rootAddress as string,
216+
publicKey: MPC.deriveUnhardened(params.bitgoKey || '', ROOT_PATH).slice(0, 66),
217+
};
213218
}
214219

215-
const MPC = new Ecdsa();
216220
const keyShares = await this.getKeyShares(params);
217221
const publicKey = MPC.deriveUnhardened(keyShares.commonKeyChain, ROOT_PATH).slice(0, 66);
218222

0 commit comments

Comments
 (0)