@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
@@ -1,243 +0,0 @@
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 _WalletType = _interopRequireDefault(require("./WalletType"));
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 BookkeepingRecord model module.
30
- * @module model/BookkeepingRecord
31
- */
32
- var BookkeepingRecord = /*#__PURE__*/function () {
33
- /**
34
- * Constructs a new <code>BookkeepingRecord</code>.
35
- * The bookkeeping item information.
36
- * @alias module:model/BookkeepingRecord
37
- * @param wallet_id {String} The wallet ID.
38
- * @param transaction_timestamp {Number} The time when the bookkeeping was created, in Unix timestamp format, measured in milliseconds.
39
- * @param token_id {String} The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
40
- * @param type {String} The bookkeeping type.
41
- * @param amount {String} The amount of the bookkeeping.
42
- * @param balance {String} The post-balance of the tx.
43
- */
44
- function BookkeepingRecord(wallet_id, transaction_timestamp, token_id, type, amount, balance) {
45
- _classCallCheck(this, BookkeepingRecord);
46
- BookkeepingRecord.initialize(this, wallet_id, transaction_timestamp, token_id, type, amount, balance);
47
- }
48
-
49
- /**
50
- * Initializes the fields of this object.
51
- * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
52
- * Only for internal use.
53
- */
54
- return _createClass(BookkeepingRecord, null, [{
55
- key: "initialize",
56
- value: function initialize(obj, wallet_id, transaction_timestamp, token_id, type, amount, balance) {
57
- obj['wallet_id'] = wallet_id;
58
- obj['transaction_timestamp'] = transaction_timestamp;
59
- obj['token_id'] = token_id;
60
- obj['type'] = type;
61
- obj['amount'] = amount;
62
- obj['balance'] = balance;
63
- }
64
-
65
- /**
66
- * Constructs a <code>BookkeepingRecord</code> from a plain JavaScript object, optionally creating a new instance.
67
- * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
68
- * @param {Object} data The plain JavaScript object bearing properties of interest.
69
- * @param {module:model/BookkeepingRecord} obj Optional instance to populate.
70
- * @return {module:model/BookkeepingRecord} The populated <code>BookkeepingRecord</code> instance.
71
- */
72
- }, {
73
- key: "constructFromObject",
74
- value: function constructFromObject(data, obj) {
75
- if (data) {
76
- obj = obj || new BookkeepingRecord();
77
- if (data.hasOwnProperty('wallet_id')) {
78
- obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
79
- }
80
- if (data.hasOwnProperty('wallet_type')) {
81
- obj['wallet_type'] = _WalletType["default"].constructFromObject(data['wallet_type']);
82
- }
83
- if (data.hasOwnProperty('wallet_name')) {
84
- obj['wallet_name'] = _ApiClient["default"].convertToType(data['wallet_name'], 'String');
85
- }
86
- if (data.hasOwnProperty('transaction_timestamp')) {
87
- obj['transaction_timestamp'] = _ApiClient["default"].convertToType(data['transaction_timestamp'], 'Number');
88
- }
89
- if (data.hasOwnProperty('token_id')) {
90
- obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
91
- }
92
- if (data.hasOwnProperty('type')) {
93
- obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
94
- }
95
- if (data.hasOwnProperty('amount')) {
96
- obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
97
- }
98
- if (data.hasOwnProperty('balance')) {
99
- obj['balance'] = _ApiClient["default"].convertToType(data['balance'], 'String');
100
- }
101
- if (data.hasOwnProperty('from_address')) {
102
- obj['from_address'] = _ApiClient["default"].convertToType(data['from_address'], 'String');
103
- }
104
- if (data.hasOwnProperty('to_address')) {
105
- obj['to_address'] = _ApiClient["default"].convertToType(data['to_address'], 'String');
106
- }
107
- if (data.hasOwnProperty('transaction_hash')) {
108
- obj['transaction_hash'] = _ApiClient["default"].convertToType(data['transaction_hash'], 'String');
109
- }
110
- }
111
- return obj;
112
- }
113
-
114
- /**
115
- * Validates the JSON data with respect to <code>BookkeepingRecord</code>.
116
- * @param {Object} data The plain JavaScript object bearing properties of interest.
117
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>BookkeepingRecord</code>.
118
- */
119
- }, {
120
- key: "validateJSON",
121
- value: function validateJSON(data) {
122
- // check to make sure all required properties are present in the JSON string
123
- var _iterator = _createForOfIteratorHelper(BookkeepingRecord.RequiredProperties),
124
- _step;
125
- try {
126
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
127
- var property = _step.value;
128
- if (!data.hasOwnProperty(property)) {
129
- throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
130
- }
131
- }
132
- // ensure the json data is a string
133
- } catch (err) {
134
- _iterator.e(err);
135
- } finally {
136
- _iterator.f();
137
- }
138
- if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
139
- throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
140
- }
141
- // ensure the json data is a string
142
- if (data['wallet_name'] && !(typeof data['wallet_name'] === 'string' || data['wallet_name'] instanceof String)) {
143
- throw new Error("Expected the field `wallet_name` to be a primitive type in the JSON string but got " + data['wallet_name']);
144
- }
145
- // ensure the json data is a string
146
- if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
147
- throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
148
- }
149
- // ensure the json data is a string
150
- if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
151
- throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
152
- }
153
- // ensure the json data is a string
154
- if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
155
- throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
156
- }
157
- // ensure the json data is a string
158
- if (data['balance'] && !(typeof data['balance'] === 'string' || data['balance'] instanceof String)) {
159
- throw new Error("Expected the field `balance` to be a primitive type in the JSON string but got " + data['balance']);
160
- }
161
- // ensure the json data is a string
162
- if (data['from_address'] && !(typeof data['from_address'] === 'string' || data['from_address'] instanceof String)) {
163
- throw new Error("Expected the field `from_address` to be a primitive type in the JSON string but got " + data['from_address']);
164
- }
165
- // ensure the json data is a string
166
- if (data['to_address'] && !(typeof data['to_address'] === 'string' || data['to_address'] instanceof String)) {
167
- throw new Error("Expected the field `to_address` to be a primitive type in the JSON string but got " + data['to_address']);
168
- }
169
- // ensure the json data is a string
170
- if (data['transaction_hash'] && !(typeof data['transaction_hash'] === 'string' || data['transaction_hash'] instanceof String)) {
171
- throw new Error("Expected the field `transaction_hash` to be a primitive type in the JSON string but got " + data['transaction_hash']);
172
- }
173
- return true;
174
- }
175
- }]);
176
- }();
177
- BookkeepingRecord.RequiredProperties = ["wallet_id", "transaction_timestamp", "token_id", "type", "amount", "balance"];
178
-
179
- /**
180
- * The wallet ID.
181
- * @member {String} wallet_id
182
- */
183
- BookkeepingRecord.prototype['wallet_id'] = undefined;
184
-
185
- /**
186
- * @member {module:model/WalletType} wallet_type
187
- */
188
- BookkeepingRecord.prototype['wallet_type'] = undefined;
189
-
190
- /**
191
- * The wallet name.
192
- * @member {String} wallet_name
193
- */
194
- BookkeepingRecord.prototype['wallet_name'] = undefined;
195
-
196
- /**
197
- * The time when the bookkeeping was created, in Unix timestamp format, measured in milliseconds.
198
- * @member {Number} transaction_timestamp
199
- */
200
- BookkeepingRecord.prototype['transaction_timestamp'] = undefined;
201
-
202
- /**
203
- * The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens).
204
- * @member {String} token_id
205
- */
206
- BookkeepingRecord.prototype['token_id'] = undefined;
207
-
208
- /**
209
- * The bookkeeping type.
210
- * @member {String} type
211
- */
212
- BookkeepingRecord.prototype['type'] = undefined;
213
-
214
- /**
215
- * The amount of the bookkeeping.
216
- * @member {String} amount
217
- */
218
- BookkeepingRecord.prototype['amount'] = undefined;
219
-
220
- /**
221
- * The post-balance of the tx.
222
- * @member {String} balance
223
- */
224
- BookkeepingRecord.prototype['balance'] = undefined;
225
-
226
- /**
227
- * The from address.
228
- * @member {String} from_address
229
- */
230
- BookkeepingRecord.prototype['from_address'] = undefined;
231
-
232
- /**
233
- * The to address.
234
- * @member {String} to_address
235
- */
236
- BookkeepingRecord.prototype['to_address'] = undefined;
237
-
238
- /**
239
- * The transaction hash.
240
- * @member {String} transaction_hash
241
- */
242
- BookkeepingRecord.prototype['transaction_hash'] = undefined;
243
- var _default = exports["default"] = BookkeepingRecord;
@@ -1,19 +0,0 @@
1
- # CoboWaas2.BookkeepingRecord
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **wallet_id** | **String** | The wallet ID. |
8
- **wallet_type** | [**WalletType**](WalletType.md) | | [optional]
9
- **wallet_name** | **String** | The wallet name. | [optional]
10
- **transaction_timestamp** | **Number** | The time when the bookkeeping was created, in Unix timestamp format, measured in milliseconds. |
11
- **token_id** | **String** | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). |
12
- **type** | **String** | The bookkeeping type. |
13
- **amount** | **String** | The amount of the bookkeeping. |
14
- **balance** | **String** | The post-balance of the tx. |
15
- **from_address** | **String** | The from address. | [optional]
16
- **to_address** | **String** | The to address. | [optional]
17
- **transaction_hash** | **String** | The transaction hash. | [optional]
18
-
19
-
@@ -1,12 +0,0 @@
1
- # CoboWaas2.BookkeepingSummary
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **total_transaction_count** | **Number** | Total transaction count. |
8
- **total_inflow_value** | **String** | The USD value of the inflow. |
9
- **total_outflow_value** | **String** | The USD value of the outflow. |
10
- **total_fee_value** | **String** | The USD value of the fee. | [optional]
11
-
12
-
@@ -1,10 +0,0 @@
1
- # CoboWaas2.WalletBalanceSnapshot
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **snapshot_id** | **Number** | The snapshot ID. |
8
- **snapshot_name** | **String** | The snapshot name. | [optional]
9
-
10
-
@@ -1,13 +0,0 @@
1
- # CoboWaas2.WalletBalanceSnapshotRecord
2
-
3
- ## Properties
4
-
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **wallet_id** | **String** | The wallet ID. |
8
- **wallet_type** | [**WalletType**](WalletType.md) | | [optional]
9
- **wallet_name** | **String** | The wallet name. | [optional]
10
- **token_id** | **String** | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). |
11
- **balance** | **String** | The balance of the token. |
12
-
13
-