@cobo/cobo-waas2 1.32.0 → 1.33.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 +2 -1
- package/dist/ApiClient.js +1 -1
- package/dist/api/PaymentApi.js +36 -0
- package/dist/model/TransactionExtra.js +54 -8
- package/docs/PaymentApi.md +47 -0
- package/docs/TransactionExtra.md +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](http
|
|
|
15
15
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
16
16
|
|
|
17
17
|
- API version: v2
|
|
18
|
-
- Package version: 1.
|
|
18
|
+
- Package version: 1.33.0
|
|
19
19
|
- Generator version: 7.6.0
|
|
20
20
|
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
|
21
21
|
For more information, please visit [https://www.cobo.com/waas](https://www.cobo.com/waas)
|
|
@@ -134,6 +134,7 @@ Class | Method | HTTP request | Description
|
|
|
134
134
|
*CoboWaas2.PaymentApi* | [**createRefund**](docs/PaymentApi.md#createRefund) | **POST** /payments/refunds | Create refund order
|
|
135
135
|
*CoboWaas2.PaymentApi* | [**createRefundLink**](docs/PaymentApi.md#createRefundLink) | **POST** /payments/links/refunds | Create refund link
|
|
136
136
|
*CoboWaas2.PaymentApi* | [**createReport**](docs/PaymentApi.md#createReport) | **POST** /payments/reports | Generate reports
|
|
137
|
+
*CoboWaas2.PaymentApi* | [**createSdkLink**](docs/PaymentApi.md#createSdkLink) | **POST** /payments/links/sdk | Create SDK link
|
|
137
138
|
*CoboWaas2.PaymentApi* | [**createSettlementRequest**](docs/PaymentApi.md#createSettlementRequest) | **POST** /payments/settlement_requests | Create settlement request
|
|
138
139
|
*CoboWaas2.PaymentApi* | [**createTopUpAddresses**](docs/PaymentApi.md#createTopUpAddresses) | **POST** /payments/topup/address | Batch create top-up addresses
|
|
139
140
|
*CoboWaas2.PaymentApi* | [**deleteCounterpartyById**](docs/PaymentApi.md#deleteCounterpartyById) | **DELETE** /payments/counterparty/{counterparty_id} | Delete counterparty
|
package/dist/ApiClient.js
CHANGED
package/dist/api/PaymentApi.js
CHANGED
|
@@ -841,6 +841,42 @@ var PaymentApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
841
841
|
});
|
|
842
842
|
}
|
|
843
843
|
|
|
844
|
+
/**
|
|
845
|
+
* Create SDK link
|
|
846
|
+
* This operation creates a payment link for use with the front-end SDK integration. The returned URL and token can be used to initialize the Cobo payment SDK in your front-end application. For more information, see [Cobo Payment Guide](https://www.cobo.com/payments/en/guides/overview).
|
|
847
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Link} and HTTP response
|
|
848
|
+
*/
|
|
849
|
+
}, {
|
|
850
|
+
key: "createSdkLinkWithHttpInfo",
|
|
851
|
+
value: function createSdkLinkWithHttpInfo() {
|
|
852
|
+
var postBody = null;
|
|
853
|
+
if (postBody && postBody.toJSON) {
|
|
854
|
+
postBody = postBody.toJSON();
|
|
855
|
+
}
|
|
856
|
+
var pathParams = {};
|
|
857
|
+
var queryParams = {};
|
|
858
|
+
var headerParams = {};
|
|
859
|
+
var formParams = {};
|
|
860
|
+
var authNames = ['CoboAuth'];
|
|
861
|
+
var contentTypes = [];
|
|
862
|
+
var accepts = ['application/json'];
|
|
863
|
+
var returnType = _Link["default"];
|
|
864
|
+
return this.apiClient.callApi('/payments/links/sdk', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Create SDK link
|
|
869
|
+
* This operation creates a payment link for use with the front-end SDK integration. The returned URL and token can be used to initialize the Cobo payment SDK in your front-end application. For more information, see [Cobo Payment Guide](https://www.cobo.com/payments/en/guides/overview).
|
|
870
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Link}
|
|
871
|
+
*/
|
|
872
|
+
}, {
|
|
873
|
+
key: "createSdkLink",
|
|
874
|
+
value: function createSdkLink() {
|
|
875
|
+
return this.createSdkLinkWithHttpInfo().then(function (response_and_data) {
|
|
876
|
+
return response_and_data.data;
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
|
|
844
880
|
/**
|
|
845
881
|
* Create settlement request
|
|
846
882
|
* <Note>This operation has been deprecated. Please use [Create payout](https://www.cobo.com/payments/en/api-references/payment/create-payout) instead.</Note> You can include multiple merchants and cryptocurrencies in a single settlement request.
|
|
@@ -11,6 +11,7 @@ var _TransactionBabylonBusinessInfo = _interopRequireDefault(require("./Transact
|
|
|
11
11
|
var _TransactionBabylonTxParameters = _interopRequireDefault(require("./TransactionBabylonTxParameters"));
|
|
12
12
|
var _TransactionCoreStakeInfo = _interopRequireDefault(require("./TransactionCoreStakeInfo"));
|
|
13
13
|
var _TransactionExtraType = _interopRequireDefault(require("./TransactionExtraType"));
|
|
14
|
+
var _TransactionWalletConnectInfo = _interopRequireDefault(require("./TransactionWalletConnectInfo"));
|
|
14
15
|
var _TransactionExtra;
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
17
|
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); }
|
|
@@ -37,7 +38,7 @@ var TransactionExtra = /*#__PURE__*/function () {
|
|
|
37
38
|
/**
|
|
38
39
|
* Constructs a new <code>TransactionExtra</code>.
|
|
39
40
|
* @alias module:model/TransactionExtra
|
|
40
|
-
* @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} instance The actual instance to initialize TransactionExtra.
|
|
41
|
+
* @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo|module:model/TransactionWalletConnectInfo)} instance The actual instance to initialize TransactionExtra.
|
|
41
42
|
*/
|
|
42
43
|
function TransactionExtra() {
|
|
43
44
|
var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
@@ -70,6 +71,10 @@ var TransactionExtra = /*#__PURE__*/function () {
|
|
|
70
71
|
this.actualInstance = _TransactionCoreStakeInfo["default"].constructFromObject(instance);
|
|
71
72
|
match++;
|
|
72
73
|
break;
|
|
74
|
+
case "WalletConnectInfo":
|
|
75
|
+
this.actualInstance = _TransactionWalletConnectInfo["default"].constructFromObject(instance);
|
|
76
|
+
match++;
|
|
77
|
+
break;
|
|
73
78
|
default:
|
|
74
79
|
errorMessages.push("Unrecognized discriminator value: " + discriminatorValue);
|
|
75
80
|
break;
|
|
@@ -145,13 +150,36 @@ var TransactionExtra = /*#__PURE__*/function () {
|
|
|
145
150
|
// json data failed to deserialize into TransactionCoreStakeInfo
|
|
146
151
|
errorMessages.push("Failed to construct TransactionCoreStakeInfo: " + err);
|
|
147
152
|
}
|
|
153
|
+
try {
|
|
154
|
+
if (instance instanceof _TransactionWalletConnectInfo["default"]) {
|
|
155
|
+
this.actualInstance = instance;
|
|
156
|
+
} else if (!!_TransactionWalletConnectInfo["default"].validateJSON && _TransactionWalletConnectInfo["default"].validateJSON(instance)) {
|
|
157
|
+
// plain JS object
|
|
158
|
+
// create TransactionWalletConnectInfo from JS object
|
|
159
|
+
this.actualInstance = _TransactionWalletConnectInfo["default"].constructFromObject(instance);
|
|
160
|
+
} else {
|
|
161
|
+
if (_TransactionWalletConnectInfo["default"].constructFromObject(instance)) {
|
|
162
|
+
if (!!_TransactionWalletConnectInfo["default"].constructFromObject(instance).toJSON) {
|
|
163
|
+
if (_TransactionWalletConnectInfo["default"].constructFromObject(instance).toJSON()) {
|
|
164
|
+
this.actualInstance = _TransactionWalletConnectInfo["default"].constructFromObject(instance);
|
|
165
|
+
}
|
|
166
|
+
} else {
|
|
167
|
+
this.actualInstance = _TransactionWalletConnectInfo["default"].constructFromObject(instance);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
match++;
|
|
172
|
+
} catch (err) {
|
|
173
|
+
// json data failed to deserialize into TransactionWalletConnectInfo
|
|
174
|
+
errorMessages.push("Failed to construct TransactionWalletConnectInfo: " + err);
|
|
175
|
+
}
|
|
148
176
|
|
|
149
177
|
// if (match > 1) {
|
|
150
|
-
// throw new Error("Multiple matches found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo. Input: " + JSON.stringify(instance));
|
|
178
|
+
// throw new Error("Multiple matches found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo, TransactionWalletConnectInfo. Input: " + JSON.stringify(instance));
|
|
151
179
|
// } else
|
|
152
180
|
if (match === 0) {
|
|
153
181
|
// this.actualInstance = null; // clear the actual instance in case there are multiple matches
|
|
154
|
-
// throw new Error("No match found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo. Details: " +
|
|
182
|
+
// throw new Error("No match found constructing `TransactionExtra` with oneOf schemas TransactionBabylonBusinessInfo, TransactionBabylonTxParameters, TransactionCoreStakeInfo, TransactionWalletConnectInfo. Details: " +
|
|
155
183
|
// errorMessages.join(", "));
|
|
156
184
|
return;
|
|
157
185
|
} else {// only 1 match
|
|
@@ -170,16 +198,16 @@ var TransactionExtra = /*#__PURE__*/function () {
|
|
|
170
198
|
key: "getActualInstance",
|
|
171
199
|
value:
|
|
172
200
|
/**
|
|
173
|
-
* Gets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>.
|
|
174
|
-
* @return {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} The actual instance.
|
|
201
|
+
* Gets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>, <code>TransactionWalletConnectInfo</code>.
|
|
202
|
+
* @return {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo|module:model/TransactionWalletConnectInfo)} The actual instance.
|
|
175
203
|
*/
|
|
176
204
|
function getActualInstance() {
|
|
177
205
|
return this.actualInstance;
|
|
178
206
|
}
|
|
179
207
|
|
|
180
208
|
/**
|
|
181
|
-
* Sets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>.
|
|
182
|
-
* @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo)} obj The actual instance.
|
|
209
|
+
* Sets the actual instance, which can be <code>TransactionBabylonBusinessInfo</code>, <code>TransactionBabylonTxParameters</code>, <code>TransactionCoreStakeInfo</code>, <code>TransactionWalletConnectInfo</code>.
|
|
210
|
+
* @param {(module:model/TransactionBabylonBusinessInfo|module:model/TransactionBabylonTxParameters|module:model/TransactionCoreStakeInfo|module:model/TransactionWalletConnectInfo)} obj The actual instance.
|
|
183
211
|
*/
|
|
184
212
|
}, {
|
|
185
213
|
key: "setActualInstance",
|
|
@@ -274,5 +302,23 @@ TransactionExtra.prototype['validator_address'] = undefined;
|
|
|
274
302
|
* @member {String} reward_address
|
|
275
303
|
*/
|
|
276
304
|
TransactionExtra.prototype['reward_address'] = undefined;
|
|
277
|
-
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The dapp name that initiated this transaction.
|
|
308
|
+
* @member {String} dapp_name
|
|
309
|
+
*/
|
|
310
|
+
TransactionExtra.prototype['dapp_name'] = undefined;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* The dapp domain that initiated this transaction
|
|
314
|
+
* @member {String} dapp_domain
|
|
315
|
+
*/
|
|
316
|
+
TransactionExtra.prototype['dapp_domain'] = undefined;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The session id that initiated this transaction
|
|
320
|
+
* @member {String} session_id
|
|
321
|
+
*/
|
|
322
|
+
TransactionExtra.prototype['session_id'] = undefined;
|
|
323
|
+
TransactionExtra.OneOf = ["TransactionBabylonBusinessInfo", "TransactionBabylonTxParameters", "TransactionCoreStakeInfo", "TransactionWalletConnectInfo"];
|
|
278
324
|
var _default = exports["default"] = TransactionExtra;
|
package/docs/PaymentApi.md
CHANGED
|
@@ -21,6 +21,7 @@ Method | HTTP request | Description
|
|
|
21
21
|
[**createRefund**](PaymentApi.md#createRefund) | **POST** /payments/refunds | Create refund order
|
|
22
22
|
[**createRefundLink**](PaymentApi.md#createRefundLink) | **POST** /payments/links/refunds | Create refund link
|
|
23
23
|
[**createReport**](PaymentApi.md#createReport) | **POST** /payments/reports | Generate reports
|
|
24
|
+
[**createSdkLink**](PaymentApi.md#createSdkLink) | **POST** /payments/links/sdk | Create SDK link
|
|
24
25
|
[**createSettlementRequest**](PaymentApi.md#createSettlementRequest) | **POST** /payments/settlement_requests | Create settlement request
|
|
25
26
|
[**createTopUpAddresses**](PaymentApi.md#createTopUpAddresses) | **POST** /payments/topup/address | Batch create top-up addresses
|
|
26
27
|
[**deleteCounterpartyById**](PaymentApi.md#deleteCounterpartyById) | **DELETE** /payments/counterparty/{counterparty_id} | Delete counterparty
|
|
@@ -960,6 +961,52 @@ Name | Type | Description | Notes
|
|
|
960
961
|
- **Accept**: application/json
|
|
961
962
|
|
|
962
963
|
|
|
964
|
+
## createSdkLink
|
|
965
|
+
|
|
966
|
+
> Link createSdkLink()
|
|
967
|
+
|
|
968
|
+
Create SDK link
|
|
969
|
+
|
|
970
|
+
This operation creates a payment link for use with the front-end SDK integration. The returned URL and token can be used to initialize the Cobo payment SDK in your front-end application. For more information, see [Cobo Payment Guide](https://www.cobo.com/payments/en/guides/overview).
|
|
971
|
+
|
|
972
|
+
### Example
|
|
973
|
+
|
|
974
|
+
```javascript
|
|
975
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
976
|
+
// Initialize the API client
|
|
977
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
978
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
979
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
980
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
981
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
982
|
+
// Call the API
|
|
983
|
+
const apiInstance = new CoboWaas2.PaymentApi();
|
|
984
|
+
apiInstance.createSdkLink().then((data) => {
|
|
985
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
986
|
+
}, (error) => {
|
|
987
|
+
console.error(error);
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
### Parameters
|
|
993
|
+
|
|
994
|
+
This endpoint does not need any parameter.
|
|
995
|
+
|
|
996
|
+
### Return type
|
|
997
|
+
|
|
998
|
+
[**Link**](Link.md)
|
|
999
|
+
|
|
1000
|
+
### Authorization
|
|
1001
|
+
|
|
1002
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
1003
|
+
|
|
1004
|
+
### HTTP request headers
|
|
1005
|
+
|
|
1006
|
+
- **Content-Type**: Not defined
|
|
1007
|
+
- **Accept**: application/json
|
|
1008
|
+
|
|
1009
|
+
|
|
963
1010
|
## createSettlementRequest
|
|
964
1011
|
|
|
965
1012
|
> Settlement createSettlementRequest(opts)
|
package/docs/TransactionExtra.md
CHANGED
|
@@ -17,5 +17,8 @@ Name | Type | Description | Notes
|
|
|
17
17
|
**change_address** | **String** | The change address on the Bitcoin chain. If not provided, the source wallet's address will be used as the change address. | [optional]
|
|
18
18
|
**validator_address** | **String** | The validator's EVM address. | [optional]
|
|
19
19
|
**reward_address** | **String** | The EVM address used to receive staking rewards. | [optional]
|
|
20
|
+
**dapp_name** | **String** | The dapp name that initiated this transaction. | [optional]
|
|
21
|
+
**dapp_domain** | **String** | The dapp domain that initiated this transaction | [optional]
|
|
22
|
+
**session_id** | **String** | The session id that initiated this transaction | [optional]
|
|
20
23
|
|
|
21
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobo/cobo-waas2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"description": "The Cobo Wallet-as-a-Service (WaaS) 2.0 API is the latest version of Cobo's WaaS API offering. It enables you to access Cobo's full suite of crypto wallet technologies with powerful and flexible access controls. By encapsulating complex security protocols and streamlining blockchain interactions, this API allows you to concentrate on your core business activities without worrying about the safety of your assets. The WaaS 2.0 API presents the following key features: - A unified API for Cobo's [all four wallet types](https://manuals.cobo.com/en/portal/introduction#an-all-in-one-wallet-platform) - Support for 80+ chains and 3000+ tokens - A comprehensive selection of webhook events - Flexible usage models for MPC Wallets, including [Organization-Controlled Wallets](https://manuals.cobo.com/en/portal/mpc-wallets/ocw/introduction) and [User-Controlled Wallets](https://manuals.cobo.com/en/portal/mpc-wallets/ucw/introduction) - Programmatic control of smart contract wallets such as Safe{Wallet} with fine-grained access controls - Seamlessly transfer funds across multiple exchanges, including Binance, OKX, Bybit, Deribit, and more For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](https://www.cobo.com/developers/v2/guides/overview/introduction). ",
|
|
5
5
|
"license": "GPL 2.0",
|
|
6
6
|
"main": "dist/index.js",
|