@cobo/cobo-waas2 1.8.0 → 1.10.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 +117 -33
- package/dist/ApiClient.js +11 -1
- package/dist/api/AddressBooksApi.js +1 -1
- package/dist/api/DevelopersApi.js +7 -7
- package/dist/api/DevelopersWebhooksApi.js +8 -8
- package/dist/api/PrimeBrokerApi.js +317 -0
- package/dist/api/StakingsApi.js +412 -18
- package/dist/api/SwapsApi.js +360 -0
- package/dist/api/TransactionsApi.js +64 -20
- package/dist/api/TravelRuleApi.js +18 -18
- package/dist/api/WalletsApi.js +84 -13
- package/dist/api/WalletsExchangeWalletApi.js +1 -1
- package/dist/api/WalletsMPCWalletsApi.js +151 -39
- package/dist/api/WalletsSmartContractWalletsApi.js +1 -1
- package/dist/index.js +276 -10
- package/dist/model/ActivityExtra.js +5 -5
- package/dist/model/AddressBalance.js +129 -0
- package/dist/model/AddressTransferDestination.js +36 -0
- package/dist/model/AddressesEventData.js +4 -4
- package/dist/model/AddressesEventDataAllOfAddresses.js +295 -0
- package/dist/model/ApprovalStatementStatus.js +81 -0
- package/dist/model/AssetBalance.js +6 -6
- package/dist/model/BTCEIP191MessageSignDestination.js +122 -0
- package/dist/model/BabylonAirdropPop.js +186 -0
- package/dist/model/BabylonAirdropRegistration.js +172 -0
- package/dist/model/BabylonEligibleAirdrop.js +157 -0
- package/dist/model/BabylonRegistrationRequestStatus.js +66 -0
- package/dist/model/BabylonRegistrationStatus.js +66 -0
- package/dist/model/BabylonStakingActivityDetailExtra.js +1 -1
- package/dist/model/BabylonStakingRegistration.js +185 -0
- package/dist/model/{TokenBalanceBalance.js → Balance.js} +22 -22
- package/dist/model/{SwapSummary.js → ChangeGuardPubkey200Response.js} +28 -39
- package/dist/model/ContractCallParams.js +36 -0
- package/dist/model/ContractCallSource.js +6 -0
- package/dist/model/CoreStakingActivityDetailExtra.js +3 -3
- package/dist/model/CreateAddressRequest.js +28 -2
- package/dist/model/CreateBabylonAirdropRegistration201Response.js +87 -0
- package/dist/model/CreateBabylonAirdropRegistrationRequest.js +105 -0
- package/dist/model/CreateBabylonStakingRegistration201Response.js +87 -0
- package/dist/model/CreateBabylonStakingRegistrationRequest.js +103 -0
- package/dist/model/CreatePrimeBrokerAddress201Response.js +140 -0
- package/dist/model/CreatePrimeBrokerAddressRequest.js +107 -0
- package/dist/model/CreateSwapActivityRequest.js +153 -0
- package/dist/model/CreateSwapQuote201Response.js +264 -0
- package/dist/model/CreateSwapQuoteRequest.js +166 -0
- package/dist/model/DeleteGuardPubkey201Response.js +110 -0
- package/dist/model/EthStakeEstimatedFee.js +1 -1
- package/dist/model/EthStakingActivityDetailExtra.js +1 -1
- package/dist/model/GetStakingEstimationFee201Response.js +1 -1
- package/dist/model/GetTransactionLimitation200Response.js +4 -4
- package/dist/model/GuardPubkeyStatus.js +91 -0
- package/dist/model/ListAddressBalancesByToken200Response.js +123 -0
- package/dist/model/ListBabylonAirdropRegistrations200Response.js +123 -0
- package/dist/model/ListBabylonEligibleAirdrops200Response.js +123 -0
- package/dist/model/ListBabylonEligibleStakings200Response.js +123 -0
- package/dist/model/ListBabylonEligibleStakings200ResponseDataInner.js +141 -0
- package/dist/model/ListBabylonStakingRegistrations200Response.js +123 -0
- package/dist/model/ListEnableTokenPairs200Response.js +123 -0
- package/dist/model/ListKeyShareHolders200Response.js +123 -0
- package/dist/model/ListSwapActivities200Response.js +123 -0
- package/dist/model/MessageSignDestination.js +70 -8
- package/dist/model/MessageSignDestinationType.js +12 -2
- package/dist/model/MessageSignSource.js +6 -0
- package/dist/model/MpcContractCallSource.js +16 -0
- package/dist/model/MpcMessageSignSource.js +16 -0
- package/dist/model/MpcSigningGroup.js +27 -4
- package/dist/model/MpcTransferSource.js +16 -0
- package/dist/model/OrgInfo.js +3 -3
- package/dist/model/QueryApprovalStatement200Response.js +122 -0
- package/dist/model/QueryGuardPubkey200Response.js +129 -0
- package/dist/model/QueryGuardPubkey200ResponseAddressesInner.js +125 -0
- package/dist/model/RootPubkey.js +1 -1
- package/dist/model/SelfCustodyWallet.js +7 -7
- package/dist/model/StakingPoolId.js +30 -0
- package/dist/model/StakingPoolType.js +15 -0
- package/dist/model/SubWalletAssetBalance.js +6 -6
- package/dist/model/SubmitDepositTravelRuleInfo201Response.js +1 -1
- package/dist/model/SwapQuote.js +203 -0
- package/dist/model/TSSGroups.js +1 -1
- package/dist/model/TokenBalance.js +6 -6
- package/dist/model/TransactionDepositToAddressDestination.js +16 -0
- package/dist/model/TransactionDepositToAddressDestinationTxInfo.js +83 -0
- package/dist/model/TransactionDestination.js +10 -4
- package/dist/model/TransactionRawTxInfo.js +29 -0
- package/dist/model/TransactionRbfSource.js +6 -0
- package/dist/model/TransactionSubStatus.js +5 -0
- package/dist/model/TransactionUserApprovalDetail.js +3 -3
- package/dist/model/TransactionUtxoChange.js +101 -0
- package/dist/model/TransferDestination.js +6 -0
- package/dist/model/TransferParams.js +36 -0
- package/dist/model/TransferSource.js +6 -0
- package/dist/model/TravelRuleDepositExchangesOrVASP.js +4 -4
- package/dist/model/TravelRuleDepositExchangesOrVASPEntityInfo.js +7 -7
- package/dist/model/TravelRuleDepositLegalEntity.js +5 -5
- package/dist/model/TravelRuleDepositNaturalEntity.js +9 -9
- package/dist/model/TravelRuleDepositRequestTravelRuleInfo.js +5 -5
- package/dist/model/TravelRuleWithdrawExchangesOrVASP.js +3 -3
- package/dist/model/TravelRuleWithdrawExchangesOrVASPEntityInfo.js +5 -5
- package/dist/model/TravelRuleWithdrawLegalEntity.js +2 -2
- package/dist/model/TravelRuleWithdrawNaturalEntity.js +7 -7
- package/dist/model/TravelRuleWithdrawRequestTravelRuleInfo.js +4 -4
- package/dist/model/Vasp.js +7 -7
- package/dist/model/WebhookEventData.js +2 -2
- package/docs/ActivityExtra.md +5 -5
- package/docs/AddressBalance.md +10 -0
- package/docs/AddressBooksApi.md +1 -1
- package/docs/AddressTransferDestination.md +14 -0
- package/docs/AddressesEventData.md +1 -1
- package/docs/AddressesEventDataAllOfAddresses.md +19 -0
- package/docs/ApprovalStatementStatus.md +20 -0
- package/docs/AssetBalance.md +1 -1
- package/docs/BTCEIP191MessageSignDestination.md +10 -0
- package/docs/BabylonAirdropPop.md +14 -0
- package/docs/BabylonAirdropRegistration.md +16 -0
- package/docs/BabylonEligibleAirdrop.md +14 -0
- package/docs/BabylonRegistrationRequestStatus.md +14 -0
- package/docs/BabylonRegistrationStatus.md +14 -0
- package/docs/BabylonStakingActivityDetailExtra.md +1 -1
- package/docs/BabylonStakingRegistration.md +17 -0
- package/docs/{TokenBalanceBalance.md → Balance.md} +1 -1
- package/docs/ChangeGuardPubkey200Response.md +9 -0
- package/docs/ContractCallParams.md +14 -0
- package/docs/ContractCallSource.md +1 -0
- package/docs/CoreStakingActivityDetailExtra.md +3 -3
- package/docs/CreateAddressRequest.md +3 -1
- package/docs/CreateBabylonAirdropRegistration201Response.md +9 -0
- package/docs/CreateBabylonAirdropRegistrationRequest.md +10 -0
- package/docs/CreateBabylonStakingRegistration201Response.md +9 -0
- package/docs/CreateBabylonStakingRegistrationRequest.md +10 -0
- package/docs/CreatePrimeBrokerAddress201Response.md +10 -0
- package/docs/CreatePrimeBrokerAddressRequest.md +9 -0
- package/docs/CreateSwapActivityRequest.md +12 -0
- package/docs/CreateSwapQuote201Response.md +17 -0
- package/docs/CreateSwapQuoteRequest.md +13 -0
- package/docs/DeleteGuardPubkey201Response.md +9 -0
- package/docs/DevelopersApi.md +5 -5
- package/docs/DevelopersWebhooksApi.md +8 -8
- package/docs/EthStakeEstimatedFee.md +1 -1
- package/docs/EthStakingActivityDetailExtra.md +1 -1
- package/docs/GetStakingEstimationFee201Response.md +1 -1
- package/docs/GetTransactionLimitation200Response.md +4 -4
- package/docs/GuardPubkeyStatus.md +24 -0
- package/docs/ListAddressBalancesByToken200Response.md +10 -0
- package/docs/ListBabylonAirdropRegistrations200Response.md +10 -0
- package/docs/ListBabylonEligibleAirdrops200Response.md +10 -0
- package/docs/ListBabylonEligibleStakings200Response.md +10 -0
- package/docs/ListBabylonEligibleStakings200ResponseDataInner.md +13 -0
- package/docs/ListBabylonStakingRegistrations200Response.md +10 -0
- package/docs/ListEnableTokenPairs200Response.md +10 -0
- package/docs/ListKeyShareHolders200Response.md +10 -0
- package/docs/ListSwapActivities200Response.md +10 -0
- package/docs/MessageSignDestination.md +1 -0
- package/docs/MessageSignDestinationType.md +6 -2
- package/docs/MessageSignSource.md +1 -0
- package/docs/MpcContractCallSource.md +1 -0
- package/docs/MpcMessageSignSource.md +1 -0
- package/docs/MpcSigningGroup.md +1 -1
- package/docs/MpcTransferSource.md +1 -0
- package/docs/OrgInfo.md +1 -1
- package/docs/PrimeBrokerApi.md +318 -0
- package/docs/QueryApprovalStatement200Response.md +12 -0
- package/docs/QueryGuardPubkey200Response.md +11 -0
- package/docs/QueryGuardPubkey200ResponseAddressesInner.md +10 -0
- package/docs/RootPubkey.md +1 -1
- package/docs/SelfCustodyWallet.md +3 -3
- package/docs/StakingPoolId.md +12 -0
- package/docs/StakingPoolType.md +6 -0
- package/docs/StakingsApi.md +460 -12
- package/docs/SubWalletAssetBalance.md +1 -1
- package/docs/SubmitDepositTravelRuleInfo201Response.md +1 -1
- package/docs/SwapQuote.md +16 -0
- package/docs/SwapsApi.md +348 -0
- package/docs/TSSGroups.md +1 -1
- package/docs/TokenBalance.md +1 -1
- package/docs/TransactionDepositToAddressDestination.md +1 -0
- package/docs/TransactionDepositToAddressDestinationTxInfo.md +9 -0
- package/docs/TransactionDestination.md +1 -0
- package/docs/TransactionRawTxInfo.md +2 -0
- package/docs/TransactionRbfSource.md +1 -0
- package/docs/TransactionSubStatus.md +2 -0
- package/docs/TransactionUserApprovalDetail.md +3 -3
- package/docs/TransactionUtxoChange.md +10 -0
- package/docs/TransactionsApi.md +68 -17
- package/docs/TransferDestination.md +14 -0
- package/docs/TransferParams.md +14 -0
- package/docs/TransferSource.md +1 -0
- package/docs/TravelRuleApi.md +13 -13
- package/docs/TravelRuleDepositExchangesOrVASP.md +2 -2
- package/docs/TravelRuleDepositExchangesOrVASPEntityInfo.md +7 -7
- package/docs/TravelRuleDepositLegalEntity.md +3 -3
- package/docs/TravelRuleDepositNaturalEntity.md +5 -5
- package/docs/TravelRuleDepositRequestTravelRuleInfo.md +5 -5
- package/docs/TravelRuleWithdrawExchangesOrVASP.md +1 -1
- package/docs/TravelRuleWithdrawExchangesOrVASPEntityInfo.md +5 -5
- package/docs/TravelRuleWithdrawLegalEntity.md +1 -1
- package/docs/TravelRuleWithdrawNaturalEntity.md +4 -4
- package/docs/TravelRuleWithdrawRequestTravelRuleInfo.md +4 -4
- package/docs/Vasp.md +3 -3
- package/docs/WalletsApi.md +78 -13
- package/docs/WalletsExchangeWalletApi.md +1 -1
- package/docs/WalletsMPCWalletsApi.md +141 -27
- package/docs/WalletsSmartContractWalletsApi.md +1 -1
- package/docs/WebhookEventData.md +1 -1
- package/package.json +2 -2
- package/docs/SwapSummary.md +0 -10
package/docs/SwapsApi.md
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# CoboWaas2.SwapsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.dev.cobo.com/v2*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**createSwapActivity**](SwapsApi.md#createSwapActivity) | **POST** /swaps/swap | Create Swap Activity
|
|
8
|
+
[**createSwapQuote**](SwapsApi.md#createSwapQuote) | **POST** /swaps/quote | Create Swap Quote
|
|
9
|
+
[**getSwapActivity**](SwapsApi.md#getSwapActivity) | **GET** /swaps/activities/{activity_id} | Get Swap Activity Details
|
|
10
|
+
[**getSwapQuote**](SwapsApi.md#getSwapQuote) | **GET** /swaps/quote | Get Current Swap Rate
|
|
11
|
+
[**listEnableTokenPairs**](SwapsApi.md#listEnableTokenPairs) | **GET** /swaps/enabled_pairs | List Supported Token Pairs
|
|
12
|
+
[**listSwapActivities**](SwapsApi.md#listSwapActivities) | **GET** /swaps/activities | List Swap Activities
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## createSwapActivity
|
|
17
|
+
|
|
18
|
+
> SwapActivity createSwapActivity(CreateSwapActivityRequest)
|
|
19
|
+
|
|
20
|
+
Create Swap Activity
|
|
21
|
+
|
|
22
|
+
This operation to create a swap activity.
|
|
23
|
+
|
|
24
|
+
### Example
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
28
|
+
// Initialize the API client
|
|
29
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
30
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
31
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
32
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
33
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
34
|
+
// Call the API
|
|
35
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
36
|
+
const CreateSwapActivityRequest = new CoboWaas2.CreateSwapActivityRequest();
|
|
37
|
+
apiInstance.createSwapActivity(CreateSwapActivityRequest).then((data) => {
|
|
38
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
39
|
+
}, (error) => {
|
|
40
|
+
console.error(error);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Parameters
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
Name | Type | Description | Notes
|
|
49
|
+
------------- | ------------- | ------------- | -------------
|
|
50
|
+
**CreateSwapActivityRequest** | [**CreateSwapActivityRequest**](CreateSwapActivityRequest.md)| The request body for creating a swap activity. |
|
|
51
|
+
|
|
52
|
+
### Return type
|
|
53
|
+
|
|
54
|
+
[**SwapActivity**](SwapActivity.md)
|
|
55
|
+
|
|
56
|
+
### Authorization
|
|
57
|
+
|
|
58
|
+
[OAuth2](../README.md#OAuth2)
|
|
59
|
+
|
|
60
|
+
### HTTP request headers
|
|
61
|
+
|
|
62
|
+
- **Content-Type**: application/json
|
|
63
|
+
- **Accept**: application/json
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## createSwapQuote
|
|
67
|
+
|
|
68
|
+
> CreateSwapQuote201Response createSwapQuote(CreateSwapQuoteRequest)
|
|
69
|
+
|
|
70
|
+
Create Swap Quote
|
|
71
|
+
|
|
72
|
+
This operation retrieves a quote for swapping between two tokens. Either pay_amount or receive_amount must be provided.
|
|
73
|
+
|
|
74
|
+
### Example
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
78
|
+
// Initialize the API client
|
|
79
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
80
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
81
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
82
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
83
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
84
|
+
// Call the API
|
|
85
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
86
|
+
const CreateSwapQuoteRequest = new CoboWaas2.CreateSwapQuoteRequest();
|
|
87
|
+
apiInstance.createSwapQuote(CreateSwapQuoteRequest).then((data) => {
|
|
88
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
89
|
+
}, (error) => {
|
|
90
|
+
console.error(error);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Parameters
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
Name | Type | Description | Notes
|
|
99
|
+
------------- | ------------- | ------------- | -------------
|
|
100
|
+
**CreateSwapQuoteRequest** | [**CreateSwapQuoteRequest**](CreateSwapQuoteRequest.md)| The request body for creating a swap activity. |
|
|
101
|
+
|
|
102
|
+
### Return type
|
|
103
|
+
|
|
104
|
+
[**CreateSwapQuote201Response**](CreateSwapQuote201Response.md)
|
|
105
|
+
|
|
106
|
+
### Authorization
|
|
107
|
+
|
|
108
|
+
[OAuth2](../README.md#OAuth2)
|
|
109
|
+
|
|
110
|
+
### HTTP request headers
|
|
111
|
+
|
|
112
|
+
- **Content-Type**: application/json
|
|
113
|
+
- **Accept**: application/json
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## getSwapActivity
|
|
117
|
+
|
|
118
|
+
> SwapActivity getSwapActivity(activity_id)
|
|
119
|
+
|
|
120
|
+
Get Swap Activity Details
|
|
121
|
+
|
|
122
|
+
This operation retrieves the details of a swap activity.
|
|
123
|
+
|
|
124
|
+
### Example
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
128
|
+
// Initialize the API client
|
|
129
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
130
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
131
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
132
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
133
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
134
|
+
// Call the API
|
|
135
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
136
|
+
const activity_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
137
|
+
apiInstance.getSwapActivity(activity_id).then((data) => {
|
|
138
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
139
|
+
}, (error) => {
|
|
140
|
+
console.error(error);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Parameters
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
Name | Type | Description | Notes
|
|
149
|
+
------------- | ------------- | ------------- | -------------
|
|
150
|
+
**activity_id** | **String**| The unique id of the activity. |
|
|
151
|
+
|
|
152
|
+
### Return type
|
|
153
|
+
|
|
154
|
+
[**SwapActivity**](SwapActivity.md)
|
|
155
|
+
|
|
156
|
+
### Authorization
|
|
157
|
+
|
|
158
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
159
|
+
|
|
160
|
+
### HTTP request headers
|
|
161
|
+
|
|
162
|
+
- **Content-Type**: Not defined
|
|
163
|
+
- **Accept**: application/json
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## getSwapQuote
|
|
167
|
+
|
|
168
|
+
> SwapQuote getSwapQuote(wallet_id, pay_token_id, receive_token_id, opts)
|
|
169
|
+
|
|
170
|
+
Get Current Swap Rate
|
|
171
|
+
|
|
172
|
+
This operation retrieves the current market exchange rate and estimated amount for swapping between two tokens. Either pay_amount or receive_amount must be provided.
|
|
173
|
+
|
|
174
|
+
### Example
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
177
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
178
|
+
// Initialize the API client
|
|
179
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
180
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
181
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
182
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
183
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
184
|
+
// Call the API
|
|
185
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
186
|
+
const wallet_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
187
|
+
const pay_token_id = "ETH";
|
|
188
|
+
const receive_token_id = "USDT";
|
|
189
|
+
const opts = {
|
|
190
|
+
'pay_amount': "1.5",
|
|
191
|
+
'receive_amount': "2000"
|
|
192
|
+
};
|
|
193
|
+
apiInstance.getSwapQuote(wallet_id, pay_token_id, receive_token_id, opts).then((data) => {
|
|
194
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
195
|
+
}, (error) => {
|
|
196
|
+
console.error(error);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Parameters
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
Name | Type | Description | Notes
|
|
205
|
+
------------- | ------------- | ------------- | -------------
|
|
206
|
+
**wallet_id** | **String**| The wallet ID. |
|
|
207
|
+
**pay_token_id** | **String**| Unique id of the token to pay. |
|
|
208
|
+
**receive_token_id** | **String**| Unique id of the token to receive. |
|
|
209
|
+
**pay_amount** | **String**| The amount of pay token to swap. | [optional]
|
|
210
|
+
**receive_amount** | **String**| The amount of token to receive. | [optional]
|
|
211
|
+
|
|
212
|
+
### Return type
|
|
213
|
+
|
|
214
|
+
[**SwapQuote**](SwapQuote.md)
|
|
215
|
+
|
|
216
|
+
### Authorization
|
|
217
|
+
|
|
218
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
219
|
+
|
|
220
|
+
### HTTP request headers
|
|
221
|
+
|
|
222
|
+
- **Content-Type**: Not defined
|
|
223
|
+
- **Accept**: application/json
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## listEnableTokenPairs
|
|
227
|
+
|
|
228
|
+
> ListEnableTokenPairs200Response listEnableTokenPairs(opts)
|
|
229
|
+
|
|
230
|
+
List Supported Token Pairs
|
|
231
|
+
|
|
232
|
+
This operation retrieves all supported token pairs for swaps in a specified wallet.
|
|
233
|
+
|
|
234
|
+
### Example
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
238
|
+
// Initialize the API client
|
|
239
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
240
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
241
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
242
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
243
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
244
|
+
// Call the API
|
|
245
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
246
|
+
const opts = {
|
|
247
|
+
'limit': 10,
|
|
248
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
249
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
250
|
+
};
|
|
251
|
+
apiInstance.listEnableTokenPairs(opts).then((data) => {
|
|
252
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
253
|
+
}, (error) => {
|
|
254
|
+
console.error(error);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Parameters
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
Name | Type | Description | Notes
|
|
263
|
+
------------- | ------------- | ------------- | -------------
|
|
264
|
+
**limit** | **Number**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10]
|
|
265
|
+
**before** | **String**| This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned. | [optional]
|
|
266
|
+
**after** | **String**| This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. | [optional]
|
|
267
|
+
|
|
268
|
+
### Return type
|
|
269
|
+
|
|
270
|
+
[**ListEnableTokenPairs200Response**](ListEnableTokenPairs200Response.md)
|
|
271
|
+
|
|
272
|
+
### Authorization
|
|
273
|
+
|
|
274
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
275
|
+
|
|
276
|
+
### HTTP request headers
|
|
277
|
+
|
|
278
|
+
- **Content-Type**: Not defined
|
|
279
|
+
- **Accept**: application/json
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## listSwapActivities
|
|
283
|
+
|
|
284
|
+
> ListSwapActivities200Response listSwapActivities(opts)
|
|
285
|
+
|
|
286
|
+
List Swap Activities
|
|
287
|
+
|
|
288
|
+
This operation retrieves a list of swap activities.
|
|
289
|
+
|
|
290
|
+
### Example
|
|
291
|
+
|
|
292
|
+
```javascript
|
|
293
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
294
|
+
// Initialize the API client
|
|
295
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
296
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
297
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
298
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
299
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
300
|
+
// Call the API
|
|
301
|
+
const apiInstance = new CoboWaas2.SwapsApi();
|
|
302
|
+
const opts = {
|
|
303
|
+
'status': "Success",
|
|
304
|
+
'min_updated_timestamp': 1635744000000,
|
|
305
|
+
'max_updated_timestamp': 1635744000000,
|
|
306
|
+
'initiator': "steve@example.com",
|
|
307
|
+
'limit': 10,
|
|
308
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
309
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk",
|
|
310
|
+
'sort_by': "timestamp",
|
|
311
|
+
'direction': "ASC"
|
|
312
|
+
};
|
|
313
|
+
apiInstance.listSwapActivities(opts).then((data) => {
|
|
314
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
315
|
+
}, (error) => {
|
|
316
|
+
console.error(error);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Parameters
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
Name | Type | Description | Notes
|
|
325
|
+
------------- | ------------- | ------------- | -------------
|
|
326
|
+
**status** | **String**| | [optional]
|
|
327
|
+
**min_updated_timestamp** | **Number**| The start time of the query. All staking activities updated after the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds. | [optional]
|
|
328
|
+
**max_updated_timestamp** | **Number**| The end time of the query. All staking activities updated before the specified time will be retrieved. The time is in Unix timestamp format, measured in milliseconds. | [optional]
|
|
329
|
+
**initiator** | **String**| The activity initiator, which is your API key by default. You can also specify the initiator when creating the activity. | [optional]
|
|
330
|
+
**limit** | **Number**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10]
|
|
331
|
+
**before** | **String**| This parameter specifies an object ID as a starting point for pagination, retrieving data before the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `before` to the ID of Object C (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object A. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. - If you set it to `infinity`, the last page of data is returned. | [optional]
|
|
332
|
+
**after** | **String**| This parameter specifies an object ID as a starting point for pagination, retrieving data after the specified object relative to the current dataset. Suppose the current data is ordered as Object A, Object B, and Object C. If you set `after` to the ID of Object A (`RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk`), the response will include Object B and Object C. **Notes**: - If you set both `after` and `before`, an error will occur. - If you leave both `before` and `after` empty, the first page of data is returned. | [optional]
|
|
333
|
+
**sort_by** | **String**| The field used for sorting. | [optional] [default to '']
|
|
334
|
+
**direction** | **String**| The sort direction. Possible values include: - `ASC`: Sort the results in ascending order. - `DESC`: Sort the results in descending order. | [optional] [default to '']
|
|
335
|
+
|
|
336
|
+
### Return type
|
|
337
|
+
|
|
338
|
+
[**ListSwapActivities200Response**](ListSwapActivities200Response.md)
|
|
339
|
+
|
|
340
|
+
### Authorization
|
|
341
|
+
|
|
342
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
343
|
+
|
|
344
|
+
### HTTP request headers
|
|
345
|
+
|
|
346
|
+
- **Content-Type**: Not defined
|
|
347
|
+
- **Accept**: application/json
|
|
348
|
+
|
package/docs/TSSGroups.md
CHANGED
|
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**tss_key_share_group_id** | **String** | The TSS key share group ID. | [optional]
|
|
8
8
|
**curve** | [**CurveType**](CurveType.md) | | [optional]
|
|
9
|
-
**root_pubkey** | **String** | The vault's [root extended public key](https://
|
|
9
|
+
**root_pubkey** | **String** | The vault's [root extended public key](https://www.cobo.com/developers/v2/guides/mpc-wallets/get-started-ocw#root-extended-public-keys). | [optional]
|
|
10
10
|
|
|
11
11
|
|
package/docs/TokenBalance.md
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**token_id** | **String** | The token ID, which is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens). |
|
|
8
|
-
**balance** | [**
|
|
8
|
+
**balance** | [**Balance**](Balance.md) | |
|
|
9
9
|
|
|
10
10
|
|
|
@@ -11,5 +11,6 @@ Name | Type | Description | Notes
|
|
|
11
11
|
**address** | **String** | The destination address. |
|
|
12
12
|
**memo** | **String** | The memo that identifies a transaction in order to credit the correct account. For transfers out of Cobo Portal, it is highly recommended to include a memo for the chains such as XRP, EOS, XLM, IOST, BNB_BNB, ATOM, LUNA, and TON. | [optional]
|
|
13
13
|
**amount** | **String** | The transfer amount. For example, if you trade 1.5 BTC, then the value is `1.5`. |
|
|
14
|
+
**tx_info** | [**TransactionDepositToAddressDestinationTxInfo**](TransactionDepositToAddressDestinationTxInfo.md) | | [optional]
|
|
14
15
|
|
|
15
16
|
|
|
@@ -24,5 +24,6 @@ Name | Type | Description | Notes
|
|
|
24
24
|
**wallet_type** | [**WalletType**](WalletType.md) | |
|
|
25
25
|
**wallet_subtype** | [**WalletSubtype**](WalletSubtype.md) | |
|
|
26
26
|
**memo** | **String** | The memo that identifies a transaction in order to credit the correct account. For transfers out of Cobo Portal, it is highly recommended to include a memo for the chains such as XRP, EOS, XLM, IOST, BNB_BNB, ATOM, LUNA, and TON. | [optional]
|
|
27
|
+
**tx_info** | [**TransactionDepositToAddressDestinationTxInfo**](TransactionDepositToAddressDestinationTxInfo.md) | | [optional]
|
|
27
28
|
|
|
28
29
|
|
|
@@ -7,5 +7,7 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**used_nonce** | **Number** | The transaction nonce. | [optional]
|
|
8
8
|
**selected_utxos** | [**[TransactionSelectedUtxo]**](TransactionSelectedUtxo.md) | The selected UTXOs to be consumed in the transaction. | [optional]
|
|
9
9
|
**raw_tx** | **String** | The raw transaction data. | [optional]
|
|
10
|
+
**unsigned_raw_tx** | **String** | The unsigned raw transaction data. | [optional]
|
|
11
|
+
**utxo_change** | [**TransactionUtxoChange**](TransactionUtxoChange.md) | | [optional]
|
|
10
12
|
|
|
11
13
|
|
|
@@ -9,5 +9,6 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**address** | **String** | The wallet address. If you want to specify the UTXOs to be used, please provide the `included_utxos` property. If you specify both the `address` and `included_utxos` properties, the specified included UTXOs must belong to the address. It is recommended to specify no more than 100 included UTXOs to ensure optimal transaction processing. You need to provide either the `address` or `included_utxos` property. If neither property is provided, the transfer will fail. | [optional]
|
|
10
10
|
**included_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
11
11
|
**excluded_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
12
|
+
**mpc_used_key_share_holder_group** | [**MpcSigningGroup**](MpcSigningGroup.md) | | [optional]
|
|
12
13
|
|
|
13
14
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
|
-
**pubkey** | **String** | The
|
|
7
|
+
**pubkey** | **String** | The Cobo Guard public key of the user who audited this message. | [optional]
|
|
8
8
|
**result** | [**TransactionApprovalResult**](TransactionApprovalResult.md) | | [optional]
|
|
9
|
-
**signature** | **String** |
|
|
9
|
+
**signature** | **String** | The signature of the audited message. | [optional]
|
|
10
10
|
**language** | **String** | The language of the audited message. | [optional]
|
|
11
|
-
**message_version** | **String** |
|
|
11
|
+
**message_version** | **String** | The version of the audited message. | [optional]
|
|
12
12
|
**message** | **String** | The audited message. | [optional]
|
|
13
13
|
**extra_message** | **String** | The extra audited message. | [optional]
|
|
14
14
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# CoboWaas2.TransactionUtxoChange
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**address** | **String** | The receiving address of the UTXO change output. | [optional]
|
|
8
|
+
**value** | **String** | The amount of the UTXO change output. | [optional]
|
|
9
|
+
|
|
10
|
+
|
package/docs/TransactionsApi.md
CHANGED
|
@@ -12,10 +12,11 @@ Method | HTTP request | Description
|
|
|
12
12
|
[**createTransferTransaction**](TransactionsApi.md#createTransferTransaction) | **POST** /transactions/transfer | Transfer token
|
|
13
13
|
[**dropTransactionById**](TransactionsApi.md#dropTransactionById) | **POST** /transactions/{transaction_id}/drop | Drop transaction
|
|
14
14
|
[**estimateFee**](TransactionsApi.md#estimateFee) | **POST** /transactions/estimate_fee | Estimate transaction fee
|
|
15
|
-
[**getTransactionApprovalDetail**](TransactionsApi.md#getTransactionApprovalDetail) | **GET** /transactions/{transaction_id}/approval_detail | Get transaction approval
|
|
15
|
+
[**getTransactionApprovalDetail**](TransactionsApi.md#getTransactionApprovalDetail) | **GET** /transactions/{transaction_id}/approval_detail | Get transaction approval details
|
|
16
16
|
[**getTransactionById**](TransactionsApi.md#getTransactionById) | **GET** /transactions/{transaction_id} | Get transaction information
|
|
17
17
|
[**listTransactions**](TransactionsApi.md#listTransactions) | **GET** /transactions | List all transactions
|
|
18
18
|
[**resendTransactionById**](TransactionsApi.md#resendTransactionById) | **POST** /transactions/{transaction_id}/resend | Resend transaction
|
|
19
|
+
[**signAndBroadcastTransactionById**](TransactionsApi.md#signAndBroadcastTransactionById) | **POST** /transactions/{transaction_id}/sign_and_broadcast | Sign and broadcast transaction
|
|
19
20
|
[**speedupTransactionById**](TransactionsApi.md#speedupTransactionById) | **POST** /transactions/{transaction_id}/speedup | Speed up transaction
|
|
20
21
|
|
|
21
22
|
|
|
@@ -64,7 +65,7 @@ Name | Type | Description | Notes
|
|
|
64
65
|
|
|
65
66
|
### Authorization
|
|
66
67
|
|
|
67
|
-
[
|
|
68
|
+
[OAuth2](../README.md#OAuth2)
|
|
68
69
|
|
|
69
70
|
### HTTP request headers
|
|
70
71
|
|
|
@@ -114,7 +115,7 @@ Name | Type | Description | Notes
|
|
|
114
115
|
|
|
115
116
|
### Authorization
|
|
116
117
|
|
|
117
|
-
[
|
|
118
|
+
[OAuth2](../README.md#OAuth2)
|
|
118
119
|
|
|
119
120
|
### HTTP request headers
|
|
120
121
|
|
|
@@ -168,7 +169,7 @@ Name | Type | Description | Notes
|
|
|
168
169
|
|
|
169
170
|
### Authorization
|
|
170
171
|
|
|
171
|
-
[
|
|
172
|
+
[OAuth2](../README.md#OAuth2)
|
|
172
173
|
|
|
173
174
|
### HTTP request headers
|
|
174
175
|
|
|
@@ -220,7 +221,7 @@ Name | Type | Description | Notes
|
|
|
220
221
|
|
|
221
222
|
### Authorization
|
|
222
223
|
|
|
223
|
-
[OAuth2](../README.md#OAuth2)
|
|
224
|
+
[OAuth2](../README.md#OAuth2)
|
|
224
225
|
|
|
225
226
|
### HTTP request headers
|
|
226
227
|
|
|
@@ -272,7 +273,7 @@ Name | Type | Description | Notes
|
|
|
272
273
|
|
|
273
274
|
### Authorization
|
|
274
275
|
|
|
275
|
-
[OAuth2](../README.md#OAuth2)
|
|
276
|
+
[OAuth2](../README.md#OAuth2)
|
|
276
277
|
|
|
277
278
|
### HTTP request headers
|
|
278
279
|
|
|
@@ -286,7 +287,7 @@ Name | Type | Description | Notes
|
|
|
286
287
|
|
|
287
288
|
Transfer token
|
|
288
289
|
|
|
289
|
-
The operation transfers your assets from a wallet created on Cobo Portal to another address. You need to specify details such as the sender address and recipient address, token ID, and the amount to transfer. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>If you make transfers from Custodial Wallets, do not set the fee-related properties
|
|
290
|
+
The operation transfers your assets from a wallet created on Cobo Portal to another address. You need to specify details such as the sender address and recipient address, token ID, and the amount to transfer. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>If you make transfers from Custodial Wallets (Asset Wallets) and Exchange Wallets, do not set the fee-related properties, as they will not take effects.</Note> <Note>You can transfer tokens to multiple addresses only if you use MPC Wallets as the transaction source. You should use the <code>utxo_outputs</code> property to specify the destination addresses.</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>
|
|
290
291
|
|
|
291
292
|
### Example
|
|
292
293
|
|
|
@@ -324,7 +325,7 @@ Name | Type | Description | Notes
|
|
|
324
325
|
|
|
325
326
|
### Authorization
|
|
326
327
|
|
|
327
|
-
[OAuth2](../README.md#OAuth2)
|
|
328
|
+
[OAuth2](../README.md#OAuth2)
|
|
328
329
|
|
|
329
330
|
### HTTP request headers
|
|
330
331
|
|
|
@@ -378,7 +379,7 @@ Name | Type | Description | Notes
|
|
|
378
379
|
|
|
379
380
|
### Authorization
|
|
380
381
|
|
|
381
|
-
[
|
|
382
|
+
[OAuth2](../README.md#OAuth2)
|
|
382
383
|
|
|
383
384
|
### HTTP request headers
|
|
384
385
|
|
|
@@ -430,7 +431,7 @@ Name | Type | Description | Notes
|
|
|
430
431
|
|
|
431
432
|
### Authorization
|
|
432
433
|
|
|
433
|
-
[
|
|
434
|
+
[OAuth2](../README.md#OAuth2)
|
|
434
435
|
|
|
435
436
|
### HTTP request headers
|
|
436
437
|
|
|
@@ -442,7 +443,7 @@ Name | Type | Description | Notes
|
|
|
442
443
|
|
|
443
444
|
> TransactionApprovalDetail getTransactionApprovalDetail(transaction_id)
|
|
444
445
|
|
|
445
|
-
Get transaction approval
|
|
446
|
+
Get transaction approval details
|
|
446
447
|
|
|
447
448
|
This operation retrieves approval detailed information about a specified transaction.
|
|
448
449
|
|
|
@@ -530,7 +531,7 @@ Name | Type | Description | Notes
|
|
|
530
531
|
|
|
531
532
|
### Authorization
|
|
532
533
|
|
|
533
|
-
[
|
|
534
|
+
[OAuth2](../README.md#OAuth2)
|
|
534
535
|
|
|
535
536
|
### HTTP request headers
|
|
536
537
|
|
|
@@ -614,7 +615,7 @@ Name | Type | Description | Notes
|
|
|
614
615
|
|
|
615
616
|
### Authorization
|
|
616
617
|
|
|
617
|
-
[
|
|
618
|
+
[OAuth2](../README.md#OAuth2)
|
|
618
619
|
|
|
619
620
|
### HTTP request headers
|
|
620
621
|
|
|
@@ -628,7 +629,7 @@ Name | Type | Description | Notes
|
|
|
628
629
|
|
|
629
630
|
Resend transaction
|
|
630
631
|
|
|
631
|
-
This operation resends a specified transaction. Resending a transaction means retrying a previously failed transaction. For more details about resending a transaction, see [Resend a transaction](/v2/guides/transactions/manage-transactions#resend-a-transaction). A transaction can be resent if its status is `failed`. <Note>This operation only applies to transactions from MPC Wallets in the SOL token.</Note>
|
|
632
|
+
This operation resends a specified transaction. Resending a transaction means retrying a previously failed transaction. For more details about resending a transaction, see [Resend a transaction](https://www.cobo.com/developers/v2/guides/transactions/manage-transactions#resend-a-transaction). A transaction can be resent if its status is `failed`. <Note>This operation only applies to transactions from MPC Wallets in the SOL token.</Note>
|
|
632
633
|
|
|
633
634
|
### Example
|
|
634
635
|
|
|
@@ -668,7 +669,7 @@ Name | Type | Description | Notes
|
|
|
668
669
|
|
|
669
670
|
### Authorization
|
|
670
671
|
|
|
671
|
-
[
|
|
672
|
+
[OAuth2](../README.md#OAuth2)
|
|
672
673
|
|
|
673
674
|
### HTTP request headers
|
|
674
675
|
|
|
@@ -676,13 +677,63 @@ Name | Type | Description | Notes
|
|
|
676
677
|
- **Accept**: application/json
|
|
677
678
|
|
|
678
679
|
|
|
680
|
+
## signAndBroadcastTransactionById
|
|
681
|
+
|
|
682
|
+
> CreateTransferTransaction201Response signAndBroadcastTransactionById(transaction_id)
|
|
683
|
+
|
|
684
|
+
Sign and broadcast transaction
|
|
685
|
+
|
|
686
|
+
This operation signs and broadcasts a specified transaction. To call this operation, the following conditions must be met: - The `transaction_process_type` of the transaction must be set to `BuildOnly` when you call the [Transfer token](https://www.cobo.com/developers/v2/api-references/transactions/transfer-token) or [Call smart contract](https://www.cobo.com/developers/v2/api-references/transactions/call-smart-contract) operation. - The transaction status must be `Built`.
|
|
687
|
+
|
|
688
|
+
### Example
|
|
689
|
+
|
|
690
|
+
```javascript
|
|
691
|
+
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
692
|
+
// Initialize the API client
|
|
693
|
+
const apiClient = CoboWaas2.ApiClient.instance
|
|
694
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
695
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
696
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
697
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
698
|
+
// Call the API
|
|
699
|
+
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
700
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
701
|
+
apiInstance.signAndBroadcastTransactionById(transaction_id).then((data) => {
|
|
702
|
+
console.log('API called successfully. Returned data: ' + data);
|
|
703
|
+
}, (error) => {
|
|
704
|
+
console.error(error);
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
### Parameters
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
Name | Type | Description | Notes
|
|
713
|
+
------------- | ------------- | ------------- | -------------
|
|
714
|
+
**transaction_id** | **String**| The transaction ID. |
|
|
715
|
+
|
|
716
|
+
### Return type
|
|
717
|
+
|
|
718
|
+
[**CreateTransferTransaction201Response**](CreateTransferTransaction201Response.md)
|
|
719
|
+
|
|
720
|
+
### Authorization
|
|
721
|
+
|
|
722
|
+
[CoboAuth](../README.md#CoboAuth)
|
|
723
|
+
|
|
724
|
+
### HTTP request headers
|
|
725
|
+
|
|
726
|
+
- **Content-Type**: Not defined
|
|
727
|
+
- **Accept**: application/json
|
|
728
|
+
|
|
729
|
+
|
|
679
730
|
## speedupTransactionById
|
|
680
731
|
|
|
681
732
|
> CreateTransferTransaction201Response speedupTransactionById(transaction_id, opts)
|
|
682
733
|
|
|
683
734
|
Speed up transaction
|
|
684
735
|
|
|
685
|
-
This operation accelerates a specified transaction. Speeding up a transaction will trigger a Replace-By-Fee (RBF) transaction which is a new version of the original transaction. For more details about speeding up a transaction, refer to [Speed up a transaction](/v2/guides/transactions/manage-transactions#speed-up-a-transaction). You can use the `address` or `included_utxos` properties in the request body to specify the address or UTXOs that will cover the transaction fee. Generally, the transaction fee is paid by the original transaction's source. If that source's balance is insufficient, the specified address or UTXOs can be used to cover the fee. A transaction can be sped up only if its status is `Broadcasting`. <Note>This operation only applies to transactions from MPC Wallets and Smart Contract Wallets. It does not apply to transactions on the following chains: VET, TRON, TVET, SOL, and TON.</Note> <Info>If you speed up a transaction from a Smart Contract Wallet, two RBF transactions will be triggered, one for the transaction from the Smart Contract Wallet, and the other for the transaction from the Delegate.</Info>
|
|
736
|
+
This operation accelerates a specified transaction. Speeding up a transaction will trigger a Replace-By-Fee (RBF) transaction which is a new version of the original transaction. For more details about speeding up a transaction, refer to [Speed up a transaction](https://www.cobo.com/developers/v2/guides/transactions/manage-transactions#speed-up-a-transaction). You can use the `address` or `included_utxos` properties in the request body to specify the address or UTXOs that will cover the transaction fee. Generally, the transaction fee is paid by the original transaction's source. If that source's balance is insufficient, the specified address or UTXOs can be used to cover the fee. A transaction can be sped up only if its status is `Broadcasting`. <Note>This operation only applies to transactions from MPC Wallets and Smart Contract Wallets. It does not apply to transactions on the following chains: VET, TRON, TVET, SOL, and TON.</Note> <Info>If you speed up a transaction from a Smart Contract Wallet, two RBF transactions will be triggered, one for the transaction from the Smart Contract Wallet, and the other for the transaction from the Delegate.</Info>
|
|
686
737
|
|
|
687
738
|
### Example
|
|
688
739
|
|
|
@@ -722,7 +773,7 @@ Name | Type | Description | Notes
|
|
|
722
773
|
|
|
723
774
|
### Authorization
|
|
724
775
|
|
|
725
|
-
[
|
|
776
|
+
[OAuth2](../README.md#OAuth2)
|
|
726
777
|
|
|
727
778
|
### HTTP request headers
|
|
728
779
|
|