@cobo/cobo-waas2 1.9.0 → 1.10.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 (89) hide show
  1. package/README.md +40 -4
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/DevelopersApi.js +4 -4
  4. package/dist/api/StakingsApi.js +400 -6
  5. package/dist/api/SwapsApi.js +360 -0
  6. package/dist/api/TransactionsApi.js +4 -4
  7. package/dist/index.js +164 -3
  8. package/dist/model/AddressesEventData.js +4 -4
  9. package/dist/model/AddressesEventDataAllOfAddresses.js +295 -0
  10. package/dist/model/BTCEIP191MessageSignDestination.js +1 -1
  11. package/dist/model/BabylonAirdropPop.js +186 -0
  12. package/dist/model/BabylonAirdropRegistration.js +172 -0
  13. package/dist/model/BabylonEligibleAirdrop.js +157 -0
  14. package/dist/model/BabylonRegistrationRequestStatus.js +66 -0
  15. package/dist/model/BabylonRegistrationStatus.js +66 -0
  16. package/dist/model/BabylonStakingRegistration.js +185 -0
  17. package/dist/model/ContractCallSource.js +6 -0
  18. package/dist/model/CreateBabylonAirdropRegistration201Response.js +87 -0
  19. package/dist/model/CreateBabylonAirdropRegistrationRequest.js +105 -0
  20. package/dist/model/CreateBabylonStakingRegistration201Response.js +87 -0
  21. package/dist/model/CreateBabylonStakingRegistrationRequest.js +103 -0
  22. package/dist/model/CreateSwapActivityRequest.js +153 -0
  23. package/dist/model/CreateSwapQuote201Response.js +264 -0
  24. package/dist/model/CreateSwapQuoteRequest.js +166 -0
  25. package/dist/model/ListBabylonAirdropRegistrations200Response.js +123 -0
  26. package/dist/model/ListBabylonEligibleAirdrops200Response.js +123 -0
  27. package/dist/model/ListBabylonEligibleStakings200Response.js +123 -0
  28. package/dist/model/ListBabylonEligibleStakings200ResponseDataInner.js +141 -0
  29. package/dist/model/ListBabylonStakingRegistrations200Response.js +123 -0
  30. package/dist/model/{SwapSummary.js → ListEnableTokenPairs200Response.js} +51 -49
  31. package/dist/model/ListSwapActivities200Response.js +123 -0
  32. package/dist/model/MessageSignSource.js +6 -0
  33. package/dist/model/MpcContractCallSource.js +16 -0
  34. package/dist/model/MpcMessageSignSource.js +16 -0
  35. package/dist/model/MpcSigningGroup.js +27 -4
  36. package/dist/model/MpcTransferSource.js +16 -0
  37. package/dist/model/QueryGuardPubkey200ResponseAddressesInner.js +2 -2
  38. package/dist/model/StakingPoolId.js +30 -0
  39. package/dist/model/StakingPoolType.js +15 -0
  40. package/dist/model/SwapQuote.js +203 -0
  41. package/dist/model/TransactionDestination.js +4 -4
  42. package/dist/model/TransactionRawTxInfo.js +16 -0
  43. package/dist/model/TransactionRbfSource.js +6 -0
  44. package/dist/model/TransactionUtxoChange.js +101 -0
  45. package/dist/model/TransferSource.js +6 -0
  46. package/dist/model/WebhookEventData.js +2 -2
  47. package/docs/AddressesEventData.md +1 -1
  48. package/docs/AddressesEventDataAllOfAddresses.md +19 -0
  49. package/docs/BabylonAirdropPop.md +14 -0
  50. package/docs/BabylonAirdropRegistration.md +16 -0
  51. package/docs/BabylonEligibleAirdrop.md +14 -0
  52. package/docs/BabylonRegistrationRequestStatus.md +14 -0
  53. package/docs/BabylonRegistrationStatus.md +14 -0
  54. package/docs/BabylonStakingRegistration.md +17 -0
  55. package/docs/ContractCallSource.md +1 -0
  56. package/docs/CreateBabylonAirdropRegistration201Response.md +9 -0
  57. package/docs/CreateBabylonAirdropRegistrationRequest.md +10 -0
  58. package/docs/CreateBabylonStakingRegistration201Response.md +9 -0
  59. package/docs/CreateBabylonStakingRegistrationRequest.md +10 -0
  60. package/docs/CreateSwapActivityRequest.md +12 -0
  61. package/docs/CreateSwapQuote201Response.md +17 -0
  62. package/docs/CreateSwapQuoteRequest.md +13 -0
  63. package/docs/DevelopersApi.md +2 -2
  64. package/docs/ListBabylonAirdropRegistrations200Response.md +10 -0
  65. package/docs/ListBabylonEligibleAirdrops200Response.md +10 -0
  66. package/docs/ListBabylonEligibleStakings200Response.md +10 -0
  67. package/docs/ListBabylonEligibleStakings200ResponseDataInner.md +13 -0
  68. package/docs/ListBabylonStakingRegistrations200Response.md +10 -0
  69. package/docs/ListEnableTokenPairs200Response.md +10 -0
  70. package/docs/ListSwapActivities200Response.md +10 -0
  71. package/docs/MessageSignSource.md +1 -0
  72. package/docs/MpcContractCallSource.md +1 -0
  73. package/docs/MpcMessageSignSource.md +1 -0
  74. package/docs/MpcSigningGroup.md +1 -1
  75. package/docs/MpcTransferSource.md +1 -0
  76. package/docs/QueryGuardPubkey200ResponseAddressesInner.md +1 -1
  77. package/docs/StakingPoolId.md +12 -0
  78. package/docs/StakingPoolType.md +6 -0
  79. package/docs/StakingsApi.md +449 -1
  80. package/docs/SwapQuote.md +16 -0
  81. package/docs/SwapsApi.md +348 -0
  82. package/docs/TransactionRawTxInfo.md +1 -0
  83. package/docs/TransactionRbfSource.md +1 -0
  84. package/docs/TransactionUtxoChange.md +10 -0
  85. package/docs/TransactionsApi.md +2 -2
  86. package/docs/TransferSource.md +1 -0
  87. package/docs/WebhookEventData.md +1 -1
  88. package/package.json +2 -2
  89. package/docs/SwapSummary.md +0 -10
