@cobo/cobo-waas2 1.4.0 → 1.5.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 (106) hide show
  1. package/README.md +19 -8
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/AddressBooksApi.js +105 -0
  4. package/dist/api/DevelopersWebhooksApi.js +43 -0
  5. package/dist/api/OAuthApi.js +6 -6
  6. package/dist/api/TransactionsApi.js +12 -12
  7. package/dist/api/WalletsApi.js +2 -2
  8. package/dist/api/WalletsExchangeWalletApi.js +4 -4
  9. package/dist/api/WalletsMPCWalletsApi.js +8 -8
  10. package/dist/api/WalletsSmartContractWalletsApi.js +93 -0
  11. package/dist/index.js +101 -31
  12. package/dist/model/AddressBook.js +25 -10
  13. package/dist/model/AddressTransferDestination.js +2 -2
  14. package/dist/model/ApiLogDetails.js +238 -0
  15. package/dist/model/ApiLogSummary.js +161 -0
  16. package/dist/model/CheckLoopTransfers200ResponseInner.js +1 -1
  17. package/dist/model/CoboSafeDelegate.js +2 -2
  18. package/dist/model/ErrorResponse.js +2 -2
  19. package/dist/model/EstimateContractCallFeeParams.js +2 -2
  20. package/dist/model/EstimateFeeParams.js +1 -1
  21. package/dist/model/EstimateTransferFeeParams.js +2 -2
  22. package/dist/model/EstimatedFee.js +1 -1
  23. package/dist/model/EstimatedFixedFee.js +1 -1
  24. package/dist/model/ExchangeId.js +10 -0
  25. package/dist/model/ExtendedTokenInfo.js +17 -4
  26. package/dist/model/ListAddressBooks200Response.js +123 -0
  27. package/dist/model/MPCDelegate.js +4 -4
  28. package/dist/model/{RefreshToken200Response.js → RefreshToken201Response.js} +21 -21
  29. package/dist/model/SafeWalletDelegates.js +210 -0
  30. package/dist/model/{BookkeepingSummary.js → SafeWalletDelegatesContractCall.js} +47 -52
  31. package/dist/model/{WalletBalanceSnapshotRecord.js → SafeWalletDelegatesTransfer.js} +47 -63
  32. package/dist/model/TokenAssetModelType.js +61 -0
  33. package/dist/model/TokenBalanceBalance.js +6 -6
  34. package/dist/model/TokenInfo.js +11 -2
  35. package/dist/model/Transaction.js +1 -1
  36. package/dist/model/TransactionDestination.js +50 -10
  37. package/dist/model/TransactionDestinationType.js +5 -0
  38. package/dist/model/TransactionDetail.js +2 -2
  39. package/dist/model/TransactionDetails.js +2 -2
  40. package/dist/model/TransactionEvmCalldataInfo.js +177 -0
  41. package/dist/model/TransactionEvmContractDestination.js +16 -0
  42. package/dist/model/TransactionEvmContractMethod.js +136 -0
  43. package/dist/model/TransactionRawMessageSignDestination.js +120 -0
  44. package/dist/model/TransactionSmartContractSafeWalletSource.js +4 -6
  45. package/dist/model/TransactionTokeApproval.js +17 -4
  46. package/dist/model/TransactionTransferToAddressDestination.js +2 -2
  47. package/dist/model/TransactionWebhookEventData.js +2 -2
  48. package/dist/model/TransferDestination.js +2 -2
  49. package/dist/model/TriggerTestWebhookEvent201Response.js +83 -0
  50. package/dist/model/{WalletBalanceSnapshot.js → TriggerTestWebhookEventRequest.js} +31 -36
  51. package/dist/model/WebhookEventData.js +1 -1
  52. package/docs/AddressBook.md +8 -7
  53. package/docs/AddressBooksApi.md +71 -0
  54. package/docs/AddressTransferDestination.md +2 -2
  55. package/docs/ApiLogDetails.md +18 -0
  56. package/docs/ApiLogSummary.md +13 -0
  57. package/docs/CheckLoopTransfers200ResponseInner.md +1 -1
  58. package/docs/CoboSafeDelegate.md +2 -2
  59. package/docs/DevelopersWebhooksApi.md +53 -0
  60. package/docs/ErrorResponse.md +1 -1
  61. package/docs/EstimateContractCallFeeParams.md +1 -1
  62. package/docs/EstimateFeeParams.md +1 -1
  63. package/docs/EstimateTransferFeeParams.md +1 -1
  64. package/docs/EstimatedFee.md +1 -1
  65. package/docs/EstimatedFixedFee.md +1 -1
  66. package/docs/ExchangeId.md +4 -0
  67. package/docs/ExtendedTokenInfo.md +3 -2
  68. package/docs/ListAddressBooks200Response.md +10 -0
  69. package/docs/MPCDelegate.md +2 -2
  70. package/docs/OAuthApi.md +3 -3
  71. package/docs/{RefreshToken200Response.md → RefreshToken201Response.md} +1 -1
  72. package/docs/SafeWalletDelegates.md +14 -0
  73. package/docs/SafeWalletDelegatesContractCall.md +12 -0
  74. package/docs/SafeWalletDelegatesTransfer.md +12 -0
  75. package/docs/TokenAssetModelType.md +12 -0
  76. package/docs/TokenBalanceBalance.md +4 -4
  77. package/docs/TokenInfo.md +3 -2
  78. package/docs/Transaction.md +1 -1
  79. package/docs/TransactionDestination.md +4 -2
  80. package/docs/TransactionDestinationType.md +2 -0
  81. package/docs/TransactionDetail.md +1 -1
  82. package/docs/TransactionDetails.md +1 -1
  83. package/docs/TransactionEvmCalldataInfo.md +16 -0
  84. package/docs/TransactionEvmContractDestination.md +1 -0
  85. package/docs/TransactionEvmContractMethod.md +13 -0
  86. package/docs/TransactionRawMessageSignDestination.md +10 -0
  87. package/docs/TransactionSmartContractSafeWalletSource.md +1 -1
  88. package/docs/TransactionSource.md +1 -1
  89. package/docs/TransactionTokeApproval.md +3 -2
  90. package/docs/TransactionTransferToAddressDestination.md +2 -2
  91. package/docs/TransactionWebhookEventData.md +1 -1
  92. package/docs/TransactionsApi.md +7 -7
  93. package/docs/TransferDestination.md +2 -2
  94. package/docs/TriggerTestWebhookEvent201Response.md +9 -0
  95. package/docs/TriggerTestWebhookEventRequest.md +10 -0
  96. package/docs/WalletsApi.md +1 -1
  97. package/docs/WalletsExchangeWalletApi.md +2 -2
  98. package/docs/WalletsMPCWalletsApi.md +4 -4
  99. package/docs/WalletsSmartContractWalletsApi.md +63 -0
  100. package/docs/WebhookEventData.md +1 -1
  101. package/package.json +2 -2
  102. package/dist/model/BookkeepingRecord.js +0 -243
  103. package/docs/BookkeepingRecord.md +0 -19
  104. package/docs/BookkeepingSummary.md +0 -12
  105. package/docs/WalletBalanceSnapshot.md +0 -10
  106. package/docs/WalletBalanceSnapshotRecord.md +0 -13
