@cobo/cobo-waas2 1.15.0 → 1.17.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.
- package/README.md +42 -6
- package/dist/ApiClient.js +1 -1
- package/dist/PreRequestScript.js +27 -33
- package/dist/api/AddressBooksApi.js +4 -4
- package/dist/api/AppWorkflowsApi.js +275 -0
- package/dist/api/DevelopersApi.js +4 -4
- package/dist/api/DevelopersWebhooksApi.js +12 -12
- package/dist/api/FeeStationApi.js +12 -12
- package/dist/api/OAuthApi.js +93 -6
- package/dist/api/PaymentApi.js +107 -161
- package/dist/api/StakingsApi.js +28 -28
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/api/WalletsApi.js +102 -51
- package/dist/api/WalletsExchangeWalletApi.js +8 -8
- package/dist/api/WalletsMPCWalletsApi.js +20 -20
- package/dist/index.js +224 -14
- package/dist/model/AppWorkflow.js +173 -0
- package/dist/model/AppWorkflowField.js +137 -0
- package/dist/model/AppWorkflowPolicy.js +144 -0
- package/dist/model/ApprovalEntry.js +148 -0
- package/dist/model/ApprovalRequest.js +180 -0
- package/dist/model/ApprovalRequestDetail.js +177 -0
- package/dist/model/ApprovalStatus.js +71 -0
- package/dist/model/ApprovalUser.js +146 -0
- package/dist/model/BabylonStakeExtra.js +16 -0
- package/dist/model/BatchCheckUtxo201Response.js +107 -0
- package/dist/model/BatchCheckUtxoRequest.js +142 -0
- package/dist/model/{CreateBankAccountRequest.js → BatchUTXOParam.js} +43 -28
- package/dist/model/ChainInfo.js +9 -0
- package/dist/model/CreateApprovalRequest201Response.js +110 -0
- package/dist/model/CreatePaymentOrderRequest.js +5 -5
- package/dist/model/CreateRefundRequest.js +35 -0
- package/dist/model/CreateSettlement.js +39 -29
- package/dist/model/CreateStakeActivityExtra.js +6 -0
- package/dist/model/CryptoAddress.js +171 -0
- package/dist/model/{OrderAddressInfo.js → CustodialTransferDestination.js} +36 -46
- package/dist/model/CustodialWeb3TransferSource.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +13 -0
- package/dist/model/EstimateFeeParams.js +6 -0
- package/dist/model/EstimateTransferFeeParams.js +13 -0
- package/dist/model/ExchangePermissionToken201Response.js +122 -0
- package/dist/model/ExchangePermissionTokenRequest.js +110 -0
- package/dist/model/ListApprovalRequests200Response.js +123 -0
- package/dist/model/MpcTransferSource.js +1 -1
- package/dist/model/Order.js +4 -4
- package/dist/model/PaymentOrderEventData.js +6 -6
- package/dist/model/PayoutChannel.js +61 -0
- package/dist/model/PolicyAction.js +123 -0
- package/dist/model/PolicyActionContent.js +169 -0
- package/dist/model/PolicyActionType.js +66 -0
- package/dist/model/PolicyCondition.js +148 -0
- package/dist/model/PolicyFieldOperator.js +76 -0
- package/dist/model/PolicyFieldValueType.js +61 -0
- package/dist/model/RefreshPermissionTokenRequest.js +110 -0
- package/dist/model/RequestApproval.js +188 -0
- package/dist/model/RevokeApprovalRequest201Response.js +119 -0
- package/dist/model/RevokeApprovalRequestRequest.js +110 -0
- package/dist/model/SettlementDetail.js +22 -0
- package/dist/model/SupportedToken.js +222 -0
- package/dist/model/SwapActivityApprovers.js +122 -0
- package/dist/model/SwapActivityDetail.js +30 -0
- package/dist/model/SwapApproversStatus.js +66 -0
- package/dist/model/TransactionCoboCategory.js +102 -7
- package/dist/model/TransactionDestination.js +4 -0
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionSubStatus.js +10 -0
- package/dist/model/TransactionTransferToWalletDestination.js +2 -2
- package/dist/model/TransferDestination.js +42 -14
- package/dist/model/TransferDestinationType.js +5 -0
- package/dist/model/UTXO.js +9 -0
- package/docs/AddressBooksApi.md +2 -2
- package/docs/AppWorkflow.md +12 -0
- package/docs/AppWorkflowField.md +11 -0
- package/docs/AppWorkflowPolicy.md +10 -0
- package/docs/AppWorkflowsApi.md +273 -0
- package/docs/ApprovalEntry.md +11 -0
- package/docs/ApprovalRequest.md +13 -0
- package/docs/ApprovalRequestDetail.md +13 -0
- package/docs/ApprovalStatus.md +16 -0
- package/docs/ApprovalUser.md +12 -0
- package/docs/BabylonStakeExtra.md +1 -0
- package/docs/BatchCheckUtxo201Response.md +9 -0
- package/docs/BatchCheckUtxoRequest.md +10 -0
- package/docs/BatchUTXOParam.md +10 -0
- package/docs/ChainInfo.md +1 -0
- package/docs/CreateApprovalRequest201Response.md +9 -0
- package/docs/CreatePaymentOrderRequest.md +1 -1
- package/docs/CreateRefundRequest.md +3 -0
- package/docs/CreateSettlement.md +5 -2
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CryptoAddress.md +14 -0
- package/docs/CustodialTransferDestination.md +11 -0
- package/docs/CustodialWeb3TransferSource.md +1 -1
- package/docs/DevelopersApi.md +2 -2
- package/docs/DevelopersWebhooksApi.md +6 -6
- package/docs/EstimateContractCallFeeParams.md +1 -0
- package/docs/EstimateFeeParams.md +1 -0
- package/docs/EstimateTransferFeeParams.md +1 -0
- package/docs/ExchangePermissionToken201Response.md +12 -0
- package/docs/ExchangePermissionTokenRequest.md +9 -0
- package/docs/FeeStationApi.md +6 -6
- package/docs/ListApprovalRequests200Response.md +10 -0
- package/docs/MpcTransferSource.md +1 -1
- package/docs/OAuthApi.md +102 -0
- package/docs/Order.md +2 -2
- package/docs/PaymentApi.md +86 -147
- package/docs/PaymentOrderEventData.md +2 -2
- package/docs/PayoutChannel.md +12 -0
- package/docs/PolicyAction.md +10 -0
- package/docs/PolicyActionContent.md +25 -0
- package/docs/PolicyActionType.md +14 -0
- package/docs/PolicyCondition.md +12 -0
- package/docs/PolicyFieldOperator.md +18 -0
- package/docs/PolicyFieldValueType.md +12 -0
- package/docs/RefreshPermissionTokenRequest.md +9 -0
- package/docs/RequestApproval.md +13 -0
- package/docs/RevokeApprovalRequest201Response.md +10 -0
- package/docs/RevokeApprovalRequestRequest.md +9 -0
- package/docs/SettlementDetail.md +2 -0
- package/docs/StakingsApi.md +14 -14
- package/docs/SupportedToken.md +17 -0
- package/docs/SwapActivityApprovers.md +10 -0
- package/docs/SwapActivityDetail.md +1 -0
- package/docs/SwapApproversStatus.md +14 -0
- package/docs/TransactionCoboCategory.md +41 -3
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionSubStatus.md +4 -0
- package/docs/TransactionTransferToWalletDestination.md +1 -1
- package/docs/TransactionsApi.md +2 -2
- package/docs/TransferDestination.md +1 -1
- package/docs/TransferDestinationType.md +2 -0
- package/docs/UTXO.md +1 -0
- package/docs/WalletsApi.md +78 -23
- package/docs/WalletsExchangeWalletApi.md +4 -4
- package/docs/WalletsMPCWalletsApi.md +10 -10
- package/package.json +1 -1
- package/docs/CreateBankAccountRequest.md +0 -9
- package/docs/OrderAddressInfo.md +0 -12
|
@@ -0,0 +1,142 @@
|
|
|
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 _BatchUTXOParam = _interopRequireDefault(require("./BatchUTXOParam"));
|
|
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 BatchCheckUtxoRequest model module.
|
|
30
|
+
* @module model/BatchCheckUtxoRequest
|
|
31
|
+
*/
|
|
32
|
+
var BatchCheckUtxoRequest = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>BatchCheckUtxoRequest</code>.
|
|
35
|
+
* @alias module:model/BatchCheckUtxoRequest
|
|
36
|
+
* @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](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
|
|
37
|
+
* @param utxos {Array.<module:model/BatchUTXOParam>}
|
|
38
|
+
*/
|
|
39
|
+
function BatchCheckUtxoRequest(token_id, utxos) {
|
|
40
|
+
_classCallCheck(this, BatchCheckUtxoRequest);
|
|
41
|
+
BatchCheckUtxoRequest.initialize(this, token_id, utxos);
|
|
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(BatchCheckUtxoRequest, null, [{
|
|
50
|
+
key: "initialize",
|
|
51
|
+
value: function initialize(obj, token_id, utxos) {
|
|
52
|
+
obj['token_id'] = token_id;
|
|
53
|
+
obj['utxos'] = utxos;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Constructs a <code>BatchCheckUtxoRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
58
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
59
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
60
|
+
* @param {module:model/BatchCheckUtxoRequest} obj Optional instance to populate.
|
|
61
|
+
* @return {module:model/BatchCheckUtxoRequest} The populated <code>BatchCheckUtxoRequest</code> instance.
|
|
62
|
+
*/
|
|
63
|
+
}, {
|
|
64
|
+
key: "constructFromObject",
|
|
65
|
+
value: function constructFromObject(data, obj) {
|
|
66
|
+
if (data) {
|
|
67
|
+
obj = obj || new BatchCheckUtxoRequest();
|
|
68
|
+
if (data.hasOwnProperty('token_id')) {
|
|
69
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('utxos')) {
|
|
72
|
+
obj['utxos'] = _ApiClient["default"].convertToType(data['utxos'], [_BatchUTXOParam["default"]]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Validates the JSON data with respect to <code>BatchCheckUtxoRequest</code>.
|
|
80
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
81
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>BatchCheckUtxoRequest</code>.
|
|
82
|
+
*/
|
|
83
|
+
}, {
|
|
84
|
+
key: "validateJSON",
|
|
85
|
+
value: function validateJSON(data) {
|
|
86
|
+
// check to make sure all required properties are present in the JSON string
|
|
87
|
+
var _iterator = _createForOfIteratorHelper(BatchCheckUtxoRequest.RequiredProperties),
|
|
88
|
+
_step;
|
|
89
|
+
try {
|
|
90
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
91
|
+
var property = _step.value;
|
|
92
|
+
if (!data.hasOwnProperty(property)) {
|
|
93
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// ensure the json data is a string
|
|
97
|
+
} catch (err) {
|
|
98
|
+
_iterator.e(err);
|
|
99
|
+
} finally {
|
|
100
|
+
_iterator.f();
|
|
101
|
+
}
|
|
102
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
103
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
104
|
+
}
|
|
105
|
+
if (data['utxos']) {
|
|
106
|
+
// data not null
|
|
107
|
+
// ensure the json data is an array
|
|
108
|
+
if (!Array.isArray(data['utxos'])) {
|
|
109
|
+
throw new Error("Expected the field `utxos` to be an array in the JSON data but got " + data['utxos']);
|
|
110
|
+
}
|
|
111
|
+
// validate the optional field `utxos` (array)
|
|
112
|
+
var _iterator2 = _createForOfIteratorHelper(data['utxos']),
|
|
113
|
+
_step2;
|
|
114
|
+
try {
|
|
115
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
116
|
+
var item = _step2.value;
|
|
117
|
+
_BatchUTXOParam["default"].validateJSON(item);
|
|
118
|
+
}
|
|
119
|
+
} catch (err) {
|
|
120
|
+
_iterator2.e(err);
|
|
121
|
+
} finally {
|
|
122
|
+
_iterator2.f();
|
|
123
|
+
}
|
|
124
|
+
;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
}();
|
|
130
|
+
BatchCheckUtxoRequest.RequiredProperties = ["token_id", "utxos"];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 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](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).
|
|
134
|
+
* @member {String} token_id
|
|
135
|
+
*/
|
|
136
|
+
BatchCheckUtxoRequest.prototype['token_id'] = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @member {Array.<module:model/BatchUTXOParam>} utxos
|
|
140
|
+
*/
|
|
141
|
+
BatchCheckUtxoRequest.prototype['utxos'] = undefined;
|
|
142
|
+
var _default = exports["default"] = BatchCheckUtxoRequest;
|
|
@@ -25,18 +25,19 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
29
|
-
* @module model/
|
|
28
|
+
* The BatchUTXOParam model module.
|
|
29
|
+
* @module model/BatchUTXOParam
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
31
|
+
var BatchUTXOParam = /*#__PURE__*/function () {
|
|
32
32
|
/**
|
|
33
|
-
* Constructs a new <code>
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
33
|
+
* Constructs a new <code>BatchUTXOParam</code>.
|
|
34
|
+
* The UTXO information.
|
|
35
|
+
* @alias module:model/BatchUTXOParam
|
|
36
|
+
* @param tx_hash {String} The transaction hash.
|
|
36
37
|
*/
|
|
37
|
-
function
|
|
38
|
-
_classCallCheck(this,
|
|
39
|
-
|
|
38
|
+
function BatchUTXOParam(tx_hash) {
|
|
39
|
+
_classCallCheck(this, BatchUTXOParam);
|
|
40
|
+
BatchUTXOParam.initialize(this, tx_hash);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -44,43 +45,44 @@ var CreateBankAccountRequest = /*#__PURE__*/function () {
|
|
|
44
45
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
46
|
* Only for internal use.
|
|
46
47
|
*/
|
|
47
|
-
return _createClass(
|
|
48
|
+
return _createClass(BatchUTXOParam, null, [{
|
|
48
49
|
key: "initialize",
|
|
49
|
-
value: function initialize(obj,
|
|
50
|
-
obj['
|
|
50
|
+
value: function initialize(obj, tx_hash) {
|
|
51
|
+
obj['tx_hash'] = tx_hash;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
|
-
* Constructs a <code>
|
|
55
|
+
* Constructs a <code>BatchUTXOParam</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
56
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
57
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
-
* @param {module:model/
|
|
58
|
-
* @return {module:model/
|
|
58
|
+
* @param {module:model/BatchUTXOParam} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/BatchUTXOParam} The populated <code>BatchUTXOParam</code> instance.
|
|
59
60
|
*/
|
|
60
61
|
}, {
|
|
61
62
|
key: "constructFromObject",
|
|
62
63
|
value: function constructFromObject(data, obj) {
|
|
63
64
|
if (data) {
|
|
64
|
-
obj = obj || new
|
|
65
|
-
if (data.hasOwnProperty('
|
|
66
|
-
obj['
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
obj = obj || new BatchUTXOParam();
|
|
66
|
+
if (data.hasOwnProperty('tx_hash')) {
|
|
67
|
+
obj['tx_hash'] = _ApiClient["default"].convertToType(data['tx_hash'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('vout_ns')) {
|
|
70
|
+
obj['vout_ns'] = _ApiClient["default"].convertToType(data['vout_ns'], ['Number']);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
return obj;
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
/**
|
|
75
|
-
* Validates the JSON data with respect to <code>
|
|
77
|
+
* Validates the JSON data with respect to <code>BatchUTXOParam</code>.
|
|
76
78
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
77
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>
|
|
79
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>BatchUTXOParam</code>.
|
|
78
80
|
*/
|
|
79
81
|
}, {
|
|
80
82
|
key: "validateJSON",
|
|
81
83
|
value: function validateJSON(data) {
|
|
82
84
|
// check to make sure all required properties are present in the JSON string
|
|
83
|
-
var _iterator = _createForOfIteratorHelper(
|
|
85
|
+
var _iterator = _createForOfIteratorHelper(BatchUTXOParam.RequiredProperties),
|
|
84
86
|
_step;
|
|
85
87
|
try {
|
|
86
88
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -89,20 +91,33 @@ var CreateBankAccountRequest = /*#__PURE__*/function () {
|
|
|
89
91
|
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
90
92
|
}
|
|
91
93
|
}
|
|
94
|
+
// ensure the json data is a string
|
|
92
95
|
} catch (err) {
|
|
93
96
|
_iterator.e(err);
|
|
94
97
|
} finally {
|
|
95
98
|
_iterator.f();
|
|
96
99
|
}
|
|
100
|
+
if (data['tx_hash'] && !(typeof data['tx_hash'] === 'string' || data['tx_hash'] instanceof String)) {
|
|
101
|
+
throw new Error("Expected the field `tx_hash` to be a primitive type in the JSON string but got " + data['tx_hash']);
|
|
102
|
+
}
|
|
103
|
+
// ensure the json data is an array
|
|
104
|
+
if (!Array.isArray(data['vout_ns'])) {
|
|
105
|
+
throw new Error("Expected the field `vout_ns` to be an array in the JSON data but got " + data['vout_ns']);
|
|
106
|
+
}
|
|
97
107
|
return true;
|
|
98
108
|
}
|
|
99
109
|
}]);
|
|
100
110
|
}();
|
|
101
|
-
|
|
111
|
+
BatchUTXOParam.RequiredProperties = ["tx_hash"];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The transaction hash.
|
|
115
|
+
* @member {String} tx_hash
|
|
116
|
+
*/
|
|
117
|
+
BatchUTXOParam.prototype['tx_hash'] = undefined;
|
|
102
118
|
|
|
103
119
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @member {Object.<String, Object>} info
|
|
120
|
+
* @member {Array.<Number>} vout_ns
|
|
106
121
|
*/
|
|
107
|
-
|
|
108
|
-
var _default = exports["default"] =
|
|
122
|
+
BatchUTXOParam.prototype['vout_ns'] = undefined;
|
|
123
|
+
var _default = exports["default"] = BatchUTXOParam;
|
package/dist/model/ChainInfo.js
CHANGED
|
@@ -84,6 +84,9 @@ var ChainInfo = /*#__PURE__*/function () {
|
|
|
84
84
|
if (data.hasOwnProperty('confirming_threshold')) {
|
|
85
85
|
obj['confirming_threshold'] = _ApiClient["default"].convertToType(data['confirming_threshold'], 'Number');
|
|
86
86
|
}
|
|
87
|
+
if (data.hasOwnProperty('coinbase_maturity')) {
|
|
88
|
+
obj['coinbase_maturity'] = _ApiClient["default"].convertToType(data['coinbase_maturity'], 'Number');
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
return obj;
|
|
89
92
|
}
|
|
@@ -178,4 +181,10 @@ ChainInfo.prototype['require_memo'] = undefined;
|
|
|
178
181
|
* @member {Number} confirming_threshold
|
|
179
182
|
*/
|
|
180
183
|
ChainInfo.prototype['confirming_threshold'] = undefined;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The number of confirmations required before a coinbase transaction is considered mature and can be spent, for example, 100 confirmations for BTC.
|
|
187
|
+
* @member {Number} coinbase_maturity
|
|
188
|
+
*/
|
|
189
|
+
ChainInfo.prototype['coinbase_maturity'] = undefined;
|
|
181
190
|
var _default = exports["default"] = ChainInfo;
|
|
@@ -0,0 +1,110 @@
|
|
|
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 _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; } } }; }
|
|
11
|
+
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; } }
|
|
12
|
+
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; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
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); } /**
|
|
18
|
+
* Cobo Wallet as a Service 2.0
|
|
19
|
+
*
|
|
20
|
+
* Contact: help@cobo.com
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The CreateApprovalRequest201Response model module.
|
|
29
|
+
* @module model/CreateApprovalRequest201Response
|
|
30
|
+
*/
|
|
31
|
+
var CreateApprovalRequest201Response = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>CreateApprovalRequest201Response</code>.
|
|
34
|
+
* @alias module:model/CreateApprovalRequest201Response
|
|
35
|
+
* @param approval_id {String} The system-generated unique ID of the approval request. You can use this ID to query the approval request status or revoke the request.
|
|
36
|
+
*/
|
|
37
|
+
function CreateApprovalRequest201Response(approval_id) {
|
|
38
|
+
_classCallCheck(this, CreateApprovalRequest201Response);
|
|
39
|
+
CreateApprovalRequest201Response.initialize(this, approval_id);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(CreateApprovalRequest201Response, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj, approval_id) {
|
|
50
|
+
obj['approval_id'] = approval_id;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a <code>CreateApprovalRequest201Response</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
+
* @param {module:model/CreateApprovalRequest201Response} obj Optional instance to populate.
|
|
58
|
+
* @return {module:model/CreateApprovalRequest201Response} The populated <code>CreateApprovalRequest201Response</code> instance.
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "constructFromObject",
|
|
62
|
+
value: function constructFromObject(data, obj) {
|
|
63
|
+
if (data) {
|
|
64
|
+
obj = obj || new CreateApprovalRequest201Response();
|
|
65
|
+
if (data.hasOwnProperty('approval_id')) {
|
|
66
|
+
obj['approval_id'] = _ApiClient["default"].convertToType(data['approval_id'], 'String');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Validates the JSON data with respect to <code>CreateApprovalRequest201Response</code>.
|
|
74
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
75
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateApprovalRequest201Response</code>.
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "validateJSON",
|
|
79
|
+
value: function validateJSON(data) {
|
|
80
|
+
// check to make sure all required properties are present in the JSON string
|
|
81
|
+
var _iterator = _createForOfIteratorHelper(CreateApprovalRequest201Response.RequiredProperties),
|
|
82
|
+
_step;
|
|
83
|
+
try {
|
|
84
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
85
|
+
var property = _step.value;
|
|
86
|
+
if (!data.hasOwnProperty(property)) {
|
|
87
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ensure the json data is a string
|
|
91
|
+
} catch (err) {
|
|
92
|
+
_iterator.e(err);
|
|
93
|
+
} finally {
|
|
94
|
+
_iterator.f();
|
|
95
|
+
}
|
|
96
|
+
if (data['approval_id'] && !(typeof data['approval_id'] === 'string' || data['approval_id'] instanceof String)) {
|
|
97
|
+
throw new Error("Expected the field `approval_id` to be a primitive type in the JSON string but got " + data['approval_id']);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}]);
|
|
102
|
+
}();
|
|
103
|
+
CreateApprovalRequest201Response.RequiredProperties = ["approval_id"];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The system-generated unique ID of the approval request. You can use this ID to query the approval request status or revoke the request.
|
|
107
|
+
* @member {String} approval_id
|
|
108
|
+
*/
|
|
109
|
+
CreateApprovalRequest201Response.prototype['approval_id'] = undefined;
|
|
110
|
+
var _default = exports["default"] = CreateApprovalRequest201Response;
|
|
@@ -91,8 +91,8 @@ var CreatePaymentOrderRequest = /*#__PURE__*/function () {
|
|
|
91
91
|
if (data.hasOwnProperty('psp_order_code')) {
|
|
92
92
|
obj['psp_order_code'] = _ApiClient["default"].convertToType(data['psp_order_code'], 'String');
|
|
93
93
|
}
|
|
94
|
-
if (data.hasOwnProperty('
|
|
95
|
-
obj['
|
|
94
|
+
if (data.hasOwnProperty('expired_in')) {
|
|
95
|
+
obj['expired_in'] = _ApiClient["default"].convertToType(data['expired_in'], 'Number');
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
return obj;
|
|
@@ -199,8 +199,8 @@ CreatePaymentOrderRequest.prototype['merchant_order_code'] = undefined;
|
|
|
199
199
|
CreatePaymentOrderRequest.prototype['psp_order_code'] = undefined;
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
* The
|
|
203
|
-
* @member {Number}
|
|
202
|
+
* The pay-in order will expire after approximately a certain number of seconds: - The order status becomes final and cannot be changed - The `received_token_amount` field will no longer be updated - Funds received after expiration will be categorized as late payments and can only be settled from the developer balance. - A late payment will trigger a `transactionLate` webhook event.
|
|
203
|
+
* @member {Number} expired_in
|
|
204
204
|
*/
|
|
205
|
-
CreatePaymentOrderRequest.prototype['
|
|
205
|
+
CreatePaymentOrderRequest.prototype['expired_in'] = undefined;
|
|
206
206
|
var _default = exports["default"] = CreatePaymentOrderRequest;
|
|
@@ -92,6 +92,15 @@ var CreateRefundRequest = /*#__PURE__*/function () {
|
|
|
92
92
|
if (data.hasOwnProperty('order_id')) {
|
|
93
93
|
obj['order_id'] = _ApiClient["default"].convertToType(data['order_id'], 'String');
|
|
94
94
|
}
|
|
95
|
+
if (data.hasOwnProperty('charge_merchant_fee')) {
|
|
96
|
+
obj['charge_merchant_fee'] = _ApiClient["default"].convertToType(data['charge_merchant_fee'], 'Boolean');
|
|
97
|
+
}
|
|
98
|
+
if (data.hasOwnProperty('merchant_fee_amount')) {
|
|
99
|
+
obj['merchant_fee_amount'] = _ApiClient["default"].convertToType(data['merchant_fee_amount'], 'String');
|
|
100
|
+
}
|
|
101
|
+
if (data.hasOwnProperty('merchant_fee_token_id')) {
|
|
102
|
+
obj['merchant_fee_token_id'] = _ApiClient["default"].convertToType(data['merchant_fee_token_id'], 'String');
|
|
103
|
+
}
|
|
95
104
|
}
|
|
96
105
|
return obj;
|
|
97
106
|
}
|
|
@@ -143,6 +152,14 @@ var CreateRefundRequest = /*#__PURE__*/function () {
|
|
|
143
152
|
if (data['order_id'] && !(typeof data['order_id'] === 'string' || data['order_id'] instanceof String)) {
|
|
144
153
|
throw new Error("Expected the field `order_id` to be a primitive type in the JSON string but got " + data['order_id']);
|
|
145
154
|
}
|
|
155
|
+
// ensure the json data is a string
|
|
156
|
+
if (data['merchant_fee_amount'] && !(typeof data['merchant_fee_amount'] === 'string' || data['merchant_fee_amount'] instanceof String)) {
|
|
157
|
+
throw new Error("Expected the field `merchant_fee_amount` to be a primitive type in the JSON string but got " + data['merchant_fee_amount']);
|
|
158
|
+
}
|
|
159
|
+
// ensure the json data is a string
|
|
160
|
+
if (data['merchant_fee_token_id'] && !(typeof data['merchant_fee_token_id'] === 'string' || data['merchant_fee_token_id'] instanceof String)) {
|
|
161
|
+
throw new Error("Expected the field `merchant_fee_token_id` to be a primitive type in the JSON string but got " + data['merchant_fee_token_id']);
|
|
162
|
+
}
|
|
146
163
|
return true;
|
|
147
164
|
}
|
|
148
165
|
}]);
|
|
@@ -189,4 +206,22 @@ CreateRefundRequest.prototype['refund_type'] = undefined;
|
|
|
189
206
|
* @member {String} order_id
|
|
190
207
|
*/
|
|
191
208
|
CreateRefundRequest.prototype['order_id'] = undefined;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Indicates whether the merchant should bear the transaction fee for the refund. If true, the fee will be deducted from merchant's account balance.
|
|
212
|
+
* @member {Boolean} charge_merchant_fee
|
|
213
|
+
*/
|
|
214
|
+
CreateRefundRequest.prototype['charge_merchant_fee'] = undefined;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The amount of the transaction fee that the merchant will bear for the refund. This is only applicable if `charge_merchant_fee` is set to true.
|
|
218
|
+
* @member {String} merchant_fee_amount
|
|
219
|
+
*/
|
|
220
|
+
CreateRefundRequest.prototype['merchant_fee_amount'] = undefined;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The ID of the cryptocurrency used for the transaction fee. This is only applicable if `charge_merchant_fee` is set to true.
|
|
224
|
+
* @member {String} merchant_fee_token_id
|
|
225
|
+
*/
|
|
226
|
+
CreateRefundRequest.prototype['merchant_fee_token_id'] = undefined;
|
|
192
227
|
var _default = exports["default"] = CreateRefundRequest;
|
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _PayoutChannel = _interopRequireDefault(require("./PayoutChannel"));
|
|
8
9
|
var _SettlementType = _interopRequireDefault(require("./SettlementType"));
|
|
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
|
-
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
12
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
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); } }
|
|
16
14
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -33,12 +31,10 @@ var CreateSettlement = /*#__PURE__*/function () {
|
|
|
33
31
|
/**
|
|
34
32
|
* Constructs a new <code>CreateSettlement</code>.
|
|
35
33
|
* @alias module:model/CreateSettlement
|
|
36
|
-
* @param amount {String} The settlement amount. - If `token_id` is specified, this represents the settlement amount in the specified cryptocurrency. - If `token_id` is not specified, this represents the settlement amount in the specified fiat currency.
|
|
37
|
-
* @param bank_account_id {String} The ID of the bank account where the settled funds will be deposited.
|
|
38
34
|
*/
|
|
39
|
-
function CreateSettlement(
|
|
35
|
+
function CreateSettlement() {
|
|
40
36
|
_classCallCheck(this, CreateSettlement);
|
|
41
|
-
CreateSettlement.initialize(this
|
|
37
|
+
CreateSettlement.initialize(this);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
/**
|
|
@@ -48,10 +44,7 @@ var CreateSettlement = /*#__PURE__*/function () {
|
|
|
48
44
|
*/
|
|
49
45
|
return _createClass(CreateSettlement, null, [{
|
|
50
46
|
key: "initialize",
|
|
51
|
-
value: function initialize(obj
|
|
52
|
-
obj['amount'] = amount;
|
|
53
|
-
obj['bank_account_id'] = bank_account_id;
|
|
54
|
-
}
|
|
47
|
+
value: function initialize(obj) {}
|
|
55
48
|
|
|
56
49
|
/**
|
|
57
50
|
* Constructs a <code>CreateSettlement</code> from a plain JavaScript object, optionally creating a new instance.
|
|
@@ -83,6 +76,15 @@ var CreateSettlement = /*#__PURE__*/function () {
|
|
|
83
76
|
if (data.hasOwnProperty('settlement_type')) {
|
|
84
77
|
obj['settlement_type'] = _SettlementType["default"].constructFromObject(data['settlement_type']);
|
|
85
78
|
}
|
|
79
|
+
if (data.hasOwnProperty('crypto_address_id')) {
|
|
80
|
+
obj['crypto_address_id'] = _ApiClient["default"].convertToType(data['crypto_address_id'], 'String');
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('payout_channel')) {
|
|
83
|
+
obj['payout_channel'] = _PayoutChannel["default"].constructFromObject(data['payout_channel']);
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('order_ids')) {
|
|
86
|
+
obj['order_ids'] = _ApiClient["default"].convertToType(data['order_ids'], ['String']);
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
89
|
return obj;
|
|
88
90
|
}
|
|
@@ -95,22 +97,7 @@ var CreateSettlement = /*#__PURE__*/function () {
|
|
|
95
97
|
}, {
|
|
96
98
|
key: "validateJSON",
|
|
97
99
|
value: function validateJSON(data) {
|
|
98
|
-
//
|
|
99
|
-
var _iterator = _createForOfIteratorHelper(CreateSettlement.RequiredProperties),
|
|
100
|
-
_step;
|
|
101
|
-
try {
|
|
102
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
103
|
-
var property = _step.value;
|
|
104
|
-
if (!data.hasOwnProperty(property)) {
|
|
105
|
-
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// ensure the json data is a string
|
|
109
|
-
} catch (err) {
|
|
110
|
-
_iterator.e(err);
|
|
111
|
-
} finally {
|
|
112
|
-
_iterator.f();
|
|
113
|
-
}
|
|
100
|
+
// ensure the json data is a string
|
|
114
101
|
if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
|
|
115
102
|
throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
|
|
116
103
|
}
|
|
@@ -130,12 +117,18 @@ var CreateSettlement = /*#__PURE__*/function () {
|
|
|
130
117
|
if (data['bank_account_id'] && !(typeof data['bank_account_id'] === 'string' || data['bank_account_id'] instanceof String)) {
|
|
131
118
|
throw new Error("Expected the field `bank_account_id` to be a primitive type in the JSON string but got " + data['bank_account_id']);
|
|
132
119
|
}
|
|
120
|
+
// ensure the json data is a string
|
|
121
|
+
if (data['crypto_address_id'] && !(typeof data['crypto_address_id'] === 'string' || data['crypto_address_id'] instanceof String)) {
|
|
122
|
+
throw new Error("Expected the field `crypto_address_id` to be a primitive type in the JSON string but got " + data['crypto_address_id']);
|
|
123
|
+
}
|
|
124
|
+
// ensure the json data is an array
|
|
125
|
+
if (!Array.isArray(data['order_ids'])) {
|
|
126
|
+
throw new Error("Expected the field `order_ids` to be an array in the JSON data but got " + data['order_ids']);
|
|
127
|
+
}
|
|
133
128
|
return true;
|
|
134
129
|
}
|
|
135
130
|
}]);
|
|
136
131
|
}();
|
|
137
|
-
CreateSettlement.RequiredProperties = ["amount", "bank_account_id"];
|
|
138
|
-
|
|
139
132
|
/**
|
|
140
133
|
* The merchant ID.
|
|
141
134
|
* @member {String} merchant_id
|
|
@@ -171,4 +164,21 @@ CreateSettlement.prototype['bank_account_id'] = undefined;
|
|
|
171
164
|
* @member {module:model/SettlementType} settlement_type
|
|
172
165
|
*/
|
|
173
166
|
CreateSettlement.prototype['settlement_type'] = undefined;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The ID of the pre-approved crypto address used for Crypto settlements. - This field is only applicable when `payout_channel` is set to `Crypto`. - If `payout_channel` is `OffRamp`, this field will be ignored. - The value must refer to a valid address that has been pre-configured and approved for the given token.
|
|
170
|
+
* @member {String} crypto_address_id
|
|
171
|
+
*/
|
|
172
|
+
CreateSettlement.prototype['crypto_address_id'] = undefined;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @member {module:model/PayoutChannel} payout_channel
|
|
176
|
+
*/
|
|
177
|
+
CreateSettlement.prototype['payout_channel'] = undefined;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* A list of unique order IDs to be included in this settlement. - This field is only applicable when `settlement_type` is set to `Merchant`. - If provided, the settlement will only apply to the specified orders. - The settlement `amount` must exactly match the total eligible amount from these orders. - This ensures consistency between the declared amount and the actual order-level data being settled.
|
|
181
|
+
* @member {Array.<String>} order_ids
|
|
182
|
+
*/
|
|
183
|
+
CreateSettlement.prototype['order_ids'] = undefined;
|
|
174
184
|
var _default = exports["default"] = CreateSettlement;
|
|
@@ -9,6 +9,7 @@ var _BabylonStakeExtra = _interopRequireDefault(require("./BabylonStakeExtra"));
|
|
|
9
9
|
var _CoreStakeExtra = _interopRequireDefault(require("./CoreStakeExtra"));
|
|
10
10
|
var _EthStakeExtra = _interopRequireDefault(require("./EthStakeExtra"));
|
|
11
11
|
var _StakingPoolType = _interopRequireDefault(require("./StakingPoolType"));
|
|
12
|
+
var _StakingSource = _interopRequireDefault(require("./StakingSource"));
|
|
12
13
|
var _CreateStakeActivityExtra;
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
15
|
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); }
|
|
@@ -223,6 +224,11 @@ CreateStakeActivityExtra.prototype['stake_block_time'] = undefined;
|
|
|
223
224
|
*/
|
|
224
225
|
CreateStakeActivityExtra.prototype['auto_broadcast'] = undefined;
|
|
225
226
|
|
|
227
|
+
/**
|
|
228
|
+
* @member {module:model/StakingSource} babylon_address
|
|
229
|
+
*/
|
|
230
|
+
CreateStakeActivityExtra.prototype['babylon_address'] = undefined;
|
|
231
|
+
|
|
226
232
|
/**
|
|
227
233
|
* The name of the provider.
|
|
228
234
|
* @member {String} provider_name
|