@@ -0,0 +1,185 @@
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 _BabylonRegistrationRequestStatus = _interopRequireDefault(require("./BabylonRegistrationRequestStatus"));
9
+ var _StakingSource = _interopRequireDefault(require("./StakingSource"));
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
+ * The BabylonStakingRegistration model module.
28
+ * @module model/BabylonStakingRegistration
29
+ */
30
+ var BabylonStakingRegistration = /*#__PURE__*/function () {
31
+ /**
32
+ * Constructs a new <code>BabylonStakingRegistration</code>.
33
+ * The details of aBabylon Phase-2 registration.
34
+ * @alias module:model/BabylonStakingRegistration
35
+ */
36
+ function BabylonStakingRegistration() {
37
+ _classCallCheck(this, BabylonStakingRegistration);
38
+ BabylonStakingRegistration.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(BabylonStakingRegistration, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>BabylonStakingRegistration</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/BabylonStakingRegistration} obj Optional instance to populate.
55
+ * @return {module:model/BabylonStakingRegistration} The populated <code>BabylonStakingRegistration</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new BabylonStakingRegistration();
62
+ if (data.hasOwnProperty('id')) {
63
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('staking_id')) {
66
+ obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
67
+ }
68
+ if (data.hasOwnProperty('babylon_address')) {
69
+ obj['babylon_address'] = _StakingSource["default"].constructFromObject(data['babylon_address']);
70
+ }
71
+ if (data.hasOwnProperty('btc_address')) {
72
+ obj['btc_address'] = _StakingSource["default"].constructFromObject(data['btc_address']);
73
+ }
74
+ if (data.hasOwnProperty('status')) {
75
+ obj['status'] = _BabylonRegistrationRequestStatus["default"].constructFromObject(data['status']);
76
+ }
77
+ if (data.hasOwnProperty('staked_amount')) {
78
+ obj['staked_amount'] = _ApiClient["default"].convertToType(data['staked_amount'], 'String');
79
+ }
80
+ if (data.hasOwnProperty('error_message')) {
81
+ obj['error_message'] = _ApiClient["default"].convertToType(data['error_message'], 'String');
82
+ }
83
+ if (data.hasOwnProperty('created_timestamp')) {
84
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
85
+ }
86
+ if (data.hasOwnProperty('updated_timestamp')) {
87
+ obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
88
+ }
89
+ }
90
+ return obj;
91
+ }
92
+
93
+ /**
94
+ * Validates the JSON data with respect to <code>BabylonStakingRegistration</code>.
95
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
96
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>BabylonStakingRegistration</code>.
97
+ */
98
+ }, {
99
+ key: "validateJSON",
100
+ value: function validateJSON(data) {
101
+ // ensure the json data is a string
102
+ if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
103
+ throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
104
+ }
105
+ // ensure the json data is a string
106
+ if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
107
+ throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
108
+ }
109
+ // validate the optional field `babylon_address`
110
+ if (data['babylon_address']) {
111
+ // data not null
112
+ if (!!_StakingSource["default"].validateJSON) {
113
+ _StakingSource["default"].validateJSON(data['babylon_address']);
114
+ }
115
+ }
116
+ // validate the optional field `btc_address`
117
+ if (data['btc_address']) {
118
+ // data not null
119
+ if (!!_StakingSource["default"].validateJSON) {
120
+ _StakingSource["default"].validateJSON(data['btc_address']);
121
+ }
122
+ }
123
+ // ensure the json data is a string
124
+ if (data['staked_amount'] && !(typeof data['staked_amount'] === 'string' || data['staked_amount'] instanceof String)) {
125
+ throw new Error("Expected the field `staked_amount` to be a primitive type in the JSON string but got " + data['staked_amount']);
126
+ }
127
+ // ensure the json data is a string
128
+ if (data['error_message'] && !(typeof data['error_message'] === 'string' || data['error_message'] instanceof String)) {
129
+ throw new Error("Expected the field `error_message` to be a primitive type in the JSON string but got " + data['error_message']);
130
+ }
131
+ return true;
132
+ }
133
+ }]);
134
+ }();
135
+ /**
136
+ * The registration ID, a unique identifier for tracking the staking registration.
137
+ * @member {String} id
138
+ */
139
+ BabylonStakingRegistration.prototype['id'] = undefined;
140
+
141
+ /**
142
+ * The ID of the Phase-1 BTC staking position.
143
+ * @member {String} staking_id
144
+ */
145
+ BabylonStakingRegistration.prototype['staking_id'] = undefined;
146
+
147
+ /**
148
+ * @member {module:model/StakingSource} babylon_address
149
+ */
150
+ BabylonStakingRegistration.prototype['babylon_address'] = undefined;
151
+
152
+ /**
153
+ * @member {module:model/StakingSource} btc_address
154
+ */
155
+ BabylonStakingRegistration.prototype['btc_address'] = undefined;
156
+
157
+ /**
158
+ * @member {module:model/BabylonRegistrationRequestStatus} status
159
+ */
160
+ BabylonStakingRegistration.prototype['status'] = undefined;
161
+
162
+ /**
163
+ * The amount of BTC that is staked.
164
+ * @member {String} staked_amount
165
+ */
166
+ BabylonStakingRegistration.prototype['staked_amount'] = undefined;
167
+
168
+ /**
169
+ * The error message if the Babylon Phase-2 registration request failed.
170
+ * @member {String} error_message
171
+ */
172
+ BabylonStakingRegistration.prototype['error_message'] = undefined;
173
+
174
+ /**
175
+ * The time when the registration was created, in Unix timestamp format, measured in milliseconds.
176
+ * @member {Number} created_timestamp
177
+ */
178
+ BabylonStakingRegistration.prototype['created_timestamp'] = undefined;
179
+
180
+ /**
181
+ * The time when the registration was updated, in Unix timestamp format, measured in milliseconds.
182
+ * @member {Number} updated_timestamp
183
+ */
184
+ BabylonStakingRegistration.prototype['updated_timestamp'] = undefined;
185
+ var _default = exports["default"] = BabylonStakingRegistration;
@@ -8,6 +8,7 @@ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _CoboSafeDelegate = _interopRequireDefault(require("./CoboSafeDelegate"));
9
9
  var _ContractCallSourceType = _interopRequireDefault(require("./ContractCallSourceType"));
