-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1456 from c9s/edwin/bitget/get-account-assets
FEATURE: [bitget] get account assets
- Loading branch information
Showing
6 changed files
with
254 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
pkg/exchange/bitget/bitgetapi/v2/get_account_assets_request.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package bitgetapi | ||
|
||
//go:generate -command GetRequest requestgen -method GET -responseType .APIResponse -responseDataField Data | ||
//go:generate -command PostRequest requestgen -method POST -responseType .APIResponse -responseDataField Data | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
|
||
"github.com/c9s/bbgo/pkg/fixedpoint" | ||
"github.com/c9s/bbgo/pkg/types" | ||
) | ||
|
||
type AccountAsset struct { | ||
Coin string `json:"coin"` | ||
Available fixedpoint.Value `json:"available"` | ||
Frozen fixedpoint.Value `json:"frozen"` | ||
Locked fixedpoint.Value `json:"locked"` | ||
LimitAvailable fixedpoint.Value `json:"limitAvailable"` | ||
UpdatedTime types.MillisecondTimestamp `json:"uTime"` | ||
} | ||
|
||
type AssetType string | ||
|
||
const ( | ||
AssetTypeHoldOnly AssetType = "hold_only" | ||
AssetTypeHAll AssetType = "all" | ||
) | ||
|
||
//go:generate GetRequest -url "/api/v2/spot/account/assets" -type GetAccountAssetsRequest -responseDataType []AccountAsset | ||
type GetAccountAssetsRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
coin *string `param:"symbol,query"` | ||
assetType AssetType `param:"assetType,query"` | ||
} | ||
|
||
func (c *Client) NewGetAccountAssetsRequest() *GetAccountAssetsRequest { | ||
return &GetAccountAssetsRequest{client: c.Client} | ||
} |
195 changes: 195 additions & 0 deletions
195
pkg/exchange/bitget/bitgetapi/v2/get_account_assets_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters