Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generated codec for swap branch #487

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions src/codec/Switcheo/carbon/liquiditypool/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Long from "long";
import _m0 from "protobufjs/minimal";
import { Pool } from "./liquiditypool";
import { CommitmentCurve, Commitment, AccumulatedRewards } from "./reward";
import { MultiSwapStepDB, MultiSwap } from "./swap_router";
import { Timestamp } from "../../../google/protobuf/timestamp";
import { Coin } from "../../../cosmos/base/v1beta1/coin";

Expand Down Expand Up @@ -101,6 +102,14 @@ export interface ClaimEvent {
rewards: Coin[];
}

export interface MultiSwapStepEvent {
swap?: MultiSwapStepDB;
}

export interface MultiSwapResultantEvent {
swap?: MultiSwap;
}

const basePoolEvent: object = {
creator: "",
type: "",
Expand Down Expand Up @@ -1507,6 +1516,133 @@ export const ClaimEvent = {
},
};

const baseMultiSwapStepEvent: object = {};

export const MultiSwapStepEvent = {
encode(
message: MultiSwapStepEvent,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.swap !== undefined) {
MultiSwapStepDB.encode(message.swap, writer.uint32(10).fork()).ldelim();
}
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): MultiSwapStepEvent {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMultiSwapStepEvent } as MultiSwapStepEvent;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.swap = MultiSwapStepDB.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},

fromJSON(object: any): MultiSwapStepEvent {
const message = { ...baseMultiSwapStepEvent } as MultiSwapStepEvent;
message.swap =
object.swap !== undefined && object.swap !== null
? MultiSwapStepDB.fromJSON(object.swap)
: undefined;
return message;
},

toJSON(message: MultiSwapStepEvent): unknown {
const obj: any = {};
message.swap !== undefined &&
(obj.swap = message.swap
? MultiSwapStepDB.toJSON(message.swap)
: undefined);
return obj;
},

fromPartial(object: DeepPartial<MultiSwapStepEvent>): MultiSwapStepEvent {
const message = { ...baseMultiSwapStepEvent } as MultiSwapStepEvent;
message.swap =
object.swap !== undefined && object.swap !== null
? MultiSwapStepDB.fromPartial(object.swap)
: undefined;
return message;
},
};

const baseMultiSwapResultantEvent: object = {};

export const MultiSwapResultantEvent = {
encode(
message: MultiSwapResultantEvent,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.swap !== undefined) {
MultiSwap.encode(message.swap, writer.uint32(10).fork()).ldelim();
}
return writer;
},

decode(
input: _m0.Reader | Uint8Array,
length?: number
): MultiSwapResultantEvent {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = {
...baseMultiSwapResultantEvent,
} as MultiSwapResultantEvent;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.swap = MultiSwap.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},

fromJSON(object: any): MultiSwapResultantEvent {
const message = {
...baseMultiSwapResultantEvent,
} as MultiSwapResultantEvent;
message.swap =
object.swap !== undefined && object.swap !== null
? MultiSwap.fromJSON(object.swap)
: undefined;
return message;
},

toJSON(message: MultiSwapResultantEvent): unknown {
const obj: any = {};
message.swap !== undefined &&
(obj.swap = message.swap ? MultiSwap.toJSON(message.swap) : undefined);
return obj;
},

fromPartial(
object: DeepPartial<MultiSwapResultantEvent>
): MultiSwapResultantEvent {
const message = {
...baseMultiSwapResultantEvent,
} as MultiSwapResultantEvent;
message.swap =
object.swap !== undefined && object.swap !== null
? MultiSwap.fromPartial(object.swap)
: undefined;
return message;
},
};

