Skip to content

Commit

Permalink
fix: signTransaction return pub_key in WELLDONE Wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoon-Suji committed May 19, 2023
1 parent e6585e3 commit 9053217
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/wallet-ts/src/utils/wallets/welldone/WelldoneWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import {
CosmosChainId,
TestnetCosmosChainId,
} from '@injectivelabs/ts-types'
import { TxResponse, TxRestApi, CosmosTxV1Beta1Tx } from '@injectivelabs/sdk-ts'
import {
TxResponse,
TxRestApi,
CosmosTxV1Beta1Tx,
getPublicKey,
} from '@injectivelabs/sdk-ts'
import { DirectSignResponse, makeSignBytes } from '@cosmjs/proto-signing'
import { encodeSecp256k1Pubkey } from '@cosmjs/amino'
import {
ErrorType,
UnspecifiedErrorCode,
Expand Down Expand Up @@ -108,13 +112,15 @@ export class WelldoneWallet {
method: 'dapp:signTransaction',
params: [`0x${Buffer.from(signBytes).toString('hex')}`],
})
const pubKey = getPublicKey({
chainId: this.chainId,
key: Buffer.from(response[0].publicKey.replace('0x', ''), 'hex').toString('base64'),
})

return {
signed: signDoc,
signature: {
pub_key: encodeSecp256k1Pubkey(
Buffer.from(response[0].publicKey.replace('0x', ''), 'hex'),
),
pub_key: pubKey as any,
signature: Buffer.from(
response[0].signature.replace('0x', ''),
'hex',
Expand Down

0 comments on commit 9053217

Please sign in to comment.