diff --git a/examples/telescope-with-contracts/.eslintrc.json b/examples/telescope-with-contracts/.eslintrc.json new file mode 100644 index 000000000..bffb357a7 --- /dev/null +++ b/examples/telescope-with-contracts/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/examples/telescope-with-contracts/.gitignore b/examples/telescope-with-contracts/.gitignore new file mode 100644 index 000000000..c87c9b392 --- /dev/null +++ b/examples/telescope-with-contracts/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/examples/telescope-with-contracts/README.md b/examples/telescope-with-contracts/README.md new file mode 100644 index 000000000..c87e0421d --- /dev/null +++ b/examples/telescope-with-contracts/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/telescope-with-contracts/codegen/JunoSwap.client.ts b/examples/telescope-with-contracts/codegen/JunoSwap.client.ts new file mode 100644 index 000000000..188eb28d3 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/JunoSwap.client.ts @@ -0,0 +1,294 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.13.1. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { Uint128, BalanceResponse, ExecuteMsg, Expiration, Timestamp, Uint64, TokenSelect, Addr, InfoResponse, InstantiateMsg, QueryMsg, Token, Token1ForToken2PriceResponse, Token2ForToken1PriceResponse } from "./JunoSwap.types"; +export interface JunoSwapReadOnlyInterface { + contractAddress: string; + balance: ({ + address + }: { + address: string; + }) => Promise; + info: () => Promise; + token1ForToken2Price: ({ + token1Amount + }: { + token1Amount: Uint128; + }) => Promise; + token2ForToken1Price: ({ + token2Amount + }: { + token2Amount: Uint128; + }) => Promise; +} +export class JunoSwapQueryClient implements JunoSwapReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.balance = this.balance.bind(this); + this.info = this.info.bind(this); + this.token1ForToken2Price = this.token1ForToken2Price.bind(this); + this.token2ForToken1Price = this.token2ForToken1Price.bind(this); + } + + balance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + info = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info: {} + }); + }; + token1ForToken2Price = async ({ + token1Amount + }: { + token1Amount: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token1_for_token2_price: { + token1_amount: token1Amount + } + }); + }; + token2ForToken1Price = async ({ + token2Amount + }: { + token2Amount: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token2_for_token1_price: { + token2_amount: token2Amount + } + }); + }; +} +export interface JunoSwapInterface extends JunoSwapReadOnlyInterface { + contractAddress: string; + sender: string; + addLiquidity: ({ + expiration, + maxToken2, + minLiquidity, + token1Amount + }: { + expiration?: Expiration; + maxToken2: Uint128; + minLiquidity: Uint128; + token1Amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeLiquidity: ({ + amount, + expiration, + minToken1, + minToken2 + }: { + amount: Uint128; + expiration?: Expiration; + minToken1: Uint128; + minToken2: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + swapToken1ForToken2: ({ + expiration, + minToken2, + token1Amount + }: { + expiration?: Expiration; + minToken2: Uint128; + token1Amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + swapToken2ForToken1: ({ + expiration, + minToken1, + token2Amount + }: { + expiration?: Expiration; + minToken1: Uint128; + token2Amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + multiContractSwap: ({ + expiration, + inputToken, + inputTokenAmount, + outputAmmAddress, + outputMinToken, + outputToken + }: { + expiration?: Expiration; + inputToken: TokenSelect; + inputTokenAmount: Uint128; + outputAmmAddress: Addr; + outputMinToken: Uint128; + outputToken: TokenSelect; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + swapTo: ({ + expiration, + inputAmount, + inputToken, + minToken, + recipient + }: { + expiration?: Expiration; + inputAmount: Uint128; + inputToken: TokenSelect; + minToken: Uint128; + recipient: Addr; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class JunoSwapClient extends JunoSwapQueryClient implements JunoSwapInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addLiquidity = this.addLiquidity.bind(this); + this.removeLiquidity = this.removeLiquidity.bind(this); + this.swapToken1ForToken2 = this.swapToken1ForToken2.bind(this); + this.swapToken2ForToken1 = this.swapToken2ForToken1.bind(this); + this.multiContractSwap = this.multiContractSwap.bind(this); + this.swapTo = this.swapTo.bind(this); + } + + addLiquidity = async ({ + expiration, + maxToken2, + minLiquidity, + token1Amount + }: { + expiration?: Expiration; + maxToken2: Uint128; + minLiquidity: Uint128; + token1Amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_liquidity: { + expiration, + max_token2: maxToken2, + min_liquidity: minLiquidity, + token1_amount: token1Amount + } + }, fee, memo, funds); + }; + removeLiquidity = async ({ + amount, + expiration, + minToken1, + minToken2 + }: { + amount: Uint128; + expiration?: Expiration; + minToken1: Uint128; + minToken2: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_liquidity: { + amount, + expiration, + min_token1: minToken1, + min_token2: minToken2 + } + }, fee, memo, funds); + }; + swapToken1ForToken2 = async ({ + expiration, + minToken2, + token1Amount + }: { + expiration?: Expiration; + minToken2: Uint128; + token1Amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + swap_token1_for_token2: { + expiration, + min_token2: minToken2, + token1_amount: token1Amount + } + }, fee, memo, funds); + }; + swapToken2ForToken1 = async ({ + expiration, + minToken1, + token2Amount + }: { + expiration?: Expiration; + minToken1: Uint128; + token2Amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + swap_token2_for_token1: { + expiration, + min_token1: minToken1, + token2_amount: token2Amount + } + }, fee, memo, funds); + }; + multiContractSwap = async ({ + expiration, + inputToken, + inputTokenAmount, + outputAmmAddress, + outputMinToken, + outputToken + }: { + expiration?: Expiration; + inputToken: TokenSelect; + inputTokenAmount: Uint128; + outputAmmAddress: Addr; + outputMinToken: Uint128; + outputToken: TokenSelect; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + multi_contract_swap: { + expiration, + input_token: inputToken, + input_token_amount: inputTokenAmount, + output_amm_address: outputAmmAddress, + output_min_token: outputMinToken, + output_token: outputToken + } + }, fee, memo, funds); + }; + swapTo = async ({ + expiration, + inputAmount, + inputToken, + minToken, + recipient + }: { + expiration?: Expiration; + inputAmount: Uint128; + inputToken: TokenSelect; + minToken: Uint128; + recipient: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + swap_to: { + expiration, + input_amount: inputAmount, + input_token: inputToken, + min_token: minToken, + recipient + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/JunoSwap.types.ts b/examples/telescope-with-contracts/codegen/JunoSwap.types.ts new file mode 100644 index 000000000..c5dae2f44 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/JunoSwap.types.ts @@ -0,0 +1,125 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.13.1. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export interface BalanceResponse { + balance: Uint128; + [k: string]: unknown; +} +export type ExecuteMsg = { + add_liquidity: { + expiration?: Expiration | null; + max_token2: Uint128; + min_liquidity: Uint128; + token1_amount: Uint128; + [k: string]: unknown; + }; +} | { + remove_liquidity: { + amount: Uint128; + expiration?: Expiration | null; + min_token1: Uint128; + min_token2: Uint128; + [k: string]: unknown; + }; +} | { + swap_token1_for_token2: { + expiration?: Expiration | null; + min_token2: Uint128; + token1_amount: Uint128; + [k: string]: unknown; + }; +} | { + swap_token2_for_token1: { + expiration?: Expiration | null; + min_token1: Uint128; + token2_amount: Uint128; + [k: string]: unknown; + }; +} | { + multi_contract_swap: { + expiration?: Expiration | null; + input_token: TokenSelect; + input_token_amount: Uint128; + output_amm_address: Addr; + output_min_token: Uint128; + output_token: TokenSelect; + [k: string]: unknown; + }; +} | { + swap_to: { + expiration?: Expiration | null; + input_amount: Uint128; + input_token: TokenSelect; + min_token: Uint128; + recipient: Addr; + [k: string]: unknown; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: { + [k: string]: unknown; + }; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type TokenSelect = "Token1" | "Token2"; +export type Addr = string; +export interface InfoResponse { + lp_token_supply: Uint128; + token1_address?: string | null; + token1_denom: string; + token1_reserve: Uint128; + token2_address?: string | null; + token2_denom: string; + token2_reserve: Uint128; + [k: string]: unknown; +} +export interface InstantiateMsg { + token1_address?: Addr | null; + token1_denom: string; + token2_address?: Addr | null; + token2_denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + balance: { + address: string; + [k: string]: unknown; + }; +} | { + info: { + [k: string]: unknown; + }; +} | { + token1_for_token2_price: { + token1_amount: Uint128; + [k: string]: unknown; + }; +} | { + token2_for_token1_price: { + token2_amount: Uint128; + [k: string]: unknown; + }; +}; +export interface Token { + address?: Addr | null; + denom: string; + reserve: Uint128; + [k: string]: unknown; +} +export interface Token1ForToken2PriceResponse { + token2_amount: Uint128; + [k: string]: unknown; +} +export interface Token2ForToken1PriceResponse { + token1_amount: Uint128; + [k: string]: unknown; +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/contracts.ts b/examples/telescope-with-contracts/codegen/contracts.ts new file mode 100644 index 000000000..205908413 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/contracts.ts @@ -0,0 +1,13 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.13.1. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _0 from "./JunoSwap.types"; +import * as _1 from "./JunoSwap.client"; +export namespace contracts { + export const JunoSwap = { ..._0, + ..._1 + }; +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/bundle.ts b/examples/telescope-with-contracts/codegen/google/bundle.ts new file mode 100644 index 000000000..a84164676 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/bundle.ts @@ -0,0 +1,17 @@ +import * as _0 from "./protobuf/any"; +import * as _1 from "./protobuf/duration"; +import * as _2 from "./protobuf/timestamp"; +import * as _3 from "./protobuf/empty"; +import * as _4 from "./protobuf/struct"; +import * as _5 from "./protobuf/wrappers"; +import * as _6 from "./protobuf/field_mask"; +export namespace google { + export const protobuf = { ..._0, + ..._1, + ..._2, + ..._3, + ..._4, + ..._5, + ..._6 + }; +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/any.ts b/examples/telescope-with-contracts/codegen/google/protobuf/any.ts new file mode 100644 index 000000000..897c0029e --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/any.ts @@ -0,0 +1,188 @@ +import * as _m0 from "protobufjs/minimal"; +import { isSet, bytesFromBase64, base64FromBytes } from "@osmonauts/helpers"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { + typeUrl: "", + value: new Uint8Array() + }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + + case 2: + message.value = reader.bytes(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: Partial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/duration.ts b/examples/telescope-with-contracts/codegen/google/protobuf/duration.ts new file mode 100644 index 000000000..4438b0c5f --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/duration.ts @@ -0,0 +1,150 @@ +import * as _m0 from "protobufjs/minimal"; +import { Long, isSet } from "@osmonauts/helpers"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: Long; + + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +function createBaseDuration(): Duration { + return { + seconds: Long.ZERO, + nanos: 0 + }; +} + +export const Duration = { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.seconds.isZero()) { + writer.uint32(8).int64(message.seconds); + } + + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Duration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.seconds = (reader.int64() as Long); + break; + + case 2: + message.nanos = reader.int32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Duration { + return { + seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial(object: Partial): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO; + message.nanos = object.nanos ?? 0; + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/empty.ts b/examples/telescope-with-contracts/codegen/google/protobuf/empty.ts new file mode 100644 index 000000000..19603f65e --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/empty.ts @@ -0,0 +1,57 @@ +import * as _m0 from "protobufjs/minimal"; + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface Empty {} + +function createBaseEmpty(): Empty { + return {}; +} + +export const Empty = { + encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Empty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): Empty { + return {}; + }, + + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: Partial): Empty { + const message = createBaseEmpty(); + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/field_mask.ts b/examples/telescope-with-contracts/codegen/google/protobuf/field_mask.ts new file mode 100644 index 000000000..dd95f4984 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/field_mask.ts @@ -0,0 +1,270 @@ +import * as _m0 from "protobufjs/minimal"; + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + */ +export interface FieldMask { + /** The set of field mask paths. */ + paths: string[]; +} + +function createBaseFieldMask(): FieldMask { + return { + paths: [] + }; +} + +export const FieldMask = { + encode(message: FieldMask, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldMask { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldMask(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): FieldMask { + return { + paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => String(e)) : [] + }; + }, + + toJSON(message: FieldMask): unknown { + const obj: any = {}; + + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = []; + } + + return obj; + }, + + fromPartial(object: Partial): FieldMask { + const message = createBaseFieldMask(); + message.paths = object.paths?.map(e => e) || []; + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/struct.ts b/examples/telescope-with-contracts/codegen/google/protobuf/struct.ts new file mode 100644 index 000000000..a77781660 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/struct.ts @@ -0,0 +1,428 @@ +//@ts-nocheck +import * as _m0 from "protobufjs/minimal"; +import { isSet, isObject } from "@osmonauts/helpers"; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1, +} +export function nullValueFromJSON(object: any): NullValue { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} +export function nullValueToJSON(object: NullValue): string { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + + default: + return "UNKNOWN"; + } +} +export interface Struct_FieldsEntry { + key: string; + value: Value | undefined; +} + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { + [key: string]: Value | undefined; + }; +} + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** Represents a null value. */ + nullValue?: NullValue; + + /** Represents a double value. */ + numberValue?: number; + + /** Represents a string value. */ + stringValue?: string; + + /** Represents a boolean value. */ + boolValue?: boolean; + + /** Represents a structured value. */ + structValue?: Struct | undefined; + + /** Represents a repeated `Value`. */ + listValue?: ListValue | undefined; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: Value[]; +} + +function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { + return { + key: "", + value: undefined + }; +} + +export const Struct_FieldsEntry = { + encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + + if (message.value !== undefined) { + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct_FieldsEntry(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + + case 2: + message.value = Value.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Struct_FieldsEntry { + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? Value.fromJSON(object.value) : undefined + }; + }, + + toJSON(message: Struct_FieldsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value ? Value.toJSON(message.value) : undefined); + return obj; + }, + + fromPartial(object: Partial): Struct_FieldsEntry { + const message = createBaseStruct_FieldsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? Value.fromPartial(object.value) : undefined; + return message; + } + +}; + +function createBaseStruct(): Struct { + return { + fields: {} + }; +} + +export const Struct = { + encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + Object.entries(message.fields).forEach(([key, value]) => { + Struct_FieldsEntry.encode({ + key: (key as any), + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Struct { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); + + if (entry1.value !== undefined) { + message.fields[entry1.key] = entry1.value; + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Struct { + return { + fields: isObject(object.fields) ? Object.entries(object.fields).reduce<{ + [key: string]: Value; + }>((acc, [key, value]) => { + acc[key] = Value.fromJSON(value); + return acc; + }, {}) : {} + }; + }, + + toJSON(message: Struct): unknown { + const obj: any = {}; + obj.fields = {}; + + if (message.fields) { + Object.entries(message.fields).forEach(([k, v]) => { + obj.fields[k] = Value.toJSON(v); + }); + } + + return obj; + }, + + fromPartial(object: Partial): Struct { + const message = createBaseStruct(); + message.fields = Object.entries(object.fields ?? {}).reduce<{ + [key: string]: Value; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Value.fromPartial(value); + } + + return acc; + }, {}); + return message; + } + +}; + +function createBaseValue(): Value { + return { + nullValue: undefined, + numberValue: undefined, + stringValue: undefined, + boolValue: undefined, + structValue: undefined, + listValue: undefined + }; +} + +export const Value = { + encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nullValue !== undefined) { + writer.uint32(8).int32(message.nullValue); + } + + if (message.numberValue !== undefined) { + writer.uint32(17).double(message.numberValue); + } + + if (message.stringValue !== undefined) { + writer.uint32(26).string(message.stringValue); + } + + if (message.boolValue !== undefined) { + writer.uint32(32).bool(message.boolValue); + } + + if (message.structValue !== undefined) { + Struct.encode(message.structValue, writer.uint32(42).fork()).ldelim(); + } + + if (message.listValue !== undefined) { + ListValue.encode(message.listValue, writer.uint32(50).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nullValue = (reader.int32() as any); + break; + + case 2: + message.numberValue = reader.double(); + break; + + case 3: + message.stringValue = reader.string(); + break; + + case 4: + message.boolValue = reader.bool(); + break; + + case 5: + message.structValue = Struct.decode(reader, reader.uint32()); + break; + + case 6: + message.listValue = ListValue.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Value { + return { + nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined, + numberValue: isSet(object.numberValue) ? Number(object.numberValue) : undefined, + stringValue: isSet(object.stringValue) ? String(object.stringValue) : undefined, + boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined, + structValue: isSet(object.structValue) ? Struct.fromJSON(object.structValue) : undefined, + listValue: isSet(object.listValue) ? ListValue.fromJSON(object.listValue) : undefined + }; + }, + + toJSON(message: Value): unknown { + const obj: any = {}; + message.nullValue !== undefined && (obj.nullValue = nullValueToJSON(message.nullValue)); + message.numberValue !== undefined && (obj.numberValue = message.numberValue); + message.stringValue !== undefined && (obj.stringValue = message.stringValue); + message.boolValue !== undefined && (obj.boolValue = message.boolValue); + message.structValue !== undefined && (obj.structValue = message.structValue ? Struct.toJSON(message.structValue) : undefined); + message.listValue !== undefined && (obj.listValue = message.listValue ? ListValue.toJSON(message.listValue) : undefined); + return obj; + }, + + fromPartial(object: Partial): Value { + const message = createBaseValue(); + message.nullValue = object.nullValue ?? undefined; + message.numberValue = object.numberValue ?? undefined; + message.stringValue = object.stringValue ?? undefined; + message.boolValue = object.boolValue ?? undefined; + message.structValue = object.structValue !== undefined && object.structValue !== null ? Struct.fromPartial(object.structValue) : undefined; + message.listValue = object.listValue !== undefined && object.listValue !== null ? ListValue.fromPartial(object.listValue) : undefined; + return message; + } + +}; + +function createBaseListValue(): ListValue { + return { + values: [] + }; +} + +export const ListValue = { + encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.values) { + Value.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.values.push(Value.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): ListValue { + return { + values: Array.isArray(object?.values) ? object.values.map((e: any) => Value.fromJSON(e)) : [] + }; + }, + + toJSON(message: ListValue): unknown { + const obj: any = {}; + + if (message.values) { + obj.values = message.values.map(e => e ? Value.toJSON(e) : undefined); + } else { + obj.values = []; + } + + return obj; + }, + + fromPartial(object: Partial): ListValue { + const message = createBaseListValue(); + message.values = object.values?.map(e => Value.fromPartial(e)) || []; + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/timestamp.ts b/examples/telescope-with-contracts/codegen/google/protobuf/timestamp.ts new file mode 100644 index 000000000..4811fdd08 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/timestamp.ts @@ -0,0 +1,172 @@ +import * as _m0 from "protobufjs/minimal"; +import { Long, isSet } from "@osmonauts/helpers"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +function createBaseTimestamp(): Timestamp { + return { + seconds: Long.ZERO, + nanos: 0 + }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.seconds.isZero()) { + writer.uint32(8).int64(message.seconds); + } + + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.seconds = (reader.int64() as Long); + break; + + case 2: + message.nanos = reader.int32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Timestamp { + return { + seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, + + fromPartial(object: Partial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO; + message.nanos = object.nanos ?? 0; + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/google/protobuf/wrappers.ts b/examples/telescope-with-contracts/codegen/google/protobuf/wrappers.ts new file mode 100644 index 000000000..5ded8df66 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/google/protobuf/wrappers.ts @@ -0,0 +1,605 @@ +import * as _m0 from "protobufjs/minimal"; +import { isSet, Long, bytesFromBase64, base64FromBytes } from "@osmonauts/helpers"; + +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + */ +export interface DoubleValue { + /** The double value. */ + value: number; +} + +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + */ +export interface FloatValue { + /** The float value. */ + value: number; +} + +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + */ +export interface Int64Value { + /** The int64 value. */ + value: Long; +} + +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + */ +export interface UInt64Value { + /** The uint64 value. */ + value: Long; +} + +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + */ +export interface Int32Value { + /** The int32 value. */ + value: number; +} + +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + */ +export interface UInt32Value { + /** The uint32 value. */ + value: number; +} + +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + */ +export interface BoolValue { + /** The bool value. */ + value: boolean; +} + +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + */ +export interface StringValue { + /** The string value. */ + value: string; +} + +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + */ +export interface BytesValue { + /** The bytes value. */ + value: Uint8Array; +} + +function createBaseDoubleValue(): DoubleValue { + return { + value: 0 + }; +} + +export const DoubleValue = { + encode(message: DoubleValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== 0) { + writer.uint32(9).double(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DoubleValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): DoubleValue { + return { + value: isSet(object.value) ? Number(object.value) : 0 + }; + }, + + toJSON(message: DoubleValue): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: Partial): DoubleValue { + const message = createBaseDoubleValue(); + message.value = object.value ?? 0; + return message; + } + +}; + +function createBaseFloatValue(): FloatValue { + return { + value: 0 + }; +} + +export const FloatValue = { + encode(message: FloatValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== 0) { + writer.uint32(13).float(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FloatValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFloatValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): FloatValue { + return { + value: isSet(object.value) ? Number(object.value) : 0 + }; + }, + + toJSON(message: FloatValue): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: Partial): FloatValue { + const message = createBaseFloatValue(); + message.value = object.value ?? 0; + return message; + } + +}; + +function createBaseInt64Value(): Int64Value { + return { + value: Long.ZERO + }; +} + +export const Int64Value = { + encode(message: Int64Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.value.isZero()) { + writer.uint32(8).int64(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Int64Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt64Value(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = (reader.int64() as Long); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Int64Value { + return { + value: isSet(object.value) ? Long.fromString(object.value) : Long.ZERO + }; + }, + + toJSON(message: Int64Value): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = (message.value || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: Partial): Int64Value { + const message = createBaseInt64Value(); + message.value = object.value !== undefined && object.value !== null ? Long.fromValue(object.value) : Long.ZERO; + return message; + } + +}; + +function createBaseUInt64Value(): UInt64Value { + return { + value: Long.UZERO + }; +} + +export const UInt64Value = { + encode(message: UInt64Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.value.isZero()) { + writer.uint32(8).uint64(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UInt64Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt64Value(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = (reader.uint64() as Long); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UInt64Value { + return { + value: isSet(object.value) ? Long.fromString(object.value) : Long.UZERO + }; + }, + + toJSON(message: UInt64Value): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = (message.value || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: Partial): UInt64Value { + const message = createBaseUInt64Value(); + message.value = object.value !== undefined && object.value !== null ? Long.fromValue(object.value) : Long.UZERO; + return message; + } + +}; + +function createBaseInt32Value(): Int32Value { + return { + value: 0 + }; +} + +export const Int32Value = { + encode(message: Int32Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Int32Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt32Value(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Int32Value { + return { + value: isSet(object.value) ? Number(object.value) : 0 + }; + }, + + toJSON(message: Int32Value): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = Math.round(message.value)); + return obj; + }, + + fromPartial(object: Partial): Int32Value { + const message = createBaseInt32Value(); + message.value = object.value ?? 0; + return message; + } + +}; + +function createBaseUInt32Value(): UInt32Value { + return { + value: 0 + }; +} + +export const UInt32Value = { + encode(message: UInt32Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== 0) { + writer.uint32(8).uint32(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UInt32Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt32Value(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UInt32Value { + return { + value: isSet(object.value) ? Number(object.value) : 0 + }; + }, + + toJSON(message: UInt32Value): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = Math.round(message.value)); + return obj; + }, + + fromPartial(object: Partial): UInt32Value { + const message = createBaseUInt32Value(); + message.value = object.value ?? 0; + return message; + } + +}; + +function createBaseBoolValue(): BoolValue { + return { + value: false + }; +} + +export const BoolValue = { + encode(message: BoolValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value === true) { + writer.uint32(8).bool(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BoolValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoolValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): BoolValue { + return { + value: isSet(object.value) ? Boolean(object.value) : false + }; + }, + + toJSON(message: BoolValue): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: Partial): BoolValue { + const message = createBaseBoolValue(); + message.value = object.value ?? false; + return message; + } + +}; + +function createBaseStringValue(): StringValue { + return { + value: "" + }; +} + +export const StringValue = { + encode(message: StringValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== "") { + writer.uint32(10).string(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StringValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): StringValue { + return { + value: isSet(object.value) ? String(object.value) : "" + }; + }, + + toJSON(message: StringValue): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: Partial): StringValue { + const message = createBaseStringValue(); + message.value = object.value ?? ""; + return message; + } + +}; + +function createBaseBytesValue(): BytesValue { + return { + value: new Uint8Array() + }; +} + +export const BytesValue = { + encode(message: BytesValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value.length !== 0) { + writer.uint32(10).bytes(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BytesValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBytesValue(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): BytesValue { + return { + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() + }; + }, + + toJSON(message: BytesValue): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: Partial): BytesValue { + const message = createBaseBytesValue(); + message.value = object.value ?? new Uint8Array(); + return message; + } + +}; \ No newline at end of file diff --git a/examples/telescope-with-contracts/codegen/index.ts b/examples/telescope-with-contracts/codegen/index.ts new file mode 100644 index 000000000..9f561ae27 --- /dev/null +++ b/examples/telescope-with-contracts/codegen/index.ts @@ -0,0 +1,8 @@ +/** + * This file and any referenced files were automatically generated by @osmonauts/telescope@0.18.7 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +export * from "./google/bundle"; +export * from "./contracts"; \ No newline at end of file diff --git a/examples/telescope-with-contracts/components/astronaut.tsx b/examples/telescope-with-contracts/components/astronaut.tsx new file mode 100644 index 000000000..572884aa7 --- /dev/null +++ b/examples/telescope-with-contracts/components/astronaut.tsx @@ -0,0 +1,304 @@ +export const Astronaut = (props: any) => ( + + {'cosmology-astronaut'} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); diff --git a/examples/telescope-with-contracts/components/features.tsx b/examples/telescope-with-contracts/components/features.tsx new file mode 100644 index 000000000..37852ca15 --- /dev/null +++ b/examples/telescope-with-contracts/components/features.tsx @@ -0,0 +1,45 @@ +import { LinkIcon } from '@chakra-ui/icons'; +import { + Box, + Heading, + HStack, + Icon, + Link, + Text, + VStack +} from '@chakra-ui/react'; +import { FeatureProps } from './types'; + +export const Product = ({ title, text, href }: FeatureProps) => { + return ( + + + {title} → + {text} + + + ); +}; + +export const Dependency = ({ title, text, href }: FeatureProps) => { + return ( + + + + + + + + {title} + + + {text} + + + ); +}; diff --git a/examples/telescope-with-contracts/components/index.tsx b/examples/telescope-with-contracts/components/index.tsx new file mode 100644 index 000000000..fbf3bb494 --- /dev/null +++ b/examples/telescope-with-contracts/components/index.tsx @@ -0,0 +1,5 @@ +export * from './types'; +export * from './wallet-connect'; +export * from './user-info'; +export * from './astronaut'; +export * from './features'; diff --git a/examples/telescope-with-contracts/components/types.tsx b/examples/telescope-with-contracts/components/types.tsx new file mode 100644 index 000000000..93f463d0e --- /dev/null +++ b/examples/telescope-with-contracts/components/types.tsx @@ -0,0 +1,38 @@ +import { MouseEventHandler, ReactNode } from 'react'; +import { IconType } from 'react-icons'; + +export interface ChooseChainInfo { + chainId: string; + chainRoute?: string; + label: string; + value: string; + icon?: string; + disabled?: boolean; +} + +export enum WalletStatus { + NotInit = 'NotInit', + Loading = 'Loading', + Loaded = 'Loaded', + NotExist = 'NotExist', + Rejected = 'Rejected' +} + +export interface ConnectWalletType { + buttonText?: string; + isLoading?: boolean; + isDisabled?: boolean; + icon?: IconType; + onClickConnectBtn?: MouseEventHandler; +} + +export interface ConnectedUserCardType { + userName: string; + icon?: ReactNode; +} + +export interface FeatureProps { + title: string; + text: string; + href: string; +} diff --git a/examples/telescope-with-contracts/components/user-info.tsx b/examples/telescope-with-contracts/components/user-info.tsx new file mode 100644 index 000000000..14534b5b4 --- /dev/null +++ b/examples/telescope-with-contracts/components/user-info.tsx @@ -0,0 +1,54 @@ +import React, { ReactNode } from 'react'; +import { Text, useColorModeValue, Stack, Box } from '@chakra-ui/react'; +import { ConnectedUserCardType } from './types'; + +export const ConnectedUserCard = ({ + userName, + icon +}: ConnectedUserCardType) => { + return ( + + + {icon} + + + {userName} + + + ); +}; + +export const ConnectedUserInfo = ({ + name, + icon +}: { + name: string; + icon?: ReactNode; +}) => { + return ; +}; diff --git a/examples/telescope-with-contracts/components/wallet-connect.tsx b/examples/telescope-with-contracts/components/wallet-connect.tsx new file mode 100644 index 000000000..bdb2fdc72 --- /dev/null +++ b/examples/telescope-with-contracts/components/wallet-connect.tsx @@ -0,0 +1,121 @@ +import React, { MouseEventHandler, ReactNode } from 'react'; +import { Button, Icon, Stack, Text, useColorModeValue } from '@chakra-ui/react'; +import { FiAlertTriangle } from 'react-icons/fi'; +import { WalletStatus } from './types'; +import { IoWallet } from 'react-icons/io5'; +import { ConnectWalletType } from './types'; + +export const ConnectWalletButton = ({ + buttonText, + isLoading, + isDisabled, + icon, + onClickConnectBtn +}: ConnectWalletType) => { + return ( + + ); +}; + +export const Disconnect = ({ + buttonText, + onClick +}: { + buttonText: string; + onClick: MouseEventHandler; +}) => { + return ( + + ); +}; + +export const Connected = ({ + buttonText, + onClick +}: { + buttonText: string; + onClick: MouseEventHandler; +}) => { + return ( + + ); +}; + +export const Connecting = () => { + return ; +}; + +export const Rejected = ({ + buttonText, + wordOfWarning +}: { + buttonText: string; + wordOfWarning?: string; +}) => { + return ( + + + + + + + Warning:  + + {wordOfWarning} + + + + ); +}; + +export const NotExist = ({ buttonText }: { buttonText: string }) => { + return ; +}; + +export const WalletConnectComponent = ({ + walletStatus, + disconnect, + connecting, + connected, + rejected, + notExist +}: { + walletStatus: WalletStatus; + disconnect: ReactNode; + connecting: ReactNode; + connected: ReactNode; + rejected: ReactNode; + notExist: ReactNode; +}) => { + switch (walletStatus) { + case WalletStatus.NotInit: + return <>{disconnect}; + case WalletStatus.Loading: + return <>{connecting}; + case WalletStatus.Loaded: + return <>{connected}; + case WalletStatus.Rejected: + return <>{rejected}; + case WalletStatus.NotExist: + return <>{notExist}; + default: + return <>{disconnect}; + } +}; diff --git a/examples/telescope-with-contracts/config/features.ts b/examples/telescope-with-contracts/config/features.ts new file mode 100644 index 000000000..0b085303d --- /dev/null +++ b/examples/telescope-with-contracts/config/features.ts @@ -0,0 +1,47 @@ +import { FeatureProps } from "../components"; + +export const products: FeatureProps[] = [ + { + title: 'CosmosKit', + text: 'A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.', + href: 'https://github.com/cosmology-tech/cosmos-kit', + }, + { + title: 'Telescope', + text: 'A TypeScript Transpiler for Cosmos Protobufs to generate libraries for Cosmos blockchains.', + href: 'https://github.com/osmosis-labs/telescope', + }, + { + title: 'TS Codegen', + text: 'The quickest and easiest way to convert CosmWasm Contracts into dev-friendly TypeScript classes.', + href: 'https://github.com/CosmWasm/ts-codegen', + }, + { + title: 'Cosmology', + text: 'Build web3 applications in the Cosmos and Intechain Ecosystem.', + href: 'https://github.com/cosmology-tech/cosmology', + }, + { + title: 'Chain Registry', + text: 'The npm package for the Official Cosmos chain registry.', + href: 'https://github.com/cosmology-tech/chain-registry', + }, + { + title: 'Videos', + text: 'Learn more from the official Cosmology website.', + href: 'https://cosmology.tech/', + } +] + +export const dependencies: FeatureProps[] = [ + { + title: 'Chakra UI', + text: 'A simple, modular and accessible React Component Library.', + href: 'https://chakra-ui.com/' + }, + { + title: 'Next.js', + text: 'A React Framework supports hybrid static & server rendering.', + href: 'https://nextjs.org/' + } +]; \ No newline at end of file diff --git a/examples/telescope-with-contracts/config/index.ts b/examples/telescope-with-contracts/config/index.ts new file mode 100644 index 000000000..f97c1231f --- /dev/null +++ b/examples/telescope-with-contracts/config/index.ts @@ -0,0 +1,2 @@ +export * from './theme'; +export * from './features'; \ No newline at end of file diff --git a/examples/telescope-with-contracts/config/theme.ts b/examples/telescope-with-contracts/config/theme.ts new file mode 100644 index 000000000..b50e4954e --- /dev/null +++ b/examples/telescope-with-contracts/config/theme.ts @@ -0,0 +1,65 @@ +import { extendTheme } from "@chakra-ui/react" + +export const defaultThemeObject = { + fonts: { + body: 'Inter, system-ui, sans-serif', + heading: 'Work Sans, system-ui, sans-serif', + }, + colors: { + primary: { + '50': '#e5e7f9', + '100': '#bec4ef', + '200': '#929ce4', + '300': '#6674d9', + '400': '#4657d1', + '500': '#2539c9', + '600': '#2133c3', + '700': '#1b2cbc', + '800': '#1624b5', + '900': '#0d17a9', + }, + }, + breakPoints: { + sm: '30em', + md: '48em', + lg: '62em', + xl: '80em', + '2xl': '96em', + }, + shadows: { + largeSoft: 'rgba(60, 64, 67, 0.15) 0px 2px 10px 6px;', + }, + styles: { + global: { + 'html, #__next': { + height: '100%', + }, + '#__next': { + display: 'flex', + flexDirection: 'column', + }, + '.body': { + // todo check how to do this without breaking the site + // height: '100%', // Push footer to bottom + overflowY: 'scroll', // Always show scrollbar to avoid flickering + }, + html: { + scrollBehavior: 'smooth', + }, + '#nprogress': { + pointerEvents: 'none', + }, + '#nprogress .bar': { + background: 'green.200', + position: 'fixed', + zIndex: '1031', + top: 0, + left: 0, + width: '100%', + height: '2px', + }, + }, + }, +}; + +export const defaultTheme = extendTheme(defaultThemeObject); diff --git a/examples/telescope-with-contracts/contracts/wasmswap/LICENSE b/examples/telescope-with-contracts/contracts/wasmswap/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/examples/telescope-with-contracts/contracts/wasmswap/README.md b/examples/telescope-with-contracts/contracts/wasmswap/README.md new file mode 100644 index 000000000..6b15e40e9 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/README.md @@ -0,0 +1 @@ +# WasmSwap \ No newline at end of file diff --git a/examples/telescope-with-contracts/contracts/wasmswap/package.json b/examples/telescope-with-contracts/contracts/wasmswap/package.json new file mode 100644 index 000000000..fb9c19073 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/package.json @@ -0,0 +1,21 @@ +{ + "name": "@cosmjson/wasmswap", + "chain": "juno", + "contract": "wasmswap", + "version": "0.0.9", + "description": "wasmswap", + "author": "Dan Lynch ", + "homepage": "https://github.com/cosmology-tech/cosmjson/tree/master/packages/wasmswap#readme", + "license": "SEE LICENSE IN LICENSE", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/cosmology-tech/cosmjson" + }, + "bugs": { + "url": "https://github.com/cosmology-tech/cosmjson/issues" + }, + "gitHead": "236741e84afac1df89b843b04f608e26c1edf0df" +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/balance_response.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/balance_response.json new file mode 100644 index 000000000..4e1a0be2b --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/balance_response.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "BalanceResponse", + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "$ref": "#/definitions/Uint128" + } + }, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/execute_msg.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/execute_msg.json new file mode 100644 index 000000000..ebbd4f7eb --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/execute_msg.json @@ -0,0 +1,313 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "type": "object", + "required": [ + "add_liquidity" + ], + "properties": { + "add_liquidity": { + "type": "object", + "required": [ + "max_token2", + "min_liquidity", + "token1_amount" + ], + "properties": { + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "max_token2": { + "$ref": "#/definitions/Uint128" + }, + "min_liquidity": { + "$ref": "#/definitions/Uint128" + }, + "token1_amount": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "remove_liquidity" + ], + "properties": { + "remove_liquidity": { + "type": "object", + "required": [ + "amount", + "min_token1", + "min_token2" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "min_token1": { + "$ref": "#/definitions/Uint128" + }, + "min_token2": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "swap_token1_for_token2" + ], + "properties": { + "swap_token1_for_token2": { + "type": "object", + "required": [ + "min_token2", + "token1_amount" + ], + "properties": { + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "min_token2": { + "$ref": "#/definitions/Uint128" + }, + "token1_amount": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "swap_token2_for_token1" + ], + "properties": { + "swap_token2_for_token1": { + "type": "object", + "required": [ + "min_token1", + "token2_amount" + ], + "properties": { + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "min_token1": { + "$ref": "#/definitions/Uint128" + }, + "token2_amount": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "multi_contract_swap" + ], + "properties": { + "multi_contract_swap": { + "type": "object", + "required": [ + "input_token", + "input_token_amount", + "output_amm_address", + "output_min_token", + "output_token" + ], + "properties": { + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "input_token": { + "$ref": "#/definitions/TokenSelect" + }, + "input_token_amount": { + "$ref": "#/definitions/Uint128" + }, + "output_amm_address": { + "$ref": "#/definitions/Addr" + }, + "output_min_token": { + "$ref": "#/definitions/Uint128" + }, + "output_token": { + "$ref": "#/definitions/TokenSelect" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "swap_to" + ], + "properties": { + "swap_to": { + "type": "object", + "required": [ + "input_amount", + "input_token", + "min_token", + "recipient" + ], + "properties": { + "expiration": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "input_amount": { + "$ref": "#/definitions/Uint128" + }, + "input_token": { + "$ref": "#/definitions/TokenSelect" + }, + "min_token": { + "$ref": "#/definitions/Uint128" + }, + "recipient": { + "$ref": "#/definitions/Addr" + } + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "anyOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "TokenSelect": { + "type": "string", + "enum": [ + "Token1", + "Token2" + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/info_response.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/info_response.json new file mode 100644 index 000000000..573d1a048 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/info_response.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InfoResponse", + "type": "object", + "required": [ + "lp_token_supply", + "token1_denom", + "token1_reserve", + "token2_denom", + "token2_reserve" + ], + "properties": { + "lp_token_supply": { + "$ref": "#/definitions/Uint128" + }, + "token1_address": { + "type": [ + "string", + "null" + ] + }, + "token1_denom": { + "type": "string" + }, + "token1_reserve": { + "$ref": "#/definitions/Uint128" + }, + "token2_address": { + "type": [ + "string", + "null" + ] + }, + "token2_denom": { + "type": "string" + }, + "token2_reserve": { + "$ref": "#/definitions/Uint128" + } + }, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/instantiate_msg.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/instantiate_msg.json new file mode 100644 index 000000000..82b145a09 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/instantiate_msg.json @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "token1_denom", + "token2_denom" + ], + "properties": { + "token1_address": { + "anyOf": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "null" + } + ] + }, + "token1_denom": { + "type": "string" + }, + "token2_address": { + "anyOf": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "null" + } + ] + }, + "token2_denom": { + "type": "string" + } + }, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/query_msg.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/query_msg.json new file mode 100644 index 000000000..dd6ca9139 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/query_msg.json @@ -0,0 +1,85 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "description": "Implements CW20. Returns the current balance of the given address, 0 if unset.", + "type": "object", + "required": [ + "balance" + ], + "properties": { + "balance": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "info" + ], + "properties": { + "info": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "token1_for_token2_price" + ], + "properties": { + "token1_for_token2_price": { + "type": "object", + "required": [ + "token1_amount" + ], + "properties": { + "token1_amount": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "token2_for_token1_price" + ], + "properties": { + "token2_for_token1_price": { + "type": "object", + "required": [ + "token2_amount" + ], + "properties": { + "token2_amount": { + "$ref": "#/definitions/Uint128" + } + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/token.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/token.json new file mode 100644 index 000000000..a12f172f9 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/token.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Token", + "type": "object", + "required": [ + "denom", + "reserve" + ], + "properties": { + "address": { + "anyOf": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "null" + } + ] + }, + "denom": { + "type": "string" + }, + "reserve": { + "$ref": "#/definitions/Uint128" + } + }, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/token1_for_token2_price_response.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/token1_for_token2_price_response.json new file mode 100644 index 000000000..28a856fd9 --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/token1_for_token2_price_response.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Token1ForToken2PriceResponse", + "type": "object", + "required": [ + "token2_amount" + ], + "properties": { + "token2_amount": { + "$ref": "#/definitions/Uint128" + } + }, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/contracts/wasmswap/schema/token2_for_token1_price_response.json b/examples/telescope-with-contracts/contracts/wasmswap/schema/token2_for_token1_price_response.json new file mode 100644 index 000000000..4548db69c --- /dev/null +++ b/examples/telescope-with-contracts/contracts/wasmswap/schema/token2_for_token1_price_response.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Token2ForToken1PriceResponse", + "type": "object", + "required": [ + "token1_amount" + ], + "properties": { + "token1_amount": { + "$ref": "#/definitions/Uint128" + } + }, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} diff --git a/examples/telescope-with-contracts/next.config.js b/examples/telescope-with-contracts/next.config.js new file mode 100644 index 000000000..ae887958d --- /dev/null +++ b/examples/telescope-with-contracts/next.config.js @@ -0,0 +1,7 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + swcMinify: true, +} + +module.exports = nextConfig diff --git a/examples/telescope-with-contracts/package.json b/examples/telescope-with-contracts/package.json new file mode 100644 index 000000000..6b79a832f --- /dev/null +++ b/examples/telescope-with-contracts/package.json @@ -0,0 +1,39 @@ +{ + "name": "@cosmonauts/connect-chain-with-telescope-and-contracts", + "version": "0.1.1", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint", + "codegen": "node scripts/codegen.js" + }, + "dependencies": { + "@chakra-ui/icons": "^2.0.8", + "@chakra-ui/react": "^2.2.8", + "@cosmjs/cosmwasm-stargate": "0.28.13", + "@cosmjs/stargate": "0.28.13", + "@cosmos-kit/react": "^0.11.0", + "@cosmos-kit/types": "^0.11.0", + "@emotion/react": "11.10.0", + "@emotion/styled": "11.10.0", + "@osmonauts/helpers": "^0.4.3", + "@osmonauts/lcd": "^0.4.0", + "framer-motion": "7.2.1", + "next": "12.2.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-icons": "^4.4.0" + }, + "devDependencies": { + "@cosmjson/wasmswap": "^0.0.9", + "@osmonauts/telescope": "0.18.7", + "@types/node": "18.7.11", + "@types/react": "18.0.17", + "@types/react-dom": "18.0.6", + "eslint": "8.22.0", + "eslint-config-next": "12.2.5", + "typescript": "4.7.4" + } +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/pages/_app.tsx b/examples/telescope-with-contracts/pages/_app.tsx new file mode 100644 index 000000000..07169c83b --- /dev/null +++ b/examples/telescope-with-contracts/pages/_app.tsx @@ -0,0 +1,42 @@ +import '../styles/globals.css'; +import type { AppProps } from 'next/app'; +import { GasPrice } from '@cosmjs/stargate'; +import { ChakraProvider } from '@chakra-ui/react'; +import { defaultTheme } from '../config'; +import { ChainInfoID } from '@cosmos-kit/types'; +import { WalletManagerProvider } from '@cosmos-kit/react'; + +const LOCAL_STORAGE_KEY = 'connectedWalletId'; + +function MyApp({ Component, pageProps }: AppProps) { + return ( +

Loading...

} + localStorageKey={LOCAL_STORAGE_KEY} + defaultChainId={ChainInfoID.Juno1} + getSigningCosmWasmClientOptions={(chainInfo) => ({ + gasPrice: GasPrice.fromString( + '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom + ) + })} + getSigningStargateClientOptions={(chainInfo) => ({ + gasPrice: GasPrice.fromString( + '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom + ) + })} + > + + + +
+ ); +} + +export default MyApp; diff --git a/examples/telescope-with-contracts/pages/api/hello.ts b/examples/telescope-with-contracts/pages/api/hello.ts new file mode 100644 index 000000000..89e4d6bd9 --- /dev/null +++ b/examples/telescope-with-contracts/pages/api/hello.ts @@ -0,0 +1,13 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import type { NextApiRequest, NextApiResponse } from 'next'; + +type Data = { + name: string; +}; + +export default function handler( + req: NextApiRequest, + res: NextApiResponse +) { + res.status(200).json({ name: 'John Doe' }); +} diff --git a/examples/telescope-with-contracts/pages/index.tsx b/examples/telescope-with-contracts/pages/index.tsx new file mode 100644 index 000000000..b2106e0ef --- /dev/null +++ b/examples/telescope-with-contracts/pages/index.tsx @@ -0,0 +1,149 @@ +import { + Box, + Divider, + Grid, + Heading, + SimpleGrid, + Text, + Stack, + Container +} from '@chakra-ui/react'; +import { + Connected, + ConnectedUserInfo, + Connecting, + Disconnect, + NotExist, + Rejected, + WalletConnectComponent, + Astronaut, + Dependency, + Product +} from '../components'; +import styles from '../styles/Home.module.css'; +import { useWalletManager, useWallet } from '@cosmos-kit/react'; +import { mapStatusFromCosmosWallet } from '../utils'; +import { MouseEventHandler } from 'react'; +import Head from 'next/head'; +import { dependencies, products } from '../config'; + +export default function Home() { + const { connect, disconnect } = useWalletManager(); + const { status, error, name, address } = useWallet(); + const walletStatus = mapStatusFromCosmosWallet(status, error as Error); + + const onClickConnect: MouseEventHandler = (e) => { + e.preventDefault(); + connect(); + }; + + const onClickDisconnect: MouseEventHandler = (e) => { + e.preventDefault(); + disconnect(); + }; + + const userInfoCard = name ? ( + } /> + ) : ( + <> + ); + + const connectWalletButton = ( + + } + connecting={} + connected={ + + } + rejected={ + + } + notExist={} + /> + ); + + return ( +
+ + Create Cosmos App + + + +
+ + + + Cosmos Apps Made Easy
+
+ + Welcome to + + CosmosKit + Telescope + Next.js + + + + {userInfoCard} + {connectWalletButton} + +
+ + {products.map((product) => ( + + ))} + + + + {dependencies.map((dependency, i) => ( + + ))} + +
+
+ +
+ ); +} diff --git a/examples/telescope-with-contracts/public/favicon.ico b/examples/telescope-with-contracts/public/favicon.ico new file mode 100644 index 000000000..aec78edd3 Binary files /dev/null and b/examples/telescope-with-contracts/public/favicon.ico differ diff --git a/examples/telescope-with-contracts/scripts/codegen.js b/examples/telescope-with-contracts/scripts/codegen.js new file mode 100644 index 000000000..d15cda137 --- /dev/null +++ b/examples/telescope-with-contracts/scripts/codegen.js @@ -0,0 +1,78 @@ +const { join, resolve } = require('path'); +const telescope = require('@osmonauts/telescope').default; + +const protoDirs = [join(__dirname, '/../proto')]; +const contractsDir = resolve(join(__dirname, '/../contracts')); +const contracts = [ + { + name: 'JunoSwap', + dir: join(contractsDir, 'wasmswap') + } +]; + +telescope({ + protoDirs, + outPath: join(__dirname, '../codegen'), + options: { + tsDisable: { + files: [ + 'ibc/core/types/v1/genesis.ts', + 'google/protobuf/descriptor.ts', + 'google/protobuf/struct.ts' + ] + }, + prototypes: { + allowUndefinedTypes: true, + fieldDefaultIsOptional: true, + includePackageVar: false, + typingsFormat: { + useDeepPartial: false, + useExact: false, + timestamp: 'date', + duration: 'duration' + }, + }, + cosmwasm: { + contracts, + outPath: join(__dirname, '../codegen'), + options: { + bundle: { + enabled: true, + bundleFile: 'contracts.ts', + scope: 'contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: false, + optionalClient: true, + version: 'v4', + mutations: true + }, + recoil: { + enabled: false + }, + messageComposer: { + enabled: false + } + } + }, + aminoEncoding: { + enabled: false + }, + lcdClients: { + enabled: true + }, + rpcClients: { + enabled: true, + camelCase: true + } + } +}).then(() => { + console.log('✨ all done!'); +}); + diff --git a/examples/telescope-with-contracts/styles/Home.module.css b/examples/telescope-with-contracts/styles/Home.module.css new file mode 100644 index 000000000..e7136f438 --- /dev/null +++ b/examples/telescope-with-contracts/styles/Home.module.css @@ -0,0 +1,25 @@ +.container { + padding: 0 2rem; +} + +.footer { + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; +} + +.footer a { + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; +} + +@media (prefers-color-scheme: dark) { + .footer { + border-color: #222; + } +} \ No newline at end of file diff --git a/examples/telescope-with-contracts/styles/globals.css b/examples/telescope-with-contracts/styles/globals.css new file mode 100644 index 000000000..4f1842163 --- /dev/null +++ b/examples/telescope-with-contracts/styles/globals.css @@ -0,0 +1,26 @@ +html, +body { + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, + Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; +} + +a { + color: inherit; + text-decoration: none; +} + +* { + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + html { + color-scheme: dark; + } + body { + color: white; + background: black; + } +} diff --git a/examples/telescope-with-contracts/tsconfig.json b/examples/telescope-with-contracts/tsconfig.json new file mode 100644 index 000000000..99710e857 --- /dev/null +++ b/examples/telescope-with-contracts/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/telescope-with-contracts/utils.ts b/examples/telescope-with-contracts/utils.ts new file mode 100644 index 000000000..83e05bd10 --- /dev/null +++ b/examples/telescope-with-contracts/utils.ts @@ -0,0 +1,24 @@ +import { WalletStatus } from "./components"; +import { CosmosWalletStatus } from "@cosmos-kit/types"; + +export const mapStatusFromCosmosWallet = (status: CosmosWalletStatus, error?: Error): WalletStatus => { + switch (status) { + case CosmosWalletStatus.Uninitialized || CosmosWalletStatus.Disconnected: + return WalletStatus.NotInit; + case CosmosWalletStatus.Connecting + || CosmosWalletStatus.ChoosingWallet + || CosmosWalletStatus.PendingWalletConnect + || CosmosWalletStatus.EnablingWallet: + return WalletStatus.Loading; + case CosmosWalletStatus.Connected: + return WalletStatus.Loaded; + case CosmosWalletStatus.Errored: + if (error && error.message === 'Request rejected') { + return WalletStatus.NotInit; + } else { + return WalletStatus.Rejected; + } + default: + return WalletStatus.NotInit; + } +} \ No newline at end of file diff --git a/lerna.json b/lerna.json index f2f75e049..5b425ea7f 100644 --- a/lerna.json +++ b/lerna.json @@ -8,6 +8,7 @@ ], "packages": [ "packages/*", + "examples/*", "templates/*" ], "version": "independent", diff --git a/package.json b/package.json index 873e2b602..2eaccb688 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,11 @@ }, "workspaces": [ "packages/*", + "examples/*", "templates/*" ], "repository": { "type": "git", "url": "https://github.com/cosmology-tech/create-cosmos-app" } -} +} \ No newline at end of file diff --git a/templates/connect-chain/components/astronaut.tsx b/templates/connect-chain/components/astronaut.tsx index c32c3f878..572884aa7 100644 --- a/templates/connect-chain/components/astronaut.tsx +++ b/templates/connect-chain/components/astronaut.tsx @@ -1,304 +1,304 @@ export const Astronaut = (props: any) => ( - - {"cosmology-astronaut"} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {'cosmology-astronaut'} + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + + + - - - - - - + + + + + + + + + + + - - - - + - - + d="M69 250.7c-.1 2.8 0 7.5-3.3 9.3-3.2 1.7-31 3.2-36.5-2.8-5.4-6-15.4-25.5-17.2-36.5-1.2-7.3-2-20.5 4-22.2q6-1.8 12.2 1.1-5.9-8.9-5.9-16.4c0-3.6 1.3-9.5 5.9-10.5q4.6-1 18.8 1.5-3-10.8 0-15c6-8.5 22.5-7.2 27-6 4.5 1.3 39.8 37 42 46.4 1.4 5.7-2.3 21.4-6.7 24q-2.8 1.7-12.7 2.9 6.3 12 0 16.2-6.4 4.3-27.6 0v8z" + /> + - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - + - + d="M46.4 219.6c.9 3 3.7 7.6 6.1 11.6q3.8 6.4 5.1 8.3-12.3-10.5-14.1-17-1.8-6.5 0-11.3.8.8 2.9 8.4z" + /> + - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - -); \ No newline at end of file + + + +); diff --git a/templates/connect-chain/components/features.tsx b/templates/connect-chain/components/features.tsx index e83df5d27..37852ca15 100644 --- a/templates/connect-chain/components/features.tsx +++ b/templates/connect-chain/components/features.tsx @@ -1,29 +1,45 @@ -import { LinkIcon } from "@chakra-ui/icons"; -import { Box, Heading, HStack, Icon, Link, Text, VStack } from "@chakra-ui/react"; -import { FeatureProps } from "./types"; +import { LinkIcon } from '@chakra-ui/icons'; +import { + Box, + Heading, + HStack, + Icon, + Link, + Text, + VStack +} from '@chakra-ui/react'; +import { FeatureProps } from './types'; export const Product = ({ title, text, href }: FeatureProps) => { - return ( - - - {title} → - {text} - - - ); + return ( + + + {title} → + {text} + + + ); }; export const Dependency = ({ title, text, href }: FeatureProps) => { - return ( - - - - - - {title} - {text} - - - ) -} \ No newline at end of file + return ( + + + + + + + + {title} + + + {text} + + + ); +}; diff --git a/templates/connect-chain/components/index.tsx b/templates/connect-chain/components/index.tsx index f6b34f396..fbf3bb494 100644 --- a/templates/connect-chain/components/index.tsx +++ b/templates/connect-chain/components/index.tsx @@ -2,4 +2,4 @@ export * from './types'; export * from './wallet-connect'; export * from './user-info'; export * from './astronaut'; -export * from './features'; \ No newline at end of file +export * from './features'; diff --git a/templates/connect-chain/components/types.tsx b/templates/connect-chain/components/types.tsx index f273ae850..93f463d0e 100644 --- a/templates/connect-chain/components/types.tsx +++ b/templates/connect-chain/components/types.tsx @@ -1,5 +1,5 @@ -import { MouseEventHandler, ReactNode } from "react"; -import { IconType } from "react-icons"; +import { MouseEventHandler, ReactNode } from 'react'; +import { IconType } from 'react-icons'; export interface ChooseChainInfo { chainId: string; @@ -11,11 +11,11 @@ export interface ChooseChainInfo { } export enum WalletStatus { - NotInit = "NotInit", - Loading = "Loading", - Loaded = "Loaded", - NotExist = "NotExist", - Rejected = "Rejected" + NotInit = 'NotInit', + Loading = 'Loading', + Loaded = 'Loaded', + NotExist = 'NotExist', + Rejected = 'Rejected' } export interface ConnectWalletType { @@ -35,4 +35,4 @@ export interface FeatureProps { title: string; text: string; href: string; -} \ No newline at end of file +} diff --git a/templates/connect-chain/components/user-info.tsx b/templates/connect-chain/components/user-info.tsx index 2b8db2aa5..14534b5b4 100644 --- a/templates/connect-chain/components/user-info.tsx +++ b/templates/connect-chain/components/user-info.tsx @@ -1,10 +1,10 @@ -import React, { ReactNode } from "react"; -import { Text, useColorModeValue, Stack, Box } from "@chakra-ui/react"; -import { ConnectedUserCardType } from "./types"; +import React, { ReactNode } from 'react'; +import { Text, useColorModeValue, Stack, Box } from '@chakra-ui/react'; +import { ConnectedUserCardType } from './types'; export const ConnectedUserCard = ({ userName, - icon, + icon }: ConnectedUserCardType) => { return ( {icon} - + {userName} ); }; - export const ConnectedUserInfo = ({ name, - icon, + icon }: { name: string; icon?: ReactNode; diff --git a/templates/connect-chain/components/wallet-connect.tsx b/templates/connect-chain/components/wallet-connect.tsx index 9a4b7fe59..bdb2fdc72 100644 --- a/templates/connect-chain/components/wallet-connect.tsx +++ b/templates/connect-chain/components/wallet-connect.tsx @@ -1,16 +1,16 @@ -import React, { MouseEventHandler, ReactNode } from "react"; -import { Button, Icon, Stack, Text, useColorModeValue } from "@chakra-ui/react"; -import { FiAlertTriangle } from "react-icons/fi"; -import { WalletStatus } from "./types"; -import { IoWallet } from "react-icons/io5"; -import { ConnectWalletType } from "./types"; +import React, { MouseEventHandler, ReactNode } from 'react'; +import { Button, Icon, Stack, Text, useColorModeValue } from '@chakra-ui/react'; +import { FiAlertTriangle } from 'react-icons/fi'; +import { WalletStatus } from './types'; +import { IoWallet } from 'react-icons/io5'; +import { ConnectWalletType } from './types'; export const ConnectWalletButton = ({ buttonText, isLoading, isDisabled, icon, - onClickConnectBtn, + onClickConnectBtn }: ConnectWalletType) => { return ( ); }; export const Disconnect = ({ buttonText, - onClick, + onClick }: { buttonText: string; onClick: MouseEventHandler; @@ -41,7 +41,7 @@ export const Disconnect = ({ export const Connected = ({ buttonText, - onClick, + onClick }: { buttonText: string; onClick: MouseEventHandler; @@ -57,7 +57,7 @@ export const Connecting = () => { export const Rejected = ({ buttonText, - wordOfWarning, + wordOfWarning }: { buttonText: string; wordOfWarning?: string; @@ -68,7 +68,7 @@ export const Rejected = ({

Loading...

} localStorageKey={LOCAL_STORAGE_KEY} @@ -25,26 +24,19 @@ function MyApp({ Component, pageProps }: AppProps) { getSigningCosmWasmClientOptions={(chainInfo) => ({ gasPrice: GasPrice.fromString( '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom - ), + ) })} getSigningStargateClientOptions={(chainInfo) => ({ gasPrice: GasPrice.fromString( '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom - ), + ) })} - // Choose a different RPC node for the desired chain. - // chainInfoOverrides={[ - // { - // ...ChainInfoMap[ChainInfoID.Juno1], - // rpc: "https://another.rpc.com", - // } - // ]} > - ) + ); } -export default MyApp +export default MyApp; diff --git a/templates/connect-chain/pages/api/hello.ts b/templates/connect-chain/pages/api/hello.ts index f8bcc7e5c..89e4d6bd9 100644 --- a/templates/connect-chain/pages/api/hello.ts +++ b/templates/connect-chain/pages/api/hello.ts @@ -1,13 +1,13 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' +import type { NextApiRequest, NextApiResponse } from 'next'; type Data = { - name: string -} + name: string; +}; export default function handler( req: NextApiRequest, res: NextApiResponse ) { - res.status(200).json({ name: 'John Doe' }) + res.status(200).json({ name: 'John Doe' }); } diff --git a/templates/connect-chain/pages/index.tsx b/templates/connect-chain/pages/index.tsx index 8f4113c23..b2106e0ef 100644 --- a/templates/connect-chain/pages/index.tsx +++ b/templates/connect-chain/pages/index.tsx @@ -22,12 +22,11 @@ import { } from '../components'; import styles from '../styles/Home.module.css'; import { useWalletManager, useWallet } from '@cosmos-kit/react'; -import { mapStatusFromCosmosWallet } from "../utils"; +import { mapStatusFromCosmosWallet } from '../utils'; import { MouseEventHandler } from 'react'; import Head from 'next/head'; import { dependencies, products } from '../config'; - export default function Home() { const { connect, disconnect } = useWalletManager(); const { status, error, name, address } = useWallet(); @@ -43,11 +42,11 @@ export default function Home() { disconnect(); }; - const userInfoCard = (name) - ? ( - } /> - ) - : <>; + const userInfoCard = name ? ( + } /> + ) : ( + <> + ); const connectWalletButton = ( } /> - ) + ); return (
@@ -78,21 +77,27 @@ export default function Home() {
- + + lineHeight={'110%'} + > Cosmos Apps Made Easy
- - Welcome to {' '} - + lineHeight={'110%'} + > + Welcome to CosmosKit + Telescope + Next.js @@ -114,14 +119,19 @@ export default function Home() { templateColumns={{ base: 'repeat(1, 1fr)', sm: 'repeat(2, 1fr)', - md: 'repeat(3, 1fr)', + md: 'repeat(3, 1fr)' }} - gap={{ base: '3', sm: '6', md: '8' }}> - {products.map(product => )} + gap={{ base: '3', sm: '6', md: '8' }} + > + {products.map((product) => ( + + ))} - {dependencies.map((dependency) => )} + {dependencies.map((dependency, i) => ( + + ))}
@@ -136,4 +146,4 @@ export default function Home() {
); -} \ No newline at end of file +} diff --git a/templates/connect-multi-chain/config/chain-infos.ts b/templates/connect-multi-chain/config/chain-infos.ts index 52a2a1f2b..6b1c473e2 100644 --- a/templates/connect-multi-chain/config/chain-infos.ts +++ b/templates/connect-multi-chain/config/chain-infos.ts @@ -1,15 +1,17 @@ -import { ChooseChainInfo } from "../components"; +import { ChooseChainInfo } from '../components'; import { chains as chainsBase, assets as chainAssets } from 'chain-registry'; -export const chainInfos: ChooseChainInfo[] = chainsBase.map(chain => { - const assets = chainAssets.find( - _chain => _chain.chain_name === chain.chain_name - )?.assets; - return { - chainId: chain.chain_id, - label: chain.pretty_name, - value: chain.chain_id, - icon: assets ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png : undefined, - disabled: false - } -}); \ No newline at end of file +export const chainInfos: ChooseChainInfo[] = chainsBase.map((chain) => { + const assets = chainAssets.find( + (_chain) => _chain.chain_name === chain.chain_name + )?.assets; + return { + chainId: chain.chain_id, + label: chain.pretty_name, + value: chain.chain_id, + icon: assets + ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png + : undefined, + disabled: false + }; +}); diff --git a/templates/connect-multi-chain/config/features.ts b/templates/connect-multi-chain/config/features.ts index 0b085303d..a9902de32 100644 --- a/templates/connect-multi-chain/config/features.ts +++ b/templates/connect-multi-chain/config/features.ts @@ -1,47 +1,47 @@ -import { FeatureProps } from "../components"; +import { FeatureProps } from '../components'; export const products: FeatureProps[] = [ - { - title: 'CosmosKit', - text: 'A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.', - href: 'https://github.com/cosmology-tech/cosmos-kit', - }, - { - title: 'Telescope', - text: 'A TypeScript Transpiler for Cosmos Protobufs to generate libraries for Cosmos blockchains.', - href: 'https://github.com/osmosis-labs/telescope', - }, - { - title: 'TS Codegen', - text: 'The quickest and easiest way to convert CosmWasm Contracts into dev-friendly TypeScript classes.', - href: 'https://github.com/CosmWasm/ts-codegen', - }, - { - title: 'Cosmology', - text: 'Build web3 applications in the Cosmos and Intechain Ecosystem.', - href: 'https://github.com/cosmology-tech/cosmology', - }, - { - title: 'Chain Registry', - text: 'The npm package for the Official Cosmos chain registry.', - href: 'https://github.com/cosmology-tech/chain-registry', - }, - { - title: 'Videos', - text: 'Learn more from the official Cosmology website.', - href: 'https://cosmology.tech/', - } -] + { + title: 'CosmosKit', + text: 'A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.', + href: 'https://github.com/cosmology-tech/cosmos-kit' + }, + { + title: 'Telescope', + text: 'A TypeScript Transpiler for Cosmos Protobufs to generate libraries for Cosmos blockchains.', + href: 'https://github.com/osmosis-labs/telescope' + }, + { + title: 'TS Codegen', + text: 'The quickest and easiest way to convert CosmWasm Contracts into dev-friendly TypeScript classes.', + href: 'https://github.com/CosmWasm/ts-codegen' + }, + { + title: 'Cosmology', + text: 'Build web3 applications in the Cosmos and Intechain Ecosystem.', + href: 'https://github.com/cosmology-tech/cosmology' + }, + { + title: 'Chain Registry', + text: 'The npm package for the Official Cosmos chain registry.', + href: 'https://github.com/cosmology-tech/chain-registry' + }, + { + title: 'Videos', + text: 'Learn more from the official Cosmology website.', + href: 'https://cosmology.tech/' + } +]; export const dependencies: FeatureProps[] = [ - { - title: 'Chakra UI', - text: 'A simple, modular and accessible React Component Library.', - href: 'https://chakra-ui.com/' - }, - { - title: 'Next.js', - text: 'A React Framework supports hybrid static & server rendering.', - href: 'https://nextjs.org/' - } -]; \ No newline at end of file + { + title: 'Chakra UI', + text: 'A simple, modular and accessible React Component Library.', + href: 'https://chakra-ui.com/' + }, + { + title: 'Next.js', + text: 'A React Framework supports hybrid static & server rendering.', + href: 'https://nextjs.org/' + } +]; diff --git a/templates/connect-multi-chain/config/index.ts b/templates/connect-multi-chain/config/index.ts index c02b0ac33..0addef3f2 100644 --- a/templates/connect-multi-chain/config/index.ts +++ b/templates/connect-multi-chain/config/index.ts @@ -1,3 +1,3 @@ export * from './theme'; export * from './features'; -export * from './chain-infos'; \ No newline at end of file +export * from './chain-infos'; diff --git a/templates/connect-multi-chain/config/theme.ts b/templates/connect-multi-chain/config/theme.ts index b50e4954e..1d6be080b 100644 --- a/templates/connect-multi-chain/config/theme.ts +++ b/templates/connect-multi-chain/config/theme.ts @@ -1,65 +1,65 @@ -import { extendTheme } from "@chakra-ui/react" +import { extendTheme } from '@chakra-ui/react'; export const defaultThemeObject = { - fonts: { - body: 'Inter, system-ui, sans-serif', - heading: 'Work Sans, system-ui, sans-serif', - }, - colors: { - primary: { - '50': '#e5e7f9', - '100': '#bec4ef', - '200': '#929ce4', - '300': '#6674d9', - '400': '#4657d1', - '500': '#2539c9', - '600': '#2133c3', - '700': '#1b2cbc', - '800': '#1624b5', - '900': '#0d17a9', - }, - }, - breakPoints: { - sm: '30em', - md: '48em', - lg: '62em', - xl: '80em', - '2xl': '96em', - }, - shadows: { - largeSoft: 'rgba(60, 64, 67, 0.15) 0px 2px 10px 6px;', - }, - styles: { - global: { - 'html, #__next': { - height: '100%', - }, - '#__next': { - display: 'flex', - flexDirection: 'column', - }, - '.body': { - // todo check how to do this without breaking the site - // height: '100%', // Push footer to bottom - overflowY: 'scroll', // Always show scrollbar to avoid flickering - }, - html: { - scrollBehavior: 'smooth', - }, - '#nprogress': { - pointerEvents: 'none', - }, - '#nprogress .bar': { - background: 'green.200', - position: 'fixed', - zIndex: '1031', - top: 0, - left: 0, - width: '100%', - height: '2px', - }, - }, - }, + fonts: { + body: 'Inter, system-ui, sans-serif', + heading: 'Work Sans, system-ui, sans-serif' + }, + colors: { + primary: { + '50': '#e5e7f9', + '100': '#bec4ef', + '200': '#929ce4', + '300': '#6674d9', + '400': '#4657d1', + '500': '#2539c9', + '600': '#2133c3', + '700': '#1b2cbc', + '800': '#1624b5', + '900': '#0d17a9' + } + }, + breakPoints: { + sm: '30em', + md: '48em', + lg: '62em', + xl: '80em', + '2xl': '96em' + }, + shadows: { + largeSoft: 'rgba(60, 64, 67, 0.15) 0px 2px 10px 6px;' + }, + styles: { + global: { + 'html, #__next': { + height: '100%' + }, + '#__next': { + display: 'flex', + flexDirection: 'column' + }, + '.body': { + // todo check how to do this without breaking the site + // height: '100%', // Push footer to bottom + overflowY: 'scroll' // Always show scrollbar to avoid flickering + }, + html: { + scrollBehavior: 'smooth' + }, + '#nprogress': { + pointerEvents: 'none' + }, + '#nprogress .bar': { + background: 'green.200', + position: 'fixed', + zIndex: '1031', + top: 0, + left: 0, + width: '100%', + height: '2px' + } + } + } }; export const defaultTheme = extendTheme(defaultThemeObject); diff --git a/templates/connect-multi-chain/package.json b/templates/connect-multi-chain/package.json index 6d167ad65..2ce9fdf50 100644 --- a/templates/connect-multi-chain/package.json +++ b/templates/connect-multi-chain/package.json @@ -1,5 +1,5 @@ { - "name": "@cosmos-app/connect-multi-chain", + "name": "@cosmonauts/connect-multi-chain", "version": "0.1.1", "private": true, "scripts": { @@ -34,4 +34,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/templates/connect-multi-chain/pages/_app.tsx b/templates/connect-multi-chain/pages/_app.tsx index ece869905..07169c83b 100644 --- a/templates/connect-multi-chain/pages/_app.tsx +++ b/templates/connect-multi-chain/pages/_app.tsx @@ -1,15 +1,14 @@ import '../styles/globals.css'; import type { AppProps } from 'next/app'; -import { GasPrice } from '@cosmjs/stargate' +import { GasPrice } from '@cosmjs/stargate'; import { ChakraProvider } from '@chakra-ui/react'; import { defaultTheme } from '../config'; import { ChainInfoID } from '@cosmos-kit/types'; import { WalletManagerProvider } from '@cosmos-kit/react'; -const LOCAL_STORAGE_KEY = 'connectedWalletId' +const LOCAL_STORAGE_KEY = 'connectedWalletId'; function MyApp({ Component, pageProps }: AppProps) { - return (

Loading...

} localStorageKey={LOCAL_STORAGE_KEY} @@ -25,26 +24,19 @@ function MyApp({ Component, pageProps }: AppProps) { getSigningCosmWasmClientOptions={(chainInfo) => ({ gasPrice: GasPrice.fromString( '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom - ), + ) })} getSigningStargateClientOptions={(chainInfo) => ({ gasPrice: GasPrice.fromString( '0.0025' + chainInfo.feeCurrencies[0].coinMinimalDenom - ), + ) })} - // Choose a different RPC node for the desired chain. - // chainInfoOverrides={[ - // { - // ...ChainInfoMap[ChainInfoID.Juno1], - // rpc: "https://another.rpc.com", - // } - // ]} >
- ) + ); } -export default MyApp +export default MyApp; diff --git a/templates/connect-multi-chain/pages/api/hello.ts b/templates/connect-multi-chain/pages/api/hello.ts index f8bcc7e5c..89e4d6bd9 100644 --- a/templates/connect-multi-chain/pages/api/hello.ts +++ b/templates/connect-multi-chain/pages/api/hello.ts @@ -1,13 +1,13 @@ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next' +import type { NextApiRequest, NextApiResponse } from 'next'; type Data = { - name: string -} + name: string; +}; export default function handler( req: NextApiRequest, res: NextApiResponse ) { - res.status(200).json({ name: 'John Doe' }) + res.status(200).json({ name: 'John Doe' }); } diff --git a/templates/connect-multi-chain/pages/index.tsx b/templates/connect-multi-chain/pages/index.tsx index 06501d8d7..79335b368 100644 --- a/templates/connect-multi-chain/pages/index.tsx +++ b/templates/connect-multi-chain/pages/index.tsx @@ -27,12 +27,11 @@ import { } from '../components'; import styles from '../styles/Home.module.css'; import { useWalletManager, useWallet } from '@cosmos-kit/react'; -import { mapStatusFromCosmosWallet } from "../utils"; +import { mapStatusFromCosmosWallet } from '../utils'; import { MouseEventHandler, useState } from 'react'; import Head from 'next/head'; import { chainInfos, dependencies, products } from '../config'; - export default function Home() { const [chainId, setChainId] = useState(); const { connect, disconnect } = useWalletManager(); @@ -49,20 +48,25 @@ export default function Home() { disconnect(); }; + const userInfoCard = name ? ( + } /> + ) : ( + <> + ); - const userInfoCard = (name) - ? ( - } /> - ) - : <>; - - const addressCard = (chainId && address && name) - ? ( - - + const addressCard = + chainId && address && name ? ( + + - ) - : <>; + ) : ( + <> + ); const connectWalletButton = ( } /> - ) + ); const onChainChange: handleSelectChainDropdown = ( selectedValue: ChainOption | null @@ -109,21 +113,27 @@ export default function Home() {
- + + lineHeight={'110%'} + > Cosmos Apps Made Easy
- - Welcome to {' '} - + lineHeight={'110%'} + > + Welcome to CosmosKit + Telescope + Next.js @@ -139,20 +149,18 @@ export default function Home() { {chooseChain} {connectWalletButton}
- { - (chainId && !address) - ? <> - : ( - - {(chainId && address) ? addressCard : userInfoCard} - - ) - } + {chainId && !address ? ( + <> + ) : ( + + {chainId && address ? addressCard : userInfoCard} + + )}
- {products.map(product => )} + gap={{ base: '3', sm: '6', md: '8' }} + > + {products.map((product) => ( + + ))} - {dependencies.map((dependency) => )} + {dependencies.map((dependency, i) => ( + + ))}
@@ -182,4 +195,4 @@ export default function Home() { ); -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 4edc94c9f..fb12776dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,6 +61,27 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== +"@babel/core@7.18.10": + version "7.18.10" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz#39ad504991d77f1f3da91be0b8b949a5bc466fb8" + integrity sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-module-transforms" "^7.18.9" + "@babel/helpers" "^7.18.9" + "@babel/parser" "^7.18.10" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.18.10" + "@babel/types" "^7.18.10" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + "@babel/core@7.18.13": version "7.18.13" resolved "https://registry.npmjs.org/@babel/core/-/core-7.18.13.tgz#9be8c44512751b05094a4d3ab05fc53a47ce00ac" @@ -134,16 +155,16 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.11.5", "@babel/generator@^7.9.6": - version "7.11.6" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620" - integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== +"@babel/generator@7.18.12": + version "7.18.12" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz#fa58daa303757bd6f5e4bbca91b342040463d9f4" + integrity sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg== dependencies: - "@babel/types" "^7.11.5" + "@babel/types" "^7.18.10" + "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" - source-map "^0.5.0" -"@babel/generator@^7.18.13": +"@babel/generator@7.18.13", "@babel/generator@^7.18.10", "@babel/generator@^7.18.13": version "7.18.13" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.13.tgz#59550cbb9ae79b8def15587bdfbaa388c4abf212" integrity sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ== @@ -152,6 +173,15 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@^7.11.5", "@babel/generator@^7.9.6": + version "7.11.6" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620" + integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== + dependencies: + "@babel/types" "^7.11.5" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/generator@^7.18.9", "@babel/generator@^7.7.2": version "7.18.9" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.9.tgz#68337e9ea8044d6ddc690fb29acae39359cca0a5" @@ -709,6 +739,11 @@ regenerator-runtime "^0.13.4" v8flags "^3.1.1" +"@babel/parser@7.18.11": + version "7.18.11" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" + integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== + "@babel/parser@^7.1.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": version "7.8.4" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" @@ -724,7 +759,7 @@ resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.9.tgz#f2dde0c682ccc264a9a8595efd030a5cc8fd2539" integrity sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg== -"@babel/parser@^7.18.10", "@babel/parser@^7.18.13": +"@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.18.13": version "7.18.13" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.13.tgz#5b2dd21cae4a2c5145f1fbd8ca103f9313d3b7e4" integrity sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg== @@ -1909,7 +1944,7 @@ "@babel/plugin-transform-react-jsx-self" "^7.9.0" "@babel/plugin-transform-react-jsx-source" "^7.9.0" -"@babel/preset-typescript@^7.16.7": +"@babel/preset-typescript@^7.16.7", "@babel/preset-typescript@^7.17.12", "@babel/preset-typescript@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== @@ -1994,22 +2029,23 @@ "@babel/parser" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.9.6": - version "7.11.5" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" - integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== +"@babel/traverse@7.18.11": + version "7.18.11" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" + integrity sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.5" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.11.5" - "@babel/types" "^7.11.5" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.18.11" + "@babel/types" "^7.18.10" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.19" -"@babel/traverse@^7.18.13", "@babel/traverse@^7.4.5": +"@babel/traverse@7.18.13", "@babel/traverse@^7.18.10", "@babel/traverse@^7.18.13", "@babel/traverse@^7.4.5": version "7.18.13" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.13.tgz#5ab59ef51a997b3f10c4587d648b9696b6cb1a68" integrity sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA== @@ -2025,6 +2061,21 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.10.4", "@babel/traverse@^7.9.6": + version "7.11.5" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" + integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.11.5" + "@babel/types" "^7.11.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + "@babel/traverse@^7.18.9", "@babel/traverse@^7.7.2": version "7.18.9" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.9.tgz#deeff3e8f1bad9786874cb2feda7a2d77a904f98" @@ -2056,6 +2107,24 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/types@7.18.10": + version "7.18.10" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" + integrity sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ== + dependencies: + "@babel/helper-string-parser" "^7.18.10" + "@babel/helper-validator-identifier" "^7.18.6" + to-fast-properties "^2.0.0" + +"@babel/types@7.18.13", "@babel/types@^7.18.10", "@babel/types@^7.18.13": + version "7.18.13" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.13.tgz#30aeb9e514f4100f7c1cb6e5ba472b30e48f519a" + integrity sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ== + dependencies: + "@babel/helper-string-parser" "^7.18.10" + "@babel/helper-validator-identifier" "^7.18.6" + to-fast-properties "^2.0.0" + "@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" @@ -2074,15 +2143,6 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@babel/types@^7.18.10", "@babel/types@^7.18.13": - version "7.18.13" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.13.tgz#30aeb9e514f4100f7c1cb6e5ba472b30e48f519a" - integrity sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ== - dependencies: - "@babel/helper-string-parser" "^7.18.10" - "@babel/helper-validator-identifier" "^7.18.6" - to-fast-properties "^2.0.0" - "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.3.3": version "7.18.9" resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.9.tgz#7148d64ba133d8d73a41b3172ac4b83a1452205f" @@ -2988,6 +3048,11 @@ resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.24.1.tgz#0adfefe63b7f17222bc2bc12f71296f35e7ad378" integrity sha512-VA3WFx1lMFb7esp9BqHWkDgMvHoA3D9w+uDRvWhVRpUpDc7RYHxMbWExASjz+gNblTCg556WJGzF64tXnf9tdQ== +"@cosmjson/wasmswap@^0.0.9": + version "0.0.9" + resolved "https://registry.npmjs.org/@cosmjson/wasmswap/-/wasmswap-0.0.9.tgz#f8dc7c6ffcceb74c7e877a28606f86e7ff5baab4" + integrity sha512-ieZgG1FuaRAJbCnVFLiIgpX4Y60h+EGx27bftmv63sL2YRCaKg7QFbbTZD598pJZiCoLNbkvvMFSypGNGXE3rw== + "@cosmos-kit/core@^0.11.0": version "0.11.0" resolved "https://registry.npmjs.org/@cosmos-kit/core/-/core-0.11.0.tgz#5535fa5720203ceccaa20e9dc61eac068b4ff599" @@ -3049,6 +3114,39 @@ "@walletconnect/client" "1.7.8" "@walletconnect/types" "1.7.8" +"@cosmwasm/ts-codegen@0.13.1": + version "0.13.1" + resolved "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.13.1.tgz#eeb5918171e2bf635e55870ed8492aa88e47d5f3" + integrity sha512-q56nncxid1TwlgvOcszal4MUSiqVQw6iR4AOOKekwqbPEOdO9oPcGi5OBmo1Z/hPcB3kTP6p8L/0Md499zU3RA== + dependencies: + "@babel/core" "7.18.10" + "@babel/generator" "7.18.12" + "@babel/parser" "7.18.11" + "@babel/plugin-proposal-class-properties" "7.18.6" + "@babel/plugin-proposal-export-default-from" "7.18.10" + "@babel/plugin-proposal-object-rest-spread" "7.18.9" + "@babel/plugin-transform-runtime" "7.18.10" + "@babel/preset-env" "7.18.10" + "@babel/preset-typescript" "^7.18.6" + "@babel/runtime" "^7.18.9" + "@babel/traverse" "7.18.11" + "@babel/types" "7.18.10" + "@pyramation/json-schema-to-typescript" " 11.0.4" + case "1.6.3" + dargs "7.0.0" + deepmerge "4.2.2" + dotty "0.1.2" + fuzzy "0.1.3" + glob "8.0.3" + inquirerer "0.1.3" + long "^5.2.0" + minimist "1.2.6" + mkdirp "1.0.4" + parse-package-name "1.0.0" + rimraf "3.0.2" + shelljs "0.8.5" + wasm-ast-types "^0.9.0" + "@ctrl/tinycolor@^3.4.0": version "3.4.1" resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz#75b4c27948c81e88ccd3a8902047bcd797f38d32" @@ -3714,7 +3812,7 @@ jest-haste-map "^28.1.3" slash "^3.0.0" -"@jest/transform@^28.1.3": +"@jest/transform@28.1.3", "@jest/transform@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== @@ -3787,6 +3885,11 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@keplr-wallet/background@0.10.19": version "0.10.19" resolved "https://registry.npmjs.org/@keplr-wallet/background/-/background-0.10.19.tgz#403503c09d306b0526e663f0ab84ad61d68b9b45" @@ -5022,6 +5125,107 @@ dependencies: "@octokit/openapi-types" "^12.11.0" +"@osmonauts/ast@^0.14.7": + version "0.14.7" + resolved "https://registry.npmjs.org/@osmonauts/ast/-/ast-0.14.7.tgz#2388744dc4160335b970ff6ff158e4a9b487cfbc" + integrity sha512-oSGRDrmO8wLSISBFGxLr3LtsuZE6tyqovgeiarW2lC+t4LIdlVff7OaTEehqn6RLgGnoFWCGw9mfHeTJET8zGg== + dependencies: + "@babel/runtime" "^7.18.9" + "@babel/types" "7.18.13" + "@osmonauts/proto-parser" "^0.11.5" + "@osmonauts/types" "^0.9.4" + "@osmonauts/utils" "^0.3.13" + case "1.6.3" + dotty "0.1.2" + +"@osmonauts/helpers@^0.4.3": + version "0.4.3" + resolved "https://registry.npmjs.org/@osmonauts/helpers/-/helpers-0.4.3.tgz#f73cce20c2d05cc4ab056efdd1f16bb1e9eef76e" + integrity sha512-Dd6CXSKoAP4kLptE8Fx2vsEqc0Ai4kF07l4zPsfOYop9SH5ayOKkRTfAkrBjBr84FsMPyu5TEhJeqj1i//Q/jg== + dependencies: + "@babel/runtime" "^7.18.9" + "@cosmjs/amino" "0.28.13" + "@cosmjs/crypto" "0.28.13" + "@cosmjs/proto-signing" "0.28.13" + "@cosmjs/stargate" "0.28.13" + cosmjs-types "0.5.1" + long "^5.2.0" + protobufjs "^6.11.3" + +"@osmonauts/lcd@^0.4.0": + version "0.4.0" + resolved "https://registry.npmjs.org/@osmonauts/lcd/-/lcd-0.4.0.tgz#94c14df420559530e5fbaec2b64e6e0603629605" + integrity sha512-DjzU2ZqJ6DHkRpNfIfut1LIVYxdqo5IQf9sgYPiDF2hmTCxvYeAZ6uvCuiUiKJO0QdjBs3criv0/CH+Ytl5dsA== + dependencies: + "@babel/runtime" "^7.18.9" + axios "0.27.2" + +"@osmonauts/proto-parser@^0.11.5": + version "0.11.5" + resolved "https://registry.npmjs.org/@osmonauts/proto-parser/-/proto-parser-0.11.5.tgz#520fda78f671878d514212e1877440e644f5fd61" + integrity sha512-y7Gkc9bBLjeBL3wzLoMOCaDWvi7CGmR9ELqTSB0f9Qz44oeFubyZSDXMCnvAu87NZM/9d5T+dHSybHRGzyPTMw== + dependencies: + "@babel/runtime" "^7.18.9" + "@osmonauts/types" "^0.9.4" + "@pyramation/protobufjs" "6.11.3" + dotty "0.1.2" + glob "8.0.3" + mkdirp "1.0.4" + +"@osmonauts/telescope@0.18.7": + version "0.18.7" + resolved "https://registry.npmjs.org/@osmonauts/telescope/-/telescope-0.18.7.tgz#75e60e21f3311d08f415a541a62054a81571b6d5" + integrity sha512-6dKVxOthxaVdcdG+xDPRrLLwsl0zqwDCJJh+lmSaOpfa1eK6ZIZx48Z/YhMUY5P29sXaMJU1r/iANWG0ctlLhw== + dependencies: + "@babel/core" "7.18.13" + "@babel/generator" "7.18.13" + "@babel/parser" "^7.18.13" + "@babel/plugin-proposal-class-properties" "7.18.6" + "@babel/plugin-proposal-export-default-from" "7.18.10" + "@babel/plugin-proposal-object-rest-spread" "7.18.9" + "@babel/plugin-transform-runtime" "7.18.10" + "@babel/preset-env" "7.18.10" + "@babel/preset-typescript" "^7.17.12" + "@babel/runtime" "^7.18.9" + "@babel/traverse" "7.18.13" + "@babel/types" "7.18.13" + "@cosmwasm/ts-codegen" "0.13.1" + "@osmonauts/ast" "^0.14.7" + "@osmonauts/proto-parser" "^0.11.5" + "@osmonauts/types" "^0.9.4" + "@osmonauts/utils" "^0.3.13" + "@types/parse-package-name" "0.1.0" + case "1.6.3" + dargs "7.0.0" + deepmerge "4.2.2" + dotty "0.1.2" + fuzzy "0.1.3" + glob "8.0.3" + inquirerer "0.1.3" + long "^5.2.0" + minimatch "5.1.0" + minimist "1.2.6" + mkdirp "1.0.4" + parse-package-name "1.0.0" + rimraf "3.0.2" + shelljs "0.8.5" + +"@osmonauts/types@^0.9.4": + version "0.9.4" + resolved "https://registry.npmjs.org/@osmonauts/types/-/types-0.9.4.tgz#62ae85ed8387f11add4b682414d697d268349ce8" + integrity sha512-OpPFOlvAeAQzmHl9+mtuBFYPaoW3K3Rro2j39duPDo52MP/cRCaoqhVAlhQD3NyorN1lgF0TefrnSapYg+Sw/Q== + dependencies: + "@babel/runtime" "^7.18.9" + "@osmonauts/utils" "^0.3.13" + case "1.6.3" + +"@osmonauts/utils@^0.3.13": + version "0.3.13" + resolved "https://registry.npmjs.org/@osmonauts/utils/-/utils-0.3.13.tgz#ec520833aefcd3eb7487f2b045772bb12ed8939b" + integrity sha512-mVQH7yRY8gidRC/OBzMvYuaeHd7mYHq4CMyVmcvqTFZZi7ZWlcKplR81r+GsDTInW1EN/acuBKmpOw8gG2PeKQ== + dependencies: + "@babel/runtime" "^7.18.9" + "@popperjs/core@^2.9.3": version "2.11.6" resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" @@ -5094,6 +5298,54 @@ "@babel/preset-react" "7.9.4" babel-plugin-macros "2.8.0" +"@pyramation/json-schema-ref-parser@9.0.6": + version "9.0.6" + resolved "https://registry.npmjs.org/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#556e416ce7dcc15a3c1afd04d6a059e03ed09aeb" + integrity sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg== + dependencies: + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + js-yaml "^3.13.1" + +"@pyramation/json-schema-to-typescript@ 11.0.4": + version "11.0.4" + resolved "https://registry.npmjs.org/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz#959bdb631dad336e1fdbf608a9b5908ab0da1d6b" + integrity sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg== + dependencies: + "@pyramation/json-schema-ref-parser" "9.0.6" + "@types/json-schema" "^7.0.11" + "@types/lodash" "^4.14.182" + "@types/prettier" "^2.6.1" + cli-color "^2.0.2" + get-stdin "^8.0.0" + glob "^7.1.6" + glob-promise "^4.2.2" + is-glob "^4.0.3" + lodash "^4.17.21" + minimist "^1.2.6" + mkdirp "^1.0.4" + mz "^2.7.0" + prettier "^2.6.2" + +"@pyramation/protobufjs@6.11.3": + version "6.11.3" + resolved "https://registry.npmjs.org/@pyramation/protobufjs/-/protobufjs-6.11.3.tgz#208bd1ba985c915cb55e0c7d1e20a477683ec531" + integrity sha512-CxqX5IUZsrsZXidzCjw25iDcX0EghDk3I/riK3KXzgxguxHHwEPlFMOPUMnsnFtK95+PQ3WPzZFfslsvCcLveg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + "@rushstack/eslint-patch@^1.1.3": version "1.1.4" resolved "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" @@ -5223,6 +5475,14 @@ resolved "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/glob@^7.1.3": + version "7.2.0" + resolved "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + "@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -5257,6 +5517,11 @@ expect "^28.0.0" pretty-format "^28.0.0" +"@types/json-schema@^7.0.11": + version "7.0.11" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" @@ -5269,7 +5534,7 @@ dependencies: "@types/lodash" "*" -"@types/lodash@*": +"@types/lodash@*", "@types/lodash@^4.14.182": version "4.14.184" resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q== @@ -5279,6 +5544,11 @@ resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/minimatch@*": + version "5.1.0" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.0.tgz#c3018161691376002f8a22ebb87f341e0dba3219" + integrity sha512-0RJHq5FqDWo17kdHe+SMDJLfxmLaqHbWnqZ6gNKzDvStUlrmx/eKIY17+ifLS1yybo7X86aUshQMlittDOVNnw== + "@types/minimatch@^3.0.3": version "3.0.5" resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" @@ -5324,11 +5594,21 @@ resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== +"@types/parse-package-name@0.1.0": + version "0.1.0" + resolved "https://registry.npmjs.org/@types/parse-package-name/-/parse-package-name-0.1.0.tgz#a4e54e3eef677d8b9d931b54b94ed77e8ae52a4f" + integrity sha512-+vF4M3Cd3Ec22Uwb+OKhDrSAcXQ5I6evRx+1letx4KzfzycU+AOEDHnCifus8In11i8iYNFXPfzg9HWTcC1h+Q== + "@types/prettier@^2.1.5": version "2.6.4" resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.6.4.tgz#ad899dad022bab6b5a9f0a0fe67c2f7a4a8950ed" integrity sha512-fOwvpvQYStpb/zHMx0Cauwywu9yLDmzWiiQBC7gJyq5tYLUXFZvDG7VK1B7WBxxjBJNKFOZ0zLoOQn8vmATbhw== +"@types/prettier@^2.6.1": + version "2.7.0" + resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc" + integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A== + "@types/prop-types@*": version "15.7.5" resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" @@ -5749,6 +6029,11 @@ ansi-styles@^5.0.0: resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + anymatch@^3.0.3: version "3.1.1" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" @@ -5888,6 +6173,13 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= +ast-stringify@0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/ast-stringify/-/ast-stringify-0.1.0.tgz#5c6439fbfb4513dcc26c7d34464ccd084ed91cb7" + integrity sha512-J1PgFYV3RG6r37+M6ySZJH406hR82okwGvFM9hLXpOvdx4WC4GEW8/qiw6pi1hKTrqcRvoHP8a7mp87egYr6iA== + dependencies: + "@babel/runtime" "^7.11.2" + ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" @@ -6353,6 +6645,11 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw== + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -6528,6 +6825,17 @@ clean-stack@^2.0.0: resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +cli-color@^2.0.2: + version "2.0.3" + resolved "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz#73769ba969080629670f3f2ef69a4bf4e7cc1879" + integrity sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.61" + es6-iterator "^2.0.3" + memoizee "^0.4.15" + timers-ext "^0.1.7" + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -6858,6 +7166,14 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +cosmjs-types@0.5.1: + version "0.5.1" + resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.1.tgz#f9bc35e78c32b687fb6018dc573eb454b3ae2587" + integrity sha512-NcC58xUIVLlKdIimWWQAmSlmCjiMrJnuHf4i3LiD8PCextfHR0fT3V5/WlXZZreyMgdmh6ML1zPUfGTbbo3Z5g== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + cosmjs-types@^0.4.0: version "0.4.1" resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz#3b2a53ba60d33159dd075596ce8267cfa7027063" @@ -6959,6 +7275,14 @@ curve25519-js@0.0.4: resolved "https://registry.npmjs.org/curve25519-js/-/curve25519-js-0.0.4.tgz#e6ad967e8cd284590d657bbfc90d8b50e49ba060" integrity sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w== +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + damerau-levenshtein@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" @@ -7180,6 +7504,11 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" +dotty@0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/dotty/-/dotty-0.1.2.tgz#512d44cc4111a724931226259297f235e8484f6f" + integrity sha512-V0EWmKeH3DEhMwAZ+8ZB2Ao4OK6p++Z0hsDtZq3N0+0ZMVqkzrcEGROvOnZpLnvBg5PTNG23JEDLAm64gPaotQ== + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -7327,6 +7656,42 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.61, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: + version "0.10.62" + resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" + integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== + dependencies: + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" + +es6-iterator@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@^3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + escalade@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.0.tgz#e8e2d7c7a8b76f6ee64c2181d6b8151441602d4e" @@ -7589,6 +7954,14 @@ esutils@^2.0.2: resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +event-emitter@^0.3.5: + version "0.3.5" + resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== + dependencies: + d "1" + es5-ext "~0.10.14" + eventemitter3@^4.0.4, eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -7635,6 +8008,13 @@ expect@^28.0.0, expect@^28.1.3: jest-message-util "^28.1.3" jest-util "^28.1.3" +ext@^1.1.2: + version "1.6.0" + resolved "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" + integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== + dependencies: + type "^2.5.0" + extend@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -8005,6 +8385,11 @@ get-port@^5.1.1: resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== +get-stdin@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" + integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -8088,6 +8473,13 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" +glob-promise@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/glob-promise/-/glob-promise-4.2.2.tgz#15f44bcba0e14219cd93af36da6bb905ff007877" + integrity sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw== + dependencies: + "@types/glob" "^7.1.3" + glob@7.1.7: version "7.1.7" resolved "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -8745,6 +9137,11 @@ is-plain-object@^5.0.0: resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-promise@^2.2.2: + version "2.2.2" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + is-regex@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" @@ -9668,7 +10065,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.7.0: +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.7.0: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9688,6 +10085,11 @@ long@^4.0.0: resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== +long@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" + integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -9702,6 +10104,13 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lru-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== + dependencies: + es5-ext "~0.10.2" + lz-string@^1.4.4: version "1.4.4" resolved "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" @@ -9810,6 +10219,20 @@ memoize-one@^5.0.0: resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== +memoizee@^0.4.15: + version "0.4.15" + resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" + integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.53" + es6-weak-map "^2.0.3" + event-emitter "^0.3.5" + is-promise "^2.2.2" + lru-queue "^0.1.0" + next-tick "^1.1.0" + timers-ext "^0.1.7" + meow@^8.0.0: version "8.1.2" resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" @@ -9882,6 +10305,13 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== +minimatch@5.1.0, minimatch@^5.0.1: + version "5.1.0" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7" + integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -9889,13 +10319,6 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7" - integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== - dependencies: - brace-expansion "^2.0.1" - minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -10079,6 +10502,15 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + nan@^2.13.2: version "2.16.0" resolved "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" @@ -10104,6 +10536,11 @@ neo-async@^2.6.0: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== +next-tick@1, next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + next@12.2.5: version "12.2.5" resolved "https://registry.npmjs.org/next/-/next-12.2.5.tgz#14fb5975e8841fad09553b8ef41fe1393602b717" @@ -10370,7 +10807,7 @@ oauth-sign@~0.9.0: resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -10694,6 +11131,11 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-package-name@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/parse-package-name/-/parse-package-name-1.0.0.tgz#1a108757e4ffc6889d5e78bcc4932a97c097a5a7" + integrity sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg== + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -10865,7 +11307,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.7.1, prettier@^2.1.2: +prettier@2.7.1, prettier@^2.1.2, prettier@^2.6.2: version "2.7.1" resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== @@ -10936,7 +11378,7 @@ proto-list@~1.2.1: resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= -protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: +protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== @@ -11561,6 +12003,13 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + rimraf@^2.6.3: version "2.7.1" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -11568,13 +12017,6 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@^3.0.0, rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - ripemd160-min@0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62" @@ -12303,6 +12745,20 @@ text-table@^0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + through2@^2.0.0: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -12323,6 +12779,14 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" + tiny-inflate@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz#122715494913a1805166aaf7c93467933eea26c4" @@ -12498,6 +12962,16 @@ type-tagger@^1.0.0: resolved "https://registry.npmjs.org/type-tagger/-/type-tagger-1.0.0.tgz#dc6297e52e17097c1b92b42c16816a18f631e7f4" integrity sha512-FIPqqpmDgdaulCnRoKv1/d3U4xVBUrYn42QXWNP3XYmgfPUDuBUsgFOb9ntT0aIe0UsUP+lknpQ5d9Kn36RssA== +type@^1.0.1: + version "1.2.0" + resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.5.0: + version "2.7.2" + resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== + typedarray-to-buffer@3.1.5, typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -12764,6 +13238,18 @@ warning@^4.0.3: dependencies: loose-envify "^1.0.0" +wasm-ast-types@^0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.9.0.tgz#d0f15f669286d3bc32340f9017d6bdbe2bd8c9d8" + integrity sha512-C/dzYTSa/2Zxhzup2G5mEi1Vt2/rGI7MHTNgRwB4F++7Uh7cY+U3rVwD/Syanyj9RZss4kcW/ZczwC0Rg9ab6A== + dependencies: + "@babel/runtime" "^7.18.9" + "@babel/types" "7.18.10" + "@jest/transform" "28.1.3" + ast-stringify "0.1.0" + case "1.6.3" + deepmerge "4.2.2" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8"