Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: set the types to the origin package alias and remove trade client #170

Merged
merged 6 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 39 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,81 @@
# Changelog
## 1.3.0
IMPROVEMENT
[\#170](https://github.com/bnb-chain/go-sdk/pull/170) types: set the types to the origin package alias and remove trade client

## 1.2.9
IMPROVEMENT
[\#168](https://github.com/bnb-chain/go-sdk/pull/168) type: add more oracle claim type

## 1.2.8
FEATURE
[\#164](https://github.com/bnb-chain/go-sdk/pull/164) feat: impl bep159 txs cli and queries

## 1.2.7
* [\#160](https://github.com/bnb-chain/go-sdk/pull/160) [RPC] Support minimal 0.1 BNB staking

## 1.2.6
CHAIN UPGRADE
* [\#144](https://github.com/binance-chain/go-sdk/pull/144) [RPC] [API] Support for the transfer of token ownership, and change the minimum token symbol length
* [\#144](https://github.com/bnb-chain/go-sdk/pull/144) [RPC] [API] Support for the transfer of token ownership, and change the minimum token symbol length

## 1.2.5
IMPROVEMENT
* [\#142](https://github.com/binance-chain/go-sdk/pull/142) [RPC] [API] add contract info for a token if there is any
* [\#142](https://github.com/bnb-chain/go-sdk/pull/142) [RPC] [API] add contract info for a token if there is any

## 1.2.4
CHAIN UPGRADE
* [\#132](https://github.com/binance-chain/go-sdk/pull/132) [RPC] [API] enable side chain governance transaction
* [\#133](https://github.com/binance-chain/go-sdk/pull/133) [RPC] [API] enable side chain unbind transaction, and modify the structure of claimMsg
* [\#136](https://github.com/binance-chain/go-sdk/pull/136) [TX] [TOOL] add utils to parse Claim payload to human readable interface
* [\#132](https://github.com/bnb-chain/go-sdk/pull/132) [RPC] [API] enable side chain governance transaction
* [\#133](https://github.com/bnb-chain/go-sdk/pull/133) [RPC] [API] enable side chain unbind transaction, and modify the structure of claimMsg
* [\#136](https://github.com/bnb-chain/go-sdk/pull/136) [TX] [TOOL] add utils to parse Claim payload to human readable interface

## 1.2.3
CHAIN UPGRADE
* [\#110](https://github.com/binance-chain/go-sdk/pull/110) [RPC] [API] Add pending_match flag
* [\#130](https://github.com/binance-chain/go-sdk/pull/130) [RPC] [API] Support Mini Token
* [\#110](https://github.com/bnb-chain/go-sdk/pull/110) [RPC] [API] Add pending_match flag
* [\#130](https://github.com/bnb-chain/go-sdk/pull/130) [RPC] [API] Support Mini Token
## 1.2.2
* [\#106](https://github.com/binance-chain/go-sdk/pull/106) [RPC] fix nil point error in getBalance rpc call
* [\#103](https://github.com/binance-chain/go-sdk/pull/103) [RPC] change the default timeout of RPC client as 5 seconds
* [\#102](https://github.com/binance-chain/go-sdk/pull/102) [FIX] Some typos only (managr/manger)
* [\#106](https://github.com/bnb-chain/go-sdk/pull/106) [RPC] fix nil point error in getBalance rpc call
* [\#103](https://github.com/bnb-chain/go-sdk/pull/103) [RPC] change the default timeout of RPC client as 5 seconds
* [\#102](https://github.com/bnb-chain/go-sdk/pull/102) [FIX] Some typos only (managr/manger)

## 1.2.1
* [\#99](https://github.com/binance-chain/go-sdk/pull/99) [BUILD] upgrade version of btcd to avoid retag issue
* [\#99](https://github.com/bnb-chain/go-sdk/pull/99) [BUILD] upgrade version of btcd to avoid retag issue

## v1.2.0
* [\#93](https://github.com/binance-chain/go-sdk/pull/93) [BREAKING] uprade to binance chain release 0.6.3
* [\#93](https://github.com/bnb-chain/go-sdk/pull/93) [BREAKING] uprade to binance chain release 0.6.3

## v1.1.3
* [\#81](https://github.com/binance-chain/go-sdk/pull/81) [TX] support swap on a single chain
* [\#81](https://github.com/bnb-chain/go-sdk/pull/81) [TX] support swap on a single chain


## v1.1.2
* [\#88](https://github.com/binance-chain/go-sdk/pull/88) [RPC] wrap error for abci query when abci code is not 0
* [\#88](https://github.com/bnb-chain/go-sdk/pull/88) [RPC] wrap error for abci query when abci code is not 0

## v1.1.1
IMPROVEMENT
* [\#87](https://github.com/binance-chain/go-sdk/pull/87) [RPC] distinguish not found error for get timelock rpc
* [\#84](https://github.com/binance-chain/go-sdk/pull/84) [RPC] change interface of get timelock
* [\#87](https://github.com/bnb-chain/go-sdk/pull/87) [RPC] distinguish not found error for get timelock rpc
* [\#84](https://github.com/bnb-chain/go-sdk/pull/84) [RPC] change interface of get timelock


## v1.1.0
IMPROVEMENT
* [\#82](https://github.com/binance-chain/go-sdk/pull/82) [RPC] refactor reconnection
* [\#82](https://github.com/bnb-chain/go-sdk/pull/82) [RPC] refactor reconnection

## v1.0.9

FEATURES
* [\#71](https://github.com/binance-chain/go-sdk/pull/71) [RPC] add timelock query support
* [\#73](https://github.com/binance-chain/go-sdk/pull/73) [RPC] add limit param to get depth api for RPC
* [\#71](https://github.com/bnb-chain/go-sdk/pull/71) [RPC] add timelock query support
* [\#73](https://github.com/bnb-chain/go-sdk/pull/73) [RPC] add limit param to get depth api for RPC


## v1.0.8
IMPROVEMENTS
* [\#53](https://github.com/binance-chain/go-sdk/pull/53) [SOURCE] change the default source into 0
* [\#56](https://github.com/binance-chain/go-sdk/pull/56) [RPC] add reconnect strategy when timeout to receive response
* [\#61](https://github.com/binance-chain/go-sdk/pull/61) [KEY] support bip44 to derive many address from same seed phase
* [\#53](https://github.com/bnb-chain/go-sdk/pull/53) [SOURCE] change the default source into 0
* [\#56](https://github.com/bnb-chain/go-sdk/pull/56) [RPC] add reconnect strategy when timeout to receive response
* [\#61](https://github.com/bnb-chain/go-sdk/pull/61) [KEY] support bip44 to derive many address from same seed phase

FEATURES
* [\#66](https://github.com/binance-chain/go-sdk/pull/66) [API] support set account flag transaction
* [\#70](https://github.com/binance-chain/go-sdk/pull/70) [API] support atomic swap transactions
* [\#66](https://github.com/bnb-chain/go-sdk/pull/66) [API] support set account flag transaction
* [\#70](https://github.com/bnb-chain/go-sdk/pull/70) [API] support atomic swap transactions

BREAKING
* [\#57](https://github.com/binance-chain/go-sdk/pull/57) [API] add query option to getTokens api
* [\#57](https://github.com/bnb-chain/go-sdk/pull/57) [API] add query option to getTokens api
6 changes: 3 additions & 3 deletions client/basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"gopkg.in/resty.v1"

"github.com/binance-chain/go-sdk/types"
"github.com/binance-chain/go-sdk/types/tx"
"github.com/bnb-chain/go-sdk/types"
"github.com/bnb-chain/go-sdk/types/tx"
"github.com/gorilla/websocket"
)

Expand All @@ -34,7 +34,7 @@ type client struct {
}

func NewClient(baseUrl string, apiKey string) BasicClient {
return &client{baseUrl: baseUrl, apiUrl: fmt.Sprintf("%s://%s", types.DefaultApiSchema, baseUrl+types.DefaultAPIVersionPrefix),apiKey:apiKey}
return &client{baseUrl: baseUrl, apiUrl: fmt.Sprintf("%s://%s", types.DefaultApiSchema, baseUrl+types.DefaultAPIVersionPrefix), apiKey: apiKey}
}

func (c *client) Get(path string, qp map[string]string) ([]byte, int, error) {
Expand Down
23 changes: 9 additions & 14 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ package client
import (
"gopkg.in/resty.v1"

"github.com/binance-chain/go-sdk/client/basic"
"github.com/binance-chain/go-sdk/client/query"
"github.com/binance-chain/go-sdk/client/transaction"
"github.com/binance-chain/go-sdk/client/websocket"
"github.com/binance-chain/go-sdk/common/types"
"github.com/binance-chain/go-sdk/keys"
"github.com/bnb-chain/go-sdk/client/basic"
"github.com/bnb-chain/go-sdk/client/query"
"github.com/bnb-chain/go-sdk/client/transaction"
"github.com/bnb-chain/go-sdk/common/types"
"github.com/bnb-chain/go-sdk/keys"
)

// dexClient wrapper
type dexClient struct {
query.QueryClient
websocket.WSClient
transaction.TransactionClient
basic.BasicClient
}
Expand All @@ -23,7 +21,6 @@ type dexClient struct {
type DexClient interface {
basic.BasicClient
query.QueryClient
websocket.WSClient
transaction.TransactionClient
}

Expand All @@ -32,27 +29,25 @@ func init() {
}

func NewDexClientWithApiKey(baseUrl string, network types.ChainNetwork, keyManager keys.KeyManager, apiKey string) (DexClient, error) {
types.Network = network
types.SetNetwork(network)
c := basic.NewClient(baseUrl+"/internal", apiKey)
w := websocket.NewClient(c)
q := query.NewClient(c)
n, err := q.GetNodeInfo()
if err != nil {
return nil, err
}
t := transaction.NewClient(n.NodeInfo.Network, keyManager, q, c)
return &dexClient{BasicClient: c, QueryClient: q, TransactionClient: t, WSClient: w}, nil
return &dexClient{BasicClient: c, QueryClient: q, TransactionClient: t}, nil
}

func NewDexClient(baseUrl string, network types.ChainNetwork, keyManager keys.KeyManager) (DexClient, error) {
types.Network = network
types.SetNetwork(network)
c := basic.NewClient(baseUrl, "")
w := websocket.NewClient(c)
q := query.NewClient(c)
n, err := q.GetNodeInfo()
if err != nil {
return nil, err
}
t := transaction.NewClient(n.NodeInfo.Network, keyManager, q, c)
return &dexClient{BasicClient: c, QueryClient: q, TransactionClient: t, WSClient: w}, nil
return &dexClient{BasicClient: c, QueryClient: q, TransactionClient: t}, nil
}
2 changes: 1 addition & 1 deletion client/query/get_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/binance-chain/go-sdk/common/types"
"github.com/bnb-chain/go-sdk/common/types"
)

// GetAccount returns list of trading pairs
Expand Down
31 changes: 0 additions & 31 deletions client/query/get_closed_orders.go

This file was deleted.

31 changes: 0 additions & 31 deletions client/query/get_depth.go

This file was deleted.

60 changes: 0 additions & 60 deletions client/query/get_kline.go

This file was deleted.

30 changes: 0 additions & 30 deletions client/query/get_markets.go

This file was deleted.

31 changes: 0 additions & 31 deletions client/query/get_mini_closed_orders.go

This file was deleted.

Loading