@cobo/cobo-waas2 1.1.2 → 1.2.1

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 (143) hide show
  1. package/README.md +16 -3
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/PreRequestScript.js +640 -0
  4. package/dist/api/OAuthApi.js +16 -15
  5. package/dist/api/TransactionsApi.js +18 -18
  6. package/dist/api/WalletsApi.js +123 -12
  7. package/dist/api/WalletsExchangeWalletApi.js +254 -0
  8. package/dist/api/WalletsMPCWalletsApi.js +8 -8
  9. package/dist/index.js +56 -0
  10. package/dist/model/AddressInfo.js +1 -1
  11. package/dist/model/AddressTransferDestination.js +3 -3
  12. package/dist/model/AddressTransferDestinationAccountOutput.js +2 -2
  13. package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +1 -1
  14. package/dist/model/AssetInfo.js +2 -2
  15. package/dist/model/BabylonStakeExtra.js +9 -0
  16. package/dist/model/CheckAddressValidity200Response.js +2 -2
  17. package/dist/model/CheckAddressesValidity200ResponseInner.js +121 -0
  18. package/dist/model/CheckLoopTransfers200ResponseInner.js +96 -0
  19. package/dist/model/CoboSafeDelegate.js +27 -2
  20. package/dist/model/ContractCallDestination.js +24 -3
  21. package/dist/model/ContractCallSource.js +41 -4
  22. package/dist/model/CreateSmartContractWalletParams.js +23 -2
  23. package/dist/model/CreateStakeActivity.js +14 -1
  24. package/dist/model/CreateStakeActivityExtra.js +57 -6
  25. package/dist/model/CreateTssRequestRequest.js +13 -0
  26. package/dist/model/CreateUnstakeActivity.js +13 -0
  27. package/dist/model/CreateWalletParams.js +51 -6
  28. package/dist/model/CreateWithdrawActivity.js +13 -0
  29. package/dist/model/CreatedWalletInfo.js +63 -6
  30. package/dist/model/EstimateFeeParams.js +37 -4
  31. package/dist/model/EstimateStakeFee.js +19 -1
  32. package/dist/model/EstimateUnstakeFee.js +18 -0
  33. package/dist/model/EstimateWithdrawFee.js +18 -0
  34. package/dist/model/EstimatedFee.js +65 -8
  35. package/dist/model/EvmContractCallDestination.js +1 -1
  36. package/dist/model/ExchangeId.js +5 -0
  37. package/dist/model/ExchangeTransferDestination.js +16 -16
  38. package/dist/model/ExchangeTransferSource.js +14 -14
  39. package/dist/model/FeeRate.js +65 -8
  40. package/dist/model/GetToken200Response.js +4 -4
  41. package/dist/model/KeyShareHolder.js +13 -0
  42. package/dist/model/ListAssetBalancesForExchangeWallet200Response.js +123 -0
  43. package/dist/model/ListExchanges200ResponseInner.js +122 -0
  44. package/dist/model/ListSupportedAssetsForExchange200Response.js +123 -0
  45. package/dist/model/MPCWalletInfo.js +26 -0
  46. package/dist/model/MessageSignDestination.js +37 -4
  47. package/dist/model/MessageSignSource.js +27 -2
  48. package/dist/model/PoolDetailsAllOfValidatorsInfo.js +20 -4
  49. package/dist/model/RefreshToken200Response.js +135 -0
  50. package/dist/model/RefreshTokenRequest.js +2 -2
  51. package/dist/model/SmartContractWalletInfo.js +23 -2
  52. package/dist/model/SmartContractWalletType.js +2 -2
  53. package/dist/model/StakingSource.js +41 -4
  54. package/dist/model/SubWalletAssetBalance.js +10 -10
  55. package/dist/model/TSSRequest.js +23 -1
  56. package/dist/model/TSSRequestWebhookEventData.js +263 -0
  57. package/dist/model/TransactionDepositFromWalletSource.js +6 -6
  58. package/dist/model/TransactionDepositToAddressDestination.js +2 -2
  59. package/dist/model/TransactionDepositToWalletDestination.js +9 -9
  60. package/dist/model/TransactionDestination.js +112 -19
  61. package/dist/model/TransactionEvmContractDestination.js +1 -1
  62. package/dist/model/TransactionExchangeWalletSource.js +6 -6
  63. package/dist/model/TransactionFee.js +65 -8
  64. package/dist/model/TransactionMPCWalletSource.js +13 -0
  65. package/dist/model/TransactionRbfSource.js +27 -2
  66. package/dist/model/TransactionRequestFee.js +65 -8
  67. package/dist/model/TransactionResult.js +23 -2
  68. package/dist/model/TransactionSource.js +123 -16
  69. package/dist/model/TransactionSubStatus.js +5 -0
  70. package/dist/model/TransactionTransferToAddressDestinationAccountOutput.js +1 -1
  71. package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +1 -1
  72. package/dist/model/TransactionTransferToWalletDestination.js +9 -9
  73. package/dist/model/TransactionWebhookEventData.js +8 -3
  74. package/dist/model/TransferDestination.js +43 -10
  75. package/dist/model/TransferParams.js +2 -2
  76. package/dist/model/TransferSource.js +76 -11
  77. package/dist/model/UpdateWalletParams.js +65 -8
  78. package/dist/model/WalletInfo.js +77 -8
  79. package/dist/model/WebhookEventData.js +84 -17
  80. package/dist/model/WebhookEventDataType.js +7 -2
  81. package/dist/model/WebhookEventType.js +24 -4
  82. package/docs/AddressInfo.md +1 -1
  83. package/docs/AddressTransferDestination.md +2 -2
  84. package/docs/AddressTransferDestinationAccountOutput.md +1 -1
  85. package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -1
  86. package/docs/AssetInfo.md +1 -1
  87. package/docs/BabylonStakeExtra.md +1 -0
  88. package/docs/CheckAddressValidity200Response.md +1 -1
  89. package/docs/CheckAddressesValidity200ResponseInner.md +10 -0
  90. package/docs/CheckLoopTransfers200ResponseInner.md +10 -0
  91. package/docs/ContractCallDestination.md +1 -1
  92. package/docs/CreateStakeActivity.md +1 -0
  93. package/docs/CreateStakeActivityExtra.md +1 -0
  94. package/docs/CreateTssRequestRequest.md +1 -0
  95. package/docs/CreateUnstakeActivity.md +1 -0
  96. package/docs/CreateWithdrawActivity.md +1 -0
  97. package/docs/CreatedWalletInfo.md +2 -0
  98. package/docs/DevelopersWebhooksApi.md +78 -69
  99. package/docs/EstimateStakeFee.md +1 -0
  100. package/docs/EstimateUnstakeFee.md +1 -0
  101. package/docs/EstimateWithdrawFee.md +1 -0
  102. package/docs/EvmContractCallDestination.md +1 -1
  103. package/docs/ExchangeId.md +2 -0
  104. package/docs/ExchangeTransferDestination.md +2 -2
  105. package/docs/ExchangeTransferSource.md +1 -1
  106. package/docs/GetToken200Response.md +4 -4
  107. package/docs/KeyShareHolder.md +1 -0
  108. package/docs/ListAssetBalancesForExchangeWallet200Response.md +10 -0
  109. package/docs/ListExchanges200ResponseInner.md +10 -0
  110. package/docs/ListSupportedAssetsForExchange200Response.md +10 -0
  111. package/docs/MPCWalletInfo.md +2 -0
  112. package/docs/OAuthApi.md +26 -24
  113. package/docs/RefreshToken200Response.md +13 -0
  114. package/docs/RefreshTokenRequest.md +2 -2
  115. package/docs/SmartContractWalletType.md +1 -1
  116. package/docs/SubWalletAssetBalance.md +2 -2
  117. package/docs/TSSRequest.md +2 -0
  118. package/docs/TSSRequestWebhookEventData.md +29 -0
  119. package/docs/TransactionDepositFromWalletSource.md +1 -1
  120. package/docs/TransactionDepositToAddressDestination.md +1 -1
  121. package/docs/TransactionDepositToWalletDestination.md +2 -2
  122. package/docs/TransactionDestination.md +3 -3
  123. package/docs/TransactionEvmContractDestination.md +1 -1
  124. package/docs/TransactionExchangeWalletSource.md +1 -1
  125. package/docs/TransactionMPCWalletSource.md +1 -0
  126. package/docs/TransactionSource.md +2 -1
  127. package/docs/TransactionSubStatus.md +2 -0
  128. package/docs/TransactionTransferToAddressDestinationAccountOutput.md +1 -1
  129. package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +1 -1
  130. package/docs/TransactionTransferToWalletDestination.md +2 -2
  131. package/docs/TransactionWebhookEventData.md +3 -1
  132. package/docs/TransactionsApi.md +98 -88
  133. package/docs/TransferDestination.md +4 -4
  134. package/docs/TransferParams.md +1 -1
  135. package/docs/TransferSource.md +1 -1
  136. package/docs/WalletInfo.md +2 -0
  137. package/docs/WalletsApi.md +316 -187
  138. package/docs/WalletsExchangeWalletApi.md +230 -0
  139. package/docs/WalletsMPCWalletsApi.md +153 -135
  140. package/docs/WebhookEventData.md +10 -5
  141. package/docs/WebhookEventDataType.md +3 -1
  142. package/docs/WebhookEventType.md +12 -4
  143. package/package.json +1 -1