10
10
  var _MpcContractCallSource = _interopRequireDefault(require("./MpcContractCallSource"));
11
+ var _MpcSigningGroup = _interopRequireDefault(require("./MpcSigningGroup"));
11
12
  var _SafeContractCallSource = _interopRequireDefault(require("./SafeContractCallSource"));
12
13
  var _ContractCallSource;
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -194,6 +195,11 @@ ContractCallSource.prototype['wallet_id'] = undefined;
194
195
  */
195
196
  ContractCallSource.prototype['address'] = undefined;
196
197
 
198
+ /**
199
+ * @member {module:model/MpcSigningGroup} mpc_used_key_share_holder_group
200
+ */
201
+ ContractCallSource.prototype['mpc_used_key_share_holder_group'] = undefined;
202
+
197
203
  /**
198
204
  * @member {module:model/CoboSafeDelegate} delegate
199
205
  */
@@ -0,0 +1,87 @@
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
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ 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); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); } /**
15
+ * Cobo Wallet as a Service 2.0
16
+ *
17
+ * Contact: help@cobo.com
18
+ *
19
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
20
+ * https://openapi-generator.tech
21
+ * Do not edit the class manually.
22
+ *
23
+ */
24
+ /**
25
+ * The CreateBabylonAirdropRegistration201Response model module.
26
+ * @module model/CreateBabylonAirdropRegistration201Response
27
+ */
28
+ var CreateBabylonAirdropRegistration201Response = /*#__PURE__*/function () {
29
+ /**
30
+ * Constructs a new <code>CreateBabylonAirdropRegistration201Response</code>.
31
+ * @alias module:model/CreateBabylonAirdropRegistration201Response
32
+ */
33
+ function CreateBabylonAirdropRegistration201Response() {
34
+ _classCallCheck(this, CreateBabylonAirdropRegistration201Response);
35
+ CreateBabylonAirdropRegistration201Response.initialize(this);
36
+ }
37
+
38
+ /**
39
+ * Initializes the fields of this object.
40
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
+ * Only for internal use.
42
+ */
43
+ return _createClass(CreateBabylonAirdropRegistration201Response, null, [{
44
+ key: "initialize",
45
+ value: function initialize(obj) {}
46
+
47
+ /**
48
+ * Constructs a <code>CreateBabylonAirdropRegistration201Response</code> from a plain JavaScript object, optionally creating a new instance.
49
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
51
+ * @param {module:model/CreateBabylonAirdropRegistration201Response} obj Optional instance to populate.
52
+ * @return {module:model/CreateBabylonAirdropRegistration201Response} The populated <code>CreateBabylonAirdropRegistration201Response</code> instance.
53
+ */
54
+ }, {
55
+ key: "constructFromObject",
56
+ value: function constructFromObject(data, obj) {
57
+ if (data) {
58
+ obj = obj || new CreateBabylonAirdropRegistration201Response();
59
+ if (data.hasOwnProperty('registration_id')) {
60
+ obj['registration_id'] = _ApiClient["default"].convertToType(data['registration_id'], 'String');
61
+ }
62
+ }
63
+ return obj;
64
+ }
65
+
66
+ /**
67
+ * Validates the JSON data with respect to <code>CreateBabylonAirdropRegistration201Response</code>.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateBabylonAirdropRegistration201Response</code>.
70
+ */
71
+ }, {
72
+ key: "validateJSON",
73
+ value: function validateJSON(data) {
74
+ // ensure the json data is a string
75
+ if (data['registration_id'] && !(typeof data['registration_id'] === 'string' || data['registration_id'] instanceof String)) {
76
+ throw new Error("Expected the field `registration_id` to be a primitive type in the JSON string but got " + data['registration_id']);
77
+ }
78
+ return true;
79
+ }
80
+ }]);
81
+ }();
82
+ /**
83
+ * The registration ID, a unique identifier for tracking the airdrop registration request. You can check the registration status with the [Get Babylon airdrop registration details](https://www.cobo.com/developers/v2/api-references/stakings/get_babylon_airdrop_registration_details) operation.
84
+ * @member {String} registration_id
85
+ */
86
+ CreateBabylonAirdropRegistration201Response.prototype['registration_id'] = undefined;
87
+ var _default = exports["default"] = CreateBabylonAirdropRegistration201Response;
@@ -0,0 +1,105 @@
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 _StakingSource = _interopRequireDefault(require("./StakingSource"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ 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); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Cobo Wallet as a Service 2.0
17
+ *
18
+ * Contact: help@cobo.com
19
+ *
20
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
21
+ * https://openapi-generator.tech
22
+ * Do not edit the class manually.
23
+ *
24
+ */
25
+ /**
26
+ * The CreateBabylonAirdropRegistrationRequest model module.
27
+ * @module model/CreateBabylonAirdropRegistrationRequest
28
+ */
29
+ var CreateBabylonAirdropRegistrationRequest = /*#__PURE__*/function () {
30
+ /**
31
+ * Constructs a new <code>CreateBabylonAirdropRegistrationRequest</code>.
32
+ * @alias module:model/CreateBabylonAirdropRegistrationRequest
33
+ */
34
+ function CreateBabylonAirdropRegistrationRequest() {
35
+ _classCallCheck(this, CreateBabylonAirdropRegistrationRequest);
36
+ CreateBabylonAirdropRegistrationRequest.initialize(this);
37
+ }
38
+
39
+ /**
40
+ * Initializes the fields of this object.
41
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
42
+ * Only for internal use.
43
+ */
44
+ return _createClass(CreateBabylonAirdropRegistrationRequest, null, [{
45
+ key: "initialize",
46
+ value: function initialize(obj) {}
47
+
48
+ /**
49
+ * Constructs a <code>CreateBabylonAirdropRegistrationRequest</code> from a plain JavaScript object, optionally creating a new instance.
50
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
51
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
52
+ * @param {module:model/CreateBabylonAirdropRegistrationRequest} obj Optional instance to populate.
53
+ * @return {module:model/CreateBabylonAirdropRegistrationRequest} The populated <code>CreateBabylonAirdropRegistrationRequest</code> instance.
54
+ */
55
+ }, {
56
+ key: "constructFromObject",
57
+ value: function constructFromObject(data, obj) {
58
+ if (data) {
59
+ obj = obj || new CreateBabylonAirdropRegistrationRequest();
60
+ if (data.hasOwnProperty('btc_address')) {
61
+ obj['btc_address'] = _StakingSource["default"].constructFromObject(data['btc_address']);
62
+ }
63
+ if (data.hasOwnProperty('babylon_address')) {
64
+ obj['babylon_address'] = _StakingSource["default"].constructFromObject(data['babylon_address']);
65
+ }
66
+ }
67
+ return obj;
68
+ }
69
+
70
+ /**
71
+ * Validates the JSON data with respect to <code>CreateBabylonAirdropRegistrationRequest</code>.
72
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
73
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateBabylonAirdropRegistrationRequest</code>.
74
+ */
75
+ }, {
76
+ key: "validateJSON",
77
+ value: function validateJSON(data) {
78
+ // validate the optional field `btc_address`
79
+ if (data['btc_address']) {
80
+ // data not null
81
+ if (!!_StakingSource["default"].validateJSON) {
82
+ _StakingSource["default"].validateJSON(data['btc_address']);
83
+ }
84
+ }
85
+ // validate the optional field `babylon_address`
86
+ if (data['babylon_address']) {
87
+ // data not null
88
+ if (!!_StakingSource["default"].validateJSON) {
89
+ _StakingSource["default"].validateJSON(data['babylon_address']);
90
+ }
91
+ }
92
+ return true;
93
+ }
94
+ }]);
95
+ }();
96
+ /**
97
+ * @member {module:model/StakingSource} btc_address
98
+ */
99
+ CreateBabylonAirdropRegistrationRequest.prototype['btc_address'] = undefined;
100
+
101
+ /**
102
+ * @member {module:model/StakingSource} babylon_address
103
+ */
104
+ CreateBabylonAirdropRegistrationRequest.prototype['babylon_address'] = undefined;
105
+ var _default = exports["default"] = CreateBabylonAirdropRegistrationRequest;
@@ -0,0 +1,87 @@
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
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ 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); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); } /**
15
+ * Cobo Wallet as a Service 2.0
16
+ *
17
+ * Contact: help@cobo.com
18
+ *
19
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
20
+ * https://openapi-generator.tech
21
+ * Do not edit the class manually.
22
+ *
23
+ */
24
+ /**
25
+ * The CreateBabylonStakingRegistration201Response model module.
26
+ * @module model/CreateBabylonStakingRegistration201Response
27
+ */
28
+ var CreateBabylonStakingRegistration201Response = /*#__PURE__*/function () {
29
+ /**
30
+ * Constructs a new <code>CreateBabylonStakingRegistration201Response</code>.
31
+ * @alias module:model/CreateBabylonStakingRegistration201Response
32
+ */
33
+ function CreateBabylonStakingRegistration201Response() {
34
+ _classCallCheck(this, CreateBabylonStakingRegistration201Response);
35
+ CreateBabylonStakingRegistration201Response.initialize(this);
36
+ }
37
+
38
+ /**
39
+ * Initializes the fields of this object.
40
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
41
+ * Only for internal use.
42
+ */
43
+ return _createClass(CreateBabylonStakingRegistration201Response, null, [{
44
+ key: "initialize",
45
+ value: function initialize(obj) {}
46
+
47
+ /**
48
+ * Constructs a <code>CreateBabylonStakingRegistration201Response</code> from a plain JavaScript object, optionally creating a new instance.
49
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
51
+ * @param {module:model/CreateBabylonStakingRegistration201Response} obj Optional instance to populate.
52
+ * @return {module:model/CreateBabylonStakingRegistration201Response} The populated <code>CreateBabylonStakingRegistration201Response</code> instance.
53
+ */
54
+ }, {
55
+ key: "constructFromObject",
56
+ value: function constructFromObject(data, obj) {
57
+ if (data) {
58
+ obj = obj || new CreateBabylonStakingRegistration201Response();
59
+ if (data.hasOwnProperty('registration_id')) {
60
+ obj['registration_id'] = _ApiClient["default"].convertToType(data['registration_id'], 'String');
61
+ }
62
+ }
63
+ return obj;
64
+ }
65
+
66
+ /**
67
+ * Validates the JSON data with respect to <code>CreateBabylonStakingRegistration201Response</code>.
68
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
69
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateBabylonStakingRegistration201Response</code>.
70
+ */
71
+ }, {
72
+ key: "validateJSON",
73
+ value: function validateJSON(data) {
74
+ // ensure the json data is a string
75
+ if (data['registration_id'] && !(typeof data['registration_id'] === 'string' || data['registration_id'] instanceof String)) {
76
+ throw new Error("Expected the field `registration_id` to be a primitive type in the JSON string but got " + data['registration_id']);
77
+ }
78
+ return true;
79
+ }
80
+ }]);
81
+ }();
82
+ /**
83
+ * The registration ID, a unique identifier for tracking the Babylon staking registration request. You can use it with the [Get Babylon staking registration details operation](https://www.cobo.com/developers/v2/api-references/stakings/get_babylon_staking_registration_details) to check the registration status.
84
+ * @member {String} registration_id
85
+ */
86
+ CreateBabylonStakingRegistration201Response.prototype['registration_id'] = undefined;
87
+ var _default = exports["default"] = CreateBabylonStakingRegistration201Response;
@@ -0,0 +1,103 @@
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 _StakingSource = _interopRequireDefault(require("./StakingSource"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ 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); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Cobo Wallet as a Service 2.0
17
+ *
18
+ * Contact: help@cobo.com
19
+ *
20
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
21
+ * https://openapi-generator.tech
22
+ * Do not edit the class manually.
23
+ *
24
+ */
25
+ /**
26
+ * The CreateBabylonStakingRegistrationRequest model module.
27
+ * @module model/CreateBabylonStakingRegistrationRequest
28
+ */
29
+ var CreateBabylonStakingRegistrationRequest = /*#__PURE__*/function () {
30
+ /**
31
+ * Constructs a new <code>CreateBabylonStakingRegistrationRequest</code>.
32
+ * @alias module:model/CreateBabylonStakingRegistrationRequest
33
+ */
34
+ function CreateBabylonStakingRegistrationRequest() {
35
+ _classCallCheck(this, CreateBabylonStakingRegistrationRequest);
36
+ CreateBabylonStakingRegistrationRequest.initialize(this);
37
+ }
38
+
39
+ /**
40
+ * Initializes the fields of this object.
41
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
42
+ * Only for internal use.
43
+ */
44
+ return _createClass(CreateBabylonStakingRegistrationRequest, null, [{
45
+ key: "initialize",
46
+ value: function initialize(obj) {}
47
+
48
+ /**
49
+ * Constructs a <code>CreateBabylonStakingRegistrationRequest</code> from a plain JavaScript object, optionally creating a new instance.
50
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
51
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
52
+ * @param {module:model/CreateBabylonStakingRegistrationRequest} obj Optional instance to populate.
53
+ * @return {module:model/CreateBabylonStakingRegistrationRequest} The populated <code>CreateBabylonStakingRegistrationRequest</code> instance.
54
+ */
55
+ }, {
56
+ key: "constructFromObject",
57
+ value: function constructFromObject(data, obj) {
58
+ if (data) {
59
+ obj = obj || new CreateBabylonStakingRegistrationRequest();
60
+ if (data.hasOwnProperty('staking_id')) {
61
+ obj['staking_id'] = _ApiClient["default"].convertToType(data['staking_id'], 'String');
62
+ }
63
+ if (data.hasOwnProperty('babylon_address')) {
64
+ obj['babylon_address'] = _StakingSource["default"].constructFromObject(data['babylon_address']);
65
+ }
66
+ }
67
+ return obj;
68
+ }
69
+
70
+ /**
71
+ * Validates the JSON data with respect to <code>CreateBabylonStakingRegistrationRequest</code>.
72
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
73
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateBabylonStakingRegistrationRequest</code>.
74
+ */
75
+ }, {
76
+ key: "validateJSON",
77
+ value: function validateJSON(data) {
78
+ // ensure the json data is a string
79
+ if (data['staking_id'] && !(typeof data['staking_id'] === 'string' || data['staking_id'] instanceof String)) {
80
+ throw new Error("Expected the field `staking_id` to be a primitive type in the JSON string but got " + data['staking_id']);
81
+ }
82
+ // validate the optional field `babylon_address`
83
+ if (data['babylon_address']) {
84
+ // data not null
85
+ if (!!_StakingSource["default"].validateJSON) {
86
+ _StakingSource["default"].validateJSON(data['babylon_address']);
87
+ }
88
+ }
89
+ return true;
90
+ }
91
+ }]);
92
+ }();
93
+ /**
94
+ * The ID of the Phase-1 BTC staking position.
95
+ * @member {String} staking_id
96
+ */
97
+ CreateBabylonStakingRegistrationRequest.prototype['staking_id'] = undefined;
98
+
99
+ /**
100
+ * @member {module:model/StakingSource} babylon_address
101
+ */
102
+ CreateBabylonStakingRegistrationRequest.prototype['babylon_address'] = undefined;
103
+ var _default = exports["default"] = CreateBabylonStakingRegistrationRequest;