@cobo/cobo-waas2 1.17.0 → 1.18.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 +36 -4
- package/dist/ApiClient.js +1 -1
- package/dist/api/FeeStationApi.js +2 -2
- package/dist/api/OAuthApi.js +12 -12
- package/dist/api/OrganizationsApi.js +79 -0
- package/dist/api/PaymentApi.js +233 -16
- package/dist/api/TransactionsApi.js +2 -2
- package/dist/api/WalletsApi.js +5 -2
- package/dist/index.js +203 -7
- package/dist/model/Account.js +174 -0
- package/dist/model/AcquiringType.js +61 -0
- package/dist/model/AddressTransferDestination.js +2 -2
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/BalanceUpdateInfo.js +170 -0
- package/dist/model/BalanceUpdateInfoEventData.js +297 -0
- package/dist/model/BankAccount.js +2 -2
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/CreateMerchantRequest.js +13 -0
- package/dist/model/CreatePaymentOrderRequest.js +10 -1
- package/dist/model/CreateRefundRequest.js +9 -11
- package/dist/model/CreateSettlement.js +8 -27
- package/dist/model/CreateSettlementRequestRequest.js +27 -0
- package/dist/model/CryptoAddress.js +7 -7
- package/dist/model/CustodialTransferDestination.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +2 -2
- package/dist/model/EstimateFeeParams.js +1 -1
- package/dist/model/EstimatedFILFee.js +170 -0
- package/dist/model/EstimatedFILFeeSlow.js +186 -0
- package/dist/model/EstimatedFee.js +68 -12
- package/dist/model/EstimatedSOLFee.js +170 -0
- package/dist/model/EstimatedSOLFeeSlow.js +184 -0
- package/dist/model/ExchangePermissionToken201Response.js +4 -4
- package/dist/model/ExchangePermissionTokenRequest.js +2 -2
- package/dist/model/FILBase.js +88 -0
- package/dist/model/FILPrice.js +114 -0
- package/dist/model/FeeType.js +10 -0
- package/dist/model/GetExchangeRate200Response.js +2 -2
- package/dist/model/GraphQLError.js +135 -0
- package/dist/model/GraphQLErrorLocationsInner.js +92 -0
- package/dist/model/{TransactionMessageSignBTCEIP191Destination.js → GraphQLRequest.js} +49 -36
- package/dist/model/GraphQLResponse.js +119 -0
- package/dist/model/ListTopUpPayers200Response.js +123 -0
- package/dist/model/ListTopUpPayers200ResponseDataInner.js +189 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/Merchant.js +15 -2
- package/dist/model/Order.js +12 -3
- package/dist/model/PayerAccount.js +189 -0
- package/dist/model/PaymentOrderEventData.js +27 -9
- package/dist/model/PaymentRefundEventData.js +66 -11
- package/dist/model/PaymentSettlementEvent.js +14 -9
- package/dist/model/RefreshPermissionTokenRequest.js +2 -2
- package/dist/model/Refund.js +39 -4
- package/dist/model/RefundStatus.js +5 -0
- package/dist/model/SOLBase.js +101 -0
- package/dist/model/SOLComputeUnit.js +101 -0
- package/dist/model/Settlement.js +3 -3
- package/dist/model/SettlementDetail.js +15 -6
- package/dist/model/SettlementInfo.js +11 -2
- package/dist/model/SwapActivityDetail.js +30 -0
- package/dist/model/SwapActivitySigners.js +110 -0
- package/dist/model/SwapQuote.js +17 -4
- package/dist/model/SwapSingingStatus.js +71 -0
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListingEventData.js +8 -3
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/TopUpAddress.js +230 -0
- package/dist/model/TransactionCoboCategory.js +20 -0
- package/dist/model/TransactionDestination.js +10 -38
- package/dist/model/TransactionEvmCalldataInfo.js +1 -1
- package/dist/model/TransactionFILFee.js +229 -0
- package/dist/model/TransactionFee.js +107 -9
- package/dist/model/TransactionRequestFILFee.js +186 -0
- package/dist/model/TransactionRequestFee.js +89 -9
- package/dist/model/TransactionRequestSOLFee.js +168 -0
- package/dist/model/TransactionSOLFee.js +229 -0
- package/dist/model/TransactionTransferToAddressDestination.js +2 -2
- package/dist/model/TransactionTransferToWalletDestination.js +1 -1
- package/dist/model/TransactionWebhookEventData.js +8 -3
- package/dist/model/TransferDestination.js +2 -2
- package/dist/model/UpdateMerchantByIdRequest.js +13 -0
- package/dist/model/UpdateRefundByIdRequest.js +110 -0
- package/dist/model/UpdateTopUpAddress.js +141 -0
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WebhookEvent.js +2 -2
- package/dist/model/WebhookEventData.js +83 -13
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventLog.js +2 -2
- package/dist/model/WebhookEventType.js +15 -0
- package/docs/Account.md +14 -0
- package/docs/AcquiringType.md +12 -0
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressesEventData.md +3 -1
- package/docs/BalanceUpdateInfo.md +13 -0
- package/docs/BalanceUpdateInfoEventData.md +47 -0
- package/docs/BankAccount.md +2 -2
- package/docs/ChainsEventData.md +3 -1
- package/docs/CreateMerchantRequest.md +1 -0
- package/docs/CreatePaymentOrderRequest.md +2 -1
- package/docs/CreateRefundRequest.md +5 -5
- package/docs/CreateSettlement.md +7 -9
- package/docs/CreateSettlementRequestRequest.md +3 -0
- package/docs/CryptoAddress.md +5 -5
- package/docs/EstimateContractCallFeeParams.md +1 -1
- package/docs/EstimateFeeParams.md +1 -1
- package/docs/EstimatedFILFee.md +13 -0
- package/docs/EstimatedFILFeeSlow.md +12 -0
- package/docs/EstimatedFee.md +3 -3
- package/docs/EstimatedSOLFee.md +13 -0
- package/docs/EstimatedSOLFeeSlow.md +12 -0
- package/docs/ExchangePermissionToken201Response.md +4 -4
- package/docs/ExchangePermissionTokenRequest.md +1 -1
- package/docs/FILBase.md +9 -0
- package/docs/FILPrice.md +11 -0
- package/docs/FeeStationApi.md +1 -1
- package/docs/FeeType.md +4 -0
- package/docs/GetExchangeRate200Response.md +1 -1
- package/docs/GraphQLError.md +11 -0
- package/docs/GraphQLErrorLocationsInner.md +10 -0
- package/docs/GraphQLRequest.md +11 -0
- package/docs/GraphQLResponse.md +10 -0
- package/docs/ListTopUpPayers200Response.md +10 -0
- package/docs/ListTopUpPayers200ResponseDataInner.md +14 -0
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/Merchant.md +3 -2
- package/docs/OAuthApi.md +8 -8
- package/docs/Order.md +4 -3
- package/docs/OrganizationsApi.md +55 -0
- package/docs/PayerAccount.md +14 -0
- package/docs/PaymentApi.md +230 -6
- package/docs/PaymentOrderEventData.md +7 -4
- package/docs/PaymentRefundEventData.md +10 -5
- package/docs/PaymentSettlementEvent.md +6 -4
- package/docs/RefreshPermissionTokenRequest.md +1 -1
- package/docs/Refund.md +7 -4
- package/docs/RefundStatus.md +2 -0
- package/docs/SOLBase.md +10 -0
- package/docs/SOLComputeUnit.md +10 -0
- package/docs/Settlement.md +3 -3
- package/docs/SettlementDetail.md +7 -6
- package/docs/SettlementInfo.md +3 -2
- package/docs/SwapActivityDetail.md +1 -0
- package/docs/SwapActivitySigners.md +11 -0
- package/docs/SwapQuote.md +3 -2
- package/docs/SwapSingingStatus.md +16 -0
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListingEventData.md +3 -1
- package/docs/TokensEventData.md +3 -1
- package/docs/TopUpAddress.md +18 -0
- package/docs/TransactionCoboCategory.md +8 -0
- package/docs/TransactionDestination.md +2 -2
- package/docs/TransactionEvmCalldataInfo.md +1 -1
- package/docs/TransactionFILFee.md +16 -0
- package/docs/TransactionFee.md +8 -1
- package/docs/TransactionRequestFILFee.md +13 -0
- package/docs/TransactionRequestFee.md +5 -1
- package/docs/TransactionRequestSOLFee.md +12 -0
- package/docs/TransactionSOLFee.md +16 -0
- package/docs/TransactionTransferToAddressDestination.md +2 -2
- package/docs/TransactionTransferToWalletDestination.md +1 -1
- package/docs/TransactionWebhookEventData.md +3 -1
- package/docs/TransactionsApi.md +1 -1
- package/docs/TransferDestination.md +2 -2
- package/docs/UpdateMerchantByIdRequest.md +1 -0
- package/docs/UpdateRefundByIdRequest.md +9 -0
- package/docs/UpdateTopUpAddress.md +11 -0
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletsApi.md +3 -1
- package/docs/WebhookEvent.md +1 -1
- package/docs/WebhookEventData.md +14 -5
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventLog.md +1 -1
- package/docs/WebhookEventType.md +6 -0
- package/package.json +1 -1
- package/docs/TransactionMessageSignBTCEIP191Destination.md +0 -10
|
@@ -0,0 +1,230 @@
|
|
|
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 TopUpAddress model module.
|
|
29
|
+
* @module model/TopUpAddress
|
|
30
|
+
*/
|
|
31
|
+
var TopUpAddress = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>TopUpAddress</code>.
|
|
34
|
+
* The details of a top-up address
|
|
35
|
+
* @alias module:model/TopUpAddress
|
|
36
|
+
* @param address {String} The dedicated top-up address assigned to a specific payer under a merchant on a specified chain.
|
|
37
|
+
* @param payer_id {String} A unique identifier assigned by Cobo to track and identify individual payers.
|
|
38
|
+
* @param custom_payer_id {String} A unique identifier assigned by the developer to track and identify individual payers in their system.
|
|
39
|
+
* @param merchant_id {String} The merchant ID.
|
|
40
|
+
* @param token_id {String} The token ID, which is a unique identifier that specifies both the blockchain network and cryptocurrency token in the format `{CHAIN}_{TOKEN}`.
|
|
41
|
+
* @param min_amount {String} The minimum top-up amount allowed for this address. Top-ups below this threshold will not be credited to merchant funds, but to developer funds instead.
|
|
42
|
+
*/
|
|
43
|
+
function TopUpAddress(address, payer_id, custom_payer_id, merchant_id, token_id, min_amount) {
|
|
44
|
+
_classCallCheck(this, TopUpAddress);
|
|
45
|
+
TopUpAddress.initialize(this, address, payer_id, custom_payer_id, merchant_id, token_id, min_amount);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Initializes the fields of this object.
|
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
51
|
+
* Only for internal use.
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(TopUpAddress, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, address, payer_id, custom_payer_id, merchant_id, token_id, min_amount) {
|
|
56
|
+
obj['address'] = address;
|
|
57
|
+
obj['payer_id'] = payer_id;
|
|
58
|
+
obj['custom_payer_id'] = custom_payer_id;
|
|
59
|
+
obj['merchant_id'] = merchant_id;
|
|
60
|
+
obj['token_id'] = token_id;
|
|
61
|
+
obj['min_amount'] = min_amount;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a <code>TopUpAddress</code> from a plain JavaScript object, optionally creating a new instance.
|
|
66
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
67
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
68
|
+
* @param {module:model/TopUpAddress} obj Optional instance to populate.
|
|
69
|
+
* @return {module:model/TopUpAddress} The populated <code>TopUpAddress</code> instance.
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "constructFromObject",
|
|
73
|
+
value: function constructFromObject(data, obj) {
|
|
74
|
+
if (data) {
|
|
75
|
+
obj = obj || new TopUpAddress();
|
|
76
|
+
if (data.hasOwnProperty('address')) {
|
|
77
|
+
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
|
78
|
+
}
|
|
79
|
+
if (data.hasOwnProperty('payer_id')) {
|
|
80
|
+
obj['payer_id'] = _ApiClient["default"].convertToType(data['payer_id'], 'String');
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('custom_payer_id')) {
|
|
83
|
+
obj['custom_payer_id'] = _ApiClient["default"].convertToType(data['custom_payer_id'], 'String');
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('merchant_id')) {
|
|
86
|
+
obj['merchant_id'] = _ApiClient["default"].convertToType(data['merchant_id'], 'String');
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('token_id')) {
|
|
89
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
90
|
+
}
|
|
91
|
+
if (data.hasOwnProperty('chain')) {
|
|
92
|
+
obj['chain'] = _ApiClient["default"].convertToType(data['chain'], 'String');
|
|
93
|
+
}
|
|
94
|
+
if (data.hasOwnProperty('developer_fee_rate')) {
|
|
95
|
+
obj['developer_fee_rate'] = _ApiClient["default"].convertToType(data['developer_fee_rate'], 'String');
|
|
96
|
+
}
|
|
97
|
+
if (data.hasOwnProperty('min_amount')) {
|
|
98
|
+
obj['min_amount'] = _ApiClient["default"].convertToType(data['min_amount'], 'String');
|
|
99
|
+
}
|
|
100
|
+
if (data.hasOwnProperty('created_timestamp')) {
|
|
101
|
+
obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
|
|
102
|
+
}
|
|
103
|
+
if (data.hasOwnProperty('updated_timestamp')) {
|
|
104
|
+
obj['updated_timestamp'] = _ApiClient["default"].convertToType(data['updated_timestamp'], 'Number');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return obj;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Validates the JSON data with respect to <code>TopUpAddress</code>.
|
|
112
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
113
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TopUpAddress</code>.
|
|
114
|
+
*/
|
|
115
|
+
}, {
|
|
116
|
+
key: "validateJSON",
|
|
117
|
+
value: function validateJSON(data) {
|
|
118
|
+
// check to make sure all required properties are present in the JSON string
|
|
119
|
+
var _iterator = _createForOfIteratorHelper(TopUpAddress.RequiredProperties),
|
|
120
|
+
_step;
|
|
121
|
+
try {
|
|
122
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
123
|
+
var property = _step.value;
|
|
124
|
+
if (!data.hasOwnProperty(property)) {
|
|
125
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// ensure the json data is a string
|
|
129
|
+
} catch (err) {
|
|
130
|
+
_iterator.e(err);
|
|
131
|
+
} finally {
|
|
132
|
+
_iterator.f();
|
|
133
|
+
}
|
|
134
|
+
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
|
135
|
+
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
|
136
|
+
}
|
|
137
|
+
// ensure the json data is a string
|
|
138
|
+
if (data['payer_id'] && !(typeof data['payer_id'] === 'string' || data['payer_id'] instanceof String)) {
|
|
139
|
+
throw new Error("Expected the field `payer_id` to be a primitive type in the JSON string but got " + data['payer_id']);
|
|
140
|
+
}
|
|
141
|
+
// ensure the json data is a string
|
|
142
|
+
if (data['custom_payer_id'] && !(typeof data['custom_payer_id'] === 'string' || data['custom_payer_id'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `custom_payer_id` to be a primitive type in the JSON string but got " + data['custom_payer_id']);
|
|
144
|
+
}
|
|
145
|
+
// ensure the json data is a string
|
|
146
|
+
if (data['merchant_id'] && !(typeof data['merchant_id'] === 'string' || data['merchant_id'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `merchant_id` to be a primitive type in the JSON string but got " + data['merchant_id']);
|
|
148
|
+
}
|
|
149
|
+
// ensure the json data is a string
|
|
150
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
151
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
152
|
+
}
|
|
153
|
+
// ensure the json data is a string
|
|
154
|
+
if (data['chain'] && !(typeof data['chain'] === 'string' || data['chain'] instanceof String)) {
|
|
155
|
+
throw new Error("Expected the field `chain` to be a primitive type in the JSON string but got " + data['chain']);
|
|
156
|
+
}
|
|
157
|
+
// ensure the json data is a string
|
|
158
|
+
if (data['developer_fee_rate'] && !(typeof data['developer_fee_rate'] === 'string' || data['developer_fee_rate'] instanceof String)) {
|
|
159
|
+
throw new Error("Expected the field `developer_fee_rate` to be a primitive type in the JSON string but got " + data['developer_fee_rate']);
|
|
160
|
+
}
|
|
161
|
+
// ensure the json data is a string
|
|
162
|
+
if (data['min_amount'] && !(typeof data['min_amount'] === 'string' || data['min_amount'] instanceof String)) {
|
|
163
|
+
throw new Error("Expected the field `min_amount` to be a primitive type in the JSON string but got " + data['min_amount']);
|
|
164
|
+
}
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}]);
|
|
168
|
+
}();
|
|
169
|
+
TopUpAddress.RequiredProperties = ["address", "payer_id", "custom_payer_id", "merchant_id", "token_id", "min_amount"];
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The dedicated top-up address assigned to a specific payer under a merchant on a specified chain.
|
|
173
|
+
* @member {String} address
|
|
174
|
+
*/
|
|
175
|
+
TopUpAddress.prototype['address'] = undefined;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* A unique identifier assigned by Cobo to track and identify individual payers.
|
|
179
|
+
* @member {String} payer_id
|
|
180
|
+
*/
|
|
181
|
+
TopUpAddress.prototype['payer_id'] = undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* A unique identifier assigned by the developer to track and identify individual payers in their system.
|
|
185
|
+
* @member {String} custom_payer_id
|
|
186
|
+
*/
|
|
187
|
+
TopUpAddress.prototype['custom_payer_id'] = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The merchant ID.
|
|
191
|
+
* @member {String} merchant_id
|
|
192
|
+
*/
|
|
193
|
+
TopUpAddress.prototype['merchant_id'] = undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The token ID, which is a unique identifier that specifies both the blockchain network and cryptocurrency token in the format `{CHAIN}_{TOKEN}`.
|
|
197
|
+
* @member {String} token_id
|
|
198
|
+
*/
|
|
199
|
+
TopUpAddress.prototype['token_id'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The chain ID.
|
|
203
|
+
* @member {String} chain
|
|
204
|
+
*/
|
|
205
|
+
TopUpAddress.prototype['chain'] = undefined;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The developer fee rate applied to top-up transactions made to this address. Expressed as a decimal string where \"0.1\" represents 10%.
|
|
209
|
+
* @member {String} developer_fee_rate
|
|
210
|
+
*/
|
|
211
|
+
TopUpAddress.prototype['developer_fee_rate'] = undefined;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The minimum top-up amount allowed for this address. Top-ups below this threshold will not be credited to merchant funds, but to developer funds instead.
|
|
215
|
+
* @member {String} min_amount
|
|
216
|
+
*/
|
|
217
|
+
TopUpAddress.prototype['min_amount'] = undefined;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The creation time of the top-up address, represented as a UNIX timestamp in seconds.
|
|
221
|
+
* @member {Number} created_timestamp
|
|
222
|
+
*/
|
|
223
|
+
TopUpAddress.prototype['created_timestamp'] = undefined;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The last update time of the top-up address, represented as a UNIX timestamp in seconds.
|
|
227
|
+
* @member {Number} updated_timestamp
|
|
228
|
+
*/
|
|
229
|
+
TopUpAddress.prototype['updated_timestamp'] = undefined;
|
|
230
|
+
var _default = exports["default"] = TopUpAddress;
|
|
@@ -165,6 +165,26 @@ var TransactionCoboCategory = exports["default"] = /*#__PURE__*/function () {
|
|
|
165
165
|
* @const
|
|
166
166
|
*/
|
|
167
167
|
_defineProperty(this, "StakingSkyfarmUnstake", "StakingSkyfarmUnstake");
|
|
168
|
+
/**
|
|
169
|
+
* value: "ScreenAppRefund"
|
|
170
|
+
* @const
|
|
171
|
+
*/
|
|
172
|
+
_defineProperty(this, "ScreenAppRefund", "ScreenAppRefund");
|
|
173
|
+
/**
|
|
174
|
+
* value: "ScreenAppIsolate"
|
|
175
|
+
* @const
|
|
176
|
+
*/
|
|
177
|
+
_defineProperty(this, "ScreenAppIsolate", "ScreenAppIsolate");
|
|
178
|
+
/**
|
|
179
|
+
* value: "ComplianceRefund"
|
|
180
|
+
* @const
|
|
181
|
+
*/
|
|
182
|
+
_defineProperty(this, "ComplianceRefund", "ComplianceRefund");
|
|
183
|
+
/**
|
|
184
|
+
* value: "ComplianceIsolate"
|
|
185
|
+
* @const
|
|
186
|
+
*/
|
|
187
|
+
_defineProperty(this, "ComplianceIsolate", "ComplianceIsolate");
|
|
168
188
|
/**
|
|
169
189
|
* value: "unknown_default_open_api"
|
|
170
190
|
* @const
|
|
@@ -18,7 +18,6 @@ var _TransactionDepositToWalletDestination = _interopRequireDefault(require("./T
|
|
|
18
18
|
var _TransactionDestinationType = _interopRequireDefault(require("./TransactionDestinationType"));
|
|
19
19
|
var _TransactionEvmCalldataInfo = _interopRequireDefault(require("./TransactionEvmCalldataInfo"));
|
|
20
20
|
var _TransactionEvmContractDestination = _interopRequireDefault(require("./TransactionEvmContractDestination"));
|
|
21
|
-
var _TransactionMessageSignBTCEIP191Destination = _interopRequireDefault(require("./TransactionMessageSignBTCEIP191Destination"));
|
|
22
21
|
var _TransactionMessageSignEIP191Destination = _interopRequireDefault(require("./TransactionMessageSignEIP191Destination"));
|
|
23
22
|
var _TransactionMessageSignEIP712Destination = _interopRequireDefault(require("./TransactionMessageSignEIP712Destination"));
|
|
24
23
|
var _TransactionRawMessageSignDestination = _interopRequireDefault(require("./TransactionRawMessageSignDestination"));
|
|
@@ -56,7 +55,7 @@ var TransactionDestination = /*#__PURE__*/function () {
|
|
|
56
55
|
/**
|
|
57
56
|
* Constructs a new <code>TransactionDestination</code>.
|
|
58
57
|
* @alias module:model/TransactionDestination
|
|
59
|
-
* @param {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/
|
|
58
|
+
* @param {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/TransactionMessageSignEIP191Destination|module:model/TransactionMessageSignEIP712Destination|module:model/TransactionRawMessageSignDestination|module:model/TransactionSolContractDestination|module:model/TransactionTransferToAddressDestination|module:model/TransactionTransferToWalletDestination)} instance The actual instance to initialize TransactionDestination.
|
|
60
59
|
*/
|
|
61
60
|
function TransactionDestination() {
|
|
62
61
|
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -89,10 +88,6 @@ var TransactionDestination = /*#__PURE__*/function () {
|
|
|
89
88
|
this.actualInstance = _TransactionBIP322Destination["default"].constructFromObject(instance);
|
|
90
89
|
match++;
|
|
91
90
|
break;
|
|
92
|
-
case "BTC_EIP_191_Signature":
|
|
93
|
-
this.actualInstance = _TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance);
|
|
94
|
-
match++;
|
|
95
|
-
break;
|
|
96
91
|
case "COSMOS_ADR_36_Signature":
|
|
97
92
|
this.actualInstance = _TransactionCosmosAdr36Destination["default"].constructFromObject(instance);
|
|
98
93
|
match++;
|
|
@@ -304,29 +299,6 @@ var TransactionDestination = /*#__PURE__*/function () {
|
|
|
304
299
|
// json data failed to deserialize into TransactionMessageSignEIP712Destination
|
|
305
300
|
errorMessages.push("Failed to construct TransactionMessageSignEIP712Destination: " + err);
|
|
306
301
|
}
|
|
307
|
-
try {
|
|
308
|
-
if (instance instanceof _TransactionMessageSignBTCEIP191Destination["default"]) {
|
|
309
|
-
this.actualInstance = instance;
|
|
310
|
-
} else if (!!_TransactionMessageSignBTCEIP191Destination["default"].validateJSON && _TransactionMessageSignBTCEIP191Destination["default"].validateJSON(instance)) {
|
|
311
|
-
// plain JS object
|
|
312
|
-
// create TransactionMessageSignBTCEIP191Destination from JS object
|
|
313
|
-
this.actualInstance = _TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance);
|
|
314
|
-
} else {
|
|
315
|
-
if (_TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance)) {
|
|
316
|
-
if (!!_TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance).toJSON) {
|
|
317
|
-
if (_TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance).toJSON()) {
|
|
318
|
-
this.actualInstance = _TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance);
|
|
319
|
-
}
|
|
320
|
-
} else {
|
|
321
|
-
this.actualInstance = _TransactionMessageSignBTCEIP191Destination["default"].constructFromObject(instance);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
match++;
|
|
326
|
-
} catch (err) {
|
|
327
|
-
// json data failed to deserialize into TransactionMessageSignBTCEIP191Destination
|
|
328
|
-
errorMessages.push("Failed to construct TransactionMessageSignBTCEIP191Destination: " + err);
|
|
329
|
-
}
|
|
330
302
|
try {
|
|
331
303
|
if (instance instanceof _TransactionRawMessageSignDestination["default"]) {
|
|
332
304
|
this.actualInstance = instance;
|
|
@@ -467,11 +439,11 @@ var TransactionDestination = /*#__PURE__*/function () {
|
|
|
467
439
|
}
|
|
468
440
|
|
|
469
441
|
// if (match > 1) {
|
|
470
|
-
// throw new Error("Multiple matches found constructing `TransactionDestination` with oneOf schemas TransactionBIP137Destination, TransactionBIP322Destination, TransactionCosmosAdr36Destination, TransactionCosmosContractDestination, TransactionDepositToAddressDestination, TransactionDepositToWalletDestination, TransactionEvmContractDestination,
|
|
442
|
+
// throw new Error("Multiple matches found constructing `TransactionDestination` with oneOf schemas TransactionBIP137Destination, TransactionBIP322Destination, TransactionCosmosAdr36Destination, TransactionCosmosContractDestination, TransactionDepositToAddressDestination, TransactionDepositToWalletDestination, TransactionEvmContractDestination, TransactionMessageSignEIP191Destination, TransactionMessageSignEIP712Destination, TransactionRawMessageSignDestination, TransactionSolContractDestination, TransactionTransferToAddressDestination, TransactionTransferToWalletDestination. Input: " + JSON.stringify(instance));
|
|
471
443
|
// } else
|
|
472
444
|
if (match === 0) {
|
|
473
445
|
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
474
|
-
// throw new Error("No match found constructing `TransactionDestination` with oneOf schemas TransactionBIP137Destination, TransactionBIP322Destination, TransactionCosmosAdr36Destination, TransactionCosmosContractDestination, TransactionDepositToAddressDestination, TransactionDepositToWalletDestination, TransactionEvmContractDestination,
|
|
446
|
+
// throw new Error("No match found constructing `TransactionDestination` with oneOf schemas TransactionBIP137Destination, TransactionBIP322Destination, TransactionCosmosAdr36Destination, TransactionCosmosContractDestination, TransactionDepositToAddressDestination, TransactionDepositToWalletDestination, TransactionEvmContractDestination, TransactionMessageSignEIP191Destination, TransactionMessageSignEIP712Destination, TransactionRawMessageSignDestination, TransactionSolContractDestination, TransactionTransferToAddressDestination, TransactionTransferToWalletDestination. Details: " +
|
|
475
447
|
// errorMessages.join(", "));
|
|
476
448
|
return;
|
|
477
449
|
} else {// only 1 match
|
|
@@ -490,16 +462,16 @@ var TransactionDestination = /*#__PURE__*/function () {
|
|
|
490
462
|
key: "getActualInstance",
|
|
491
463
|
value:
|
|
492
464
|
/**
|
|
493
|
-
* Gets the actual instance, which can be <code>TransactionBIP137Destination</code>, <code>TransactionBIP322Destination</code>, <code>TransactionCosmosAdr36Destination</code>, <code>TransactionCosmosContractDestination</code>, <code>TransactionDepositToAddressDestination</code>, <code>TransactionDepositToWalletDestination</code>, <code>TransactionEvmContractDestination</code>, <code>
|
|
494
|
-
* @return {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/
|
|
465
|
+
* Gets the actual instance, which can be <code>TransactionBIP137Destination</code>, <code>TransactionBIP322Destination</code>, <code>TransactionCosmosAdr36Destination</code>, <code>TransactionCosmosContractDestination</code>, <code>TransactionDepositToAddressDestination</code>, <code>TransactionDepositToWalletDestination</code>, <code>TransactionEvmContractDestination</code>, <code>TransactionMessageSignEIP191Destination</code>, <code>TransactionMessageSignEIP712Destination</code>, <code>TransactionRawMessageSignDestination</code>, <code>TransactionSolContractDestination</code>, <code>TransactionTransferToAddressDestination</code>, <code>TransactionTransferToWalletDestination</code>.
|
|
466
|
+
* @return {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/TransactionMessageSignEIP191Destination|module:model/TransactionMessageSignEIP712Destination|module:model/TransactionRawMessageSignDestination|module:model/TransactionSolContractDestination|module:model/TransactionTransferToAddressDestination|module:model/TransactionTransferToWalletDestination)} The actual instance.
|
|
495
467
|
*/
|
|
496
468
|
function getActualInstance() {
|
|
497
469
|
return this.actualInstance;
|
|
498
470
|
}
|
|
499
471
|
|
|
500
472
|
/**
|
|
501
|
-
* Sets the actual instance, which can be <code>TransactionBIP137Destination</code>, <code>TransactionBIP322Destination</code>, <code>TransactionCosmosAdr36Destination</code>, <code>TransactionCosmosContractDestination</code>, <code>TransactionDepositToAddressDestination</code>, <code>TransactionDepositToWalletDestination</code>, <code>TransactionEvmContractDestination</code>, <code>
|
|
502
|
-
* @param {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/
|
|
473
|
+
* Sets the actual instance, which can be <code>TransactionBIP137Destination</code>, <code>TransactionBIP322Destination</code>, <code>TransactionCosmosAdr36Destination</code>, <code>TransactionCosmosContractDestination</code>, <code>TransactionDepositToAddressDestination</code>, <code>TransactionDepositToWalletDestination</code>, <code>TransactionEvmContractDestination</code>, <code>TransactionMessageSignEIP191Destination</code>, <code>TransactionMessageSignEIP712Destination</code>, <code>TransactionRawMessageSignDestination</code>, <code>TransactionSolContractDestination</code>, <code>TransactionTransferToAddressDestination</code>, <code>TransactionTransferToWalletDestination</code>.
|
|
474
|
+
* @param {(module:model/TransactionBIP137Destination|module:model/TransactionBIP322Destination|module:model/TransactionCosmosAdr36Destination|module:model/TransactionCosmosContractDestination|module:model/TransactionDepositToAddressDestination|module:model/TransactionDepositToWalletDestination|module:model/TransactionEvmContractDestination|module:model/TransactionMessageSignEIP191Destination|module:model/TransactionMessageSignEIP712Destination|module:model/TransactionRawMessageSignDestination|module:model/TransactionSolContractDestination|module:model/TransactionTransferToAddressDestination|module:model/TransactionTransferToWalletDestination)} obj The actual instance.
|
|
503
475
|
*/
|
|
504
476
|
}, {
|
|
505
477
|
key: "setActualInstance",
|
|
@@ -544,13 +516,13 @@ TransactionDestination.prototype['utxo_outputs'] = undefined;
|
|
|
544
516
|
TransactionDestination.prototype['change_address'] = undefined;
|
|
545
517
|
|
|
546
518
|
/**
|
|
547
|
-
* 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.
|
|
519
|
+
* 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. If both `force_internal` and `force_external` are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
|
|
548
520
|
* @member {Boolean} force_internal
|
|
549
521
|
*/
|
|
550
522
|
TransactionDestination.prototype['force_internal'] = undefined;
|
|
551
523
|
|
|
552
524
|
/**
|
|
553
|
-
* 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.
|
|
525
|
+
* 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. If both `force_internal` and `force_external` are set to `false`, the system uses Cobo Loop by default if possible; otherwise, it proceeds with an on-chain transfer.
|
|
554
526
|
* @member {Boolean} force_external
|
|
555
527
|
*/
|
|
556
528
|
TransactionDestination.prototype['force_external'] = undefined;
|
|
@@ -678,5 +650,5 @@ TransactionDestination.prototype['message_bip322'] = undefined;
|
|
|
678
650
|
* @member {String} message_cosmos_adr36
|
|
679
651
|
*/
|
|
680
652
|
TransactionDestination.prototype['message_cosmos_adr36'] = undefined;
|
|
681
|
-
TransactionDestination.OneOf = ["TransactionBIP137Destination", "TransactionBIP322Destination", "TransactionCosmosAdr36Destination", "TransactionCosmosContractDestination", "TransactionDepositToAddressDestination", "TransactionDepositToWalletDestination", "TransactionEvmContractDestination", "
|
|
653
|
+
TransactionDestination.OneOf = ["TransactionBIP137Destination", "TransactionBIP322Destination", "TransactionCosmosAdr36Destination", "TransactionCosmosContractDestination", "TransactionDepositToAddressDestination", "TransactionDepositToWalletDestination", "TransactionEvmContractDestination", "TransactionMessageSignEIP191Destination", "TransactionMessageSignEIP712Destination", "TransactionRawMessageSignDestination", "TransactionSolContractDestination", "TransactionTransferToAddressDestination", "TransactionTransferToWalletDestination"];
|
|
682
654
|
var _default = exports["default"] = TransactionDestination;
|
|
@@ -129,7 +129,7 @@ var TransactionEvmCalldataInfo = /*#__PURE__*/function () {
|
|
|
129
129
|
}]);
|
|
130
130
|
}();
|
|
131
131
|
/**
|
|
132
|
-
* The ID of the chain on which the smart contract is
|
|
132
|
+
* The ID of the chain on which the smart contract is issued.
|
|
133
133
|
* @member {String} chain_id
|
|
134
134
|
*/
|
|
135
135
|
TransactionEvmCalldataInfo.prototype['chain_id'] = undefined;
|
|
@@ -0,0 +1,229 @@
|
|
|
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 _FILBase = _interopRequireDefault(require("./FILBase"));
|
|
9
|
+
var _FILPrice = _interopRequireDefault(require("./FILPrice"));
|
|
10
|
+
var _FeeType = _interopRequireDefault(require("./FeeType"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; } } }; }
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
+
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); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
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); } /**
|
|
21
|
+
* Cobo Wallet as a Service 2.0
|
|
22
|
+
*
|
|
23
|
+
* Contact: help@cobo.com
|
|
24
|
+
*
|
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
|
+
* https://openapi-generator.tech
|
|
27
|
+
* Do not edit the class manually.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The TransactionFILFee model module.
|
|
32
|
+
* @module model/TransactionFILFee
|
|
33
|
+
*/
|
|
34
|
+
var TransactionFILFee = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>TransactionFILFee</code>.
|
|
37
|
+
* The transaction fee actually charged by the chain that uses the FIL fee model. In the Fil fee model, the calculation method for the fee is: fee = gas_fee_cap * gas_limit, refer to [Fee models](https://www.cobo.com/developers/v2/guides/transactions/estimate-fees#fee-models). Switch between the tabs to display the properties for different transaction fee models.
|
|
38
|
+
* @alias module:model/TransactionFILFee
|
|
39
|
+
* @implements module:model/FILBase
|
|
40
|
+
* @implements module:model/FILPrice
|
|
41
|
+
* @param fee_type {module:model/FeeType}
|
|
42
|
+
*/
|
|
43
|
+
function TransactionFILFee(fee_type) {
|
|
44
|
+
_classCallCheck(this, TransactionFILFee);
|
|
45
|
+
_FILBase["default"].initialize(this);
|
|
46
|
+
_FILPrice["default"].initialize(this);
|
|
47
|
+
TransactionFILFee.initialize(this, fee_type);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the fields of this object.
|
|
52
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
53
|
+
* Only for internal use.
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(TransactionFILFee, null, [{
|
|
56
|
+
key: "initialize",
|
|
57
|
+
value: function initialize(obj, fee_type) {
|
|
58
|
+
obj['fee_type'] = fee_type;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Constructs a <code>TransactionFILFee</code> from a plain JavaScript object, optionally creating a new instance.
|
|
63
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
64
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
65
|
+
* @param {module:model/TransactionFILFee} obj Optional instance to populate.
|
|
66
|
+
* @return {module:model/TransactionFILFee} The populated <code>TransactionFILFee</code> instance.
|
|
67
|
+
*/
|
|
68
|
+
}, {
|
|
69
|
+
key: "constructFromObject",
|
|
70
|
+
value: function constructFromObject(data, obj) {
|
|
71
|
+
if (data) {
|
|
72
|
+
obj = obj || new TransactionFILFee();
|
|
73
|
+
_FILBase["default"].constructFromObject(data, obj);
|
|
74
|
+
_FILPrice["default"].constructFromObject(data, obj);
|
|
75
|
+
if (data.hasOwnProperty('gas_base')) {
|
|
76
|
+
obj['gas_base'] = _ApiClient["default"].convertToType(data['gas_base'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('gas_premium')) {
|
|
79
|
+
obj['gas_premium'] = _ApiClient["default"].convertToType(data['gas_premium'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('gas_fee_cap')) {
|
|
82
|
+
obj['gas_fee_cap'] = _ApiClient["default"].convertToType(data['gas_fee_cap'], 'String');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('gas_limit')) {
|
|
85
|
+
obj['gas_limit'] = _ApiClient["default"].convertToType(data['gas_limit'], 'String');
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('fee_type')) {
|
|
88
|
+
obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
|
|
89
|
+
}
|
|
90
|
+
if (data.hasOwnProperty('token_id')) {
|
|
91
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
92
|
+
}
|
|
93
|
+
if (data.hasOwnProperty('fee_used')) {
|
|
94
|
+
obj['fee_used'] = _ApiClient["default"].convertToType(data['fee_used'], 'String');
|
|
95
|
+
}
|
|
96
|
+
if (data.hasOwnProperty('estimated_fee_used')) {
|
|
97
|
+
obj['estimated_fee_used'] = _ApiClient["default"].convertToType(data['estimated_fee_used'], 'String');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return obj;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Validates the JSON data with respect to <code>TransactionFILFee</code>.
|
|
105
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
106
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>TransactionFILFee</code>.
|
|
107
|
+
*/
|
|
108
|
+
}, {
|
|
109
|
+
key: "validateJSON",
|
|
110
|
+
value: function validateJSON(data) {
|
|
111
|
+
// check to make sure all required properties are present in the JSON string
|
|
112
|
+
var _iterator = _createForOfIteratorHelper(TransactionFILFee.RequiredProperties),
|
|
113
|
+
_step;
|
|
114
|
+
try {
|
|
115
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
116
|
+
var property = _step.value;
|
|
117
|
+
if (!data.hasOwnProperty(property)) {
|
|
118
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// ensure the json data is a string
|
|
122
|
+
} catch (err) {
|
|
123
|
+
_iterator.e(err);
|
|
124
|
+
} finally {
|
|
125
|
+
_iterator.f();
|
|
126
|
+
}
|
|
127
|
+
if (data['gas_base'] && !(typeof data['gas_base'] === 'string' || data['gas_base'] instanceof String)) {
|
|
128
|
+
throw new Error("Expected the field `gas_base` to be a primitive type in the JSON string but got " + data['gas_base']);
|
|
129
|
+
}
|
|
130
|
+
// ensure the json data is a string
|
|
131
|
+
if (data['gas_premium'] && !(typeof data['gas_premium'] === 'string' || data['gas_premium'] instanceof String)) {
|
|
132
|
+
throw new Error("Expected the field `gas_premium` to be a primitive type in the JSON string but got " + data['gas_premium']);
|
|
133
|
+
}
|
|
134
|
+
// ensure the json data is a string
|
|
135
|
+
if (data['gas_fee_cap'] && !(typeof data['gas_fee_cap'] === 'string' || data['gas_fee_cap'] instanceof String)) {
|
|
136
|
+
throw new Error("Expected the field `gas_fee_cap` to be a primitive type in the JSON string but got " + data['gas_fee_cap']);
|
|
137
|
+
}
|
|
138
|
+
// ensure the json data is a string
|
|
139
|
+
if (data['gas_limit'] && !(typeof data['gas_limit'] === 'string' || data['gas_limit'] instanceof String)) {
|
|
140
|
+
throw new Error("Expected the field `gas_limit` to be a primitive type in the JSON string but got " + data['gas_limit']);
|
|
141
|
+
}
|
|
142
|
+
// ensure the json data is a string
|
|
143
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
144
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
145
|
+
}
|
|
146
|
+
// ensure the json data is a string
|
|
147
|
+
if (data['fee_used'] && !(typeof data['fee_used'] === 'string' || data['fee_used'] instanceof String)) {
|
|
148
|
+
throw new Error("Expected the field `fee_used` to be a primitive type in the JSON string but got " + data['fee_used']);
|
|
149
|
+
}
|
|
150
|
+
// ensure the json data is a string
|
|
151
|
+
if (data['estimated_fee_used'] && !(typeof data['estimated_fee_used'] === 'string' || data['estimated_fee_used'] instanceof String)) {
|
|
152
|
+
throw new Error("Expected the field `estimated_fee_used` to be a primitive type in the JSON string but got " + data['estimated_fee_used']);
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
}();
|
|
158
|
+
TransactionFILFee.RequiredProperties = ["fee_type"];
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* This is the minimum fee required to include a transaction in a block. It is determined by the network's congestion level, which adjusts to maintain a target block utilization rate. The base fee is burned, reducing the total supply of Filecoin over time.
|
|
162
|
+
* @member {String} gas_base
|
|
163
|
+
*/
|
|
164
|
+
TransactionFILFee.prototype['gas_base'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* An optional additional fee that users can include to prioritize their transactions over others. It acts like a tip to incentivize miners to select and include your transaction over transactions with only the base fee.
|
|
168
|
+
* @member {String} gas_premium
|
|
169
|
+
*/
|
|
170
|
+
TransactionFILFee.prototype['gas_premium'] = undefined;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The gas_fee_cap is a user-defined limit on how much they are willing to pay per unit of gas.
|
|
174
|
+
* @member {String} gas_fee_cap
|
|
175
|
+
*/
|
|
176
|
+
TransactionFILFee.prototype['gas_fee_cap'] = undefined;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* This defines the maximum amount of computational effort that a transaction is allowed to consume. It's a way to cap the resources that a transaction can use, ensuring it doesn't consume excessive network resources.
|
|
180
|
+
* @member {String} gas_limit
|
|
181
|
+
*/
|
|
182
|
+
TransactionFILFee.prototype['gas_limit'] = undefined;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @member {module:model/FeeType} fee_type
|
|
186
|
+
*/
|
|
187
|
+
TransactionFILFee.prototype['fee_type'] = undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The token ID of the transaction fee.
|
|
191
|
+
* @member {String} token_id
|
|
192
|
+
*/
|
|
193
|
+
TransactionFILFee.prototype['token_id'] = undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The transaction fee.
|
|
197
|
+
* @member {String} fee_used
|
|
198
|
+
*/
|
|
199
|
+
TransactionFILFee.prototype['fee_used'] = undefined;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The estimated transaction fee.
|
|
203
|
+
* @member {String} estimated_fee_used
|
|
204
|
+
*/
|
|
205
|
+
TransactionFILFee.prototype['estimated_fee_used'] = undefined;
|
|
206
|
+
|
|
207
|
+
// Implement FILBase interface:
|
|
208
|
+
/**
|
|
209
|
+
* This is the minimum fee required to include a transaction in a block. It is determined by the network's congestion level, which adjusts to maintain a target block utilization rate. The base fee is burned, reducing the total supply of Filecoin over time.
|
|
210
|
+
* @member {String} gas_base
|
|
211
|
+
*/
|
|
212
|
+
_FILBase["default"].prototype['gas_base'] = undefined;
|
|
213
|
+
// Implement FILPrice interface:
|
|
214
|
+
/**
|
|
215
|
+
* An optional additional fee that users can include to prioritize their transactions over others. It acts like a tip to incentivize miners to select and include your transaction over transactions with only the base fee.
|
|
216
|
+
* @member {String} gas_premium
|
|
217
|
+
*/
|
|
218
|
+
_FILPrice["default"].prototype['gas_premium'] = undefined;
|
|
219
|
+
/**
|
|
220
|
+
* The gas_fee_cap is a user-defined limit on how much they are willing to pay per unit of gas.
|
|
221
|
+
* @member {String} gas_fee_cap
|
|
222
|
+
*/
|
|
223
|
+
_FILPrice["default"].prototype['gas_fee_cap'] = undefined;
|
|
224
|
+
/**
|
|
225
|
+
* This defines the maximum amount of computational effort that a transaction is allowed to consume. It's a way to cap the resources that a transaction can use, ensuring it doesn't consume excessive network resources.
|
|
226
|
+
* @member {String} gas_limit
|
|
227
|
+
*/
|
|
228
|
+
_FILPrice["default"].prototype['gas_limit'] = undefined;
|
|
229
|
+
var _default = exports["default"] = TransactionFILFee;
|