Skip to content

Commit

Permalink
Support for fund and quote_fund for wallet funding (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-agarwal-coinbase authored Nov 27, 2024
1 parent a6b3587 commit 1d02804
Show file tree
Hide file tree
Showing 24 changed files with 2,299 additions and 55 deletions.
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

0 comments on commit 1d02804

Please sign in to comment.