kucoin-api 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BrokerClient.d.ts +162 -0
- package/dist/cjs/BrokerClient.js +175 -0
- package/dist/cjs/BrokerClient.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/requestUtils.d.ts +2 -0
- package/dist/cjs/lib/requestUtils.js +3 -0
- package/dist/cjs/lib/requestUtils.js.map +1 -1
- package/dist/cjs/types/request/broker.types.d.ts +52 -0
- package/dist/cjs/types/request/broker.types.js +3 -0
- package/dist/cjs/types/request/broker.types.js.map +1 -0
- package/dist/cjs/types/response/broker.types.d.ts +92 -0
- package/dist/cjs/types/response/broker.types.js +3 -0
- package/dist/cjs/types/response/broker.types.js.map +1 -0
- package/dist/mjs/BrokerClient.d.ts +162 -0
- package/dist/mjs/BrokerClient.js +171 -0
- package/dist/mjs/BrokerClient.js.map +1 -0
- package/dist/mjs/index.d.ts +3 -0
- package/dist/mjs/index.js +3 -0
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/lib/requestUtils.d.ts +2 -0
- package/dist/mjs/lib/requestUtils.js +3 -0
- package/dist/mjs/lib/requestUtils.js.map +1 -1
- package/dist/mjs/types/request/broker.types.d.ts +52 -0
- package/dist/mjs/types/request/broker.types.js +2 -0
- package/dist/mjs/types/request/broker.types.js.map +1 -0
- package/dist/mjs/types/response/broker.types.d.ts +92 -0
- package/dist/mjs/types/response/broker.types.js +2 -0
- package/dist/mjs/types/response/broker.types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
2
|
+
import { RestClientType } from './lib/requestUtils.js';
|
|
3
|
+
import { BrokerTransferRequest, CreateBrokerSubAccountApiRequest, DeleteBrokerSubAccountApiRequest, GetBrokerDepositListRequest, GetBrokerInfoRequest, GetBrokerSubAccountApisRequest, GetBrokerSubAccountsRequest, UpdateBrokerSubAccountApiRequest } from './types/request/broker.types.js';
|
|
4
|
+
import { BrokerDepositRecord, BrokerInfo, BrokerSubAccountApi, BrokerTransferHistory, BrokerWithdrawalRecord, CreateBrokerSubAccountApiResponse, CreateBrokerSubAccountResponse, GetBrokerSubAccountsResponse } from './types/response/broker.types.js';
|
|
5
|
+
import { APISuccessResponse } from './types/response/shared.types.js';
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare class BrokerClient extends BaseRestClient {
|
|
10
|
+
getClientType(): RestClientType;
|
|
11
|
+
/**
|
|
12
|
+
* Get Broker Info
|
|
13
|
+
*
|
|
14
|
+
* This endpoint supports querying the basic information of the current Broker
|
|
15
|
+
*/
|
|
16
|
+
getBrokerInfo(params: GetBrokerInfoRequest): Promise<APISuccessResponse<BrokerInfo>>;
|
|
17
|
+
/**
|
|
18
|
+
* Add SubAccount
|
|
19
|
+
*
|
|
20
|
+
* This endpoint supports Broker users to create sub-accounts.
|
|
21
|
+
* Note that the account name is unique across the exchange.
|
|
22
|
+
* It is recommended to add a special identifier to prevent name duplication.
|
|
23
|
+
*/
|
|
24
|
+
createSubAccount(params: {
|
|
25
|
+
accountName: string;
|
|
26
|
+
}): Promise<APISuccessResponse<CreateBrokerSubAccountResponse>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get SubAccount
|
|
29
|
+
*
|
|
30
|
+
* This interface supports querying sub-accounts created by Broker.
|
|
31
|
+
* Returns paginated results with default page size of 20 (max 100).
|
|
32
|
+
*/
|
|
33
|
+
getSubAccounts(params: GetBrokerSubAccountsRequest): Promise<APISuccessResponse<GetBrokerSubAccountsResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Add SubAccount API
|
|
36
|
+
*
|
|
37
|
+
* This interface supports the creation of Broker sub-account APIKEY.
|
|
38
|
+
* Supports up to 20 IPs in the whitelist.
|
|
39
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
40
|
+
* Label must be between 4 and 32 characters.
|
|
41
|
+
*/
|
|
42
|
+
createSubAccountApi(params: CreateBrokerSubAccountApiRequest): Promise<APISuccessResponse<CreateBrokerSubAccountApiResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get SubAccount API
|
|
45
|
+
*
|
|
46
|
+
* This interface supports querying the Broker's sub-account APIKEYs.
|
|
47
|
+
* Can optionally filter by specific apiKey.
|
|
48
|
+
*/
|
|
49
|
+
getSubAccountApis(params: GetBrokerSubAccountApisRequest): Promise<APISuccessResponse<BrokerSubAccountApi[]>>;
|
|
50
|
+
/**
|
|
51
|
+
* Modify SubAccount API
|
|
52
|
+
*
|
|
53
|
+
* This interface supports modifying the Broker's sub-account APIKEY.
|
|
54
|
+
* Supports up to 20 IPs in the whitelist.
|
|
55
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
56
|
+
* Label must be between 4 and 32 characters.
|
|
57
|
+
*/
|
|
58
|
+
updateSubAccountApi(params: UpdateBrokerSubAccountApiRequest): Promise<APISuccessResponse<BrokerSubAccountApi>>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete SubAccount API
|
|
61
|
+
*
|
|
62
|
+
* This interface supports deleting Broker's sub-account APIKEY.
|
|
63
|
+
*/
|
|
64
|
+
deleteSubAccountApi(params: DeleteBrokerSubAccountApiRequest): Promise<APISuccessResponse<boolean>>;
|
|
65
|
+
/**
|
|
66
|
+
* Transfer
|
|
67
|
+
*
|
|
68
|
+
* This endpoint supports fund transfer between Broker account and Broker sub-accounts.
|
|
69
|
+
* Please be aware that withdrawal from sub-account is not directly supported.
|
|
70
|
+
* Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.
|
|
71
|
+
*
|
|
72
|
+
* Direction:
|
|
73
|
+
* - OUT: Broker account is transferred to Broker sub-account
|
|
74
|
+
* - IN: Broker sub-account is transferred to Broker account
|
|
75
|
+
*
|
|
76
|
+
* Account Types:
|
|
77
|
+
* - MAIN: Funding account
|
|
78
|
+
* - TRADE: Spot trading account
|
|
79
|
+
*/
|
|
80
|
+
submitTransfer(params: BrokerTransferRequest): Promise<APISuccessResponse<{
|
|
81
|
+
orderId: string;
|
|
82
|
+
}>>;
|
|
83
|
+
/**
|
|
84
|
+
* Get Transfer History
|
|
85
|
+
*
|
|
86
|
+
* This endpoint supports querying transfer records of the broker itself and its created sub-accounts.
|
|
87
|
+
*
|
|
88
|
+
* Account Types:
|
|
89
|
+
* - MAIN: Funding account
|
|
90
|
+
* - TRADE: Spot trading account
|
|
91
|
+
* - CONTRACT: Contract account
|
|
92
|
+
* - MARGIN: Margin account
|
|
93
|
+
* - ISOLATED: Isolated margin account
|
|
94
|
+
*
|
|
95
|
+
* Status:
|
|
96
|
+
* - PROCESSING: Processing
|
|
97
|
+
* - SUCCESS: Successful
|
|
98
|
+
* - FAILURE: Failed
|
|
99
|
+
*/
|
|
100
|
+
getTransferHistory(params: {
|
|
101
|
+
orderId: string;
|
|
102
|
+
}): Promise<APISuccessResponse<BrokerTransferHistory>>;
|
|
103
|
+
/**
|
|
104
|
+
* Get Deposit List
|
|
105
|
+
*
|
|
106
|
+
* This endpoint can obtain the deposit records of each sub-account under the ND Broker.
|
|
107
|
+
* Default limit is 1000 records (max 1000).
|
|
108
|
+
* Results are sorted in descending order by default.
|
|
109
|
+
*
|
|
110
|
+
* Status:
|
|
111
|
+
* - PROCESSING: Processing
|
|
112
|
+
* - SUCCESS: Successful
|
|
113
|
+
* - FAILURE: Failed
|
|
114
|
+
*/
|
|
115
|
+
getDeposits(params?: GetBrokerDepositListRequest): Promise<APISuccessResponse<BrokerDepositRecord[]>>;
|
|
116
|
+
/**
|
|
117
|
+
* Get Deposit Detail
|
|
118
|
+
*
|
|
119
|
+
* This endpoint supports querying the deposit record of sub-accounts created by a Broker
|
|
120
|
+
* (excluding main account of nd broker).
|
|
121
|
+
*
|
|
122
|
+
* Status:
|
|
123
|
+
* - PROCESSING: Processing
|
|
124
|
+
* - SUCCESS: Successful
|
|
125
|
+
* - FAILURE: Failed
|
|
126
|
+
*/
|
|
127
|
+
getDeposit(params: {
|
|
128
|
+
currency: string;
|
|
129
|
+
hash: string;
|
|
130
|
+
}): Promise<APISuccessResponse<BrokerDepositRecord>>;
|
|
131
|
+
/**
|
|
132
|
+
* Get Withdrawal Detail
|
|
133
|
+
*
|
|
134
|
+
* This endpoint supports querying the withdrawal records of sub-accounts created by a Broker
|
|
135
|
+
* (excluding main account of nd broker).
|
|
136
|
+
*
|
|
137
|
+
* Status:
|
|
138
|
+
* - PROCESSING: Processing
|
|
139
|
+
* - WALLET_PROCESSING: Wallet Processing
|
|
140
|
+
* - REVIEW: Under Review
|
|
141
|
+
* - SUCCESS: Successful
|
|
142
|
+
* - FAILURE: Failed
|
|
143
|
+
*/
|
|
144
|
+
getWithdrawal(params: {
|
|
145
|
+
withdrawalId: string;
|
|
146
|
+
}): Promise<APISuccessResponse<BrokerWithdrawalRecord>>;
|
|
147
|
+
/**
|
|
148
|
+
* Get Broker Rebate
|
|
149
|
+
*
|
|
150
|
+
* This interface supports downloading Broker rebate orders.
|
|
151
|
+
* Returns a URL to download a CSV file containing the rebate data.
|
|
152
|
+
* The URL is valid for 1 day.
|
|
153
|
+
* Maximum interval between begin and end dates is 6 months.
|
|
154
|
+
*/
|
|
155
|
+
getBrokerRebate(params: {
|
|
156
|
+
begin: string;
|
|
157
|
+
end: string;
|
|
158
|
+
tradeType: '1' | '2';
|
|
159
|
+
}): Promise<APISuccessResponse<{
|
|
160
|
+
url: string;
|
|
161
|
+
}>>;
|
|
162
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrokerClient = void 0;
|
|
4
|
+
const BaseRestClient_js_1 = require("./lib/BaseRestClient.js");
|
|
5
|
+
const requestUtils_js_1 = require("./lib/requestUtils.js");
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
class BrokerClient extends BaseRestClient_js_1.BaseRestClient {
|
|
10
|
+
getClientType() {
|
|
11
|
+
return requestUtils_js_1.REST_CLIENT_TYPE_ENUM.broker;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get Broker Info
|
|
15
|
+
*
|
|
16
|
+
* This endpoint supports querying the basic information of the current Broker
|
|
17
|
+
*/
|
|
18
|
+
getBrokerInfo(params) {
|
|
19
|
+
return this.getPrivate('api/v1/broker/nd/info', params);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Add SubAccount
|
|
23
|
+
*
|
|
24
|
+
* This endpoint supports Broker users to create sub-accounts.
|
|
25
|
+
* Note that the account name is unique across the exchange.
|
|
26
|
+
* It is recommended to add a special identifier to prevent name duplication.
|
|
27
|
+
*/
|
|
28
|
+
createSubAccount(params) {
|
|
29
|
+
return this.postPrivate('api/v1/broker/nd/account', params);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get SubAccount
|
|
33
|
+
*
|
|
34
|
+
* This interface supports querying sub-accounts created by Broker.
|
|
35
|
+
* Returns paginated results with default page size of 20 (max 100).
|
|
36
|
+
*/
|
|
37
|
+
getSubAccounts(params) {
|
|
38
|
+
return this.getPrivate('api/v1/broker/nd/account', params);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Add SubAccount API
|
|
42
|
+
*
|
|
43
|
+
* This interface supports the creation of Broker sub-account APIKEY.
|
|
44
|
+
* Supports up to 20 IPs in the whitelist.
|
|
45
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
46
|
+
* Label must be between 4 and 32 characters.
|
|
47
|
+
*/
|
|
48
|
+
createSubAccountApi(params) {
|
|
49
|
+
return this.postPrivate('api/v1/broker/nd/account/apikey', params);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get SubAccount API
|
|
53
|
+
*
|
|
54
|
+
* This interface supports querying the Broker's sub-account APIKEYs.
|
|
55
|
+
* Can optionally filter by specific apiKey.
|
|
56
|
+
*/
|
|
57
|
+
getSubAccountApis(params) {
|
|
58
|
+
return this.getPrivate('api/v1/broker/nd/account/apikey', params);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Modify SubAccount API
|
|
62
|
+
*
|
|
63
|
+
* This interface supports modifying the Broker's sub-account APIKEY.
|
|
64
|
+
* Supports up to 20 IPs in the whitelist.
|
|
65
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
66
|
+
* Label must be between 4 and 32 characters.
|
|
67
|
+
*/
|
|
68
|
+
updateSubAccountApi(params) {
|
|
69
|
+
return this.postPrivate('api/v1/broker/nd/account/update-apikey', params);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Delete SubAccount API
|
|
73
|
+
*
|
|
74
|
+
* This interface supports deleting Broker's sub-account APIKEY.
|
|
75
|
+
*/
|
|
76
|
+
deleteSubAccountApi(params) {
|
|
77
|
+
return this.deletePrivate('api/v1/broker/nd/account/apikey', params);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Transfer
|
|
81
|
+
*
|
|
82
|
+
* This endpoint supports fund transfer between Broker account and Broker sub-accounts.
|
|
83
|
+
* Please be aware that withdrawal from sub-account is not directly supported.
|
|
84
|
+
* Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.
|
|
85
|
+
*
|
|
86
|
+
* Direction:
|
|
87
|
+
* - OUT: Broker account is transferred to Broker sub-account
|
|
88
|
+
* - IN: Broker sub-account is transferred to Broker account
|
|
89
|
+
*
|
|
90
|
+
* Account Types:
|
|
91
|
+
* - MAIN: Funding account
|
|
92
|
+
* - TRADE: Spot trading account
|
|
93
|
+
*/
|
|
94
|
+
submitTransfer(params) {
|
|
95
|
+
return this.postPrivate('api/v1/broker/nd/transfer', params);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get Transfer History
|
|
99
|
+
*
|
|
100
|
+
* This endpoint supports querying transfer records of the broker itself and its created sub-accounts.
|
|
101
|
+
*
|
|
102
|
+
* Account Types:
|
|
103
|
+
* - MAIN: Funding account
|
|
104
|
+
* - TRADE: Spot trading account
|
|
105
|
+
* - CONTRACT: Contract account
|
|
106
|
+
* - MARGIN: Margin account
|
|
107
|
+
* - ISOLATED: Isolated margin account
|
|
108
|
+
*
|
|
109
|
+
* Status:
|
|
110
|
+
* - PROCESSING: Processing
|
|
111
|
+
* - SUCCESS: Successful
|
|
112
|
+
* - FAILURE: Failed
|
|
113
|
+
*/
|
|
114
|
+
getTransferHistory(params) {
|
|
115
|
+
return this.getPrivate('api/v3/broker/nd/transfer/detail', params);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get Deposit List
|
|
119
|
+
*
|
|
120
|
+
* This endpoint can obtain the deposit records of each sub-account under the ND Broker.
|
|
121
|
+
* Default limit is 1000 records (max 1000).
|
|
122
|
+
* Results are sorted in descending order by default.
|
|
123
|
+
*
|
|
124
|
+
* Status:
|
|
125
|
+
* - PROCESSING: Processing
|
|
126
|
+
* - SUCCESS: Successful
|
|
127
|
+
* - FAILURE: Failed
|
|
128
|
+
*/
|
|
129
|
+
getDeposits(params) {
|
|
130
|
+
return this.getPrivate('api/v1/asset/ndbroker/deposit/list', params);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get Deposit Detail
|
|
134
|
+
*
|
|
135
|
+
* This endpoint supports querying the deposit record of sub-accounts created by a Broker
|
|
136
|
+
* (excluding main account of nd broker).
|
|
137
|
+
*
|
|
138
|
+
* Status:
|
|
139
|
+
* - PROCESSING: Processing
|
|
140
|
+
* - SUCCESS: Successful
|
|
141
|
+
* - FAILURE: Failed
|
|
142
|
+
*/
|
|
143
|
+
getDeposit(params) {
|
|
144
|
+
return this.getPrivate('api/v3/broker/nd/deposit/detail', params);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get Withdrawal Detail
|
|
148
|
+
*
|
|
149
|
+
* This endpoint supports querying the withdrawal records of sub-accounts created by a Broker
|
|
150
|
+
* (excluding main account of nd broker).
|
|
151
|
+
*
|
|
152
|
+
* Status:
|
|
153
|
+
* - PROCESSING: Processing
|
|
154
|
+
* - WALLET_PROCESSING: Wallet Processing
|
|
155
|
+
* - REVIEW: Under Review
|
|
156
|
+
* - SUCCESS: Successful
|
|
157
|
+
* - FAILURE: Failed
|
|
158
|
+
*/
|
|
159
|
+
getWithdrawal(params) {
|
|
160
|
+
return this.getPrivate('api/v3/broker/nd/withdraw/detail', params);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get Broker Rebate
|
|
164
|
+
*
|
|
165
|
+
* This interface supports downloading Broker rebate orders.
|
|
166
|
+
* Returns a URL to download a CSV file containing the rebate data.
|
|
167
|
+
* The URL is valid for 1 day.
|
|
168
|
+
* Maximum interval between begin and end dates is 6 months.
|
|
169
|
+
*/
|
|
170
|
+
getBrokerRebate(params) {
|
|
171
|
+
return this.getPrivate('api/v1/broker/nd/rebase/download', params);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.BrokerClient = BrokerClient;
|
|
175
|
+
//# sourceMappingURL=BrokerClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrokerClient.js","sourceRoot":"","sources":["../../src/BrokerClient.ts"],"names":[],"mappings":";;;AAAA,+DAAyD;AACzD,2DAA8E;AAuB9E;;GAEG;AACH,MAAa,YAAa,SAAQ,kCAAc;IAC9C,aAAa;QACX,OAAO,uCAAqB,CAAC,MAAM,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,aAAa,CACX,MAA4B;QAE5B,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,MAEhB;QACC,OAAO,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;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AAC,CAAC;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,MAIf;QAKC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;CACF;AApND,oCAoNC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export * from './BrokerClient.js';
|
|
1
2
|
export * from './FuturesClient.js';
|
|
2
3
|
export * from './lib/websocket/logger.js';
|
|
3
4
|
export * from './lib/websocket/websocket-util.js';
|
|
4
5
|
export * from './SpotClient.js';
|
|
6
|
+
export * from './types/request/broker.types.js';
|
|
5
7
|
export * from './types/request/futures.types.js';
|
|
6
8
|
export * from './types/request/spot-account.js';
|
|
7
9
|
export * from './types/request/spot-earn.js';
|
|
@@ -9,6 +11,7 @@ export * from './types/request/spot-funding.js';
|
|
|
9
11
|
export * from './types/request/spot-margin-trading.js';
|
|
10
12
|
export * from './types/request/spot-misc.js';
|
|
11
13
|
export * from './types/request/spot-trading.js';
|
|
14
|
+
export * from './types/response/broker.types.js';
|
|
12
15
|
export * from './types/response/futures.types.js';
|
|
13
16
|
export * from './types/response/shared.types.js';
|
|
14
17
|
export * from './types/response/spot-account.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,10 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BrokerClient.js"), exports);
|
|
17
18
|
__exportStar(require("./FuturesClient.js"), exports);
|
|
18
19
|
__exportStar(require("./lib/websocket/logger.js"), exports);
|
|
19
20
|
__exportStar(require("./lib/websocket/websocket-util.js"), exports);
|
|
20
21
|
__exportStar(require("./SpotClient.js"), exports);
|
|
22
|
+
__exportStar(require("./types/request/broker.types.js"), exports);
|
|
21
23
|
__exportStar(require("./types/request/futures.types.js"), exports);
|
|
22
24
|
__exportStar(require("./types/request/spot-account.js"), exports);
|
|
23
25
|
__exportStar(require("./types/request/spot-earn.js"), exports);
|
|
@@ -25,6 +27,7 @@ __exportStar(require("./types/request/spot-funding.js"), exports);
|
|
|
25
27
|
__exportStar(require("./types/request/spot-margin-trading.js"), exports);
|
|
26
28
|
__exportStar(require("./types/request/spot-misc.js"), exports);
|
|
27
29
|
__exportStar(require("./types/request/spot-trading.js"), exports);
|
|
30
|
+
__exportStar(require("./types/response/broker.types.js"), exports);
|
|
28
31
|
__exportStar(require("./types/response/futures.types.js"), exports);
|
|
29
32
|
__exportStar(require("./types/response/shared.types.js"), exports);
|
|
30
33
|
__exportStar(require("./types/response/spot-account.js"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,4DAA0C;AAC1C,oEAAkD;AAClD,kDAAgC;AAChC,mEAAiD;AACjD,kEAAgD;AAChD,+DAA6C;AAC7C,kEAAgD;AAChD,yEAAuD;AACvD,+DAA6C;AAC7C,kEAAgD;AAChD,oEAAkD;AAClD,mEAAiD;AACjD,mEAAiD;AACjD,gEAA8C;AAC9C,mEAAiD;AACjD,0EAAwD;AACxD,gEAA8C;AAC9C,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,+DAA6C;AAC7C,iEAA+C;AAC/C,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,qDAAmC;AACnC,4DAA0C;AAC1C,oEAAkD;AAClD,kDAAgC;AAChC,kEAAgD;AAChD,mEAAiD;AACjD,kEAAgD;AAChD,+DAA6C;AAC7C,kEAAgD;AAChD,yEAAuD;AACvD,+DAA6C;AAC7C,kEAAgD;AAChD,mEAAiD;AACjD,oEAAkD;AAClD,mEAAiD;AACjD,mEAAiD;AACjD,gEAA8C;AAC9C,mEAAiD;AACjD,0EAAwD;AACxD,gEAA8C;AAC9C,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,+DAA6C;AAC7C,iEAA+C;AAC/C,uDAAqC"}
|
|
@@ -6,6 +6,8 @@ export declare const REST_CLIENT_TYPE_ENUM: {
|
|
|
6
6
|
readonly main: "main";
|
|
7
7
|
/** Futures */
|
|
8
8
|
readonly futures: "futures";
|
|
9
|
+
/** Broker */
|
|
10
|
+
readonly broker: "broker";
|
|
9
11
|
};
|
|
10
12
|
export type RestClientType = (typeof REST_CLIENT_TYPE_ENUM)[keyof typeof REST_CLIENT_TYPE_ENUM];
|
|
11
13
|
export interface RestClientOptions {
|
|
@@ -9,10 +9,13 @@ exports.REST_CLIENT_TYPE_ENUM = {
|
|
|
9
9
|
main: 'main',
|
|
10
10
|
/** Futures */
|
|
11
11
|
futures: 'futures',
|
|
12
|
+
/** Broker */
|
|
13
|
+
broker: 'broker',
|
|
12
14
|
};
|
|
13
15
|
const kucoinURLMap = {
|
|
14
16
|
[exports.REST_CLIENT_TYPE_ENUM.main]: 'https://api.kucoin.com',
|
|
15
17
|
[exports.REST_CLIENT_TYPE_ENUM.futures]: 'https://api-futures.kucoin.com',
|
|
18
|
+
[exports.REST_CLIENT_TYPE_ENUM.broker]: 'https://api-broker.kucoin.com',
|
|
16
19
|
};
|
|
17
20
|
function serializeParams(params, strict_validation, encodeValues, prefixWith) {
|
|
18
21
|
if (!params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestUtils.js","sourceRoot":"","sources":["../../../src/lib/requestUtils.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,qBAAqB,GAAG;IACnC,oBAAoB;IACpB,IAAI,EAAE,MAAM;IACZ,cAAc;IACd,OAAO,EAAE,SA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AAEY,QAAA,SAAS,GAAG,SAAS,CAAC;AACtB,QAAA,aAAa,GAAG,sCAAsC,CAAC;AAEvD,QAAA,YAAY,GAAG,gBAAgB,CAAC;AAChC,QAAA,gBAAgB,GAAG,sCAAsC,CAAC;AAEvE,SAAgB,cAAc,CAC5B,UAAmB,EACnB,kBAAqC,EACrC,cAA8B;IAE9B,MAAM,gBAAgB,GAAG;QACvB,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC;QACrC,OAAO,EAAE,mBAAmB;KAC7B,CAAC;IAEF,IAAI,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAC/B,OAAO,kBAAkB,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,OAAO,gBAAgB,CAAC,OAAO,CAAC;AAClC,CAAC;AAnBD,wCAmBC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface GetBrokerInfoRequest {
|
|
2
|
+
begin: string;
|
|
3
|
+
end: string;
|
|
4
|
+
tradeType: '1' | '2';
|
|
5
|
+
}
|
|
6
|
+
export interface GetBrokerSubAccountsRequest {
|
|
7
|
+
uid: string;
|
|
8
|
+
currentPage?: number;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
}
|
|
11
|
+
export type BrokerSubAccountPermission = 'general' | 'spot' | 'futures';
|
|
12
|
+
export interface CreateBrokerSubAccountApiRequest {
|
|
13
|
+
uid: string;
|
|
14
|
+
passphrase: string;
|
|
15
|
+
ipWhitelist: string[];
|
|
16
|
+
permissions: BrokerSubAccountPermission[];
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GetBrokerSubAccountApisRequest {
|
|
20
|
+
uid: string;
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateBrokerSubAccountApiRequest {
|
|
24
|
+
uid: string;
|
|
25
|
+
apiKey: string;
|
|
26
|
+
ipWhitelist: string[];
|
|
27
|
+
permissions: BrokerSubAccountPermission[];
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
export interface DeleteBrokerSubAccountApiRequest {
|
|
31
|
+
uid: string;
|
|
32
|
+
apiKey: string;
|
|
33
|
+
}
|
|
34
|
+
export type BrokerTransferDirection = 'OUT' | 'IN';
|
|
35
|
+
export type BrokerAccountType = 'MAIN' | 'TRADE';
|
|
36
|
+
export interface BrokerTransferRequest {
|
|
37
|
+
currency: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
clientOid: string;
|
|
40
|
+
direction: BrokerTransferDirection;
|
|
41
|
+
accountType: BrokerAccountType;
|
|
42
|
+
specialUid: string;
|
|
43
|
+
specialAccountType: BrokerAccountType;
|
|
44
|
+
}
|
|
45
|
+
export interface GetBrokerDepositListRequest {
|
|
46
|
+
currency?: string;
|
|
47
|
+
status?: 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
48
|
+
hash?: string;
|
|
49
|
+
startTimestamp?: number;
|
|
50
|
+
endTimestamp?: number;
|
|
51
|
+
limit?: number;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.types.js","sourceRoot":"","sources":["../../../../src/types/request/broker.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface BrokerInfo {
|
|
2
|
+
accountSize: number;
|
|
3
|
+
maxAccountSize: number | null;
|
|
4
|
+
level: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateBrokerSubAccountResponse {
|
|
7
|
+
accountName: string;
|
|
8
|
+
uid: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
level: number;
|
|
11
|
+
}
|
|
12
|
+
export interface BrokerSubAccount {
|
|
13
|
+
accountName: string;
|
|
14
|
+
uid: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
level: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GetBrokerSubAccountsResponse {
|
|
19
|
+
currentPage: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
totalNum: number;
|
|
22
|
+
totalPage: number;
|
|
23
|
+
items: BrokerSubAccount[];
|
|
24
|
+
}
|
|
25
|
+
export interface CreateBrokerSubAccountApiResponse {
|
|
26
|
+
uid: string;
|
|
27
|
+
label: string;
|
|
28
|
+
apiKey: string;
|
|
29
|
+
secretKey: string;
|
|
30
|
+
apiVersion: number;
|
|
31
|
+
permissions: string[];
|
|
32
|
+
ipWhitelist: string[];
|
|
33
|
+
createdAt: number;
|
|
34
|
+
}
|
|
35
|
+
export interface BrokerSubAccountApi {
|
|
36
|
+
uid: string;
|
|
37
|
+
label: string;
|
|
38
|
+
apiKey: string;
|
|
39
|
+
apiVersion: number;
|
|
40
|
+
permissions: ('General' | 'Spot' | 'Futures')[];
|
|
41
|
+
ipWhitelist: string[];
|
|
42
|
+
createdAt: number;
|
|
43
|
+
}
|
|
44
|
+
export type BrokerTransferAccountType = 'MAIN' | 'TRADE' | 'CONTRACT' | 'MARGIN' | 'ISOLATED';
|
|
45
|
+
export type BrokerTransferStatus = 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
46
|
+
export interface BrokerTransferHistory {
|
|
47
|
+
orderId: string;
|
|
48
|
+
currency: string;
|
|
49
|
+
amount: string;
|
|
50
|
+
fromUid: number;
|
|
51
|
+
fromAccountType: BrokerTransferAccountType;
|
|
52
|
+
fromAccountTag: string;
|
|
53
|
+
toUid: number;
|
|
54
|
+
toAccountType: BrokerTransferAccountType;
|
|
55
|
+
toAccountTag: string;
|
|
56
|
+
status: BrokerTransferStatus;
|
|
57
|
+
reason: string | null;
|
|
58
|
+
createdAt: number;
|
|
59
|
+
}
|
|
60
|
+
export interface BrokerDepositRecord {
|
|
61
|
+
uid: number;
|
|
62
|
+
hash: string;
|
|
63
|
+
address: string;
|
|
64
|
+
memo: string;
|
|
65
|
+
amount: string;
|
|
66
|
+
fee: string;
|
|
67
|
+
currency: string;
|
|
68
|
+
isInner: boolean;
|
|
69
|
+
walletTxId: string;
|
|
70
|
+
status: BrokerTransferStatus;
|
|
71
|
+
remark: string;
|
|
72
|
+
chain: string;
|
|
73
|
+
createdAt: number;
|
|
74
|
+
updatedAt: number;
|
|
75
|
+
}
|
|
76
|
+
export type BrokerWithdrawalStatus = 'PROCESSING' | 'WALLET_PROCESSING' | 'REVIEW' | 'SUCCESS' | 'FAILURE';
|
|
77
|
+
export interface BrokerWithdrawalRecord {
|
|
78
|
+
id: string;
|
|
79
|
+
chain: string;
|
|
80
|
+
walletTxId: string;
|
|
81
|
+
uid: number;
|
|
82
|
+
amount: string;
|
|
83
|
+
memo: string;
|
|
84
|
+
fee: string;
|
|
85
|
+
address: string;
|
|
86
|
+
remark: string;
|
|
87
|
+
isInner: boolean;
|
|
88
|
+
currency: string;
|
|
89
|
+
status: BrokerWithdrawalStatus;
|
|
90
|
+
createdAt: number;
|
|
91
|
+
updatedAt: number;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.types.js","sourceRoot":"","sources":["../../../../src/types/response/broker.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
2
|
+
import { RestClientType } from './lib/requestUtils.js';
|
|
3
|
+
import { BrokerTransferRequest, CreateBrokerSubAccountApiRequest, DeleteBrokerSubAccountApiRequest, GetBrokerDepositListRequest, GetBrokerInfoRequest, GetBrokerSubAccountApisRequest, GetBrokerSubAccountsRequest, UpdateBrokerSubAccountApiRequest } from './types/request/broker.types.js';
|
|
4
|
+
import { BrokerDepositRecord, BrokerInfo, BrokerSubAccountApi, BrokerTransferHistory, BrokerWithdrawalRecord, CreateBrokerSubAccountApiResponse, CreateBrokerSubAccountResponse, GetBrokerSubAccountsResponse } from './types/response/broker.types.js';
|
|
5
|
+
import { APISuccessResponse } from './types/response/shared.types.js';
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare class BrokerClient extends BaseRestClient {
|
|
10
|
+
getClientType(): RestClientType;
|
|
11
|
+
/**
|
|
12
|
+
* Get Broker Info
|
|
13
|
+
*
|
|
14
|
+
* This endpoint supports querying the basic information of the current Broker
|
|
15
|
+
*/
|
|
16
|
+
getBrokerInfo(params: GetBrokerInfoRequest): Promise<APISuccessResponse<BrokerInfo>>;
|
|
17
|
+
/**
|
|
18
|
+
* Add SubAccount
|
|
19
|
+
*
|
|
20
|
+
* This endpoint supports Broker users to create sub-accounts.
|
|
21
|
+
* Note that the account name is unique across the exchange.
|
|
22
|
+
* It is recommended to add a special identifier to prevent name duplication.
|
|
23
|
+
*/
|
|
24
|
+
createSubAccount(params: {
|
|
25
|
+
accountName: string;
|
|
26
|
+
}): Promise<APISuccessResponse<CreateBrokerSubAccountResponse>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get SubAccount
|
|
29
|
+
*
|
|
30
|
+
* This interface supports querying sub-accounts created by Broker.
|
|
31
|
+
* Returns paginated results with default page size of 20 (max 100).
|
|
32
|
+
*/
|
|
33
|
+
getSubAccounts(params: GetBrokerSubAccountsRequest): Promise<APISuccessResponse<GetBrokerSubAccountsResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Add SubAccount API
|
|
36
|
+
*
|
|
37
|
+
* This interface supports the creation of Broker sub-account APIKEY.
|
|
38
|
+
* Supports up to 20 IPs in the whitelist.
|
|
39
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
40
|
+
* Label must be between 4 and 32 characters.
|
|
41
|
+
*/
|
|
42
|
+
createSubAccountApi(params: CreateBrokerSubAccountApiRequest): Promise<APISuccessResponse<CreateBrokerSubAccountApiResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get SubAccount API
|
|
45
|
+
*
|
|
46
|
+
* This interface supports querying the Broker's sub-account APIKEYs.
|
|
47
|
+
* Can optionally filter by specific apiKey.
|
|
48
|
+
*/
|
|
49
|
+
getSubAccountApis(params: GetBrokerSubAccountApisRequest): Promise<APISuccessResponse<BrokerSubAccountApi[]>>;
|
|
50
|
+
/**
|
|
51
|
+
* Modify SubAccount API
|
|
52
|
+
*
|
|
53
|
+
* This interface supports modifying the Broker's sub-account APIKEY.
|
|
54
|
+
* Supports up to 20 IPs in the whitelist.
|
|
55
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
56
|
+
* Label must be between 4 and 32 characters.
|
|
57
|
+
*/
|
|
58
|
+
updateSubAccountApi(params: UpdateBrokerSubAccountApiRequest): Promise<APISuccessResponse<BrokerSubAccountApi>>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete SubAccount API
|
|
61
|
+
*
|
|
62
|
+
* This interface supports deleting Broker's sub-account APIKEY.
|
|
63
|
+
*/
|
|
64
|
+
deleteSubAccountApi(params: DeleteBrokerSubAccountApiRequest): Promise<APISuccessResponse<boolean>>;
|
|
65
|
+
/**
|
|
66
|
+
* Transfer
|
|
67
|
+
*
|
|
68
|
+
* This endpoint supports fund transfer between Broker account and Broker sub-accounts.
|
|
69
|
+
* Please be aware that withdrawal from sub-account is not directly supported.
|
|
70
|
+
* Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.
|
|
71
|
+
*
|
|
72
|
+
* Direction:
|
|
73
|
+
* - OUT: Broker account is transferred to Broker sub-account
|
|
74
|
+
* - IN: Broker sub-account is transferred to Broker account
|
|
75
|
+
*
|
|
76
|
+
* Account Types:
|
|
77
|
+
* - MAIN: Funding account
|
|
78
|
+
* - TRADE: Spot trading account
|
|
79
|
+
*/
|
|
80
|
+
submitTransfer(params: BrokerTransferRequest): Promise<APISuccessResponse<{
|
|
81
|
+
orderId: string;
|
|
82
|
+
}>>;
|
|
83
|
+
/**
|
|
84
|
+
* Get Transfer History
|
|
85
|
+
*
|
|
86
|
+
* This endpoint supports querying transfer records of the broker itself and its created sub-accounts.
|
|
87
|
+
*
|
|
88
|
+
* Account Types:
|
|
89
|
+
* - MAIN: Funding account
|
|
90
|
+
* - TRADE: Spot trading account
|
|
91
|
+
* - CONTRACT: Contract account
|
|
92
|
+
* - MARGIN: Margin account
|
|
93
|
+
* - ISOLATED: Isolated margin account
|
|
94
|
+
*
|
|
95
|
+
* Status:
|
|
96
|
+
* - PROCESSING: Processing
|
|
97
|
+
* - SUCCESS: Successful
|
|
98
|
+
* - FAILURE: Failed
|
|
99
|
+
*/
|
|
100
|
+
getTransferHistory(params: {
|
|
101
|
+
orderId: string;
|
|
102
|
+
}): Promise<APISuccessResponse<BrokerTransferHistory>>;
|
|
103
|
+
/**
|
|
104
|
+
* Get Deposit List
|
|
105
|
+
*
|
|
106
|
+
* This endpoint can obtain the deposit records of each sub-account under the ND Broker.
|
|
107
|
+
* Default limit is 1000 records (max 1000).
|
|
108
|
+
* Results are sorted in descending order by default.
|
|
109
|
+
*
|
|
110
|
+
* Status:
|
|
111
|
+
* - PROCESSING: Processing
|
|
112
|
+
* - SUCCESS: Successful
|
|
113
|
+
* - FAILURE: Failed
|
|
114
|
+
*/
|
|
115
|
+
getDeposits(params?: GetBrokerDepositListRequest): Promise<APISuccessResponse<BrokerDepositRecord[]>>;
|
|
116
|
+
/**
|
|
117
|
+
* Get Deposit Detail
|
|
118
|
+
*
|
|
119
|
+
* This endpoint supports querying the deposit record of sub-accounts created by a Broker
|
|
120
|
+
* (excluding main account of nd broker).
|
|
121
|
+
*
|
|
122
|
+
* Status:
|
|
123
|
+
* - PROCESSING: Processing
|
|
124
|
+
* - SUCCESS: Successful
|
|
125
|
+
* - FAILURE: Failed
|
|
126
|
+
*/
|
|
127
|
+
getDeposit(params: {
|
|
128
|
+
currency: string;
|
|
129
|
+
hash: string;
|
|
130
|
+
}): Promise<APISuccessResponse<BrokerDepositRecord>>;
|
|
131
|
+
/**
|
|
132
|
+
* Get Withdrawal Detail
|
|
133
|
+
*
|
|
134
|
+
* This endpoint supports querying the withdrawal records of sub-accounts created by a Broker
|
|
135
|
+
* (excluding main account of nd broker).
|
|
136
|
+
*
|
|
137
|
+
* Status:
|
|
138
|
+
* - PROCESSING: Processing
|
|
139
|
+
* - WALLET_PROCESSING: Wallet Processing
|
|
140
|
+
* - REVIEW: Under Review
|
|
141
|
+
* - SUCCESS: Successful
|
|
142
|
+
* - FAILURE: Failed
|
|
143
|
+
*/
|
|
144
|
+
getWithdrawal(params: {
|
|
145
|
+
withdrawalId: string;
|
|
146
|
+
}): Promise<APISuccessResponse<BrokerWithdrawalRecord>>;
|
|
147
|
+
/**
|
|
148
|
+
* Get Broker Rebate
|
|
149
|
+
*
|
|
150
|
+
* This interface supports downloading Broker rebate orders.
|
|
151
|
+
* Returns a URL to download a CSV file containing the rebate data.
|
|
152
|
+
* The URL is valid for 1 day.
|
|
153
|
+
* Maximum interval between begin and end dates is 6 months.
|
|
154
|
+
*/
|
|
155
|
+
getBrokerRebate(params: {
|
|
156
|
+
begin: string;
|
|
157
|
+
end: string;
|
|
158
|
+
tradeType: '1' | '2';
|
|
159
|
+
}): Promise<APISuccessResponse<{
|
|
160
|
+
url: string;
|
|
161
|
+
}>>;
|
|
162
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { BaseRestClient } from './lib/BaseRestClient.js';
|
|
2
|
+
import { REST_CLIENT_TYPE_ENUM } from './lib/requestUtils.js';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export class BrokerClient extends BaseRestClient {
|
|
7
|
+
getClientType() {
|
|
8
|
+
return REST_CLIENT_TYPE_ENUM.broker;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get Broker Info
|
|
12
|
+
*
|
|
13
|
+
* This endpoint supports querying the basic information of the current Broker
|
|
14
|
+
*/
|
|
15
|
+
getBrokerInfo(params) {
|
|
16
|
+
return this.getPrivate('api/v1/broker/nd/info', params);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Add SubAccount
|
|
20
|
+
*
|
|
21
|
+
* This endpoint supports Broker users to create sub-accounts.
|
|
22
|
+
* Note that the account name is unique across the exchange.
|
|
23
|
+
* It is recommended to add a special identifier to prevent name duplication.
|
|
24
|
+
*/
|
|
25
|
+
createSubAccount(params) {
|
|
26
|
+
return this.postPrivate('api/v1/broker/nd/account', params);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get SubAccount
|
|
30
|
+
*
|
|
31
|
+
* This interface supports querying sub-accounts created by Broker.
|
|
32
|
+
* Returns paginated results with default page size of 20 (max 100).
|
|
33
|
+
*/
|
|
34
|
+
getSubAccounts(params) {
|
|
35
|
+
return this.getPrivate('api/v1/broker/nd/account', params);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Add SubAccount API
|
|
39
|
+
*
|
|
40
|
+
* This interface supports the creation of Broker sub-account APIKEY.
|
|
41
|
+
* Supports up to 20 IPs in the whitelist.
|
|
42
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
43
|
+
* Label must be between 4 and 32 characters.
|
|
44
|
+
*/
|
|
45
|
+
createSubAccountApi(params) {
|
|
46
|
+
return this.postPrivate('api/v1/broker/nd/account/apikey', params);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get SubAccount API
|
|
50
|
+
*
|
|
51
|
+
* This interface supports querying the Broker's sub-account APIKEYs.
|
|
52
|
+
* Can optionally filter by specific apiKey.
|
|
53
|
+
*/
|
|
54
|
+
getSubAccountApis(params) {
|
|
55
|
+
return this.getPrivate('api/v1/broker/nd/account/apikey', params);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Modify SubAccount API
|
|
59
|
+
*
|
|
60
|
+
* This interface supports modifying the Broker's sub-account APIKEY.
|
|
61
|
+
* Supports up to 20 IPs in the whitelist.
|
|
62
|
+
* Only General, Spot, and Futures permissions can be set.
|
|
63
|
+
* Label must be between 4 and 32 characters.
|
|
64
|
+
*/
|
|
65
|
+
updateSubAccountApi(params) {
|
|
66
|
+
return this.postPrivate('api/v1/broker/nd/account/update-apikey', params);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete SubAccount API
|
|
70
|
+
*
|
|
71
|
+
* This interface supports deleting Broker's sub-account APIKEY.
|
|
72
|
+
*/
|
|
73
|
+
deleteSubAccountApi(params) {
|
|
74
|
+
return this.deletePrivate('api/v1/broker/nd/account/apikey', params);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Transfer
|
|
78
|
+
*
|
|
79
|
+
* This endpoint supports fund transfer between Broker account and Broker sub-accounts.
|
|
80
|
+
* Please be aware that withdrawal from sub-account is not directly supported.
|
|
81
|
+
* Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.
|
|
82
|
+
*
|
|
83
|
+
* Direction:
|
|
84
|
+
* - OUT: Broker account is transferred to Broker sub-account
|
|
85
|
+
* - IN: Broker sub-account is transferred to Broker account
|
|
86
|
+
*
|
|
87
|
+
* Account Types:
|
|
88
|
+
* - MAIN: Funding account
|
|
89
|
+
* - TRADE: Spot trading account
|
|
90
|
+
*/
|
|
91
|
+
submitTransfer(params) {
|
|
92
|
+
return this.postPrivate('api/v1/broker/nd/transfer', params);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get Transfer History
|
|
96
|
+
*
|
|
97
|
+
* This endpoint supports querying transfer records of the broker itself and its created sub-accounts.
|
|
98
|
+
*
|
|
99
|
+
* Account Types:
|
|
100
|
+
* - MAIN: Funding account
|
|
101
|
+
* - TRADE: Spot trading account
|
|
102
|
+
* - CONTRACT: Contract account
|
|
103
|
+
* - MARGIN: Margin account
|
|
104
|
+
* - ISOLATED: Isolated margin account
|
|
105
|
+
*
|
|
106
|
+
* Status:
|
|
107
|
+
* - PROCESSING: Processing
|
|
108
|
+
* - SUCCESS: Successful
|
|
109
|
+
* - FAILURE: Failed
|
|
110
|
+
*/
|
|
111
|
+
getTransferHistory(params) {
|
|
112
|
+
return this.getPrivate('api/v3/broker/nd/transfer/detail', params);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get Deposit List
|
|
116
|
+
*
|
|
117
|
+
* This endpoint can obtain the deposit records of each sub-account under the ND Broker.
|
|
118
|
+
* Default limit is 1000 records (max 1000).
|
|
119
|
+
* Results are sorted in descending order by default.
|
|
120
|
+
*
|
|
121
|
+
* Status:
|
|
122
|
+
* - PROCESSING: Processing
|
|
123
|
+
* - SUCCESS: Successful
|
|
124
|
+
* - FAILURE: Failed
|
|
125
|
+
*/
|
|
126
|
+
getDeposits(params) {
|
|
127
|
+
return this.getPrivate('api/v1/asset/ndbroker/deposit/list', params);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get Deposit Detail
|
|
131
|
+
*
|
|
132
|
+
* This endpoint supports querying the deposit record of sub-accounts created by a Broker
|
|
133
|
+
* (excluding main account of nd broker).
|
|
134
|
+
*
|
|
135
|
+
* Status:
|
|
136
|
+
* - PROCESSING: Processing
|
|
137
|
+
* - SUCCESS: Successful
|
|
138
|
+
* - FAILURE: Failed
|
|
139
|
+
*/
|
|
140
|
+
getDeposit(params) {
|
|
141
|
+
return this.getPrivate('api/v3/broker/nd/deposit/detail', params);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get Withdrawal Detail
|
|
145
|
+
*
|
|
146
|
+
* This endpoint supports querying the withdrawal records of sub-accounts created by a Broker
|
|
147
|
+
* (excluding main account of nd broker).
|
|
148
|
+
*
|
|
149
|
+
* Status:
|
|
150
|
+
* - PROCESSING: Processing
|
|
151
|
+
* - WALLET_PROCESSING: Wallet Processing
|
|
152
|
+
* - REVIEW: Under Review
|
|
153
|
+
* - SUCCESS: Successful
|
|
154
|
+
* - FAILURE: Failed
|
|
155
|
+
*/
|
|
156
|
+
getWithdrawal(params) {
|
|
157
|
+
return this.getPrivate('api/v3/broker/nd/withdraw/detail', params);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get Broker Rebate
|
|
161
|
+
*
|
|
162
|
+
* This interface supports downloading Broker rebate orders.
|
|
163
|
+
* Returns a URL to download a CSV file containing the rebate data.
|
|
164
|
+
* The URL is valid for 1 day.
|
|
165
|
+
* Maximum interval between begin and end dates is 6 months.
|
|
166
|
+
*/
|
|
167
|
+
getBrokerRebate(params) {
|
|
168
|
+
return this.getPrivate('api/v1/broker/nd/rebase/download', params);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=BrokerClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrokerClient.js","sourceRoot":"","sources":["../../src/BrokerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAkB,MAAM,uBAAuB,CAAC;AAuB9E;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC9C,aAAa;QACX,OAAO,qBAAqB,CAAC,MAAM,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,aAAa,CACX,MAA4B;QAE5B,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,MAEhB;QACC,OAAO,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;OAKG;IACH,cAAc,CACZ,MAAmC;QAEnC,OAAO,IAAI,CAAC,UAAU,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,mBAAmB,CACjB,MAAwC;QAExC,OAAO,IAAI,CAAC,WAAW,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,iBAAiB,CACf,MAAsC;QAEtC,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;OAOG;IACH,mBAAmB,CACjB,MAAwC;QAExC,OAAO,IAAI,CAAC,WAAW,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CACjB,MAAwC;QAExC,OAAO,IAAI,CAAC,aAAa,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,MAA6B;QAK1C,OAAO,IAAI,CAAC,WAAW,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,kBAAkB,CAAC,MAElB;QACC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,WAAW,CACT,MAAoC;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,oCAAoC,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,MAGV;QACC,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,MAEb;QACC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,MAIf;QAKC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;CACF"}
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export * from './BrokerClient.js';
|
|
1
2
|
export * from './FuturesClient.js';
|
|
2
3
|
export * from './lib/websocket/logger.js';
|
|
3
4
|
export * from './lib/websocket/websocket-util.js';
|
|
4
5
|
export * from './SpotClient.js';
|
|
6
|
+
export * from './types/request/broker.types.js';
|
|
5
7
|
export * from './types/request/futures.types.js';
|
|
6
8
|
export * from './types/request/spot-account.js';
|
|
7
9
|
export * from './types/request/spot-earn.js';
|
|
@@ -9,6 +11,7 @@ export * from './types/request/spot-funding.js';
|
|
|
9
11
|
export * from './types/request/spot-margin-trading.js';
|
|
10
12
|
export * from './types/request/spot-misc.js';
|
|
11
13
|
export * from './types/request/spot-trading.js';
|
|
14
|
+
export * from './types/response/broker.types.js';
|
|
12
15
|
export * from './types/response/futures.types.js';
|
|
13
16
|
export * from './types/response/shared.types.js';
|
|
14
17
|
export * from './types/response/spot-account.js';
|
package/dist/mjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export * from './BrokerClient.js';
|
|
1
2
|
export * from './FuturesClient.js';
|
|
2
3
|
export * from './lib/websocket/logger.js';
|
|
3
4
|
export * from './lib/websocket/websocket-util.js';
|
|
4
5
|
export * from './SpotClient.js';
|
|
6
|
+
export * from './types/request/broker.types.js';
|
|
5
7
|
export * from './types/request/futures.types.js';
|
|
6
8
|
export * from './types/request/spot-account.js';
|
|
7
9
|
export * from './types/request/spot-earn.js';
|
|
@@ -9,6 +11,7 @@ export * from './types/request/spot-funding.js';
|
|
|
9
11
|
export * from './types/request/spot-margin-trading.js';
|
|
10
12
|
export * from './types/request/spot-misc.js';
|
|
11
13
|
export * from './types/request/spot-trading.js';
|
|
14
|
+
export * from './types/response/broker.types.js';
|
|
12
15
|
export * from './types/response/futures.types.js';
|
|
13
16
|
export * from './types/response/shared.types.js';
|
|
14
17
|
export * from './types/response/spot-account.js';
|
package/dist/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc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CAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC"}
|
|
@@ -6,6 +6,8 @@ export declare const REST_CLIENT_TYPE_ENUM: {
|
|
|
6
6
|
readonly main: "main";
|
|
7
7
|
/** Futures */
|
|
8
8
|
readonly futures: "futures";
|
|
9
|
+
/** Broker */
|
|
10
|
+
readonly broker: "broker";
|
|
9
11
|
};
|
|
10
12
|
export type RestClientType = (typeof REST_CLIENT_TYPE_ENUM)[keyof typeof REST_CLIENT_TYPE_ENUM];
|
|
11
13
|
export interface RestClientOptions {
|
|
@@ -6,10 +6,13 @@ export const REST_CLIENT_TYPE_ENUM = {
|
|
|
6
6
|
main: 'main',
|
|
7
7
|
/** Futures */
|
|
8
8
|
futures: 'futures',
|
|
9
|
+
/** Broker */
|
|
10
|
+
broker: 'broker',
|
|
9
11
|
};
|
|
10
12
|
const kucoinURLMap = {
|
|
11
13
|
[REST_CLIENT_TYPE_ENUM.main]: 'https://api.kucoin.com',
|
|
12
14
|
[REST_CLIENT_TYPE_ENUM.futures]: 'https://api-futures.kucoin.com',
|
|
15
|
+
[REST_CLIENT_TYPE_ENUM.broker]: 'https://api-broker.kucoin.com',
|
|
13
16
|
};
|
|
14
17
|
export function serializeParams(params, strict_validation, encodeValues, prefixWith) {
|
|
15
18
|
if (!params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestUtils.js","sourceRoot":"","sources":["../../../src/lib/requestUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,oBAAoB;IACpB,IAAI,EAAE,MAAM;IACZ,cAAc;IACd,OAAO,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"requestUtils.js","sourceRoot":"","sources":["../../../src/lib/requestUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,oBAAoB;IACpB,IAAI,EAAE,MAAM;IACZ,cAAc;IACd,OAAO,EAA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EvE,MAAM,UAAU,cAAc,CAC5B,UAAmB,EACnB,kBAAqC,EACrC,cAA8B;IAE9B,MAAM,gBAAgB,GAAG;QACvB,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC;QACrC,OAAO,EAAE,mBAAmB;KAC7B,CAAC;IAEF,IAAI,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAC/B,OAAO,kBAAkB,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,OAAO,gBAAgB,CAAC,OAAO,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface GetBrokerInfoRequest {
|
|
2
|
+
begin: string;
|
|
3
|
+
end: string;
|
|
4
|
+
tradeType: '1' | '2';
|
|
5
|
+
}
|
|
6
|
+
export interface GetBrokerSubAccountsRequest {
|
|
7
|
+
uid: string;
|
|
8
|
+
currentPage?: number;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
}
|
|
11
|
+
export type BrokerSubAccountPermission = 'general' | 'spot' | 'futures';
|
|
12
|
+
export interface CreateBrokerSubAccountApiRequest {
|
|
13
|
+
uid: string;
|
|
14
|
+
passphrase: string;
|
|
15
|
+
ipWhitelist: string[];
|
|
16
|
+
permissions: BrokerSubAccountPermission[];
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GetBrokerSubAccountApisRequest {
|
|
20
|
+
uid: string;
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateBrokerSubAccountApiRequest {
|
|
24
|
+
uid: string;
|
|
25
|
+
apiKey: string;
|
|
26
|
+
ipWhitelist: string[];
|
|
27
|
+
permissions: BrokerSubAccountPermission[];
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
export interface DeleteBrokerSubAccountApiRequest {
|
|
31
|
+
uid: string;
|
|
32
|
+
apiKey: string;
|
|
33
|
+
}
|
|
34
|
+
export type BrokerTransferDirection = 'OUT' | 'IN';
|
|
35
|
+
export type BrokerAccountType = 'MAIN' | 'TRADE';
|
|
36
|
+
export interface BrokerTransferRequest {
|
|
37
|
+
currency: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
clientOid: string;
|
|
40
|
+
direction: BrokerTransferDirection;
|
|
41
|
+
accountType: BrokerAccountType;
|
|
42
|
+
specialUid: string;
|
|
43
|
+
specialAccountType: BrokerAccountType;
|
|
44
|
+
}
|
|
45
|
+
export interface GetBrokerDepositListRequest {
|
|
46
|
+
currency?: string;
|
|
47
|
+
status?: 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
48
|
+
hash?: string;
|
|
49
|
+
startTimestamp?: number;
|
|
50
|
+
endTimestamp?: number;
|
|
51
|
+
limit?: number;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.types.js","sourceRoot":"","sources":["../../../../src/types/request/broker.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface BrokerInfo {
|
|
2
|
+
accountSize: number;
|
|
3
|
+
maxAccountSize: number | null;
|
|
4
|
+
level: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateBrokerSubAccountResponse {
|
|
7
|
+
accountName: string;
|
|
8
|
+
uid: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
level: number;
|
|
11
|
+
}
|
|
12
|
+
export interface BrokerSubAccount {
|
|
13
|
+
accountName: string;
|
|
14
|
+
uid: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
level: number;
|
|
17
|
+
}
|
|
18
|
+
export interface GetBrokerSubAccountsResponse {
|
|
19
|
+
currentPage: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
totalNum: number;
|
|
22
|
+
totalPage: number;
|
|
23
|
+
items: BrokerSubAccount[];
|
|
24
|
+
}
|
|
25
|
+
export interface CreateBrokerSubAccountApiResponse {
|
|
26
|
+
uid: string;
|
|
27
|
+
label: string;
|
|
28
|
+
apiKey: string;
|
|
29
|
+
secretKey: string;
|
|
30
|
+
apiVersion: number;
|
|
31
|
+
permissions: string[];
|
|
32
|
+
ipWhitelist: string[];
|
|
33
|
+
createdAt: number;
|
|
34
|
+
}
|
|
35
|
+
export interface BrokerSubAccountApi {
|
|
36
|
+
uid: string;
|
|
37
|
+
label: string;
|
|
38
|
+
apiKey: string;
|
|
39
|
+
apiVersion: number;
|
|
40
|
+
permissions: ('General' | 'Spot' | 'Futures')[];
|
|
41
|
+
ipWhitelist: string[];
|
|
42
|
+
createdAt: number;
|
|
43
|
+
}
|
|
44
|
+
export type BrokerTransferAccountType = 'MAIN' | 'TRADE' | 'CONTRACT' | 'MARGIN' | 'ISOLATED';
|
|
45
|
+
export type BrokerTransferStatus = 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
46
|
+
export interface BrokerTransferHistory {
|
|
47
|
+
orderId: string;
|
|
48
|
+
currency: string;
|
|
49
|
+
amount: string;
|
|
50
|
+
fromUid: number;
|
|
51
|
+
fromAccountType: BrokerTransferAccountType;
|
|
52
|
+
fromAccountTag: string;
|
|
53
|
+
toUid: number;
|
|
54
|
+
toAccountType: BrokerTransferAccountType;
|
|
55
|
+
toAccountTag: string;
|
|
56
|
+
status: BrokerTransferStatus;
|
|
57
|
+
reason: string | null;
|
|
58
|
+
createdAt: number;
|
|
59
|
+
}
|
|
60
|
+
export interface BrokerDepositRecord {
|
|
61
|
+
uid: number;
|
|
62
|
+
hash: string;
|
|
63
|
+
address: string;
|
|
64
|
+
memo: string;
|
|
65
|
+
amount: string;
|
|
66
|
+
fee: string;
|
|
67
|
+
currency: string;
|
|
68
|
+
isInner: boolean;
|
|
69
|
+
walletTxId: string;
|
|
70
|
+
status: BrokerTransferStatus;
|
|
71
|
+
remark: string;
|
|
72
|
+
chain: string;
|
|
73
|
+
createdAt: number;
|
|
74
|
+
updatedAt: number;
|
|
75
|
+
}
|
|
76
|
+
export type BrokerWithdrawalStatus = 'PROCESSING' | 'WALLET_PROCESSING' | 'REVIEW' | 'SUCCESS' | 'FAILURE';
|
|
77
|
+
export interface BrokerWithdrawalRecord {
|
|
78
|
+
id: string;
|
|
79
|
+
chain: string;
|
|
80
|
+
walletTxId: string;
|
|
81
|
+
uid: number;
|
|
82
|
+
amount: string;
|
|
83
|
+
memo: string;
|
|
84
|
+
fee: string;
|
|
85
|
+
address: string;
|
|
86
|
+
remark: string;
|
|
87
|
+
isInner: boolean;
|
|
88
|
+
currency: string;
|
|
89
|
+
status: BrokerWithdrawalStatus;
|
|
90
|
+
createdAt: number;
|
|
91
|
+
updatedAt: number;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broker.types.js","sourceRoot":"","sources":["../../../../src/types/response/broker.types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED