Skip to content

Commit

Permalink
Merge pull request #2 from maestro-org/release-please--branches--main…
Browse files Browse the repository at this point in the history
…--changes--next

release: 0.1.0-alpha.1
  • Loading branch information
Vardominator authored Oct 8, 2024
2 parents 4e265be + a07a6d9 commit bcfdbe1
Show file tree
Hide file tree
Showing 67 changed files with 512 additions and 418 deletions.
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0-alpha.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 24
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maestro%2Fmaestro-bitcoin-900ea6470a56333353dbdc9e87ba4431c23eeb68a4ea6060a511b1403f94b13a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maestro%2Fmaestro-bitcoin-c531b4034ac885b312d47dac9228993502b0ea2f32bf5e939c0f0e096b1ba462.yml
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## 0.1.0-alpha.1 (2024-10-08)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/maestro-org/maestro-bitcoin-go-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* **api:** update via SDK Studio ([#4](https://github.com/maestro-org/maestro-bitcoin-go-sdk/issues/4)) ([fc8b1cf](https://github.com/maestro-org/maestro-bitcoin-go-sdk/commit/fc8b1cf8e9f39bd269055051902b23a60c16b37d))


### Chores

* configure new SDK language ([4e265be](https://github.com/maestro-org/maestro-bitcoin-go-sdk/commit/4e265be800eec9f36fee72f43b7057b46f530204))
* go live ([#1](https://github.com/maestro-org/maestro-bitcoin-go-sdk/issues/1)) ([58adb9b](https://github.com/maestro-org/maestro-bitcoin-go-sdk/commit/58adb9b2105c594c54d80811713794276e182b4e))
* update SDK settings ([#3](https://github.com/maestro-org/maestro-bitcoin-go-sdk/issues/3)) ([8574183](https://github.com/maestro-org/maestro-bitcoin-go-sdk/commit/85741837cfd5517f572110e7be96a1fbda4dc96c))
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To use a local version of this library from source in another project, edit the
directive. This can be done through the CLI with the following:

```sh
$ go mod edit -replace github.com/stainless-sdks/maestro-bitcoin-go=/path/to/maestro-bitcoin-go
$ go mod edit -replace github.com/maestro-org/maestro-bitcoin-go-sdk=/path/to/maestro-bitcoin-go-sdk
```

## Running tests
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Maestro Bitcoin
Copyright 2024 Maestro

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
62 changes: 35 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# Maestro Bitcoin Go API Library
# Maestro Go API Library

<a href="https://pkg.go.dev/github.com/stainless-sdks/maestro-bitcoin-go"><img src="https://pkg.go.dev/badge/github.com/stainless-sdks/maestro-bitcoin-go.svg" alt="Go Reference"></a>
<a href="https://pkg.go.dev/github.com/maestro-org/maestro-bitcoin-go-sdk"><img src="https://pkg.go.dev/badge/github.com/maestro-org/maestro-bitcoin-go-sdk.svg" alt="Go Reference"></a>

The Maestro Bitcoin Go library provides convenient access to [the Maestro Bitcoin REST
The Maestro Go library provides convenient access to [the Maestro REST
API](https://docs.gomaestro.org/) from applications written in Go. The full API of this library can be found in [api.md](api.md).

It is generated with [Stainless](https://www.stainlessapi.com/).

## Installation

<!-- x-release-please-start-version -->

```go
import (
"github.com/stainless-sdks/maestro-bitcoin-go" // imported as maestrobitcoin
"github.com/maestro-org/maestro-bitcoin-go-sdk" // imported as maestrobitcoingosdk
)
```

<!-- x-release-please-end -->

Or to pin the version:

<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/stainless-sdks/maestro-bitcoin-go@v0.0.1-alpha.0'
go get -u 'github.com/maestro-org/maestro-bitcoin-go-sdk@v0.1.0-alpha.1'
```

<!-- x-release-please-end -->

## Requirements

This library requires Go 1.18+.
Expand All @@ -36,14 +44,14 @@ import (
"context"
"fmt"

"github.com/stainless-sdks/maestro-bitcoin-go"
"github.com/stainless-sdks/maestro-bitcoin-go/option"
"github.com/maestro-org/maestro-bitcoin-go-sdk"
"github.com/maestro-org/maestro-bitcoin-go-sdk/option"
)

func main() {
client := maestrobitcoin.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("API_KEY")
option.WithEnvironmentEnvironment1(), // defaults to option.WithEnvironmentProduction()
client := maestrobitcoingosdk.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("API_KEY")
option.WithEnvironmentTestnet(), // defaults to option.WithEnvironmentMainnet()
)
timestampedBlockchainInfo, err := client.General.Info.Get(context.TODO())
if err != nil {
Expand All @@ -68,18 +76,18 @@ To send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](

```go
params := FooParams{
Name: maestrobitcoin.F("hello"),
Name: maestrobitcoingosdk.F("hello"),

// Explicitly send `"description": null`
Description: maestrobitcoin.Null[string](),
Description: maestrobitcoingosdk.Null[string](),

Point: maestrobitcoin.F(maestrobitcoin.Point{
X: maestrobitcoin.Int(0),
Y: maestrobitcoin.Int(1),
Point: maestrobitcoingosdk.F(maestrobitcoingosdk.Point{
X: maestrobitcoingosdk.Int(0),
Y: maestrobitcoingosdk.Int(1),

// In cases where the API specifies a given type,
// but you want to send something else, use `Raw`:
Z: maestrobitcoin.Raw[int64](0.01), // sends a float
Z: maestrobitcoingosdk.Raw[int64](0.01), // sends a float
}),
}
```
Expand Down Expand Up @@ -133,7 +141,7 @@ This library uses the functional options pattern. Functions defined in the
requests. For example:

```go
client := maestrobitcoin.NewClient(
client := maestrobitcoingosdk.NewClient(
// Adds a header to every request made by the client
option.WithHeader("X-Some-Header", "custom_header_info"),
)
Expand All @@ -146,7 +154,7 @@ client.General.Info.Get(context.TODO(), ...,
)
```

See the [full list of request options](https://pkg.go.dev/github.com/stainless-sdks/maestro-bitcoin-go/option).
See the [full list of request options](https://pkg.go.dev/github.com/maestro-org/maestro-bitcoin-go-sdk/option).

### Pagination

Expand All @@ -160,7 +168,7 @@ with additional helper methods like `.GetNextPage()`, e.g.:
### Errors

When the API returns a non-success status code, we return an error with type
`*maestrobitcoin.Error`. This contains the `StatusCode`, `*http.Request`, and
`*maestrobitcoingosdk.Error`. This contains the `StatusCode`, `*http.Request`, and
`*http.Response` values of the request, as well as the JSON of the error body
(much like other response objects in the SDK).

Expand All @@ -169,7 +177,7 @@ To handle errors, we recommend that you use the `errors.As` pattern:
```go
_, err := client.General.Info.Get(context.TODO())
if err != nil {
var apierr *maestrobitcoin.Error
var apierr *maestrobitcoingosdk.Error
if errors.As(err, &apierr) {
println(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request
println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
Expand Down Expand Up @@ -209,7 +217,7 @@ The file name and content-type can be customized by implementing `Name() string`
string` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a
file returned by `os.Open` will be sent with the file name on disk.

We also provide a helper `maestrobitcoin.FileParam(reader io.Reader, filename string, contentType string)`
We also provide a helper `maestrobitcoingosdk.FileParam(reader io.Reader, filename string, contentType string)`
which can be used to wrap any `io.Reader` with the appropriate file name and content type.

### Retries
Expand All @@ -222,7 +230,7 @@ You can use the `WithMaxRetries` option to configure or disable this:

```go
// Configure the default for all requests:
client := maestrobitcoin.NewClient(
client := maestrobitcoingosdk.NewClient(
option.WithMaxRetries(0), // default is 2
)

Expand Down Expand Up @@ -263,9 +271,9 @@ or the `option.WithJSONSet()` methods.

```go
params := FooNewParams{
ID: maestrobitcoin.F("id_xxxx"),
Data: maestrobitcoin.F(FooNewParamsData{
FirstName: maestrobitcoin.F("John"),
ID: maestrobitcoingosdk.F("id_xxxx"),
Data: maestrobitcoingosdk.F(FooNewParamsData{
FirstName: maestrobitcoingosdk.F("John"),
}),
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Expand Down Expand Up @@ -300,7 +308,7 @@ func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response,
return res, err
}

client := maestrobitcoin.NewClient(
client := maestrobitcoingosdk.NewClient(
option.WithMiddleware(Logger),
)
```
Expand All @@ -325,7 +333,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/maestro-bitcoin-go/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/maestro-org/maestro-bitcoin-go-sdk/issues) with questions, bugs, or suggestions.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Maestro Bitcoin please follow the respective company's security reporting guidelines.
or products provided by Maestro please follow the respective company's security reporting guidelines.

### Maestro Bitcoin Terms and Policies
### Maestro Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.

Expand Down
6 changes: 3 additions & 3 deletions address.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package maestrobitcoin
package maestrobitcoingosdk

import (
"github.com/stainless-sdks/maestro-bitcoin-go/option"
"github.com/maestro-org/maestro-bitcoin-go-sdk/option"
)

// AddressService contains methods and other services that help with interacting
// with the maestro-bitcoin API.
// with the maestro API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
Expand Down
10 changes: 5 additions & 5 deletions addressbrc20.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package maestrobitcoin
package maestrobitcoingosdk

import (
"context"
"errors"
"fmt"
"net/http"

"github.com/stainless-sdks/maestro-bitcoin-go/internal/apijson"
"github.com/stainless-sdks/maestro-bitcoin-go/internal/requestconfig"
"github.com/stainless-sdks/maestro-bitcoin-go/option"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/apijson"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/requestconfig"
"github.com/maestro-org/maestro-bitcoin-go-sdk/option"
)

// AddressBrc20Service contains methods and other services that help with
// interacting with the maestro-bitcoin API.
// interacting with the maestro API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
Expand Down
12 changes: 6 additions & 6 deletions addressbrc20_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package maestrobitcoin_test
package maestrobitcoingosdk_test

import (
"context"
"errors"
"os"
"testing"

"github.com/stainless-sdks/maestro-bitcoin-go"
"github.com/stainless-sdks/maestro-bitcoin-go/internal/testutil"
"github.com/stainless-sdks/maestro-bitcoin-go/option"
"github.com/maestro-org/maestro-bitcoin-go-sdk"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/testutil"
"github.com/maestro-org/maestro-bitcoin-go-sdk/option"
)

func TestAddressBrc20List(t *testing.T) {
Expand All @@ -21,13 +21,13 @@ func TestAddressBrc20List(t *testing.T) {
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := maestrobitcoin.NewClient(
client := maestrobitcoingosdk.NewClient(
option.WithBaseURL(baseURL),
option.WithAPIKey("My API Key"),
)
_, err := client.Addresses.Brc20.List(context.TODO(), "tb1qphcdyah2e4vtpxn56hsz3p6kapg90pl4x525kc")
if err != nil {
var apierr *maestrobitcoin.Error
var apierr *maestrobitcoingosdk.Error
if errors.As(err, &apierr) {
t.Log(string(apierr.DumpRequest(true)))
}
Expand Down
14 changes: 7 additions & 7 deletions addressrune.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package maestrobitcoin
package maestrobitcoingosdk

import (
"context"
Expand All @@ -9,15 +9,15 @@ import (
"net/http"
"net/url"

"github.com/stainless-sdks/maestro-bitcoin-go/internal/apijson"
"github.com/stainless-sdks/maestro-bitcoin-go/internal/apiquery"
"github.com/stainless-sdks/maestro-bitcoin-go/internal/param"
"github.com/stainless-sdks/maestro-bitcoin-go/internal/requestconfig"
"github.com/stainless-sdks/maestro-bitcoin-go/option"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/apijson"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/apiquery"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/param"
"github.com/maestro-org/maestro-bitcoin-go-sdk/internal/requestconfig"
"github.com/maestro-org/maestro-bitcoin-go-sdk/option"
)

// AddressRuneService contains methods and other services that help with
// interacting with the maestro-bitcoin API.
// interacting with the maestro API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
Expand Down
Loading

0 comments on commit bcfdbe1

Please sign in to comment.