Skip to content

Commit cd0d8f5

Browse files
committed
Update proto to latest millions version
1 parent a1d5ce9 commit cd0d8f5

File tree

7 files changed

+203
-91
lines changed

7 files changed

+203
-91
lines changed

src/codec/lum-network/millions/callbacks.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export interface TransferFromNativeCallback {
8181
withdrawalId: Long;
8282
}
8383

84+
export interface SetWithdrawAddressCallback {
85+
poolId: Long;
86+
}
87+
8488
const baseSplitDelegation: object = { validatorAddress: '', amount: '' };
8589

8690
export const SplitDelegation = {
@@ -655,6 +659,61 @@ export const TransferFromNativeCallback = {
655659
},
656660
};
657661

662+
const baseSetWithdrawAddressCallback: object = { poolId: Long.UZERO };
663+
664+
export const SetWithdrawAddressCallback = {
665+
encode(message: SetWithdrawAddressCallback, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
666+
if (!message.poolId.isZero()) {
667+
writer.uint32(8).uint64(message.poolId);
668+
}
669+
return writer;
670+
},
671+
672+
decode(input: _m0.Reader | Uint8Array, length?: number): SetWithdrawAddressCallback {
673+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
674+
let end = length === undefined ? reader.len : reader.pos + length;
675+
const message = { ...baseSetWithdrawAddressCallback } as SetWithdrawAddressCallback;
676+
while (reader.pos < end) {
677+
const tag = reader.uint32();
678+
switch (tag >>> 3) {
679+
case 1:
680+
message.poolId = reader.uint64() as Long;
681+
break;
682+
default:
683+
reader.skipType(tag & 7);
684+
break;
685+
}
686+
}
687+
return message;
688+
},
689+
690+
fromJSON(object: any): SetWithdrawAddressCallback {
691+
const message = { ...baseSetWithdrawAddressCallback } as SetWithdrawAddressCallback;
692+
if (object.poolId !== undefined && object.poolId !== null) {
693+
message.poolId = Long.fromString(object.poolId);
694+
} else {
695+
message.poolId = Long.UZERO;
696+
}
697+
return message;
698+
},
699+
700+
toJSON(message: SetWithdrawAddressCallback): unknown {
701+
const obj: any = {};
702+
message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString());
703+
return obj;
704+
},
705+
706+
fromPartial(object: DeepPartial<SetWithdrawAddressCallback>): SetWithdrawAddressCallback {
707+
const message = { ...baseSetWithdrawAddressCallback } as SetWithdrawAddressCallback;
708+
if (object.poolId !== undefined && object.poolId !== null) {
709+
message.poolId = object.poolId as Long;
710+
} else {
711+
message.poolId = Long.UZERO;
712+
}
713+
return message;
714+
},
715+
};
716+
658717
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long;
659718
export type DeepPartial<T> = T extends Builtin
660719
? T

src/codec/lum-network/millions/draw.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ export const protobufPackage = 'lum.network.millions';
1010
export enum DrawState {
1111
DRAW_STATE_UNSPECIFIED = 0,
1212
DRAW_STATE_ICA_WITHDRAWREWARDS = 1,
13-
DRAW_STATE_IBC_TRANSFER = 2,
14-
DRAW_STATE_DRAWING = 3,
15-
DRAW_STATE_SUCCESS = 4,
16-
DRAW_STATE_FAILURE = 5,
13+
DRAW_STATE_QUERY_BALANCE = 2,
14+
DRAW_STATE_IBC_TRANSFER = 3,
15+
DRAW_STATE_DRAWING = 4,
16+
DRAW_STATE_SUCCESS = 5,
17+
DRAW_STATE_FAILURE = 6,
1718
UNRECOGNIZED = -1,
1819
}
1920

