1
1
/* eslint-disable */
2
2
import Long from 'long' ;
3
3
import _m0 from 'protobufjs/minimal' ;
4
- import { Coin } from '../../../cosmos/base/v1beta1/coin' ;
4
+ import { Coin } from "../../base/v1beta1/coin" ;
5
+ import { Period } from "./vesting" ;
5
6
6
7
export const protobufPackage = 'cosmos.vesting.v1beta1' ;
7
8
@@ -20,6 +21,23 @@ export interface MsgCreateVestingAccount {
20
21
/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */
21
22
export interface MsgCreateVestingAccountResponse { }
22
23
24
+ /**
25
+ * MsgCreateVestingAccount defines a message that enables creating a vesting
26
+ * account.
27
+ */
28
+ export interface MsgCreatePeriodicVestingAccount {
29
+ fromAddress : string ;
30
+ toAddress : string ;
31
+ startTime : Long ;
32
+ vestingPeriods : Period [ ] ;
33
+ }
34
+
35
+ /**
36
+ * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount
37
+ * response type.
38
+ */
39
+ export interface MsgCreatePeriodicVestingAccountResponse { }
40
+
23
41
const baseMsgCreateVestingAccount : object = { fromAddress : '' , toAddress : '' , endTime : Long . ZERO , delayed : false } ;
24
42
25
43
export const MsgCreateVestingAccount = {
@@ -188,26 +206,189 @@ export const MsgCreateVestingAccountResponse = {
188
206
} ,
189
207
} ;
190
208
209
+ const baseMsgCreatePeriodicVestingAccount : object = { fromAddress : '' , toAddress : '' , startTime : Long . ZERO } ;
210
+
211
+ export const MsgCreatePeriodicVestingAccount = {
212
+ encode ( message : MsgCreatePeriodicVestingAccount , writer : _m0 . Writer = _m0 . Writer . create ( ) ) : _m0 . Writer {
213
+ if ( message . fromAddress !== '' ) {
214
+ writer . uint32 ( 10 ) . string ( message . fromAddress ) ;
215
+ }
216
+ if ( message . toAddress !== '' ) {
217
+ writer . uint32 ( 18 ) . string ( message . toAddress ) ;
218
+ }
219
+ if ( ! message . startTime . isZero ( ) ) {
220
+ writer . uint32 ( 24 ) . int64 ( message . startTime ) ;
221
+ }
222
+ for ( const v of message . vestingPeriods ) {
223
+ Period . encode ( v ! , writer . uint32 ( 34 ) . fork ( ) ) . ldelim ( ) ;
224
+ }
225
+ return writer ;
226
+ } ,
227
+
228
+ decode ( input : _m0 . Reader | Uint8Array , length ?: number ) : MsgCreatePeriodicVestingAccount {
229
+ const reader = input instanceof _m0 . Reader ? input : new _m0 . Reader ( input ) ;
230
+ let end = length === undefined ? reader . len : reader . pos + length ;
231
+ const message = { ...baseMsgCreatePeriodicVestingAccount } as MsgCreatePeriodicVestingAccount ;
232
+ message . vestingPeriods = [ ] ;
233
+ while ( reader . pos < end ) {
234
+ const tag = reader . uint32 ( ) ;
235
+ switch ( tag >>> 3 ) {
236
+ case 1 :
237
+ message . fromAddress = reader . string ( ) ;
238
+ break ;
239
+ case 2 :
240
+ message . toAddress = reader . string ( ) ;
241
+ break ;
242
+ case 3 :
243
+ message . startTime = reader . int64 ( ) as Long ;
244
+ break ;
245
+ case 4 :
246
+ message . vestingPeriods . push ( Period . decode ( reader , reader . uint32 ( ) ) ) ;
247
+ break ;
248
+ default :
249
+ reader . skipType ( tag & 7 ) ;
250
+ break ;
251
+ }
252
+ }
253
+ return message ;
254
+ } ,
255
+
256
+ fromJSON ( object : any ) : MsgCreatePeriodicVestingAccount {
257
+ const message = { ...baseMsgCreatePeriodicVestingAccount } as MsgCreatePeriodicVestingAccount ;
258
+ message . vestingPeriods = [ ] ;
259
+ if ( object . fromAddress !== undefined && object . fromAddress !== null ) {
260
+ message . fromAddress = String ( object . fromAddress ) ;
261
+ } else {
262
+ message . fromAddress = '' ;
263
+ }
264
+ if ( object . toAddress !== undefined && object . toAddress !== null ) {
265
+ message . toAddress = String ( object . toAddress ) ;
266
+ } else {
267
+ message . toAddress = '' ;
268
+ }
269
+ if ( object . startTime !== undefined && object . startTime !== null ) {
270
+ message . startTime = Long . fromString ( object . startTime ) ;
271
+ } else {
272
+ message . startTime = Long . ZERO ;
273
+ }
274
+ if ( object . vestingPeriods !== undefined && object . vestingPeriods !== null ) {
275
+ for ( const e of object . vestingPeriods ) {
276
+ message . vestingPeriods . push ( Period . fromJSON ( e ) ) ;
277
+ }
278
+ }
279
+ return message ;
280
+ } ,
281
+
282
+ toJSON ( message : MsgCreatePeriodicVestingAccount ) : unknown {
283
+ const obj : any = { } ;
284
+ message . fromAddress !== undefined && ( obj . fromAddress = message . fromAddress ) ;
285
+ message . toAddress !== undefined && ( obj . toAddress = message . toAddress ) ;
286
+ message . startTime !== undefined && ( obj . startTime = ( message . startTime || Long . ZERO ) . toString ( ) ) ;
287
+ if ( message . vestingPeriods ) {
288
+ obj . vestingPeriods = message . vestingPeriods . map ( ( e ) => ( e ? Period . toJSON ( e ) : undefined ) ) ;
289
+ } else {
290
+ obj . vestingPeriods = [ ] ;
291
+ }
292
+ return obj ;
293
+ } ,
294
+
295
+ fromPartial ( object : DeepPartial < MsgCreatePeriodicVestingAccount > ) : MsgCreatePeriodicVestingAccount {
296
+ const message = { ...baseMsgCreatePeriodicVestingAccount } as MsgCreatePeriodicVestingAccount ;
297
+ message . vestingPeriods = [ ] ;
298
+ if ( object . fromAddress !== undefined && object . fromAddress !== null ) {
299
+ message . fromAddress = object . fromAddress ;
300
+ } else {
301
+ message . fromAddress = '' ;
302
+ }
303
+ if ( object . toAddress !== undefined && object . toAddress !== null ) {
304
+ message . toAddress = object . toAddress ;
305
+ } else {
306
+ message . toAddress = '' ;
307
+ }
308
+ if ( object . startTime !== undefined && object . startTime !== null ) {
309
+ message . startTime = object . startTime as Long ;
310
+ } else {
311
+ message . startTime = Long . ZERO ;
312
+ }
313
+ if ( object . vestingPeriods !== undefined && object . vestingPeriods !== null ) {
314
+ for ( const e of object . vestingPeriods ) {
315
+ message . vestingPeriods . push ( Period . fromPartial ( e ) ) ;
316
+ }
317
+ }
318
+ return message ;
319
+ } ,
320
+ } ;
321
+
322
+ const baseMsgCreatePeriodicVestingAccountResponse : object = { } ;
323
+
324
+ export const MsgCreatePeriodicVestingAccountResponse = {
325
+ encode ( _ : MsgCreatePeriodicVestingAccountResponse , writer : _m0 . Writer = _m0 . Writer . create ( ) ) : _m0 . Writer {
326
+ return writer ;
327
+ } ,
328
+
329
+ decode ( input : _m0 . Reader | Uint8Array , length ?: number ) : MsgCreatePeriodicVestingAccountResponse {
330
+ const reader = input instanceof _m0 . Reader ? input : new _m0 . Reader ( input ) ;
331
+ let end = length === undefined ? reader . len : reader . pos + length ;
332
+ const message = { ...baseMsgCreatePeriodicVestingAccountResponse } as MsgCreatePeriodicVestingAccountResponse ;
333
+ while ( reader . pos < end ) {
334
+ const tag = reader . uint32 ( ) ;
335
+ switch ( tag >>> 3 ) {
336
+ default :
337
+ reader . skipType ( tag & 7 ) ;
338
+ break ;
339
+ }
340
+ }
341
+ return message ;
342
+ } ,
343
+
344
+ fromJSON ( _ : any ) : MsgCreatePeriodicVestingAccountResponse {
345
+ const message = { ...baseMsgCreatePeriodicVestingAccountResponse } as MsgCreatePeriodicVestingAccountResponse ;
346
+ return message ;
347
+ } ,
348
+
349
+ toJSON ( _ : MsgCreatePeriodicVestingAccountResponse ) : unknown {
350
+ const obj : any = { } ;
351
+ return obj ;
352
+ } ,
353
+
354
+ fromPartial ( _ : DeepPartial < MsgCreatePeriodicVestingAccountResponse > ) : MsgCreatePeriodicVestingAccountResponse {
355
+ const message = { ...baseMsgCreatePeriodicVestingAccountResponse } as MsgCreatePeriodicVestingAccountResponse ;
356
+ return message ;
357
+ } ,
358
+ } ;
359
+
191
360
/** Msg defines the bank Msg service. */
192
361
export interface Msg {
193
362
/**
194
363
* CreateVestingAccount defines a method that enables creating a vesting
195
364
* account.
196
365
*/
197
366
CreateVestingAccount ( request : MsgCreateVestingAccount ) : Promise < MsgCreateVestingAccountResponse > ;
367
+ /**
368
+ * CreatePeriodicVestingAccount defines a method that enables creating a
369
+ * periodic vesting account.
370
+ */
371
+ CreatePeriodicVestingAccount ( request : MsgCreatePeriodicVestingAccount ) : Promise < MsgCreatePeriodicVestingAccountResponse > ;
198
372
}
199
373
200
374
export class MsgClientImpl implements Msg {
201
375
private readonly rpc : Rpc ;
202
376
constructor ( rpc : Rpc ) {
203
377
this . rpc = rpc ;
204
378
this . CreateVestingAccount = this . CreateVestingAccount . bind ( this ) ;
379
+ this . CreatePeriodicVestingAccount = this . CreatePeriodicVestingAccount . bind ( this ) ;
205
380
}
206
381
CreateVestingAccount ( request : MsgCreateVestingAccount ) : Promise < MsgCreateVestingAccountResponse > {
207
382
const data = MsgCreateVestingAccount . encode ( request ) . finish ( ) ;
208
383
const promise = this . rpc . request ( 'cosmos.vesting.v1beta1.Msg' , 'CreateVestingAccount' , data ) ;
209
384
return promise . then ( ( data ) => MsgCreateVestingAccountResponse . decode ( new _m0 . Reader ( data ) ) ) ;
210
385
}
386
+
387
+ CreatePeriodicVestingAccount ( request : MsgCreatePeriodicVestingAccount ) : Promise < MsgCreatePeriodicVestingAccountResponse > {
388
+ const data = MsgCreatePeriodicVestingAccount . encode ( request ) . finish ( ) ;
389
+ const promise = this . rpc . request ( 'cosmos.vesting.v1beta1.Msg' , 'CreatePeriodicVestingAccount' , data ) ;
390
+ return promise . then ( ( data ) => MsgCreatePeriodicVestingAccountResponse . decode ( new _m0 . Reader ( data ) ) ) ;
391
+ }
211
392
}
212
393
213
394
interface Rpc {
0 commit comments