Add type for params of send coins method
All checks were successful
Tests / sdk_tests (pull_request) Successful in 19m37s

This commit is contained in:
neeraj 2024-03-13 19:01:26 +05:30
parent b687b8334e
commit 2e5fff814d
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,4 @@
import { sha256 } from 'js-sha256'; import { sha256 } from 'js-sha256';
import {
MessageSendParams
} from '@tharsis/transactions';
import { DeliverTxResponse, StdFee } from '@cosmjs/stargate'; import { DeliverTxResponse, StdFee } from '@cosmjs/stargate';
import { RegistryClient } from './registry-client'; 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 { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto2/cerc/bond/v1/tx';
import { Coin } from './proto2/cosmos/base/v1beta1/coin'; import { Coin } from './proto2/cosmos/base/v1beta1/coin';
import { MsgSendResponse } from './proto2/cosmos/bank/v1beta1/tx'; import { MsgSendResponse } from './proto2/cosmos/bank/v1beta1/tx';
import { MessageMsgSendCoins } from './types/cosmos/bank/message';
export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; export const DEFAULT_CHAIN_ID = 'laconic_9000-1';
@ -139,7 +137,7 @@ export class Registry {
/** /**
* Send coins. * 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')); const account = new Account(Buffer.from(privateKey, 'hex'));
await account.init(); await account.init();
const laconicClient = await this.getLaconicClient(account); const laconicClient = await this.getLaconicClient(account);

View File

@ -9,3 +9,9 @@ export const typeUrlMsgSendResponse = '/cosmos.bank.v1beta1.MsgSendResponse';
export const bankTypes: ReadonlyArray<[string, GeneratedType]> = [ export const bankTypes: ReadonlyArray<[string, GeneratedType]> = [
[typeUrlMsgSendResponse, MsgSendResponse] [typeUrlMsgSendResponse, MsgSendResponse]
]; ];
export interface MessageMsgSendCoins {
destinationAddress: string;
amount: string;
denom: string;
}