@@ -55,6 +55,27 @@ var CreateWalletParams = /*#__PURE__*/function () {
55
55
  }
56
56
  var match = 0;
57
57
  var errorMessages = [];
58
+ var discriminatorValue = instance["wallet_type"];
59
+ if (discriminatorValue) {
60
+ switch (discriminatorValue) {
61
+ case "Custodial":
62
+ this.actualInstance = _CreateCustodialWalletParams["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ case "Exchange":
66
+ this.actualInstance = _CreateExchangeWalletParams["default"].constructFromObject(instance);
67
+ match++;
68
+ break;
69
+ case "MPC":
70
+ this.actualInstance = _CreateMpcWalletParams["default"].constructFromObject(instance);
71
+ match++;
72
+ break;
73
+ default:
74
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
75
+ break;
76
+ }
77
+ return;
78
+ }
58
79
  try {
59
80
  if (instance instanceof _CreateCustodialWalletParams["default"]) {
60
81
  this.actualInstance = instance;
@@ -62,8 +83,16 @@ var CreateWalletParams = /*#__PURE__*/function () {
62
83
  // plain JS object
63
84
  // create CreateCustodialWalletParams from JS object
64
85
  this.actualInstance = _CreateCustodialWalletParams["default"].constructFromObject(instance);
65
- } else if (_CreateCustodialWalletParams["default"].constructFromObject(instance)) {
66
- this.actualInstance = _CreateCustodialWalletParams["default"].constructFromObject(instance);
86
+ } else {
87
+ if (_CreateCustodialWalletParams["default"].constructFromObject(instance)) {
88
+ if (!!_CreateCustodialWalletParams["default"].constructFromObject(instance).toJSON) {
89
+ if (_CreateCustodialWalletParams["default"].constructFromObject(instance).toJSON()) {
90
+ this.actualInstance = _CreateCustodialWalletParams["default"].constructFromObject(instance);
91
+ }
92
+ } else {
93
+ this.actualInstance = _CreateCustodialWalletParams["default"].constructFromObject(instance);
94
+ }
95
+ }
67
96
  }
68
97
  match++;
69
98
  } catch (err) {
@@ -77,8 +106,16 @@ var CreateWalletParams = /*#__PURE__*/function () {
77
106
  // plain JS object
78
107
  // create CreateMpcWalletParams from JS object
79
108
  this.actualInstance = _CreateMpcWalletParams["default"].constructFromObject(instance);
80
- } else if (_CreateMpcWalletParams["default"].constructFromObject(instance)) {
81
- this.actualInstance = _CreateMpcWalletParams["default"].constructFromObject(instance);
109
+ } else {
110
+ if (_CreateMpcWalletParams["default"].constructFromObject(instance)) {
111
+ if (!!_CreateMpcWalletParams["default"].constructFromObject(instance).toJSON) {
112
+ if (_CreateMpcWalletParams["default"].constructFromObject(instance).toJSON()) {
113
+ this.actualInstance = _CreateMpcWalletParams["default"].constructFromObject(instance);
114
+ }
115
+ } else {
116
+ this.actualInstance = _CreateMpcWalletParams["default"].constructFromObject(instance);
117
+ }
118
+ }
82
119
  }
83
120
  match++;
84
121
  } catch (err) {
@@ -92,8 +129,16 @@ var CreateWalletParams = /*#__PURE__*/function () {
92
129
  // plain JS object
93
130
  // create CreateExchangeWalletParams from JS object
94
131
  this.actualInstance = _CreateExchangeWalletParams["default"].constructFromObject(instance);
95
- } else if (_CreateExchangeWalletParams["default"].constructFromObject(instance)) {
96
- this.actualInstance = _CreateExchangeWalletParams["default"].constructFromObject(instance);
132
+ } else {
133
+ if (_CreateExchangeWalletParams["default"].constructFromObject(instance)) {
134
+ if (!!_CreateExchangeWalletParams["default"].constructFromObject(instance).toJSON) {
135
+ if (_CreateExchangeWalletParams["default"].constructFromObject(instance).toJSON()) {
136
+ this.actualInstance = _CreateExchangeWalletParams["default"].constructFromObject(instance);
137
+ }
138
+ } else {
139
+ this.actualInstance = _CreateExchangeWalletParams["default"].constructFromObject(instance);
140
+ }
141
+ }
97
142
  }
98
143
  match++;
99
144
  } catch (err) {
@@ -65,6 +65,9 @@ var CreateWithdrawActivity = /*#__PURE__*/function () {
65
65
  value: function constructFromObject(data, obj) {
66
66
  if (data) {
67
67
  obj = obj || new CreateWithdrawActivity();
68
+ if (data.hasOwnProperty('request_id')) {
69
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
70
+ }
68
71
  if (data.hasOwnProperty('staking_id')) {
69
72
  obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
70
73
  }
@@ -105,6 +108,10 @@ var CreateWithdrawActivity = /*#__PURE__*/function () {
105
108
  } finally {
106
109
  _iterator.f();
107
110
  }
111
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
112
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
113
+ }
114
+ // ensure the json data is a string
108
115
  if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
109
116
  throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
110
117
  }
@@ -129,6 +136,12 @@ var CreateWithdrawActivity = /*#__PURE__*/function () {
129
136
  }();
130
137
  CreateWithdrawActivity.RequiredProperties = ["staking_id", "fee"];
131
138
 
139
+ /**
140
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
141
+ * @member {String} request_id
142
+ */
143
+ CreateWithdrawActivity.prototype['request_id'] = undefined;
144
+
132
145
  /**
133
146
  * The id of the related staking.
134
147
  * @member {String} staking_id
@@ -55,6 +55,27 @@ var CreatedWalletInfo = /*#__PURE__*/function () {
55
55
  }
56
56
  var match = 0;
57
57
  var errorMessages = [];
58
+ var discriminatorValue = instance["wallet_type"];
59
+ if (discriminatorValue) {
60
+ switch (discriminatorValue) {
61
+ case "Custodial":
62
+ this.actualInstance = _CustodialWalletInfo["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ case "Exchange":
66
+ this.actualInstance = _ExchangeWalletInfo["default"].constructFromObject(instance);
67
+ match++;
68
+ break;
69
+ case "MPC":
70
+ this.actualInstance = _MPCWalletInfo["default"].constructFromObject(instance);
71
+ match++;
72
+ break;
73
+ default:
74
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
75
+ break;
76
+ }
77
+ return;
78
+ }
58
79
  try {
59
80
  if (instance instanceof _CustodialWalletInfo["default"]) {
60
81
  this.actualInstance = instance;
@@ -62,8 +83,16 @@ var CreatedWalletInfo = /*#__PURE__*/function () {
62
83
  // plain JS object
63
84
  // create CustodialWalletInfo from JS object
64
85
  this.actualInstance = _CustodialWalletInfo["default"].constructFromObject(instance);
65
- } else if (_CustodialWalletInfo["default"].constructFromObject(instance)) {
66
- this.actualInstance = _CustodialWalletInfo["default"].constructFromObject(instance);
86
+ } else {
87
+ if (_CustodialWalletInfo["default"].constructFromObject(instance)) {
88
+ if (!!_CustodialWalletInfo["default"].constructFromObject(instance).toJSON) {
89
+ if (_CustodialWalletInfo["default"].constructFromObject(instance).toJSON()) {
90
+ this.actualInstance = _CustodialWalletInfo["default"].constructFromObject(instance);
91
+ }
92
+ } else {
93
+ this.actualInstance = _CustodialWalletInfo["default"].constructFromObject(instance);
94
+ }
95
+ }
67
96
  }
68
97
  match++;
69
98
  } catch (err) {
@@ -77,8 +106,16 @@ var CreatedWalletInfo = /*#__PURE__*/function () {
77
106
  // plain JS object
78
107
  // create MPCWalletInfo from JS object
79
108
  this.actualInstance = _MPCWalletInfo["default"].constructFromObject(instance);
80
- } else if (_MPCWalletInfo["default"].constructFromObject(instance)) {
81
- this.actualInstance = _MPCWalletInfo["default"].constructFromObject(instance);
109
+ } else {
110
+ if (_MPCWalletInfo["default"].constructFromObject(instance)) {
111
+ if (!!_MPCWalletInfo["default"].constructFromObject(instance).toJSON) {
112
+ if (_MPCWalletInfo["default"].constructFromObject(instance).toJSON()) {
113
+ this.actualInstance = _MPCWalletInfo["default"].constructFromObject(instance);
114
+ }
115
+ } else {
116
+ this.actualInstance = _MPCWalletInfo["default"].constructFromObject(instance);
117
+ }
118
+ }
82
119
  }
83
120
  match++;
84
121
  } catch (err) {
@@ -92,8 +129,16 @@ var CreatedWalletInfo = /*#__PURE__*/function () {
92
129
  // plain JS object
93
130
  // create ExchangeWalletInfo from JS object
94
131
  this.actualInstance = _ExchangeWalletInfo["default"].constructFromObject(instance);
95
- } else if (_ExchangeWalletInfo["default"].constructFromObject(instance)) {
96
- this.actualInstance = _ExchangeWalletInfo["default"].constructFromObject(instance);
132
+ } else {
133
+ if (_ExchangeWalletInfo["default"].constructFromObject(instance)) {
134
+ if (!!_ExchangeWalletInfo["default"].constructFromObject(instance).toJSON) {
135
+ if (_ExchangeWalletInfo["default"].constructFromObject(instance).toJSON()) {
136
+ this.actualInstance = _ExchangeWalletInfo["default"].constructFromObject(instance);
137
+ }
138
+ } else {
139
+ this.actualInstance = _ExchangeWalletInfo["default"].constructFromObject(instance);
140
+ }
141
+ }
97
142
  }
98
143
  match++;
99
144
  } catch (err) {
@@ -191,12 +236,24 @@ CreatedWalletInfo.prototype['org_id'] = undefined;
191
236
  */
192
237
  CreatedWalletInfo.prototype['project_id'] = undefined;
193
238
 
239
+ /**
240
+ * The project name.
241
+ * @member {String} project_name
242
+ */
243
+ CreatedWalletInfo.prototype['project_name'] = undefined;
244
+
194
245
  /**
195
246
  * The ID of the owning vault.
196
247
  * @member {String} vault_id
197
248
  */
198
249
  CreatedWalletInfo.prototype['vault_id'] = undefined;
199
250
 
251
+ /**
252
+ * The vault name.
253
+ * @member {String} vault_name
254
+ */
255
+ CreatedWalletInfo.prototype['vault_name'] = undefined;
256
+
200
257
  /**
201
258
  * The API key of your exchange account.
202
259
  * @member {String} apikey
@@ -55,6 +55,23 @@ var EstimateFeeParams = /*#__PURE__*/function () {
55
55
  }
56
56
  var match = 0;
57
57
  var errorMessages = [];
58
+ var discriminatorValue = instance["request_type"];
59
+ if (discriminatorValue) {
60
+ switch (discriminatorValue) {
61
+ case "Call":
62
+ this.actualInstance = _EstimateContractCallFeeParams["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ case "Transfer":
66
+ this.actualInstance = _EstimateTransferFeeParams["default"].constructFromObject(instance);
67
+ match++;
68
+ break;
69
+ default:
70
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
71
+ break;
72
+ }
73
+ return;
74
+ }
58
75
  try {
59
76
  if (instance instanceof _EstimateTransferFeeParams["default"]) {
60
77
  this.actualInstance = instance;
@@ -62,8 +79,16 @@ var EstimateFeeParams = /*#__PURE__*/function () {
62
79
  // plain JS object
63
80
  // create EstimateTransferFeeParams from JS object
64
81
  this.actualInstance = _EstimateTransferFeeParams["default"].constructFromObject(instance);
65
- } else if (_EstimateTransferFeeParams["default"].constructFromObject(instance)) {
66
- this.actualInstance = _EstimateTransferFeeParams["default"].constructFromObject(instance);
82
+ } else {
83
+ if (_EstimateTransferFeeParams["default"].constructFromObject(instance)) {
84
+ if (!!_EstimateTransferFeeParams["default"].constructFromObject(instance).toJSON) {
85
+ if (_EstimateTransferFeeParams["default"].constructFromObject(instance).toJSON()) {
86
+ this.actualInstance = _EstimateTransferFeeParams["default"].constructFromObject(instance);
87
+ }
88
+ } else {
89
+ this.actualInstance = _EstimateTransferFeeParams["default"].constructFromObject(instance);
90
+ }
91
+ }
67
92
  }
68
93
  match++;
69
94
  } catch (err) {
@@ -77,8 +102,16 @@ var EstimateFeeParams = /*#__PURE__*/function () {
77
102
  // plain JS object
78
103
  // create EstimateContractCallFeeParams from JS object
79
104
  this.actualInstance = _EstimateContractCallFeeParams["default"].constructFromObject(instance);
80
- } else if (_EstimateContractCallFeeParams["default"].constructFromObject(instance)) {
81
- this.actualInstance = _EstimateContractCallFeeParams["default"].constructFromObject(instance);
105
+ } else {
106
+ if (_EstimateContractCallFeeParams["default"].constructFromObject(instance)) {
107
+ if (!!_EstimateContractCallFeeParams["default"].constructFromObject(instance).toJSON) {
108
+ if (_EstimateContractCallFeeParams["default"].constructFromObject(instance).toJSON()) {
109
+ this.actualInstance = _EstimateContractCallFeeParams["default"].constructFromObject(instance);
110
+ }
111
+ } else {
112
+ this.actualInstance = _EstimateContractCallFeeParams["default"].constructFromObject(instance);
113
+ }
114
+ }
82
115
  }
83
116
  match++;
84
117
  } catch (err) {
@@ -85,6 +85,9 @@ var EstimateStakeFee = /*#__PURE__*/function () {
85
85
  if (data.hasOwnProperty('activity_type')) {
86
86
  obj['activity_type'] = _ActivityType["default"].constructFromObject(data['activity_type']);
87
87
  }
88
+ if (data.hasOwnProperty('request_id')) {
89
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
90
+ }
88
91
  if (data.hasOwnProperty('source')) {
89
92
  obj['source'] = _StakingSource["default"].constructFromObject(data['source']);
90
93
  }
@@ -122,12 +125,16 @@ var EstimateStakeFee = /*#__PURE__*/function () {
122
125
  throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
123
126
  }
124
127
  }
125
- // validate the optional field `source`
128
+ // ensure the json data is a string
126
129
  } catch (err) {
127
130
  _iterator.e(err);
128
131
  } finally {
129
132
  _iterator.f();
130
133
  }
134
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
135
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
136
+ }
137
+ // validate the optional field `source`
131
138
  if (data['source']) {
132
139
  // data not null
133
140
  if (!!_StakingSource["default"].validateJSON) {
@@ -167,6 +174,12 @@ EstimateStakeFee.RequiredProperties = ["activity_type", "pool_id", "amount", "fe
167
174
  */
168
175
  EstimateStakeFee.prototype['activity_type'] = undefined;
169
176
 
177
+ /**
178
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
179
+ * @member {String} request_id
180
+ */
181
+ EstimateStakeFee.prototype['request_id'] = undefined;
182
+
170
183
  /**
171
184
  * @member {module:model/StakingSource} source
172
185
  */
@@ -200,6 +213,11 @@ EstimateStakeFee.prototype['extra'] = undefined;
200
213
  */
201
214
  _BaseEstimateStakingFee["default"].prototype['activity_type'] = undefined;
202
215
  // Implement CreateStakeActivity interface:
216
+ /**
217
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
218
+ * @member {String} request_id
219
+ */
220
+ _CreateStakeActivity["default"].prototype['request_id'] = undefined;
203
221
  /**
204
222
  * @member {module:model/StakingSource} source
205
223
  */
@@ -77,6 +77,9 @@ var EstimateUnstakeFee = /*#__PURE__*/function () {
77
77
  if (data.hasOwnProperty('activity_type')) {
78
78
  obj['activity_type'] = _ActivityType["default"].constructFromObject(data['activity_type']);
79
79
  }
80
+ if (data.hasOwnProperty('request_id')) {
81
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
82
+ }
80
83
  if (data.hasOwnProperty('staking_id')) {
81
84
  obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
82
85
  }
@@ -114,6 +117,10 @@ var EstimateUnstakeFee = /*#__PURE__*/function () {
114
117
  } finally {
115
118
  _iterator.f();
116
119
  }
120
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
121
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
122
+ }
123
+ // ensure the json data is a string
117
124
  if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
118
125
  throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
119
126
  }
@@ -139,6 +146,12 @@ EstimateUnstakeFee.RequiredProperties = ["activity_type", "staking_id"];
139
146
  */
140
147
  EstimateUnstakeFee.prototype['activity_type'] = undefined;
141
148
 
149
+ /**
150
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
151
+ * @member {String} request_id
152
+ */
153
+ EstimateUnstakeFee.prototype['request_id'] = undefined;
154
+
142
155
  /**
143
156
  * The id of the related staking.
144
157
  * @member {String} staking_id
@@ -162,6 +175,11 @@ EstimateUnstakeFee.prototype['fee'] = undefined;
162
175
  */
163
176
  _BaseEstimateStakingFee["default"].prototype['activity_type'] = undefined;
164
177
  // Implement CreateUnstakeActivity interface:
178
+ /**
179
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
180
+ * @member {String} request_id
181
+ */
182
+ _CreateUnstakeActivity["default"].prototype['request_id'] = undefined;
165
183
  /**
166
184
  * The id of the related staking.
167
185
  * @member {String} staking_id
@@ -79,6 +79,9 @@ var EstimateWithdrawFee = /*#__PURE__*/function () {
79
79
  if (data.hasOwnProperty('activity_type')) {
80
80
  obj['activity_type'] = _ActivityType["default"].constructFromObject(data['activity_type']);
81
81
  }
82
+ if (data.hasOwnProperty('request_id')) {
83
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
84
+ }
82
85
  if (data.hasOwnProperty('staking_id')) {
83
86
  obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
84
87
  }
@@ -119,6 +122,10 @@ var EstimateWithdrawFee = /*#__PURE__*/function () {
119
122
  } finally {
120
123
  _iterator.f();
121
124
  }
125
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
126
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
127
+ }
128
+ // ensure the json data is a string
122
129
  if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
123
130
  throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
124
131
  }
@@ -148,6 +155,12 @@ EstimateWithdrawFee.RequiredProperties = ["activity_type", "staking_id", "fee"];
148
155
  */
149
156
  EstimateWithdrawFee.prototype['activity_type'] = undefined;
150
157
 
158
+ /**
159
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
160
+ * @member {String} request_id
161
+ */
162
+ EstimateWithdrawFee.prototype['request_id'] = undefined;
163
+
151
164
  /**
152
165
  * The id of the related staking.
153
166
  * @member {String} staking_id
@@ -177,6 +190,11 @@ EstimateWithdrawFee.prototype['fee'] = undefined;
177
190
  */
178
191
  _BaseEstimateStakingFee["default"].prototype['activity_type'] = undefined;
179
192
  // Implement CreateWithdrawActivity interface:
193
+ /**
194
+ * The request ID that is used to track a request. The request ID is provided by you and must be unique within your organization.
195
+ * @member {String} request_id
196
+ */
197
+ _CreateWithdrawActivity["default"].prototype['request_id'] = undefined;
180
198
  /**
181
199
  * The id of the related staking.
182
200
  * @member {String} staking_id
@@ -55,6 +55,31 @@ var EstimatedFee = /*#__PURE__*/function () {
55
55
  }
56
56
  var match = 0;
57
57
  var errorMessages = [];
58
+ var discriminatorValue = instance["fee_type"];
59
+ if (discriminatorValue) {
60
+ switch (discriminatorValue) {
61
+ case "EVM_EIP_1559":
62
+ this.actualInstance = _EstimatedEvmEip1559Fee["default"].constructFromObject(instance);
63
+ match++;
64
+ break;
65
+ case "EVM_Legacy":
66
+ this.actualInstance = _EstimatedEvmLegacyFee["default"].constructFromObject(instance);
67
+ match++;
68
+ break;
69
+ case "Fixed":
70
+ this.actualInstance = _EstimatedFixedFee["default"].constructFromObject(instance);
71
+ match++;
72
+ break;
73
+ case "UTXO":
74
+ this.actualInstance = _EstimatedUtxoFee["default"].constructFromObject(instance);
75
+ match++;
76
+ break;
77
+ default:
78
+ errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
79
+ break;
80
+ }
81
+ return;
82
+ }
58
83
  try {
59
84
  if (instance instanceof _EstimatedFixedFee["default"]) {
60
85
  this.actualInstance = instance;
@@ -62,8 +87,16 @@ var EstimatedFee = /*#__PURE__*/function () {
62
87
  // plain JS object
63
88
  // create EstimatedFixedFee from JS object
64
89
  this.actualInstance = _EstimatedFixedFee["default"].constructFromObject(instance);
65
- } else if (_EstimatedFixedFee["default"].constructFromObject(instance)) {
66
- this.actualInstance = _EstimatedFixedFee["default"].constructFromObject(instance);
90
+ } else {
91
+ if (_EstimatedFixedFee["default"].constructFromObject(instance)) {
92
+ if (!!_EstimatedFixedFee["default"].constructFromObject(instance).toJSON) {
93
+ if (_EstimatedFixedFee["default"].constructFromObject(instance).toJSON()) {
94
+ this.actualInstance = _EstimatedFixedFee["default"].constructFromObject(instance);
95
+ }
96
+ } else {
97
+ this.actualInstance = _EstimatedFixedFee["default"].constructFromObject(instance);
98
+ }
99
+ }
67
100
  }
68
101
  match++;
69
102
  } catch (err) {
@@ -77,8 +110,16 @@ var EstimatedFee = /*#__PURE__*/function () {
77
110
  // plain JS object
78
111
  // create EstimatedEvmEip1559Fee from JS object
79
112
  this.actualInstance = _EstimatedEvmEip1559Fee["default"].constructFromObject(instance);
80
- } else if (_EstimatedEvmEip1559Fee["default"].constructFromObject(instance)) {
81
- this.actualInstance = _EstimatedEvmEip1559Fee["default"].constructFromObject(instance);
113
+ } else {
114
+ if (_EstimatedEvmEip1559Fee["default"].constructFromObject(instance)) {
115
+ if (!!_EstimatedEvmEip1559Fee["default"].constructFromObject(instance).toJSON) {
116
+ if (_EstimatedEvmEip1559Fee["default"].constructFromObject(instance).toJSON()) {
117
+ this.actualInstance = _EstimatedEvmEip1559Fee["default"].constructFromObject(instance);
118
+ }
119
+ } else {
120
+ this.actualInstance = _EstimatedEvmEip1559Fee["default"].constructFromObject(instance);
121
+ }
122
+ }
82
123
  }
83
124
  match++;
84
125
  } catch (err) {
@@ -92,8 +133,16 @@ var EstimatedFee = /*#__PURE__*/function () {
92
133
  // plain JS object
93
134
  // create EstimatedEvmLegacyFee from JS object
94
135
  this.actualInstance = _EstimatedEvmLegacyFee["default"].constructFromObject(instance);
95
- } else if (_EstimatedEvmLegacyFee["default"].constructFromObject(instance)) {
96
- this.actualInstance = _EstimatedEvmLegacyFee["default"].constructFromObject(instance);
136
+ } else {
137
+ if (_EstimatedEvmLegacyFee["default"].constructFromObject(instance)) {
138
+ if (!!_EstimatedEvmLegacyFee["default"].constructFromObject(instance).toJSON) {
139
+ if (_EstimatedEvmLegacyFee["default"].constructFromObject(instance).toJSON()) {
140
+ this.actualInstance = _EstimatedEvmLegacyFee["default"].constructFromObject(instance);
141
+ }
142
+ } else {
143
+ this.actualInstance = _EstimatedEvmLegacyFee["default"].constructFromObject(instance);
144
+ }
145
+ }
97
146
  }
98
147
  match++;
99
148
  } catch (err) {
@@ -107,8 +156,16 @@ var EstimatedFee = /*#__PURE__*/function () {
107
156
  // plain JS object
108
157
  // create EstimatedUtxoFee from JS object
109
158
  this.actualInstance = _EstimatedUtxoFee["default"].constructFromObject(instance);
110
- } else if (_EstimatedUtxoFee["default"].constructFromObject(instance)) {
111
- this.actualInstance = _EstimatedUtxoFee["default"].constructFromObject(instance);
159
+ } else {
160
+ if (_EstimatedUtxoFee["default"].constructFromObject(instance)) {
161
+ if (!!_EstimatedUtxoFee["default"].constructFromObject(instance).toJSON) {
162
+ if (_EstimatedUtxoFee["default"].constructFromObject(instance).toJSON()) {
163
+ this.actualInstance = _EstimatedUtxoFee["default"].constructFromObject(instance);
164
+ }
165
+ } else {
166
+ this.actualInstance = _EstimatedUtxoFee["default"].constructFromObject(instance);
167
+ }
168
+ }
112
169
  }
113
170
  match++;
114
171
  } catch (err) {
@@ -133,7 +133,7 @@ EvmContractCallDestination.prototype['destination_type'] = undefined;
133
133
  EvmContractCallDestination.prototype['address'] = undefined;
134
134
 
135
135
  /**
136
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
136
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
137
137
  * @member {String} value
138
138
  */
139
139
  EvmContractCallDestination.prototype['value'] = undefined;
@@ -55,6 +55,11 @@ var ExchangeId = exports["default"] = /*#__PURE__*/function () {
55
55
  * @const
56
56
  */
57
57
  _defineProperty(this, "gate", "gate");
58
+ /**
59
+ * value: "bitget"
60
+ * @const
61
+ */
62
+ _defineProperty(this, "bitget", "bitget");
58
63
  /**
59
64
  * value: "unknown_default_open_api"
60
65
  * @const
@@ -32,16 +32,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
32
32
  var ExchangeTransferDestination = /*#__PURE__*/function () {
33
33
  /**
34
34
  * Constructs a new <code>ExchangeTransferDestination</code>.
35
- * The information about the transaction destination type &#x60;ExchangeWallet&#x60;. An Exchange Wallet (Sub Account) as the transaction destination can only receives token transfers from another Exchange Wallet.
35
+ * The information about the transaction destination type &#x60;ExchangeWallet&#x60;. An Exchange Wallet (Sub Account) can only receive asset transfers from another Exchange Wallet.
36
36
  * @alias module:model/ExchangeTransferDestination
37
37
  * @param destination_type {module:model/TransferDestinationType}
38
38
  * @param wallet_id {String} The wallet ID.
39
- * @param sub_wallet_id {String} The exchange trading account or the sub-wallet ID.
40
- * @param amount {String} The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
39
+ * @param trading_account_type {String} The trading account type.
40
+ * @param amount {String} The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
41
41
  */
42
- function ExchangeTransferDestination(destination_type, wallet_id, sub_wallet_id, amount) {
42
+ function ExchangeTransferDestination(destination_type, wallet_id, trading_account_type, amount) {
43
43
  _classCallCheck(this, ExchangeTransferDestination);
44
- ExchangeTransferDestination.initialize(this, destination_type, wallet_id, sub_wallet_id, amount);
44
+ ExchangeTransferDestination.initialize(this, destination_type, wallet_id, trading_account_type, amount);
45
45
  }
46
46
 
47
47
  /**
@@ -51,10 +51,10 @@ var ExchangeTransferDestination = /*#__PURE__*/function () {
51
51
  */
52
52
  return _createClass(ExchangeTransferDestination, null, [{
53
53
  key: "initialize",
54
- value: function initialize(obj, destination_type, wallet_id, sub_wallet_id, amount) {
54
+ value: function initialize(obj, destination_type, wallet_id, trading_account_type, amount) {
55
55
  obj['destination_type'] = destination_type;
56
56
  obj['wallet_id'] = wallet_id;
57
- obj['sub_wallet_id'] = sub_wallet_id;
57
+ obj['trading_account_type'] = trading_account_type;
58
58
  obj['amount'] = amount;
59
59
  }
60
60
 
@@ -76,8 +76,8 @@ var ExchangeTransferDestination = /*#__PURE__*/function () {
76
76
  if (data.hasOwnProperty('wallet_id')) {
77
77
  obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
78
78
  }
79
- if (data.hasOwnProperty('sub_wallet_id')) {
80
- obj['sub_wallet_id'] = _ApiClient["default"].convertToType(data['sub_wallet_id'], 'String');
79
+ if (data.hasOwnProperty('trading_account_type')) {
80
+ obj['trading_account_type'] = _ApiClient["default"].convertToType(data['trading_account_type'], 'String');
81
81
  }
82
82
  if (data.hasOwnProperty('amount')) {
83
83
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
@@ -114,8 +114,8 @@ var ExchangeTransferDestination = /*#__PURE__*/function () {
114
114
  throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
115
115
  }
116
116
  // ensure the json data is a string
117
- if (data['sub_wallet_id'] && !(typeof data['sub_wallet_id'] === 'string' || data['sub_wallet_id'] instanceof String)) {
118
- throw new Error("Expected the field `sub_wallet_id` to be a primitive type in the JSON string but got " + data['sub_wallet_id']);
117
+ if (data['trading_account_type'] && !(typeof data['trading_account_type'] === 'string' || data['trading_account_type'] instanceof String)) {
118
+ throw new Error("Expected the field `trading_account_type` to be a primitive type in the JSON string but got " + data['trading_account_type']);
119
119
  }
120
120
  // ensure the json data is a string
121
121
  if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
@@ -125,7 +125,7 @@ var ExchangeTransferDestination = /*#__PURE__*/function () {
125
125
  }
126
126
  }]);
127
127
  }();
128
- ExchangeTransferDestination.RequiredProperties = ["destination_type", "wallet_id", "sub_wallet_id", "amount"];
128
+ ExchangeTransferDestination.RequiredProperties = ["destination_type", "wallet_id", "trading_account_type", "amount"];
129
129
 
130
130
  /**
131
131
  * @member {module:model/TransferDestinationType} destination_type
@@ -139,13 +139,13 @@ ExchangeTransferDestination.prototype['destination_type'] = undefined;
139
139
  ExchangeTransferDestination.prototype['wallet_id'] = undefined;
140
140
 
141
141
  /**
142
- * The exchange trading account or the sub-wallet ID.
143
- * @member {String} sub_wallet_id
142
+ * The trading account type.
143
+ * @member {String} trading_account_type
144
144
  */
145
- ExchangeTransferDestination.prototype['sub_wallet_id'] = undefined;
145
+ ExchangeTransferDestination.prototype['trading_account_type'] = undefined;
146
146
 
147
147
  /**
148
- * The quantity of the token in the transaction. For example, if you trade 1.5 ETH, then the value is `1.5`.
148
+ * The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`.
149
149
  * @member {String} amount
150
150
  */
151
151
  ExchangeTransferDestination.prototype['amount'] = undefined;