@cobo/cobo-waas2 1.1.2 → 1.2.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/README.md +16 -3
- package/dist/ApiClient.js +1 -1
- package/dist/api/OAuthApi.js +16 -15
- package/dist/api/TransactionsApi.js +18 -18
- package/dist/api/WalletsApi.js +123 -12
- package/dist/api/WalletsExchangeWalletApi.js +254 -0
- package/dist/api/WalletsMPCWalletsApi.js +8 -8
- package/dist/index.js +56 -0
- package/dist/model/AddressInfo.js +1 -1
- package/dist/model/AddressTransferDestination.js +3 -3
- package/dist/model/AddressTransferDestinationAccountOutput.js +2 -2
- package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +1 -1
- package/dist/model/AssetInfo.js +2 -2
- package/dist/model/BabylonStakeExtra.js +9 -0
- package/dist/model/CheckAddressValidity200Response.js +2 -2
- package/dist/model/CheckAddressesValidity200ResponseInner.js +121 -0
- package/dist/model/CheckLoopTransfers200ResponseInner.js +96 -0
- package/dist/model/ContractCallDestination.js +1 -1
- package/dist/model/CreateStakeActivity.js +14 -1
- package/dist/model/CreateStakeActivityExtra.js +6 -0
- package/dist/model/CreateTssRequestRequest.js +13 -0
- package/dist/model/CreateUnstakeActivity.js +13 -0
- package/dist/model/CreateWithdrawActivity.js +13 -0
- package/dist/model/CreatedWalletInfo.js +12 -0
- package/dist/model/EstimateStakeFee.js +19 -1
- package/dist/model/EstimateUnstakeFee.js +18 -0
- package/dist/model/EstimateWithdrawFee.js +18 -0
- package/dist/model/EvmContractCallDestination.js +1 -1
- package/dist/model/ExchangeId.js +5 -0
- package/dist/model/ExchangeTransferDestination.js +16 -16
- package/dist/model/ExchangeTransferSource.js +14 -14
- package/dist/model/GetToken200Response.js +4 -4
- package/dist/model/KeyShareHolder.js +13 -0
- package/dist/model/ListAssetBalancesForExchangeWallet200Response.js +123 -0
- package/dist/model/ListExchanges200ResponseInner.js +122 -0
- package/dist/model/ListSupportedAssetsForExchange200Response.js +123 -0
- package/dist/model/MPCWalletInfo.js +26 -0
- package/dist/model/RefreshToken200Response.js +135 -0
- package/dist/model/RefreshTokenRequest.js +2 -2
- package/dist/model/SmartContractWalletType.js +2 -2
- package/dist/model/SubWalletAssetBalance.js +10 -10
- package/dist/model/TSSRequest.js +23 -1
- package/dist/model/TSSRequestWebhookEventData.js +263 -0
- package/dist/model/TransactionDepositFromWalletSource.js +6 -6
- package/dist/model/TransactionDepositToAddressDestination.js +2 -2
- package/dist/model/TransactionDepositToWalletDestination.js +9 -9
- package/dist/model/TransactionDestination.js +5 -5
- package/dist/model/TransactionEvmContractDestination.js +1 -1
- package/dist/model/TransactionExchangeWalletSource.js +6 -6
- package/dist/model/TransactionMPCWalletSource.js +13 -0
- package/dist/model/TransactionSource.js +8 -2
- package/dist/model/TransactionSubStatus.js +5 -0
- package/dist/model/TransactionTransferToAddressDestinationAccountOutput.js +1 -1
- package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +1 -1
- package/dist/model/TransactionTransferToWalletDestination.js +9 -9
- package/dist/model/TransactionWebhookEventData.js +8 -3
- package/dist/model/TransferDestination.js +6 -6
- package/dist/model/TransferParams.js +2 -2
- package/dist/model/TransferSource.js +3 -3
- package/dist/model/WalletInfo.js +12 -0
- package/dist/model/WebhookEventData.js +49 -15
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +24 -4
- package/docs/AddressInfo.md +1 -1
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressTransferDestinationAccountOutput.md +1 -1
- package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -1
- package/docs/AssetInfo.md +1 -1
- package/docs/BabylonStakeExtra.md +1 -0
- package/docs/CheckAddressValidity200Response.md +1 -1
- package/docs/CheckAddressesValidity200ResponseInner.md +10 -0
- package/docs/CheckLoopTransfers200ResponseInner.md +10 -0
- package/docs/ContractCallDestination.md +1 -1
- package/docs/CreateStakeActivity.md +1 -0
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CreateTssRequestRequest.md +1 -0
- package/docs/CreateUnstakeActivity.md +1 -0
- package/docs/CreateWithdrawActivity.md +1 -0
- package/docs/CreatedWalletInfo.md +2 -0
- package/docs/DevelopersWebhooksApi.md +78 -69
- package/docs/EstimateStakeFee.md +1 -0
- package/docs/EstimateUnstakeFee.md +1 -0
- package/docs/EstimateWithdrawFee.md +1 -0
- package/docs/EvmContractCallDestination.md +1 -1
- package/docs/ExchangeId.md +2 -0
- package/docs/ExchangeTransferDestination.md +2 -2
- package/docs/ExchangeTransferSource.md +1 -1
- package/docs/GetToken200Response.md +4 -4
- package/docs/KeyShareHolder.md +1 -0
- package/docs/ListAssetBalancesForExchangeWallet200Response.md +10 -0
- package/docs/ListExchanges200ResponseInner.md +10 -0
- package/docs/ListSupportedAssetsForExchange200Response.md +10 -0
- package/docs/MPCWalletInfo.md +2 -0
- package/docs/OAuthApi.md +26 -24
- package/docs/RefreshToken200Response.md +13 -0
- package/docs/RefreshTokenRequest.md +2 -2
- package/docs/SmartContractWalletType.md +1 -1
- package/docs/SubWalletAssetBalance.md +2 -2
- package/docs/TSSRequest.md +2 -0
- package/docs/TSSRequestWebhookEventData.md +29 -0
- package/docs/TransactionDepositFromWalletSource.md +1 -1
- package/docs/TransactionDepositToAddressDestination.md +1 -1
- package/docs/TransactionDepositToWalletDestination.md +2 -2
- package/docs/TransactionDestination.md +3 -3
- package/docs/TransactionEvmContractDestination.md +1 -1
- package/docs/TransactionExchangeWalletSource.md +1 -1
- package/docs/TransactionMPCWalletSource.md +1 -0
- package/docs/TransactionSource.md +2 -1
- package/docs/TransactionSubStatus.md +2 -0
- package/docs/TransactionTransferToAddressDestinationAccountOutput.md +1 -1
- package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +1 -1
- package/docs/TransactionTransferToWalletDestination.md +2 -2
- package/docs/TransactionWebhookEventData.md +3 -1
- package/docs/TransactionsApi.md +98 -88
- package/docs/TransferDestination.md +4 -4
- package/docs/TransferParams.md +1 -1
- package/docs/TransferSource.md +1 -1
- package/docs/WalletInfo.md +2 -0
- package/docs/WalletsApi.md +316 -187
- package/docs/WalletsExchangeWalletApi.md +230 -0
- package/docs/WalletsMPCWalletsApi.md +153 -135
- package/docs/WebhookEventData.md +10 -5
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +12 -4
- package/package.json +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# CoboWaas2.WalletsExchangeWalletApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.dev.cobo.com/v2*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**listAssetBalancesForExchangeWallet**](WalletsExchangeWalletApi.md#listAssetBalancesForExchangeWallet) | **GET** /wallets/{wallet_id}/exchanges/assets | List asset balances
|
|
8
|
+
[**listExchanges**](WalletsExchangeWalletApi.md#listExchanges) | **GET** /wallets/exchanges | List supported exchanges
|
|
9
|
+
[**listSupportedAssetsForExchange**](WalletsExchangeWalletApi.md#listSupportedAssetsForExchange) | **GET** /wallets/exchanges/{exchange_id}/assets | List supported assets
|
|
10
|
+
[**listSupportedChainsForExchange**](WalletsExchangeWalletApi.md#listSupportedChainsForExchange) | **GET** /wallets/exchanges/{exchange_id}/assets/{asset_id}/chains | List supported chains
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## listAssetBalancesForExchangeWallet
|
|
15
|
+
|
|
16
|
+
> ListAssetBalancesForExchangeWallet200Response listAssetBalancesForExchangeWallet(wallet_id, opts)
|
|
17
|
+
|
|
18
|
+
List asset balances
|
|
19
|
+
|
|
20
|
+
This operation retrieves the asset balances in a specified Exchange Wallet. You can filter the results by trading account type or asset ID.
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
26
|
+
// Initialize the API client
|
|
27
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
28
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
29
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
30
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
31
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
32
|
+
// Call the API
|
|
33
|
+
const apiInstance = new CoboWaas2.WalletsExchangeWalletApi();
|
|
34
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
35
|
+
const opts = {
|
|
36
|
+
'trading_account_types': "Trading,Funding",
|
|
37
|
+
'asset_ids': "USDT,USDC",
|
|
38
|
+
'limit': 10,
|
|
39
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
40
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
41
|
+
};
|
|
42
|
+
apiInstance.listAssetBalancesForExchangeWallet(wallet_id, opts).then((data) => {
|
|
43
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
44
|
+
}, (error) => {
|
|
45
|
+
console.error(error);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Name | Type | Description | Notes
|
|
54
|
+
------------- | ------------- | ------------- | -------------
|
|
55
|
+
**wallet_id** | **String**| The wallet ID. |
|
|
56
|
+
**trading_account_types** | **String**| A list of trading account types, separated by comma. You can get the the supported trading account types of an exchange by calling [List supported exchanges](/v2/api-references/wallets--exchange-wallet/list-supported-exchanges). | [optional]
|
|
57
|
+
**asset_ids** | **String**| (This concept applies to Exchange Wallets only) A list of asset IDs, separated by comma. An asset ID is the unique identifier of the asset held within your linked exchange account. | [optional]
|
|
58
|
+
**limit** | **Number**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10]
|
|
59
|
+
**before** | **String**| An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned. | [optional]
|
|
60
|
+
**after** | **String**| An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. | [optional]
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
[**ListAssetBalancesForExchangeWallet200Response**](ListAssetBalancesForExchangeWallet200Response.md)
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: Not defined
|
|
73
|
+
- **Accept**: application/json
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## listExchanges
|
|
77
|
+
|
|
78
|
+
> [ListExchanges200ResponseInner] listExchanges()
|
|
79
|
+
|
|
80
|
+
List supported exchanges
|
|
81
|
+
|
|
82
|
+
This operation retrieves the information about the exchanges supported by Cobo's Exchange Wallets, including exchange IDs and trading account types.
|
|
83
|
+
|
|
84
|
+
### Example
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
88
|
+
// Initialize the API client
|
|
89
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
90
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
91
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
92
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
93
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
94
|
+
// Call the API
|
|
95
|
+
const apiInstance = new CoboWaas2.WalletsExchangeWalletApi();
|
|
96
|
+
apiInstance.listExchanges().then((data) => {
|
|
97
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
98
|
+
}, (error) => {
|
|
99
|
+
console.error(error);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Parameters
|
|
105
|
+
|
|
106
|
+
This endpoint does not need any parameter.
|
|
107
|
+
|
|
108
|
+
### Return type
|
|
109
|
+
|
|
110
|
+
[**[ListExchanges200ResponseInner]**](ListExchanges200ResponseInner.md)
|
|
111
|
+
|
|
112
|
+
### Authorization
|
|
113
|
+
|
|
114
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
115
|
+
|
|
116
|
+
### HTTP request headers
|
|
117
|
+
|
|
118
|
+
- **Content-Type**: Not defined
|
|
119
|
+
- **Accept**: application/json
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## listSupportedAssetsForExchange
|
|
123
|
+
|
|
124
|
+
> ListSupportedAssetsForExchange200Response listSupportedAssetsForExchange(exchange_id, opts)
|
|
125
|
+
|
|
126
|
+
List supported assets
|
|
127
|
+
|
|
128
|
+
This operation retrieves all the assets supported by a specified exchange.
|
|
129
|
+
|
|
130
|
+
### Example
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
133
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
134
|
+
// Initialize the API client
|
|
135
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
136
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
137
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
138
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
139
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
140
|
+
// Call the API
|
|
141
|
+
const apiInstance = new CoboWaas2.WalletsExchangeWalletApi();
|
|
142
|
+
const exchange_id = new CoboWaas2.ExchangeId();
|
|
143
|
+
const opts = {
|
|
144
|
+
'limit': 10,
|
|
145
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
146
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
147
|
+
};
|
|
148
|
+
apiInstance.listSupportedAssetsForExchange(exchange_id, opts).then((data) => {
|
|
149
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
150
|
+
}, (error) => {
|
|
151
|
+
console.error(error);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Parameters
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
Name | Type | Description | Notes
|
|
160
|
+
------------- | ------------- | ------------- | -------------
|
|
161
|
+
**exchange_id** | [**ExchangeId**](.md)| The ID of the exchange. Possible values include: - `binance`: Binance. - `okx`: OKX. - `deribit`: Deribit. - `bybit`: Bybit. - `gate`: Gate.io - `bitget'`: Bitget |
|
|
162
|
+
**limit** | **Number**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10]
|
|
163
|
+
**before** | **String**| An object ID that serves as a starting point for retrieving data in reverse chronological order. For example, if you specify `before` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`, the request will retrieve a list of data objects that end before the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1`. You can set this parameter to the value of `pagination.before` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set `before` to `infinity`, the last page of data is returned. | [optional]
|
|
164
|
+
**after** | **String**| An object ID that acts as a starting point for retrieving data in chronological order. For example, if you specify `after` as `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`, the request will retrieve a list of data objects that start after the object with the object ID `RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`. You can set this parameter to the value of `pagination.after` in the response of the previous request. - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. | [optional]
|
|
165
|
+
|
|
166
|
+
### Return type
|
|
167
|
+
|
|
168
|
+
[**ListSupportedAssetsForExchange200Response**](ListSupportedAssetsForExchange200Response.md)
|
|
169
|
+
|
|
170
|
+
### Authorization
|
|
171
|
+
|
|
172
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
173
|
+
|
|
174
|
+
### HTTP request headers
|
|
175
|
+
|
|
176
|
+
- **Content-Type**: Not defined
|
|
177
|
+
- **Accept**: application/json
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## listSupportedChainsForExchange
|
|
181
|
+
|
|
182
|
+
> [ChainInfo] listSupportedChainsForExchange(exchange_id, asset_id)
|
|
183
|
+
|
|
184
|
+
List supported chains
|
|
185
|
+
|
|
186
|
+
This operation retrieves all the chains supported by a specified exchange for a given asset. You can use this operation to confirm whether you can transfer an asset from or to your Exchange Wallet when using a specific chain.
|
|
187
|
+
|
|
188
|
+
### Example
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
192
|
+
// Initialize the API client
|
|
193
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
194
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
195
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
196
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
197
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
198
|
+
// Call the API
|
|
199
|
+
const apiInstance = new CoboWaas2.WalletsExchangeWalletApi();
|
|
200
|
+
const exchange_id = new CoboWaas2.ExchangeId();
|
|
201
|
+
const asset_id = "USDT";
|
|
202
|
+
apiInstance.listSupportedChainsForExchange(exchange_id, asset_id).then((data) => {
|
|
203
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
204
|
+
}, (error) => {
|
|
205
|
+
console.error(error);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Parameters
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
Name | Type | Description | Notes
|
|
214
|
+
------------- | ------------- | ------------- | -------------
|
|
215
|
+
**exchange_id** | [**ExchangeId**](.md)| The ID of the exchange. Possible values include: - `binance`: Binance. - `okx`: OKX. - `deribit`: Deribit. - `bybit`: Bybit. - `gate`: Gate.io - `bitget'`: Bitget |
|
|
216
|
+
**asset_id** | **String**| (This concept applies to Exchange Wallets only) The asset ID. An asset ID is the unique identifier of the asset held within your linked exchange account. You can get the ID of the assets supported by an exchanges by calling [List supported assets](/v2/api-references/wallets--exchange-wallet/list-supported-assets). |
|
|
217
|
+
|
|
218
|
+
### Return type
|
|
219
|
+
|
|
220
|
+
[**[ChainInfo]**](ChainInfo.md)
|
|
221
|
+
|
|
222
|
+
### Authorization
|
|
223
|
+
|
|
224
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
225
|
+
|
|
226
|
+
### HTTP request headers
|
|
227
|
+
|
|
228
|
+
- **Content-Type**: Not defined
|
|
229
|
+
- **Accept**: application/json
|
|
230
|
+
|