diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ea749f..a4d3d1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,14 @@ and this project adheres to queries remain available in the `IbcExtension` because for IBC the storage layout is standardized. Such queries can still be implemented in CosmJS caller code that only needs to support one backend. ([#865]) +- @cosmjs/tendermint-rpc: Remove default URL from `HttpClient` and + `WebsocketClient` constructors ([#897]). - all: Upgrade cosmjs-types to 0.3. This includes the types of the Cosmos SDK 0.44 modules x/authz and x/feegrant. It causes a few breaking changes by adding fields to interfaces. ([#928]) [#865]: https://github.com/cosmos/cosmjs/issues/865 +[#897]: https://github.com/cosmos/cosmjs/issues/897 [#928]: https://github.com/cosmos/cosmjs/issues/928 ### Added diff --git a/packages/tendermint-rpc/src/rpcclients/httpclient.ts b/packages/tendermint-rpc/src/rpcclients/httpclient.ts index 52beb72a..293842df 100644 --- a/packages/tendermint-rpc/src/rpcclients/httpclient.ts +++ b/packages/tendermint-rpc/src/rpcclients/httpclient.ts @@ -39,7 +39,7 @@ export async function http(method: "POST", url: string, request?: any): Promise< export class HttpClient implements RpcClient { protected readonly url: string; - public constructor(url = "http://localhost:46657") { + public constructor(url: string) { // accept host.name:port and assume http protocol this.url = hasProtocol(url) ? url : "http://" + url; } diff --git a/packages/tendermint-rpc/src/rpcclients/websocketclient.ts b/packages/tendermint-rpc/src/rpcclients/websocketclient.ts index 458353fa..d5485b35 100644 --- a/packages/tendermint-rpc/src/rpcclients/websocketclient.ts +++ b/packages/tendermint-rpc/src/rpcclients/websocketclient.ts @@ -142,7 +142,7 @@ export class WebsocketClient implements RpcStreamingClient { // map is never cleared and there is no need to do so. But unsubscribe all the subscriptions! private readonly subscriptionStreams = new Map>(); - public constructor(baseUrl = "ws://localhost:46657", onError: (err: any) => void = defaultErrorHandler) { + public constructor(baseUrl: string, onError: (err: any) => void = defaultErrorHandler) { // accept host.name:port and assume ws protocol // make sure we don't end up with ...//websocket const path = baseUrl.endsWith("/") ? "websocket" : "/websocket";