Skip to content

Commit

Permalink
Merge pull request #57 from cosmology-tech/upgrade-and-regen
Browse files Browse the repository at this point in the history
upgrade telescope and regen
  • Loading branch information
Zetazzz authored Nov 4, 2024
2 parents 903688d + bdb0a35 commit 657c328
Showing 13 changed files with 62 additions and 54 deletions.
2 changes: 1 addition & 1 deletion libs/interchainjs/src/binary.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ export const createGetBalance = (clientResolver: RpcResolver) => buildQuery<Quer
decode: QueryBalanceResponse.decode,
service: "cosmos.bank.v1beta1.Query",
method: "Balance",
clientResolver: clientResolver
clientResolver
});
export const useGetBalance = buildUseQuery<QueryBalanceRequest, QueryBalanceResponse>({
builderQueryFn: createGetBalance,
2 changes: 1 addition & 1 deletion libs/interchainjs/src/cosmos/bank/v1beta1/tx.rpc.func.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { buildUseMutation } from "../../../react-query";
import { toEncoders, toConverters } from "@interchainjs/cosmos/utils";
import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx";
export const createSend = (clientResolver: SigningClientResolver) => buildTx<MsgSend>({
clientResolver: clientResolver,
clientResolver,
typeUrl: MsgSend.typeUrl,
encoders: toEncoders(MsgSend),
converters: toConverters(MsgSend)
2 changes: 1 addition & 1 deletion libs/interchainjs/src/extern.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
9 changes: 4 additions & 5 deletions libs/interchainjs/src/helper-func-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
@@ -20,7 +20,7 @@ export interface QueryBuilderOptions<TReq, TRes> {

export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {
return async (request: TReq) => {
let rpc: Rpc;
let rpc: Rpc | undefined;

if(isRpc(opts.clientResolver)) {
rpc = opts.clientResolver;
@@ -44,11 +44,10 @@ export interface ITxArgs<TMsg> {
}

export function isISigningClient(client: unknown): client is ISigningClient {
return client
return client !== null && client !== undefined
&& typeof (client as ISigningClient).signAndBroadcast === 'function'
&& typeof (client as ISigningClient).addConverters === 'function'
&& typeof (client as ISigningClient).addEncoders === 'function';

}

export interface ISigningClient {
@@ -83,7 +82,7 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
fee: StdFee | 'auto',
memo: string
): Promise<DeliverTxResponse> => {
let client: ISigningClient;
let client: ISigningClient | undefined;

// if opts.getSigningClient is a function, call it to get the SigningClient instance
if(isISigningClient(opts.clientResolver)) {
4 changes: 2 additions & 2 deletions libs/interchainjs/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
@@ -199,7 +199,7 @@ export interface Rpc {
}

export function isRpc(rpc: unknown): rpc is Rpc {
return rpc && typeof (rpc as Rpc).request === 'function';
return rpc !== null && rpc !== undefined && typeof (rpc as Rpc).request === 'function';
}

interface Timestamp {
27 changes: 18 additions & 9 deletions libs/interchainjs/src/react-query.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/

import { getRpcClient } from './extern'

import { getRpcClient } from './extern'
import {
isRpc,
Rpc,
@@ -22,7 +23,6 @@ import {
useQuery,
useQueryClient,
UseQueryOptions,
MutationOptions,
useMutation,
UseMutationOptions,
QueryKey,
@@ -41,7 +41,7 @@ export interface CacheResolver {
}

export function isCacheResolver(resolver: unknown) : resolver is CacheResolver {
return resolver && (resolver as CacheResolver).rpcEndpoint !== undefined && (resolver as CacheResolver).clientQueryKey !== undefined;
return resolver !== null && resolver !== undefined && (resolver as CacheResolver).rpcEndpoint !== undefined && (resolver as CacheResolver).clientQueryKey !== undefined;
}

export interface ReactQueryParams<TResponse, TData = TResponse> {
@@ -52,6 +52,7 @@ export interface UseRpcClientQuery<TData> extends ReactQueryParams<ProtobufRpcCl
clientResolver?: CacheResolver;
}


export interface UseRpcEndpointQuery<TData> extends ReactQueryParams<string | HttpEndpoint, TData> {
getter: () => Promise<string | HttpEndpoint>;
rpcEndPointKey?: string;
@@ -76,9 +77,9 @@ export const useRpcClient = <TData = ProtobufRpcClient>({
context: options?.context
});

const key = clientResolver.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY;
return useQuery<ProtobufRpcClient, Error, TData>([key, clientResolver.rpcEndpoint], async () => {
if(!clientResolver.rpcEndpoint) {
const key = clientResolver?.clientQueryKey || DEFAULT_RPC_CLIENT_QUERY_KEY;
return useQuery<ProtobufRpcClient, Error, TData>([key, clientResolver?.rpcEndpoint], async () => {
if(!clientResolver?.rpcEndpoint) {
throw new Error('rpcEndpoint is required');
}

@@ -110,7 +111,7 @@ export function buildUseQuery<TReq, TRes>(opts: UseQueryBuilderOptions<TReq, TRe
context: options?.context
});

let rpcResolver: RpcResolver;
let rpcResolver: RpcResolver | undefined;

if(isRpc(clientResolver)) {
rpcResolver = clientResolver;
@@ -126,6 +127,10 @@ export function buildUseQuery<TReq, TRes>(opts: UseQueryBuilderOptions<TReq, TRe
rpcResolver = clientResolver;
}

if(!rpcResolver) {
throw new Error('RpcResolver is not initialized');
}

const queryFn = opts.builderQueryFn(rpcResolver);
return useQuery<TRes, Error, TData>(customizedQueryKey || [opts.queryKeyPrefix, request], () => queryFn(request), options);
};
@@ -162,7 +167,7 @@ export function buildUseMutation<TMsg, TError>(opts: UseMutationBuilderOptions<T
context: options?.context
});

let signingClientResolver: SigningClientResolver;
let signingClientResolver: SigningClientResolver | undefined;

if(isISigningClient(clientResolver)) {
signingClientResolver = clientResolver;
@@ -174,6 +179,10 @@ export function buildUseMutation<TMsg, TError>(opts: UseMutationBuilderOptions<T
clientResolver = clientResolver;
}

if(!signingClientResolver) {
throw new Error('SigningClientResolver is not initialized');
}

const mutationFn = opts.builderMutationFn(signingClientResolver);

return useMutation<DeliverTxResponse, Error, ITxArgs<TMsg>>(
2 changes: 1 addition & 1 deletion libs/interchainjs/src/registry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
2 changes: 1 addition & 1 deletion libs/interchainjs/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
2 changes: 1 addition & 1 deletion libs/interchainjs/src/utf8.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
2 changes: 1 addition & 1 deletion libs/interchainjs/src/varint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.6
* This file and any referenced files were automatically generated by @cosmology/telescope@1.10.7
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
"@chain-registry/client": "1.18.1",
"@confio/relayer": "^0.12.0",
"@cosmjs/crypto": "^0.32.2",
"@cosmology/telescope": "^1.10.6",
"@cosmology/telescope": "^1.10.7",
"@injectivelabs/networks": "^1.14.13",
"@injectivelabs/sdk-ts": "^1.14.13",
"@injectivelabs/wallet-ts": "^1.14.13",
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1694,25 +1694,25 @@
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671"
integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w==

"@cosmology/ast@^1.8.8":
version "1.8.8"
resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.8.8.tgz#4989811877fd7fdcdd44a78b2d0733a29f95041e"
integrity sha512-jFkpiKiE4/xsvnIrMu53SQuVAZeSWUJKrNm1TqY9YwTnxLXT/gQNwjh0r/u6XQX/As4jOTSZ6HmQZO1mEq/rKg==
"@cosmology/ast@^1.8.9":
version "1.8.9"
resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.8.9.tgz#28df40cad0eb5349e0fa8dcfa288e53322e32e3e"
integrity sha512-yhRo0QiCGCkPCVKxyvGrUKqZwbbGQXBF+HlqNsBDqC4Ra4r/KY7JP7Q2NCttzCXK6YFfa+dkOiKGs7YAh9eL6g==
dependencies:
"@babel/types" "7.23.6"
"@cosmology/types" "^1.10.2"
"@cosmology/utils" "^1.8.6"
"@cosmology/types" "^1.10.3"
"@cosmology/utils" "^1.8.7"
case "1.6.3"
dotty "0.1.2"

"@cosmology/proto-parser@^1.8.6":
version "1.8.6"
resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.8.6.tgz#41e59e15be2eee5b587af18e8137a2d1dc2e95c6"
integrity sha512-n4ytcDpNDZR6zetqpzHr9UbW/CZlo79vjVqvp/6C3rBMEG719QggKHekZxMpO08muP+IbacTOkJW9s9sLSuULg==
"@cosmology/proto-parser@^1.8.7":
version "1.8.7"
resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.8.7.tgz#b79d9969b2445ca27b8c57bd741305868214e730"
integrity sha512-fF6bq+ddV3ITUwZWFAR3GiA04TEh9akY9Jzeo4F92BtaeJ4DdfPoBhLgMVDmvCvDCzlzs2VfO8QANnzCMCqB2w==
dependencies:
"@cosmology/protobufjs" "7.3.2"
"@cosmology/types" "^1.10.2"
"@cosmology/utils" "^1.8.6"
"@cosmology/types" "^1.10.3"
"@cosmology/utils" "^1.8.7"
dotty "0.1.2"
fast-json-patch "3.1.1"
glob "8.0.3"
@@ -1738,19 +1738,19 @@
"@types/node" ">=13.7.0"
long "^5.0.0"

"@cosmology/telescope@^1.10.6":
version "1.10.6"
resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.10.6.tgz#0bcef39e0360f93d7604f3ebdad142456be0ff11"
integrity sha512-ZmZTnIbDI/EtQhbi+8+Exu8NiXG/4l1hCVZKJFzQ1Q7Q8vwl1l8bNAocC+Q3Pjx3l7cX36kp6l48EMnmd7MXgw==
"@cosmology/telescope@^1.10.7":
version "1.10.7"
resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.10.7.tgz#381d6f915cdc36c6b11ada29399e9f609b76911c"
integrity sha512-pUzkJEodSPC3MHoRpOoEkfpOUjeVx77K95Men9T7U0Ehce0jNjX615y7ih6KADaO2vgWNbGbeeLjrU/9Wc4dpw==
dependencies:
"@babel/generator" "^7.23.6"
"@babel/parser" "^7.23.6"
"@babel/traverse" "7.23.6"
"@babel/types" "7.23.6"
"@cosmology/ast" "^1.8.8"
"@cosmology/proto-parser" "^1.8.6"
"@cosmology/types" "^1.10.2"
"@cosmology/utils" "^1.8.6"
"@cosmology/ast" "^1.8.9"
"@cosmology/proto-parser" "^1.8.7"
"@cosmology/types" "^1.10.3"
"@cosmology/utils" "^1.8.7"
"@cosmwasm/ts-codegen" "0.35.7"
"@types/parse-package-name" "0.1.0"
case "1.6.3"
@@ -1768,20 +1768,20 @@
rimraf "5.0.0"
yaml "^2.3.4"

"@cosmology/types@^1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.10.2.tgz#3d048860dc8fe0a72a72e06f831d29dbed30af2f"
integrity sha512-6L/Q0k/gFtgOjFUDsNdPkgo9xfuF9OHvO13RRh03JK2iN8UstHiCcBXG0NyW4kg+ugMUBkdzo2nEjDs9QZI9WQ==
"@cosmology/types@^1.10.3":
version "1.10.3"
resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.10.3.tgz#005ee9246ef618466254d4156074c0cc80f2dfaa"
integrity sha512-3iBnbmMcJQ7xVgudS/BoxU/dPGJxFQibhMjA5LW2dIAaQh54oCcd2pTuG93daRgh7TMKyh/tIMnwfwg2G5dcGw==
dependencies:
case "1.6.3"
fast-json-patch "3.1.1"

"@cosmology/utils@^1.8.6":
version "1.8.6"
resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.8.6.tgz#f874ee348d5b721faed2faf122df89d3084386a0"
integrity sha512-1+LE4J4EjEbQcwankqkIy6ThyIdkzCNOFyHQHheruyv+Gnak2AWvPL2I2x2kaljZIgjx70z/edsC/OJb5nQ7vw==
"@cosmology/utils@^1.8.7":
version "1.8.7"
resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.8.7.tgz#f19b08cfe606c46a01176006f754283a5e117f60"
integrity sha512-sb1Zk3YjRsS8lAh8GUYskUQUQj34rlJ4Rbleir+kQ6YtqXxsTPvo0b78ALtQJYhd5k03JPmAH80mCaWkmjrTKA==
dependencies:
"@cosmology/types" "^1.10.2"
"@cosmology/types" "^1.10.3"
dotty "0.1.2"

"@cosmostation/extension-client@^0.1.15":

0 comments on commit 657c328

Please sign in to comment.