@cobo/cobo-waas2 1.1.2 → 1.2.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 +16 -3
- package/dist/ApiClient.js +1 -1
- package/dist/api/OAuthApi.js +16 -15
- package/dist/api/TransactionsApi.js +18 -18
- package/dist/api/WalletsApi.js +123 -12
- package/dist/api/WalletsExchangeWalletApi.js +254 -0
- package/dist/api/WalletsMPCWalletsApi.js +8 -8
- package/dist/index.js +56 -0
- package/dist/model/AddressInfo.js +1 -1
- package/dist/model/AddressTransferDestination.js +3 -3
- package/dist/model/AddressTransferDestinationAccountOutput.js +2 -2
- package/dist/model/AddressTransferDestinationUtxoOutputsInner.js +1 -1
- package/dist/model/AssetInfo.js +2 -2
- package/dist/model/BabylonStakeExtra.js +9 -0
- package/dist/model/CheckAddressValidity200Response.js +2 -2
- package/dist/model/CheckAddressesValidity200ResponseInner.js +121 -0
- package/dist/model/CheckLoopTransfers200ResponseInner.js +96 -0
- package/dist/model/ContractCallDestination.js +1 -1
- package/dist/model/CreateStakeActivity.js +14 -1
- package/dist/model/CreateStakeActivityExtra.js +6 -0
- package/dist/model/CreateTssRequestRequest.js +13 -0
- package/dist/model/CreateUnstakeActivity.js +13 -0
- package/dist/model/CreateWithdrawActivity.js +13 -0
- package/dist/model/CreatedWalletInfo.js +12 -0
- package/dist/model/EstimateStakeFee.js +19 -1
- package/dist/model/EstimateUnstakeFee.js +18 -0
- package/dist/model/EstimateWithdrawFee.js +18 -0
- package/dist/model/EvmContractCallDestination.js +1 -1
- package/dist/model/ExchangeId.js +5 -0
- package/dist/model/ExchangeTransferDestination.js +16 -16
- package/dist/model/ExchangeTransferSource.js +14 -14
- package/dist/model/GetToken200Response.js +4 -4
- package/dist/model/KeyShareHolder.js +13 -0
- package/dist/model/ListAssetBalancesForExchangeWallet200Response.js +123 -0
- package/dist/model/ListExchanges200ResponseInner.js +122 -0
- package/dist/model/ListSupportedAssetsForExchange200Response.js +123 -0
- package/dist/model/MPCWalletInfo.js +26 -0
- package/dist/model/RefreshToken200Response.js +135 -0
- package/dist/model/RefreshTokenRequest.js +2 -2
- package/dist/model/SmartContractWalletType.js +2 -2
- package/dist/model/SubWalletAssetBalance.js +10 -10
- package/dist/model/TSSRequest.js +23 -1
- package/dist/model/TSSRequestWebhookEventData.js +263 -0
- package/dist/model/TransactionDepositFromWalletSource.js +6 -6
- package/dist/model/TransactionDepositToAddressDestination.js +2 -2
- package/dist/model/TransactionDepositToWalletDestination.js +9 -9
- package/dist/model/TransactionDestination.js +5 -5
- package/dist/model/TransactionEvmContractDestination.js +1 -1
- package/dist/model/TransactionExchangeWalletSource.js +6 -6
- package/dist/model/TransactionMPCWalletSource.js +13 -0
- package/dist/model/TransactionSource.js +8 -2
- package/dist/model/TransactionSubStatus.js +5 -0
- package/dist/model/TransactionTransferToAddressDestinationAccountOutput.js +1 -1
- package/dist/model/TransactionTransferToAddressDestinationUtxoOutputsInner.js +1 -1
- package/dist/model/TransactionTransferToWalletDestination.js +9 -9
- package/dist/model/TransactionWebhookEventData.js +8 -3
- package/dist/model/TransferDestination.js +6 -6
- package/dist/model/TransferParams.js +2 -2
- package/dist/model/TransferSource.js +3 -3
- package/dist/model/WalletInfo.js +12 -0
- package/dist/model/WebhookEventData.js +49 -15
- package/dist/model/WebhookEventDataType.js +7 -2
- package/dist/model/WebhookEventType.js +24 -4
- package/docs/AddressInfo.md +1 -1
- package/docs/AddressTransferDestination.md +2 -2
- package/docs/AddressTransferDestinationAccountOutput.md +1 -1
- package/docs/AddressTransferDestinationUtxoOutputsInner.md +1 -1
- package/docs/AssetInfo.md +1 -1
- package/docs/BabylonStakeExtra.md +1 -0
- package/docs/CheckAddressValidity200Response.md +1 -1
- package/docs/CheckAddressesValidity200ResponseInner.md +10 -0
- package/docs/CheckLoopTransfers200ResponseInner.md +10 -0
- package/docs/ContractCallDestination.md +1 -1
- package/docs/CreateStakeActivity.md +1 -0
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CreateTssRequestRequest.md +1 -0
- package/docs/CreateUnstakeActivity.md +1 -0
- package/docs/CreateWithdrawActivity.md +1 -0
- package/docs/CreatedWalletInfo.md +2 -0
- package/docs/DevelopersWebhooksApi.md +78 -69
- package/docs/EstimateStakeFee.md +1 -0
- package/docs/EstimateUnstakeFee.md +1 -0
- package/docs/EstimateWithdrawFee.md +1 -0
- package/docs/EvmContractCallDestination.md +1 -1
- package/docs/ExchangeId.md +2 -0
- package/docs/ExchangeTransferDestination.md +2 -2
- package/docs/ExchangeTransferSource.md +1 -1
- package/docs/GetToken200Response.md +4 -4
- package/docs/KeyShareHolder.md +1 -0
- package/docs/ListAssetBalancesForExchangeWallet200Response.md +10 -0
- package/docs/ListExchanges200ResponseInner.md +10 -0
- package/docs/ListSupportedAssetsForExchange200Response.md +10 -0
- package/docs/MPCWalletInfo.md +2 -0
- package/docs/OAuthApi.md +26 -24
- package/docs/RefreshToken200Response.md +13 -0
- package/docs/RefreshTokenRequest.md +2 -2
- package/docs/SmartContractWalletType.md +1 -1
- package/docs/SubWalletAssetBalance.md +2 -2
- package/docs/TSSRequest.md +2 -0
- package/docs/TSSRequestWebhookEventData.md +29 -0
- package/docs/TransactionDepositFromWalletSource.md +1 -1
- package/docs/TransactionDepositToAddressDestination.md +1 -1
- package/docs/TransactionDepositToWalletDestination.md +2 -2
- package/docs/TransactionDestination.md +3 -3
- package/docs/TransactionEvmContractDestination.md +1 -1
- package/docs/TransactionExchangeWalletSource.md +1 -1
- package/docs/TransactionMPCWalletSource.md +1 -0
- package/docs/TransactionSource.md +2 -1
- package/docs/TransactionSubStatus.md +2 -0
- package/docs/TransactionTransferToAddressDestinationAccountOutput.md +1 -1
- package/docs/TransactionTransferToAddressDestinationUtxoOutputsInner.md +1 -1
- package/docs/TransactionTransferToWalletDestination.md +2 -2
- package/docs/TransactionWebhookEventData.md +3 -1
- package/docs/TransactionsApi.md +98 -88
- package/docs/TransferDestination.md +4 -4
- package/docs/TransferParams.md +1 -1
- package/docs/TransferSource.md +1 -1
- package/docs/WalletInfo.md +2 -0
- package/docs/WalletsApi.md +316 -187
- package/docs/WalletsExchangeWalletApi.md +230 -0
- package/docs/WalletsMPCWalletsApi.md +153 -135
- package/docs/WebhookEventData.md +10 -5
- package/docs/WebhookEventDataType.md +3 -1
- package/docs/WebhookEventType.md +12 -4
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**destination_type** | [**TransactionDestinationType**](TransactionDestinationType.md) | |
|
|
8
8
|
**address** | **String** | The destination address. |
|
|
9
|
-
**value** | **String** | The
|
|
9
|
+
**value** | **String** | The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`. | [optional]
|
|
10
10
|
**calldata** | **Blob** | The data that is used to invoke a specific function or method within the specified contract at the destination address. |
|
|
11
11
|
|
|
12
12
|
|
|
@@ -7,6 +7,6 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**source_type** | [**TransactionSourceType**](TransactionSourceType.md) | |
|
|
8
8
|
**exchange_id** | [**ExchangeId**](ExchangeId.md) | |
|
|
9
9
|
**wallet_id** | **String** | The wallet ID. |
|
|
10
|
-
**
|
|
10
|
+
**trading_account_type** | **String** | The exchange trading account or a sub-wallet ID. | [optional]
|
|
11
11
|
|
|
12
12
|
|
|
@@ -9,5 +9,6 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**address** | **String** | The wallet address. | [optional]
|
|
10
10
|
**included_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
11
11
|
**excluded_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
12
|
+
**signer_key_share_holder_group_id** | **String** | The ID of the key share holder group that is selected to sign the transaction. | [optional]
|
|
12
13
|
|
|
13
14
|
|
|
@@ -9,9 +9,10 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**address** | **String** | The wallet address. |
|
|
10
10
|
**included_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
11
11
|
**excluded_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
12
|
+
**signer_key_share_holder_group_id** | **String** | The ID of the key share holder group that is selected to sign the transaction. | [optional]
|
|
12
13
|
**delegate** | [**CoboSafeDelegate**](CoboSafeDelegate.md) | |
|
|
13
14
|
**exchange_id** | [**ExchangeId**](ExchangeId.md) | |
|
|
14
|
-
**
|
|
15
|
+
**trading_account_type** | **String** | The exchange trading account or a sub-wallet ID. | [optional]
|
|
15
16
|
**wallet_type** | [**WalletType**](WalletType.md) | |
|
|
16
17
|
**wallet_subtype** | [**WalletSubtype**](WalletSubtype.md) | |
|
|
17
18
|
**addresses** | **[String]** | A list of addresses. |
|
|
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**address** | **String** | The destination address. | [optional]
|
|
8
8
|
**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]
|
|
9
|
-
**amount** | **String** | The
|
|
9
|
+
**amount** | **String** | The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`. | [optional]
|
|
10
10
|
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**address** | **String** | The destination address. | [optional]
|
|
8
|
-
**amount** | **String** | The
|
|
8
|
+
**amount** | **String** | The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`. | [optional]
|
|
9
9
|
**script** | **String** | The script of the output. It is a programmable code fragment that defines the conditions under which the UTXO can be spent. | [optional]
|
|
10
10
|
|
|
11
11
|
|
|
@@ -6,8 +6,8 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**destination_type** | [**TransactionDestinationType**](TransactionDestinationType.md) | |
|
|
8
8
|
**wallet_id** | **String** | The wallet ID. |
|
|
9
|
-
**
|
|
9
|
+
**trading_account_type** | **String** | The trading account type. | [optional]
|
|
10
10
|
**exchange_id** | [**ExchangeId**](ExchangeId.md) | | [optional]
|
|
11
|
-
**amount** | **String** | The
|
|
11
|
+
**amount** | **String** | The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`. |
|
|
12
12
|
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
|
-
**data_type** | **String** |
|
|
7
|
+
**data_type** | **String** | The data type of the event. - `Transaction`: The transaction event data. - `TSSRequest`: The TSS request event data. |
|
|
8
8
|
**transaction_id** | **String** | The transaction ID. |
|
|
9
9
|
**cobo_id** | **String** | The Cobo ID, which can be used to track a transaction. | [optional]
|
|
10
10
|
**request_id** | **String** | The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. | [optional]
|
|
@@ -41,6 +41,8 @@ Name | Type | Description | Notes
|
|
|
41
41
|
|
|
42
42
|
* `Transaction` (value: `"Transaction"`)
|
|
43
43
|
|
|
44
|
+
* `TSSRequest` (value: `"TSSRequest"`)
|
|
45
|
+
|
|
44
46
|
* `unknown_default_open_api` (value: `"unknown_default_open_api"`)
|
|
45
47
|
|
|
46
48
|
|
package/docs/TransactionsApi.md
CHANGED
|
@@ -23,20 +23,21 @@ Method | HTTP request | Description
|
|
|
23
23
|
|
|
24
24
|
Cancel transaction
|
|
25
25
|
|
|
26
|
-
This operation cancels a specified transaction. A transaction can be cancelled if its status is either of the following: - `Submitted` - `PendingScreening` - `PendingAuthorization` - `PendingSignature` A transaction request for tracking is returned upon successful operation. <Note>This operation only applies to transactions from MPC Wallets.</Note>
|
|
26
|
+
This operation cancels a specified transaction. A transaction can be cancelled if its status is either of the following: - `Submitted` - `PendingScreening` - `PendingAuthorization` - `PendingSignature` A transaction request for tracking is returned upon successful operation. <Note>This operation only applies to transactions from MPC Wallets and Smart Contract Wallets.</Note>
|
|
27
27
|
|
|
28
28
|
### Example
|
|
29
29
|
|
|
30
30
|
```javascript
|
|
31
31
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
32
|
-
//
|
|
32
|
+
// Initialize the API client
|
|
33
33
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
35
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
36
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
37
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
38
|
+
// Call the API
|
|
38
39
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
39
|
-
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
40
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
40
41
|
apiInstance.cancelTransactionById(transaction_id).then((data) => {
|
|
41
42
|
console.log('API called successfully. Returned data: ' + data);
|
|
42
43
|
}, (error) => {
|
|
@@ -72,21 +73,22 @@ Name | Type | Description | Notes
|
|
|
72
73
|
|
|
73
74
|
Call smart contract
|
|
74
75
|
|
|
75
|
-
This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to blockchains that have a similar architecture to Ethereum.</Note>
|
|
76
|
+
This operation creates a transaction to interact with a smart contract on the blockchain. You need to provide details such as the source address, destination address, and the calldata. You can specify the fee-related properties to limit the transaction fee. A transaction request for tracking is returned upon successful operation. <Note>Currently, this operation only applies to the transactions from MPC Wallets or Smart Contract Wallets on the blockchains that have a similar architecture to Ethereum.</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>
|
|
76
77
|
|
|
77
78
|
### Example
|
|
78
79
|
|
|
79
80
|
```javascript
|
|
80
81
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
81
|
-
//
|
|
82
|
+
// Initialize the API client
|
|
82
83
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
85
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
86
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
87
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
88
|
+
// Call the API
|
|
87
89
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
88
90
|
const opts = {
|
|
89
|
-
'ContractCallParams': new CoboWaas2.ContractCallParams()
|
|
91
|
+
'ContractCallParams': new CoboWaas2.ContractCallParams()
|
|
90
92
|
};
|
|
91
93
|
apiInstance.createContractCallTransaction(opts).then((data) => {
|
|
92
94
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -123,21 +125,22 @@ Name | Type | Description | Notes
|
|
|
123
125
|
|
|
124
126
|
Sign message
|
|
125
127
|
|
|
126
|
-
This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](/v2/api-references/transactions/get-transaction-information). <Note>
|
|
128
|
+
This operation creates a transaction to sign the provided message using cryptographic techniques. In some scenarios, you want to sign a message for identity authentication or transaction approval. You need to provide details such as the source address, destination address, and the message to be signed. A transaction request for tracking is returned upon successful operation. You can get the signature result by calling [Get transaction information](/v2/api-references/transactions/get-transaction-information). <Note>This operation only applies to transactions from MPC Wallets.</Note>
|
|
127
129
|
|
|
128
130
|
### Example
|
|
129
131
|
|
|
130
132
|
```javascript
|
|
131
133
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
132
|
-
//
|
|
134
|
+
// Initialize the API client
|
|
133
135
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
137
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
138
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
139
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
140
|
+
// Call the API
|
|
138
141
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
139
142
|
const opts = {
|
|
140
|
-
'MessageSignParams': new CoboWaas2.MessageSignParams()
|
|
143
|
+
'MessageSignParams': new CoboWaas2.MessageSignParams()
|
|
141
144
|
};
|
|
142
145
|
apiInstance.createMessageSignTransaction(opts).then((data) => {
|
|
143
146
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -174,21 +177,22 @@ Name | Type | Description | Notes
|
|
|
174
177
|
|
|
175
178
|
Transfer token
|
|
176
179
|
|
|
177
|
-
The operation transfers your assets from a wallet created on Cobo Protal 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>
|
|
180
|
+
The operation transfers your assets from a wallet created on Cobo Protal 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>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>
|
|
178
181
|
|
|
179
182
|
### Example
|
|
180
183
|
|
|
181
184
|
```javascript
|
|
182
185
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
183
|
-
//
|
|
186
|
+
// Initialize the API client
|
|
184
187
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
189
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
190
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
191
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
192
|
+
// Call the API
|
|
189
193
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
190
194
|
const opts = {
|
|
191
|
-
'TransferParams': new CoboWaas2.TransferParams()
|
|
195
|
+
'TransferParams': new CoboWaas2.TransferParams()
|
|
192
196
|
};
|
|
193
197
|
apiInstance.createTransferTransaction(opts).then((data) => {
|
|
194
198
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -225,22 +229,23 @@ Name | Type | Description | Notes
|
|
|
225
229
|
|
|
226
230
|
Drop transaction
|
|
227
231
|
|
|
228
|
-
This operation drops a specified transaction. Dropping a transaction will trigger an Replace-By-Fee (RBF) transaction which is a new version of the original transaction. It has a higher transaction fee to incentivize miners to prioritize its confirmation over the original one. A transaction can be dropped if its status is `Broadcasting`. <ul> <li>For EVM chains, this RBF transaction has a transfer amount of `0` and the sending address is the same as the receiving address.</li> <li>For UTXO chains, this RBF transaction has a transfer amount of `0` and the destination address is the same as the change address in the original transaction.</li> </ul>
|
|
232
|
+
This operation drops a specified transaction. Dropping a transaction will trigger an Replace-By-Fee (RBF) transaction which is a new version of the original transaction. It has a higher transaction fee to incentivize miners to prioritize its confirmation over the original one. A transaction can be dropped if its status is `Broadcasting`. <ul> <li>For EVM chains, this RBF transaction has a transfer amount of `0` and the sending address is the same as the receiving address.</li> <li>For UTXO chains, this RBF transaction has a transfer amount of `0` and the destination address is the same as the change address in the original transaction.</li> </ul> A transaction request for tracking is returned upon successful operation. <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 drop 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>
|
|
229
233
|
|
|
230
234
|
### Example
|
|
231
235
|
|
|
232
236
|
```javascript
|
|
233
237
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
234
|
-
//
|
|
238
|
+
// Initialize the API client
|
|
235
239
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
|
240
245
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
241
|
-
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
246
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
242
247
|
const opts = {
|
|
243
|
-
'TransactionRbf': new CoboWaas2.TransactionRbf()
|
|
248
|
+
'TransactionRbf': new CoboWaas2.TransactionRbf()
|
|
244
249
|
};
|
|
245
250
|
apiInstance.dropTransactionById(transaction_id, opts).then((data) => {
|
|
246
251
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -284,15 +289,16 @@ This operation estimates the transaction fee rates of a token transfer or a cont
|
|
|
284
289
|
|
|
285
290
|
```javascript
|
|
286
291
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
287
|
-
//
|
|
292
|
+
// Initialize the API client
|
|
288
293
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
295
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
296
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
297
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
298
|
+
// Call the API
|
|
293
299
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
294
300
|
const opts = {
|
|
295
|
-
'EstimateFeeParams': new CoboWaas2.EstimateFeeParams()
|
|
301
|
+
'EstimateFeeParams': new CoboWaas2.EstimateFeeParams()
|
|
296
302
|
};
|
|
297
303
|
apiInstance.estimateFee(opts).then((data) => {
|
|
298
304
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -335,14 +341,15 @@ This operation retrieves detailed information about a specified transaction, suc
|
|
|
335
341
|
|
|
336
342
|
```javascript
|
|
337
343
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
338
|
-
//
|
|
344
|
+
// Initialize the API client
|
|
339
345
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
340
|
-
//
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
346
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
347
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
348
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
349
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
350
|
+
// Call the API
|
|
344
351
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
345
|
-
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
352
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
346
353
|
apiInstance.getTransactionById(transaction_id).then((data) => {
|
|
347
354
|
console.log('API called successfully. Returned data: ' + data);
|
|
348
355
|
}, (error) => {
|
|
@@ -384,31 +391,32 @@ This operation retrieves all the transactions under your organization. You can
|
|
|
384
391
|
|
|
385
392
|
```javascript
|
|
386
393
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
387
|
-
//
|
|
394
|
+
// Initialize the API client
|
|
388
395
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
389
|
-
//
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
397
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
398
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
399
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
400
|
+
// Call the API
|
|
393
401
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
394
402
|
const opts = {
|
|
395
|
-
'request_id': "web_send_by_user_327_1610444045047",
|
|
396
|
-
'cobo_ids': "20231213122855000000000000000000,20231213122955000000000000000000",
|
|
397
|
-
'transaction_ids': "f47ac10b-58cc-4372-a567-0e02b2c3d479,557918d2-632a-4fe1-932f-315711f05fe3",
|
|
398
|
-
'transaction_hashes': "239861be9a4afe080c359b7fe4a1d035945ec46256b1a0f44d1267c71de8ec28",
|
|
399
|
-
'types': "Deposit,Withdrawal",
|
|
400
|
-
'statuses': "Completed,Failed",
|
|
401
|
-
'wallet_ids': "f47ac10b-58cc-4372-a567-0e02b2c3d479,1ddca562-8434-41c9-8809-d437bad9c868",
|
|
402
|
-
'chain_ids': "BTC,ETH",
|
|
403
|
-
'token_ids': "ETH_USDT,ETH_USDC",
|
|
404
|
-
'asset_ids': "USDT,USDC",
|
|
405
|
-
'vault_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
406
|
-
'project_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
407
|
-
'min_created_timestamp': 1635744000000,
|
|
408
|
-
'max_created_timestamp': 1635744000000,
|
|
409
|
-
'limit': 10,
|
|
410
|
-
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
411
|
-
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
403
|
+
'request_id': "web_send_by_user_327_1610444045047",
|
|
404
|
+
'cobo_ids': "20231213122855000000000000000000,20231213122955000000000000000000",
|
|
405
|
+
'transaction_ids': "f47ac10b-58cc-4372-a567-0e02b2c3d479,557918d2-632a-4fe1-932f-315711f05fe3",
|
|
406
|
+
'transaction_hashes': "239861be9a4afe080c359b7fe4a1d035945ec46256b1a0f44d1267c71de8ec28",
|
|
407
|
+
'types': "Deposit,Withdrawal",
|
|
408
|
+
'statuses': "Completed,Failed",
|
|
409
|
+
'wallet_ids': "f47ac10b-58cc-4372-a567-0e02b2c3d479,1ddca562-8434-41c9-8809-d437bad9c868",
|
|
410
|
+
'chain_ids': "BTC,ETH",
|
|
411
|
+
'token_ids': "ETH_USDT,ETH_USDC",
|
|
412
|
+
'asset_ids': "USDT,USDC",
|
|
413
|
+
'vault_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
414
|
+
'project_id': "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
415
|
+
'min_created_timestamp': 1635744000000,
|
|
416
|
+
'max_created_timestamp': 1635744000000,
|
|
417
|
+
'limit': 10,
|
|
418
|
+
'before': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1",
|
|
419
|
+
'after': "RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk"
|
|
412
420
|
};
|
|
413
421
|
apiInstance.listTransactions(opts).then((data) => {
|
|
414
422
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -428,12 +436,12 @@ Name | Type | Description | Notes
|
|
|
428
436
|
**transaction_ids** | **String**| A list of transaction IDs, separated by comma. | [optional]
|
|
429
437
|
**transaction_hashes** | **String**| A list of transaction hashes, separated by comma. | [optional]
|
|
430
438
|
**types** | **String**| A list of transaction types, separated by comma. Possible values include: - `Deposit`: A deposit transaction. - `Withdrawal`: A withdrawal transaction. - `ContractCall`: A transaction that interacts with a smart contract. - `MessageSign`: A transaction that signs a message. - `ExternalSafeTx`: A transaction to a Smart Contract Wallet (Safe{Wallet}) that requires one or multiple signatures to be executed. | [optional]
|
|
431
|
-
**statuses** | **String**| A list of transaction statuses, separated by comma. Possible values include: - `Submitted`: The transaction is submitted. - `PendingScreening`: The transaction is pending screening by Risk Control. - `PendingAuthorization`: The transaction is pending approvals. - `PendingSignature`: The transaction is pending signature. - `Broadcasting`: The transaction is being broadcast. - `Confirming`: The transaction is waiting for the required number of confirmations. - `Completed`: The transaction is completed. - `Failed`: The transaction failed. - `Rejected`: The transaction is rejected. - `Pending`: The transaction is
|
|
439
|
+
**statuses** | **String**| A list of transaction statuses, separated by comma. Possible values include: - `Submitted`: The transaction is submitted. - `PendingScreening`: The transaction is pending screening by Risk Control. - `PendingAuthorization`: The transaction is pending approvals. - `PendingSignature`: The transaction is pending signature. - `Broadcasting`: The transaction is being broadcast. - `Confirming`: The transaction is waiting for the required number of confirmations. - `Completed`: The transaction is completed. - `Failed`: The transaction failed. - `Rejected`: The transaction is rejected. - `Pending`: The transaction is waiting to be included in the next block of the blockchain. | [optional]
|
|
432
440
|
**wallet_ids** | **String**| A list of wallet IDs, separated by comma. | [optional]
|
|
433
441
|
**chain_ids** | **String**| A list of chain IDs, separated by comma. The chain ID is the unique identifier of a blockchain. You can retrieve the IDs of all the chains you can use by calling [List enabled chains](/v2/api-references/wallets/list-enabled-chains). | [optional]
|
|
434
442
|
**token_ids** | **String**| A list of token IDs, separated by comma. The token ID is the unique identifier of a token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). | [optional]
|
|
435
443
|
**asset_ids** | **String**| (This concept applies to Exchange Wallets only) A list of asset IDs, separated by comma. An asset ID is the unique identifier of the asset held within your linked exchange account. | [optional]
|
|
436
|
-
**vault_id** | **String**|
|
|
444
|
+
**vault_id** | **String**| The vault ID, which you can retrieve by calling [List all vaults](/v2/api-references/wallets--mpc-wallets/list-all-vaults). | [optional]
|
|
437
445
|
**project_id** | **String**| The project ID, which you can retrieve by calling [List all projects](/v2/api-references/wallets--mpc-wallets/list-all-projects). | [optional]
|
|
438
446
|
**min_created_timestamp** | **Number**| The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. | [optional]
|
|
439
447
|
**max_created_timestamp** | **Number**| The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. | [optional]
|
|
@@ -461,22 +469,23 @@ Name | Type | Description | Notes
|
|
|
461
469
|
|
|
462
470
|
Resend transaction
|
|
463
471
|
|
|
464
|
-
This operation resends a specified transaction. Resending a transaction initiates a new attempt to process the transaction that failed previously. A transaction can be resent if its status is `failed`. A transaction request for tracking is returned upon successful operation. <Note>This operation only applies to transactions in the SOL token
|
|
472
|
+
This operation resends a specified transaction. Resending a transaction initiates a new attempt to process the transaction that failed previously. A transaction can be resent if its status is `failed`. A transaction request for tracking is returned upon successful operation. <Note>This operation only applies to transactions from MPC Wallets in the SOL token.</Note>
|
|
465
473
|
|
|
466
474
|
### Example
|
|
467
475
|
|
|
468
476
|
```javascript
|
|
469
477
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
470
|
-
//
|
|
478
|
+
// Initialize the API client
|
|
471
479
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
472
|
-
//
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
480
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
481
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
482
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
483
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
484
|
+
// Call the API
|
|
476
485
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
477
|
-
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
486
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
478
487
|
const opts = {
|
|
479
|
-
'TransactionResend': new CoboWaas2.TransactionResend()
|
|
488
|
+
'TransactionResend': new CoboWaas2.TransactionResend()
|
|
480
489
|
};
|
|
481
490
|
apiInstance.resendTransactionById(transaction_id, opts).then((data) => {
|
|
482
491
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -514,22 +523,23 @@ Name | Type | Description | Notes
|
|
|
514
523
|
|
|
515
524
|
Speed up transaction
|
|
516
525
|
|
|
517
|
-
This operation accelerates a specified transaction. Speeding up a transaction will trigger an Replace-By-Fee (RBF) transaction which is a new version of the original transaction. It shares the same inputs but has a higher transaction fee to incentivize miners to prioritize its confirmation over the previous one. A transaction can be accelerated if its status is `Broadcasting`. A transaction request for tracking is returned upon successful operation.
|
|
526
|
+
This operation accelerates a specified transaction. Speeding up a transaction will trigger an Replace-By-Fee (RBF) transaction which is a new version of the original transaction. It shares the same inputs but has a higher transaction fee to incentivize miners to prioritize its confirmation over the previous one. A transaction can be accelerated if its status is `Broadcasting`. A transaction request for tracking is returned upon successful operation. <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>
|
|
518
527
|
|
|
519
528
|
### Example
|
|
520
529
|
|
|
521
530
|
```javascript
|
|
522
531
|
const CoboWaas2 = require('@cobo/cobo-waas2');
|
|
523
|
-
//
|
|
532
|
+
// Initialize the API client
|
|
524
533
|
const apiClient = CoboWaas2.ApiClient.instance
|
|
525
|
-
//
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
534
|
+
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
|
|
535
|
+
apiClient.setEnv(CoboWaas2.Env.DEV);
|
|
536
|
+
// Replace `<YOUR_PRIVATE_KEY>` with your private key
|
|
537
|
+
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
|
|
538
|
+
// Call the API
|
|
529
539
|
const apiInstance = new CoboWaas2.TransactionsApi();
|
|
530
|
-
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
540
|
+
const transaction_id = "f47ac10b-58cc-4372-a567-0e02b2c3d479";
|
|
531
541
|
const opts = {
|
|
532
|
-
'TransactionRbf': new CoboWaas2.TransactionRbf()
|
|
542
|
+
'TransactionRbf': new CoboWaas2.TransactionRbf()
|
|
533
543
|
};
|
|
534
544
|
apiInstance.speedupTransactionById(transaction_id, opts).then((data) => {
|
|
535
545
|
console.log('API called successfully. Returned data: ' + data);
|
|
@@ -8,10 +8,10 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**account_output** | [**AddressTransferDestinationAccountOutput**](AddressTransferDestinationAccountOutput.md) | | [optional]
|
|
9
9
|
**utxo_outputs** | [**[AddressTransferDestinationUtxoOutputsInner]**](AddressTransferDestinationUtxoOutputsInner.md) | | [optional]
|
|
10
10
|
**change_address** | **String** | The address used to receive the remaining funds or change from the transaction. | [optional]
|
|
11
|
-
**force_internal** | **Boolean** | Whether the transaction request must be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must be executed as a Loop transfer. - `false`: The transaction request may not be executed as a Loop transfer. | [optional]
|
|
12
|
-
**force_external** | **Boolean** | Whether the transaction request must not be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must not be executed as a Loop transfer. - `false`: The transaction request can be executed as a Loop transfer. | [optional]
|
|
11
|
+
**force_internal** | **Boolean** | Whether the transaction request must be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must be executed as a Loop transfer. - `false`: The transaction request may not be executed as a Loop transfer. <Note>Please do not set both `force_internal` and `force_internal` as `true`.</Note> | [optional]
|
|
12
|
+
**force_external** | **Boolean** | Whether the transaction request must not be executed as a Loop transfer. For more information about Loop, see [Loop's website](https://loop.top/). - `true`: The transaction request must not be executed as a Loop transfer. - `false`: The transaction request can be executed as a Loop transfer. <Note>Please do not set both `force_internal` and `force_internal` as `true`.</Note> | [optional]
|
|
13
13
|
**wallet_id** | **String** | The wallet ID. |
|
|
14
|
-
**
|
|
15
|
-
**amount** | **String** | The
|
|
14
|
+
**trading_account_type** | **String** | The trading account type. |
|
|
15
|
+
**amount** | **String** | The transfer amount. For example, if you trade 1.5 ETH, then the value is `1.5`. |
|
|
16
16
|
|
|
17
17
|
|
package/docs/TransferParams.md
CHANGED
|
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**request_id** | **String** | The request ID that is used to track a transaction request. The request ID is provided by you and must be unique within your organization. |
|
|
8
8
|
**source** | [**TransferSource**](TransferSource.md) | |
|
|
9
|
-
**token_id** | **String** | The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). |
|
|
9
|
+
**token_id** | **String** | The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](/v2/api-references/wallets/list-enabled-tokens). For transfers from Exchange Wallets, this property value represents the asset ID. |
|
|
10
10
|
**destination** | [**TransferDestination**](TransferDestination.md) | |
|
|
11
11
|
**category_names** | **[String]** | The custom category for you to identify your transactions. | [optional]
|
|
12
12
|
**description** | **String** | The description of the transfer. | [optional]
|
package/docs/TransferSource.md
CHANGED
|
@@ -10,6 +10,6 @@ Name | Type | Description | Notes
|
|
|
10
10
|
**included_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
11
11
|
**excluded_utxos** | [**[TransactionUtxo]**](TransactionUtxo.md) | | [optional]
|
|
12
12
|
**delegate** | [**CoboSafeDelegate**](CoboSafeDelegate.md) | |
|
|
13
|
-
**
|
|
13
|
+
**trading_account_type** | **String** | The trading account type. |
|
|
14
14
|
|
|
15
15
|
|
package/docs/WalletInfo.md
CHANGED
|
@@ -10,7 +10,9 @@ Name | Type | Description | Notes
|
|
|
10
10
|
**name** | **String** | The wallet name. |
|
|
11
11
|
**org_id** | **String** | The ID of the owning organization. |
|
|
12
12
|
**project_id** | **String** | The project ID. | [optional]
|
|
13
|
+
**project_name** | **String** | The project name. | [optional]
|
|
13
14
|
**vault_id** | **String** | The ID of the owning vault. |
|
|
15
|
+
**vault_name** | **String** | The vault name. | [optional]
|
|
14
16
|
**apikey** | **String** | The API key of your exchange account. |
|
|
15
17
|
**exchange_id** | [**ExchangeId**](ExchangeId.md) | |
|
|
16
18
|
**main_wallet_id** | **String** | The wallet ID of the Main Account associated with the Sub Account. This property is returned only if you are creating or querying an Exchange Wallet (Sub Account). | [optional]
|