Skip to content

Commit 15bf16a

Browse files
author
Enguerrand Pinot
committed
Use builtin codecs
1 parent d2ad995 commit 15bf16a

14 files changed

+15
-130
lines changed

src/messages/bank/MsgMultiSend.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
import { Message } from '../Message';
2-
import { Coin } from '../../types';
2+
import { MsgMultiSend } from "../../codec/cosmos/bank/v1beta1/tx";
3+
import { Input, Output } from "../../codec/cosmos/bank/v1beta1/bank";
34

45
export const MsgMultiSendUrl = '/cosmos.bank.v1beta1.MsgMultiSend';
56

6-
/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */
7-
export interface MsgMultiSend {
8-
input: { address: string; coins: Coin[] }[];
9-
output: { address: string; coins: Coin[] }[];
10-
}
11-
12-
export const BuildMsgMultiSend = (input: { address: string; coins: Coin[] }[], output: { address: string; coins: Coin[] }[]): Message => {
7+
export const BuildMsgMultiSend = (inputs: Input[], outputs: Output[]): Message => {
138
return {
149
typeUrl: MsgMultiSendUrl,
1510
value: {
16-
input,
17-
output,
11+
inputs,
12+
outputs,
1813
} as MsgMultiSend,
1914
};
2015
};

src/messages/bank/MsgSend.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import { Message } from '../Message';
22
import { Coin } from '../../types';
3+
import { MsgSend } from "../../codec/cosmos/bank/v1beta1/tx";
34

45
export const MsgSendUrl = '/cosmos.bank.v1beta1.MsgSend';
56

6-
/** MsgSend represents a message to send coins from one account to another. */
7-
export interface MsgSend {
8-
fromAddress: string;
9-
toAddress: string;
10-
amount: Coin[];
11-
}
12-
137
export const BuildMsgSend = (fromAddress: string, toAddress: string, amount: Coin[]): Message => {
148
return {
159
typeUrl: MsgSendUrl,

src/messages/distribution/MsgFundCommunityPool.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { Message } from '../Message';
22
import { Coin } from '../../types';
3+
import { MsgFundCommunityPool } from "../../codec/cosmos/distribution/v1beta1/tx";
34

45
export const MsgFundCommunityPoolUrl = '/cosmos.distribution.v1beta1.MsgFundCommunityPool';
56

6-
/**
7-
* MsgFundCommunityPool allows an account to directly
8-
* fund the community pool.
9-
*/
10-
export interface MsgFundCommunityPool {
11-
amount: Coin[];
12-
depositor: string;
13-
}
14-
157
export const BuildMsgFundCommunityPool = (depositor: string, amount: Coin[]): Message => {
168
return {
179
typeUrl: MsgFundCommunityPoolUrl,

src/messages/distribution/MsgSetWithdrawAddress.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { Message } from '../Message';
2+
import { MsgSetWithdrawAddress } from "../../codec/cosmos/distribution/v1beta1/tx";
23

34
export const MsgSetWithdrawAddressUrl = '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress';
45

5-
/**
6-
* MsgSetWithdrawAddress sets the withdraw address for
7-
* a delegator (or validator self-delegation).
8-
*/
9-
export interface MsgSetWithdrawAddress {
10-
delegatorAddress: string;
11-
withdrawAddress: string;
12-
}
13-
146
export const BuildMsgSetWithdrawAddress = (delegatorAddress: string, withdrawAddress: string): Message => {
157
return {
168
typeUrl: MsgSetWithdrawAddressUrl,

src/messages/distribution/MsgWithdrawDelegatorReward.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { Message } from '../Message';
2+
import { MsgWithdrawDelegatorReward } from "../../codec/cosmos/distribution/v1beta1/tx";
23

34
export const MsgWithdrawDelegatorRewardUrl = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward';
45

5-
/**
6-
* MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator
7-
* from a single validator.
8-
*/
9-
export interface MsgWithdrawDelegatorReward {
10-
delegatorAddress: string;
11-
validatorAddress: string;
12-
}
13-
146
export const BuildMsgWithdrawDelegatorReward = (delegatorAddress: string, validatorAddress: string): Message => {
157
return {
168
typeUrl: MsgWithdrawDelegatorRewardUrl,

src/messages/distribution/MsgWithdrawValidatorCommission.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
import { Message } from '../Message';
2+
import { MsgWithdrawValidatorCommission } from "../../codec/cosmos/distribution/v1beta1/tx";
23

34
export const MsgWithdrawValidatorCommissionUrl = '/cosmos.bank.v1beta1.MsgSend';
45

5-
/**
6-
* MsgWithdrawValidatorCommission withdraws the full commission to the validator
7-
* address.
8-
*/
9-
export interface MsgWithdrawValidatorCommission {
10-
validatorAddress: string;
11-
}
12-
136
export const BuildMsgWithdrawValidatorCommission = (validatorAddress: string): Message => {
147
return {
158
typeUrl: MsgWithdrawValidatorCommissionUrl,

src/messages/faucet/MsgMintAndSend.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/messages/faucet/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/messages/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ export * from './Message';
22
export * from './bank';
33
export * from './distribution';
44
export * from './staking';
5-
export * from './faucet';

src/messages/staking/MsgBeginRedelegate.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
import { Message } from '../Message';
22
import { Coin } from '../../types';
3+
import { MsgBeginRedelegate } from "../../codec/cosmos/staking/v1beta1/tx";
34

45
export const MsgBeginRedelegateUrl = '/cosmos.staking.v1beta1.MsgBeginRedelegate';
56

6-
/**
7-
* MsgBeginRedelegate defines a SDK message for performing a redelegation
8-
* of coins from a delegator and source validator to a destination validator.
9-
*/
10-
export interface MsgBeginRedelegate {
11-
delegatorAddress: string;
12-
validatorSrcAddress: string;
13-
validatorDstAddress: string;
14-
amount?: Coin;
15-
}
16-
177
export const BuildMsgBeginRedelegate = (delegatorAddress: string, validatorSrcAddress: string, validatorDstAddress: string, amount?: Coin): Message => {
188
return {
199
typeUrl: MsgBeginRedelegateUrl,

0 commit comments

Comments
 (0)