Skip to content

Commit 93c7db8

Browse files
authored
Merge pull request #14 from 0x4139/fix/clob-nil-transport
fix: default transport client in clob.NewClient when nil
2 parents c508815 + eaa0c07 commit 93c7db8

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

pkg/clob/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package clob
22

33
const (
4+
// BaseURL is the default production endpoint for the CLOB.
5+
BaseURL = "https://clob.polymarket.com"
6+
47
// DefaultGeoblockHost is the default host for the geoblock endpoint.
58
DefaultGeoblockHost = "https://polymarket.com"
69
)

pkg/clob/impl.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func NewClientWithGeoblock(httpClient *transport.Client, geoblockHost string) Cl
7171
geoblockHost = DefaultGeoblockHost
7272
}
7373

74+
if httpClient == nil {
75+
httpClient = transport.NewClient(nil, BaseURL)
76+
}
77+
7478
c := &clientImpl{
7579
httpClient: httpClient,
7680
cache: newClientCache(),

0 commit comments

Comments
 (0)