Skip to content

Commit

Permalink
types: set the types to the origin package alias and remove trade cli…
Browse files Browse the repository at this point in the history
…ent (bnb-chain#170)
  • Loading branch information
j75689 authored Jan 6, 2023
1 parent d5c9fac commit 93d9640
Show file tree
Hide file tree
Showing 136 changed files with 1,230 additions and 12,509 deletions.
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

0 comments on commit 93d9640

Please sign in to comment.