Skip to content

Commit ba0e987

Browse files
authored
Generate schema (#98)
1 parent 62aba39 commit ba0e987

6 files changed

Lines changed: 36 additions & 23 deletions

ts/types/StreamSwapController.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
88
import { StdFee } from "@cosmjs/amino";
9-
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, PoolConfig, Uint256, Binary, Schedule, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
9+
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, Schedule, PoolConfig, Uint256, Binary, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
1010
export interface StreamSwapControllerReadOnlyInterface {
1111
contractAddress: string;
1212
params: () => Promise<Params>;

ts/types/StreamSwapController.message-composer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate";
88
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
99
import { toUtf8 } from "@cosmjs/encoding";
10-
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, PoolConfig, Uint256, Binary, Schedule, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
10+
import { Decimal256, Uint128, InstantiateMsg, Coin, ExecuteMsg, Timestamp, Uint64, Schedule, PoolConfig, Uint256, Binary, CreateStreamMsg, VestingConfig, QueryMsg, Boolean, StreamsResponse, StreamResponse, Addr, Params } from "./StreamSwapController.types";
1111
export interface StreamSwapControllerMsg {
1212
contractAddress: string;
1313
sender: string;

ts/types/StreamSwapController.types.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,19 @@ export type ExecuteMsg = {
4444
};
4545
export type Timestamp = Uint64;
4646
export type Uint64 = number;
47+
export type Schedule = "saturating_linear" | {
48+
piecewise_linear: [number, Uint128][];
49+
};
4750
export type PoolConfig = {
4851
concentrated_liquidity: {
4952
out_amount_clp: Uint256;
5053
};
5154
};
5255
export type Uint256 = string;
5356
export type Binary = string;
54-
export type Schedule = "saturating_linear" | {
55-
piecewise_linear: [number, Uint128][];
56-
};
5757
export interface CreateStreamMsg {
5858
bootstraping_start_time: Timestamp;
59+
creator_vesting?: VestingConfig | null;
5960
end_time: Timestamp;
6061
in_denom: string;
6162
name: string;
@@ -64,10 +65,10 @@ export interface CreateStreamMsg {
6465
salt: Binary;
6566
start_time: Timestamp;
6667
stream_admin: string;
68+
subscriber_vesting?: VestingConfig | null;
6769
threshold?: Uint256 | null;
6870
treasury: string;
6971
url?: string | null;
70-
vesting?: VestingConfig | null;
7172
}
7273
export interface VestingConfig {
7374
schedule: Schedule;

ts/types/StreamSwapStream.client.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
88
import { StdFee } from "@cosmjs/amino";
9-
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";
9+
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";
1010
export interface StreamSwapStreamReadOnlyInterface {
1111
contractAddress: string;
1212
params: () => Promise<Params>;
@@ -107,10 +107,12 @@ export interface StreamSwapStreamInterface extends StreamSwapStreamReadOnlyInter
107107
syncPosition: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
108108
finalizeStream: ({
109109
createPool,
110-
newTreasury
110+
newTreasury,
111+
salt
111112
}: {
112113
createPool?: CreatePool;
113114
newTreasury?: string;
115+
salt?: Binary;
114116
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
115117
exitStream: ({
116118
salt
@@ -172,15 +174,18 @@ export class StreamSwapStreamClient extends StreamSwapStreamQueryClient implemen
172174
};
173175
finalizeStream = async ({
174176
createPool,
175-
newTreasury
177+
newTreasury,
178+
salt
176179
}: {
177180
createPool?: CreatePool;
178181
newTreasury?: string;
182+
salt?: Binary;
179183
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
180184
return await this.client.execute(this.sender, this.contractAddress, {
181185
finalize_stream: {
182186
create_pool: createPool,
183-
new_treasury: newTreasury
187+
new_treasury: newTreasury,
188+
salt
184189
}
185190
}, fee, memo, _funds);
186191
};

ts/types/StreamSwapStream.message-composer.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate";
88
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
99
import { toUtf8 } from "@cosmjs/encoding";
10-
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";
10+
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";
1111
export interface StreamSwapStreamMsg {
1212
contractAddress: string;
1313
sender: string;
@@ -21,10 +21,12 @@ export interface StreamSwapStreamMsg {
2121
syncPosition: (_funds?: Coin[]) => MsgExecuteContractEncodeObject;
2222
finalizeStream: ({
2323
createPool,
24-
newTreasury
24+
newTreasury,
25+
salt
2526
}: {
2627
createPool?: CreatePool;
2728
newTreasury?: string;
29+
salt?: Binary;
2830
}, _funds?: Coin[]) => MsgExecuteContractEncodeObject;
2931
exitStream: ({
3032
salt
@@ -115,10 +117,12 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
115117
};
116118
finalizeStream = ({
117119
createPool,
118-
newTreasury
120+
newTreasury,
121+
salt
119122
}: {
120123
createPool?: CreatePool;
121124
newTreasury?: string;
125+
salt?: Binary;
122126
}, _funds?: Coin[]): MsgExecuteContractEncodeObject => {
123127
return {
124128
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
@@ -128,7 +132,8 @@ export class StreamSwapStreamMsgComposer implements StreamSwapStreamMsg {
128132
msg: toUtf8(JSON.stringify({
129133
finalize_stream: {
130134
create_pool: createPool,
131-
new_treasury: newTreasury
135+
new_treasury: newTreasury,
136+
salt
132137
}
133138
})),
134139
funds: _funds

ts/types/StreamSwapStream.types.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
export type Timestamp = Uint64;
88
export type Uint64 = string;
9+
export type Schedule = "saturating_linear" | {
10+
piecewise_linear: [number, Uint128][];
11+
};
912
export type Uint128 = string;
1013
export type PoolConfig = {
1114
concentrated_liquidity: {
@@ -14,11 +17,9 @@ export type PoolConfig = {
1417
};
1518
export type Uint256 = string;
1619
export type Binary = string;
17-
export type Schedule = "saturating_linear" | {
18-
piecewise_linear: [number, Uint128][];
19-
};
2020
export interface InstantiateMsg {
2121
bootstraping_start_time: Timestamp;
22+
creator_vesting?: VestingConfig | null;
2223
end_time: Timestamp;
2324
in_denom: string;
2425
name: string;
@@ -27,21 +28,21 @@ export interface InstantiateMsg {
2728
salt: Binary;
2829
start_time: Timestamp;
2930
stream_admin: string;
31+
subscriber_vesting?: VestingConfig | null;
3032
threshold?: Uint256 | null;
3133
treasury: string;
3234
url?: string | null;
33-
vesting?: VestingConfig | null;
34-
}
35-
export interface Coin {
36-
amount: Uint128;
37-
denom: string;
38-
[k: string]: unknown;
3935
}
4036
export interface VestingConfig {
4137
schedule: Schedule;
4238
unbonding_duration_seconds: number;
4339
vesting_duration_seconds: number;
4440
}
41+
export interface Coin {
42+
amount: Uint128;
43+
denom: string;
44+
[k: string]: unknown;
45+
}
4546
export type ExecuteMsg = {
4647
sync_stream: {};
4748
} | {
@@ -56,6 +57,7 @@ export type ExecuteMsg = {
5657
finalize_stream: {
5758
create_pool?: CreatePool | null;
5859
new_treasury?: string | null;
60+
salt?: Binary | null;
5961
};
6062
} | {
6163
exit_stream: {

0 commit comments

Comments
 (0)