mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Merge pull request #935 from cosmos/remove-default-url
Remove default URLs from HttpClient and WebsocketClient
This commit is contained in:
commit
a6bf588c46
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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<string, Stream<SubscriptionEvent>>();
|
||||
|
||||
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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user