@cobo/cobo-waas2 1.23.0 → 1.24.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 +45 -6
- package/dist/ApiClient.js +1 -1
- package/dist/api/AddressBooksApi.js +6 -6
- package/dist/api/FeeStationApi.js +47 -4
- package/dist/api/PaymentApi.js +194 -47
- package/dist/api/SwapsApi.js +374 -0
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/index.js +224 -14
- package/dist/model/AddressInfo.js +13 -0
- package/dist/model/AddressesEventDataAllOfAddresses.js +18 -0
- package/dist/model/BridgingFee.js +136 -0
- package/dist/model/CommissionFee.js +110 -0
- package/dist/model/ContractCallDestination.js +48 -8
- package/dist/model/ContractCallDestinationType.js +5 -0
- package/dist/model/CreateMerchantRequest.js +13 -6
- package/dist/model/CreatePaymentOrderRequest.js +14 -1
- package/dist/model/CreateSettlement.js +2 -2
- 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/ListSwapActivities200Response.js +123 -0
- package/dist/model/ListSwapEnabledTokens200Response.js +123 -0
- package/dist/model/ListTopUpPayerAccounts200Response.js +123 -0
- package/dist/model/Merchant.js +9 -0
- package/dist/model/MerchantBalance.js +3 -3
- package/dist/model/MessageSignDestination.js +8 -70
- package/dist/model/OtcFee.js +123 -0
- package/dist/model/PaymentEstimateFee.js +125 -0
- package/dist/model/PaymentEstimateFee201Response.js +107 -0
- package/dist/model/{RawMessageSignDestination.js → PaymentEstimateFeeRequest.js} +51 -37
- package/dist/model/PaymentEstimatedFee.js +173 -0
- package/dist/model/PaymentFeeType.js +71 -0
- package/dist/model/PaymentRefundEventData.js +22 -2
- package/dist/model/PaymentSettlementEvent.js +62 -6
- package/dist/model/PspBalance.js +3 -3
- package/dist/model/Refund.js +17 -1
- 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/SupportedToken.js +9 -0
- 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/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/UpdateBankAccountByIdRequest.js +108 -0
- package/dist/model/UpdateTopUpAddress.js +4 -6
- package/dist/model/WalletSetup.js +66 -0
- package/dist/model/WebhookEventData.js +19 -1
- package/docs/AddressBooksApi.md +3 -3
- package/docs/AddressInfo.md +1 -0
- package/docs/AddressesEventDataAllOfAddresses.md +1 -0
- package/docs/BridgingFee.md +11 -0
- package/docs/CommissionFee.md +9 -0
- package/docs/ContractCallDestination.md +2 -0
- package/docs/ContractCallDestinationType.md +2 -0
- package/docs/CreateMerchantRequest.md +2 -1
- package/docs/CreatePaymentOrderRequest.md +2 -1
- package/docs/CreateSettlement.md +2 -2
- package/docs/CreateSettlementRequestRequest.md +3 -0
- package/docs/CreateSwapActivityRequest.md +15 -0
- 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/ListSwapActivities200Response.md +10 -0
- package/docs/ListSwapEnabledTokens200Response.md +10 -0
- package/docs/ListTopUpPayerAccounts200Response.md +10 -0
- package/docs/Merchant.md +1 -0
- package/docs/MerchantBalance.md +3 -3
- package/docs/MessageSignDestination.md +0 -1
- package/docs/OtcFee.md +10 -0
- package/docs/PaymentApi.md +196 -21
- 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/PaymentRefundEventData.md +2 -1
- package/docs/PaymentSettlementEvent.md +6 -3
- package/docs/PspBalance.md +3 -3
- package/docs/Refund.md +2 -1
- 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/SupportedToken.md +1 -0
- 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/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/TransactionsApi.md +2 -2
- package/docs/UpdateBankAccountByIdRequest.md +9 -0
- package/docs/UpdateTopUpAddress.md +1 -1
- package/docs/WalletSetup.md +14 -0
- package/docs/WebhookEventData.md +4 -1
- package/package.json +1 -1
- package/docs/BTCEIP191MessageSignDestination.md +0 -10
- package/docs/RawMessageSignDestination.md +0 -10
|
@@ -0,0 +1,374 @@
|
|
|
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 _CreateSwapActivityRequest = _interopRequireDefault(require("../model/CreateSwapActivityRequest"));
|
|
9
|
+
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
10
|
+
var _EstimatedFee = _interopRequireDefault(require("../model/EstimatedFee"));
|
|
11
|
+
var _ListSwapActivities200Response = _interopRequireDefault(require("../model/ListSwapActivities200Response"));
|
|
12
|
+
var _ListSwapEnabledTokens200Response = _interopRequireDefault(require("../model/ListSwapEnabledTokens200Response"));
|
|
13
|
+
var _SwapActivityDetail = _interopRequireDefault(require("../model/SwapActivityDetail"));
|
|
14
|
+
var _SwapActivityStatus = _interopRequireDefault(require("../model/SwapActivityStatus"));
|
|
15
|
+
var _SwapEstimateFee = _interopRequireDefault(require("../model/SwapEstimateFee"));
|
|
16
|
+
var _SwapQuote = _interopRequireDefault(require("../model/SwapQuote"));
|
|
17
|
+
var _SwapType = _interopRequireDefault(require("../model/SwapType"));
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
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); }
|
|
20
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
|
+
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); } }
|
|
22
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
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); } /**
|
|
25
|
+
* Cobo Wallet as a Service 2.0
|
|
26
|
+
*
|
|
27
|
+
* Contact: help@cobo.com
|
|
28
|
+
*
|
|
29
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
30
|
+
* https://openapi-generator.tech
|
|
31
|
+
* Do not edit the class manually.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Swaps service.
|
|
36
|
+
* @module api/SwapsApi
|
|
37
|
+
*/
|
|
38
|
+
var SwapsApi = exports["default"] = /*#__PURE__*/function () {
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new SwapsApi.
|
|
41
|
+
* @alias module:api/SwapsApi
|
|
42
|
+
* @class
|
|
43
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
44
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
45
|
+
*/
|
|
46
|
+
function SwapsApi(apiClient) {
|
|
47
|
+
_classCallCheck(this, SwapsApi);
|
|
48
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Create swap activity
|
|
53
|
+
* This operation creates a swap activity. A swap activity can be either a bridge (cross-chain transfer) or an exchange (token-to-token swap on the same chain).
|
|
54
|
+
* @param {module:model/CreateSwapActivityRequest} CreateSwapActivityRequest The request body for creating a swap activity.
|
|
55
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SwapActivityDetail} and HTTP response
|
|
56
|
+
*/
|
|
57
|
+
return _createClass(SwapsApi, [{
|
|
58
|
+
key: "createSwapActivityWithHttpInfo",
|
|
59
|
+
value: function createSwapActivityWithHttpInfo(CreateSwapActivityRequest) {
|
|
60
|
+
var postBody = CreateSwapActivityRequest;
|
|
61
|
+
if (postBody && postBody.toJSON) {
|
|
62
|
+
postBody = postBody.toJSON();
|
|
63
|
+
}
|
|
64
|
+
// verify the required parameter 'CreateSwapActivityRequest' is set
|
|
65
|
+
if (CreateSwapActivityRequest === undefined || CreateSwapActivityRequest === null) {
|
|
66
|
+
throw new Error("Missing the required parameter 'CreateSwapActivityRequest' when calling createSwapActivity");
|
|
67
|
+
}
|
|
68
|
+
var pathParams = {};
|
|
69
|
+
var queryParams = {};
|
|
70
|
+
var headerParams = {};
|
|
71
|
+
var formParams = {};
|
|
72
|
+
var authNames = ['OAuth2', 'CoboAuth'];
|
|
73
|
+
var contentTypes = ['application/json'];
|
|
74
|
+
var accepts = ['application/json'];
|
|
75
|
+
var returnType = _SwapActivityDetail["default"];
|
|
76
|
+
return this.apiClient.callApi('/swaps/swap', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Create swap activity
|
|
81
|
+
* This operation creates a swap activity. A swap activity can be either a bridge (cross-chain transfer) or an exchange (token-to-token swap on the same chain).
|
|
82
|
+
* @param {module:model/CreateSwapActivityRequest} CreateSwapActivityRequest The request body for creating a swap activity.
|
|
83
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SwapActivityDetail}
|
|
84
|
+
*/
|
|
85
|
+
}, {
|
|
86
|
+
key: "createSwapActivity",
|
|
87
|
+
value: function createSwapActivity(CreateSwapActivityRequest) {
|
|
88
|
+
return this.createSwapActivityWithHttpInfo(CreateSwapActivityRequest).then(function (response_and_data) {
|
|
89
|
+
return response_and_data.data;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Estimate swap fee
|
|
95
|
+
* This operation estimates the network fee of a swap activity. You can use this operation to estimate the network fee before initiating swap activities from MPC Wallets or Web3 Wallets. It requires a valid `wallet_id` and `quote_id`, so you need to [get a swap quote](https://www.cobo.com/developers/v2/api-references/swaps/get-swap-quote) first.
|
|
96
|
+
* @param {module:model/SwapEstimateFee} SwapEstimateFee The request body for estimating the network fee of a swap activity.
|
|
97
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/EstimatedFee} and HTTP response
|
|
98
|
+
*/
|
|
99
|
+
}, {
|
|
100
|
+
key: "estimateSwapFeeWithHttpInfo",
|
|
101
|
+
value: function estimateSwapFeeWithHttpInfo(SwapEstimateFee) {
|
|
102
|
+
var postBody = SwapEstimateFee;
|
|
103
|
+
if (postBody && postBody.toJSON) {
|
|
104
|
+
postBody = postBody.toJSON();
|
|
105
|
+
}
|
|
106
|
+
// verify the required parameter 'SwapEstimateFee' is set
|
|
107
|
+
if (SwapEstimateFee === undefined || SwapEstimateFee === null) {
|
|
108
|
+
throw new Error("Missing the required parameter 'SwapEstimateFee' when calling estimateSwapFee");
|
|
109
|
+
}
|
|
110
|
+
var pathParams = {};
|
|
111
|
+
var queryParams = {};
|
|
112
|
+
var headerParams = {};
|
|
113
|
+
var formParams = {};
|
|
114
|
+
var authNames = ['OAuth2', 'CoboAuth'];
|
|
115
|
+
var contentTypes = ['application/json'];
|
|
116
|
+
var accepts = ['application/json'];
|
|
117
|
+
var returnType = _EstimatedFee["default"];
|
|
118
|
+
return this.apiClient.callApi('/swaps/estimate_fee', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Estimate swap fee
|
|
123
|
+
* This operation estimates the network fee of a swap activity. You can use this operation to estimate the network fee before initiating swap activities from MPC Wallets or Web3 Wallets. It requires a valid `wallet_id` and `quote_id`, so you need to [get a swap quote](https://www.cobo.com/developers/v2/api-references/swaps/get-swap-quote) first.
|
|
124
|
+
* @param {module:model/SwapEstimateFee} SwapEstimateFee The request body for estimating the network fee of a swap activity.
|
|
125
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/EstimatedFee}
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "estimateSwapFee",
|
|
129
|
+
value: function estimateSwapFee(SwapEstimateFee) {
|
|
130
|
+
return this.estimateSwapFeeWithHttpInfo(SwapEstimateFee).then(function (response_and_data) {
|
|
131
|
+
return response_and_data.data;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get swap activity
|
|
137
|
+
* This operation retrieves detailed information about a specified swap activity.
|
|
138
|
+
* @param {String} activity_id The unique identifier of the swap activity.
|
|
139
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SwapActivityDetail} and HTTP response
|
|
140
|
+
*/
|
|
141
|
+
}, {
|
|
142
|
+
key: "getSwapActivityWithHttpInfo",
|
|
143
|
+
value: function getSwapActivityWithHttpInfo(activity_id) {
|
|
144
|
+
var postBody = null;
|
|
145
|
+
if (postBody && postBody.toJSON) {
|
|
146
|
+
postBody = postBody.toJSON();
|
|
147
|
+
}
|
|
148
|
+
// verify the required parameter 'activity_id' is set
|
|
149
|
+
if (activity_id === undefined || activity_id === null) {
|
|
150
|
+
throw new Error("Missing the required parameter 'activity_id' when calling getSwapActivity");
|
|
151
|
+
}
|
|
152
|
+
var pathParams = {
|
|
153
|
+
'activity_id': activity_id
|
|
154
|
+
};
|
|
155
|
+
var queryParams = {};
|
|
156
|
+
var headerParams = {};
|
|
157
|
+
var formParams = {};
|
|
158
|
+
var authNames = ['CoboAuth'];
|
|
159
|
+
var contentTypes = [];
|
|
160
|
+
var accepts = ['application/json'];
|
|
161
|
+
var returnType = _SwapActivityDetail["default"];
|
|
162
|
+
return this.apiClient.callApi('/swaps/activities/{activity_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Get swap activity
|
|
167
|
+
* This operation retrieves detailed information about a specified swap activity.
|
|
168
|
+
* @param {String} activity_id The unique identifier of the swap activity.
|
|
169
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SwapActivityDetail}
|
|
170
|
+
*/
|
|
171
|
+
}, {
|
|
172
|
+
key: "getSwapActivity",
|
|
173
|
+
value: function getSwapActivity(activity_id) {
|
|
174
|
+
return this.getSwapActivityWithHttpInfo(activity_id).then(function (response_and_data) {
|
|
175
|
+
return response_and_data.data;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Get swap quote
|
|
181
|
+
* This operation retrieves the current market exchange rate and estimated service fee. You need to provide `wallet_id`, `pay_token_id`, and `receive_token_id`, along with either `pay_amount` or `receive_amount`.
|
|
182
|
+
* @param {String} wallet_id The wallet ID.
|
|
183
|
+
* @param {String} pay_token_id The ID of the token to pay.
|
|
184
|
+
* @param {String} receive_token_id The ID of the token to receive.
|
|
185
|
+
* @param {Object} opts Optional parameters
|
|
186
|
+
* @param {String} [pay_amount] The amount of the token to pay.
|
|
187
|
+
* @param {String} [receive_amount] The amount of the token to receive.
|
|
188
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SwapQuote} and HTTP response
|
|
189
|
+
*/
|
|
190
|
+
}, {
|
|
191
|
+
key: "getSwapQuoteWithHttpInfo",
|
|
192
|
+
value: function getSwapQuoteWithHttpInfo(wallet_id, pay_token_id, receive_token_id, opts) {
|
|
193
|
+
opts = opts || {};
|
|
194
|
+
var postBody = null;
|
|
195
|
+
if (postBody && postBody.toJSON) {
|
|
196
|
+
postBody = postBody.toJSON();
|
|
197
|
+
}
|
|
198
|
+
// verify the required parameter 'wallet_id' is set
|
|
199
|
+
if (wallet_id === undefined || wallet_id === null) {
|
|
200
|
+
throw new Error("Missing the required parameter 'wallet_id' when calling getSwapQuote");
|
|
201
|
+
}
|
|
202
|
+
// verify the required parameter 'pay_token_id' is set
|
|
203
|
+
if (pay_token_id === undefined || pay_token_id === null) {
|
|
204
|
+
throw new Error("Missing the required parameter 'pay_token_id' when calling getSwapQuote");
|
|
205
|
+
}
|
|
206
|
+
// verify the required parameter 'receive_token_id' is set
|
|
207
|
+
if (receive_token_id === undefined || receive_token_id === null) {
|
|
208
|
+
throw new Error("Missing the required parameter 'receive_token_id' when calling getSwapQuote");
|
|
209
|
+
}
|
|
210
|
+
var pathParams = {};
|
|
211
|
+
var queryParams = {
|
|
212
|
+
'wallet_id': wallet_id,
|
|
213
|
+
'pay_token_id': pay_token_id,
|
|
214
|
+
'receive_token_id': receive_token_id,
|
|
215
|
+
'pay_amount': opts['pay_amount'],
|
|
216
|
+
'receive_amount': opts['receive_amount']
|
|
217
|
+
};
|
|
218
|
+
var headerParams = {};
|
|
219
|
+
var formParams = {};
|
|
220
|
+
var authNames = ['CoboAuth'];
|
|
221
|
+
var contentTypes = [];
|
|
222
|
+
var accepts = ['application/json'];
|
|
223
|
+
var returnType = _SwapQuote["default"];
|
|
224
|
+
return this.apiClient.callApi('/swaps/quote', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Get swap quote
|
|
229
|
+
* This operation retrieves the current market exchange rate and estimated service fee. You need to provide `wallet_id`, `pay_token_id`, and `receive_token_id`, along with either `pay_amount` or `receive_amount`.
|
|
230
|
+
* @param {String} wallet_id The wallet ID.
|
|
231
|
+
* @param {String} pay_token_id The ID of the token to pay.
|
|
232
|
+
* @param {String} receive_token_id The ID of the token to receive.
|
|
233
|
+
* @param {Object} opts Optional parameters
|
|
234
|
+
* @param {String} opts.pay_amount The amount of the token to pay.
|
|
235
|
+
* @param {String} opts.receive_amount The amount of the token to receive.
|
|
236
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SwapQuote}
|
|
237
|
+
*/
|
|
238
|
+
}, {
|
|
239
|
+
key: "getSwapQuote",
|
|
240
|
+
value: function getSwapQuote(wallet_id, pay_token_id, receive_token_id, opts) {
|
|
241
|
+
return this.getSwapQuoteWithHttpInfo(wallet_id, pay_token_id, receive_token_id, opts).then(function (response_and_data) {
|
|
242
|
+
return response_and_data.data;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* List swap activities
|
|
248
|
+
* This operation retrieves a list of swap activities. You can filter the results by swap type, status, initiator, and time range.
|
|
249
|
+
* @param {Object} opts Optional parameters
|
|
250
|
+
* @param {module:model/SwapType} [type]
|
|
251
|
+
* @param {module:model/SwapActivityStatus} [status]
|
|
252
|
+
* @param {Number} [min_updated_timestamp] The start time of the query. All swap activities updated after the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
253
|
+
* @param {Number} [max_updated_timestamp] The end time of the query. All swap activities updated before the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
254
|
+
* @param {String} [initiator] The initiator of the swap activity. It is optional when creating the activity and defaults to your API key if not specified.
|
|
255
|
+
* @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
|
|
256
|
+
* @param {String} [before] A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
|
|
257
|
+
* @param {String} [after] A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response.
|
|
258
|
+
* @param {module:model/String} [sort_by] The field to sort the results by. Possible values include: - `created_timestamp`: Sort by the time when the data was created. - `updated_timestamp`: Sort by the time when the data was last updated.
|
|
259
|
+
* @param {module:model/String} [direction = 'ASC')] The sort direction. Possible values include: - `ASC`: Sort the results in ascending order. - `DESC`: Sort the results in descending order.
|
|
260
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSwapActivities200Response} and HTTP response
|
|
261
|
+
*/
|
|
262
|
+
}, {
|
|
263
|
+
key: "listSwapActivitiesWithHttpInfo",
|
|
264
|
+
value: function listSwapActivitiesWithHttpInfo(opts) {
|
|
265
|
+
opts = opts || {};
|
|
266
|
+
var postBody = null;
|
|
267
|
+
if (postBody && postBody.toJSON) {
|
|
268
|
+
postBody = postBody.toJSON();
|
|
269
|
+
}
|
|
270
|
+
var pathParams = {};
|
|
271
|
+
var queryParams = {
|
|
272
|
+
'type': opts['type'],
|
|
273
|
+
'status': opts['status'],
|
|
274
|
+
'min_updated_timestamp': opts['min_updated_timestamp'],
|
|
275
|
+
'max_updated_timestamp': opts['max_updated_timestamp'],
|
|
276
|
+
'initiator': opts['initiator'],
|
|
277
|
+
'limit': opts['limit'],
|
|
278
|
+
'before': opts['before'],
|
|
279
|
+
'after': opts['after'],
|
|
280
|
+
'sort_by': opts['sort_by'],
|
|
281
|
+
'direction': opts['direction']
|
|
282
|
+
};
|
|
283
|
+
var headerParams = {};
|
|
284
|
+
var formParams = {};
|
|
285
|
+
var authNames = ['CoboAuth'];
|
|
286
|
+
var contentTypes = [];
|
|
287
|
+
var accepts = ['application/json'];
|
|
288
|
+
var returnType = _ListSwapActivities200Response["default"];
|
|
289
|
+
return this.apiClient.callApi('/swaps/activities', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* List swap activities
|
|
294
|
+
* This operation retrieves a list of swap activities. You can filter the results by swap type, status, initiator, and time range.
|
|
295
|
+
* @param {Object} opts Optional parameters
|
|
296
|
+
* @param {module:model/SwapType} opts.type
|
|
297
|
+
* @param {module:model/SwapActivityStatus} opts.status
|
|
298
|
+
* @param {Number} opts.min_updated_timestamp The start time of the query. All swap activities updated after the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
299
|
+
* @param {Number} opts.max_updated_timestamp The end time of the query. All swap activities updated before the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds.
|
|
300
|
+
* @param {String} opts.initiator The initiator of the swap activity. It is optional when creating the activity and defaults to your API key if not specified.
|
|
301
|
+
* @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
|
|
302
|
+
* @param {String} opts.before A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
|
|
303
|
+
* @param {String} opts.after A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response.
|
|
304
|
+
* @param {module:model/String} opts.sort_by The field to sort the results by. Possible values include: - `created_timestamp`: Sort by the time when the data was created. - `updated_timestamp`: Sort by the time when the data was last updated.
|
|
305
|
+
* @param {module:model/String} opts.direction The sort direction. Possible values include: - `ASC`: Sort the results in ascending order. - `DESC`: Sort the results in descending order. (default to 'ASC')
|
|
306
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSwapActivities200Response}
|
|
307
|
+
*/
|
|
308
|
+
}, {
|
|
309
|
+
key: "listSwapActivities",
|
|
310
|
+
value: function listSwapActivities(opts) {
|
|
311
|
+
return this.listSwapActivitiesWithHttpInfo(opts).then(function (response_and_data) {
|
|
312
|
+
return response_and_data.data;
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* List enabled tokens for swap
|
|
318
|
+
* This operation retrieves a list of tokens that are enabled for the swap feature. You can filter the results by swap type, asset ID, and chain ID.
|
|
319
|
+
* @param {Object} opts Optional parameters
|
|
320
|
+
* @param {module:model/SwapType} [type]
|
|
321
|
+
* @param {String} [asset_id] (This concept applies to Exchange Wallets only) The asset ID. An asset ID is the unique identifier of the asset held within your linked exchange account.
|
|
322
|
+
* @param {String} [chain_id] 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).
|
|
323
|
+
* @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
|
|
324
|
+
* @param {String} [before] A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
|
|
325
|
+
* @param {String} [after] A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response.
|
|
326
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSwapEnabledTokens200Response} and HTTP response
|
|
327
|
+
*/
|
|
328
|
+
}, {
|
|
329
|
+
key: "listSwapEnabledTokensWithHttpInfo",
|
|
330
|
+
value: function listSwapEnabledTokensWithHttpInfo(opts) {
|
|
331
|
+
opts = opts || {};
|
|
332
|
+
var postBody = null;
|
|
333
|
+
if (postBody && postBody.toJSON) {
|
|
334
|
+
postBody = postBody.toJSON();
|
|
335
|
+
}
|
|
336
|
+
var pathParams = {};
|
|
337
|
+
var queryParams = {
|
|
338
|
+
'type': opts['type'],
|
|
339
|
+
'asset_id': opts['asset_id'],
|
|
340
|
+
'chain_id': opts['chain_id'],
|
|
341
|
+
'limit': opts['limit'],
|
|
342
|
+
'before': opts['before'],
|
|
343
|
+
'after': opts['after']
|
|
344
|
+
};
|
|
345
|
+
var headerParams = {};
|
|
346
|
+
var formParams = {};
|
|
347
|
+
var authNames = ['CoboAuth'];
|
|
348
|
+
var contentTypes = [];
|
|
349
|
+
var accepts = ['application/json'];
|
|
350
|
+
var returnType = _ListSwapEnabledTokens200Response["default"];
|
|
351
|
+
return this.apiClient.callApi('/swaps/enabled_tokens', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* List enabled tokens for swap
|
|
356
|
+
* This operation retrieves a list of tokens that are enabled for the swap feature. You can filter the results by swap type, asset ID, and chain ID.
|
|
357
|
+
* @param {Object} opts Optional parameters
|
|
358
|
+
* @param {module:model/SwapType} opts.type
|
|
359
|
+
* @param {String} opts.asset_id (This concept applies to Exchange Wallets only) The asset ID. An asset ID is the unique identifier of the asset held within your linked exchange account.
|
|
360
|
+
* @param {String} opts.chain_id 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).
|
|
361
|
+
* @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
|
|
362
|
+
* @param {String} opts.before A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
|
|
363
|
+
* @param {String} opts.after A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response.
|
|
364
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSwapEnabledTokens200Response}
|
|
365
|
+
*/
|
|
366
|
+
}, {
|
|
367
|
+
key: "listSwapEnabledTokens",
|
|
368
|
+
value: function listSwapEnabledTokens(opts) {
|
|
369
|
+
return this.listSwapEnabledTokensWithHttpInfo(opts).then(function (response_and_data) {
|
|
370
|
+
return response_and_data.data;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}]);
|
|
374
|
+
}();
|
|
@@ -203,7 +203,7 @@ var TransactionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Call smart contract
|
|
206
|
-
* This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to
|
|
206
|
+
* This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to transactions from Custodial Wallets (Web3 Wallets), MPC Wallets, or Smart Contract Wallets on EVM-compatible chains and Solana. Solana v0 transactions are not supported.</Note> <Info>If you initiate a transaction from a Smart Contract Wallet, a relevant transaction will be triggered from the Delegate to the Cobo Safe's address of the Smart Contract Wallet, with a transfer amount of <code>0</code>.</Info>
|
|
207
207
|
* @param {Object} opts Optional parameters
|
|
208
208
|
* @param {module:model/ContractCallParams} [ContractCallParams] The request body for making a contract call.
|
|
209
209
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateTransferTransaction201Response} and HTTP response
|
|
@@ -229,7 +229,7 @@ var TransactionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* Call smart contract
|
|
232
|
-
* This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to
|
|
232
|
+
* This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to transactions from Custodial Wallets (Web3 Wallets), MPC Wallets, or Smart Contract Wallets on EVM-compatible chains and Solana. Solana v0 transactions are not supported.</Note> <Info>If you initiate a transaction from a Smart Contract Wallet, a relevant transaction will be triggered from the Delegate to the Cobo Safe's address of the Smart Contract Wallet, with a transfer amount of <code>0</code>.</Info>
|
|
233
233
|
* @param {Object} opts Optional parameters
|
|
234
234
|
* @param {module:model/ContractCallParams} opts.ContractCallParams The request body for making a contract call.
|
|
235
235
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateTransferTransaction201Response}
|
|
@@ -244,7 +244,7 @@ var TransactionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
246
|
* Sign message
|
|
247
|
-
* This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](https://www.cobo.com/developers/v2/api-references/transactions/get-transaction-information). <Note> This operation only supports message signing transactions from the following wallets and chains: - MPC Wallets: BTC, EVM-compatible chains,
|
|
247
|
+
* This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](https://www.cobo.com/developers/v2/api-references/transactions/get-transaction-information). <Note> This operation only supports message signing transactions from the following wallets and chains: - MPC Wallets: BTC, EVM-compatible chains, and Cosmos. - Web3 Wallets: EVM-compatible chains. </Note>
|
|
248
248
|
* @param {Object} opts Optional parameters
|
|
249
249
|
* @param {module:model/MessageSignParams} [MessageSignParams] The request body to create a message signing transaction
|
|
250
250
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateTransferTransaction201Response} and HTTP response
|
|
@@ -270,7 +270,7 @@ var TransactionsApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* Sign message
|
|
273
|
-
* This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](https://www.cobo.com/developers/v2/api-references/transactions/get-transaction-information). <Note> This operation only supports message signing transactions from the following wallets and chains: - MPC Wallets: BTC, EVM-compatible chains,
|
|
273
|
+
* This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](https://www.cobo.com/developers/v2/api-references/transactions/get-transaction-information). <Note> This operation only supports message signing transactions from the following wallets and chains: - MPC Wallets: BTC, EVM-compatible chains, and Cosmos. - Web3 Wallets: EVM-compatible chains. </Note>
|
|
274
274
|
* @param {Object} opts Optional parameters
|
|
275
275
|
* @param {module:model/MessageSignParams} opts.MessageSignParams The request body to create a message signing transaction
|
|
276
276
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateTransferTransaction201Response}
|