@@ -0,0 +1,177 @@
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 _TransactionEvmContractMethod = _interopRequireDefault(require("./TransactionEvmContractMethod"));
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 TransactionEvmCalldataInfo model module.
27
+ * @module model/TransactionEvmCalldataInfo
28
+ */
29
+ var TransactionEvmCalldataInfo = /*#__PURE__*/function () {
30
+ /**
31
+ * Constructs a new <code>TransactionEvmCalldataInfo</code>.
32
+ * @alias module:model/TransactionEvmCalldataInfo
33
+ */
34
+ function TransactionEvmCalldataInfo() {
35
+ _classCallCheck(this, TransactionEvmCalldataInfo);
36
+ TransactionEvmCalldataInfo.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(TransactionEvmCalldataInfo, null, [{
45
+ key: "initialize",
46
+ value: function initialize(obj) {}
47
+
48
+ /**
49
+ * Constructs a <code>TransactionEvmCalldataInfo</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/TransactionEvmCalldataInfo} obj Optional instance to populate.
53
+ * @return {module:model/TransactionEvmCalldataInfo} The populated <code>TransactionEvmCalldataInfo</code> instance.
54
+ */
55
+ }, {
56
+ key: "constructFromObject",
57
+ value: function constructFromObject(data, obj) {
58
+ if (data) {
59
+ obj = obj || new TransactionEvmCalldataInfo();
60
+ if (data.hasOwnProperty('chain_id')) {
61
+ obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
62
+ }
63
+ if (data.hasOwnProperty('address')) {
64
+ obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('name')) {
67
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('impl_address')) {
70
+ obj['impl_address'] = _ApiClient["default"].convertToType(data['impl_address'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('impl_name')) {
73
+ obj['impl_name'] = _ApiClient["default"].convertToType(data['impl_name'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('proxy')) {
76
+ obj['proxy'] = _ApiClient["default"].convertToType(data['proxy'], 'Boolean');
77
+ }
78
+ if (data.hasOwnProperty('method')) {
79
+ obj['method'] = _TransactionEvmContractMethod["default"].constructFromObject(data['method']);
80
+ }
81
+ if (data.hasOwnProperty('params')) {
82
+ obj['params'] = _ApiClient["default"].convertToType(data['params'], 'String');
83
+ }
84
+ }
85
+ return obj;
86
+ }
87
+
88
+ /**
89
+ * Validates the JSON data with respect to <code>TransactionEvmCalldataInfo</code>.
90
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
91
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionEvmCalldataInfo</code>.
92
+ */
93
+ }, {
94
+ key: "validateJSON",
95
+ value: function validateJSON(data) {
96
+ // ensure the json data is a string
97
+ if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
98
+ throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
99
+ }
100
+ // ensure the json data is a string
101
+ if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
102
+ throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
103
+ }
104
+ // ensure the json data is a string
105
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
106
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
107
+ }
108
+ // ensure the json data is a string
109
+ if (data['impl_address'] && !(typeof data['impl_address'] === 'string' || data['impl_address'] instanceof String)) {
110
+ throw new Error("Expected the field `impl_address` to be a primitive type in the JSON string but got " + data['impl_address']);
111
+ }
112
+ // ensure the json data is a string
113
+ if (data['impl_name'] && !(typeof data['impl_name'] === 'string' || data['impl_name'] instanceof String)) {
114
+ throw new Error("Expected the field `impl_name` to be a primitive type in the JSON string but got " + data['impl_name']);
115
+ }
116
+ // validate the optional field `method`
117
+ if (data['method']) {
118
+ // data not null
119
+ if (!!_TransactionEvmContractMethod["default"].validateJSON) {
120
+ _TransactionEvmContractMethod["default"].validateJSON(data['method']);
121
+ }
122
+ }
123
+ // ensure the json data is a string
124
+ if (data['params'] && !(typeof data['params'] === 'string' || data['params'] instanceof String)) {
125
+ throw new Error("Expected the field `params` to be a primitive type in the JSON string but got " + data['params']);
126
+ }
127
+ return true;
128
+ }
129
+ }]);
130
+ }();
131
+ /**
132
+ * The ID of the chain on which the smart contract is deployed.
133
+ * @member {String} chain_id
134
+ */
135
+ TransactionEvmCalldataInfo.prototype['chain_id'] = undefined;
136
+
137
+ /**
138
+ * The address of the smart contract.
139
+ * @member {String} address
140
+ */
141
+ TransactionEvmCalldataInfo.prototype['address'] = undefined;
142
+
143
+ /**
144
+ * The name of the smart contract.
145
+ * @member {String} name
146
+ */
147
+ TransactionEvmCalldataInfo.prototype['name'] = undefined;
148
+
149
+ /**
150
+ * The address of the implementation smart contract. This property is applicable only when the specified smart contract is a proxy contract.
151
+ * @member {String} impl_address
152
+ */
153
+ TransactionEvmCalldataInfo.prototype['impl_address'] = undefined;
154
+
155
+ /**
156
+ * The name of the implementation smart contract. This property is applicable only when the specified smart contract is a proxy contract.
157
+ * @member {String} impl_name
158
+ */
159
+ TransactionEvmCalldataInfo.prototype['impl_name'] = undefined;
160
+
161
+ /**
162
+ * Whether the specified smart contract address is a proxy contract. - `true`: The specified smart contract address is a proxy contract. - `false`: The specified smart contract address is not a proxy contract.
163
+ * @member {Boolean} proxy
164
+ */
165
+ TransactionEvmCalldataInfo.prototype['proxy'] = undefined;
166
+
167
+ /**
168
+ * @member {module:model/TransactionEvmContractMethod} method
169
+ */
170
+ TransactionEvmCalldataInfo.prototype['method'] = undefined;
171
+
172
+ /**
173
+ * The parameters of the contract method are represented as a JSON array of arrays. Each element in the outer array is itself an array containing three elements that provide detailed information about a specific parameter: - Parameter name: The unique identifier of the parameter, such as `kind`, `swaps`, and `to`. - Parameter type: The Solidity data type of the parameter, such as `uint8`, `tuple[]`, `address[]`, and `int256[]`. - Parameter value: The actual value of the parameter. If the parameter type is a basic type such as `uint256` or `address`, this value is a single element. If the parameter type is a complex type such as `tuple[]` or `address[]`, the value is a nested array, with each inner array containing parameter names, types, and values.
174
+ * @member {String} params
175
+ */
176
+ TransactionEvmCalldataInfo.prototype['params'] = undefined;
177
+ var _default = exports["default"] = TransactionEvmCalldataInfo;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _TransactionDestinationType = _interopRequireDefault(require("./TransactionDestinationType"));
9
+ var _TransactionEvmCalldataInfo = _interopRequireDefault(require("./TransactionEvmCalldataInfo"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
11
12
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
@@ -80,6 +81,9 @@ var TransactionEvmContractDestination = /*#__PURE__*/function () {
80
81
  if (data.hasOwnProperty('calldata')) {
81
82
  obj['calldata'] = _ApiClient["default"].convertToType(data['calldata'], 'String');
82
83
  }
84
+ if (data.hasOwnProperty('calldata_info')) {
85
+ obj['calldata_info'] = _TransactionEvmCalldataInfo["default"].constructFromObject(data['calldata_info']);
86
+ }
83
87
  }
84
88
  return obj;
85
89
  }
@@ -119,6 +123,13 @@ var TransactionEvmContractDestination = /*#__PURE__*/function () {
119
123
  if (data['calldata'] && !(typeof data['calldata'] === 'string' || data['calldata'] instanceof String)) {
120
124
  throw new Error("Expected the field `calldata` to be a primitive type in the JSON string but got " + data['calldata']);
121
125
  }
126
+ // validate the optional field `calldata_info`
127
+ if (data['calldata_info']) {
128
+ // data not null
129
+ if (!!_TransactionEvmCalldataInfo["default"].validateJSON) {
130
+ _TransactionEvmCalldataInfo["default"].validateJSON(data['calldata_info']);
131
+ }
132
+ }
122
133
  return true;
123
134
  }
124
135
  }]);
