Skip to content

Commit b2af5f1

Browse files
authored
Merge pull request #185 from nowooj/fix/pubkey-type
fix: pubkey is Object case
2 parents 9a05880 + 2424133 commit b2af5f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

networks/cosmos/src/workflows/plugins/signer-info.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ export class SignerInfoPlugin extends BaseWorkflowBuilderPlugin<
6060
// Get public key bytes - handle both AccountData (with pubkey property) and IAccount (with getPublicKey method)
6161
let pubkeyBytes: Uint8Array;
6262
if ('pubkey' in account && account.pubkey) {
63-
// AccountData from OfflineSigner - has direct pubkey property
64-
pubkeyBytes = account.pubkey;
63+
if (account.pubkey instanceof Uint8Array) {
64+
pubkeyBytes = account.pubkey;
65+
} else {
66+
// Convert object with numeric keys to Uint8Array
67+
const values = Object.values(account.pubkey) as number[];
68+
pubkeyBytes = new Uint8Array(values);
69+
}
6570
} else if ('getPublicKey' in account && typeof account.getPublicKey === 'function') {
6671
// IAccount from IWallet - use getPublicKey method
6772
try {

0 commit comments

Comments
 (0)