client

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	WorkspaceID string
	// contains filtered or unexported fields
}

func New

func New(p *config.Profile) (*Client, error)

New builds an HTTP client backed by bron-sdk-go using the resolved profile. The private key (JWK) is read from KeyFile. Workspace ID is interpolated into request paths via Do().

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, pathParams map[string]string, body, query, result interface{}) error

Do executes a request, substituting `{workspaceId}` and any other path placeholders (`{accountId}`, `{transactionId}`, ...) before sending. All values are URL-escaped via `url.PathEscape`.

Decoding goes through json.Decoder.UseNumber so decimal payloads keep their exact wire representation. The default decoder converts every JSON number to float64, which truncates large integers and rounds long decimals — fatal for balances/amounts where a single trailing digit can be billions of wei. We capture the raw response into json.RawMessage and re-decode locally so that numeric leaves arrive as json.Number; output formatters then emit them verbatim.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL