-
Notifications
You must be signed in to change notification settings - Fork 39
/
ibc.ts
157 lines (128 loc) · 4.05 KB
/
ibc.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/* eslint-disable */
import { Long, DeepPartial, Exact } from "../../../helpers";
import * as _m0 from "protobufjs/minimal";
export const protobufPackage = "cosmwasm.wasm.v1";
/** MsgIBCSend */
export interface MsgIBCSend {
/** the channel by which the packet will be sent */
channel: string;
/**
* Timeout height relative to the current block height.
* The timeout is disabled when set to 0.
*/
timeoutHeight: Long;
/**
* Timeout timestamp (in nanoseconds) relative to the current block timestamp.
* The timeout is disabled when set to 0.
*/
timeoutTimestamp: Long;
/**
* Data is the payload to transfer. We must not make assumption what format or
* content is in here.
*/
data: Uint8Array;
}
/** MsgIBCCloseChannel port and channel need to be owned by the contract */
export interface MsgIBCCloseChannel {
channel: string;
}
function createBaseMsgIBCSend(): MsgIBCSend {
return {
channel: "",
timeoutHeight: Long.UZERO,
timeoutTimestamp: Long.UZERO,
data: new Uint8Array(),
};
}
export const MsgIBCSend = {
encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.channel !== "") {
writer.uint32(18).string(message.channel);
}
if (!message.timeoutHeight.isZero()) {
writer.uint32(32).uint64(message.timeoutHeight);
}
if (!message.timeoutTimestamp.isZero()) {
writer.uint32(40).uint64(message.timeoutTimestamp);
}
if (message.data.length !== 0) {
writer.uint32(50).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgIBCSend();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
message.channel = reader.string();
break;
case 4:
message.timeoutHeight = reader.uint64() as Long;
break;
case 5:
message.timeoutTimestamp = reader.uint64() as Long;
break;
case 6:
message.data = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial<I extends Exact<DeepPartial<MsgIBCSend>, I>>(object: I): MsgIBCSend {
const message = createBaseMsgIBCSend();
message.channel = object.channel ?? "";
message.timeoutHeight =
object.timeoutHeight !== undefined && object.timeoutHeight !== null
? Long.fromValue(object.timeoutHeight)
: Long.UZERO;
message.timeoutTimestamp =
object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null
? Long.fromValue(object.timeoutTimestamp)
: Long.UZERO;
message.data = object.data ?? new Uint8Array();
return message;
},
};
function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel {
return {
channel: "",
};
}
export const MsgIBCCloseChannel = {
encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.channel !== "") {
writer.uint32(18).string(message.channel);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgIBCCloseChannel();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
message.channel = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial<I extends Exact<DeepPartial<MsgIBCCloseChannel>, I>>(object: I): MsgIBCCloseChannel {
const message = createBaseMsgIBCCloseChannel();
message.channel = object.channel ?? "";
return message;
},
};