Skip to content

Commit 7c1024f

Browse files
authoredOct 31, 2024
chore: Release V0.10.0 (#39)
* feat: Support waiting for faucet transactions (#38) * chore: Bump OpenAPI client * chore: Add network_id to Transaction resource * chore: Update faucet transaction payload This updates the faucet transaction payload to reflect what our API now returns. * feat: Support fetching faucet transaction status * chore: Add status and network to faucet transaction string * chore: Fix typos * chore: Prepare v0.10.0 release
1 parent 3e06f37 commit 7c1024f

30 files changed

+2678
-36
lines changed
 

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44

5+
## [0.10.0] - 2024-10-31
6+
7+
### Changed
8+
- Make faucet transactions async i.e. using `faucet_tx.wait()` to wait for the transaction to be confirmed.
9+
- This will make the SDK more consistent and make faucet transactions more reliable.
10+
511
## [0.0.9] - 2024-10-29
612

713
### Fixed

‎README.md

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ testnet ETH. You are allowed one faucet claim per 24-hour window.
100100
# Fund the wallet with a faucet transaction.
101101
faucet_tx = wallet1.faucet()
102102

103+
# Wait for the faucet transaction to complete.
104+
faucet_tx.wait()
105+
103106
print(f"Faucet transaction successfully completed: {faucet_tx}")
104107
```
105108

@@ -135,6 +138,9 @@ print(f"Wallet successfully created: {wallet3}")
135138
# Fund the wallet with USDC with a faucet transaction.
136139
usdc_faucet_tx = wallet1.faucet("usdc")
137140

141+
# Wait for the faucet transaction to complete.
142+
usdc_faucet_tx.wait()
143+
138144
print(f"Faucet transaction successfully completed: {usdc_faucet_tx}")
139145

140146
transfer = wallet1.transfer(0.00001, "usdc", wallet3, gasless=True).wait()

‎cdp/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.9"
1+
__version__ = "0.10.0"

‎cdp/address.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def faucet(self, asset_id=None) -> FaucetTransaction:
6565
6666
"""
6767
model = Cdp.api_clients.external_addresses.request_external_faucet_funds(
68-
network_id=self.network_id, address_id=self.address_id, asset_id=asset_id
68+
network_id=self.network_id,
69+
address_id=self.address_id,
70+
asset_id=asset_id,
71+
skip_wait=True
6972
)
7073

7174
return FaucetTransaction(model)

‎cdp/client/__init__.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from cdp.client.api.contract_events_api import ContractEventsApi
2424
from cdp.client.api.contract_invocations_api import ContractInvocationsApi
2525
from cdp.client.api.external_addresses_api import ExternalAddressesApi
26+
from cdp.client.api.fund_api import FundApi
2627
from cdp.client.api.networks_api import NetworksApi
2728
from cdp.client.api.onchain_identity_api import OnchainIdentityApi
2829
from cdp.client.api.server_signers_api import ServerSignersApi
@@ -67,6 +68,8 @@
6768
from cdp.client.models.contract_invocation_list import ContractInvocationList
6869
from cdp.client.models.create_address_request import CreateAddressRequest
6970
from cdp.client.models.create_contract_invocation_request import CreateContractInvocationRequest
71+
from cdp.client.models.create_fund_operation_request import CreateFundOperationRequest
72+
from cdp.client.models.create_fund_quote_request import CreateFundQuoteRequest
7073
from cdp.client.models.create_payload_signature_request import CreatePayloadSignatureRequest
7174
from cdp.client.models.create_server_signer_request import CreateServerSignerRequest
7275
from cdp.client.models.create_smart_contract_request import CreateSmartContractRequest
@@ -77,10 +80,12 @@
7780
from cdp.client.models.create_wallet_request_wallet import CreateWalletRequestWallet
7881
from cdp.client.models.create_wallet_webhook_request import CreateWalletWebhookRequest
7982
from cdp.client.models.create_webhook_request import CreateWebhookRequest
83+
from cdp.client.models.crypto_amount import CryptoAmount
8084
from cdp.client.models.deploy_smart_contract_request import DeploySmartContractRequest
8185
from cdp.client.models.erc20_transfer_event import ERC20TransferEvent
8286
from cdp.client.models.erc721_transfer_event import ERC721TransferEvent
8387
from cdp.client.models.error import Error
88+
from cdp.client.models.ethereum_token_transfer import EthereumTokenTransfer
8489
from cdp.client.models.ethereum_transaction import EthereumTransaction
8590
from cdp.client.models.ethereum_transaction_access import EthereumTransactionAccess
8691
from cdp.client.models.ethereum_transaction_access_list import EthereumTransactionAccessList
@@ -91,6 +96,11 @@
9196
from cdp.client.models.fetch_historical_staking_balances200_response import FetchHistoricalStakingBalances200Response
9297
from cdp.client.models.fetch_staking_rewards200_response import FetchStakingRewards200Response
9398
from cdp.client.models.fetch_staking_rewards_request import FetchStakingRewardsRequest
99+
from cdp.client.models.fiat_amount import FiatAmount
100+
from cdp.client.models.fund_operation import FundOperation
101+
from cdp.client.models.fund_operation_fees import FundOperationFees
102+
from cdp.client.models.fund_operation_list import FundOperationList
103+
from cdp.client.models.fund_quote import FundQuote
94104
from cdp.client.models.get_staking_context_request import GetStakingContextRequest
95105
from cdp.client.models.historical_balance import HistoricalBalance
96106
from cdp.client.models.multi_token_contract_options import MultiTokenContractOptions
@@ -99,7 +109,6 @@
99109
from cdp.client.models.network_identifier import NetworkIdentifier
100110
from cdp.client.models.onchain_name import OnchainName
101111
from cdp.client.models.onchain_name_list import OnchainNameList
102-
from cdp.client.models.onchain_name_text_records_inner import OnchainNameTextRecordsInner
103112
from cdp.client.models.payload_signature import PayloadSignature
104113
from cdp.client.models.payload_signature_list import PayloadSignatureList
105114
from cdp.client.models.read_contract_request import ReadContractRequest
@@ -128,6 +137,7 @@
128137
from cdp.client.models.staking_reward_format import StakingRewardFormat
129138
from cdp.client.models.staking_reward_usd_value import StakingRewardUSDValue
130139
from cdp.client.models.token_contract_options import TokenContractOptions
140+
from cdp.client.models.token_transfer_type import TokenTransferType
131141
from cdp.client.models.trade import Trade
132142
from cdp.client.models.trade_list import TradeList
133143
from cdp.client.models.transaction import Transaction

‎cdp/client/api/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from cdp.client.api.contract_events_api import ContractEventsApi
88
from cdp.client.api.contract_invocations_api import ContractInvocationsApi
99
from cdp.client.api.external_addresses_api import ExternalAddressesApi
10+
from cdp.client.api.fund_api import FundApi
1011
from cdp.client.api.networks_api import NetworksApi
1112
from cdp.client.api.onchain_identity_api import OnchainIdentityApi
1213
from cdp.client.api.server_signers_api import ServerSignersApi

‎cdp/client/api/addresses_api.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2391,7 +2391,7 @@ def request_faucet_funds(
23912391
_headers: Optional[Dict[StrictStr, Any]] = None,
23922392
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
23932393
) -> FaucetTransaction:
2394-
"""Request faucet funds for onchain address.
2394+
"""(Deprecated) Request faucet funds for onchain address.
23952395
23962396
Request faucet funds to be sent to onchain address.
23972397
@@ -2422,6 +2422,7 @@ def request_faucet_funds(
24222422
:type _host_index: int, optional
24232423
:return: Returns the result object.
24242424
""" # noqa: E501
2425+
warnings.warn("POST /v1/wallets/{wallet_id}/addresses/{address_id}/faucet is deprecated.", DeprecationWarning)
24252426

24262427
_param = self._request_faucet_funds_serialize(
24272428
wallet_id=wallet_id,
@@ -2466,7 +2467,7 @@ def request_faucet_funds_with_http_info(
24662467
_headers: Optional[Dict[StrictStr, Any]] = None,
24672468
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
24682469
) -> ApiResponse[FaucetTransaction]:
2469-
"""Request faucet funds for onchain address.
2470+
"""(Deprecated) Request faucet funds for onchain address.
24702471
24712472
Request faucet funds to be sent to onchain address.
24722473
@@ -2497,6 +2498,7 @@ def request_faucet_funds_with_http_info(
24972498
:type _host_index: int, optional
24982499
:return: Returns the result object.
24992500
""" # noqa: E501
2501+
warnings.warn("POST /v1/wallets/{wallet_id}/addresses/{address_id}/faucet is deprecated.", DeprecationWarning)
25002502

25012503
_param = self._request_faucet_funds_serialize(
25022504
wallet_id=wallet_id,
@@ -2541,7 +2543,7 @@ def request_faucet_funds_without_preload_content(
25412543
_headers: Optional[Dict[StrictStr, Any]] = None,
25422544
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
25432545
) -> RESTResponseType:
2544-
"""Request faucet funds for onchain address.
2546+
"""(Deprecated) Request faucet funds for onchain address.
25452547
25462548
Request faucet funds to be sent to onchain address.
25472549
@@ -2572,6 +2574,7 @@ def request_faucet_funds_without_preload_content(
25722574
:type _host_index: int, optional
25732575
:return: Returns the result object.
25742576
""" # noqa: E501
2577+
warnings.warn("POST /v1/wallets/{wallet_id}/addresses/{address_id}/faucet is deprecated.", DeprecationWarning)
25752578

25762579
_param = self._request_faucet_funds_serialize(
25772580
wallet_id=wallet_id,

0 commit comments

Comments
 (0)