Skip to content

fix: create sub account key error #65

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 4 additions & 3 deletions api_sub_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ package gateapi

import (
"context"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"

"github.com/antihax/optional"
)

// Linger please
Expand Down Expand Up @@ -413,14 +414,14 @@ CreateSubAccountKeys Create API Key of the sub-account

@return []SubAccountKey
*/
func (a *SubAccountApiService) CreateSubAccountKeys(ctx context.Context, userId int64, subAccountKey SubAccountKey) ([]SubAccountKey, *http.Response, error) {
func (a *SubAccountApiService) CreateSubAccountKeys(ctx context.Context, userId int64, subAccountKey SubAccountKey) (SubAccountKey, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []SubAccountKey
localVarReturnValue SubAccountKey
)

// create path and map variables
Expand Down
4 changes: 3 additions & 1 deletion model_sub_account_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package gateapi

type SubAccountKey struct {
// User ID
UserId string `json:"user_id,omitempty"`
UserId int64 `json:"user_id,omitempty"`
// Mode: 1 - classic 2 - portfolio account
Mode int32 `json:"mode,omitempty"`
// API key name
Expand All @@ -21,6 +21,8 @@ type SubAccountKey struct {
IpWhitelist []string `json:"ip_whitelist,omitempty"`
// API Key
Key string `json:"key,omitempty"`
// API Secret Key
Secret string `json:"secret,omitempty"`
// State 1 - normal 2 - locked 3 - frozen
State int32 `json:"state,omitempty"`
// Creation time
Expand Down