Skip to content

Commit

Permalink
Generate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkl committed Nov 19, 2024
1 parent 62aba39 commit 40e52d2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ts/types/StreamSwapController.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 { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, PoolConfig, Uint256, Binary, Schedule, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, Schedule, PoolConfig, Uint256, Binary, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
export interface StreamSwapControllerReadOnlyInterface {
contractAddress: string;
params: () => Promise<Params>;
Expand Down
2 changes: 1 addition & 1 deletion ts/types/StreamSwapController.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 { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, PoolConfig, Uint256, Binary, Schedule, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, Schedule, PoolConfig, Uint256, Binary, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
export interface StreamSwapControllerMsg {
contractAddress: string;
sender: string;
Expand Down
9 changes: 5 additions & 4 deletions ts/types/StreamSwapController.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ export type ExecuteMsg = {
};
export type Timestamp = Uint64;
export type Uint64 = number;
export type Schedule = "saturating_linear" | {
piecewise_linear: [number, Uint128][];
};
export type PoolConfig = {
concentrated_liquidity: {
out_amount_clp: Uint256;
};
};
export type Uint256 = string;
export type Binary = string;
export type Schedule = "saturating_linear" | {
piecewise_linear: [number, Uint128][];
};
export interface CreateStreamMsg {
bootstraping_start_time: Timestamp;
creator_vesting?: VestingConfig | null;
end_time: Timestamp;
in_denom: string;
name: string;
Expand All @@ -64,10 +65,10 @@ export interface CreateStreamMsg {
salt: Binary;
start_time: Timestamp;
stream_admin: string;
subscriber_vesting?: VestingConfig | null;
threshold?: Uint256 | null;
treasury: string;
url?: string | null;
vesting?: VestingConfig | null;
}
export interface VestingConfig {
schedule: Schedule;
Expand Down
13 changes: 9 additions & 4 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, Uint128, PoolConfig, Uint256, Binary, Schedule, InstantiateMsg, Coin, VestingConfig, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, StreamResponse } 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, StreamResponse } from "./StreamSwapStream.types";
export interface StreamSwapStreamReadOnlyInterface {
contractAddress: string;
params: () => Promise<Params>;
Expand Down Expand Up @@ -107,10 +107,12 @@ export interface StreamSwapStreamInterface extends StreamSwapStreamReadOnlyInter
syncPosition: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
finalizeStream: ({
createPool,
newTreasury
newTreasury,
salt
}: {
createPool?: CreatePool;
newTreasury?: string;
salt?: Binary;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
exitStream: ({
salt
Expand Down Expand Up @@ -172,15 +174,18 @@ export class StreamSwapStreamClient extends StreamSwapStreamQueryClient implemen
};
finalizeStream = async ({
createPool,
newTreasury
newTreasury,
salt
}: {
createPool?: CreatePool;
newTreasury?: string;
salt?: Binary;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
finalize_stream: {
create_pool: createPool,
new_treasury: newTreasury
new_treasury: newTreasury,
salt
}
}, fee, memo, _funds);
};
Expand Down
13 changes: 9 additions & 4 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, Uint128, PoolConfig, Uint256, Binary, Schedule, InstantiateMsg, Coin, VestingConfig, ExecuteMsg, CreatePool, QueryMsg, Decimal256, AveragePriceResponse, LatestStreamedPriceResponse, PositionsResponse, PositionResponse, Addr, Params, Status, StreamResponse } 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, StreamResponse } from "./StreamSwapStream.types";
export interface StreamSwapStreamMsg {
contractAddress: string;
sender: string;
Expand All @@ -21,10 +21,12 @@ export interface StreamSwapStreamMsg {
syncPosition: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
finalizeStream: ({
createPool,
newTreasury
newTreasury,
salt
}: {
createPool?: CreatePool;
newTreasury?: string;
salt?: Binary;
}, _funds?: Coin[]) => MsgExecuteContractEncodeObject;
exitStream: ({
salt
Expand Down Expand Up @@ -115,10 +117,12 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
};
finalizeStream = ({
createPool,
newTreasury
newTreasury,
salt
}: {
createPool?: CreatePool;
newTreasury?: string;
salt?: Binary;
}, _funds?: Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
Expand All @@ -128,7 +132,8 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
msg: toUtf8(JSON.stringify({
finalize_stream: {
create_pool: createPool,
new_treasury: newTreasury
new_treasury: newTreasury,
salt
}
})),
funds: _funds
Expand Down
20 changes: 11 additions & 9 deletions ts/types/StreamSwapStream.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

export type Timestamp = Uint64;
export type Uint64 = string;
export type Schedule = "saturating_linear" | {
piecewise_linear: [number, Uint128][];
};
export type Uint128 = string;
export type PoolConfig = {
concentrated_liquidity: {
Expand All @@ -14,11 +17,9 @@ export type PoolConfig = {
};
export type Uint256 = string;
export type Binary = string;
export type Schedule = "saturating_linear" | {
piecewise_linear: [number, Uint128][];
};
export interface InstantiateMsg {
bootstraping_start_time: Timestamp;
creator_vesting?: VestingConfig | null;
end_time: Timestamp;
in_denom: string;
name: string;
Expand All @@ -27,21 +28,21 @@ export interface InstantiateMsg {
salt: Binary;
start_time: Timestamp;
stream_admin: string;
subscriber_vesting?: VestingConfig | null;
threshold?: Uint256 | null;
treasury: string;
url?: string | null;
vesting?: VestingConfig | null;
}
export interface Coin {
amount: Uint128;
denom: string;
[k: string]: unknown;
}
export interface VestingConfig {
schedule: Schedule;
unbonding_duration_seconds: number;
vesting_duration_seconds: number;
}
export interface Coin {
amount: Uint128;
denom: string;
[k: string]: unknown;
}
export type ExecuteMsg = {
sync_stream: {};
} | {
Expand All @@ -56,6 +57,7 @@ export type ExecuteMsg = {
finalize_stream: {
create_pool?: CreatePool | null;
new_treasury?: string | null;
salt?: Binary | null;
};
} | {
exit_stream: {
Expand Down

0 comments on commit 40e52d2

Please sign in to comment.