@cobo/cobo-waas2 1.5.0 → 1.6.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.
Files changed (94) hide show
  1. package/README.md +15 -4
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/ServerDemo.js +80 -0
  4. package/dist/api/DevelopersApi.js +79 -0
  5. package/dist/api/OAuthApi.js +8 -8
  6. package/dist/api/WalletsApi.js +58 -57
  7. package/dist/index.js +83 -6
  8. package/dist/model/AddressTransferDestination.js +2 -2
  9. package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +6 -17
  10. package/dist/model/BabylonStakeEstimatedFee.js +118 -0
  11. package/dist/model/BabylonValidator.js +5 -0
  12. package/dist/model/CheckAddressChainsValidity200ResponseInner.js +121 -0
  13. package/dist/model/CreateSmartContractWalletParams.js +1 -1
  14. package/dist/model/CreateStakeActivityExtra.js +42 -8
  15. package/dist/model/CreateUnstakeActivity.js +16 -0
  16. package/dist/model/CreateUnstakeActivityExtra.js +159 -0
  17. package/dist/model/CreateUnstakeActivityRequest.js +20 -0
  18. package/dist/model/EstimateContractCallFeeParams.js +4 -6
  19. package/dist/model/EstimateTransferFeeParams.js +4 -8
  20. package/dist/model/EstimateUnstakeFee.js +20 -0
  21. package/dist/model/EstimatedEvmEip1559FeeSlow.js +3 -5
  22. package/dist/model/EstimatedEvmLegacyFeeSlow.js +3 -5
  23. package/dist/model/EthStakeEstimatedFee.js +112 -0
  24. package/dist/model/EthStakeExtra.js +131 -0
  25. package/dist/model/EthStakingExtra.js +131 -0
  26. package/dist/model/EthUnstakeExtra.js +131 -0
  27. package/dist/model/FeeGasLimit.js +1 -2
  28. package/dist/model/GetApiKeyInfo200Response.js +251 -0
  29. package/dist/model/GetStakingEstimationFee201Response.js +144 -43
  30. package/dist/model/GetStakingEstimationFeeRequest.js +2 -2
  31. package/dist/model/{GetToken200Response.js → GetToken2XXResponse.js} +21 -21
  32. package/dist/model/GetToken4XXResponse.js +12 -10
  33. package/dist/model/MPCDelegate.js +1 -1
  34. package/dist/model/MpcTransferSource.js +2 -2
  35. package/dist/model/{RefreshToken201Response.js → RefreshToken2XXResponse.js} +21 -21
  36. package/dist/model/RoleScopes.js +128 -0
  37. package/dist/model/Scopes.js +142 -0
  38. package/dist/model/SmartContractWalletInfo.js +1 -1
  39. package/dist/model/StakingPoolType.js +5 -0
  40. package/dist/model/StakingsExtra.js +36 -8
  41. package/dist/model/TransactionEvmEip1559Fee.js +2 -4
  42. package/dist/model/TransactionEvmLegacyFee.js +2 -4
  43. package/dist/model/TransactionFee.js +1 -2
  44. package/dist/model/TransactionRbfSource.js +1 -1
  45. package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -2
  46. package/dist/model/TransactionRequestEvmLegacyFee.js +1 -2
  47. package/dist/model/TransactionRequestFee.js +1 -2
  48. package/dist/model/TransactionSource.js +1 -1
  49. package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +0 -13
  50. package/dist/model/TransferDestination.js +2 -2
  51. package/docs/AddressTransferDestination.md +2 -2
  52. package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -2
  53. package/docs/BabylonStakeEstimatedFee.md +12 -0
  54. package/docs/BabylonValidator.md +2 -0
  55. package/docs/CheckAddressChainsValidity200ResponseInner.md +10 -0
  56. package/docs/CreateStakeActivityExtra.md +1 -0
  57. package/docs/CreateUnstakeActivity.md +1 -0
  58. package/docs/CreateUnstakeActivityExtra.md +10 -0
  59. package/docs/CreateUnstakeActivityRequest.md +1 -0
  60. package/docs/DevelopersApi.md +55 -0
  61. package/docs/EstimateContractCallFeeParams.md +1 -1
  62. package/docs/EstimateFeeParams.md +1 -1
  63. package/docs/EstimateTransferFeeParams.md +2 -2
  64. package/docs/EstimateUnstakeFee.md +1 -0
  65. package/docs/EstimatedEvmEip1559FeeSlow.md +1 -1
  66. package/docs/EstimatedEvmLegacyFeeSlow.md +1 -1
  67. package/docs/EthStakeEstimatedFee.md +11 -0
  68. package/docs/EthStakeExtra.md +10 -0
  69. package/docs/EthStakingExtra.md +10 -0
  70. package/docs/EthUnstakeExtra.md +10 -0
  71. package/docs/FeeGasLimit.md +1 -1
  72. package/docs/GetApiKeyInfo200Response.md +30 -0
  73. package/docs/GetStakingEstimationFee201Response.md +3 -0
  74. package/docs/GetStakingEstimationFeeRequest.md +1 -1
  75. package/docs/{GetToken200Response.md → GetToken2XXResponse.md} +1 -1
  76. package/docs/GetToken4XXResponse.md +1 -1
  77. package/docs/MpcTransferSource.md +1 -1
  78. package/docs/OAuthApi.md +4 -4
  79. package/docs/PoolDetailsAllOfValidatorsInfo.md +2 -0
  80. package/docs/{RefreshToken201Response.md → RefreshToken2XXResponse.md} +1 -1
  81. package/docs/RoleScopes.md +10 -0
  82. package/docs/Scopes.md +13 -0
  83. package/docs/StakingPoolType.md +2 -0
  84. package/docs/TransactionEvmEip1559Fee.md +1 -1
  85. package/docs/TransactionEvmLegacyFee.md +1 -1
  86. package/docs/TransactionFee.md +1 -1
  87. package/docs/TransactionRbfSource.md +1 -1
  88. package/docs/TransactionRequestEvmEip1559Fee.md +1 -1
  89. package/docs/TransactionRequestEvmLegacyFee.md +1 -1
  90. package/docs/TransactionRequestFee.md +1 -1
  91. package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +0 -1
  92. package/docs/TransferDestination.md +2 -2
  93. package/docs/WalletsApi.md +54 -54
  94. package/package.json +2 -1
