Skip to content

Commit

Permalink
regenerate types
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjatosba committed Dec 4, 2024
1 parent 866a0d4 commit 28675e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 60 deletions.
23 changes: 1 addition & 22 deletions ts/types/StreamSwapStream.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { StdFee } from "@cosmjs/amino";
import { Timestamp, Uint64, Schedule, Uint128, PoolConfig, Uint256, Binary, InstantiateMsg, VestingConfig, Coin, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, StreamResponse, String } from "./StreamSwapStream.types";
import { Timestamp, Uint64, Schedule, Uint128, PoolConfig, Uint256, Binary, InstantiateMsg, VestingConfig, Coin, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, FinalizedStatus, StreamResponse, String } from "./StreamSwapStream.types";
export interface StreamSwapStreamReadOnlyInterface {
contractAddress: string;
params: () => Promise<Params>;
Expand All @@ -25,7 +25,6 @@ export interface StreamSwapStreamReadOnlyInterface {
}) => Promise<PositionsResponse>;
averagePrice: () => Promise<AveragePriceResponse>;
lastStreamedPrice: () => Promise<LatestStreamedPriceResponse>;
threshold: () => Promise<Uint128>;
toS: ({
addr
}: {
Expand All @@ -45,7 +44,6 @@ export class StreamSwapStreamQueryClient implements StreamSwapStreamReadOnlyInte
this.listPositions = this.listPositions.bind(this);
this.averagePrice = this.averagePrice.bind(this);
this.lastStreamedPrice = this.lastStreamedPrice.bind(this);
this.threshold = this.threshold.bind(this);
this.toS = this.toS.bind(this);
}

Expand Down Expand Up @@ -94,11 +92,6 @@ export class StreamSwapStreamQueryClient implements StreamSwapStreamReadOnlyInte
last_streamed_price: {}
});
};
threshold = async (): Promise<Uint128> => {
return this.client.queryContractSmart(this.contractAddress, {
threshold: {}
});
};
toS = async ({
addr
}: {
Expand Down Expand Up @@ -136,9 +129,7 @@ export interface StreamSwapStreamInterface extends StreamSwapStreamReadOnlyInter
}: {
salt?: Binary;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
exitCancelled: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
cancelStream: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
cancelStreamWithThreshold: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
streamAdminCancel: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class StreamSwapStreamClient extends StreamSwapStreamQueryClient implements StreamSwapStreamInterface {
Expand All @@ -157,9 +148,7 @@ export class StreamSwapStreamClient extends StreamSwapStreamQueryClient implemen
this.syncPosition = this.syncPosition.bind(this);
this.finalizeStream = this.finalizeStream.bind(this);
this.exitStream = this.exitStream.bind(this);
this.exitCancelled = this.exitCancelled.bind(this);
this.cancelStream = this.cancelStream.bind(this);
this.cancelStreamWithThreshold = this.cancelStreamWithThreshold.bind(this);
this.streamAdminCancel = this.streamAdminCancel.bind(this);
}

Expand Down Expand Up @@ -217,21 +206,11 @@ export class StreamSwapStreamClient extends StreamSwapStreamQueryClient implemen
}
}, fee, memo, _funds);
};
exitCancelled = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
exit_cancelled: {}
}, fee, memo, _funds);
};
cancelStream = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
cancel_stream: {}
}, fee, memo, _funds);
};
cancelStreamWithThreshold = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
cancel_stream_with_threshold: {}
}, fee, memo, _funds);
};
streamAdminCancel = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
stream_admin_cancel: {}
Expand Down
32 changes: 1 addition & 31 deletions ts/types/StreamSwapStream.message-composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate";
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
import { toUtf8 } from "@cosmjs/encoding";
import { Timestamp, Uint64, Schedule, Uint128, PoolConfig, Uint256, Binary, InstantiateMsg, VestingConfig, Coin, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, StreamResponse, String } from "./StreamSwapStream.types";
import { Timestamp, Uint64, Schedule, Uint128, PoolConfig, Uint256, Binary, InstantiateMsg, VestingConfig, Coin, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, FinalizedStatus, StreamResponse, String } from "./StreamSwapStream.types";
export interface StreamSwapStreamMsg {
contractAddress: string;
sender: string;
Expand All @@ -33,9 +33,7 @@ export interface StreamSwapStreamMsg {
}: {
salt?: Binary;
}, _funds?: Coin[]) => MsgExecuteContractEncodeObject;
exitCancelled: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
cancelStream: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
cancelStreamWithThreshold: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
streamAdminCancel: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
}
export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
Expand All @@ -51,9 +49,7 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
this.syncPosition = this.syncPosition.bind(this);
this.finalizeStream = this.finalizeStream.bind(this);
this.exitStream = this.exitStream.bind(this);
this.exitCancelled = this.exitCancelled.bind(this);
this.cancelStream = this.cancelStream.bind(this);
this.cancelStreamWithThreshold = this.cancelStreamWithThreshold.bind(this);
this.streamAdminCancel = this.streamAdminCancel.bind(this);
}

Expand Down Expand Up @@ -159,19 +155,6 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
})
};
};
exitCancelled = (_funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
exit_cancelled: {}
})),
funds: _funds
})
};
};
cancelStream = (_funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
Expand All @@ -185,19 +168,6 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
})
};
};
cancelStreamWithThreshold = (_funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
cancel_stream_with_threshold: {}
})),
funds: _funds
})
};
};
streamAdminCancel = (_funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
Expand Down
11 changes: 4 additions & 7 deletions ts/types/StreamSwapStream.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ export type ExecuteMsg = {
exit_stream: {
salt?: Binary | null;
};
} | {
exit_cancelled: {};
} | {
cancel_stream: {};
} | {
cancel_stream_with_threshold: {};
} | {
stream_admin_cancel: {};
};
Expand Down Expand Up @@ -98,8 +94,6 @@ export type QueryMsg = {
average_price: {};
} | {
last_streamed_price: {};
} | {
threshold: {};
} | {
to_s: {
addr?: string | null;
Expand Down Expand Up @@ -140,7 +134,10 @@ export interface Params {
tos_version: string;
vesting_code_id: number;
}
export type Status = "waiting" | "bootstrapping" | "active" | "ended" | "finalized" | "cancelled";
export type Status = "waiting" | "bootstrapping" | "active" | "ended" | {
finalized: FinalizedStatus;
} | "cancelled";
export type FinalizedStatus = "threshold_reached" | "threshold_not_reached";
export interface StreamResponse {
current_streamed_price: Decimal256;
dist_index: Decimal256;
Expand Down

0 comments on commit 28675e4

Please sign in to comment.