-
Notifications
You must be signed in to change notification settings - Fork 336
/
encodeobjects.ts
62 lines (51 loc) · 2.35 KB
/
encodeobjects.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { EncodeObject } from "@cosmjs/proto-signing";
import { MsgSend } from "./codec/cosmos/bank/v1beta1/tx";
import { MsgWithdrawDelegatorReward } from "./codec/cosmos/distribution/v1beta1/tx";
import { MsgDelegate, MsgUndelegate } from "./codec/cosmos/staking/v1beta1/tx";
import { MsgTransfer } from "./codec/ibc/applications/transfer/v1/tx";
export interface MsgSendEncodeObject extends EncodeObject {
readonly typeUrl: "/cosmos.bank.v1beta1.MsgSend";
readonly value: Partial<MsgSend>;
}
export function isMsgSendEncodeObject(encodeObject: EncodeObject): encodeObject is MsgSendEncodeObject {
return (encodeObject as MsgSendEncodeObject).typeUrl === "/cosmos.bank.v1beta1.MsgSend";
}
export interface MsgDelegateEncodeObject extends EncodeObject {
readonly typeUrl: "/cosmos.staking.v1beta1.MsgDelegate";
readonly value: Partial<MsgDelegate>;
}
export function isMsgDelegateEncodeObject(
encodeObject: EncodeObject,
): encodeObject is MsgDelegateEncodeObject {
return (encodeObject as MsgDelegateEncodeObject).typeUrl === "/cosmos.staking.v1beta1.MsgDelegate";
}
export interface MsgUndelegateEncodeObject extends EncodeObject {
readonly typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate";
readonly value: Partial<MsgUndelegate>;
}
export function isMsgUndelegateEncodeObject(
encodeObject: EncodeObject,
): encodeObject is MsgUndelegateEncodeObject {
return (encodeObject as MsgUndelegateEncodeObject).typeUrl === "/cosmos.staking.v1beta1.MsgUndelegate";
}
export interface MsgWithdrawDelegatorRewardEncodeObject extends EncodeObject {
readonly typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
readonly value: Partial<MsgWithdrawDelegatorReward>;
}
export function isMsgWithdrawDelegatorRewardEncodeObject(
encodeObject: EncodeObject,
): encodeObject is MsgWithdrawDelegatorRewardEncodeObject {
return (
(encodeObject as MsgWithdrawDelegatorRewardEncodeObject).typeUrl ===
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"
);
}
export interface MsgTransferEncodeObject extends EncodeObject {
readonly typeUrl: "/ibc.applications.transfer.v1.MsgTransfer";
readonly value: Partial<MsgTransfer>;
}
export function isMsgTransferEncodeObject(
encodeObject: EncodeObject,
): encodeObject is MsgTransferEncodeObject {
return (encodeObject as MsgTransferEncodeObject).typeUrl === "/ibc.applications.transfer.v1.MsgTransfer";
}