package/README.md CHANGED
@@ -15,7 +15,7 @@ For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](/v2/
15
15
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
16
16
 
17
17
  - API version: v2
18
- - Package version: 1.5.0
18
+ - Package version: 1.6.0
19
19
  - Generator version: 7.6.0
20
20
  - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
21
21
  For more information, please visit [https://www.cobo.com/waas](https://www.cobo.com/waas)
@@ -62,6 +62,7 @@ All URIs are relative to *https://api.dev.cobo.com/v2*
62
62
  Class | Method | HTTP request | Description
63
63
  ------------ | ------------- | ------------- | -------------
64
64
  *CoboWaas2.AddressBooksApi* | [**listAddressBooks**](docs/AddressBooksApi.md#listAddressBooks) | **GET** /address_books | List address book entries
65
+ *CoboWaas2.DevelopersApi* | [**getApiKeyInfo**](docs/DevelopersApi.md#getApiKeyInfo) | **GET** /developers/api_key_info | Get API key information
65
66
  *CoboWaas2.DevelopersWebhooksApi* | [**createWebhookEndpoint**](docs/DevelopersWebhooksApi.md#createWebhookEndpoint) | **POST** /webhooks/endpoints | Register webhook endpoint
66
67
  *CoboWaas2.DevelopersWebhooksApi* | [**getWebhookEndpointById**](docs/DevelopersWebhooksApi.md#getWebhookEndpointById) | **GET** /webhooks/endpoints/{endpoint_id} | Get webhook endpoint information
67
68
  *CoboWaas2.DevelopersWebhooksApi* | [**getWebhookEventById**](docs/DevelopersWebhooksApi.md#getWebhookEventById) | **GET** /webhooks/endpoints/{endpoint_id}/events/{event_id} | Retrieve event information
@@ -96,12 +97,12 @@ Class | Method | HTTP request | Description
96
97
  *CoboWaas2.TransactionsApi* | [**listTransactions**](docs/TransactionsApi.md#listTransactions) | **GET** /transactions | List all transactions
97
98
  *CoboWaas2.TransactionsApi* | [**resendTransactionById**](docs/TransactionsApi.md#resendTransactionById) | **POST** /transactions/{transaction_id}/resend | Resend transaction
98
99
  *CoboWaas2.TransactionsApi* | [**speedupTransactionById**](docs/TransactionsApi.md#speedupTransactionById) | **POST** /transactions/{transaction_id}/speedup | Speed up transaction
100
+ *CoboWaas2.WalletsApi* | [**checkAddressChainsValidity**](docs/WalletsApi.md#checkAddressChainsValidity) | **GET** /wallets/check_address_chains_validity | Check address validity across chains
99
101
  *CoboWaas2.WalletsApi* | [**checkAddressValidity**](docs/WalletsApi.md#checkAddressValidity) | **GET** /wallets/check_address_validity | Check address validity
100
102
  *CoboWaas2.WalletsApi* | [**checkAddressesValidity**](docs/WalletsApi.md#checkAddressesValidity) | **GET** /wallets/check_addresses_validity | Check addresses validity
101
103
  *CoboWaas2.WalletsApi* | [**createAddress**](docs/WalletsApi.md#createAddress) | **POST** /wallets/{wallet_id}/addresses | Create addresses in wallet
102
104
  *CoboWaas2.WalletsApi* | [**createWallet**](docs/WalletsApi.md#createWallet) | **POST** /wallets | Create wallet
103
105
  *CoboWaas2.WalletsApi* | [**deleteWalletById**](docs/WalletsApi.md#deleteWalletById) | **POST** /wallets/{wallet_id}/delete | Delete wallet
104
- *CoboWaas2.WalletsApi* | [**getAddress**](docs/WalletsApi.md#getAddress) | **GET** /wallets/{wallet_id}/addresses/{address} | Get address information
105
106
  *CoboWaas2.WalletsApi* | [**getChainById**](docs/WalletsApi.md#getChainById) | **GET** /wallets/chains/{chain_id} | Get chain information
106
107
  *CoboWaas2.WalletsApi* | [**getMaxTransferableValue**](docs/WalletsApi.md#getMaxTransferableValue) | **GET** /wallets/{wallet_id}/max_transferable_value | Get maximum transferable value
107
108
  *CoboWaas2.WalletsApi* | [**getTokenById**](docs/WalletsApi.md#getTokenById) | **GET** /wallets/tokens/{token_id} | Get token information
@@ -163,6 +164,7 @@ Class | Method | HTTP request | Description
163
164
  - [CoboWaas2.ApiLogSummary](docs/ApiLogSummary.md)
164
165
  - [CoboWaas2.AssetBalance](docs/AssetBalance.md)
165
166
  - [CoboWaas2.AssetInfo](docs/AssetInfo.md)
167
+ - [CoboWaas2.BabylonStakeEstimatedFee](docs/BabylonStakeEstimatedFee.md)
166
168
  - [CoboWaas2.BabylonStakeExtra](docs/BabylonStakeExtra.md)
167
169
  - [CoboWaas2.BabylonStakingExtra](docs/BabylonStakingExtra.md)
168
170
  - [CoboWaas2.BabylonValidator](docs/BabylonValidator.md)
@@ -173,6 +175,7 @@ Class | Method | HTTP request | Description
173
175
  - [CoboWaas2.BroadcastSignedTransactions201ResponseInner](docs/BroadcastSignedTransactions201ResponseInner.md)
174
176
  - [CoboWaas2.BroadcastSignedTransactionsRequest](docs/BroadcastSignedTransactionsRequest.md)
175
177
  - [CoboWaas2.ChainInfo](docs/ChainInfo.md)
178
+ - [CoboWaas2.CheckAddressChainsValidity200ResponseInner](docs/CheckAddressChainsValidity200ResponseInner.md)
176
179
  - [CoboWaas2.CheckAddressValidity200Response](docs/CheckAddressValidity200Response.md)
177
180
  - [CoboWaas2.CheckAddressesValidity200ResponseInner](docs/CheckAddressesValidity200ResponseInner.md)
178
181
  - [CoboWaas2.CheckLoopTransfers200ResponseInner](docs/CheckLoopTransfers200ResponseInner.md)
@@ -200,6 +203,7 @@ Class | Method | HTTP request | Description
200
203
  - [CoboWaas2.CreateTransferTransaction201Response](docs/CreateTransferTransaction201Response.md)
201
204
  - [CoboWaas2.CreateTssRequestRequest](docs/CreateTssRequestRequest.md)
202
205
  - [CoboWaas2.CreateUnstakeActivity](docs/CreateUnstakeActivity.md)
206
+ - [CoboWaas2.CreateUnstakeActivityExtra](docs/CreateUnstakeActivityExtra.md)
203
207
  - [CoboWaas2.CreateUnstakeActivityRequest](docs/CreateUnstakeActivityRequest.md)
204
208
  - [CoboWaas2.CreateWalletParams](docs/CreateWalletParams.md)
205
209
  - [CoboWaas2.CreateWebhookEndpointRequest](docs/CreateWebhookEndpointRequest.md)
@@ -230,6 +234,10 @@ Class | Method | HTTP request | Description
230
234
  - [CoboWaas2.EstimatedFixedFee](docs/EstimatedFixedFee.md)
231
235
  - [CoboWaas2.EstimatedUtxoFee](docs/EstimatedUtxoFee.md)
232
236
  - [CoboWaas2.EstimatedUtxoFeeSlow](docs/EstimatedUtxoFeeSlow.md)
237
+ - [CoboWaas2.EthStakeEstimatedFee](docs/EthStakeEstimatedFee.md)
238
+ - [CoboWaas2.EthStakeExtra](docs/EthStakeExtra.md)
239
+ - [CoboWaas2.EthStakingExtra](docs/EthStakingExtra.md)
240
+ - [CoboWaas2.EthUnstakeExtra](docs/EthUnstakeExtra.md)
233
241
  - [CoboWaas2.EvmContractCallDestination](docs/EvmContractCallDestination.md)
234
242
  - [CoboWaas2.EvmEIP191MessageSignDestination](docs/EvmEIP191MessageSignDestination.md)
235
243
  - [CoboWaas2.EvmEIP712MessageSignDestination](docs/EvmEIP712MessageSignDestination.md)
@@ -247,9 +255,10 @@ Class | Method | HTTP request | Description
247
255
  - [CoboWaas2.FeeRate](docs/FeeRate.md)
248
256
  - [CoboWaas2.FeeType](docs/FeeType.md)
249
257
  - [CoboWaas2.FixedFeeRate](docs/FixedFeeRate.md)
258
+ - [CoboWaas2.GetApiKeyInfo200Response](docs/GetApiKeyInfo200Response.md)
250
259
  - [CoboWaas2.GetStakingEstimationFee201Response](docs/GetStakingEstimationFee201Response.md)
251
260
  - [CoboWaas2.GetStakingEstimationFeeRequest](docs/GetStakingEstimationFeeRequest.md)
252
- - [CoboWaas2.GetToken200Response](docs/GetToken200Response.md)
261
+ - [CoboWaas2.GetToken2XXResponse](docs/GetToken2XXResponse.md)
253
262
  - [CoboWaas2.GetToken4XXResponse](docs/GetToken4XXResponse.md)
254
263
  - [CoboWaas2.KeyShareHolder](docs/KeyShareHolder.md)
255
264
  - [CoboWaas2.KeyShareHolderGroup](docs/KeyShareHolderGroup.md)
@@ -304,10 +313,11 @@ Class | Method | HTTP request | Description
304
313
  - [CoboWaas2.PoolDetailsAllOfValidatorsInfo](docs/PoolDetailsAllOfValidatorsInfo.md)
305
314
  - [CoboWaas2.PoolSummary](docs/PoolSummary.md)
306
315
  - [CoboWaas2.RawMessageSignDestination](docs/RawMessageSignDestination.md)
307
- - [CoboWaas2.RefreshToken201Response](docs/RefreshToken201Response.md)
316
+ - [CoboWaas2.RefreshToken2XXResponse](docs/RefreshToken2XXResponse.md)
308
317
  - [CoboWaas2.RefreshTokenRequest](docs/RefreshTokenRequest.md)
309
318
  - [CoboWaas2.ReplaceType](docs/ReplaceType.md)
310
319
  - [CoboWaas2.RetryWebhookEventById201Response](docs/RetryWebhookEventById201Response.md)
320
+ - [CoboWaas2.RoleScopes](docs/RoleScopes.md)
311
321
  - [CoboWaas2.RootPubkey](docs/RootPubkey.md)
312
322
  - [CoboWaas2.SafeContractCallSource](docs/SafeContractCallSource.md)
313
323
  - [CoboWaas2.SafeTransferSource](docs/SafeTransferSource.md)
@@ -315,6 +325,7 @@ Class | Method | HTTP request | Description
315
325
  - [CoboWaas2.SafeWalletDelegates](docs/SafeWalletDelegates.md)
316
326
  - [CoboWaas2.SafeWalletDelegatesContractCall](docs/SafeWalletDelegatesContractCall.md)
317
327
  - [CoboWaas2.SafeWalletDelegatesTransfer](docs/SafeWalletDelegatesTransfer.md)
328
+ - [CoboWaas2.Scopes](docs/Scopes.md)
318
329
  - [CoboWaas2.SmartContractInitiator](docs/SmartContractInitiator.md)
319
330
  - [CoboWaas2.SmartContractWalletInfo](docs/SmartContractWalletInfo.md)
320
331
  - [CoboWaas2.SmartContractWalletOperationType](docs/SmartContractWalletOperationType.md)
package/dist/ApiClient.js CHANGED
@@ -77,7 +77,7 @@ var ApiClient = /*#__PURE__*/function () {
77
77
  * @default {}
78
78
  */
79
79
  this.defaultHeaders = {
80
- 'User-Agent': 'cobo-waas2-js-sdk/1.5.0'
80
+ 'User-Agent': 'cobo-waas2-js-sdk/1.6.0'
81
81
  };
82
82
 
83
83
  /**
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var express = require("express");
4
+ var nacl = require("tweetnacl");
5
+ var CryptoJS = require("crypto-js");
6
+
7
+ // Logging setup
8
+ var logger = console;
9
+
10
+ // Public keys for different environments
11
+ var pubKeys = {
12
+ DEV: "a04ea1d5fa8da71f1dcfccf972b9c4eba0a2d8aba1f6da26f49977b08a0d2718",
13
+ PROD: "8d4a482641adb2a34b726f05827dba9a9653e5857469b8749052bf4458a86729"
14
+ };
15
+ var pubkey = pubKeys["DEV"];
16
+
17
+ // Express setup
18
+ var app = express();
19
+ app.use(express.json({
20
+ verify: function verify(req, res, buf) {
21
+ req.rawBody = buf.toString();
22
+ }
23
+ }));
24
+
25
+ // Helper function to verify the request signature
26
+ function verifyRequest(req, res) {
27
+ var signature = req.headers['biz-resp-signature'];
28
+ var bizTimestamp = req.headers['biz-timestamp'];
29
+ if (!signature || !bizTimestamp) {
30
+ res.status(401).send('Missing signature or timestamp');
31
+ return false;
32
+ }
33
+ var message = "".concat(req.rawBody, "|").concat(bizTimestamp);
34
+ if (!verifySignature(pubkey, signature, message)) {
35
+ res.status(401).send('Signature verification failed');
36
+ return false;
37
+ }
38
+ return true;
39
+ }
40
+
41
+ // Webhook endpoint
42
+ app.post("/api/webhook", function (req, res) {
43
+ if (!verifyRequest(req, res)) return;
44
+ var event = req.body;
45
+ logger.info(event);
46
+ logger.info(event.data);
47
+ // Add your business logic here
48
+ res.sendStatus(201);
49
+ });
50
+
51
+ // Callback endpoint
52
+ app.post("/api/callback", function (req, res) {
53
+ if (!verifyRequest(req, res)) return;
54
+ var tx = req.body;
55
+ logger.info(tx);
56
+ // Add your callback logic here
57
+ res.send("ok");
58
+ });
59
+
60
+ // Signature verification function
61
+ function verifySignature(publicKey, signature, message) {
62
+ var vk = Buffer.from(publicKey, "hex");
63
+
64
+ // Double SHA-256 hash of the message
65
+ var hash2String = CryptoJS.SHA256(CryptoJS.SHA256(message)).toString(CryptoJS.enc.Hex);
66
+ try {
67
+ var signatureBuffer = Buffer.from(signature, "hex");
68
+ var messageBuffer = Buffer.from(hash2String, "hex");
69
+ return nacl.sign.detached.verify(messageBuffer, signatureBuffer, vk);
70
+ } catch (error) {
71
+ logger.error("Signature verification failed", error);
72
+ return false;
73
+ }
74
+ }
75
+
76
+ // Server startup
77
+ var PORT = 8000;
78
+ app.listen(PORT, function () {
79
+ logger.info("Server running on http://localhost:".concat(PORT));
80
+ });
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
9
+ var _GetApiKeyInfo200Response = _interopRequireDefault(require("../model/GetApiKeyInfo200Response"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
17
+ * Cobo Wallet as a Service 2.0
18
+ *
19
+ * Contact: help@cobo.com
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * Developers service.
28
+ * @module api/DevelopersApi
29
+ */
30
+ var DevelopersApi = exports["default"] = /*#__PURE__*/function () {
31
+ /**
32
+ * Constructs a new DevelopersApi.
33
+ * @alias module:api/DevelopersApi
34
+ * @class
35
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
36
+ * default to {@link module:ApiClient#instance} if unspecified.
37
+ */
38
+ function DevelopersApi(apiClient) {
39
+ _classCallCheck(this, DevelopersApi);
40
+ this.apiClient = apiClient || _ApiClient["default"].instance;
41
+ }
42
+
43
+ /**
44
+ * Get API key information
45
+ * This operation retrieves the details of the API key that you are using.
46
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetApiKeyInfo200Response} and HTTP response
47
+ */
48
+ return _createClass(DevelopersApi, [{
49
+ key: "getApiKeyInfoWithHttpInfo",
50
+ value: function getApiKeyInfoWithHttpInfo() {
51
+ var postBody = null;
52
+ if (postBody && postBody.toJSON) {
53
+ postBody = postBody.toJSON();
54
+ }
55
+ var pathParams = {};
56
+ var queryParams = {};
57
+ var headerParams = {};
58
+ var formParams = {};
59
+ var authNames = ['CoboAuth'];
60
+ var contentTypes = [];
61
+ var accepts = ['application/json'];
62
+ var returnType = _GetApiKeyInfo200Response["default"];
63
+ return this.apiClient.callApi('/developers/api_key_info', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
64
+ }
65
+
66
+ /**
67
+ * Get API key information
68
+ * This operation retrieves the details of the API key that you are using.
69
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetApiKeyInfo200Response}
70
+ */
71
+ }, {
72
+ key: "getApiKeyInfo",
73
+ value: function getApiKeyInfo() {
74
+ return this.getApiKeyInfoWithHttpInfo().then(function (response_and_data) {
75
+ return response_and_data.data;
76
+ });
77
+ }
78
+ }]);
79
+ }();
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
9
- var _GetToken200Response = _interopRequireDefault(require("../model/GetToken200Response"));
9
+ var _GetToken2XXResponse = _interopRequireDefault(require("../model/GetToken2XXResponse"));
10
10
  var _GetToken4XXResponse = _interopRequireDefault(require("../model/GetToken4XXResponse"));
11
- var _RefreshToken201Response = _interopRequireDefault(require("../model/RefreshToken201Response"));
11
+ var _RefreshToken2XXResponse = _interopRequireDefault(require("../model/RefreshToken2XXResponse"));
12
12
  var _RefreshTokenRequest = _interopRequireDefault(require("../model/RefreshTokenRequest"));
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
14
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -49,7 +49,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
49
49
  * @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
50
50
  * @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
51
51
  * @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
52
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetToken200Response} and HTTP response
52
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetToken2XXResponse} and HTTP response
53
53
  */
54
54
  return _createClass(OAuthApi, [{
55
55
  key: "getTokenWithHttpInfo",
@@ -81,7 +81,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
81
81
  var authNames = ['CoboAuth'];
82
82
  var contentTypes = [];
83
83
  var accepts = ['application/json'];
84
- var returnType = _GetToken200Response["default"];
84
+ var returnType = _GetToken2XXResponse["default"];
85
85
  return this.apiClient.callApi('/oauth/token', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
86
86
  }
87
87
 
@@ -91,7 +91,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
91
91
  * @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
92
92
  * @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
93
93
  * @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
94
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetToken200Response}
94
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetToken2XXResponse}
95
95
  */
96
96
  }, {
97
97
  key: "getToken",
@@ -105,7 +105,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
105
105
  * Refresh Org Access Token
106
106
  * <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new Org Access Token with a specified client ID, grant type and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.
107
107
  * @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an Org Access Token.
108
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RefreshToken201Response} and HTTP response
108
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RefreshToken2XXResponse} and HTTP response
109
109
  */
110
110
  }, {
111
111
  key: "refreshTokenWithHttpInfo",
@@ -125,7 +125,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
125
125
  var authNames = ['CoboAuth'];
126
126
  var contentTypes = ['application/json'];
127
127
  var accepts = ['application/json'];
128
- var returnType = _RefreshToken201Response["default"];
128
+ var returnType = _RefreshToken2XXResponse["default"];
129
129
  return this.apiClient.callApi('/oauth/token', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
130
130
  }
131
131
 
@@ -133,7 +133,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
133
133
  * Refresh Org Access Token
134
134
  * <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new Org Access Token with a specified client ID, grant type and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.
135
135
  * @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an Org Access Token.
136
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RefreshToken201Response}
136
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RefreshToken2XXResponse}
137
137
  */
138
138
  }, {
139
139
  key: "refreshToken",
@@ -7,6 +7,7 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _AddressInfo = _interopRequireDefault(require("../model/AddressInfo"));
9
9
  var _ChainInfo = _interopRequireDefault(require("../model/ChainInfo"));
10
+ var _CheckAddressChainsValidity200ResponseInner = _interopRequireDefault(require("../model/CheckAddressChainsValidity200ResponseInner"));
10
11
  var _CheckAddressValidity200Response = _interopRequireDefault(require("../model/CheckAddressValidity200Response"));
11
12
  var _CheckAddressesValidity200ResponseInner = _interopRequireDefault(require("../model/CheckAddressesValidity200ResponseInner"));
12
13
  var _CreateAddressRequest = _interopRequireDefault(require("../model/CreateAddressRequest"));
@@ -62,13 +63,64 @@ var WalletsApi = exports["default"] = /*#__PURE__*/function () {
62
63
  }
63
64
 
64
65
  /**
65
- * Check address validity
66
- * This operation verifies if a given address is valid for a specific chain.
67
- * @param {String} chain_id 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).
66
+ * Check address validity across chains
67
+ * This operation verifies if a given address is valid for a list of chains.
68
68
  * @param {String} address The wallet address.
69
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CheckAddressValidity200Response} and HTTP response
69
+ * @param {String} chain_ids A list of chain IDs, separated by comma. The chain ID 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).
70
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CheckAddressChainsValidity200ResponseInner>} and HTTP response
70
71
  */
71
72
  return _createClass(WalletsApi, [{
73
+ key: "checkAddressChainsValidityWithHttpInfo",
74
+ value: function checkAddressChainsValidityWithHttpInfo(address, chain_ids) {
75
+ var postBody = null;
76
+ if (postBody && postBody.toJSON) {
77
+ postBody = postBody.toJSON();
78
+ }
79
+ // verify the required parameter 'address' is set
80
+ if (address === undefined || address === null) {
81
+ throw new Error("Missing the required parameter 'address' when calling checkAddressChainsValidity");
82
+ }
83
+ // verify the required parameter 'chain_ids' is set
84
+ if (chain_ids === undefined || chain_ids === null) {
85
+ throw new Error("Missing the required parameter 'chain_ids' when calling checkAddressChainsValidity");
86
+ }
87
+ var pathParams = {};
88
+ var queryParams = {
89
+ 'address': address,
90
+ 'chain_ids': chain_ids
91
+ };
92
+ var headerParams = {};
93
+ var formParams = {};
94
+ var authNames = ['CoboAuth'];
95
+ var contentTypes = [];
96
+ var accepts = ['application/json'];
97
+ var returnType = [_CheckAddressChainsValidity200ResponseInner["default"]];
98
+ return this.apiClient.callApi('/wallets/check_address_chains_validity', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
99
+ }
100
+
101
+ /**
102
+ * Check address validity across chains
103
+ * This operation verifies if a given address is valid for a list of chains.
104
+ * @param {String} address The wallet address.
105
+ * @param {String} chain_ids A list of chain IDs, separated by comma. The chain ID 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).
106
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CheckAddressChainsValidity200ResponseInner>}
107
+ */
108
+ }, {
109
+ key: "checkAddressChainsValidity",
110
+ value: function checkAddressChainsValidity(address, chain_ids) {
111
+ return this.checkAddressChainsValidityWithHttpInfo(address, chain_ids).then(function (response_and_data) {
112
+ return response_and_data.data;
113
+ });
114
+ }
115
+
116
+ /**
117
+ * Check address validity
118
+ * This operation verifies if a given address is valid for a specific chain.
119
+ * @param {String} chain_id 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).
120
+ * @param {String} address The wallet address.
121
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CheckAddressValidity200Response} and HTTP response
122
+ */
123
+ }, {
72
124
  key: "checkAddressValidityWithHttpInfo",
73
125
  value: function checkAddressValidityWithHttpInfo(chain_id, address) {
74
126
  var postBody = null;
@@ -297,57 +349,6 @@ var WalletsApi = exports["default"] = /*#__PURE__*/function () {
297
349
  });
298
350
  }
299
351
 
300
- /**
301
- * Get address information
302
- * This operation retrieves the detailed information about a specified address within a wallet.
303
- * @param {String} wallet_id The wallet ID.
304
- * @param {String} address The wallet address.
305
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/AddressInfo>} and HTTP response
306
- */
307
- }, {
308
- key: "getAddressWithHttpInfo",
309
- value: function getAddressWithHttpInfo(wallet_id, address) {
310
- var postBody = null;
311
- if (postBody && postBody.toJSON) {
312
- postBody = postBody.toJSON();
313
- }
314
- // verify the required parameter 'wallet_id' is set
315
- if (wallet_id === undefined || wallet_id === null) {
316
- throw new Error("Missing the required parameter 'wallet_id' when calling getAddress");
317
- }
318
- // verify the required parameter 'address' is set
319
- if (address === undefined || address === null) {
320
- throw new Error("Missing the required parameter 'address' when calling getAddress");
321
- }
322
- var pathParams = {
323
- 'wallet_id': wallet_id,
324
- 'address': address
325
- };
326
- var queryParams = {};
327
- var headerParams = {};
328
- var formParams = {};
329
- var authNames = ['CoboAuth'];
330
- var contentTypes = [];
331
- var accepts = ['application/json'];
332
- var returnType = [_AddressInfo["default"]];
333
- return this.apiClient.callApi('/wallets/{wallet_id}/addresses/{address}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
334
- }
335
-
336
- /**
337
- * Get address information
338
- * This operation retrieves the detailed information about a specified address within a wallet.
339
- * @param {String} wallet_id The wallet ID.
340
- * @param {String} address The wallet address.
341
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/AddressInfo>}
342
- */
343
- }, {
344
- key: "getAddress",
345
- value: function getAddress(wallet_id, address) {
346
- return this.getAddressWithHttpInfo(wallet_id, address).then(function (response_and_data) {
347
- return response_and_data.data;
348
- });
349
- }
350
-
351
352
  /**
352
353
  * Get chain information
353
354
  * This operation retrieves the detailed information about a specified chain.
@@ -558,7 +559,7 @@ var WalletsApi = exports["default"] = /*#__PURE__*/function () {
558
559
  * @param {String} wallet_id The wallet ID.
559
560
  * @param {Object} opts Optional parameters
560
561
  * @param {String} [chain_ids] A list of chain IDs, separated by comma. The chain ID 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).
561
- * @param {String} [addresses] A list of wallet addresses, separated by comma.
562
+ * @param {String} [addresses] A list of wallet addresses, separated by comma. For addresses requiring a memo, append the memo after the address using the '|' separator (e.g., \"address|memo\").
562
563
  * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
563
564
  * @param {String} [before] 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.
564
565
  * @param {String} [after] 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.
@@ -601,7 +602,7 @@ var WalletsApi = exports["default"] = /*#__PURE__*/function () {
601
602
  * @param {String} wallet_id The wallet ID.
602
603
  * @param {Object} opts Optional parameters
603
604
  * @param {String} opts.chain_ids A list of chain IDs, separated by comma. The chain ID 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).
604
- * @param {String} opts.addresses A list of wallet addresses, separated by comma.
605
+ * @param {String} opts.addresses A list of wallet addresses, separated by comma. For addresses requiring a memo, append the memo after the address using the '|' separator (e.g., \"address|memo\").
605
606
  * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
606
607
  * @param {String} opts.before 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.
607
608
  * @param {String} opts.after 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.