Add MsgSetWithdrawAddress types and helpers
This commit is contained in:
+17
-1
@@ -5,6 +5,7 @@ import {
|
||||
TxMsgDelegate,
|
||||
TxMsgRedelegate,
|
||||
TxMsgSend,
|
||||
TxMsgSetWithdrawAddress,
|
||||
TxMsgUndelegate,
|
||||
} from "../types/txMsg";
|
||||
|
||||
@@ -58,4 +59,19 @@ const isTxMsgClaimRewards = (msg: TxMsg | EncodeObject): msg is TxMsgClaimReward
|
||||
!!msg.value.delegatorAddress &&
|
||||
!!msg.value.validatorAddress;
|
||||
|
||||
export { isTxMsgSend, isTxMsgDelegate, isTxMsgUndelegate, isTxMsgRedelegate, isTxMsgClaimRewards };
|
||||
const isTxMsgSetWithdrawAddress = (msg: TxMsg | EncodeObject): msg is TxMsgSetWithdrawAddress =>
|
||||
msg.typeUrl === "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress" &&
|
||||
"value" in msg &&
|
||||
"delegatorAddress" in msg.value &&
|
||||
"withdrawAddress" in msg.value &&
|
||||
!!msg.value.delegatorAddress &&
|
||||
!!msg.value.withdrawAddress;
|
||||
|
||||
export {
|
||||
isTxMsgSend,
|
||||
isTxMsgDelegate,
|
||||
isTxMsgUndelegate,
|
||||
isTxMsgRedelegate,
|
||||
isTxMsgClaimRewards,
|
||||
isTxMsgSetWithdrawAddress,
|
||||
};
|
||||
|
||||
+17
-2
@@ -1,11 +1,18 @@
|
||||
export type TxType = "send" | "delegate" | "undelegate" | "redelegate" | "claimRewards";
|
||||
export type TxType =
|
||||
| "send"
|
||||
| "delegate"
|
||||
| "undelegate"
|
||||
| "redelegate"
|
||||
| "claimRewards"
|
||||
| "setWithdrawAddress";
|
||||
|
||||
export type TxMsg =
|
||||
| TxMsgSend
|
||||
| TxMsgDelegate
|
||||
| TxMsgUndelegate
|
||||
| TxMsgRedelegate
|
||||
| TxMsgClaimRewards;
|
||||
| TxMsgClaimRewards
|
||||
| TxMsgSetWithdrawAddress;
|
||||
|
||||
export interface TxMsgSend {
|
||||
readonly typeUrl: "/cosmos.bank.v1beta1.MsgSend";
|
||||
@@ -51,3 +58,11 @@ export interface TxMsgClaimRewards {
|
||||
readonly validatorAddress: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface TxMsgSetWithdrawAddress {
|
||||
readonly typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress";
|
||||
readonly value: {
|
||||
readonly delegatorAddress: string;
|
||||
readonly withdrawAddress: string;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user