-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from cosmology-tech/feat/tendermint34Client_t…
…o_cometClient feat/use Comet Client
- Loading branch information
Showing
11 changed files
with
215 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export declare const external = "import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate'\nimport { Tendermint34Client, HttpEndpoint } from \"@cosmjs/tendermint-rpc\";\n\nconst _rpcClients: Record<string, ProtobufRpcClient> = {};\n\nexport const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => {\n if (typeof rpcEndpoint === 'string') {\n return rpcEndpoint;\n } else if (!!rpcEndpoint) {\n //@ts-ignore \n return rpcEndpoint.url;\n }\n}\n\nexport const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => {\n const key = getRpcEndpointKey(rpcEndpoint);\n if (!key) return;\n if (_rpcClients.hasOwnProperty(key)) {\n return _rpcClients[key];\n }\n const tmClient = await Tendermint34Client.connect(rpcEndpoint);\n //@ts-ignore\n const client = new QueryClient(tmClient);\n const rpc = createProtobufRpcClient(client);\n _rpcClients[key] = rpc;\n return rpc;\n}\n"; | ||
export declare const external = "import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate'\nimport { connectComet, HttpEndpoint } from \"@cosmjs/tendermint-rpc\";\n\nconst _rpcClients: Record<string, ProtobufRpcClient> = {};\n\nexport const getRpcEndpointKey = (rpcEndpoint: string | HttpEndpoint) => {\n if (typeof rpcEndpoint === 'string') {\n return rpcEndpoint;\n } else if (!!rpcEndpoint) {\n //@ts-ignore \n return rpcEndpoint.url;\n }\n}\n\nexport const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => {\n const key = getRpcEndpointKey(rpcEndpoint);\n if (!key) return;\n if (_rpcClients.hasOwnProperty(key)) {\n return _rpcClients[key];\n }\n const cometClient = await connectComet(rpcEndpoint);\n //@ts-ignore\n const client = new QueryClient(cometClient);\n const rpc = createProtobufRpcClient(client);\n _rpcClients[key] = rpc;\n return rpc;\n}\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.