@coinbase-sample/prime-sdk-ts 0.7.1 → 0.8.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/dist/financing/index.js +18 -0
- package/dist/futures/index.js +20 -0
- package/dist/model/DateOfBirth.js +21 -0
- package/dist/model/DetailedAddress.js +21 -0
- package/dist/model/GetFcmSettingsResponse.js +21 -0
- package/dist/model/GetUnstakingStatusResponse.js +21 -0
- package/dist/model/ListFinancingEligibleAssetsResponse.js +21 -0
- package/dist/model/ListTFObligationsResponse.js +21 -0
- package/dist/model/NaturalPersonName.js +21 -0
- package/dist/model/PreviewUnstakeRequest.js +21 -0
- package/dist/model/PreviewUnstakeResponse.js +21 -0
- package/dist/model/ProcessRequirements.js +21 -0
- package/dist/model/RewardMetadata.js +21 -0
- package/dist/model/SetFcmSettingsRequest.js +21 -0
- package/dist/model/SetFcmSettingsResponse.js +21 -0
- package/dist/model/TFAsset.js +21 -0
- package/dist/model/TFObligation.js +21 -0
- package/dist/model/TravelRuleEntry.js +21 -0
- package/dist/model/TravelRuleParty.js +21 -0
- package/dist/model/TravelRuleWalletDetails.js +21 -0
- package/dist/model/UnstakingStatus.js +21 -0
- package/dist/model/VASP.js +21 -0
- package/dist/model/ValidatorUnstakingInfo.js +21 -0
- package/dist/model/enums/CandlesGranularity.js +3 -3
- package/dist/model/enums/EstimateType.js +28 -0
- package/dist/model/enums/OrderType.js +2 -1
- package/dist/model/enums/PegOffsetType.js +31 -0
- package/dist/model/enums/RewardSubtype.js +34 -0
- package/dist/model/enums/TransactionType.js +3 -1
- package/dist/model/enums/TravelRuleStatus.js +28 -0
- package/dist/model/enums/TravelRuleWalletType.js +31 -0
- package/dist/model/enums/UnstakeType.js +28 -0
- package/dist/model/enums/UserRole.js +2 -1
- package/dist/model/enums/XMCallType.js +2 -1
- package/dist/model/enums/XMEntityCallStatus.js +2 -1
- package/dist/model/enums/index.js +14 -2
- package/dist/shared/__tests__/validation.test.js +210 -0
- package/dist/shared/validation.js +380 -0
- package/dist/staking/index.js +22 -0
- package/dist/types/activities/types.d.ts +1 -0
- package/dist/types/financing/index.d.ts +5 -1
- package/dist/types/financing/types.d.ts +7 -1
- package/dist/types/futures/index.d.ts +6 -2
- package/dist/types/futures/types.d.ts +10 -1
- package/dist/types/model/CreateOrderRequest.d.ts +8 -1
- package/dist/types/model/CreatePortfolioAddressBookEntryRequest.d.ts +6 -0
- package/dist/types/model/DateOfBirth.d.ts +24 -0
- package/dist/types/model/DetailedAddress.d.ts +28 -0
- package/dist/types/model/GetFcmSettingsResponse.d.ts +25 -0
- package/dist/types/model/GetUnstakingStatusResponse.d.ts +42 -0
- package/dist/types/model/ListFinancingEligibleAssetsResponse.d.ts +26 -0
- package/dist/types/model/ListTFObligationsResponse.d.ts +26 -0
- package/dist/types/model/NaturalPersonName.d.ts +24 -0
- package/dist/types/model/NetworkDetails.d.ts +4 -0
- package/dist/types/model/Order.d.ts +12 -0
- package/dist/types/model/OrderPreviewRequest.d.ts +7 -0
- package/dist/types/model/PreviewUnstakeRequest.d.ts +28 -0
- package/dist/types/model/PreviewUnstakeResponse.d.ts +28 -0
- package/dist/types/model/ProcessRequirements.d.ts +23 -0
- package/dist/types/model/RewardMetadata.d.ts +23 -0
- package/dist/types/model/SetFcmSettingsRequest.d.ts +25 -0
- package/dist/types/model/SetFcmSettingsResponse.d.ts +25 -0
- package/dist/types/model/TFAsset.d.ts +33 -0
- package/dist/types/model/TFObligation.d.ts +41 -0
- package/dist/types/model/Transaction.d.ts +2 -0
- package/dist/types/model/TransactionMetadata.d.ts +2 -0
- package/dist/types/model/TravelRuleEntry.d.ts +38 -0
- package/dist/types/model/TravelRuleParty.d.ts +32 -0
- package/dist/types/model/TravelRuleWalletDetails.d.ts +28 -0
- package/dist/types/model/UnstakingStatus.d.ts +45 -0
- package/dist/types/model/VASP.d.ts +27 -0
- package/dist/types/model/ValidatorUnstakingInfo.d.ts +30 -0
- package/dist/types/model/enums/CandlesGranularity.d.ts +3 -3
- package/dist/types/model/enums/EstimateType.d.ts +24 -0
- package/dist/types/model/enums/OrderType.d.ts +3 -2
- package/dist/types/model/enums/PegOffsetType.d.ts +27 -0
- package/dist/types/model/enums/RewardSubtype.d.ts +30 -0
- package/dist/types/model/enums/TransactionType.d.ts +4 -2
- package/dist/types/model/enums/TravelRuleStatus.d.ts +24 -0
- package/dist/types/model/enums/TravelRuleWalletType.d.ts +27 -0
- package/dist/types/model/enums/UnstakeType.d.ts +24 -0
- package/dist/types/model/enums/UserRole.d.ts +3 -2
- package/dist/types/model/enums/XMCallType.d.ts +3 -2
- package/dist/types/model/enums/XMEntityCallStatus.d.ts +3 -2
- package/dist/types/model/enums/index.d.ts +6 -0
- package/dist/types/model/index.d.ts +21 -0
- package/dist/types/shared/__tests__/validation.test.d.ts +1 -0
- package/dist/types/shared/validation.d.ts +176 -0
- package/dist/types/staking/index.d.ts +5 -1
- package/dist/types/staking/types.d.ts +12 -1
- package/dist/types/transactions/types.d.ts +3 -1
- package/dist/types/wallets/types.d.ts +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum EstimateType {
|
|
21
|
+
Unspecified = "UNSPECIFIED",
|
|
22
|
+
Live = "LIVE",
|
|
23
|
+
Interim = "INTERIM"
|
|
24
|
+
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Do not edit the class manually.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* - UNKNOWN_ORDER_TYPE: nil value - MARKET: A [market order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order) - LIMIT: A [limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order) - TWAP: A [time-weighted average price order](https://en.wikipedia.org/wiki/Time-weighted_average_price) - BLOCK: A [block trade](https://en.wikipedia.org/wiki/Block_trade) - VWAP: A [volume-weighted average price order](https://en.wikipedia.org/wiki/Volume-weighted_average_price) - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote)
|
|
21
|
+
* - UNKNOWN_ORDER_TYPE: nil value - MARKET: A [market order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order) - LIMIT: A [limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order) - TWAP: A [time-weighted average price order](https://en.wikipedia.org/wiki/Time-weighted_average_price) - BLOCK: A [block trade](https://en.wikipedia.org/wiki/Block_trade) - VWAP: A [volume-weighted average price order](https://en.wikipedia.org/wiki/Volume-weighted_average_price) - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote) - PEG: A pegged order that dynamically adjust based on market conditions while maintaining execution discretion and avoiding adverse selection
|
|
22
22
|
*/
|
|
23
23
|
export declare enum OrderType {
|
|
24
24
|
Market = "MARKET",
|
|
@@ -27,5 +27,6 @@ export declare enum OrderType {
|
|
|
27
27
|
Block = "BLOCK",
|
|
28
28
|
Vwap = "VWAP",
|
|
29
29
|
StopLimit = "STOP_LIMIT",
|
|
30
|
-
Rfq = "RFQ"
|
|
30
|
+
Rfq = "RFQ",
|
|
31
|
+
Peg = "PEG"
|
|
31
32
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* - UNKNOWN_PEG_OFFSET_TYPE: nil value - PEG_OFFSET_TYPE_PRICE: Offset specified in price units - PEG_OFFSET_TYPE_BPS: Offset specified in basis points (BPS) - PEG_OFFSET_TYPE_DEPTH: Offset specified in depth
|
|
22
|
+
*/
|
|
23
|
+
export declare enum PegOffsetType {
|
|
24
|
+
PegOffsetTypePrice = "PEG_OFFSET_TYPE_PRICE",
|
|
25
|
+
PegOffsetTypeBps = "PEG_OFFSET_TYPE_BPS",
|
|
26
|
+
PegOffsetTypeDepth = "PEG_OFFSET_TYPE_DEPTH"
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* - REWARD_SUBTYPE_UNKNOWN: An unknown reward subtype, reward subtype may not be supported in the API response yet - MEV_REWARD: A maximal extractable value reward i.e. sol mev rewards - INFLATION_REWARD: An inflationary reward i.e. solana inflationary rewards - BLOCK_REWARD: A block reward i.e. solana block rewards - VALIDATOR_REWARD: A validator reward i.e. ethereum validator (consensus layer) rewards - TRANSACTION_REWARD: A transaction reward i.e. ethereum transaction (execution layer) rewards - STAKING_FEE_REBATE_REWARD: A staking fee rebate reward i.e. coinbase pays rebates for staking fees to eligible delegators
|
|
22
|
+
*/
|
|
23
|
+
export declare enum RewardSubtype {
|
|
24
|
+
MevReward = "MEV_REWARD",
|
|
25
|
+
InflationReward = "INFLATION_REWARD",
|
|
26
|
+
BlockReward = "BLOCK_REWARD",
|
|
27
|
+
ValidatorReward = "VALIDATOR_REWARD",
|
|
28
|
+
TransactionReward = "TRANSACTION_REWARD",
|
|
29
|
+
StakingFeeRebateReward = "STAKING_FEE_REBATE_REWARD"
|
|
30
|
+
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Do not edit the class manually.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* - TRANSACTION_TYPE_UNKNOWN: An unknown transaction type - DEPOSIT: A fiat or crypto deposit - WITHDRAWAL: A fiat or crypto withdrawal - INTERNAL_DEPOSIT: An internal fiat or crypto deposit - INTERNAL_WITHDRAWAL: An internal fiat or crypto withdrawal - SWEEP_DEPOSIT: Internal automated deposit to a cold address from a restored address - SWEEP_WITHDRAWAL: Internal automated withdrawal from a restored address to a cold address - PROXY_DEPOSIT: On-chain deposit of funds into proxy contract from cold address - PROXY_WITHDRAWAL: On-chain withdrawal of funds from proxy contract to cold address - BILLING_WITHDRAWAL: Coinbase Prime automated invoice settlement payment - REWARD: Reward payment to an associated address for a staked asset - COINBASE_REFUND: Coinbase Prime refund for the leftover amount for a CPFP (child pays for parent) transaction - TRANSACTION_TYPE_OTHER: An OTHER type of transaction - WITHDRAWAL_ADJUSTMENT: A manual adjustment withdrawal transaction - DEPOSIT_ADJUSTMENT: A manual adjustment deposit transaction - KEY_REGISTRATION: An on-chain registration for an address - DELEGATION: An on-chain delegation transaction - UNDELEGATION: An on-chain undelegation transaction - RESTAKE: On-chain restaking transaction - COMPLETE_UNBONDING: On-chain unbonding event transaction - WITHDRAW_UNBONDED: On-chain event indicating unbonding period is over - STAKE_ACCOUNT_CREATE: On-chain transaction to begin staking from an address - CHANGE_VALIDATOR: On-chain transaction alter validator - STAKE: On-chain transaction to begin staking in Cryptocurrency network - UNSTAKE: On-chain transaction to stop staking in Cryptocurrency network - REMOVE_AUTHORIZED_PARTY: On-chain transaction to remove a party from a multi-signature wallet - STAKE_AUTHORIZE_WITH_SEED: On-chain transaction to begin staking from a seed account - SLASH: On-chain transaction indicating a slash event has occurred - COINBASE_DEPOSIT: On-chain transaction deposit for the purpose of transaction operations - CONVERSION: Internal conversion between two assets - CLAIM_REWARDS: On-chain transaction to claim rewards from Vote Account - VOTE_AUTHORIZE: On-chain transaction to transfer the reward claiming permission to other pubkey - WEB3_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet Deprecated: Use ONCHAIN_TRANSACTION instead - ONCHAIN_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet
|
|
21
|
+
* - TRANSACTION_TYPE_UNKNOWN: An unknown transaction type - DEPOSIT: A fiat or crypto deposit - WITHDRAWAL: A fiat or crypto withdrawal - INTERNAL_DEPOSIT: An internal fiat or crypto deposit - INTERNAL_WITHDRAWAL: An internal fiat or crypto withdrawal - SWEEP_DEPOSIT: Internal automated deposit to a cold address from a restored address - SWEEP_WITHDRAWAL: Internal automated withdrawal from a restored address to a cold address - PROXY_DEPOSIT: On-chain deposit of funds into proxy contract from cold address - PROXY_WITHDRAWAL: On-chain withdrawal of funds from proxy contract to cold address - BILLING_WITHDRAWAL: Coinbase Prime automated invoice settlement payment - REWARD: Reward payment to an associated address for a staked asset - COINBASE_REFUND: Coinbase Prime refund for the leftover amount for a CPFP (child pays for parent) transaction - TRANSACTION_TYPE_OTHER: An OTHER type of transaction - WITHDRAWAL_ADJUSTMENT: A manual adjustment withdrawal transaction - DEPOSIT_ADJUSTMENT: A manual adjustment deposit transaction - KEY_REGISTRATION: An on-chain registration for an address - DELEGATION: An on-chain delegation transaction - UNDELEGATION: An on-chain undelegation transaction - RESTAKE: On-chain restaking transaction - COMPLETE_UNBONDING: On-chain unbonding event transaction - WITHDRAW_UNBONDED: On-chain event indicating unbonding period is over - STAKE_ACCOUNT_CREATE: On-chain transaction to begin staking from an address - CHANGE_VALIDATOR: On-chain transaction alter validator - STAKE: On-chain transaction to begin staking in Cryptocurrency network - UNSTAKE: On-chain transaction to stop staking in Cryptocurrency network - REMOVE_AUTHORIZED_PARTY: On-chain transaction to remove a party from a multi-signature wallet - STAKE_AUTHORIZE_WITH_SEED: On-chain transaction to begin staking from a seed account - SLASH: On-chain transaction indicating a slash event has occurred - COINBASE_DEPOSIT: On-chain transaction deposit for the purpose of transaction operations - CONVERSION: Internal conversion between two assets - CLAIM_REWARDS: On-chain transaction to claim rewards from Vote Account - VOTE_AUTHORIZE: On-chain transaction to transfer the reward claiming permission to other pubkey - WEB3_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet Deprecated: Use ONCHAIN_TRANSACTION instead - ONCHAIN_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet - PORTFOLIO_STAKE: Portfolio-level staking operation - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation
|
|
22
22
|
*/
|
|
23
23
|
export declare enum TransactionType {
|
|
24
24
|
Deposit = "DEPOSIT",
|
|
@@ -53,5 +53,7 @@ export declare enum TransactionType {
|
|
|
53
53
|
ClaimRewards = "CLAIM_REWARDS",
|
|
54
54
|
VoteAuthorize = "VOTE_AUTHORIZE",
|
|
55
55
|
Web3Transaction = "WEB3_TRANSACTION",
|
|
56
|
-
OnchainTransaction = "ONCHAIN_TRANSACTION"
|
|
56
|
+
OnchainTransaction = "ONCHAIN_TRANSACTION",
|
|
57
|
+
PortfolioStake = "PORTFOLIO_STAKE",
|
|
58
|
+
PortfolioUnstake = "PORTFOLIO_UNSTAKE"
|
|
57
59
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum TravelRuleStatus {
|
|
21
|
+
TravelRuleStatusUnspecified = "TRAVEL_RULE_STATUS_UNSPECIFIED",
|
|
22
|
+
TravelRuleStatusPending = "TRAVEL_RULE_STATUS_PENDING",
|
|
23
|
+
TravelRuleStatusSubmitted = "TRAVEL_RULE_STATUS_SUBMITTED"
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* - TRAVEL_RULE_WALLET_TYPE_UNSPECIFIED: Default unspecified wallet type - TRAVEL_RULE_WALLET_TYPE_VASP: Centralized exchange wallet - TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED: Self-hosted/custodial wallet
|
|
22
|
+
*/
|
|
23
|
+
export declare enum TravelRuleWalletType {
|
|
24
|
+
TravelRuleWalletTypeUnspecified = "TRAVEL_RULE_WALLET_TYPE_UNSPECIFIED",
|
|
25
|
+
TravelRuleWalletTypeVasp = "TRAVEL_RULE_WALLET_TYPE_VASP",
|
|
26
|
+
TravelRuleWalletTypeSelfCustodied = "TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED"
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum UnstakeType {
|
|
21
|
+
UnstakeTypeUnspecified = "UNSTAKE_TYPE_UNSPECIFIED",
|
|
22
|
+
UnstakeTypePartial = "UNSTAKE_TYPE_PARTIAL",
|
|
23
|
+
UnstakeTypeFull = "UNSTAKE_TYPE_FULL"
|
|
24
|
+
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Do not edit the class manually.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* - USER_ROLE_UNKNOWN: nil value - AUDITOR: An auditor - SIGNATORY: A signatory - ADMIN: An admin - INITIATOR: An initiator - REVIEWER: A reviewer - TRADER: A trader - FULL_TRADER: A trader with full permissions - TEAM_MANAGER: A team manager - APPROVER: An approver
|
|
21
|
+
* - USER_ROLE_UNKNOWN: nil value - AUDITOR: An auditor - SIGNATORY: A signatory - ADMIN: An admin - INITIATOR: An initiator - REVIEWER: A reviewer - TRADER: A trader - FULL_TRADER: A trader with full permissions - TEAM_MANAGER: A team manager - APPROVER: An approver - TAX_MANAGER: A tax manager
|
|
22
22
|
*/
|
|
23
23
|
export declare enum UserRole {
|
|
24
24
|
Auditor = "AUDITOR",
|
|
@@ -29,5 +29,6 @@ export declare enum UserRole {
|
|
|
29
29
|
Trader = "TRADER",
|
|
30
30
|
FullTrader = "FULL_TRADER",
|
|
31
31
|
TeamManager = "TEAM_MANAGER",
|
|
32
|
-
Approver = "APPROVER"
|
|
32
|
+
Approver = "APPROVER",
|
|
33
|
+
TaxManager = "TAX_MANAGER"
|
|
33
34
|
}
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
* Do not edit the class manually.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* - CALL_TYPE_STANDARD: Evaluated at standard margin call evaluation time - CALL_TYPE_URGENT: Evaluated in realtime
|
|
21
|
+
* - CALL_TYPE_STANDARD: Evaluated at standard margin call evaluation time - CALL_TYPE_URGENT: Evaluated in realtime - CALL_TYPE_DEBIT: Evaluated at debit call evaluation time
|
|
22
22
|
*/
|
|
23
23
|
export declare enum XMCallType {
|
|
24
24
|
XmCallTypeUnspecified = "XM_CALL_TYPE_UNSPECIFIED",
|
|
25
25
|
CallTypeStandard = "CALL_TYPE_STANDARD",
|
|
26
|
-
CallTypeUrgent = "CALL_TYPE_URGENT"
|
|
26
|
+
CallTypeUrgent = "CALL_TYPE_URGENT",
|
|
27
|
+
CallTypeDebit = "CALL_TYPE_DEBIT"
|
|
27
28
|
}
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
* Do not edit the class manually.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
|
-
* - ENTITY_NO_CALL: There are no margin calls - ENTITY_OPEN_STANDARD_CALL: There is a standard margin call. There
|
|
21
|
+
* XMEntityCallStatus summarizes the state of open margin calls or debit calls. When multiple calls exist, the status reflects the highest priority call type. Priority order (highest to lowest): aged > urgent > standard > debit. - ENTITY_NO_CALL: There are no margin calls or debit calls. - ENTITY_OPEN_STANDARD_CALL: There is a standard margin call. There may also be debit calls, but there are no urgent margin calls or expired calls.. - ENTITY_OPEN_URGENT_CALL: There is an urgent margin call. There may also be standard margin calls or debit calls, but there are no expired calls. - ENTITY_AGED_CALL: At least one open margin call (standard or urgent) or debit call is aged. This will trigger the SESSION_LOCKED control status. - ENTITY_OPEN_DEBIT_CALL: There is a debit call. There are no standard margin calls, urgent margin calls, or expired calls.
|
|
22
22
|
*/
|
|
23
23
|
export declare enum XMEntityCallStatus {
|
|
24
24
|
XmEntityCallStatusUnspecified = "XM_ENTITY_CALL_STATUS_UNSPECIFIED",
|
|
25
25
|
EntityNoCall = "ENTITY_NO_CALL",
|
|
26
26
|
EntityOpenStandardCall = "ENTITY_OPEN_STANDARD_CALL",
|
|
27
27
|
EntityOpenUrgentCall = "ENTITY_OPEN_URGENT_CALL",
|
|
28
|
-
EntityAgedCall = "ENTITY_AGED_CALL"
|
|
28
|
+
EntityAgedCall = "ENTITY_AGED_CALL",
|
|
29
|
+
EntityOpenDebitCall = "ENTITY_OPEN_DEBIT_CALL"
|
|
29
30
|
}
|
|
@@ -12,6 +12,7 @@ export { AssetChangeType } from './AssetChangeType';
|
|
|
12
12
|
export { Benchmark } from './Benchmark';
|
|
13
13
|
export { CandlesGranularity } from './CandlesGranularity';
|
|
14
14
|
export { DestinationType } from './DestinationType';
|
|
15
|
+
export { EstimateType } from './EstimateType';
|
|
15
16
|
export { FcmFuturesSweepStatus } from './FcmFuturesSweepStatus';
|
|
16
17
|
export { FcmMarginCallState } from './FcmMarginCallState';
|
|
17
18
|
export { FcmMarginCallType } from './FcmMarginCallType';
|
|
@@ -27,16 +28,21 @@ export { OrderSide } from './OrderSide';
|
|
|
27
28
|
export { OrderStatus } from './OrderStatus';
|
|
28
29
|
export { OrderType } from './OrderType';
|
|
29
30
|
export { PaymentMethodType } from './PaymentMethodType';
|
|
31
|
+
export { PegOffsetType } from './PegOffsetType';
|
|
30
32
|
export { PortfolioBalanceType } from './PortfolioBalanceType';
|
|
31
33
|
export { PositionReferenceType } from './PositionReferenceType';
|
|
32
34
|
export { ProductPermissions } from './ProductPermissions';
|
|
33
35
|
export { RateType } from './RateType';
|
|
36
|
+
export { RewardSubtype } from './RewardSubtype';
|
|
34
37
|
export { SigningStatus } from './SigningStatus';
|
|
35
38
|
export { SortDirection } from './SortDirection';
|
|
36
39
|
export { TimeInForceType } from './TimeInForceType';
|
|
37
40
|
export { TransactionStatus } from './TransactionStatus';
|
|
38
41
|
export { TransactionType } from './TransactionType';
|
|
39
42
|
export { TransferLocationType } from './TransferLocationType';
|
|
43
|
+
export { TravelRuleStatus } from './TravelRuleStatus';
|
|
44
|
+
export { TravelRuleWalletType } from './TravelRuleWalletType';
|
|
45
|
+
export { UnstakeType } from './UnstakeType';
|
|
40
46
|
export { UserRole } from './UserRole';
|
|
41
47
|
export { ValidatorStatus } from './ValidatorStatus';
|
|
42
48
|
export { VisibilityStatus } from './VisibilityStatus';
|
|
@@ -43,8 +43,10 @@ export type { CreateWalletResponse } from './CreateWalletResponse';
|
|
|
43
43
|
export type { CreateWalletTransferResponse } from './CreateWalletTransferResponse';
|
|
44
44
|
export type { CreateWalletWithdrawalResponse } from './CreateWalletWithdrawalResponse';
|
|
45
45
|
export type { CrossMarginOverview } from './CrossMarginOverview';
|
|
46
|
+
export type { DateOfBirth } from './DateOfBirth';
|
|
46
47
|
export type { DefiBalance } from './DefiBalance';
|
|
47
48
|
export type { DestinationAlloc } from './DestinationAlloc';
|
|
49
|
+
export type { DetailedAddress } from './DetailedAddress';
|
|
48
50
|
export type { EditOrderResponse } from './EditOrderResponse';
|
|
49
51
|
export type { EntityBalance } from './EntityBalance';
|
|
50
52
|
export type { EntityUser } from './EntityUser';
|
|
@@ -70,6 +72,7 @@ export type { GetExistingLocatesResponse } from './GetExistingLocatesResponse';
|
|
|
70
72
|
export type { GetFcmBalanceResponse } from './GetFcmBalanceResponse';
|
|
71
73
|
export type { GetFcmMarginCallDetailsResponse } from './GetFcmMarginCallDetailsResponse';
|
|
72
74
|
export type { GetFcmRiskLimitsResponse } from './GetFcmRiskLimitsResponse';
|
|
75
|
+
export type { GetFcmSettingsResponse } from './GetFcmSettingsResponse';
|
|
73
76
|
export type { GetFuturesSweepsResponse } from './GetFuturesSweepsResponse';
|
|
74
77
|
export type { GetInterestAccrualsResponse } from './GetInterestAccrualsResponse';
|
|
75
78
|
export type { GetInvoicesResponse } from './GetInvoicesResponse';
|
|
@@ -100,6 +103,7 @@ export type { GetPositionsResponse } from './GetPositionsResponse';
|
|
|
100
103
|
export type { GetPostTradeCreditResponse } from './GetPostTradeCreditResponse';
|
|
101
104
|
export type { GetTFTieredPricingFeesResponse } from './GetTFTieredPricingFeesResponse';
|
|
102
105
|
export type { GetTransactionResponse } from './GetTransactionResponse';
|
|
106
|
+
export type { GetUnstakingStatusResponse } from './GetUnstakingStatusResponse';
|
|
103
107
|
export type { GetWalletBalanceResponse } from './GetWalletBalanceResponse';
|
|
104
108
|
export type { GetWalletDepositInstructionsResponse } from './GetWalletDepositInstructionsResponse';
|
|
105
109
|
export type { GetWalletResponse } from './GetWalletResponse';
|
|
@@ -111,7 +115,9 @@ export type { InvoiceItem } from './InvoiceItem';
|
|
|
111
115
|
export type { ListAggregateEntityPositionsResponse } from './ListAggregateEntityPositionsResponse';
|
|
112
116
|
export type { ListEntityBalancesResponse } from './ListEntityBalancesResponse';
|
|
113
117
|
export type { ListEntityPositionsResponse } from './ListEntityPositionsResponse';
|
|
118
|
+
export type { ListFinancingEligibleAssetsResponse } from './ListFinancingEligibleAssetsResponse';
|
|
114
119
|
export type { ListOnchainAddressGroupsResponse } from './ListOnchainAddressGroupsResponse';
|
|
120
|
+
export type { ListTFObligationsResponse } from './ListTFObligationsResponse';
|
|
115
121
|
export type { ListTransactionValidatorsResponse } from './ListTransactionValidatorsResponse';
|
|
116
122
|
export type { ListWalletAddressesResponse } from './ListWalletAddressesResponse';
|
|
117
123
|
export type { ListWeb3WalletBalancesResponse } from './ListWeb3WalletBalancesResponse';
|
|
@@ -126,6 +132,7 @@ export type { MarketRate } from './MarketRate';
|
|
|
126
132
|
export type { MatchMetadata } from './MatchMetadata';
|
|
127
133
|
export type { NFTCollection } from './NFTCollection';
|
|
128
134
|
export type { NFTItem } from './NFTItem';
|
|
135
|
+
export type { NaturalPersonName } from './NaturalPersonName';
|
|
129
136
|
export type { Network } from './Network';
|
|
130
137
|
export type { NetworkDetails } from './NetworkDetails';
|
|
131
138
|
export type { OnchainTransactionDetails } from './OnchainTransactionDetails';
|
|
@@ -145,23 +152,35 @@ export type { Position } from './Position';
|
|
|
145
152
|
export type { PositionReference } from './PositionReference';
|
|
146
153
|
export type { PostOrderPreviewResponse } from './PostOrderPreviewResponse';
|
|
147
154
|
export type { PostTradeCreditInformation } from './PostTradeCreditInformation';
|
|
155
|
+
export type { PreviewUnstakeResponse } from './PreviewUnstakeResponse';
|
|
156
|
+
export type { ProcessRequirements } from './ProcessRequirements';
|
|
148
157
|
export type { Product } from './Product';
|
|
149
158
|
export type { QuoteResponse } from './QuoteResponse';
|
|
150
159
|
export type { RFQProductDetails } from './RFQProductDetails';
|
|
160
|
+
export type { RewardMetadata } from './RewardMetadata';
|
|
151
161
|
export type { RiskAssessment } from './RiskAssessment';
|
|
152
162
|
export type { RpcConfig } from './RpcConfig';
|
|
153
163
|
export type { ScheduleFuturesSweepResponse } from './ScheduleFuturesSweepResponse';
|
|
154
164
|
export type { SetAutoSweepResponse } from './SetAutoSweepResponse';
|
|
165
|
+
export type { SetFcmSettingsResponse } from './SetFcmSettingsResponse';
|
|
155
166
|
export type { ShortCollateral } from './ShortCollateral';
|
|
156
167
|
export type { StakingClaimRewardsResponse } from './StakingClaimRewardsResponse';
|
|
157
168
|
export type { StakingInitiateResponse } from './StakingInitiateResponse';
|
|
158
169
|
export type { StakingUnstakeResponse } from './StakingUnstakeResponse';
|
|
170
|
+
export type { TFAsset } from './TFAsset';
|
|
171
|
+
export type { TFObligation } from './TFObligation';
|
|
159
172
|
export type { TieredPricingFee } from './TieredPricingFee';
|
|
160
173
|
export type { Transaction } from './Transaction';
|
|
161
174
|
export type { TransactionMetadata } from './TransactionMetadata';
|
|
162
175
|
export type { TransactionValidator } from './TransactionValidator';
|
|
163
176
|
export type { TransferLocation } from './TransferLocation';
|
|
177
|
+
export type { TravelRuleEntry } from './TravelRuleEntry';
|
|
178
|
+
export type { TravelRuleParty } from './TravelRuleParty';
|
|
179
|
+
export type { TravelRuleWalletDetails } from './TravelRuleWalletDetails';
|
|
180
|
+
export type { UnstakingStatus } from './UnstakingStatus';
|
|
164
181
|
export type { UserAction } from './UserAction';
|
|
182
|
+
export type { VASP } from './VASP';
|
|
183
|
+
export type { ValidatorUnstakingInfo } from './ValidatorUnstakingInfo';
|
|
165
184
|
export type { Wallet } from './Wallet';
|
|
166
185
|
export type { WalletClaimRewardsInputs } from './WalletClaimRewardsInputs';
|
|
167
186
|
export type { WalletCryptoDepositInstructions } from './WalletCryptoDepositInstructions';
|
|
@@ -192,8 +211,10 @@ export type { ListTransactionValidatorsRequest } from './ListTransactionValidato
|
|
|
192
211
|
export type { OrderPreviewRequest } from './OrderPreviewRequest';
|
|
193
212
|
export type { PortfolioStakingInitiateRequest } from './PortfolioStakingInitiateRequest';
|
|
194
213
|
export type { PortfolioStakingUnstakeRequest } from './PortfolioStakingUnstakeRequest';
|
|
214
|
+
export type { PreviewUnstakeRequest } from './PreviewUnstakeRequest';
|
|
195
215
|
export type { ScheduleFuturesSweepRequest } from './ScheduleFuturesSweepRequest';
|
|
196
216
|
export type { SetAutoSweepRequest } from './SetAutoSweepRequest';
|
|
217
|
+
export type { SetFcmSettingsRequest } from './SetFcmSettingsRequest';
|
|
197
218
|
export type { StakingClaimRewardsRequest } from './StakingClaimRewardsRequest';
|
|
198
219
|
export type { StakingInitiateRequest } from './StakingInitiateRequest';
|
|
199
220
|
export type { StakingUnstakeRequest } from './StakingUnstakeRequest';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a validation error for a specific parameter
|
|
3
|
+
*/
|
|
4
|
+
export interface ValidationError {
|
|
5
|
+
paramName: string;
|
|
6
|
+
message: string;
|
|
7
|
+
value?: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validation result that accumulates errors with fluent/builder pattern support
|
|
11
|
+
*/
|
|
12
|
+
export declare class ValidationResult {
|
|
13
|
+
private errors;
|
|
14
|
+
/**
|
|
15
|
+
* Add a validation error
|
|
16
|
+
*/
|
|
17
|
+
addError(paramName: string, message: string, value?: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* Check if there are any validation errors
|
|
20
|
+
*/
|
|
21
|
+
hasErrors(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Get all validation errors
|
|
24
|
+
*/
|
|
25
|
+
getErrors(): ValidationError[];
|
|
26
|
+
/**
|
|
27
|
+
* Validates that a required UUID parameter is present and valid.
|
|
28
|
+
* Returns this for method chaining.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* validator
|
|
33
|
+
* .validateRequiredUUID(request.portfolioId, 'portfolioId')
|
|
34
|
+
* .validateRequiredUUID(request.orderId, 'orderId')
|
|
35
|
+
* .check();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
validateRequiredUUID(value: string | undefined | null, paramName: string): this;
|
|
39
|
+
/**
|
|
40
|
+
* Validates that an optional UUID parameter is valid if provided.
|
|
41
|
+
* Returns this for method chaining.
|
|
42
|
+
*/
|
|
43
|
+
validateOptionalUUID(value: string | undefined | null, paramName: string): this;
|
|
44
|
+
/**
|
|
45
|
+
* Validates that a required string parameter is present and not empty.
|
|
46
|
+
* Returns this for method chaining.
|
|
47
|
+
*/
|
|
48
|
+
validateRequiredString(value: string | undefined | null, paramName: string): this;
|
|
49
|
+
/**
|
|
50
|
+
* Validates that an optional string parameter is not empty if provided.
|
|
51
|
+
* Returns this for method chaining.
|
|
52
|
+
*/
|
|
53
|
+
validateOptionalString(value: string | undefined | null, paramName: string): this;
|
|
54
|
+
/**
|
|
55
|
+
* Throw an exception if there are validation errors.
|
|
56
|
+
* Automatically detects the calling method name if no context is provided.
|
|
57
|
+
*
|
|
58
|
+
* @param contextMessage - Optional context message. If not provided, attempts to detect method name.
|
|
59
|
+
* @throws {CoinbasePrimeClientException} if there are validation errors
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const validator = createValidator();
|
|
64
|
+
* validateRequiredUUID(validator, request.id, 'id');
|
|
65
|
+
* validator.throwIfInvalid(); // Automatically detects calling method
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
throwIfInvalid(contextMessage?: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Alias for throwIfInvalid() - more natural for fluent/builder pattern.
|
|
71
|
+
* Throw an exception if there are validation errors.
|
|
72
|
+
*
|
|
73
|
+
* @param contextMessage - Optional context message. If not provided, attempts to detect method name.
|
|
74
|
+
* @throws {CoinbasePrimeClientException} if there are validation errors
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* validator
|
|
79
|
+
* .validateRequiredUUID(request.portfolioId, 'portfolioId')
|
|
80
|
+
* .validateRequiredUUID(request.orderId, 'orderId')
|
|
81
|
+
* .check(); // ✅ Fluent pattern
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
check(contextMessage?: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Attempts to extract the calling method name from the stack trace.
|
|
87
|
+
* This provides automatic context for validation errors.
|
|
88
|
+
* Falls back to 'Request validation failed' if method name cannot be determined.
|
|
89
|
+
*/
|
|
90
|
+
private getCallerContext;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Validates that a string is a valid UUID v4 format
|
|
94
|
+
*/
|
|
95
|
+
export declare function isValidUUID(value: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Validates that a required UUID parameter is present and valid
|
|
98
|
+
*/
|
|
99
|
+
export declare function validateRequiredUUID(validator: ValidationResult, value: string | undefined | null, paramName: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Validates that an optional UUID parameter is valid if provided
|
|
102
|
+
*/
|
|
103
|
+
export declare function validateOptionalUUID(validator: ValidationResult, value: string | undefined | null, paramName: string): void;
|
|
104
|
+
/**
|
|
105
|
+
* Validates that a required string parameter is present and not empty
|
|
106
|
+
*/
|
|
107
|
+
export declare function validateRequiredString(validator: ValidationResult, value: string | undefined | null, paramName: string): void;
|
|
108
|
+
/**
|
|
109
|
+
* Validates that an optional string parameter is not empty if provided
|
|
110
|
+
*/
|
|
111
|
+
export declare function validateOptionalString(validator: ValidationResult, value: string | undefined | null, paramName: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Convenience function to create a new ValidationResult
|
|
114
|
+
*/
|
|
115
|
+
export declare function createValidator(): ValidationResult;
|
|
116
|
+
/**
|
|
117
|
+
* Creates a validator with property accessor support for automatic field name inference.
|
|
118
|
+
*
|
|
119
|
+
* @param source - The source object containing the fields to validate
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* validate(request)
|
|
124
|
+
* .requiredUUID(r => r.portfolioId)
|
|
125
|
+
* .requiredUUID(r => r.orderId)
|
|
126
|
+
* .check();
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function validate<T extends Record<string, any>>(source: T): PropertyValidator<T>;
|
|
130
|
+
/**
|
|
131
|
+
* Validator with property accessor support for automatic field name inference.
|
|
132
|
+
* Uses Proxy to track property accesses and extract field names automatically.
|
|
133
|
+
*/
|
|
134
|
+
export declare class PropertyValidator<T extends Record<string, any>> {
|
|
135
|
+
private validator;
|
|
136
|
+
private source;
|
|
137
|
+
constructor(source: T);
|
|
138
|
+
/**
|
|
139
|
+
* Validates that a required UUID field is present and valid.
|
|
140
|
+
* Automatically extracts the field name from the property accessor.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* validate(request)
|
|
145
|
+
* .requiredUUID(r => r.portfolioId)
|
|
146
|
+
* .check();
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
requiredUUID(accessor: (source: T) => string | undefined | null): this;
|
|
150
|
+
/**
|
|
151
|
+
* Validates that an optional UUID field is valid if provided.
|
|
152
|
+
*/
|
|
153
|
+
optionalUUID(accessor: (source: T) => string | undefined | null): this;
|
|
154
|
+
/**
|
|
155
|
+
* Validates that a required string field is present and not empty.
|
|
156
|
+
*/
|
|
157
|
+
requiredString(accessor: (source: T) => string | undefined | null): this;
|
|
158
|
+
/**
|
|
159
|
+
* Validates that an optional string field is not empty if provided.
|
|
160
|
+
*/
|
|
161
|
+
optionalString(accessor: (source: T) => string | undefined | null): this;
|
|
162
|
+
/**
|
|
163
|
+
* Throws if there are validation errors.
|
|
164
|
+
* Automatically detects the calling method name.
|
|
165
|
+
*/
|
|
166
|
+
check(contextMessage?: string): void;
|
|
167
|
+
/**
|
|
168
|
+
* Alias for check() for backward compatibility.
|
|
169
|
+
*/
|
|
170
|
+
throwIfInvalid(contextMessage?: string): void;
|
|
171
|
+
/**
|
|
172
|
+
* Extracts the property name and value from a property accessor function.
|
|
173
|
+
* Uses a Proxy to track which property was accessed.
|
|
174
|
+
*/
|
|
175
|
+
private extractProperty;
|
|
176
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { IPrimeApiClient, CoinbaseCallOptions } from '../clients';
|
|
17
|
-
import { CreateStakeRequest, CreateStakeResponse, CreateUnstakeRequest, CreateUnstakeResponse, CreatePortfolioStakeRequest, CreatePortfolioStakeResponse, CreatePortfolioUnstakeRequest, CreatePortfolioUnstakeResponse, QueryTransactionValidatorsRequest, QueryTransactionValidatorsResponse, ClaimRewardsRequest, ClaimRewardsResponse } from './types';
|
|
17
|
+
import { CreateStakeRequest, CreateStakeResponse, CreateUnstakeRequest, CreateUnstakeResponse, CreatePortfolioStakeRequest, CreatePortfolioStakeResponse, CreatePortfolioUnstakeRequest, CreatePortfolioUnstakeResponse, QueryTransactionValidatorsRequest, QueryTransactionValidatorsResponse, ClaimRewardsRequest, ClaimRewardsResponse, PreviewUnstakeRequest, PreviewUnstakeResponse, GetUnstakingStatusRequest, GetUnstakingStatusResponse } from './types';
|
|
18
18
|
export interface IStakingService {
|
|
19
19
|
createStake(request: CreateStakeRequest, options?: CoinbaseCallOptions): Promise<CreateStakeResponse>;
|
|
20
20
|
createUnstake(request: CreateUnstakeRequest, options?: CoinbaseCallOptions): Promise<CreateUnstakeResponse>;
|
|
@@ -22,6 +22,8 @@ export interface IStakingService {
|
|
|
22
22
|
createPortfolioUnstake(request: CreatePortfolioUnstakeRequest, options?: CoinbaseCallOptions): Promise<CreatePortfolioUnstakeResponse>;
|
|
23
23
|
queryTransactionValidators(request: QueryTransactionValidatorsRequest, options?: CoinbaseCallOptions): Promise<QueryTransactionValidatorsResponse>;
|
|
24
24
|
claimRewards(request: ClaimRewardsRequest, options?: CoinbaseCallOptions): Promise<ClaimRewardsResponse>;
|
|
25
|
+
previewUnstake(request: PreviewUnstakeRequest, options?: CoinbaseCallOptions): Promise<PreviewUnstakeResponse>;
|
|
26
|
+
getUnstakingStatus(request: GetUnstakingStatusRequest, options?: CoinbaseCallOptions): Promise<GetUnstakingStatusResponse>;
|
|
25
27
|
}
|
|
26
28
|
export declare class StakingService implements IStakingService {
|
|
27
29
|
private client;
|
|
@@ -32,4 +34,6 @@ export declare class StakingService implements IStakingService {
|
|
|
32
34
|
createPortfolioUnstake(request: CreatePortfolioUnstakeRequest, options?: CoinbaseCallOptions): Promise<CreatePortfolioUnstakeResponse>;
|
|
33
35
|
queryTransactionValidators(request: QueryTransactionValidatorsRequest, options?: CoinbaseCallOptions): Promise<QueryTransactionValidatorsResponse>;
|
|
34
36
|
claimRewards(request: ClaimRewardsRequest, options?: CoinbaseCallOptions): Promise<ClaimRewardsResponse>;
|
|
37
|
+
previewUnstake(request: PreviewUnstakeRequest, options?: CoinbaseCallOptions): Promise<PreviewUnstakeResponse>;
|
|
38
|
+
getUnstakingStatus(request: GetUnstakingStatusRequest, options?: CoinbaseCallOptions): Promise<GetUnstakingStatusResponse>;
|
|
35
39
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Brand } from '../shared/brand';
|
|
17
17
|
import { BasePaginatedRequest, PaginatedResponseMethods } from '../shared/paginatedResponse';
|
|
18
|
-
import { StakingInitiateResponse, StakingInitiateRequest, StakingUnstakeResponse, PortfolioStakingInitiateRequest, PortfolioStakingInitiateResponse, PortfolioStakingUnstakeRequest, PortfolioStakingUnstakeResponse, ListTransactionValidatorsResponse as internalListTransactionValidatorsResponse, StakingClaimRewardsRequest as internalStakingClaimRewardsRequest, StakingClaimRewardsResponse as internalStakingClaimRewardsResponse } from 'src/model/';
|
|
18
|
+
import { StakingInitiateResponse, StakingInitiateRequest, StakingUnstakeResponse, PortfolioStakingInitiateRequest, PortfolioStakingInitiateResponse, PortfolioStakingUnstakeRequest, PortfolioStakingUnstakeResponse, ListTransactionValidatorsResponse as internalListTransactionValidatorsResponse, StakingClaimRewardsRequest as internalStakingClaimRewardsRequest, StakingClaimRewardsResponse as internalStakingClaimRewardsResponse, PreviewUnstakeResponse as internalPreviewUnstakeResponse, GetUnstakingStatusResponse as internalGetUnstakingStatusResponse } from 'src/model/';
|
|
19
19
|
export type CreateStakeRequest = StakingInitiateRequest & {
|
|
20
20
|
portfolioId: string;
|
|
21
21
|
walletId: string;
|
|
@@ -45,3 +45,14 @@ export type ClaimRewardsRequest = internalStakingClaimRewardsRequest & {
|
|
|
45
45
|
walletId: string;
|
|
46
46
|
};
|
|
47
47
|
export type ClaimRewardsResponse = Brand<internalStakingClaimRewardsResponse, 'ClaimRewardsResponse'>;
|
|
48
|
+
export type PreviewUnstakeRequest = {
|
|
49
|
+
portfolioId: string;
|
|
50
|
+
walletId: string;
|
|
51
|
+
amount: string;
|
|
52
|
+
};
|
|
53
|
+
export type PreviewUnstakeResponse = Brand<internalPreviewUnstakeResponse, 'PreviewUnstakeResponse'>;
|
|
54
|
+
export type GetUnstakingStatusRequest = {
|
|
55
|
+
portfolioId: string;
|
|
56
|
+
walletId: string;
|
|
57
|
+
};
|
|
58
|
+
export type GetUnstakingStatusResponse = Brand<internalGetUnstakingStatusResponse, 'GetUnstakingStatusResponse'>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Brand } from '../shared/brand';
|
|
17
|
-
import { TransactionType } from '../model/enums/';
|
|
17
|
+
import { TransactionType, TravelRuleStatus } from '../model/enums/';
|
|
18
18
|
import { GetPortfolioTransactionsResponse, GetWalletTransactionsResponse, GetTransactionResponse as internalGet, CreateConversionRequest as internalCreateConversion, CreateConversionResponse as internalCreateConversionResp, CreateATransferBetweenTwoWallets, CreateWalletWithdrawalRequest, CreateWalletWithdrawalResponse, CreateWalletTransferResponse, CreateOnchainTransactionRequest as internalCreate, CreateOnchainTransactionResponse as internalCreateResp } from '../model/';
|
|
19
19
|
import { Pagination } from '../shared/pagination';
|
|
20
20
|
import { PaginatedResponseMethods, BasePaginatedRequest } from '../shared/paginatedResponse';
|
|
@@ -24,6 +24,8 @@ export type ListPortfolioTransactionsRequest = Pagination & {
|
|
|
24
24
|
types?: TransactionType[];
|
|
25
25
|
startTime?: string;
|
|
26
26
|
endTime?: string;
|
|
27
|
+
getNetworkUnifiedTransactions?: boolean;
|
|
28
|
+
travelRuleStatus?: TravelRuleStatus[];
|
|
27
29
|
};
|
|
28
30
|
type BaseListPortfolioTransactionsResponse = Brand<GetPortfolioTransactionsResponse, 'ListPortfolioTransactionsResponse'>;
|
|
29
31
|
export type ListPortfolioTransactionsResponse = BaseListPortfolioTransactionsResponse & PaginatedResponseMethods<ListPortfolioTransactionsRequest & BasePaginatedRequest, BaseListPortfolioTransactionsResponse, any>;
|
|
@@ -22,6 +22,7 @@ export type ListWalletsRequest = Pagination & {
|
|
|
22
22
|
portfolioId: string;
|
|
23
23
|
type: WalletType;
|
|
24
24
|
symbols?: string[];
|
|
25
|
+
getNetworkUnifiedWallets?: boolean;
|
|
25
26
|
};
|
|
26
27
|
export type BaseListWalletsResponse = Brand<GetWalletsResponse, 'ListWalletsResponse'>;
|
|
27
28
|
export type ListWalletsResponse = BaseListWalletsResponse & PaginatedResponseMethods<ListWalletsRequest & BasePaginatedRequest, BaseListWalletsResponse, any>;
|