@cobo/cobo-waas2 1.23.0 → 1.25.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 +68 -6
- package/dist/ApiClient.js +1 -1
- package/dist/api/AddressBooksApi.js +6 -6
- package/dist/api/ComplianceApi.js +132 -2
- package/dist/api/DevelopersWebhooksApi.js +2 -2
- package/dist/api/FeeStationApi.js +47 -4
- package/dist/api/PaymentApi.js +246 -56
- package/dist/api/SwapsApi.js +374 -0
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/index.js +336 -14
- package/dist/model/AddressInfo.js +13 -0
- package/dist/model/AddressesEventData.js +8 -3
- package/dist/model/AddressesEventDataAllOfAddresses.js +18 -0
- package/dist/model/BalanceUpdateInfoEventData.js +8 -3
- package/dist/model/BridgingFee.js +136 -0
- package/dist/model/ChainsEventData.js +8 -3
- package/dist/model/CommissionFee.js +110 -0
- package/dist/model/ComplianceDispositionUpdateEventData.js +8 -3
- package/dist/model/ComplianceKytScreeningsUpdateEventData.js +305 -0
- package/dist/model/ContractCallDestination.js +48 -8
- package/dist/model/ContractCallDestinationType.js +5 -0
- package/dist/model/CreateMerchantRequest.js +15 -8
- package/dist/model/CreateOrderLinkRequest.js +129 -0
- package/dist/model/CreatePaymentOrderRequest.js +27 -1
- package/dist/model/CreateRefundRequest.js +2 -2
- package/dist/model/CreateSettlement.js +3 -29
- package/dist/model/CreateSettlementRequestRequest.js +39 -0
- package/dist/model/CreateSwapActivityRequest.js +193 -0
- package/dist/model/CustodialTransferDestination.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +1 -1
- package/dist/model/EstimateFeeParams.js +1 -1
- package/dist/model/EstimateTransferFeeParams.js +1 -1
- package/dist/model/EstimatedEvmEip1559Fee.js +1 -1
- package/dist/model/EstimatedEvmLegacyFee.js +1 -1
- package/dist/model/EstimatedFILFee.js +1 -1
- package/dist/model/EstimatedFixedFee.js +1 -1
- package/dist/model/EstimatedSOLFee.js +1 -1
- package/dist/model/EstimatedUtxoFee.js +1 -1
- package/dist/model/FeeStationCheckFeeStationUsage.js +186 -0
- package/dist/model/FeeStationCheckFeeStationUsageResponse.js +200 -0
- package/dist/model/FeeStationGasStationType.js +61 -0
- package/dist/model/FundsStatusType.js +111 -0
- package/dist/model/KytScreeningsDecisionsType.js +71 -0
- package/dist/model/KytScreeningsEventData.js +155 -0
- package/dist/model/KytScreeningsReviewType.js +61 -0
- package/dist/model/KytScreeningsTransaction.js +144 -0
- package/dist/model/KytScreeningsTransactionType.js +61 -0
- package/dist/model/Link.js +125 -0
- package/dist/model/LinkDisplayInfo.js +100 -0
- package/dist/model/ListSwapActivities200Response.js +123 -0
- package/dist/model/ListSwapEnabledTokens200Response.js +123 -0
- package/dist/model/ListTopUpPayerAccounts200Response.js +123 -0
- package/dist/model/MPCVaultEventData.js +8 -3
- package/dist/model/Merchant.js +12 -3
- package/dist/model/MerchantBalance.js +3 -3
- package/dist/model/MessageSignDestination.js +8 -70
- package/dist/model/Order.js +13 -0
- package/dist/model/OrderLinkBusinessInfo.js +261 -0
- package/dist/model/OrderLinkBusinessInfoCustomExchangeRatesInner.js +125 -0
- package/dist/model/OtcFee.js +123 -0
- package/dist/model/PaymentAddressUpdateEventData.js +8 -3
- package/dist/model/PaymentEstimateFee.js +125 -0
- package/dist/model/PaymentEstimateFee201Response.js +108 -0
- package/dist/model/PaymentEstimateFeeRequest.js +137 -0
- package/dist/model/PaymentEstimatedFee.js +173 -0
- package/dist/model/PaymentFeeType.js +71 -0
- package/dist/model/PaymentOrderEventData.js +26 -3
- package/dist/model/PaymentRefundEventData.js +30 -5
- package/dist/model/PaymentSettlementEvent.js +70 -9
- package/dist/model/PaymentTransactionEventData.js +8 -3
- package/dist/model/PspBalance.js +3 -3
- package/dist/model/Refund.js +17 -1
- package/dist/model/ReviewStatusType.js +91 -0
- package/dist/model/SettleRequestStatus.js +5 -0
- package/dist/model/Settlement.js +45 -3
- package/dist/model/SettlementDetail.js +33 -1
- package/dist/model/SettlementInfo.js +7 -7
- package/dist/model/SolContractCallAddressLookupTableAccount.js +126 -0
- package/dist/model/SolContractCallDestination.js +30 -0
- package/dist/model/StellarContractCallContractParam.js +164 -0
- package/dist/model/StellarContractCallContractType.js +56 -0
- package/dist/model/StellarContractCallDestination.js +125 -0
- package/dist/model/StellarContractCallTrustLineOperationType.js +56 -0
- package/dist/model/StellarContractCallTrustLineParam.js +133 -0
- package/dist/model/SubmitKytResponse.js +122 -0
- package/dist/model/SubmitKytScreeningsDecisionsBody.js +122 -0
- package/dist/model/{RawMessageSignDestination.js → SubmitKytScreeningsReviewBody.js} +36 -36
- package/dist/model/SupportedToken.js +9 -0
- package/dist/model/SuspendedTokenEventData.js +8 -3
- package/dist/model/SwapActivity.js +9 -9
- package/dist/model/SwapActivityApprovers.js +1 -1
- package/dist/model/SwapActivityDetail.js +34 -18
- package/dist/model/SwapActivitySigners.js +2 -2
- package/dist/model/SwapActivityTimeline.js +5 -5
- package/dist/model/SwapEstimateFee.js +147 -0
- package/dist/model/SwapQuote.js +18 -31
- package/dist/model/SwapReceivingTransaction.js +133 -0
- package/dist/model/SwapToken.js +9 -9
- package/dist/model/TSSRequestWebhookEventData.js +8 -3
- package/dist/model/TokenListingEventData.js +8 -3
- package/dist/model/TokensEventData.js +8 -3
- package/dist/model/TransactionCoboCategory.js +5 -0
- package/dist/model/TransactionDestination.js +48 -8
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionEvmEip1559Fee.js +1 -1
- package/dist/model/TransactionEvmLegacyFee.js +1 -1
- package/dist/model/TransactionFILFee.js +1 -1
- package/dist/model/TransactionFixedFee.js +1 -1
- package/dist/model/TransactionFuelingInfo.js +13 -0
- package/dist/model/TransactionRequestEvmEip1559Fee.js +1 -1
- package/dist/model/TransactionRequestEvmLegacyFee.js +1 -1
- package/dist/model/TransactionRequestFILFee.js +1 -1
- package/dist/model/TransactionRequestSOLFee.js +1 -1
- package/dist/model/TransactionRequestUtxoFee.js +1 -1
- package/dist/model/TransactionSOLFee.js +1 -1
- package/dist/model/TransactionSolContractAddressLookupTableAccount.js +126 -0
- package/dist/model/TransactionSolContractDestination.js +30 -0
- package/dist/model/TransactionStellarContractParam.js +164 -0
- package/dist/model/TransactionStellarContractType.js +56 -0
- package/dist/model/{BTCEIP191MessageSignDestination.js → TransactionStellarDestination.js} +38 -35
- package/dist/model/TransactionStellarTrustLineOperationType.js +56 -0
- package/dist/model/TransactionStellarTrustLineParam.js +133 -0
- package/dist/model/TransactionUtxoFee.js +1 -1
- package/dist/model/TransactionWebhookEventData.js +8 -3
- package/dist/model/UpdateBankAccountByIdRequest.js +108 -0
- package/dist/model/UpdateTopUpAddress.js +4 -6
- package/dist/model/WalletInfoEventData.js +8 -3
- package/dist/model/WalletSetup.js +66 -0
- package/dist/model/WebhookEventData.js +81 -11
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +10 -0
- package/docs/AddressBooksApi.md +3 -3
- package/docs/AddressInfo.md +1 -0
- package/docs/AddressesEventData.md +3 -1
- package/docs/AddressesEventDataAllOfAddresses.md +1 -0
- package/docs/BalanceUpdateInfoEventData.md +3 -1
- package/docs/BridgingFee.md +11 -0
- package/docs/ChainsEventData.md +3 -1
- package/docs/CommissionFee.md +9 -0
- package/docs/ComplianceApi.md +158 -1
- package/docs/ComplianceDispositionUpdateEventData.md +3 -1
- package/docs/ComplianceKytScreeningsUpdateEventData.md +57 -0
- package/docs/ContractCallDestination.md +2 -0
- package/docs/ContractCallDestinationType.md +2 -0
- package/docs/CreateMerchantRequest.md +3 -2
- package/docs/CreateOrderLinkRequest.md +10 -0
- package/docs/CreatePaymentOrderRequest.md +3 -1
- package/docs/CreateRefundRequest.md +2 -2
- package/docs/CreateSettlement.md +2 -4
- package/docs/CreateSettlementRequestRequest.md +3 -0
- package/docs/CreateSwapActivityRequest.md +15 -0
- package/docs/DevelopersWebhooksApi.md +1 -1
- package/docs/EstimateContractCallFeeParams.md +1 -1
- package/docs/EstimateFeeParams.md +1 -1
- package/docs/EstimateTransferFeeParams.md +1 -1
- package/docs/FeeStationApi.md +53 -0
- package/docs/FeeStationCheckFeeStationUsage.md +14 -0
- package/docs/FeeStationCheckFeeStationUsageResponse.md +16 -0
- package/docs/FeeStationGasStationType.md +12 -0
- package/docs/FundsStatusType.md +32 -0
- package/docs/KytScreeningsDecisionsType.md +16 -0
- package/docs/KytScreeningsEventData.md +13 -0
- package/docs/KytScreeningsReviewType.md +12 -0
- package/docs/KytScreeningsTransaction.md +12 -0
- package/docs/KytScreeningsTransactionType.md +12 -0
- package/docs/Link.md +10 -0
- package/docs/LinkDisplayInfo.md +10 -0
- package/docs/ListSwapActivities200Response.md +10 -0
- package/docs/ListSwapEnabledTokens200Response.md +10 -0
- package/docs/ListTopUpPayerAccounts200Response.md +10 -0
- package/docs/MPCVaultEventData.md +3 -1
- package/docs/Merchant.md +3 -2
- package/docs/MerchantBalance.md +3 -3
- package/docs/MessageSignDestination.md +0 -1
- package/docs/Order.md +1 -0
- package/docs/OrderLinkBusinessInfo.md +19 -0
- package/docs/OrderLinkBusinessInfoCustomExchangeRatesInner.md +10 -0
- package/docs/OtcFee.md +10 -0
- package/docs/PaymentAddressUpdateEventData.md +3 -1
- package/docs/PaymentApi.md +253 -25
- package/docs/PaymentEstimateFee.md +10 -0
- package/docs/PaymentEstimateFee201Response.md +9 -0
- package/docs/PaymentEstimateFeeRequest.md +10 -0
- package/docs/PaymentEstimatedFee.md +13 -0
- package/docs/PaymentFeeType.md +16 -0
- package/docs/PaymentOrderEventData.md +4 -1
- package/docs/PaymentRefundEventData.md +5 -2
- package/docs/PaymentSettlementEvent.md +9 -4
- package/docs/PaymentTransactionEventData.md +3 -1
- package/docs/PspBalance.md +3 -3
- package/docs/Refund.md +2 -1
- package/docs/ReviewStatusType.md +24 -0
- package/docs/SettleRequestStatus.md +2 -0
- package/docs/Settlement.md +6 -3
- package/docs/SettlementDetail.md +3 -1
- package/docs/SettlementInfo.md +6 -6
- package/docs/SolContractCallAddressLookupTableAccount.md +10 -0
- package/docs/SolContractCallDestination.md +1 -0
- package/docs/StellarContractCallContractParam.md +11 -0
- package/docs/StellarContractCallContractType.md +10 -0
- package/docs/StellarContractCallDestination.md +10 -0
- package/docs/StellarContractCallTrustLineOperationType.md +10 -0
- package/docs/StellarContractCallTrustLineParam.md +11 -0
- package/docs/SubmitKytResponse.md +10 -0
- package/docs/SubmitKytScreeningsDecisionsBody.md +10 -0
- package/docs/SubmitKytScreeningsReviewBody.md +10 -0
- package/docs/SupportedToken.md +1 -0
- package/docs/SuspendedTokenEventData.md +3 -1
- package/docs/SwapActivity.md +9 -9
- package/docs/SwapActivityDetail.md +10 -9
- package/docs/SwapActivitySigners.md +1 -1
- package/docs/SwapActivityTimeline.md +3 -3
- package/docs/SwapEstimateFee.md +12 -0
- package/docs/SwapQuote.md +10 -11
- package/docs/SwapReceivingTransaction.md +11 -0
- package/docs/SwapToken.md +6 -6
- package/docs/SwapsApi.md +356 -0
- package/docs/TSSRequestWebhookEventData.md +3 -1
- package/docs/TokenListingEventData.md +3 -1
- package/docs/TokensEventData.md +3 -1
- package/docs/TransactionCoboCategory.md +2 -0
- package/docs/TransactionDestination.md +2 -0
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionFuelingInfo.md +1 -0
- package/docs/TransactionSolContractAddressLookupTableAccount.md +10 -0
- package/docs/TransactionSolContractDestination.md +1 -0
- package/docs/TransactionStellarContractParam.md +11 -0
- package/docs/TransactionStellarContractType.md +10 -0
- package/docs/TransactionStellarDestination.md +10 -0
- package/docs/TransactionStellarTrustLineOperationType.md +10 -0
- package/docs/TransactionStellarTrustLineParam.md +11 -0
- package/docs/TransactionWebhookEventData.md +3 -1
- package/docs/TransactionsApi.md +2 -2
- package/docs/UpdateBankAccountByIdRequest.md +9 -0
- package/docs/UpdateTopUpAddress.md +1 -1
- package/docs/WalletInfoEventData.md +3 -1
- package/docs/WalletSetup.md +14 -0
- package/docs/WebhookEventData.md +12 -3
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +4 -0
- package/package.json +1 -1
- package/docs/BTCEIP191MessageSignDestination.md +0 -10
- package/docs/RawMessageSignDestination.md +0 -10
|
@@ -10,6 +10,7 @@ var _SwapActivityApprovers = _interopRequireDefault(require("./SwapActivityAppro
|
|
|
10
10
|
var _SwapActivitySigners = _interopRequireDefault(require("./SwapActivitySigners"));
|
|
11
11
|
var _SwapActivityStatus = _interopRequireDefault(require("./SwapActivityStatus"));
|
|
12
12
|
var _SwapActivityTimeline = _interopRequireDefault(require("./SwapActivityTimeline"));
|
|
13
|
+
var _SwapReceivingTransaction = _interopRequireDefault(require("./SwapReceivingTransaction"));
|
|
13
14
|
var _SwapType = _interopRequireDefault(require("./SwapType"));
|
|
14
15
|
var _TransactionInitiatorType = _interopRequireDefault(require("./TransactionInitiatorType"));
|
|
15
16
|
var _TransactionRequestFee = _interopRequireDefault(require("./TransactionRequestFee"));
|
|
@@ -133,6 +134,9 @@ var SwapActivityDetail = /*#__PURE__*/function () {
|
|
|
133
134
|
if (data.hasOwnProperty('signers')) {
|
|
134
135
|
obj['signers'] = _ApiClient["default"].convertToType(data['signers'], [_SwapActivitySigners["default"]]);
|
|
135
136
|
}
|
|
137
|
+
if (data.hasOwnProperty('receiving_transaction')) {
|
|
138
|
+
obj['receiving_transaction'] = _SwapReceivingTransaction["default"].constructFromObject(data['receiving_transaction']);
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
141
|
return obj;
|
|
138
142
|
}
|
|
@@ -263,6 +267,13 @@ var SwapActivityDetail = /*#__PURE__*/function () {
|
|
|
263
267
|
}
|
|
264
268
|
;
|
|
265
269
|
}
|
|
270
|
+
// validate the optional field `receiving_transaction`
|
|
271
|
+
if (data['receiving_transaction']) {
|
|
272
|
+
// data not null
|
|
273
|
+
if (!!_SwapReceivingTransaction["default"].validateJSON) {
|
|
274
|
+
_SwapReceivingTransaction["default"].validateJSON(data['receiving_transaction']);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
266
277
|
return true;
|
|
267
278
|
}
|
|
268
279
|
}]);
|
|
@@ -284,49 +295,49 @@ SwapActivityDetail.prototype['swap_type'] = undefined;
|
|
|
284
295
|
SwapActivityDetail.prototype['status'] = undefined;
|
|
285
296
|
|
|
286
297
|
/**
|
|
287
|
-
* The request
|
|
298
|
+
* The request ID of the swap transaction.
|
|
288
299
|
* @member {String} request_id
|
|
289
300
|
*/
|
|
290
301
|
SwapActivityDetail.prototype['request_id'] = undefined;
|
|
291
302
|
|
|
292
303
|
/**
|
|
293
|
-
* The
|
|
304
|
+
* The ID of the wallet used to pay.
|
|
294
305
|
* @member {String} wallet_id
|
|
295
306
|
*/
|
|
296
307
|
SwapActivityDetail.prototype['wallet_id'] = undefined;
|
|
297
308
|
|
|
298
309
|
/**
|
|
299
|
-
* The token
|
|
310
|
+
* The ID of the token to pay.
|
|
300
311
|
* @member {String} pay_token_id
|
|
301
312
|
*/
|
|
302
313
|
SwapActivityDetail.prototype['pay_token_id'] = undefined;
|
|
303
314
|
|
|
304
315
|
/**
|
|
305
|
-
* The token
|
|
316
|
+
* The ID of the token to receive.
|
|
306
317
|
* @member {String} receive_token_id
|
|
307
318
|
*/
|
|
308
319
|
SwapActivityDetail.prototype['receive_token_id'] = undefined;
|
|
309
320
|
|
|
310
321
|
/**
|
|
311
|
-
* The amount of
|
|
322
|
+
* The amount of the token to pay.
|
|
312
323
|
* @member {String} pay_amount
|
|
313
324
|
*/
|
|
314
325
|
SwapActivityDetail.prototype['pay_amount'] = undefined;
|
|
315
326
|
|
|
316
327
|
/**
|
|
317
|
-
* The amount of
|
|
328
|
+
* The amount of the token to receive.
|
|
318
329
|
* @member {String} receive_amount
|
|
319
330
|
*/
|
|
320
331
|
SwapActivityDetail.prototype['receive_amount'] = undefined;
|
|
321
332
|
|
|
322
333
|
/**
|
|
323
|
-
* The
|
|
334
|
+
* The ID of the token used for paying the service fee.
|
|
324
335
|
* @member {String} fee_token_id
|
|
325
336
|
*/
|
|
326
337
|
SwapActivityDetail.prototype['fee_token_id'] = undefined;
|
|
327
338
|
|
|
328
339
|
/**
|
|
329
|
-
* The amount of fee.
|
|
340
|
+
* The amount of the service fee.
|
|
330
341
|
* @member {String} fee_amount
|
|
331
342
|
*/
|
|
332
343
|
SwapActivityDetail.prototype['fee_amount'] = undefined;
|
|
@@ -366,7 +377,7 @@ SwapActivityDetail.prototype['updated_timestamp'] = undefined;
|
|
|
366
377
|
SwapActivityDetail.prototype['network_fee'] = undefined;
|
|
367
378
|
|
|
368
379
|
/**
|
|
369
|
-
*
|
|
380
|
+
* The address of an MPC Wallet or Web3 Wallet that receives the swapped or bridged assets.
|
|
370
381
|
* @member {String} destination_address
|
|
371
382
|
*/
|
|
372
383
|
SwapActivityDetail.prototype['destination_address'] = undefined;
|
|
@@ -386,6 +397,11 @@ SwapActivityDetail.prototype['approvers'] = undefined;
|
|
|
386
397
|
*/
|
|
387
398
|
SwapActivityDetail.prototype['signers'] = undefined;
|
|
388
399
|
|
|
400
|
+
/**
|
|
401
|
+
* @member {module:model/SwapReceivingTransaction} receiving_transaction
|
|
402
|
+
*/
|
|
403
|
+
SwapActivityDetail.prototype['receiving_transaction'] = undefined;
|
|
404
|
+
|
|
389
405
|
// Implement SwapActivity interface:
|
|
390
406
|
/**
|
|
391
407
|
* The unique identifier of the swap activity.
|
|
@@ -401,42 +417,42 @@ _SwapActivity["default"].prototype['swap_type'] = undefined;
|
|
|
401
417
|
*/
|
|
402
418
|
_SwapActivity["default"].prototype['status'] = undefined;
|
|
403
419
|
/**
|
|
404
|
-
* The request
|
|
420
|
+
* The request ID of the swap transaction.
|
|
405
421
|
* @member {String} request_id
|
|
406
422
|
*/
|
|
407
423
|
_SwapActivity["default"].prototype['request_id'] = undefined;
|
|
408
424
|
/**
|
|
409
|
-
* The
|
|
425
|
+
* The ID of the wallet used to pay.
|
|
410
426
|
* @member {String} wallet_id
|
|
411
427
|
*/
|
|
412
428
|
_SwapActivity["default"].prototype['wallet_id'] = undefined;
|
|
413
429
|
/**
|
|
414
|
-
* The token
|
|
430
|
+
* The ID of the token to pay.
|
|
415
431
|
* @member {String} pay_token_id
|
|
416
432
|
*/
|
|
417
433
|
_SwapActivity["default"].prototype['pay_token_id'] = undefined;
|
|
418
434
|
/**
|
|
419
|
-
* The token
|
|
435
|
+
* The ID of the token to receive.
|
|
420
436
|
* @member {String} receive_token_id
|
|
421
437
|
*/
|
|
422
438
|
_SwapActivity["default"].prototype['receive_token_id'] = undefined;
|
|
423
439
|
/**
|
|
424
|
-
* The amount of
|
|
440
|
+
* The amount of the token to pay.
|
|
425
441
|
* @member {String} pay_amount
|
|
426
442
|
*/
|
|
427
443
|
_SwapActivity["default"].prototype['pay_amount'] = undefined;
|
|
428
444
|
/**
|
|
429
|
-
* The amount of
|
|
445
|
+
* The amount of the token to receive.
|
|
430
446
|
* @member {String} receive_amount
|
|
431
447
|
*/
|
|
432
448
|
_SwapActivity["default"].prototype['receive_amount'] = undefined;
|
|
433
449
|
/**
|
|
434
|
-
* The
|
|
450
|
+
* The ID of the token used for paying the service fee.
|
|
435
451
|
* @member {String} fee_token_id
|
|
436
452
|
*/
|
|
437
453
|
_SwapActivity["default"].prototype['fee_token_id'] = undefined;
|
|
438
454
|
/**
|
|
439
|
-
* The amount of fee.
|
|
455
|
+
* The amount of the service fee.
|
|
440
456
|
* @member {String} fee_amount
|
|
441
457
|
*/
|
|
442
458
|
_SwapActivity["default"].prototype['fee_amount'] = undefined;
|
|
@@ -469,7 +485,7 @@ _SwapActivity["default"].prototype['updated_timestamp'] = undefined;
|
|
|
469
485
|
*/
|
|
470
486
|
_SwapActivity["default"].prototype['network_fee'] = undefined;
|
|
471
487
|
/**
|
|
472
|
-
*
|
|
488
|
+
* The address of an MPC Wallet or Web3 Wallet that receives the swapped or bridged assets.
|
|
473
489
|
* @member {String} destination_address
|
|
474
490
|
*/
|
|
475
491
|
_SwapActivity["default"].prototype['destination_address'] = undefined;
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
var SwapActivitySigners = /*#__PURE__*/function () {
|
|
30
30
|
/**
|
|
31
31
|
* Constructs a new <code>SwapActivitySigners</code>.
|
|
32
|
-
* The signer
|
|
32
|
+
* The signer information of the swap activity.
|
|
33
33
|
* @alias module:model/SwapActivitySigners
|
|
34
34
|
*/
|
|
35
35
|
function SwapActivitySigners() {
|
|
@@ -103,7 +103,7 @@ SwapActivitySigners.prototype['signer'] = undefined;
|
|
|
103
103
|
SwapActivitySigners.prototype['status'] = undefined;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* The reason for the signing failure.
|
|
107
107
|
* @member {String} failed_reason
|
|
108
108
|
*/
|
|
109
109
|
SwapActivitySigners.prototype['failed_reason'] = undefined;
|
|
@@ -33,8 +33,8 @@ var SwapActivityTimeline = /*#__PURE__*/function () {
|
|
|
33
33
|
* Constructs a new <code>SwapActivityTimeline</code>.
|
|
34
34
|
* The timeline of the swap activity.
|
|
35
35
|
* @alias module:model/SwapActivityTimeline
|
|
36
|
-
* @param action {String} The action
|
|
37
|
-
* @param status {String} The status of the action. Possible values include: - `Success`: The action
|
|
36
|
+
* @param action {String} The action in the swap activity. Possible values include: - `Submitted`: The swap request has been submitted. - `Pending Authorization`: The swap request is pending authorization. - `Bridge {Token}`: The token is being bridged to the destination chain. - `Swap {Token}`: The token is being exchanged to the destination token. - `Cobo Confirmation`: The swap result is pending Cobo's final confirmation.
|
|
37
|
+
* @param status {String} The status of the action. Possible values include: - `Success`: The action completed successfully. - `Processing`: The action is being processed. - `Failed`: The action failed.
|
|
38
38
|
*/
|
|
39
39
|
function SwapActivityTimeline(action, status) {
|
|
40
40
|
_classCallCheck(this, SwapActivityTimeline);
|
|
@@ -116,19 +116,19 @@ var SwapActivityTimeline = /*#__PURE__*/function () {
|
|
|
116
116
|
SwapActivityTimeline.RequiredProperties = ["action", "status"];
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* The action
|
|
119
|
+
* The action in the swap activity. Possible values include: - `Submitted`: The swap request has been submitted. - `Pending Authorization`: The swap request is pending authorization. - `Bridge {Token}`: The token is being bridged to the destination chain. - `Swap {Token}`: The token is being exchanged to the destination token. - `Cobo Confirmation`: The swap result is pending Cobo's final confirmation.
|
|
120
120
|
* @member {String} action
|
|
121
121
|
*/
|
|
122
122
|
SwapActivityTimeline.prototype['action'] = undefined;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* The status of the action. Possible values include: - `Success`: The action
|
|
125
|
+
* The status of the action. Possible values include: - `Success`: The action completed successfully. - `Processing`: The action is being processed. - `Failed`: The action failed.
|
|
126
126
|
* @member {String} status
|
|
127
127
|
*/
|
|
128
128
|
SwapActivityTimeline.prototype['status'] = undefined;
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* The time when the action
|
|
131
|
+
* The time when the action occurred, in Unix timestamp format, measured in milliseconds.
|
|
132
132
|
* @member {Number} timestamp
|
|
133
133
|
*/
|
|
134
134
|
SwapActivityTimeline.prototype['timestamp'] = undefined;
|
|
@@ -0,0 +1,147 @@
|
|
|
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 _FeeType = _interopRequireDefault(require("./FeeType"));
|
|
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 SwapEstimateFee model module.
|
|
30
|
+
* @module model/SwapEstimateFee
|
|
31
|
+
*/
|
|
32
|
+
var SwapEstimateFee = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>SwapEstimateFee</code>.
|
|
35
|
+
* @alias module:model/SwapEstimateFee
|
|
36
|
+
* @param wallet_id {String} The ID of the wallet to pay.
|
|
37
|
+
* @param quote_id {String} The ID of the swap quote.
|
|
38
|
+
*/
|
|
39
|
+
function SwapEstimateFee(wallet_id, quote_id) {
|
|
40
|
+
_classCallCheck(this, SwapEstimateFee);
|
|
41
|
+
SwapEstimateFee.initialize(this, wallet_id, quote_id);
|
|
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(SwapEstimateFee, null, [{
|
|
50
|
+
key: "initialize",
|
|
51
|
+
value: function initialize(obj, wallet_id, quote_id) {
|
|
52
|
+
obj['wallet_id'] = wallet_id;
|
|
53
|
+
obj['quote_id'] = quote_id;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Constructs a <code>SwapEstimateFee</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/SwapEstimateFee} obj Optional instance to populate.
|
|
61
|
+
* @return {module:model/SwapEstimateFee} The populated <code>SwapEstimateFee</code> instance.
|
|
62
|
+
*/
|
|
63
|
+
}, {
|
|
64
|
+
key: "constructFromObject",
|
|
65
|
+
value: function constructFromObject(data, obj) {
|
|
66
|
+
if (data) {
|
|
67
|
+
obj = obj || new SwapEstimateFee();
|
|
68
|
+
if (data.hasOwnProperty('wallet_id')) {
|
|
69
|
+
obj['wallet_id'] = _ApiClient["default"].convertToType(data['wallet_id'], 'String');
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('address')) {
|
|
72
|
+
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('quote_id')) {
|
|
75
|
+
obj['quote_id'] = _ApiClient["default"].convertToType(data['quote_id'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('fee_type')) {
|
|
78
|
+
obj['fee_type'] = _FeeType["default"].constructFromObject(data['fee_type']);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validates the JSON data with respect to <code>SwapEstimateFee</code>.
|
|
86
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SwapEstimateFee</code>.
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "validateJSON",
|
|
91
|
+
value: function validateJSON(data) {
|
|
92
|
+
// check to make sure all required properties are present in the JSON string
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(SwapEstimateFee.RequiredProperties),
|
|
94
|
+
_step;
|
|
95
|
+
try {
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
+
var property = _step.value;
|
|
98
|
+
if (!data.hasOwnProperty(property)) {
|
|
99
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// ensure the json data is a string
|
|
103
|
+
} catch (err) {
|
|
104
|
+
_iterator.e(err);
|
|
105
|
+
} finally {
|
|
106
|
+
_iterator.f();
|
|
107
|
+
}
|
|
108
|
+
if (data['wallet_id'] && !(typeof data['wallet_id'] === 'string' || data['wallet_id'] instanceof String)) {
|
|
109
|
+
throw new Error("Expected the field `wallet_id` to be a primitive type in the JSON string but got " + data['wallet_id']);
|
|
110
|
+
}
|
|
111
|
+
// ensure the json data is a string
|
|
112
|
+
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
|
113
|
+
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
|
114
|
+
}
|
|
115
|
+
// ensure the json data is a string
|
|
116
|
+
if (data['quote_id'] && !(typeof data['quote_id'] === 'string' || data['quote_id'] instanceof String)) {
|
|
117
|
+
throw new Error("Expected the field `quote_id` to be a primitive type in the JSON string but got " + data['quote_id']);
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
}();
|
|
123
|
+
SwapEstimateFee.RequiredProperties = ["wallet_id", "quote_id"];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The ID of the wallet to pay.
|
|
127
|
+
* @member {String} wallet_id
|
|
128
|
+
*/
|
|
129
|
+
SwapEstimateFee.prototype['wallet_id'] = undefined;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The wallet address. This property is required when the wallet to pay is not a Custodial Wallet (Asset Wallet).
|
|
133
|
+
* @member {String} address
|
|
134
|
+
*/
|
|
135
|
+
SwapEstimateFee.prototype['address'] = undefined;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The ID of the swap quote.
|
|
139
|
+
* @member {String} quote_id
|
|
140
|
+
*/
|
|
141
|
+
SwapEstimateFee.prototype['quote_id'] = undefined;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @member {module:model/FeeType} fee_type
|
|
145
|
+
*/
|
|
146
|
+
SwapEstimateFee.prototype['fee_type'] = undefined;
|
|
147
|
+
var _default = exports["default"] = SwapEstimateFee;
|
package/dist/model/SwapQuote.js
CHANGED
|
@@ -32,14 +32,14 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
32
32
|
/**
|
|
33
33
|
* Constructs a new <code>SwapQuote</code>.
|
|
34
34
|
* @alias module:model/SwapQuote
|
|
35
|
-
* @param quote_id {String} The unique
|
|
36
|
-
* @param pay_token_id {String} The token
|
|
37
|
-
* @param pay_amount {String} The amount of
|
|
38
|
-
* @param receive_token_id {String} The token
|
|
39
|
-
* @param receive_amount {String} The amount of
|
|
40
|
-
* @param fee_token_id {String} The token
|
|
41
|
-
* @param fee_amount {String} The amount of
|
|
42
|
-
* @param quote_expired_timestamp {Number} The time when the quote
|
|
35
|
+
* @param quote_id {String} The unique identifier of the swap quote.
|
|
36
|
+
* @param pay_token_id {String} The ID of the token to pay.
|
|
37
|
+
* @param pay_amount {String} The amount of the token to pay.
|
|
38
|
+
* @param receive_token_id {String} The ID of the token to receive.
|
|
39
|
+
* @param receive_amount {String} The amount of the token to receive.
|
|
40
|
+
* @param fee_token_id {String} The ID of the token for the service fee.
|
|
41
|
+
* @param fee_amount {String} The amount of the token for the service fee.
|
|
42
|
+
* @param quote_expired_timestamp {Number} The time when the swap quote expires, in Unix timestamp format, measured in milliseconds.
|
|
43
43
|
*/
|
|
44
44
|
function SwapQuote(quote_id, pay_token_id, pay_amount, receive_token_id, receive_amount, fee_token_id, fee_amount, quote_expired_timestamp) {
|
|
45
45
|
_classCallCheck(this, SwapQuote);
|
|
@@ -97,9 +97,6 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
97
97
|
if (data.hasOwnProperty('fee_amount')) {
|
|
98
98
|
obj['fee_amount'] = _ApiClient["default"].convertToType(data['fee_amount'], 'String');
|
|
99
99
|
}
|
|
100
|
-
if (data.hasOwnProperty('estimated_network_fee_amount')) {
|
|
101
|
-
obj['estimated_network_fee_amount'] = _ApiClient["default"].convertToType(data['estimated_network_fee_amount'], 'String');
|
|
102
|
-
}
|
|
103
100
|
if (data.hasOwnProperty('min_receive_amount')) {
|
|
104
101
|
obj['min_receive_amount'] = _ApiClient["default"].convertToType(data['min_receive_amount'], 'String');
|
|
105
102
|
}
|
|
@@ -165,10 +162,6 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
165
162
|
throw new Error("Expected the field `fee_amount` to be a primitive type in the JSON string but got " + data['fee_amount']);
|
|
166
163
|
}
|
|
167
164
|
// ensure the json data is a string
|
|
168
|
-
if (data['estimated_network_fee_amount'] && !(typeof data['estimated_network_fee_amount'] === 'string' || data['estimated_network_fee_amount'] instanceof String)) {
|
|
169
|
-
throw new Error("Expected the field `estimated_network_fee_amount` to be a primitive type in the JSON string but got " + data['estimated_network_fee_amount']);
|
|
170
|
-
}
|
|
171
|
-
// ensure the json data is a string
|
|
172
165
|
if (data['min_receive_amount'] && !(typeof data['min_receive_amount'] === 'string' || data['min_receive_amount'] instanceof String)) {
|
|
173
166
|
throw new Error("Expected the field `min_receive_amount` to be a primitive type in the JSON string but got " + data['min_receive_amount']);
|
|
174
167
|
}
|
|
@@ -183,67 +176,61 @@ var SwapQuote = /*#__PURE__*/function () {
|
|
|
183
176
|
SwapQuote.RequiredProperties = ["quote_id", "pay_token_id", "pay_amount", "receive_token_id", "receive_amount", "fee_token_id", "fee_amount", "quote_expired_timestamp"];
|
|
184
177
|
|
|
185
178
|
/**
|
|
186
|
-
* The unique
|
|
179
|
+
* The unique identifier of the swap quote.
|
|
187
180
|
* @member {String} quote_id
|
|
188
181
|
*/
|
|
189
182
|
SwapQuote.prototype['quote_id'] = undefined;
|
|
190
183
|
|
|
191
184
|
/**
|
|
192
|
-
* The token
|
|
185
|
+
* The ID of the token to pay.
|
|
193
186
|
* @member {String} pay_token_id
|
|
194
187
|
*/
|
|
195
188
|
SwapQuote.prototype['pay_token_id'] = undefined;
|
|
196
189
|
|
|
197
190
|
/**
|
|
198
|
-
* The amount of
|
|
191
|
+
* The amount of the token to pay.
|
|
199
192
|
* @member {String} pay_amount
|
|
200
193
|
*/
|
|
201
194
|
SwapQuote.prototype['pay_amount'] = undefined;
|
|
202
195
|
|
|
203
196
|
/**
|
|
204
|
-
* The token
|
|
197
|
+
* The ID of the token to receive.
|
|
205
198
|
* @member {String} receive_token_id
|
|
206
199
|
*/
|
|
207
200
|
SwapQuote.prototype['receive_token_id'] = undefined;
|
|
208
201
|
|
|
209
202
|
/**
|
|
210
|
-
* The amount of
|
|
203
|
+
* The amount of the token to receive.
|
|
211
204
|
* @member {String} receive_amount
|
|
212
205
|
*/
|
|
213
206
|
SwapQuote.prototype['receive_amount'] = undefined;
|
|
214
207
|
|
|
215
208
|
/**
|
|
216
|
-
* The token
|
|
209
|
+
* The ID of the token for the service fee.
|
|
217
210
|
* @member {String} fee_token_id
|
|
218
211
|
*/
|
|
219
212
|
SwapQuote.prototype['fee_token_id'] = undefined;
|
|
220
213
|
|
|
221
214
|
/**
|
|
222
|
-
* The amount of
|
|
215
|
+
* The amount of the token for the service fee.
|
|
223
216
|
* @member {String} fee_amount
|
|
224
217
|
*/
|
|
225
218
|
SwapQuote.prototype['fee_amount'] = undefined;
|
|
226
219
|
|
|
227
220
|
/**
|
|
228
|
-
* The
|
|
229
|
-
* @member {String} estimated_network_fee_amount
|
|
230
|
-
*/
|
|
231
|
-
SwapQuote.prototype['estimated_network_fee_amount'] = undefined;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* The minimum amount of tokens to receive if the pay amount is specified.
|
|
221
|
+
* The minimum amount of the token to receive if `pay_amount` is specified.
|
|
235
222
|
* @member {String} min_receive_amount
|
|
236
223
|
*/
|
|
237
224
|
SwapQuote.prototype['min_receive_amount'] = undefined;
|
|
238
225
|
|
|
239
226
|
/**
|
|
240
|
-
* The maximum amount of
|
|
227
|
+
* The maximum amount of the token to pay if `receive_amount` is specified.
|
|
241
228
|
* @member {String} max_pay_amount
|
|
242
229
|
*/
|
|
243
230
|
SwapQuote.prototype['max_pay_amount'] = undefined;
|
|
244
231
|
|
|
245
232
|
/**
|
|
246
|
-
* The time when the quote
|
|
233
|
+
* The time when the swap quote expires, in Unix timestamp format, measured in milliseconds.
|
|
247
234
|
* @member {Number} quote_expired_timestamp
|
|
248
235
|
*/
|
|
249
236
|
SwapQuote.prototype['quote_expired_timestamp'] = undefined;
|
|
@@ -0,0 +1,133 @@
|
|
|
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 SwapReceivingTransaction model module.
|
|
29
|
+
* @module model/SwapReceivingTransaction
|
|
30
|
+
*/
|
|
31
|
+
var SwapReceivingTransaction = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>SwapReceivingTransaction</code>.
|
|
34
|
+
* The transaction that delivers the swapped or bridged assets to the destination address.
|
|
35
|
+
* @alias module:model/SwapReceivingTransaction
|
|
36
|
+
* @param chain_id {String} The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
37
|
+
*/
|
|
38
|
+
function SwapReceivingTransaction(chain_id) {
|
|
39
|
+
_classCallCheck(this, SwapReceivingTransaction);
|
|
40
|
+
SwapReceivingTransaction.initialize(this, chain_id);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initializes the fields of this object.
|
|
45
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
46
|
+
* Only for internal use.
|
|
47
|
+
*/
|
|
48
|
+
return _createClass(SwapReceivingTransaction, null, [{
|
|
49
|
+
key: "initialize",
|
|
50
|
+
value: function initialize(obj, chain_id) {
|
|
51
|
+
obj['chain_id'] = chain_id;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a <code>SwapReceivingTransaction</code> from a plain JavaScript object, optionally creating a new instance.
|
|
56
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
57
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
58
|
+
* @param {module:model/SwapReceivingTransaction} obj Optional instance to populate.
|
|
59
|
+
* @return {module:model/SwapReceivingTransaction} The populated <code>SwapReceivingTransaction</code> instance.
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "constructFromObject",
|
|
63
|
+
value: function constructFromObject(data, obj) {
|
|
64
|
+
if (data) {
|
|
65
|
+
obj = obj || new SwapReceivingTransaction();
|
|
66
|
+
if (data.hasOwnProperty('chain_id')) {
|
|
67
|
+
obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
|
|
68
|
+
}
|
|
69
|
+
if (data.hasOwnProperty('transaction_hash')) {
|
|
70
|
+
obj['transaction_hash'] = _ApiClient["default"].convertToType(data['transaction_hash'], 'String');
|
|
71
|
+
}
|
|
72
|
+
if (data.hasOwnProperty('is_loop')) {
|
|
73
|
+
obj['is_loop'] = _ApiClient["default"].convertToType(data['is_loop'], 'Boolean');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return obj;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Validates the JSON data with respect to <code>SwapReceivingTransaction</code>.
|
|
81
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
82
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SwapReceivingTransaction</code>.
|
|
83
|
+
*/
|
|
84
|
+
}, {
|
|
85
|
+
key: "validateJSON",
|
|
86
|
+
value: function validateJSON(data) {
|
|
87
|
+
// check to make sure all required properties are present in the JSON string
|
|
88
|
+
var _iterator = _createForOfIteratorHelper(SwapReceivingTransaction.RequiredProperties),
|
|
89
|
+
_step;
|
|
90
|
+
try {
|
|
91
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
92
|
+
var property = _step.value;
|
|
93
|
+
if (!data.hasOwnProperty(property)) {
|
|
94
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
} catch (err) {
|
|
99
|
+
_iterator.e(err);
|
|
100
|
+
} finally {
|
|
101
|
+
_iterator.f();
|
|
102
|
+
}
|
|
103
|
+
if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
|
|
104
|
+
throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
|
|
105
|
+
}
|
|
106
|
+
// ensure the json data is a string
|
|
107
|
+
if (data['transaction_hash'] && !(typeof data['transaction_hash'] === 'string' || data['transaction_hash'] instanceof String)) {
|
|
108
|
+
throw new Error("Expected the field `transaction_hash` to be a primitive type in the JSON string but got " + data['transaction_hash']);
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}]);
|
|
113
|
+
}();
|
|
114
|
+
SwapReceivingTransaction.RequiredProperties = ["chain_id"];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The chain ID, which is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-chains).
|
|
118
|
+
* @member {String} chain_id
|
|
119
|
+
*/
|
|
120
|
+
SwapReceivingTransaction.prototype['chain_id'] = undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The transaction hash.
|
|
124
|
+
* @member {String} transaction_hash
|
|
125
|
+
*/
|
|
126
|
+
SwapReceivingTransaction.prototype['transaction_hash'] = undefined;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Whether the transaction was executed as a [Cobo Loop](https://manuals.cobo.com/en/portal/custodial-wallets/cobo-loop) transfer. - `true`: The transaction was executed as a Cobo Loop transfer. - `false`: The transaction was not executed as a Cobo Loop transfer.
|
|
130
|
+
* @member {Boolean} is_loop
|
|
131
|
+
*/
|
|
132
|
+
SwapReceivingTransaction.prototype['is_loop'] = undefined;
|
|
133
|
+
var _default = exports["default"] = SwapReceivingTransaction;
|