Skip to content

Commit

Permalink
Generate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkl committed Dec 3, 2024
1 parent c3fea90 commit 0363905
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
19 changes: 18 additions & 1 deletion 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 } 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, String } from "./StreamSwapStream.types";
export interface StreamSwapStreamReadOnlyInterface {
contractAddress: string;
params: () => Promise<Params>;
Expand All @@ -26,6 +26,11 @@ export interface StreamSwapStreamReadOnlyInterface {
averagePrice: () => Promise<AveragePriceResponse>;
lastStreamedPrice: () => Promise<LatestStreamedPriceResponse>;
threshold: () => Promise<Uint128>;
toS: ({
addr
}: {
addr?: string;
}) => Promise<String>;
}
export class StreamSwapStreamQueryClient implements StreamSwapStreamReadOnlyInterface {
client: CosmWasmClient;
Expand All @@ -41,6 +46,7 @@ export class StreamSwapStreamQueryClient implements StreamSwapStreamReadOnlyInte
this.averagePrice = this.averagePrice.bind(this);
this.lastStreamedPrice = this.lastStreamedPrice.bind(this);
this.threshold = this.threshold.bind(this);
this.toS = this.toS.bind(this);
}

params = async (): Promise<Params> => {
Expand Down Expand Up @@ -93,6 +99,17 @@ export class StreamSwapStreamQueryClient implements StreamSwapStreamReadOnlyInte
threshold: {}
});
};
toS = async ({
addr
}: {
addr?: string;
}): Promise<String> => {
return this.client.queryContractSmart(this.contractAddress, {
to_s: {
addr
}
});
};
}
export interface StreamSwapStreamInterface extends StreamSwapStreamReadOnlyInterface {
contractAddress: string;
Expand Down
2 changes: 1 addition & 1 deletion 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 } 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, String } from "./StreamSwapStream.types";
export interface StreamSwapStreamMsg {
contractAddress: string;
sender: string;
Expand Down
7 changes: 6 additions & 1 deletion ts/types/StreamSwapStream.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export type QueryMsg = {
last_streamed_price: {};
} | {
threshold: {};
} | {
to_s: {
addr?: string | null;
};
};
export type Decimal256 = string;
export interface AveragePriceResponse {
Expand Down Expand Up @@ -153,4 +157,5 @@ export interface StreamResponse {
stream_admin: string;
treasury: string;
url?: string | null;
}
}
export type String = string;

0 comments on commit 0363905

Please sign in to comment.