import { PoolParams, PoolParamsSDKType, PoolAsset, PoolAssetSDKType } from "../balancerPool"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../../../../helpers"; /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPool { sender: string; poolParams?: PoolParams; poolAssets: PoolAsset[]; futurePoolGovernor: string; } /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPoolSDKType { sender: string; pool_params?: PoolParamsSDKType; pool_assets: PoolAssetSDKType[]; future_pool_governor: string; } /** Returns the poolID */ export interface MsgCreateBalancerPoolResponse { poolId: Long; } /** Returns the poolID */ export interface MsgCreateBalancerPoolResponseSDKType { pool_id: Long; } function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { return { sender: "", poolParams: undefined, poolAssets: [], futurePoolGovernor: "" }; } export const MsgCreateBalancerPool = { encode(message: MsgCreateBalancerPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.poolParams !== undefined) { PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim(); } for (const v of message.poolAssets) { PoolAsset.encode(v!, writer.uint32(26).fork()).ldelim(); } if (message.futurePoolGovernor !== "") { writer.uint32(34).string(message.futurePoolGovernor); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBalancerPool { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBalancerPool(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sender = reader.string(); break; case 2: message.poolParams = PoolParams.decode(reader, reader.uint32()); break; case 3: message.poolAssets.push(PoolAsset.decode(reader, reader.uint32())); break; case 4: message.futurePoolGovernor = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): MsgCreateBalancerPool { const message = createBaseMsgCreateBalancerPool(); message.sender = object.sender ?? ""; message.poolParams = object.poolParams !== undefined && object.poolParams !== null ? PoolParams.fromPartial(object.poolParams) : undefined; message.poolAssets = object.poolAssets?.map(e => PoolAsset.fromPartial(e)) || []; message.futurePoolGovernor = object.futurePoolGovernor ?? ""; return message; } }; function createBaseMsgCreateBalancerPoolResponse(): MsgCreateBalancerPoolResponse { return { poolId: Long.UZERO }; } export const MsgCreateBalancerPoolResponse = { encode(message: MsgCreateBalancerPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateBalancerPoolResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateBalancerPoolResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.poolId = (reader.uint64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): MsgCreateBalancerPoolResponse { const message = createBaseMsgCreateBalancerPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; return message; } };