@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
package/docs/WalletsApi.md
CHANGED
|
@@ -5,6 +5,8 @@ All URIs are relative to *https://api.dev.cobo.com/v2*
|
|
|
5
5
|
Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
7
|
[**checkAddressValidity**](WalletsApi.md#checkAddressValidity) | **GET** /wallets/check_address_validity | Check address validity
|
|
8
|
+
[**checkAddressesValidity**](WalletsApi.md#checkAddressesValidity) | **GET** /wallets/check_addresses_validity | Check addresses validity
|
|
9
|
+
[**checkLoopTransfers**](WalletsApi.md#checkLoopTransfers) | **GET** /wallets/check_loop_transfers | Check Loop transfers
|
|
8
10
|
[**createAddress**](WalletsApi.md#createAddress) | **POST** /wallets/{wallet_id}/addresses | Create addresses in wallet
|
|
9
11
|
[**createWallet**](WalletsApi.md#createWallet) | **POST** /wallets | Create wallet
|
|
10
12
|
[**deleteWalletById**](WalletsApi.md#deleteWalletById) | **POST** /wallets/{wallet_id}/delete | Delete wallet
|
|
@@ -40,15 +42,16 @@ This operation verifies if a given address is valid for a specific chain.
|
|
|
40
42
|
|
|
41
43
|
```javascript
|
|
42
44
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
43
|
-
//
|
|
45
|
+
// Initialize the API client
|
|
44
46
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
48
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
49
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
50
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
51
|
+
// Call the API
|
|
49
52
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
50
|
-
const chain_id = "ETH";
|
|
51
|
-
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
53
|
+
const chain_id = "ETH";
|
|
54
|
+
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
52
55
|
apiInstance.checkAddressValidity(chain_id, address).then((data) => {
|
|
53
56
|
console.log('API called successfully. Returned data: ' + data);
|
|
54
57
|
}, (error) => {
|
|
@@ -79,6 +82,112 @@ Name | Type | Description | Notes
|
|
|
79
82
|
- **Accept**: application/json
|
|
80
83
|
|
|
81
84
|
|
|
85
|
+
## checkAddressesValidity
|
|
86
|
+
|
|
87
|
+
> [CheckAddressesValidity200ResponseInner] checkAddressesValidity(chain_id, addresses)
|
|
88
|
+
|
|
89
|
+
Check addresses validity
|
|
90
|
+
|
|
91
|
+
This operation verifies if given addresses are valid for a specific chain.
|
|
92
|
+
|
|
93
|
+
### Example
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
97
|
+
// Initialize the API client
|
|
98
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
99
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
100
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
101
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
102
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
103
|
+
// Call the API
|
|
104
|
+
const apiInstance = new CoboWaas2.WalletsApi();
|
|
105
|
+
const chain_id = "ETH";
|
|
106
|
+
const addresses = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97";
|
|
107
|
+
apiInstance.checkAddressesValidity(chain_id, addresses).then((data) => {
|
|
108
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
109
|
+
}, (error) => {
|
|
110
|
+
console.error(error);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Parameters
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
Name | Type | Description | Notes
|
|
119
|
+
------------- | ------------- | ------------- | -------------
|
|
120
|
+
**chain_id** | **String**| The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains). |
|
|
121
|
+
**addresses** | **String**| A list of wallet addresses, separated by comma. You can specify a maximum of 100 addresses. |
|
|
122
|
+
|
|
123
|
+
### Return type
|
|
124
|
+
|
|
125
|
+
[**[CheckAddressesValidity200ResponseInner]**](CheckAddressesValidity200ResponseInner.md)
|
|
126
|
+
|
|
127
|
+
### Authorization
|
|
128
|
+
|
|
129
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
130
|
+
|
|
131
|
+
### HTTP request headers
|
|
132
|
+
|
|
133
|
+
- **Content-Type**: Not defined
|
|
134
|
+
- **Accept**: application/json
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
## checkLoopTransfers
|
|
138
|
+
|
|
139
|
+
> [CheckLoopTransfers200ResponseInner] checkLoopTransfers(token_id, source_wallet_id, destination_addresses)
|
|
140
|
+
|
|
141
|
+
Check Loop transfers
|
|
142
|
+
|
|
143
|
+
This operation verifies if the transactions from a given source wallet to a list of destination addresses can be executed as Loop transfers. For more information about Loop, see [Loop's website](https://loop.top/).
|
|
144
|
+
|
|
145
|
+
### Example
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
149
|
+
// Initialize the API client
|
|
150
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
151
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
152
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
153
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
154
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
155
|
+
// Call the API
|
|
156
|
+
const apiInstance = new CoboWaas2.WalletsApi();
|
|
157
|
+
const token_id = "ETH_USDT";
|
|
158
|
+
const source_wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
159
|
+
const destination_addresses = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97";
|
|
160
|
+
apiInstance.checkLoopTransfers(token_id, source_wallet_id, destination_addresses).then((data) => {
|
|
161
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
162
|
+
}, (error) => {
|
|
163
|
+
console.error(error);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Parameters
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
Name | Type | Description | Notes
|
|
172
|
+
------------- | ------------- | ------------- | -------------
|
|
173
|
+
**token_id** | **String**| The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). |
|
|
174
|
+
**source_wallet_id** | **String**| The source wallet ID. |
|
|
175
|
+
**destination_addresses** | **String**| A list of destination wallet addresses, separated by comma. |
|
|
176
|
+
|
|
177
|
+
### Return type
|
|
178
|
+
|
|
179
|
+
[**[CheckLoopTransfers200ResponseInner]**](CheckLoopTransfers200ResponseInner.md)
|
|
180
|
+
|
|
181
|
+
### Authorization
|
|
182
|
+
|
|
183
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
184
|
+
|
|
185
|
+
### HTTP request headers
|
|
186
|
+
|
|
187
|
+
- **Content-Type**: Not defined
|
|
188
|
+
- **Accept**: application/json
|
|
189
|
+
|
|
190
|
+
|
|
82
191
|
## createAddress
|
|
83
192
|
|
|
84
193
|
> [AddressInfo] createAddress(wallet_id, opts)
|
|
@@ -91,16 +200,17 @@ This operation generates one or more addresses within a specified wallet. <N
|
|
|
91
200
|
|
|
92
201
|
```javascript
|
|
93
202
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
94
|
-
//
|
|
203
|
+
// Initialize the API client
|
|
95
204
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
205
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
206
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
207
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
208
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
209
|
+
// Call the API
|
|
100
210
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
101
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
211
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
102
212
|
const opts = {
|
|
103
|
-
'CreateAddressRequest': new CoboWaas2.CreateAddressRequest()
|
|
213
|
+
'CreateAddressRequest': new CoboWaas2.CreateAddressRequest()
|
|
104
214
|
};
|
|
105
215
|
apiInstance.createAddress(wallet_id, opts).then((data) => {
|
|
106
216
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -138,21 +248,22 @@ Name | Type | Description | Notes
|
|
|
138
248
|
|
|
139
249
|
Create wallet
|
|
140
250
|
|
|
141
|
-
This operation creates a wallet with the provided information.
|
|
251
|
+
This operation creates a wallet with the provided information. <Note>This operation is not applicable to Smart Contract Wallets.</Note>
|
|
142
252
|
|
|
143
253
|
### Example
|
|
144
254
|
|
|
145
255
|
```javascript
|
|
146
256
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
147
|
-
//
|
|
257
|
+
// Initialize the API client
|
|
148
258
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
259
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
260
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
261
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
262
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
263
|
+
// Call the API
|
|
153
264
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
154
265
|
const opts = {
|
|
155
|
-
'CreateWalletParams': new CoboWaas2.CreateWalletParams()
|
|
266
|
+
'CreateWalletParams': new CoboWaas2.CreateWalletParams()
|
|
156
267
|
};
|
|
157
268
|
apiInstance.createWallet(opts).then((data) => {
|
|
158
269
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -195,14 +306,15 @@ This operation deletes a specified wallet. <Note>This operation is applic
|
|
|
195
306
|
|
|
196
307
|
```javascript
|
|
197
308
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
198
|
-
//
|
|
309
|
+
// Initialize the API client
|
|
199
310
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
311
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
312
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
313
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
314
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
315
|
+
// Call the API
|
|
204
316
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
205
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
317
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
206
318
|
apiInstance.deleteWalletById(wallet_id).then((data) => {
|
|
207
319
|
console.log('API called successfully. Returned data: ' + data);
|
|
208
320
|
}, (error) => {
|
|
@@ -244,15 +356,16 @@ This operation retrieves the detailed information about a specified address with
|
|
|
244
356
|
|
|
245
357
|
```javascript
|
|
246
358
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
247
|
-
//
|
|
359
|
+
// Initialize the API client
|
|
248
360
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
249
|
-
//
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
361
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
362
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
363
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
364
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
365
|
+
// Call the API
|
|
253
366
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
254
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
255
|
-
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
367
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
368
|
+
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
256
369
|
apiInstance.getAddress(wallet_id, address).then((data) => {
|
|
257
370
|
console.log('API called successfully. Returned data: ' + data);
|
|
258
371
|
}, (error) => {
|
|
@@ -295,14 +408,15 @@ This operation retrieves the detailed information about a specified chain.
|
|
|
295
408
|
|
|
296
409
|
```javascript
|
|
297
410
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
298
|
-
//
|
|
411
|
+
// Initialize the API client
|
|
299
412
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
300
|
-
//
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
413
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
414
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
415
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
416
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
417
|
+
// Call the API
|
|
304
418
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
305
|
-
const chain_id = "ETH";
|
|
419
|
+
const chain_id = "ETH";
|
|
306
420
|
apiInstance.getChainById(chain_id).then((data) => {
|
|
307
421
|
console.log('API called successfully. Returned data: ' + data);
|
|
308
422
|
}, (error) => {
|
|
@@ -344,19 +458,20 @@ This operation retrieves the maximum amount that you can transfer from a wallet
|
|
|
344
458
|
|
|
345
459
|
```javascript
|
|
346
460
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
347
|
-
//
|
|
461
|
+
// Initialize the API client
|
|
348
462
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
349
|
-
//
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
463
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
464
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
465
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
466
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
467
|
+
// Call the API
|
|
353
468
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
354
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
355
|
-
const token_id = "ETH_USDT";
|
|
356
|
-
const fee_rate = "10";
|
|
357
|
-
const to_address = "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE";
|
|
469
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
470
|
+
const token_id = "ETH_USDT";
|
|
471
|
+
const fee_rate = "10";
|
|
472
|
+
const to_address = "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE";
|
|
358
473
|
const opts = {
|
|
359
|
-
'from_address': "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE"
|
|
474
|
+
'from_address': "2N2xFZtbCFB6Nb3Pj9Sxsx5mX2fxX3yEgkE"
|
|
360
475
|
};
|
|
361
476
|
apiInstance.getMaxTransferableValue(wallet_id, token_id, fee_rate, to_address, opts).then((data) => {
|
|
362
477
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -403,14 +518,15 @@ This operation retrieves the detailed information about a specified token.
|
|
|
403
518
|
|
|
404
519
|
```javascript
|
|
405
520
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
406
|
-
//
|
|
521
|
+
// Initialize the API client
|
|
407
522
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
408
|
-
//
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
523
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
524
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
525
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
526
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
527
|
+
// Call the API
|
|
412
528
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
413
|
-
const token_id = "ETH_USDT";
|
|
529
|
+
const token_id = "ETH_USDT";
|
|
414
530
|
apiInstance.getTokenById(token_id).then((data) => {
|
|
415
531
|
console.log('API called successfully. Returned data: ' + data);
|
|
416
532
|
}, (error) => {
|
|
@@ -452,14 +568,15 @@ This operation retrieves the detailed information about a specified wallet.
|
|
|
452
568
|
|
|
453
569
|
```javascript
|
|
454
570
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
455
|
-
//
|
|
571
|
+
// Initialize the API client
|
|
456
572
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
457
|
-
//
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
573
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
574
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
575
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
576
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
577
|
+
// Call the API
|
|
461
578
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
462
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
579
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
463
580
|
apiInstance.getWalletById(wallet_id).then((data) => {
|
|
464
581
|
console.log('API called successfully. Returned data: ' + data);
|
|
465
582
|
}, (error) => {
|
|
@@ -501,20 +618,21 @@ This operation retrieves a list of addresses within a specified wallet.
|
|
|
501
618
|
|
|
502
619
|
```javascript
|
|
503
620
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
504
|
-
//
|
|
621
|
+
// Initialize the API client
|
|
505
622
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
506
|
-
//
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
623
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
624
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
625
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
626
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
627
|
+
// Call the API
|
|
510
628
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
511
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
629
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
512
630
|
const opts = {
|
|
513
|
-
'chain_ids': "BTC,ETH",
|
|
514
|
-
'addresses': "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97",
|
|
515
|
-
'limit': 10,
|
|
516
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
517
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
631
|
+
'chain_ids': "BTC,ETH",
|
|
632
|
+
'addresses': "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97",
|
|
633
|
+
'limit': 10,
|
|
634
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
635
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
518
636
|
};
|
|
519
637
|
apiInstance.listAddresses(wallet_id, opts).then((data) => {
|
|
520
638
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -562,19 +680,20 @@ This operation retrieves all the chains that can be used by your organization.
|
|
|
562
680
|
|
|
563
681
|
```javascript
|
|
564
682
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
565
|
-
//
|
|
683
|
+
// Initialize the API client
|
|
566
684
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
567
|
-
//
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
685
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
686
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
687
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
688
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
689
|
+
// Call the API
|
|
571
690
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
572
691
|
const opts = {
|
|
573
|
-
'wallet_type': new CoboWaas2.WalletType(),
|
|
574
|
-
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
575
|
-
'limit': 10,
|
|
576
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
577
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
692
|
+
'wallet_type': new CoboWaas2.WalletType(),
|
|
693
|
+
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
694
|
+
'limit': 10,
|
|
695
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
696
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
578
697
|
};
|
|
579
698
|
apiInstance.listEnabledChains(opts).then((data) => {
|
|
580
699
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -621,20 +740,21 @@ This operation retrieves all the tokens that can be used by your organization.
|
|
|
621
740
|
|
|
622
741
|
```javascript
|
|
623
742
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
624
|
-
//
|
|
743
|
+
// Initialize the API client
|
|
625
744
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
626
|
-
//
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
745
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
746
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
747
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
748
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
749
|
+
// Call the API
|
|
630
750
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
631
751
|
const opts = {
|
|
632
|
-
'wallet_type': new CoboWaas2.WalletType(),
|
|
633
|
-
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
634
|
-
'chain_ids': "BTC,ETH",
|
|
635
|
-
'limit': 10,
|
|
636
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
637
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
752
|
+
'wallet_type': new CoboWaas2.WalletType(),
|
|
753
|
+
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
754
|
+
'chain_ids': "BTC,ETH",
|
|
755
|
+
'limit': 10,
|
|
756
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
757
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
638
758
|
};
|
|
639
759
|
apiInstance.listEnabledTokens(opts).then((data) => {
|
|
640
760
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -676,26 +796,27 @@ Name | Type | Description | Notes
|
|
|
676
796
|
|
|
677
797
|
List supported chains
|
|
678
798
|
|
|
679
|
-
This operation retrieves all chains supported by a specific wallet type or subtype. It provides details such as the chain ID, chain symbol, and other relevant information. If you do not specify a wallet type, this operation returns a combination of chains supported by each wallet type. You can filter the result by chain IDs. The chain metadata is publicly available without any permission restrictions.
|
|
799
|
+
This operation retrieves all chains supported by a specific wallet type or subtype. It provides details such as the chain ID, chain symbol, and other relevant information. If you do not specify a wallet type, this operation returns a combination of chains supported by each wallet type. You can filter the result by chain IDs. The chain metadata is publicly available without any permission restrictions. Cobo Portal currently supports over 80 blockchains and more than 3,000 tokens. In addition to this operation, you can also view the full list of supported chains [here](https://www.cobo.com/chains). We regularly update the list with new additions. If you want to request support for a specific chain or token, please [contact us](https://www.cobo.com/contact).
|
|
680
800
|
|
|
681
801
|
### Example
|
|
682
802
|
|
|
683
803
|
```javascript
|
|
684
804
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
685
|
-
//
|
|
805
|
+
// Initialize the API client
|
|
686
806
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
687
|
-
//
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
807
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
808
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
809
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
810
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
811
|
+
// Call the API
|
|
691
812
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
692
813
|
const opts = {
|
|
693
|
-
'wallet_type': new CoboWaas2.WalletType(),
|
|
694
|
-
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
695
|
-
'chain_ids': "BTC,ETH",
|
|
696
|
-
'limit': 10,
|
|
697
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
698
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
814
|
+
'wallet_type': new CoboWaas2.WalletType(),
|
|
815
|
+
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
816
|
+
'chain_ids': "BTC,ETH",
|
|
817
|
+
'limit': 10,
|
|
818
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
819
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
699
820
|
};
|
|
700
821
|
apiInstance.listSupportedChains(opts).then((data) => {
|
|
701
822
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -737,27 +858,28 @@ Name | Type | Description | Notes
|
|
|
737
858
|
|
|
738
859
|
List supported tokens
|
|
739
860
|
|
|
740
|
-
This operation retrieves all tokens supported by a specific wallet type or subtype. It provides details such as token ID, token symbol, and other relevant information. If you do not specify a wallet type, this operation returns a combination of tokens supported by each wallet type. You can filter the result by token IDs or chain IDs. The token metadata is publicly available without any permission restrictions.
|
|
861
|
+
This operation retrieves all tokens supported by a specific wallet type or subtype. It provides details such as token ID, token symbol, and other relevant information. If you do not specify a wallet type, this operation returns a combination of tokens supported by each wallet type. You can filter the result by token IDs or chain IDs. The token metadata is publicly available without any permission restrictions. Cobo Portal currently supports over 80 blockchains and more than 3,000 tokens. In addition to this operation, you can also view the full list of supported tokens [here](https://www.cobo.com/tokens). We regularly update the list with new additions. If you want to request support for a specific chain or token, please [contact us](https://www.cobo.com/contact).
|
|
741
862
|
|
|
742
863
|
### Example
|
|
743
864
|
|
|
744
865
|
```javascript
|
|
745
866
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
746
|
-
//
|
|
867
|
+
// Initialize the API client
|
|
747
868
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
748
|
-
//
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
869
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
870
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
871
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
872
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
873
|
+
// Call the API
|
|
752
874
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
753
875
|
const opts = {
|
|
754
|
-
'wallet_type': new CoboWaas2.WalletType(),
|
|
755
|
-
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
756
|
-
'chain_ids': "BTC,ETH",
|
|
757
|
-
'token_ids': "ETH_USDT,ETH_USDC",
|
|
758
|
-
'limit': 10,
|
|
759
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
760
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
876
|
+
'wallet_type': new CoboWaas2.WalletType(),
|
|
877
|
+
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
878
|
+
'chain_ids': "BTC,ETH",
|
|
879
|
+
'token_ids': "ETH_USDT,ETH_USDC",
|
|
880
|
+
'limit': 10,
|
|
881
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
882
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
761
883
|
};
|
|
762
884
|
apiInstance.listSupportedTokens(opts).then((data) => {
|
|
763
885
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -800,26 +922,27 @@ Name | Type | Description | Notes
|
|
|
800
922
|
|
|
801
923
|
List token balances by address
|
|
802
924
|
|
|
803
|
-
The operation retrieves a list of token balances for a specified address within
|
|
925
|
+
The operation retrieves a list of token balances for a specified address within a wallet. <Note>This operation is applicable to MPC Wallets and Smart Contract Wallets only.</Note>
|
|
804
926
|
|
|
805
927
|
### Example
|
|
806
928
|
|
|
807
929
|
```javascript
|
|
808
930
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
809
|
-
//
|
|
931
|
+
// Initialize the API client
|
|
810
932
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
811
|
-
//
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
933
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
934
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
935
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
936
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
937
|
+
// Call the API
|
|
815
938
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
816
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
817
|
-
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
939
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
940
|
+
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
|
|
818
941
|
const opts = {
|
|
819
|
-
'token_ids': "ETH_USDT,ETH_USDC",
|
|
820
|
-
'limit': 10,
|
|
821
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
822
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
942
|
+
'token_ids': "ETH_USDT,ETH_USDC",
|
|
943
|
+
'limit': 10,
|
|
944
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
945
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
823
946
|
};
|
|
824
947
|
apiInstance.listTokenBalancesForAddress(wallet_id, address, opts).then((data) => {
|
|
825
948
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -861,25 +984,26 @@ Name | Type | Description | Notes
|
|
|
861
984
|
|
|
862
985
|
List token balances by wallet
|
|
863
986
|
|
|
864
|
-
The operation retrieves a list of token balances within a specified wallet. <Note>This operation is applicable to
|
|
987
|
+
The operation retrieves a list of token balances within a specified wallet. <Note>This operation is not applicable to Exchange Wallets.</Note>
|
|
865
988
|
|
|
866
989
|
### Example
|
|
867
990
|
|
|
868
991
|
```javascript
|
|
869
992
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
870
|
-
//
|
|
993
|
+
// Initialize the API client
|
|
871
994
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
872
|
-
//
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
995
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
996
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
997
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
998
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
999
|
+
// Call the API
|
|
876
1000
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
877
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1001
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
878
1002
|
const opts = {
|
|
879
|
-
'token_ids': "ETH_USDT,ETH_USDC",
|
|
880
|
-
'limit': 10,
|
|
881
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
882
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
1003
|
+
'token_ids': "ETH_USDT,ETH_USDC",
|
|
1004
|
+
'limit': 10,
|
|
1005
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
1006
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
883
1007
|
};
|
|
884
1008
|
apiInstance.listTokenBalancesForWallet(wallet_id, opts).then((data) => {
|
|
885
1009
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -926,20 +1050,21 @@ The operation retrieves a list of unspent transaction outputs (UTXOs) for a spec
|
|
|
926
1050
|
|
|
927
1051
|
```javascript
|
|
928
1052
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
929
|
-
//
|
|
1053
|
+
// Initialize the API client
|
|
930
1054
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
931
|
-
//
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1055
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
1056
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
1057
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
1058
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
1059
|
+
// Call the API
|
|
935
1060
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
936
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
937
|
-
const token_id = "ETH_USDT";
|
|
1061
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1062
|
+
const token_id = "ETH_USDT";
|
|
938
1063
|
const opts = {
|
|
939
|
-
'address': "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
940
|
-
'limit': 10,
|
|
941
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
942
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
1064
|
+
'address': "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
1065
|
+
'limit': 10,
|
|
1066
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
1067
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
943
1068
|
};
|
|
944
1069
|
apiInstance.listUtxos(wallet_id, token_id, opts).then((data) => {
|
|
945
1070
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -987,21 +1112,22 @@ This operation retrieves the information of all wallets under your organization.
|
|
|
987
1112
|
|
|
988
1113
|
```javascript
|
|
989
1114
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
990
|
-
//
|
|
1115
|
+
// Initialize the API client
|
|
991
1116
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
992
|
-
//
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1117
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
1118
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
1119
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
1120
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
1121
|
+
// Call the API
|
|
996
1122
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
997
1123
|
const opts = {
|
|
998
|
-
'wallet_type': new CoboWaas2.WalletType(),
|
|
999
|
-
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
1000
|
-
'project_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
1001
|
-
'vault_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
1002
|
-
'limit': 10,
|
|
1003
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
1004
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
1124
|
+
'wallet_type': new CoboWaas2.WalletType(),
|
|
1125
|
+
'wallet_subtype': new CoboWaas2.WalletSubtype(),
|
|
1126
|
+
'project_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
1127
|
+
'vault_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
1128
|
+
'limit': 10,
|
|
1129
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
1130
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
1005
1131
|
};
|
|
1006
1132
|
apiInstance.listWallets(opts).then((data) => {
|
|
1007
1133
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -1019,7 +1145,7 @@ Name | Type | Description | Notes
|
|
|
1019
1145
|
**wallet_type** | [**WalletType**](.md)| The wallet type. - `Custodial`: [Custodial Wallets](https://manuals.cobo.com/en/portal/custodial-wallets/introduction) - `MPC`: [MPC Wallets](https://manuals.cobo.com/en/portal/mpc-wallets/introduction) - `SmartContract`: [Smart Contract Wallets](https://manuals.cobo.com/en/portal/smart-contract-wallets/introduction) - `Exchange`: [Exchange Wallets](https://manuals.cobo.com/en/portal/exchange-wallets/introduction) | [optional]
|
|
1020
1146
|
**wallet_subtype** | [**WalletSubtype**](.md)| The wallet subtype. - `Asset`: Custodial Wallets (Asset Wallets) - `Web3`: Custodial Wallets (Web3 Wallets) - `Main`: Exchange Wallets (Main Account) - `Sub`: Exchange Wallets (Sub Account) - `Org-Controlled`: MPC Wallets (Organization-Controlled Wallets) - `User-Controlled`: MPC Wallets (User-Controlled Wallets) - `Safe{Wallet}`: Smart Contract Wallets (Safe{Wallet}) | [optional]
|
|
1021
1147
|
**project_id** | **String**| The project ID, which you can retrieve by calling [List all projects](/v2/api-references/wallets--mpc-wallets/list-all-projects). | [optional]
|
|
1022
|
-
**vault_id** | **String**|
|
|
1148
|
+
**vault_id** | **String**| The vault ID, which you can retrieve by calling [List all vaults](/v2/api-references/wallets--mpc-wallets/list-all-vaults). | [optional]
|
|
1023
1149
|
**limit** | **Number**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10]
|
|
1024
1150
|
**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]
|
|
1025
1151
|
**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]
|
|
@@ -1050,16 +1176,17 @@ This operation locks the UTXOs with specified transaction hashes. Locked UTXOs c
|
|
|
1050
1176
|
|
|
1051
1177
|
```javascript
|
|
1052
1178
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
1053
|
-
//
|
|
1179
|
+
// Initialize the API client
|
|
1054
1180
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
1055
|
-
//
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1181
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
1182
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
1183
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
1184
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
1185
|
+
// Call the API
|
|
1059
1186
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
1060
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1187
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1061
1188
|
const opts = {
|
|
1062
|
-
'LockUtxosRequest': new CoboWaas2.LockUtxosRequest()
|
|
1189
|
+
'LockUtxosRequest': new CoboWaas2.LockUtxosRequest()
|
|
1063
1190
|
};
|
|
1064
1191
|
apiInstance.lockUtxos(wallet_id, opts).then((data) => {
|
|
1065
1192
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -1103,16 +1230,17 @@ This operation unlocks the UTXOs with specified transaction hashes. Locked UTXOs
|
|
|
1103
1230
|
|
|
1104
1231
|
```javascript
|
|
1105
1232
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
1106
|
-
//
|
|
1233
|
+
// Initialize the API client
|
|
1107
1234
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
1108
|
-
//
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1235
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
1236
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
1237
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
1238
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
1239
|
+
// Call the API
|
|
1112
1240
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
1113
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1241
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1114
1242
|
const opts = {
|
|
1115
|
-
'LockUtxosRequest': new CoboWaas2.LockUtxosRequest()
|
|
1243
|
+
'LockUtxosRequest': new CoboWaas2.LockUtxosRequest()
|
|
1116
1244
|
};
|
|
1117
1245
|
apiInstance.unlockUtxos(wallet_id, opts).then((data) => {
|
|
1118
1246
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -1156,16 +1284,17 @@ This operation updates the information of a specified wallet. For Exchange Wall
|
|
|
1156
1284
|
|
|
1157
1285
|
```javascript
|
|
1158
1286
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
1159
|
-
//
|
|
1287
|
+
// Initialize the API client
|
|
1160
1288
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
1161
|
-
//
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1289
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
1290
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
1291
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
1292
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
1293
|
+
// Call the API
|
|
1165
1294
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
1166
|
-
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1295
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
1167
1296
|
const opts = {
|
|
1168
|
-
'UpdateWalletParams': new CoboWaas2.UpdateWalletParams()
|
|
1297
|
+
'UpdateWalletParams': new CoboWaas2.UpdateWalletParams()
|
|
1169
1298
|
};
|
|
1170
1299
|
apiInstance.updateWalletById(wallet_id, opts).then((data) => {
|
|
1171
1300
|
console.log('API called successfully. Returned data: ' + data);
|