Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/python/end_user/create_end_user_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from cdp import CdpClient
from cdp.policies.types import (
CreateEndUserEvmSwapRule,
CreatePolicyOptions,
EthValueCriterion,
EvmAddressCriterion,
Expand Down Expand Up @@ -63,6 +64,20 @@ async def main():
),
],
),
# Restrict end-user EVM swaps to a specific network and max USD exposure
CreateEndUserEvmSwapRule(
action="accept",
criteria=[
EvmNetworkCriterion(
networks=["base", "base-sepolia"],
operator="in",
),
NetUSDChangeCriterion(
changeCents=10000, # $100.00
operator="<=",
),
],
),
# Restrict end-user EVM message signing to messages matching a specific pattern
SignEndUserEvmMessageRule(
action="accept",
Expand Down
6 changes: 6 additions & 0 deletions python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<!-- towncrier release notes start -->

## Unreleased

### Features

- Added support for the `createEndUserEvmSwap` policy rule, enabling policy controls for end user EVM swap operations with all existing EVM criteria (ethValue, evmAddress, evmNetwork, evmData, netUSDChange).

## [1.40.0] - 2026-03-06

### Features
Expand Down
13 changes: 11 additions & 2 deletions python/cdp/openapi_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from cdp.openapi_client.api.onchain_data_api import OnchainDataApi
from cdp.openapi_client.api.onramp_api import OnrampApi
from cdp.openapi_client.api.policy_engine_api import PolicyEngineApi
from cdp.openapi_client.api.sqlapi_alpha_api import SQLAPIAlphaApi
from cdp.openapi_client.api.sqlapi_api import SQLAPIApi
from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi
from cdp.openapi_client.api.solana_token_balances_api import SolanaTokenBalancesApi
from cdp.openapi_client.api.webhooks_api import WebhooksApi
Expand Down Expand Up @@ -62,6 +62,7 @@
from cdp.openapi_client.models.common_swap_response_issues import CommonSwapResponseIssues
from cdp.openapi_client.models.common_swap_response_issues_allowance import CommonSwapResponseIssuesAllowance
from cdp.openapi_client.models.common_swap_response_issues_balance import CommonSwapResponseIssuesBalance
from cdp.openapi_client.models.create_end_user_evm_swap_rule import CreateEndUserEvmSwapRule
from cdp.openapi_client.models.create_end_user_request import CreateEndUserRequest
from cdp.openapi_client.models.create_end_user_request_evm_account import CreateEndUserRequestEvmAccount
from cdp.openapi_client.models.create_end_user_request_solana_account import CreateEndUserRequestSolanaAccount
Expand Down Expand Up @@ -151,11 +152,14 @@
from cdp.openapi_client.models.net_usd_change_criterion import NetUSDChangeCriterion
from cdp.openapi_client.models.o_auth2_authentication import OAuth2Authentication
from cdp.openapi_client.models.o_auth2_provider_type import OAuth2ProviderType
from cdp.openapi_client.models.onchain_data_column_schema import OnchainDataColumnSchema
from cdp.openapi_client.models.onchain_data_query import OnchainDataQuery
from cdp.openapi_client.models.onchain_data_result import OnchainDataResult
from cdp.openapi_client.models.onchain_data_result_metadata import OnchainDataResultMetadata
from cdp.openapi_client.models.onchain_data_result_schema import OnchainDataResultSchema
from cdp.openapi_client.models.onchain_data_result_schema_columns_inner import OnchainDataResultSchemaColumnsInner
from cdp.openapi_client.models.onchain_data_schema_response import OnchainDataSchemaResponse
from cdp.openapi_client.models.onchain_data_table_schema import OnchainDataTableSchema
from cdp.openapi_client.models.onramp_limit_type import OnrampLimitType
from cdp.openapi_client.models.onramp_order import OnrampOrder
from cdp.openapi_client.models.onramp_order_fee import OnrampOrderFee
Expand Down Expand Up @@ -192,6 +196,7 @@
from cdp.openapi_client.models.send_solana_transaction_request import SendSolanaTransactionRequest
from cdp.openapi_client.models.send_user_operation_request import SendUserOperationRequest
from cdp.openapi_client.models.send_user_operation_rule import SendUserOperationRule
from cdp.openapi_client.models.sign_end_user_evm_hash_rule import SignEndUserEvmHashRule
from cdp.openapi_client.models.sign_end_user_evm_message_rule import SignEndUserEvmMessageRule
from cdp.openapi_client.models.sign_end_user_evm_transaction_rule import SignEndUserEvmTransactionRule
from cdp.openapi_client.models.sign_end_user_evm_typed_data_rule import SignEndUserEvmTypedDataRule
Expand Down Expand Up @@ -224,6 +229,7 @@
from cdp.openapi_client.models.sign_solana_message_request import SignSolanaMessageRequest
from cdp.openapi_client.models.sign_solana_transaction200_response import SignSolanaTransaction200Response
from cdp.openapi_client.models.sign_solana_transaction_request import SignSolanaTransactionRequest
from cdp.openapi_client.models.siwe_authentication import SiweAuthentication
from cdp.openapi_client.models.sms_authentication import SmsAuthentication
from cdp.openapi_client.models.sol_address_criterion import SolAddressCriterion
from cdp.openapi_client.models.sol_data_condition import SolDataCondition
Expand Down Expand Up @@ -258,6 +264,9 @@
from cdp.openapi_client.models.user_operation_receipt_revert import UserOperationReceiptRevert
from cdp.openapi_client.models.validate_end_user_access_token_request import ValidateEndUserAccessTokenRequest
from cdp.openapi_client.models.verify_x402_payment_request import VerifyX402PaymentRequest
from cdp.openapi_client.models.webhook_event_list_response import WebhookEventListResponse
from cdp.openapi_client.models.webhook_event_response import WebhookEventResponse
from cdp.openapi_client.models.webhook_event_response_detail import WebhookEventResponseDetail
from cdp.openapi_client.models.webhook_subscription_list_response import WebhookSubscriptionListResponse
from cdp.openapi_client.models.webhook_subscription_request import WebhookSubscriptionRequest
from cdp.openapi_client.models.webhook_subscription_response import WebhookSubscriptionResponse
Expand All @@ -278,9 +287,9 @@
from cdp.openapi_client.models.x402_settle_payment_rejection import X402SettlePaymentRejection
from cdp.openapi_client.models.x402_supported_payment_kind import X402SupportedPaymentKind
from cdp.openapi_client.models.x402_v1_payment_payload import X402V1PaymentPayload
from cdp.openapi_client.models.x402_v1_payment_payload_payload import X402V1PaymentPayloadPayload
from cdp.openapi_client.models.x402_v1_payment_requirements import X402V1PaymentRequirements
from cdp.openapi_client.models.x402_v2_payment_payload import X402V2PaymentPayload
from cdp.openapi_client.models.x402_v2_payment_payload_payload import X402V2PaymentPayloadPayload
from cdp.openapi_client.models.x402_v2_payment_requirements import X402V2PaymentRequirements
from cdp.openapi_client.models.x402_verify_invalid_reason import X402VerifyInvalidReason
from cdp.openapi_client.models.x402_verify_payment_rejection import X402VerifyPaymentRejection
Expand Down
2 changes: 1 addition & 1 deletion python/cdp/openapi_client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from cdp.openapi_client.api.onchain_data_api import OnchainDataApi
from cdp.openapi_client.api.onramp_api import OnrampApi
from cdp.openapi_client.api.policy_engine_api import PolicyEngineApi
from cdp.openapi_client.api.sqlapi_alpha_api import SQLAPIAlphaApi
from cdp.openapi_client.api.sqlapi_api import SQLAPIApi
from cdp.openapi_client.api.solana_accounts_api import SolanaAccountsApi
from cdp.openapi_client.api.solana_token_balances_api import SolanaTokenBalancesApi
from cdp.openapi_client.api.webhooks_api import WebhooksApi
Expand Down
6 changes: 3 additions & 3 deletions python/cdp/openapi_client/api/faucets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ async def request_solana_faucet(
) -> RequestSolanaFaucet200Response:
"""Request funds on Solana devnet

Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC |
Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD |

:param request_solana_faucet_request:
:type request_solana_faucet_request: RequestSolanaFaucetRequest
Expand Down Expand Up @@ -425,7 +425,7 @@ async def request_solana_faucet_with_http_info(
) -> ApiResponse[RequestSolanaFaucet200Response]:
"""Request funds on Solana devnet

Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC |
Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD |

:param request_solana_faucet_request:
:type request_solana_faucet_request: RequestSolanaFaucetRequest
Expand Down Expand Up @@ -498,7 +498,7 @@ async def request_solana_faucet_without_preload_content(
) -> RESTResponseType:
"""Request funds on Solana devnet

Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----:|:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC |
Request funds from the CDP Faucet on Solana devnet. Faucets are available for SOL, USDC, and CBTUSD. To prevent abuse, we enforce rate limits within a rolling 24-hour window to control the amount of funds that can be requested. These limits are applied at both the CDP Project level and the blockchain address level. A single blockchain address cannot exceed the specified limits, even if multiple users submit requests to the same address. | Token | Amount per Faucet Request |Rolling 24-hour window Rate Limits| |:-----: |:-------------------------:|:--------------------------------:| | SOL | 0.00125 SOL | 0.0125 SOL | | USDC | 1 USDC | 10 USDC | | CBTUSD | 1 CBTUSD | 10 CBTUSD |

:param request_solana_faucet_request:
:type request_solana_faucet_request: RequestSolanaFaucetRequest
Expand Down
Loading
Loading