From 2e5fff814d09dcd54339c5ad03e9879f8d581506 Mon Sep 17 00:00:00 2001 From: neeraj Date: Wed, 13 Mar 2024 19:01:26 +0530 Subject: [PATCH] Add type for params of send coins method --- src/index.ts | 6 ++---- src/types/cosmos/bank/message.ts | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index c3ad8f7..9e01bc1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,4 @@ import { sha256 } from 'js-sha256'; -import { - MessageSendParams -} from '@tharsis/transactions'; import { DeliverTxResponse, StdFee } from '@cosmjs/stargate'; import { RegistryClient } from './registry-client'; @@ -30,6 +27,7 @@ import { LaconicClient } from './laconic-client'; import { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto2/cerc/bond/v1/tx'; import { Coin } from './proto2/cosmos/base/v1beta1/coin'; import { MsgSendResponse } from './proto2/cosmos/bank/v1beta1/tx'; +import { MessageMsgSendCoins } from './types/cosmos/bank/message'; export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; @@ -139,7 +137,7 @@ export class Registry { /** * Send coins. */ - async sendCoins ({ amount, denom, destinationAddress }: MessageSendParams, privateKey: string, fee: StdFee) { + async sendCoins ({ amount, denom, destinationAddress }: MessageMsgSendCoins, privateKey: string, fee: StdFee) { const account = new Account(Buffer.from(privateKey, 'hex')); await account.init(); const laconicClient = await this.getLaconicClient(account); diff --git a/src/types/cosmos/bank/message.ts b/src/types/cosmos/bank/message.ts index f470d6f..d012261 100644 --- a/src/types/cosmos/bank/message.ts +++ b/src/types/cosmos/bank/message.ts @@ -9,3 +9,9 @@ export const typeUrlMsgSendResponse = '/cosmos.bank.v1beta1.MsgSendResponse'; export const bankTypes: ReadonlyArray<[string, GeneratedType]> = [ [typeUrlMsgSendResponse, MsgSendResponse] ]; + +export interface MessageMsgSendCoins { + destinationAddress: string; + amount: string; + denom: string; +}