@@ -147,4 +158,9 @@ TransactionEvmContractDestination.prototype['value'] = undefined;
147
158
  * @member {String} calldata
148
159
  */
149
160
  TransactionEvmContractDestination.prototype['calldata'] = undefined;
161
+
162
+ /**
163
+ * @member {module:model/TransactionEvmCalldataInfo} calldata_info
164
+ */
165
+ TransactionEvmContractDestination.prototype['calldata_info'] = undefined;
150
166
  var _default = exports["default"] = TransactionEvmContractDestination;
@@ -0,0 +1,136 @@
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 TransactionEvmContractMethod model module.
26
+ * @module model/TransactionEvmContractMethod
27
+ */
28
+ var TransactionEvmContractMethod = /*#__PURE__*/function () {
29
+ /**
30
+ * Constructs a new <code>TransactionEvmContractMethod</code>.
31
+ * The information about a method in a smart contract.
32
+ * @alias module:model/TransactionEvmContractMethod
33
+ */
34
+ function TransactionEvmContractMethod() {
35
+ _classCallCheck(this, TransactionEvmContractMethod);
36
+ TransactionEvmContractMethod.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(TransactionEvmContractMethod, null, [{
45
+ key: "initialize",
46
+ value: function initialize(obj) {}
47
+
48
+ /**
49
+ * Constructs a <code>TransactionEvmContractMethod</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/TransactionEvmContractMethod} obj Optional instance to populate.
53
+ * @return {module:model/TransactionEvmContractMethod} The populated <code>TransactionEvmContractMethod</code> instance.
54
+ */
55
+ }, {
56
+ key: "constructFromObject",
57
+ value: function constructFromObject(data, obj) {
58
+ if (data) {
59
+ obj = obj || new TransactionEvmContractMethod();
60
+ if (data.hasOwnProperty('name')) {
61
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
62
+ }
63
+ if (data.hasOwnProperty('sig')) {
64
+ obj['sig'] = _ApiClient["default"].convertToType(data['sig'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('type')) {
67
+ obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
68
+ }
69
+ if (data.hasOwnProperty('payable')) {
70
+ obj['payable'] = _ApiClient["default"].convertToType(data['payable'], 'Boolean');
71
+ }
72
+ if (data.hasOwnProperty('selector')) {
73
+ obj['selector'] = _ApiClient["default"].convertToType(data['selector'], 'String');
74
+ }
75
+ }
76
+ return obj;
77
+ }
78
+
79
+ /**
80
+ * Validates the JSON data with respect to <code>TransactionEvmContractMethod</code>.
81
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
82
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionEvmContractMethod</code>.
83
+ */
84
+ }, {
85
+ key: "validateJSON",
86
+ value: function validateJSON(data) {
87
+ // ensure the json data is a string
88
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
89
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
90
+ }
91
+ // ensure the json data is a string
92
+ if (data['sig'] && !(typeof data['sig'] === 'string' || data['sig'] instanceof String)) {
93
+ throw new Error("Expected the field `sig` to be a primitive type in the JSON string but got " + data['sig']);
94
+ }
95
+ // ensure the json data is a string
96
+ if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
97
+ throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
98
+ }
99
+ // ensure the json data is a string
100
+ if (data['selector'] && !(typeof data['selector'] === 'string' || data['selector'] instanceof String)) {
101
+ throw new Error("Expected the field `selector` to be a primitive type in the JSON string but got " + data['selector']);
102
+ }
103
+ return true;
104
+ }
105
+ }]);
106
+ }();
107
+ /**
108
+ * The method name.
109
+ * @member {String} name
110
+ */
111
+ TransactionEvmContractMethod.prototype['name'] = undefined;
112
+
113
+ /**
114
+ * The signature of the method, which includes the method name and parameter types.
115
+ * @member {String} sig
116
+ */
117
+ TransactionEvmContractMethod.prototype['sig'] = undefined;
118
+
119
+ /**
120
+ * The method type.
121
+ * @member {String} type
122
+ */
123
+ TransactionEvmContractMethod.prototype['type'] = undefined;
124
+
125
+ /**
126
+ * Whether the method is payable, which means it can receive tokens along with the transaction. - `true`: The method is payable. - `false`: The method is not payable.
127
+ * @member {Boolean} payable
128
+ */
129
+ TransactionEvmContractMethod.prototype['payable'] = undefined;
130
+
131
+ /**
132
+ * The method selector, a four-byte identifier derived from the method's signature, used to invoke the method in a transaction.
133
+ * @member {String} selector
134
+ */
135
+ TransactionEvmContractMethod.prototype['selector'] = undefined;
136
+ var _default = exports["default"] = TransactionEvmContractMethod;
@@ -0,0 +1,120 @@
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 _TransactionDestinationType = _interopRequireDefault(require("./TransactionDestinationType"));
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ 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); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The TransactionRawMessageSignDestination model module.
30
+ * @module model/TransactionRawMessageSignDestination
31
+ */
32
+ var TransactionRawMessageSignDestination = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>TransactionRawMessageSignDestination</code>.
35
+ * The information about the destination &#x60;Raw_Message_Signature&#x60;. Refer to [Transaction sources and destinations](/v2/guides/transactions/sources-and-destinations) for a detailed introduction about the supported sources and destinations for each transaction type. Switch between the tabs to display the properties for different transaction destinations.
36
+ * @alias module:model/TransactionRawMessageSignDestination
37
+ * @param destination_type {module:model/TransactionDestinationType}
38
+ */
39
+ function TransactionRawMessageSignDestination(destination_type) {
40
+ _classCallCheck(this, TransactionRawMessageSignDestination);
41
+ TransactionRawMessageSignDestination.initialize(this, destination_type);
42
+ }
43
+
44
+ /**
45
+ * Initializes the fields of this object.
46
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47
+ * Only for internal use.
48
+ */
49
+ return _createClass(TransactionRawMessageSignDestination, null, [{
50
+ key: "initialize",
51
+ value: function initialize(obj, destination_type) {
52
+ obj['destination_type'] = destination_type;
53
+ }
54
+
55
+ /**
56
+ * Constructs a <code>TransactionRawMessageSignDestination</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/TransactionRawMessageSignDestination} obj Optional instance to populate.
60
+ * @return {module:model/TransactionRawMessageSignDestination} The populated <code>TransactionRawMessageSignDestination</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new TransactionRawMessageSignDestination();
67
+ if (data.hasOwnProperty('destination_type')) {
68
+ obj['destination_type'] = _TransactionDestinationType["default"].constructFromObject(data['destination_type']);
69
+ }
70
+ if (data.hasOwnProperty('msg_hash')) {
71
+ obj['msg_hash'] = _ApiClient["default"].convertToType(data['msg_hash'], 'String');
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>TransactionRawMessageSignDestination</code>.
79
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
80
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionRawMessageSignDestination</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ // check to make sure all required properties are present in the JSON string
86
+ var _iterator = _createForOfIteratorHelper(TransactionRawMessageSignDestination.RequiredProperties),
87
+ _step;
88
+ try {
89
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
+ var property = _step.value;
91
+ if (!data.hasOwnProperty(property)) {
92
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
93
+ }
94
+ }
95
+ // ensure the json data is a string
96
+ } catch (err) {
97
+ _iterator.e(err);
98
+ } finally {
99
+ _iterator.f();
100
+ }
101
+ if (data['msg_hash'] && !(typeof data['msg_hash'] === 'string' || data['msg_hash'] instanceof String)) {
102
+ throw new Error("Expected the field `msg_hash` to be a primitive type in the JSON string but got " + data['msg_hash']);
103
+ }
104
+ return true;
105
+ }
106
+ }]);
107
+ }();
108
+ TransactionRawMessageSignDestination.RequiredProperties = ["destination_type"];
109
+
110
+ /**
111
+ * @member {module:model/TransactionDestinationType} destination_type
112
+ */
113
+ TransactionRawMessageSignDestination.prototype['destination_type'] = undefined;
114
+
115
+ /**
116
+ * Message hash to be signed, in hexadecimal format.
117
+ * @member {String} msg_hash
118
+ */
119
+ TransactionRawMessageSignDestination.prototype['msg_hash'] = undefined;
120
+ var _default = exports["default"] = TransactionRawMessageSignDestination;
@@ -38,11 +38,10 @@ var TransactionSmartContractSafeWalletSource = /*#__PURE__*/function () {
38
38
  * @param source_type {module:model/TransactionSourceType}
39
39
  * @param wallet_id {String} The wallet ID.
40
40
  * @param address {String} The wallet address.
41
- * @param delegate {module:model/CoboSafeDelegate}
42
41
  */
43
- function TransactionSmartContractSafeWalletSource(source_type, wallet_id, address, delegate) {
42
+ function TransactionSmartContractSafeWalletSource(source_type, wallet_id, address) {
44
43
  _classCallCheck(this, TransactionSmartContractSafeWalletSource);
45
- TransactionSmartContractSafeWalletSource.initialize(this, source_type, wallet_id, address, delegate);
44
+ TransactionSmartContractSafeWalletSource.initialize(this, source_type, wallet_id, address);
46
45
  }
47
46
 
48
47
  /**
@@ -52,11 +51,10 @@ var TransactionSmartContractSafeWalletSource = /*#__PURE__*/function () {
52
51
  */
53
52
  return _createClass(TransactionSmartContractSafeWalletSource, null, [{
54
53
  key: "initialize",
55
- value: function initialize(obj, source_type, wallet_id, address, delegate) {
54
+ value: function initialize(obj, source_type, wallet_id, address) {
56
55
  obj['source_type'] = source_type;
57
56
  obj['wallet_id'] = wallet_id;
58
57
  obj['address'] = address;
59
- obj['delegate'] = delegate;
60
58
  }
61
59
 
62
60
  /**
@@ -129,7 +127,7 @@ var TransactionSmartContractSafeWalletSource = /*#__PURE__*/function () {
129
127
  }
130
128
  }]);
131
129
  }();
132
- TransactionSmartContractSafeWalletSource.RequiredProperties = ["source_type", "wallet_id", "address", "delegate"];
130
+ TransactionSmartContractSafeWalletSource.RequiredProperties = ["source_type", "wallet_id", "address"];
133
131
 
134
132
  /**
135
133
  * @member {module:model/TransactionSourceType} source_type
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _TokenAssetModelType = _interopRequireDefault(require("./TokenAssetModelType"));
8
9
  var _TokenInfo = _interopRequireDefault(require("./TokenInfo"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
@@ -107,6 +108,9 @@ var TransactionTokeApproval = /*#__PURE__*/function () {
107
108
  if (data.hasOwnProperty('custodial_minimum_deposit_threshold')) {
108
109
  obj['custodial_minimum_deposit_threshold'] = _ApiClient["default"].convertToType(data['custodial_minimum_deposit_threshold'], 'String');
109
110
  }
111
+ if (data.hasOwnProperty('asset_model_type')) {
112
+ obj['asset_model_type'] = _TokenAssetModelType["default"].constructFromObject(data['asset_model_type']);
113
+ }
110
114
  if (data.hasOwnProperty('amount')) {
111
115
  obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'Number');
112
116
  }
@@ -257,17 +261,22 @@ TransactionTokeApproval.prototype['can_deposit'] = undefined;
257
261
  TransactionTokeApproval.prototype['can_withdraw'] = undefined;
258
262
 
259
263
  /**
260
- * The minimum withdrawal amount for Custodial Wallets. If your withdrawal amount is smaller than this threshold, the withdrawal request will receive an error. Note: [Loop transfers](https://loop.top/) do not have this limitation.
264
+ * The minimum withdrawal amount for Custodial Wallets. If your withdrawal amount is smaller than this threshold, the withdrawal request will receive an error. Note: [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfers do not have this limitation.
261
265
  * @member {String} dust_threshold
262
266
  */
263
267
  TransactionTokeApproval.prototype['dust_threshold'] = undefined;
264
268
 
265
269
  /**
266
- * The minimum deposit amount for Custodial Wallets. If the amount you deposit to a Custodial Wallet is smaller than this threshold, the deposit will not show up on Cobo Portal or trigger any webhook events. Note: [Loop transfers](https://loop.top/) do not have this limitation.
270
+ * The minimum deposit amount for Custodial Wallets. If the amount you deposit to a Custodial Wallet is smaller than this threshold, the deposit will not show up on Cobo Portal or trigger any webhook events. Note: [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop)transfers do not have this limitation.
267
271
  * @member {String} custodial_minimum_deposit_threshold
268
272
  */
269
273
  TransactionTokeApproval.prototype['custodial_minimum_deposit_threshold'] = undefined;
270
274
 
275
+ /**
276
+ * @member {module:model/TokenAssetModelType} asset_model_type
277
+ */
278
+ TransactionTokeApproval.prototype['asset_model_type'] = undefined;
279
+
271
280
  /**
272
281
  * Transaction value (Note that this is an absolute value. If you trade 1.5 BTC, then the value is 1.5)
273
282
  * @member {Number} amount
@@ -337,13 +346,17 @@ _TokenInfo["default"].prototype['can_deposit'] = undefined;
337
346
  */
338
347
  _TokenInfo["default"].prototype['can_withdraw'] = undefined;
339
348
  /**
340
- * The minimum withdrawal amount for Custodial Wallets. If your withdrawal amount is smaller than this threshold, the withdrawal request will receive an error. Note: [Loop transfers](https://loop.top/) do not have this limitation.
349
+ * The minimum withdrawal amount for Custodial Wallets. If your withdrawal amount is smaller than this threshold, the withdrawal request will receive an error. Note: [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfers do not have this limitation.
341
350
  * @member {String} dust_threshold
342
351
  */
343
352
  _TokenInfo["default"].prototype['dust_threshold'] = undefined;
344
353
  /**
345
- * The minimum deposit amount for Custodial Wallets. If the amount you deposit to a Custodial Wallet is smaller than this threshold, the deposit will not show up on Cobo Portal or trigger any webhook events. Note: [Loop transfers](https://loop.top/) do not have this limitation.
354
+ * The minimum deposit amount for Custodial Wallets. If the amount you deposit to a Custodial Wallet is smaller than this threshold, the deposit will not show up on Cobo Portal or trigger any webhook events. Note: [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop)transfers do not have this limitation.
346
355
  * @member {String} custodial_minimum_deposit_threshold
347
356
  */
348
357
  _TokenInfo["default"].prototype['custodial_minimum_deposit_threshold'] = undefined;
358
+ /**
359
+ * @member {module:model/TokenAssetModelType} asset_model_type
360
+ */
361
+ _TokenInfo["default"].prototype['asset_model_type'] = undefined;
349
362
  var _default = exports["default"] = TransactionTokeApproval;
@@ -171,13 +171,13 @@ TransactionTransferToAddressDestination.prototype['utxo_outputs'] = undefined;
171
171
  TransactionTransferToAddressDestination.prototype['change_address'] = undefined;
172
172
 
173
173
  /**
174
- * Whether the transaction request must be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must be executed as a Loop transfer. - `false`: The transaction request may not be executed as a Loop transfer.
174
+ * Whether the transaction request must be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must be executed as a Cobo Loop transfer. - `false`: The transaction request may not be executed as a Cobo Loop transfer.
175
175
  * @member {Boolean} force_internal
176
176
  */
177
177
  TransactionTransferToAddressDestination.prototype['force_internal'] = undefined;
178
178
 
179
179
  /**
180
- * Whether the transaction request must not be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must not be executed as a Loop transfer. - `false`: The transaction request can be executed as a Loop transfer.
180
+ * Whether the transaction request must not be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must not be executed as a Cobo Loop transfer. - `false`: The transaction request can be executed as a Cobo Loop transfer.
181
181
  * @member {Boolean} force_external
182
182
  */
183
183
  TransactionTransferToAddressDestination.prototype['force_external'] = undefined;
@@ -460,7 +460,7 @@ TransactionWebhookEventData.prototype['category'] = undefined;
460
460
  TransactionWebhookEventData.prototype['description'] = undefined;
461
461
 
462
462
  /**
463
- * Whether the transaction is a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction is a Loop transfer. - `false`: The transaction is not a Loop transfer.
463
+ * Whether the transaction was executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction was executed as a Cobo Loop transfer. - `false`: The transaction was not executed as a Cobo Loop transfer.
464
464
  * @member {Boolean} is_loop
465
465
  */
466
466
  TransactionWebhookEventData.prototype['is_loop'] = undefined;
@@ -599,7 +599,7 @@ _Transaction["default"].prototype['category'] = undefined;
599
599
  */
600
600
  _Transaction["default"].prototype['description'] = undefined;
601
601
  /**
602
- * Whether the transaction is a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction is a Loop transfer. - `false`: The transaction is not a Loop transfer.
602
+ * Whether the transaction was executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction was executed as a Cobo Loop transfer. - `false`: The transaction was not executed as a Cobo Loop transfer.
603
603
  * @member {Boolean} is_loop
604
604
  */
605
605
  _Transaction["default"].prototype['is_loop'] = undefined;
@@ -196,13 +196,13 @@ TransferDestination.prototype['utxo_outputs'] = undefined;
196
196
  TransferDestination.prototype['change_address'] = undefined;
197
197
 
198
198
  /**
199
- * Whether the transaction request must be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must be executed as a Loop transfer. - `false`: The transaction request may not be executed as a Loop transfer. Please do not set both `force_internal` and `force_internal` as `true`.
199
+ * Whether the transaction request must be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must be executed as a Cobo Loop transfer. - `false`: The transaction request may not be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_internal` as `true`.
200
200
  * @member {Boolean} force_internal
201
201
  */
202
202
  TransferDestination.prototype['force_internal'] = undefined;
203
203
 
204
204
  /**
205
- * Whether the transaction request must not be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must not be executed as a Loop transfer. - `false`: The transaction request can be executed as a Loop transfer. Please do not set both `force_internal` and `force_internal` as `true`.
205
+ * Whether the transaction request must not be executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction request must not be executed as a Cobo Loop transfer. - `false`: The transaction request can be executed as a Cobo Loop transfer. Please do not set both `force_internal` and `force_internal` as `true`.
206
206
  * @member {Boolean} force_external
207
207
  */
208
208
  TransferDestination.prototype['force_external'] = undefined;