Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fund and quote_fund for wallet funding #47

Merged
merged 12 commits into from
Nov 27, 2024
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
### Fixed
- Fix bug in `Asset.from_model` where passed in asset ID was not used when creating a gwei or wei asset.

### Added

- Add `FundOperation` and `FundQuote` classes to support wallet funding.

## [0.10.3] - 2024-11-07

### Added
Expand Down
17 changes: 17 additions & 0 deletions cdp/api_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from cdp.client.api.balance_history_api import BalanceHistoryApi
from cdp.client.api.contract_invocations_api import ContractInvocationsApi
from cdp.client.api.external_addresses_api import ExternalAddressesApi
from cdp.client.api.fund_api import FundApi
from cdp.client.api.networks_api import NetworksApi
from cdp.client.api.smart_contracts_api import SmartContractsApi
from cdp.client.api.trades_api import TradesApi
Expand Down Expand Up @@ -53,6 +54,7 @@ def __init__(self, cdp_client: CdpApiClient) -> None:
self._smart_contracts: SmartContractsApi | None = None
self._balance_history: BalanceHistoryApi | None = None
self._transaction_history: TransactionHistoryApi | None = None
self._fund: FundApi | None = None

@property
def wallets(self) -> WalletsApi:
Expand Down Expand Up @@ -233,3 +235,18 @@ def transaction_history(self) -> TransactionHistoryApi:
if self._transaction_history is None:
self._transaction_history = TransactionHistoryApi(api_client=self._cdp_client)
return self._transaction_history

@property
def fund(self) -> FundApi:
"""Get the FundApi client instance.

Returns:
FundApi: The FundApi client instance.

Note:
This property lazily initializes the FundApi client on first access.

"""
if self._fund is None:
self._fund = FundApi(api_client=self._cdp_client)
return self._fund
4 changes: 4 additions & 0 deletions cdp/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from cdp.client.api.mpc_wallet_stake_api import MPCWalletStakeApi
from cdp.client.api.networks_api import NetworksApi
from cdp.client.api.onchain_identity_api import OnchainIdentityApi
from cdp.client.api.reputation_api import ReputationApi
from cdp.client.api.server_signers_api import ServerSignersApi
from cdp.client.api.smart_contracts_api import SmartContractsApi
from cdp.client.api.stake_api import StakeApi
Expand All @@ -53,6 +54,9 @@
from cdp.client.models.address_balance_list import AddressBalanceList
from cdp.client.models.address_historical_balance_list import AddressHistoricalBalanceList
from cdp.client.models.address_list import AddressList
from cdp.client.models.address_reputation import AddressReputation
from cdp.client.models.address_reputation_metadata import AddressReputationMetadata
from cdp.client.models.address_risk import AddressRisk
from cdp.client.models.address_transaction_list import AddressTransactionList
from cdp.client.models.asset import Asset
from cdp.client.models.balance import Balance
Expand Down
1 change: 1 addition & 0 deletions cdp/client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from cdp.client.api.mpc_wallet_stake_api import MPCWalletStakeApi
from cdp.client.api.networks_api import NetworksApi
from cdp.client.api.onchain_identity_api import OnchainIdentityApi
from cdp.client.api.reputation_api import ReputationApi
from cdp.client.api.server_signers_api import ServerSignersApi
from cdp.client.api.smart_contracts_api import SmartContractsApi
from cdp.client.api.stake_api import StakeApi
Expand Down
Loading