Skip to content

Commit

Permalink
chore: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CalicoNino committed Oct 4, 2024
1 parent 2fa390e commit ec9bdca
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/sdk/tx/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import { BaseAccount } from "src/protojs/cosmos/auth/v1beta1/auth"
* @param {EthAccount} ethAccount - The EthAccount object containing the account's base information.
* @returns {Account} The Cosmos account object.
*/
export const accountFromEthAccount = (baseAccount: BaseAccount): Account => {
const { address, pubKey, accountNumber, sequence } = baseAccount
return {
address,
pubkey: decodeOptionalPubkey(pubKey),
accountNumber: accountNumber.toNumber(),
sequence: sequence.toNumber(),
}
}
export const accountFromEthAccount = ({
address,
pubKey,
accountNumber,
sequence,
}: BaseAccount): Account => ({
address,
pubkey: decodeOptionalPubkey(pubKey),
accountNumber: accountNumber.toNumber(),
sequence: sequence.toNumber(),
})

/**
* Parses an account input into a Cosmos account. Handles both EthAccount and other standard accounts.
Expand Down

0 comments on commit ec9bdca

Please sign in to comment.