Skip to content

Commit

Permalink
use connect comet
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Jan 5, 2024
1 parent 09bd690 commit 9c1f008
Show file tree
Hide file tree
Showing 13 changed files with 2,736 additions and 2,486 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
Expand Down
8 changes: 4 additions & 4 deletions packages/osmo-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@cosmjs/amino": "0.29.3",
"@cosmjs/proto-signing": "0.29.3",
"@cosmjs/stargate": "0.29.3",
"@cosmjs/tendermint-rpc": "^0.29.3",
"@cosmjs/amino": "0.32.0",
"@cosmjs/proto-signing": "0.32.0",
"@cosmjs/stargate": "0.32.0",
"@cosmjs/tendermint-rpc": "^0.32.0",
"@cosmology/lcd": "^0.12.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmo-query/src/codegen/cosmos/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmo-query/src/codegen/cosmwasm/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
6 changes: 3 additions & 3 deletions packages/osmo-query/src/codegen/extern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/

import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate'
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";

const _rpcClients: Record<string, ProtobufRpcClient> = {};

export const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => {
if (typeof rpcEndpoint === 'string') {
return rpcEndpoint;
} else if (!!rpcEndpoint) {
//@ts-ignore
//@ts-ignore
return rpcEndpoint.url;
}
}
Expand All @@ -24,7 +24,7 @@ export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => {
if (_rpcClients.hasOwnProperty(key)) {
return _rpcClients[key];
}
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
//@ts-ignore
const client = new QueryClient(tmClient);
const rpc = createProtobufRpcClient(client);
Expand Down
4 changes: 2 additions & 2 deletions packages/osmo-query/src/codegen/ibc/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmo-query/src/codegen/osmosis/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
8 changes: 4 additions & 4 deletions packages/osmojs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@cosmjs/amino": "0.29.3",
"@cosmjs/proto-signing": "0.29.3",
"@cosmjs/stargate": "0.29.3",
"@cosmjs/tendermint-rpc": "^0.29.3",
"@cosmjs/amino": "0.32.0",
"@cosmjs/proto-signing": "0.32.0",
"@cosmjs/stargate": "0.32.0",
"@cosmjs/tendermint-rpc": "0.32.0",
"@cosmology/lcd": "^0.12.0"
}
}
4 changes: 2 additions & 2 deletions packages/osmojs/src/codegen/cosmos/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmojs/src/codegen/cosmwasm/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmojs/src/codegen/ibc/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
4 changes: 2 additions & 2 deletions packages/osmojs/src/codegen/osmosis/rpc.query.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc";
import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc";
import { QueryClient } from "@cosmjs/stargate";
export const createRPCQueryClient = async ({
rpcEndpoint
}: {
rpcEndpoint: string | HttpEndpoint;
}) => {
const tmClient = await Tendermint34Client.connect(rpcEndpoint);
const tmClient = await connectComet(rpcEndpoint);
const client = new QueryClient(tmClient);
return {
cosmos: {
Expand Down
Loading

0 comments on commit 9c1f008

Please sign in to comment.