diff --git a/package.json b/package.json index 3a5956c..8d8b52d 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@cerc-io/registry-sdk": "^0.2.5", "@cosmjs/amino": "^0.32.3", "@cosmjs/crypto": "^0.32.3", + "@cosmjs/encoding": "^0.33.1", "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@emotion/react": "^11.13.0", diff --git a/src/screens/SendTxEmbed.tsx b/src/screens/SendTxEmbed.tsx index 025f0ed..1a56fe8 100644 --- a/src/screens/SendTxEmbed.tsx +++ b/src/screens/SendTxEmbed.tsx @@ -9,6 +9,7 @@ import { AuthInfo, SignDoc } from "cosmjs-types/cosmos/tx/v1beta1/tx"; import { DirectSecp256k1Wallet, Algo, TxBodyEncodeObject } from '@cosmjs/proto-signing'; import { SigningStargateClient } from '@cosmjs/stargate'; +import { toHex } from '@cosmjs/encoding'; import { retrieveAccounts, retrieveSingleAccount } from '../utils/accounts'; // Use retrieveAccounts import AccountDetails from '../components/AccountDetails'; @@ -298,7 +299,7 @@ export const SendTxEmbed = () => { publicKey: info.publicKey ? { ...info.publicKey, - value: info.publicKey.value.toString(), + value: toHex(info.publicKey.value), } : undefined, })), @@ -317,8 +318,8 @@ export const SendTxEmbed = () => { {JSONbig.stringify( { ...transactionDetails.signDoc, - bodyBytes: transactionDetails.signDoc.bodyBytes?.toString?.() ?? transactionDetails.signDoc.bodyBytes, - authInfoBytes: transactionDetails.signDoc.authInfoBytes?.toString?.() ?? transactionDetails.signDoc.authInfoBytes, + bodyBytes: toHex(transactionDetails.signDoc.bodyBytes), + authInfoBytes: toHex(transactionDetails.signDoc.authInfoBytes), }, null, 2 diff --git a/yarn.lock b/yarn.lock index 9caa949..e7b7d0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1410,6 +1410,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@^0.33.1": + version "0.33.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.33.1.tgz#77d6a8e0152c658ecf07b5aee3f5968d9071da50" + integrity sha512-nuNxf29fUcQE14+1p//VVQDwd1iau5lhaW/7uMz7V2AH3GJbFJoJVaKvVyZvdFk+Cnu+s3wCqgq4gJkhRCJfKw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/json-rpc@^0.32.4": version "0.32.4" resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.4.tgz#be91eb89ea78bd5dc02d0a9fa184dd6790790f0b"