@@ -26,15 +27,18 @@ export function drawStateFromJSON(object: any): DrawState {
2627
case 'DRAW_STATE_ICA_WITHDRAWREWARDS':
2728
return DrawState.DRAW_STATE_ICA_WITHDRAWREWARDS;
2829
case 2:
30+
case 'DRAW_STATE_QUERY_BALANCE':
31+
return DrawState.DRAW_STATE_QUERY_BALANCE;
32+
case 3:
2933
case 'DRAW_STATE_IBC_TRANSFER':
3034
return DrawState.DRAW_STATE_IBC_TRANSFER;
31-
case 3:
35+
case 4:
3236
case 'DRAW_STATE_DRAWING':
3337
return DrawState.DRAW_STATE_DRAWING;
34-
case 4:
38+
case 5:
3539
case 'DRAW_STATE_SUCCESS':
3640
return DrawState.DRAW_STATE_SUCCESS;
37-
case 5:
41+
case 6:
3842
case 'DRAW_STATE_FAILURE':
3943
return DrawState.DRAW_STATE_FAILURE;
4044
case -1:
@@ -50,6 +54,8 @@ export function drawStateToJSON(object: DrawState): string {
5054
return 'DRAW_STATE_UNSPECIFIED';
5155
case DrawState.DRAW_STATE_ICA_WITHDRAWREWARDS:
5256
return 'DRAW_STATE_ICA_WITHDRAWREWARDS';
57+
case DrawState.DRAW_STATE_QUERY_BALANCE:
58+
return 'DRAW_STATE_QUERY_BALANCE';
5359
case DrawState.DRAW_STATE_IBC_TRANSFER:
5460
return 'DRAW_STATE_IBC_TRANSFER';
5561
case DrawState.DRAW_STATE_DRAWING:

src/codec/lum-network/millions/params.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@ import { Duration } from '../../google/protobuf/duration';
66
export const protobufPackage = 'lum.network.millions';
77

88
export interface Params {
9+
/** min_deposit_amount the minimum deposit amount accepted by pool configurations */
910
minDepositAmount: string;
11+
/** max_prize_strategy_batches the maximum prize strategy batches accepted by pool configurations */
1012
maxPrizeStrategyBatches: Long;
13+
/** max_prize_batch_quantity the maximum prize batch quantity accepted by pool configurations */
1114
maxPrizeBatchQuantity: Long;
15+
/** min_draw_schedule_delta the minimum delta between draws accepted by pool configurations */
1216
minDrawScheduleDelta?: Duration;
17+
/** max_draw_schedule_delta the maximum delta between draws accepted by pool configurations */
1318
maxDrawScheduleDelta?: Duration;
19+
/** prize_expiration_delta the prize clawback expiration delta (common to all pools) */
1420
prizeExpirationDelta?: Duration;
21+
/** fees_stakers the fees distributed by stakers over prize won (common to all pools) */
1522
feesStakers: string;
23+
/** min_deposit_draw_delta the minimum delta before a draw for a deposit to be accepted during the time weighted balance computation for a draw */
24+
minDepositDrawDelta?: Duration;
1625
}
1726

1827
const baseParams: object = { minDepositAmount: '', maxPrizeStrategyBatches: Long.UZERO, maxPrizeBatchQuantity: Long.UZERO, feesStakers: '' };
@@ -40,6 +49,9 @@ export const Params = {
4049
if (message.feesStakers !== '') {
4150
writer.uint32(58).string(message.feesStakers);
4251
}
52+
if (message.minDepositDrawDelta !== undefined) {
53+
Duration.encode(message.minDepositDrawDelta, writer.uint32(66).fork()).ldelim();
54+
}
4355
return writer;
4456
},
4557

@@ -71,6 +83,9 @@ export const Params = {
7183
case 7:
7284
message.feesStakers = reader.string();
7385
break;
86+
case 8:
87+
message.minDepositDrawDelta = Duration.decode(reader, reader.uint32());
88+
break;
7489
default:
7590
reader.skipType(tag & 7);
7691
break;
@@ -116,6 +131,11 @@ export const Params = {
116131
} else {
117132
message.feesStakers = '';
118133
}
134+
if (object.minDepositDrawDelta !== undefined && object.minDepositDrawDelta !== null) {
135+
message.minDepositDrawDelta = Duration.fromJSON(object.minDepositDrawDelta);
136+
} else {
137+
message.minDepositDrawDelta = undefined;
138+
}
119139
return message;
120140
},
121141

@@ -128,6 +148,7 @@ export const Params = {
128148
message.maxDrawScheduleDelta !== undefined && (obj.maxDrawScheduleDelta = message.maxDrawScheduleDelta ? Duration.toJSON(message.maxDrawScheduleDelta) : undefined);
129149
message.prizeExpirationDelta !== undefined && (obj.prizeExpirationDelta = message.prizeExpirationDelta ? Duration.toJSON(message.prizeExpirationDelta) : undefined);
130150
message.feesStakers !== undefined && (obj.feesStakers = message.feesStakers);
151+
message.minDepositDrawDelta !== undefined && (obj.minDepositDrawDelta = message.minDepositDrawDelta ? Duration.toJSON(message.minDepositDrawDelta) : undefined);
131152
return obj;
132153
},
133154

@@ -160,6 +181,11 @@ export const Params = {
160181
message.prizeExpirationDelta = undefined;
161182
}
162183
message.feesStakers = object.feesStakers ?? '';
184+
if (object.minDepositDrawDelta !== undefined && object.minDepositDrawDelta !== null) {
185+
message.minDepositDrawDelta = Duration.fromPartial(object.minDepositDrawDelta);
186+
} else {
187+
message.minDepositDrawDelta = undefined;
188+
}
163189
return message;
164190
},
165191
};

0 commit comments

Comments
 (0)