@cobo/cobo-waas2 1.5.0 → 1.7.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 +31 -5
- package/dist/ApiClient.js +56 -6
- package/dist/ServerDemo.js +80 -0
- package/dist/api/DevelopersApi.js +79 -0
- package/dist/api/DevelopersWebhooksApi.js +2 -2
- package/dist/api/OAuthApi.js +8 -8
- package/dist/api/StakingsApi.js +91 -7
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/api/WalletsApi.js +58 -57
- package/dist/crypto/Ed25519Signer.js +36 -0
- package/dist/crypto/Secp256k1Signer.js +36 -0
- package/dist/index.js +153 -13
- package/dist/model/Activity.js +4 -8
- package/dist/model/ActivityAction.js +20 -0
- package/dist/model/ActivityType.js +5 -0
- package/dist/model/AddressTransferDestination.js +2 -2
- package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +6 -17
- package/dist/model/AutoFuelType.js +61 -0
- package/dist/model/BabylonStakeEstimatedFee.js +118 -0
- package/dist/model/BabylonValidator.js +9 -12
- package/dist/model/CheckAddressChainsValidity200ResponseInner.js +121 -0
- package/dist/model/ContractCallParams.js +9 -0
- package/dist/model/CoreStakeExtra.js +170 -0
- package/dist/model/CoreStakingExtra.js +187 -0
- package/dist/model/CreateClaimActivity.js +139 -0
- package/dist/model/CreateClaimActivityRequest.js +182 -0
- package/dist/model/CreateSmartContractWalletParams.js +1 -1
- package/dist/model/CreateStakeActivity.js +4 -8
- package/dist/model/CreateStakeActivityExtra.js +94 -8
- package/dist/model/CreateStakeActivityRequest.js +5 -10
- package/dist/model/CreateUnstakeActivity.js +16 -0
- package/dist/model/CreateUnstakeActivityExtra.js +159 -0
- package/dist/model/CreateUnstakeActivityRequest.js +20 -0
- package/dist/model/CreateWithdrawActivity.js +0 -13
- package/dist/model/CreateWithdrawActivityRequest.js +0 -18
- package/dist/model/EstimateClaimFee.js +145 -0
- package/dist/model/EstimateContractCallFeeParams.js +6 -8
- package/dist/model/EstimateFeeParams.js +1 -1
- package/dist/model/EstimateStakeFee.js +5 -10
- package/dist/model/EstimateTransferFeeParams.js +4 -8
- package/dist/model/EstimateUnstakeFee.js +20 -0
- package/dist/model/EstimateWithdrawFee.js +0 -18
- package/dist/model/EstimatedEvmEip1559FeeSlow.js +3 -5
- package/dist/model/EstimatedEvmLegacyFeeSlow.js +3 -5
- package/dist/model/EstimatedFee.js +1 -1
- package/dist/model/EstimatedFixedFee.js +4 -4
- package/dist/model/EstimatedUtxoFeeSlow.js +3 -3
- package/dist/model/EthStakeEstimatedFee.js +112 -0
- package/dist/model/EthStakeExtra.js +131 -0
- package/dist/model/EthStakingExtra.js +162 -0
- package/dist/model/EthStakingExtraAllOfBeaconValidators.js +140 -0
- package/dist/model/EthUnstakeExtra.js +131 -0
- package/dist/model/FeeAmount.js +1 -1
- package/dist/model/FeeGasLimit.js +1 -2
- package/dist/model/FeeRate.js +1 -1
- package/dist/model/FixedFeeRate.js +2 -2
- package/dist/model/GetApiKeyInfo200Response.js +251 -0
- package/dist/model/GetStakingEstimationFee201Response.js +144 -43
- package/dist/model/GetStakingEstimationFeeRequest.js +41 -19
- package/dist/model/{GetToken200Response.js → GetToken2XXResponse.js} +21 -21
- package/dist/model/GetToken4XXResponse.js +12 -10
- package/dist/model/MPCDelegate.js +1 -1
- package/dist/model/MPCProject.js +4 -4
- package/dist/model/MpcTransferSource.js +2 -2
- package/dist/model/Pagination.js +2 -2
- package/dist/model/{RefreshToken201Response.js → RefreshToken2XXResponse.js} +21 -21
- package/dist/model/RoleScopes.js +128 -0
- package/dist/model/Scopes.js +142 -0
- package/dist/model/SmartContractWalletInfo.js +1 -1
- package/dist/model/StakingPoolId.js +81 -0
- package/dist/model/StakingPoolType.js +10 -0
- package/dist/model/Stakings.js +10 -14
- package/dist/model/StakingsExtra.js +95 -8
- package/dist/model/TransactionEvmEip1559Fee.js +2 -4
- package/dist/model/TransactionEvmLegacyFee.js +2 -4
- package/dist/model/TransactionFee.js +1 -2
- package/dist/model/TransactionRbf.js +9 -0
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionRequestEvmEip1559Fee.js +2 -3
- package/dist/model/TransactionRequestEvmLegacyFee.js +2 -3
- package/dist/model/TransactionRequestFee.js +1 -2
- package/dist/model/TransactionRequestFixedFee.js +1 -1
- package/dist/model/TransactionRequestUtxoFee.js +1 -1
- package/dist/model/TransactionSource.js +1 -1
- package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +0 -13
- package/dist/model/TransferDestination.js +2 -2
- package/dist/model/TransferParams.js +9 -0
- package/docs/Activity.md +1 -1
- package/docs/ActivityAction.md +8 -0
- package/docs/ActivityType.md +2 -0
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -2
- package/docs/AutoFuelType.md +12 -0
- package/docs/BabylonStakeEstimatedFee.md +12 -0
- package/docs/BabylonValidator.md +6 -4
- package/docs/CheckAddressChainsValidity200ResponseInner.md +10 -0
- package/docs/ContractCallParams.md +1 -0
- package/docs/CoreStakeExtra.md +13 -0
- package/docs/CoreStakingExtra.md +14 -0
- package/docs/CreateClaimActivity.md +11 -0
- package/docs/CreateClaimActivityRequest.md +12 -0
- package/docs/CreateStakeActivity.md +1 -1
- package/docs/CreateStakeActivityExtra.md +5 -0
- package/docs/CreateStakeActivityRequest.md +1 -1
- package/docs/CreateUnstakeActivity.md +1 -0
- package/docs/CreateUnstakeActivityExtra.md +10 -0
- package/docs/CreateUnstakeActivityRequest.md +1 -0
- package/docs/CreateWithdrawActivity.md +0 -1
- package/docs/CreateWithdrawActivityRequest.md +0 -1
- package/docs/DevelopersApi.md +55 -0
- package/docs/DevelopersWebhooksApi.md +1 -1
- package/docs/EstimateClaimFee.md +11 -0
- package/docs/EstimateContractCallFeeParams.md +2 -2
- package/docs/EstimateFeeParams.md +2 -2
- package/docs/EstimateStakeFee.md +1 -1
- package/docs/EstimateTransferFeeParams.md +2 -2
- package/docs/EstimateUnstakeFee.md +1 -0
- package/docs/EstimateWithdrawFee.md +0 -1
- package/docs/EstimatedEvmEip1559FeeSlow.md +1 -1
- package/docs/EstimatedEvmLegacyFeeSlow.md +1 -1
- package/docs/EstimatedFee.md +1 -1
- package/docs/EstimatedFixedFee.md +1 -1
- package/docs/EstimatedUtxoFeeSlow.md +1 -1
- package/docs/EthStakeEstimatedFee.md +11 -0
- package/docs/EthStakeExtra.md +10 -0
- package/docs/EthStakingExtra.md +11 -0
- package/docs/EthStakingExtraAllOfBeaconValidators.md +14 -0
- package/docs/EthUnstakeExtra.md +10 -0
- package/docs/FeeAmount.md +1 -1
- package/docs/FeeGasLimit.md +1 -1
- package/docs/FeeRate.md +1 -1
- package/docs/FixedFeeRate.md +1 -1
- package/docs/GetApiKeyInfo200Response.md +30 -0
- package/docs/GetStakingEstimationFee201Response.md +3 -0
- package/docs/GetStakingEstimationFeeRequest.md +3 -4
- package/docs/{GetToken200Response.md → GetToken2XXResponse.md} +1 -1
- package/docs/GetToken4XXResponse.md +1 -1
- package/docs/MPCProject.md +1 -1
- package/docs/MpcTransferSource.md +1 -1
- package/docs/OAuthApi.md +4 -4
- package/docs/Pagination.md +1 -1
- package/docs/PoolDetailsAllOfValidatorsInfo.md +6 -4
- package/docs/{RefreshToken201Response.md → RefreshToken2XXResponse.md} +1 -1
- package/docs/RoleScopes.md +10 -0
- package/docs/Scopes.md +13 -0
- package/docs/StakingPoolId.md +20 -0
- package/docs/StakingPoolType.md +4 -0
- package/docs/Stakings.md +2 -2
- package/docs/StakingsApi.md +108 -2
- package/docs/StakingsExtra.md +5 -0
- package/docs/TransactionEvmEip1559Fee.md +1 -1
- package/docs/TransactionEvmLegacyFee.md +1 -1
- package/docs/TransactionFee.md +1 -1
- package/docs/TransactionRbf.md +1 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionRequestEvmEip1559Fee.md +1 -1
- package/docs/TransactionRequestEvmLegacyFee.md +1 -1
- package/docs/TransactionRequestFee.md +1 -1
- package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +0 -1
- package/docs/TransactionsApi.md +2 -2
- package/docs/TransferDestination.md +2 -2
- package/docs/TransferParams.md +1 -0
- package/docs/WalletsApi.md +54 -54
- package/package.json +4 -2
- package/dist/model/StakingsValidatorInfo.js +0 -140
- package/docs/StakingsValidatorInfo.md +0 -13
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](/v2/
|
|
|
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.7.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)
|
|
@@ -36,7 +36,13 @@ const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
|
36
36
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
37
37
|
// for dev env
|
|
38
38
|
// apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
39
|
+
|
|
40
|
+
// by default, ed25519 is used
|
|
39
41
|
apiClient.setPrivateKey("<YOUR_API_PRIVATE_KEY_IN_HEX>");
|
|
42
|
+
|
|
43
|
+
// or secp256k1
|
|
44
|
+
// apiClient.setPrivateKey("<YOUR_API_PRIVATE_KEY_IN_HEX>", "SECP256K1");
|
|
45
|
+
|
|
40
46
|
// call api
|
|
41
47
|
const apiInstance = new CoboWaas2.WalletsApi();
|
|
42
48
|
const opts = {
|
|
@@ -62,6 +68,7 @@ All URIs are relative to *https://api.dev.cobo.com/v2*
|
|
|
62
68
|
Class | Method | HTTP request | Description
|
|
63
69
|
------------ | ------------- | ------------- | -------------
|
|
64
70
|
*CoboWaas2.AddressBooksApi* | [**listAddressBooks**](docs/AddressBooksApi.md#listAddressBooks) | **GET** /address_books | List address book entries
|
|
71
|
+
*CoboWaas2.DevelopersApi* | [**getApiKeyInfo**](docs/DevelopersApi.md#getApiKeyInfo) | **GET** /developers/api_key_info | Get API key information
|
|
65
72
|
*CoboWaas2.DevelopersWebhooksApi* | [**createWebhookEndpoint**](docs/DevelopersWebhooksApi.md#createWebhookEndpoint) | **POST** /webhooks/endpoints | Register webhook endpoint
|
|
66
73
|
*CoboWaas2.DevelopersWebhooksApi* | [**getWebhookEndpointById**](docs/DevelopersWebhooksApi.md#getWebhookEndpointById) | **GET** /webhooks/endpoints/{endpoint_id} | Get webhook endpoint information
|
|
67
74
|
*CoboWaas2.DevelopersWebhooksApi* | [**getWebhookEventById**](docs/DevelopersWebhooksApi.md#getWebhookEventById) | **GET** /webhooks/endpoints/{endpoint_id}/events/{event_id} | Retrieve event information
|
|
@@ -74,12 +81,14 @@ Class | Method | HTTP request | Description
|
|
|
74
81
|
*CoboWaas2.DevelopersWebhooksApi* | [**updateWebhookEndpointById**](docs/DevelopersWebhooksApi.md#updateWebhookEndpointById) | **PUT** /webhooks/endpoints/{endpoint_id} | Update webhook endpoint
|
|
75
82
|
*CoboWaas2.OAuthApi* | [**getToken**](docs/OAuthApi.md#getToken) | **GET** /oauth/token | Get Org Access Token
|
|
76
83
|
*CoboWaas2.OAuthApi* | [**refreshToken**](docs/OAuthApi.md#refreshToken) | **POST** /oauth/token | Refresh Org Access Token
|
|
84
|
+
*CoboWaas2.StakingsApi* | [**createClaimActivity**](docs/StakingsApi.md#createClaimActivity) | **POST** /stakings/activities/claim | Create claim activity
|
|
77
85
|
*CoboWaas2.StakingsApi* | [**createStakeActivity**](docs/StakingsApi.md#createStakeActivity) | **POST** /stakings/activities/stake | Create stake activity
|
|
78
86
|
*CoboWaas2.StakingsApi* | [**createUnstakeActivity**](docs/StakingsApi.md#createUnstakeActivity) | **POST** /stakings/activities/unstake | Create unstake activity
|
|
79
87
|
*CoboWaas2.StakingsApi* | [**createWithdrawActivity**](docs/StakingsApi.md#createWithdrawActivity) | **POST** /stakings/activities/withdraw | Create withdraw activity
|
|
80
88
|
*CoboWaas2.StakingsApi* | [**getStakingActivityById**](docs/StakingsApi.md#getStakingActivityById) | **GET** /stakings/activities/{activity_id} | Get staking activity details
|
|
81
89
|
*CoboWaas2.StakingsApi* | [**getStakingById**](docs/StakingsApi.md#getStakingById) | **GET** /stakings/{staking_id} | Get staking position details
|
|
82
90
|
*CoboWaas2.StakingsApi* | [**getStakingEstimationFee**](docs/StakingsApi.md#getStakingEstimationFee) | **POST** /stakings/estimate_fee | Estimate staking fees
|
|
91
|
+
*CoboWaas2.StakingsApi* | [**getStakingEstimationFeeV2**](docs/StakingsApi.md#getStakingEstimationFeeV2) | **POST** /stakings/estimate_fee_v2 | Estimate staking fees
|
|
83
92
|
*CoboWaas2.StakingsApi* | [**getStakingPoolById**](docs/StakingsApi.md#getStakingPoolById) | **GET** /stakings/pools/{pool_id} | Get staking pool details
|
|
84
93
|
*CoboWaas2.StakingsApi* | [**listStakingActivities**](docs/StakingsApi.md#listStakingActivities) | **GET** /stakings/activities | List staking activities
|
|
85
94
|
*CoboWaas2.StakingsApi* | [**listStakingPools**](docs/StakingsApi.md#listStakingPools) | **GET** /stakings/pools | List staking pools
|
|
@@ -96,12 +105,12 @@ Class | Method | HTTP request | Description
|
|
|
96
105
|
*CoboWaas2.TransactionsApi* | [**listTransactions**](docs/TransactionsApi.md#listTransactions) | **GET** /transactions | List all transactions
|
|
97
106
|
*CoboWaas2.TransactionsApi* | [**resendTransactionById**](docs/TransactionsApi.md#resendTransactionById) | **POST** /transactions/{transaction_id}/resend | Resend transaction
|
|
98
107
|
*CoboWaas2.TransactionsApi* | [**speedupTransactionById**](docs/TransactionsApi.md#speedupTransactionById) | **POST** /transactions/{transaction_id}/speedup | Speed up transaction
|
|
108
|
+
*CoboWaas2.WalletsApi* | [**checkAddressChainsValidity**](docs/WalletsApi.md#checkAddressChainsValidity) | **GET** /wallets/check_address_chains_validity | Check address validity across chains
|
|
99
109
|
*CoboWaas2.WalletsApi* | [**checkAddressValidity**](docs/WalletsApi.md#checkAddressValidity) | **GET** /wallets/check_address_validity | Check address validity
|
|
100
110
|
*CoboWaas2.WalletsApi* | [**checkAddressesValidity**](docs/WalletsApi.md#checkAddressesValidity) | **GET** /wallets/check_addresses_validity | Check addresses validity
|
|
101
111
|
*CoboWaas2.WalletsApi* | [**createAddress**](docs/WalletsApi.md#createAddress) | **POST** /wallets/{wallet_id}/addresses | Create addresses in wallet
|
|
102
112
|
*CoboWaas2.WalletsApi* | [**createWallet**](docs/WalletsApi.md#createWallet) | **POST** /wallets | Create wallet
|
|
103
113
|
*CoboWaas2.WalletsApi* | [**deleteWalletById**](docs/WalletsApi.md#deleteWalletById) | **POST** /wallets/{wallet_id}/delete | Delete wallet
|
|
104
|
-
*CoboWaas2.WalletsApi* | [**getAddress**](docs/WalletsApi.md#getAddress) | **GET** /wallets/{wallet_id}/addresses/{address} | Get address information
|
|
105
114
|
*CoboWaas2.WalletsApi* | [**getChainById**](docs/WalletsApi.md#getChainById) | **GET** /wallets/chains/{chain_id} | Get chain information
|
|
106
115
|
*CoboWaas2.WalletsApi* | [**getMaxTransferableValue**](docs/WalletsApi.md#getMaxTransferableValue) | **GET** /wallets/{wallet_id}/max_transferable_value | Get maximum transferable value
|
|
107
116
|
*CoboWaas2.WalletsApi* | [**getTokenById**](docs/WalletsApi.md#getTokenById) | **GET** /wallets/tokens/{token_id} | Get token information
|
|
@@ -163,6 +172,8 @@ Class | Method | HTTP request | Description
|
|
|
163
172
|
- [CoboWaas2.ApiLogSummary](docs/ApiLogSummary.md)
|
|
164
173
|
- [CoboWaas2.AssetBalance](docs/AssetBalance.md)
|
|
165
174
|
- [CoboWaas2.AssetInfo](docs/AssetInfo.md)
|
|
175
|
+
- [CoboWaas2.AutoFuelType](docs/AutoFuelType.md)
|
|
176
|
+
- [CoboWaas2.BabylonStakeEstimatedFee](docs/BabylonStakeEstimatedFee.md)
|
|
166
177
|
- [CoboWaas2.BabylonStakeExtra](docs/BabylonStakeExtra.md)
|
|
167
178
|
- [CoboWaas2.BabylonStakingExtra](docs/BabylonStakingExtra.md)
|
|
168
179
|
- [CoboWaas2.BabylonValidator](docs/BabylonValidator.md)
|
|
@@ -173,6 +184,7 @@ Class | Method | HTTP request | Description
|
|
|
173
184
|
- [CoboWaas2.BroadcastSignedTransactions201ResponseInner](docs/BroadcastSignedTransactions201ResponseInner.md)
|
|
174
185
|
- [CoboWaas2.BroadcastSignedTransactionsRequest](docs/BroadcastSignedTransactionsRequest.md)
|
|
175
186
|
- [CoboWaas2.ChainInfo](docs/ChainInfo.md)
|
|
187
|
+
- [CoboWaas2.CheckAddressChainsValidity200ResponseInner](docs/CheckAddressChainsValidity200ResponseInner.md)
|
|
176
188
|
- [CoboWaas2.CheckAddressValidity200Response](docs/CheckAddressValidity200Response.md)
|
|
177
189
|
- [CoboWaas2.CheckAddressesValidity200ResponseInner](docs/CheckAddressesValidity200ResponseInner.md)
|
|
178
190
|
- [CoboWaas2.CheckLoopTransfers200ResponseInner](docs/CheckLoopTransfers200ResponseInner.md)
|
|
@@ -183,7 +195,11 @@ Class | Method | HTTP request | Description
|
|
|
183
195
|
- [CoboWaas2.ContractCallParams](docs/ContractCallParams.md)
|
|
184
196
|
- [CoboWaas2.ContractCallSource](docs/ContractCallSource.md)
|
|
185
197
|
- [CoboWaas2.ContractCallSourceType](docs/ContractCallSourceType.md)
|
|
198
|
+
- [CoboWaas2.CoreStakeExtra](docs/CoreStakeExtra.md)
|
|
199
|
+
- [CoboWaas2.CoreStakingExtra](docs/CoreStakingExtra.md)
|
|
186
200
|
- [CoboWaas2.CreateAddressRequest](docs/CreateAddressRequest.md)
|
|
201
|
+
- [CoboWaas2.CreateClaimActivity](docs/CreateClaimActivity.md)
|
|
202
|
+
- [CoboWaas2.CreateClaimActivityRequest](docs/CreateClaimActivityRequest.md)
|
|
187
203
|
- [CoboWaas2.CreateCustodialWalletParams](docs/CreateCustodialWalletParams.md)
|
|
188
204
|
- [CoboWaas2.CreateExchangeWalletParams](docs/CreateExchangeWalletParams.md)
|
|
189
205
|
- [CoboWaas2.CreateKeyShareHolder](docs/CreateKeyShareHolder.md)
|
|
@@ -200,6 +216,7 @@ Class | Method | HTTP request | Description
|
|
|
200
216
|
- [CoboWaas2.CreateTransferTransaction201Response](docs/CreateTransferTransaction201Response.md)
|
|
201
217
|
- [CoboWaas2.CreateTssRequestRequest](docs/CreateTssRequestRequest.md)
|
|
202
218
|
- [CoboWaas2.CreateUnstakeActivity](docs/CreateUnstakeActivity.md)
|
|
219
|
+
- [CoboWaas2.CreateUnstakeActivityExtra](docs/CreateUnstakeActivityExtra.md)
|
|
203
220
|
- [CoboWaas2.CreateUnstakeActivityRequest](docs/CreateUnstakeActivityRequest.md)
|
|
204
221
|
- [CoboWaas2.CreateWalletParams](docs/CreateWalletParams.md)
|
|
205
222
|
- [CoboWaas2.CreateWebhookEndpointRequest](docs/CreateWebhookEndpointRequest.md)
|
|
@@ -215,6 +232,7 @@ Class | Method | HTTP request | Description
|
|
|
215
232
|
- [CoboWaas2.EigenLayerNativeStakeExtra](docs/EigenLayerNativeStakeExtra.md)
|
|
216
233
|
- [CoboWaas2.EigenlayerValidator](docs/EigenlayerValidator.md)
|
|
217
234
|
- [CoboWaas2.ErrorResponse](docs/ErrorResponse.md)
|
|
235
|
+
- [CoboWaas2.EstimateClaimFee](docs/EstimateClaimFee.md)
|
|
218
236
|
- [CoboWaas2.EstimateContractCallFeeParams](docs/EstimateContractCallFeeParams.md)
|
|
219
237
|
- [CoboWaas2.EstimateFeeParams](docs/EstimateFeeParams.md)
|
|
220
238
|
- [CoboWaas2.EstimateFeeRequestType](docs/EstimateFeeRequestType.md)
|
|
@@ -230,6 +248,11 @@ Class | Method | HTTP request | Description
|
|
|
230
248
|
- [CoboWaas2.EstimatedFixedFee](docs/EstimatedFixedFee.md)
|
|
231
249
|
- [CoboWaas2.EstimatedUtxoFee](docs/EstimatedUtxoFee.md)
|
|
232
250
|
- [CoboWaas2.EstimatedUtxoFeeSlow](docs/EstimatedUtxoFeeSlow.md)
|
|
251
|
+
- [CoboWaas2.EthStakeEstimatedFee](docs/EthStakeEstimatedFee.md)
|
|
252
|
+
- [CoboWaas2.EthStakeExtra](docs/EthStakeExtra.md)
|
|
253
|
+
- [CoboWaas2.EthStakingExtra](docs/EthStakingExtra.md)
|
|
254
|
+
- [CoboWaas2.EthStakingExtraAllOfBeaconValidators](docs/EthStakingExtraAllOfBeaconValidators.md)
|
|
255
|
+
- [CoboWaas2.EthUnstakeExtra](docs/EthUnstakeExtra.md)
|
|
233
256
|
- [CoboWaas2.EvmContractCallDestination](docs/EvmContractCallDestination.md)
|
|
234
257
|
- [CoboWaas2.EvmEIP191MessageSignDestination](docs/EvmEIP191MessageSignDestination.md)
|
|
235
258
|
- [CoboWaas2.EvmEIP712MessageSignDestination](docs/EvmEIP712MessageSignDestination.md)
|
|
@@ -247,9 +270,10 @@ Class | Method | HTTP request | Description
|
|
|
247
270
|
- [CoboWaas2.FeeRate](docs/FeeRate.md)
|
|
248
271
|
- [CoboWaas2.FeeType](docs/FeeType.md)
|
|
249
272
|
- [CoboWaas2.FixedFeeRate](docs/FixedFeeRate.md)
|
|
273
|
+
- [CoboWaas2.GetApiKeyInfo200Response](docs/GetApiKeyInfo200Response.md)
|
|
250
274
|
- [CoboWaas2.GetStakingEstimationFee201Response](docs/GetStakingEstimationFee201Response.md)
|
|
251
275
|
- [CoboWaas2.GetStakingEstimationFeeRequest](docs/GetStakingEstimationFeeRequest.md)
|
|
252
|
-
- [CoboWaas2.
|
|
276
|
+
- [CoboWaas2.GetToken2XXResponse](docs/GetToken2XXResponse.md)
|
|
253
277
|
- [CoboWaas2.GetToken4XXResponse](docs/GetToken4XXResponse.md)
|
|
254
278
|
- [CoboWaas2.KeyShareHolder](docs/KeyShareHolder.md)
|
|
255
279
|
- [CoboWaas2.KeyShareHolderGroup](docs/KeyShareHolderGroup.md)
|
|
@@ -304,10 +328,11 @@ Class | Method | HTTP request | Description
|
|
|
304
328
|
- [CoboWaas2.PoolDetailsAllOfValidatorsInfo](docs/PoolDetailsAllOfValidatorsInfo.md)
|
|
305
329
|
- [CoboWaas2.PoolSummary](docs/PoolSummary.md)
|
|
306
330
|
- [CoboWaas2.RawMessageSignDestination](docs/RawMessageSignDestination.md)
|
|
307
|
-
- [CoboWaas2.
|
|
331
|
+
- [CoboWaas2.RefreshToken2XXResponse](docs/RefreshToken2XXResponse.md)
|
|
308
332
|
- [CoboWaas2.RefreshTokenRequest](docs/RefreshTokenRequest.md)
|
|
309
333
|
- [CoboWaas2.ReplaceType](docs/ReplaceType.md)
|
|
310
334
|
- [CoboWaas2.RetryWebhookEventById201Response](docs/RetryWebhookEventById201Response.md)
|
|
335
|
+
- [CoboWaas2.RoleScopes](docs/RoleScopes.md)
|
|
311
336
|
- [CoboWaas2.RootPubkey](docs/RootPubkey.md)
|
|
312
337
|
- [CoboWaas2.SafeContractCallSource](docs/SafeContractCallSource.md)
|
|
313
338
|
- [CoboWaas2.SafeTransferSource](docs/SafeTransferSource.md)
|
|
@@ -315,17 +340,18 @@ Class | Method | HTTP request | Description
|
|
|
315
340
|
- [CoboWaas2.SafeWalletDelegates](docs/SafeWalletDelegates.md)
|
|
316
341
|
- [CoboWaas2.SafeWalletDelegatesContractCall](docs/SafeWalletDelegatesContractCall.md)
|
|
317
342
|
- [CoboWaas2.SafeWalletDelegatesTransfer](docs/SafeWalletDelegatesTransfer.md)
|
|
343
|
+
- [CoboWaas2.Scopes](docs/Scopes.md)
|
|
318
344
|
- [CoboWaas2.SmartContractInitiator](docs/SmartContractInitiator.md)
|
|
319
345
|
- [CoboWaas2.SmartContractWalletInfo](docs/SmartContractWalletInfo.md)
|
|
320
346
|
- [CoboWaas2.SmartContractWalletOperationType](docs/SmartContractWalletOperationType.md)
|
|
321
347
|
- [CoboWaas2.SmartContractWalletType](docs/SmartContractWalletType.md)
|
|
322
348
|
- [CoboWaas2.SourceGroup](docs/SourceGroup.md)
|
|
323
349
|
- [CoboWaas2.StakeSourceType](docs/StakeSourceType.md)
|
|
350
|
+
- [CoboWaas2.StakingPoolId](docs/StakingPoolId.md)
|
|
324
351
|
- [CoboWaas2.StakingPoolType](docs/StakingPoolType.md)
|
|
325
352
|
- [CoboWaas2.StakingSource](docs/StakingSource.md)
|
|
326
353
|
- [CoboWaas2.Stakings](docs/Stakings.md)
|
|
327
354
|
- [CoboWaas2.StakingsExtra](docs/StakingsExtra.md)
|
|
328
|
-
- [CoboWaas2.StakingsValidatorInfo](docs/StakingsValidatorInfo.md)
|
|
329
355
|
- [CoboWaas2.SubWalletAssetBalance](docs/SubWalletAssetBalance.md)
|
|
330
356
|
- [CoboWaas2.TSSGroups](docs/TSSGroups.md)
|
|
331
357
|
- [CoboWaas2.TSSRequest](docs/TSSRequest.md)
|
package/dist/ApiClient.js
CHANGED
|
@@ -6,8 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _superagent = _interopRequireDefault(require("superagent"));
|
|
8
8
|
var _querystring = _interopRequireDefault(require("querystring"));
|
|
9
|
-
var _ApiSigner = _interopRequireDefault(require("./crypto/ApiSigner"));
|
|
10
9
|
var _Env = _interopRequireDefault(require("./Env"));
|
|
10
|
+
var _Ed25519Signer = _interopRequireDefault(require("./crypto/Ed25519Signer"));
|
|
11
|
+
var _Secp256k1Signer = _interopRequireDefault(require("./crypto/Secp256k1Signer"));
|
|
12
|
+
var CryptoJS = _interopRequireWildcard(require("crypto-js"));
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
11
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -47,6 +51,8 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
47
51
|
function ApiClient() {
|
|
48
52
|
var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _Env["default"].PROD;
|
|
49
53
|
var privateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
54
|
+
var curve_type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
55
|
+
var signer = arguments.length > 3 ? arguments[3] : undefined;
|
|
50
56
|
_classCallCheck(this, ApiClient);
|
|
51
57
|
/**
|
|
52
58
|
* The base URL against which to resolve every API call's (relative) path.
|
|
@@ -54,7 +60,16 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
54
60
|
* @default https://api.dev.cobo.com/v2
|
|
55
61
|
*/
|
|
56
62
|
this.basePath = env.basePath;
|
|
57
|
-
|
|
63
|
+
if (privateKey) {
|
|
64
|
+
curve_type = curve_type || "ED25519";
|
|
65
|
+
if (curve_type === "ED25519") {
|
|
66
|
+
this.signer = new _Ed25519Signer["default"](privateKey);
|
|
67
|
+
} else if (curve_type === "SECP256k1") {
|
|
68
|
+
this.signer = new _Secp256k1Signer["default"](privateKey);
|
|
69
|
+
}
|
|
70
|
+
} else if (signer) {
|
|
71
|
+
this.signer = signer;
|
|
72
|
+
}
|
|
58
73
|
|
|
59
74
|
/**
|
|
60
75
|
* The authentication methods to be included for all API calls.
|
|
@@ -77,7 +92,7 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
77
92
|
* @default {}
|
|
78
93
|
*/
|
|
79
94
|
this.defaultHeaders = {
|
|
80
|
-
'User-Agent': 'cobo-waas2-js-sdk/1.
|
|
95
|
+
'User-Agent': 'cobo-waas2-js-sdk/1.7.0'
|
|
81
96
|
};
|
|
82
97
|
|
|
83
98
|
/**
|
|
@@ -120,15 +135,42 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
120
135
|
*/
|
|
121
136
|
this.plugins = null;
|
|
122
137
|
}
|
|
138
|
+
|
|
139
|
+
/***
|
|
140
|
+
*
|
|
141
|
+
* @param env
|
|
142
|
+
*/
|
|
123
143
|
return _createClass(ApiClient, [{
|
|
124
144
|
key: "setEnv",
|
|
125
145
|
value: function setEnv(env) {
|
|
126
146
|
this.basePath = env.basePath;
|
|
127
147
|
}
|
|
148
|
+
|
|
149
|
+
/***
|
|
150
|
+
*
|
|
151
|
+
* @param privateKey
|
|
152
|
+
*/
|
|
128
153
|
}, {
|
|
129
154
|
key: "setPrivateKey",
|
|
130
155
|
value: function setPrivateKey(privateKey) {
|
|
131
|
-
|
|
156
|
+
var curveType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "ED25519";
|
|
157
|
+
if (curveType === "ED25519") {
|
|
158
|
+
this.signer = new _Ed25519Signer["default"](privateKey);
|
|
159
|
+
} else if (curveType === "SECP256K1") {
|
|
160
|
+
this.signer = new _Secp256k1Signer["default"](privateKey);
|
|
161
|
+
} else {
|
|
162
|
+
throw new Error('Invalid curve type' + curveType);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/***
|
|
167
|
+
*
|
|
168
|
+
* @param signer
|
|
169
|
+
*/
|
|
170
|
+
}, {
|
|
171
|
+
key: "setSigner",
|
|
172
|
+
value: function setSigner(signer) {
|
|
173
|
+
this.signer = signer;
|
|
132
174
|
}
|
|
133
175
|
|
|
134
176
|
/**
|
|
@@ -441,8 +483,16 @@ var ApiClient = /*#__PURE__*/function () {
|
|
|
441
483
|
}).map(function (k) {
|
|
442
484
|
return k + '=' + encodeURIComponent(queryParams[k]).replace(/%20/g, "+");
|
|
443
485
|
}).join('&');
|
|
444
|
-
var
|
|
445
|
-
|
|
486
|
+
var nonce = String(new Date().getTime());
|
|
487
|
+
var strToSign = [httpMethod, new URL(url).pathname, nonce, queryStr, bodyParam ? JSON.stringify(bodyParam) : ''].join('|');
|
|
488
|
+
console.log("strToSign:", strToSign);
|
|
489
|
+
var hash2String = CryptoJS.SHA256(CryptoJS.SHA256(strToSign)).toString(CryptoJS.enc.Hex);
|
|
490
|
+
var headers = {
|
|
491
|
+
'BIZ-API-KEY': this.signer.getPublicKey(),
|
|
492
|
+
"BIZ-API-NONCE": nonce,
|
|
493
|
+
"BIZ-API-SIGNATURE": this.signer.sign(hash2String)
|
|
494
|
+
};
|
|
495
|
+
request.set(headers);
|
|
446
496
|
if (this.plugins !== null) {
|
|
447
497
|
for (var index in this.plugins) {
|
|
448
498
|
if (this.plugins.hasOwnProperty(index)) {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var express = require("express");
|
|
4
|
+
var nacl = require("tweetnacl");
|
|
5
|
+
var CryptoJS = require("crypto-js");
|
|
6
|
+
|
|
7
|
+
// Logging setup
|
|
8
|
+
var logger = console;
|
|
9
|
+
|
|
10
|
+
// Public keys for different environments
|
|
11
|
+
var pubKeys = {
|
|
12
|
+
DEV: "a04ea1d5fa8da71f1dcfccf972b9c4eba0a2d8aba1f6da26f49977b08a0d2718",
|
|
13
|
+
PROD: "8d4a482641adb2a34b726f05827dba9a9653e5857469b8749052bf4458a86729"
|
|
14
|
+
};
|
|
15
|
+
var pubkey = pubKeys["DEV"];
|
|
16
|
+
|
|
17
|
+
// Express setup
|
|
18
|
+
var app = express();
|
|
19
|
+
app.use(express.json({
|
|
20
|
+
verify: function verify(req, res, buf) {
|
|
21
|
+
req.rawBody = buf.toString();
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
// Helper function to verify the request signature
|
|
26
|
+
function verifyRequest(req, res) {
|
|
27
|
+
var signature = req.headers['biz-resp-signature'];
|
|
28
|
+
var bizTimestamp = req.headers['biz-timestamp'];
|
|
29
|
+
if (!signature || !bizTimestamp) {
|
|
30
|
+
res.status(401).send('Missing signature or timestamp');
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
var message = "".concat(req.rawBody, "|").concat(bizTimestamp);
|
|
34
|
+
if (!verifySignature(pubkey, signature, message)) {
|
|
35
|
+
res.status(401).send('Signature verification failed');
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Webhook endpoint
|
|
42
|
+
app.post("/api/webhook", function (req, res) {
|
|
43
|
+
if (!verifyRequest(req, res)) return;
|
|
44
|
+
var event = req.body;
|
|
45
|
+
logger.info(event);
|
|
46
|
+
logger.info(event.data);
|
|
47
|
+
// Add your business logic here
|
|
48
|
+
res.sendStatus(201);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Callback endpoint
|
|
52
|
+
app.post("/api/callback", function (req, res) {
|
|
53
|
+
if (!verifyRequest(req, res)) return;
|
|
54
|
+
var tx = req.body;
|
|
55
|
+
logger.info(tx);
|
|
56
|
+
// Add your callback logic here
|
|
57
|
+
res.send("ok");
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Signature verification function
|
|
61
|
+
function verifySignature(publicKey, signature, message) {
|
|
62
|
+
var vk = Buffer.from(publicKey, "hex");
|
|
63
|
+
|
|
64
|
+
// Double SHA-256 hash of the message
|
|
65
|
+
var hash2String = CryptoJS.SHA256(CryptoJS.SHA256(message)).toString(CryptoJS.enc.Hex);
|
|
66
|
+
try {
|
|
67
|
+
var signatureBuffer = Buffer.from(signature, "hex");
|
|
68
|
+
var messageBuffer = Buffer.from(hash2String, "hex");
|
|
69
|
+
return nacl.sign.detached.verify(messageBuffer, signatureBuffer, vk);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
logger.error("Signature verification failed", error);
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Server startup
|
|
77
|
+
var PORT = 8000;
|
|
78
|
+
app.listen(PORT, function () {
|
|
79
|
+
logger.info("Server running on http://localhost:".concat(PORT));
|
|
80
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
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 _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
9
|
+
var _GetApiKeyInfo200Response = _interopRequireDefault(require("../model/GetApiKeyInfo200Response"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
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); } /**
|
|
17
|
+
* Cobo Wallet as a Service 2.0
|
|
18
|
+
*
|
|
19
|
+
* Contact: help@cobo.com
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Developers service.
|
|
28
|
+
* @module api/DevelopersApi
|
|
29
|
+
*/
|
|
30
|
+
var DevelopersApi = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new DevelopersApi.
|
|
33
|
+
* @alias module:api/DevelopersApi
|
|
34
|
+
* @class
|
|
35
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
36
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
37
|
+
*/
|
|
38
|
+
function DevelopersApi(apiClient) {
|
|
39
|
+
_classCallCheck(this, DevelopersApi);
|
|
40
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get API key information
|
|
45
|
+
* This operation retrieves the details of the API key that you are using.
|
|
46
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetApiKeyInfo200Response} and HTTP response
|
|
47
|
+
*/
|
|
48
|
+
return _createClass(DevelopersApi, [{
|
|
49
|
+
key: "getApiKeyInfoWithHttpInfo",
|
|
50
|
+
value: function getApiKeyInfoWithHttpInfo() {
|
|
51
|
+
var postBody = null;
|
|
52
|
+
if (postBody && postBody.toJSON) {
|
|
53
|
+
postBody = postBody.toJSON();
|
|
54
|
+
}
|
|
55
|
+
var pathParams = {};
|
|
56
|
+
var queryParams = {};
|
|
57
|
+
var headerParams = {};
|
|
58
|
+
var formParams = {};
|
|
59
|
+
var authNames = ['CoboAuth'];
|
|
60
|
+
var contentTypes = [];
|
|
61
|
+
var accepts = ['application/json'];
|
|
62
|
+
var returnType = _GetApiKeyInfo200Response["default"];
|
|
63
|
+
return this.apiClient.callApi('/developers/api_key_info', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get API key information
|
|
68
|
+
* This operation retrieves the details of the API key that you are using.
|
|
69
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetApiKeyInfo200Response}
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "getApiKeyInfo",
|
|
73
|
+
value: function getApiKeyInfo() {
|
|
74
|
+
return this.getApiKeyInfoWithHttpInfo().then(function (response_and_data) {
|
|
75
|
+
return response_and_data.data;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
}();
|
|
@@ -460,7 +460,7 @@ var DevelopersWebhooksApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
460
460
|
|
|
461
461
|
/**
|
|
462
462
|
* Trigger test event
|
|
463
|
-
* This operation tests the functionality of your webhook endpoint by triggering a test webhook event.
|
|
463
|
+
* This operation tests the functionality of your webhook endpoint by triggering a test webhook event. The test event will be sent to all the endpoints you have registered on Cobo Portal. You only need to provide the event type. By default, the payload contains dummy data with no impact on your real business transactions or activities. You can optionally provide the `override_data` property to customize the payload.
|
|
464
464
|
* @param {Object} opts Optional parameters
|
|
465
465
|
* @param {module:model/TriggerTestWebhookEventRequest} [TriggerTestWebhookEventRequest] The request body used to trigger a test webhook event.
|
|
466
466
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/TriggerTestWebhookEvent201Response} and HTTP response
|
|
@@ -486,7 +486,7 @@ var DevelopersWebhooksApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
486
486
|
|
|
487
487
|
/**
|
|
488
488
|
* Trigger test event
|
|
489
|
-
* This operation tests the functionality of your webhook endpoint by triggering a test webhook event.
|
|
489
|
+
* This operation tests the functionality of your webhook endpoint by triggering a test webhook event. The test event will be sent to all the endpoints you have registered on Cobo Portal. You only need to provide the event type. By default, the payload contains dummy data with no impact on your real business transactions or activities. You can optionally provide the `override_data` property to customize the payload.
|
|
490
490
|
* @param {Object} opts Optional parameters
|
|
491
491
|
* @param {module:model/TriggerTestWebhookEventRequest} opts.TriggerTestWebhookEventRequest The request body used to trigger a test webhook event.
|
|
492
492
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/TriggerTestWebhookEvent201Response}
|
package/dist/api/OAuthApi.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
8
|
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
|
|
9
|
-
var
|
|
9
|
+
var _GetToken2XXResponse = _interopRequireDefault(require("../model/GetToken2XXResponse"));
|
|
10
10
|
var _GetToken4XXResponse = _interopRequireDefault(require("../model/GetToken4XXResponse"));
|
|
11
|
-
var
|
|
11
|
+
var _RefreshToken2XXResponse = _interopRequireDefault(require("../model/RefreshToken2XXResponse"));
|
|
12
12
|
var _RefreshTokenRequest = _interopRequireDefault(require("../model/RefreshTokenRequest"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
14
|
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); }
|
|
@@ -49,7 +49,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
49
49
|
* @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
|
|
50
50
|
* @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
|
|
51
51
|
* @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
|
|
52
|
-
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/
|
|
52
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetToken2XXResponse} and HTTP response
|
|
53
53
|
*/
|
|
54
54
|
return _createClass(OAuthApi, [{
|
|
55
55
|
key: "getTokenWithHttpInfo",
|
|
@@ -81,7 +81,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
81
81
|
var authNames = ['CoboAuth'];
|
|
82
82
|
var contentTypes = [];
|
|
83
83
|
var accepts = ['application/json'];
|
|
84
|
-
var returnType =
|
|
84
|
+
var returnType = _GetToken2XXResponse["default"];
|
|
85
85
|
return this.apiClient.callApi('/oauth/token', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -91,7 +91,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
91
91
|
* @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
|
|
92
92
|
* @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
|
|
93
93
|
* @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
|
|
94
|
-
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/
|
|
94
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetToken2XXResponse}
|
|
95
95
|
*/
|
|
96
96
|
}, {
|
|
97
97
|
key: "getToken",
|
|
@@ -105,7 +105,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
105
105
|
* Refresh Org Access Token
|
|
106
106
|
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new Org Access Token with a specified client ID, grant type and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.
|
|
107
107
|
* @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an Org Access Token.
|
|
108
|
-
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/
|
|
108
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RefreshToken2XXResponse} and HTTP response
|
|
109
109
|
*/
|
|
110
110
|
}, {
|
|
111
111
|
key: "refreshTokenWithHttpInfo",
|
|
@@ -125,7 +125,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
125
125
|
var authNames = ['CoboAuth'];
|
|
126
126
|
var contentTypes = ['application/json'];
|
|
127
127
|
var accepts = ['application/json'];
|
|
128
|
-
var returnType =
|
|
128
|
+
var returnType = _RefreshToken2XXResponse["default"];
|
|
129
129
|
return this.apiClient.callApi('/oauth/token', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
133
133
|
* Refresh Org Access Token
|
|
134
134
|
* <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new Org Access Token with a specified client ID, grant type and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.
|
|
135
135
|
* @param {module:model/RefreshTokenRequest} RefreshTokenRequest The request body for refreshing an Org Access Token.
|
|
136
|
-
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/
|
|
136
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RefreshToken2XXResponse}
|
|
137
137
|
*/
|
|
138
138
|
}, {
|
|
139
139
|
key: "refreshToken",
|