type Builtin =
| Date
| Function
Expand Down
7 changes: 4 additions & 3 deletions src/codec/Switcheo/carbon/liquiditypool/export.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export { PoolEvent, TotalCommitmentChangeEvent, RewardsWeightChangeEvent, RewardCurveChangeEvent, CommitmentCurveEvent, CommitmentEvent, SwapEvent, DepositToPoolEvent, WithdrawFromPoolEvent, StakePoolTokenEvent, UnstakePoolTokenEvent, RewardsAccumulatedEvent, ClaimEvent } from "./event"
export { PoolEvent, TotalCommitmentChangeEvent, RewardsWeightChangeEvent, RewardCurveChangeEvent, CommitmentCurveEvent, CommitmentEvent, SwapEvent, DepositToPoolEvent, WithdrawFromPoolEvent, StakePoolTokenEvent, UnstakePoolTokenEvent, RewardsAccumulatedEvent, ClaimEvent, MultiSwapStepEvent, MultiSwapResultantEvent } from "./event"
export { Pool, Pools, PoolRoute, AddLiquidity, AddLiquidities, RemoveLiquidity, RemoveLiquidities, RemovePoolRoutes, PoolReserve, ReserveData } from "./liquiditypool"
export { Params, ParamsToUpdate } from "./params"
export { LinkPoolProposal, UnlinkPoolProposal, SetRewardCurveProposal, SetCommitmentCurveProposal, SetRewardsWeightsProposal, UpdatePoolProposal, CreatePoolRouteProposal, RemovePoolRouteProposal, UpdatePoolRouteProposal } from "./proposal"
export { QueryGetPoolRequest, QueryGetPoolResponse, QueryAllPoolRequest, QueryAllPoolResponse, QueryAllPoolAddressRequest, QueryAllPoolAddressResponse, QueryAllPoolAddressResponse_AddressesEntry, ExtendedPool, QueryCommitmentRequest, QueryCommitmentResponse, QueryAllCommitmentRequest, QueryAllCommitmentResponse, QueryCommitmentCurveRequest, QueryCommitmentCurveResponse, QueryRewardCurveRequest, QueryRewardCurveResponse, QueryTotalCommitmentRequest, QueryTotalCommitmentResponse, QueryAllTotalCommitmentRequest, QueryAllTotalCommitmentResponse, QueryClaimableRewardsRequest, QueryClaimableRewardsResponse, QueryAllocatedRewardsRequest, QueryAllocatedRewardsResponse, QueryParamsRequest, QueryParamsResponse, QueryAllPoolRouteRequest, QueryAllPoolRouteResponse, QueryAllPoolRouteAddressRequest, QueryAllPoolRouteAddressResponse, QueryAllPoolRouteAddressResponse_AddressesEntry } from "./query"
export { QueryGetPoolRequest, QueryGetPoolResponse, QueryAllPoolRequest, QueryAllPoolResponse, QueryAllPoolAddressRequest, QueryAllPoolAddressResponse, QueryAllPoolAddressResponse_AddressesEntry, ExtendedPool, QueryCommitmentRequest, QueryCommitmentResponse, QueryAllCommitmentRequest, QueryAllCommitmentResponse, QueryCommitmentCurveRequest, QueryCommitmentCurveResponse, QueryRewardCurveRequest, QueryRewardCurveResponse, QueryTotalCommitmentRequest, QueryTotalCommitmentResponse, QueryAllTotalCommitmentRequest, QueryAllTotalCommitmentResponse, QueryClaimableRewardsRequest, QueryClaimableRewardsResponse, QueryAllocatedRewardsRequest, QueryAllocatedRewardsResponse, QueryParamsRequest, QueryParamsResponse, QueryAllPoolRouteRequest, QueryAllPoolRouteResponse, QueryAllPoolRouteAddressRequest, QueryAllPoolRouteAddressResponse, QueryAllPoolRouteAddressResponse_AddressesEntry, QueryMultiSwapResultantRequest, QueryMultiSwapResultantResponse, QueryMultiSwapResultantAllRequest, QueryMultiSwapResultantAllResponse } from "./query"
export { RewardCurve, CommitmentCurve, RewardWeight, RewardWeights, Commitment, CommitmentRecord, TotalCommitment, TotalCommitmentRecord, CommitmentResponse, RewardHistory, AccumulatedRewards, AccumulatedRewardsRecord, CommitmentExpiry, CommitmentExpiries, CommitmentExpiriesRecord, AllocatedRewards } from "./reward"
export { MsgCreatePool, MsgCreatePoolResponse, MsgCreatePoolWithLiquidity, MsgCreatePoolWithLiquidityResponse, MsgAddLiquidity, MsgAddLiquidityResponse, MsgRemoveLiquidity, MsgRemoveLiquidityResponse, LinkPoolParams, UnlinkPoolParams, MsgSetRewardsWeights, SetRewardsWeightsParams, MsgSetRewardsWeightsResponse, MsgStakePoolToken, MsgStakePoolTokenResponse, MsgUnstakePoolToken, MsgUnstakePoolTokenResponse, MsgClaimPoolRewards, MsgClaimPoolRewardsResponse, MsgSetRewardCurve, SetRewardCurveParams, MsgSetRewardCurveResponse, MsgSetCommitmentCurve, SetCommitmentCurveParams, MsgSetCommitmentCurveResponse, MsgUpdatePool, UpdatePoolParams, MsgUpdatePoolResponse, MsgCreatePoolRoute, MsgCreatePoolRouteResponse, CreatePoolRouteParams, MsgRemovePoolRoute, MsgRemovePoolRouteResponse, RemovePoolRouteParams, MsgUpdatePoolRoute, MsgUpdatePoolRouteResponse, UpdatePoolRouteParams, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"
export { MultiSwap, MultiSwapResultantDB, MultiSwapStepDB, MultiSwapIDs } from "./swap_router"
export { MsgCreatePool, MsgCreatePoolResponse, MsgCreatePoolWithLiquidity, MsgCreatePoolWithLiquidityResponse, MsgAddLiquidity, MsgAddLiquidityResponse, MsgRemoveLiquidity, MsgRemoveLiquidityResponse, LinkPoolParams, UnlinkPoolParams, MsgSetRewardsWeights, SetRewardsWeightsParams, MsgSetRewardsWeightsResponse, MsgStakePoolToken, MsgStakePoolTokenResponse, MsgUnstakePoolToken, MsgUnstakePoolTokenResponse, MsgClaimPoolRewards, MsgClaimPoolRewardsResponse, MsgSetRewardCurve, SetRewardCurveParams, MsgSetRewardCurveResponse, MsgSetCommitmentCurve, SetCommitmentCurveParams, MsgSetCommitmentCurveResponse, MsgUpdatePool, UpdatePoolParams, MsgUpdatePoolResponse, MsgCreatePoolRoute, MsgCreatePoolRouteResponse, CreatePoolRouteParams, MsgRemovePoolRoute, MsgRemovePoolRouteResponse, RemovePoolRouteParams, MsgUpdatePoolRoute, MsgUpdatePoolRouteResponse, UpdatePoolRouteParams, MsgSwapExactInput, MsgSwapExactInputResponse, MsgSwapExactOutput, MsgSwapExactOutputResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"
Loading