Skip to content

Commit

Permalink
Merge pull request #195 from BuxOrg/chore/600-update-name
Browse files Browse the repository at this point in the history
chore(BUX-600): rename go-buxclient
  • Loading branch information
wregulski authored Feb 22, 2024
2 parents 42806e5 + 6ca6745 commit e801606
Show file tree
Hide file tree
Showing 42 changed files with 475 additions and 928 deletions.
39 changes: 0 additions & 39 deletions .all-contributorsrc

This file was deleted.

352 changes: 3 additions & 349 deletions .github/CODE_STANDARDS.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

Binary file removed .github/IMAGES/go-share-image.png
Binary file not shown.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# Pull Request Checklist

- [ ] 📖 I created my PR using provided : [CODE_STANDARDS](https://github.com/BuxOrg/go-paymail/blob/main/.github/CODE_STANDARDS.md)
- [ ] 📖 I have read the short Code of Conduct: [CODE_OF_CONDUCT](https://github.com/BuxOrg/go-paymail/blob/main/.github/CODE_OF_CONDUCT.md)
- [ ] 📖 I created my PR using provided : [CODE_STANDARDS](https://github.com/bitcoin-sv/spv-wallet-go-client/blob/main/.github/CODE_STANDARDS.md)
- [ ] 📖 I have read the short Code of Conduct: [CODE_OF_CONDUCT](https://github.com/bitcoin-sv/spv-wallet-go-client/blob/main/.github/CODE_OF_CONDUCT.md)
- [ ] 🏠 I tested my changes locally.
- [ ] ✅ I have provided tests for my changes.
- [ ] 📝 I have used conventional commits.
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ go.list
# Eclipse
.project

# VS Code
.vscode/

# Notes
todo.md

Expand All @@ -32,3 +35,4 @@ dist

# Code coverage
coverage.txt

5 changes: 0 additions & 5 deletions .vscode/extensions.json

This file was deleted.

14 changes: 0 additions & 14 deletions .vscode/launch.json

This file was deleted.

23 changes: 0 additions & 23 deletions .vscode/settings.json

This file was deleted.

17 changes: 0 additions & 17 deletions .vscode/tasks.json

This file was deleted.

3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2022 @BuxOrg
Copyright (c) 2023 BSV Blockchain Association ("BA")
Copyright (c) 2021-2022 @BuxOrg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ include .make/go.mk

## Not defined? Use default repo name which is the application
ifeq ($(REPO_NAME),)
REPO_NAME="go-buxclient"
REPO_NAME="spv-wallet-go-client"
endif

## Not defined? Use default repo owner
ifeq ($(REPO_OWNER),)
REPO_OWNER="BuxOrg"
REPO_OWNER="bitcoin-sv"
endif


Expand Down
66 changes: 32 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
<div align="center">

# BUX: Go Client
# SPV Wallet: Go Client

[![Release](https://img.shields.io/github/release-pre/BuxOrg/go-buxclient.svg?logo=github&style=flat&v=2)](https://github.com/BuxOrg/go-buxclient/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/BuxOrg/go-buxclient/run-tests.yml?branch=master&v=2)](https://github.com/BuxOrg/go-buxclient/actions)
[![Report](https://goreportcard.com/badge/github.com/BuxOrg/go-buxclient?style=flat&v=2)](https://goreportcard.com/report/github.com/BuxOrg/go-buxclient)
[![codecov](https://codecov.io/gh/BuxOrg/go-buxclient/branch/master/graph/badge.svg?v=2)](https://codecov.io/gh/BuxOrg/go-buxclient)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/BuxOrg/go-buxclient&style=flat&v=2)](https://mergify.io)
[![Release](https://img.shields.io/github/release-pre/bitcoin-sv/spv-wallet-go-client.svg?logo=github&style=flat&v=2)](https://github.com/bitcoin-sv/spv-wallet-go-client/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/bitcoin-sv/spv-wallet-go-client/run-tests.yml?branch=master&v=2)](https://github.com/bitcoin-sv/spv-wallet-go-client/actions)
[![Report](https://goreportcard.com/badge/github.com/bitcoin-sv/spv-wallet-go-client?style=flat&v=2)](https://goreportcard.com/report/github.com/bitcoin-sv/spv-wallet-go-client)
[![codecov](https://codecov.io/gh/bitcoin-sv/spv-wallet-go-client/branch/master/graph/badge.svg?v=2)](https://codecov.io/gh/bitcoin-sv/spv-wallet-go-client)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/bitcoin-sv/spv-wallet-go-client&style=flat&v=2)](https://mergify.io)
<br>

[![Go](https://img.shields.io/github/go-mod/go-version/BuxOrg/go-buxclient?v=2)](https://golang.org/)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&v=2)](https://gitpod.io/#https://github.com/BuxOrg/go-buxclient)
[![Go](https://img.shields.io/github/go-mod/go-version/bitcoin-sv/spv-wallet-go-client?v=2)](https://golang.org/)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&v=2)](https://gitpod.io/#https://github.com/bitcoin-sv/spv-wallet-go-client)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat&v=2)](https://github.com/RichardLitt/standard-readme)
[![Makefile Included](https://img.shields.io/badge/Makefile-Supported%20-brightgreen?=flat&logo=probot&v=2)](Makefile)

<br/>
</div>

> Get started using [BUX](https://getbux.io) in five minutes
## Table of Contents
- [About](#about)
- [Installation](#installation)
- [Documentation](#documentation)
- [Usage](#usage)
- [Examples & Tests](#examples--tests)
- [Benchmarks](#benchmarks)
- [Code Standards](#code-standards)
- [Contributing](#contributing)
- [License](#license)

<br/>

## About
[Read more about BUX](https://getbux.io)
- [SPV Wallet: Go Client](#spv-wallet-go-client)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Documentation](#documentation)
- [Built-in Features](#built-in-features)
- [Automatic Releases on Tag Creation (recommended)](#automatic-releases-on-tag-creation-recommended)
- [Manual Releases (optional)](#manual-releases-optional)
- [Usage](#usage)
- [Examples \& Tests](#examples--tests)
- [Benchmarks](#benchmarks)
- [Code Standards](#code-standards)
- [Usage](#usage-1)
- [Contributing](#contributing)
- [License](#license)

<br/>

## Installation

**go-buxclient** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy).
**spv-wallet-go-client** requires a [supported release of Go](https://golang.org/doc/devel/release.html#policy).
```shell script
go get -u github.com/BuxOrg/go-buxclient
go get -u github.com/bitcoin-sv/spv-wallet-go-client
```

<br/>

## Documentation
View the generated [documentation](https://pkg.go.dev/github.com/BuxOrg/go-buxclient)
View the generated [documentation](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet-go-client)

[![GoDoc](https://godoc.org/github.com/BuxOrg/go-buxclient?status.svg&style=flat&v=2)](https://pkg.go.dev/github.com/BuxOrg/go-buxclient)
[![GoDoc](https://godoc.org/github.com/bitcoin-sv/spv-wallet-go-client?status.svg&style=flat&v=2)](https://pkg.go.dev/github.com/bitcoin-sv/spv-wallet-go-client)

<br/>

Expand Down Expand Up @@ -175,7 +173,7 @@ Checkout all the [examples](examples)!
<br/>

### Examples & Tests
All unit tests and [examples](examples) run via [GitHub Actions](https://github.com/BuxOrg/go-buxclient/actions) and
All unit tests and [examples](examples) run via [GitHub Actions](https://github.com/bitcoin-sv/spv-wallet-go-client/actions) and
uses [Go version 1.19.x](https://golang.org/doc/go1.19). View the [configuration file](.github/workflows/run-tests.yml).

<br/>
Expand Down Expand Up @@ -218,10 +216,10 @@ func main() {
keys, _ := xpriv.Generate()
// Create a client
client, _ := buxclient.New(
buxclient.WithXPriv(keys.XPriv()),
buxclient.WithHTTP("localhost:3001"),
buxclient.WithSignRequest(true))
client, _ := walletclient.New(
walletclient.WithXPriv(keys.XPriv()),
walletclient.WithHTTP("localhost:3001"),
walletclient.WithSignRequest(true))
fmt.Println(client.IsSignRequest())
}
Expand All @@ -243,4 +241,4 @@ View the [contributing guidelines](.github/CODE_STANDARDS.md#3-contributing) and

## License

[![License](https://img.shields.io/github/license/BuxOrg/go-buxclient.svg?style=flat&v=2)](LICENSE)
[![License](https://img.shields.io/github/license/bitcoin-sv/spv-wallet-go-client.svg?style=flat&v=2)](LICENSE)
14 changes: 7 additions & 7 deletions access_keys.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package buxclient
package walletclient

import (
"context"

buxmodels "github.com/BuxOrg/bux-models"
"github.com/BuxOrg/go-buxclient/transports"
"github.com/bitcoin-sv/spv-wallet-go-client/transports"
"github.com/bitcoin-sv/spv-wallet/models"
)

// GetAccessKey gets the access key given by id
func (b *BuxClient) GetAccessKey(ctx context.Context, id string) (*buxmodels.AccessKey, transports.ResponseError) {
func (b *WalletClient) GetAccessKey(ctx context.Context, id string) (*models.AccessKey, transports.ResponseError) {
return b.transport.GetAccessKey(ctx, id)
}

// GetAccessKeys gets all the access keys filtered by the metadata
func (b *BuxClient) GetAccessKeys(ctx context.Context, metadataConditions *buxmodels.Metadata) ([]*buxmodels.AccessKey, transports.ResponseError) {
func (b *WalletClient) GetAccessKeys(ctx context.Context, metadataConditions *models.Metadata) ([]*models.AccessKey, transports.ResponseError) {
return b.transport.GetAccessKeys(ctx, metadataConditions)
}

// CreateAccessKey creates new access key
func (b *BuxClient) CreateAccessKey(ctx context.Context, metadata *buxmodels.Metadata) (*buxmodels.AccessKey, transports.ResponseError) {
func (b *WalletClient) CreateAccessKey(ctx context.Context, metadata *models.Metadata) (*models.AccessKey, transports.ResponseError) {
return b.transport.CreateAccessKey(ctx, metadata)
}

// RevokeAccessKey revoked the access key given by id
func (b *BuxClient) RevokeAccessKey(ctx context.Context, id string) (*buxmodels.AccessKey, transports.ResponseError) {
func (b *WalletClient) RevokeAccessKey(ctx context.Context, id string) (*models.AccessKey, transports.ResponseError) {
return b.transport.RevokeAccessKey(ctx, id)
}
18 changes: 9 additions & 9 deletions access_keys_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package buxclient
package walletclient

import (
"context"
"testing"

buxmodels "github.com/BuxOrg/bux-models"
"github.com/bitcoin-sv/spv-wallet/models"
"github.com/stretchr/testify/assert"

"github.com/BuxOrg/go-buxclient/fixtures"
"github.com/bitcoin-sv/spv-wallet-go-client/fixtures"
)

// TestAccessKeys will test the AccessKey methods
Expand All @@ -22,7 +22,7 @@ func TestAccessKeys(t *testing.T) {

t.Run("GetAccessKey", func(t *testing.T) {
// given
client := getTestBuxClient(transportHandler, true)
client := getTestWalletClient(transportHandler, true)

// when
accessKey, err := client.GetAccessKey(context.Background(), fixtures.AccessKey.ID)
Expand All @@ -37,23 +37,23 @@ func TestAccessKeys(t *testing.T) {
transportHandler := testTransportHandler{
Type: fixtures.RequestType,
Path: "/access-key/search",
Result: fixtures.MarshallForTestHandler([]*buxmodels.AccessKey{fixtures.AccessKey}),
Result: fixtures.MarshallForTestHandler([]*models.AccessKey{fixtures.AccessKey}),
ClientURL: fixtures.ServerURL,
Client: WithHTTPClient,
}
client := getTestBuxClient(transportHandler, true)
client := getTestWalletClient(transportHandler, true)

// when
accessKeys, err := client.GetAccessKeys(context.Background(), fixtures.TestMetadata)

// then
assert.NoError(t, err)
assert.Equal(t, accessKeys, []*buxmodels.AccessKey{fixtures.AccessKey})
assert.Equal(t, accessKeys, []*models.AccessKey{fixtures.AccessKey})
})

t.Run("CreateAccessKey", func(t *testing.T) {
// given
client := getTestBuxClient(transportHandler, true)
client := getTestWalletClient(transportHandler, true)

// when
accessKey, err := client.CreateAccessKey(context.Background(), fixtures.TestMetadata)
Expand All @@ -65,7 +65,7 @@ func TestAccessKeys(t *testing.T) {

t.Run("RevokeAccessKey", func(t *testing.T) {
// given
client := getTestBuxClient(transportHandler, true)
client := getTestWalletClient(transportHandler, true)

// when
accessKey, err := client.RevokeAccessKey(context.Background(), fixtures.AccessKey.ID)
Expand Down
Loading

0 comments on commit e801606

Please sign in to comment.