Skip to content

Commit

Permalink
Merge pull request #53 from coinbase/v0.11.0
Browse files Browse the repository at this point in the history
* Fix Asset from_model bug to use passed in asset_id when initializing (#46)

* Support for fund and quote_fund for wallet funding (#47)

* Fix quote fund to properly pass in normalized amount (#50)

* Contract webhook support (#52)

* contract activity webhook support

* Update webhook.py

* Update webhook_factory.py

* chore: Prep v0.11.0 release (#51)

---------

Co-authored-by: rohan-agarwal-coinbase <[email protected]>
Co-authored-by: cb-howardatcb <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2024
2 parents 4ebb72f + 1c0ff0d commit 679eafb
Show file tree
Hide file tree
Showing 43 changed files with 3,001 additions and 110 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## Unreleased

### [0.11.0] - 2024-11-27

### Added
- Add support for funding wallets (Alpha feature release)
- Must reach out to CDP SDK Discord channel to be considered for this feature.
- Added create and update feature for `SmartContractEventActivity` webhook and its related event type filter.

### Fixed
- Fix bug in `Asset.from_model` where passed in asset ID was not used when creating a gwei or wei asset.

## [0.10.4] - 2024-11-25

### Added

- Wallet address key export

## [0.10.4] - 2024-11-25

### Added
Expand Down
2 changes: 1 addition & 1 deletion cdp/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.4"
__version__ = "0.11.0"
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
2 changes: 1 addition & 1 deletion cdp/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def from_model(cls, model: AssetModel, asset_id: str | None = None) -> "Asset":

return cls(
network_id=model.network_id,
asset_id=model.asset_id,
asset_id=asset_id or model.asset_id,
contract_address=model.contract_address,
decimals=decimals,
)
Expand Down
7 changes: 7 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 @@ -49,10 +50,14 @@
from cdp.client.exceptions import ApiException

# import models into sdk package
from cdp.client.models.abi import ABI
from cdp.client.models.address import Address
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 Expand Up @@ -122,6 +127,7 @@
from cdp.client.models.signature_creation_event_result import SignatureCreationEventResult
from cdp.client.models.signed_voluntary_exit_message_metadata import SignedVoluntaryExitMessageMetadata
from cdp.client.models.smart_contract import SmartContract
from cdp.client.models.smart_contract_activity_event import SmartContractActivityEvent
from cdp.client.models.smart_contract_list import SmartContractList
from cdp.client.models.smart_contract_options import SmartContractOptions
from cdp.client.models.smart_contract_type import SmartContractType
Expand Down Expand Up @@ -157,4 +163,5 @@
from cdp.client.models.webhook_event_type import WebhookEventType
from cdp.client.models.webhook_event_type_filter import WebhookEventTypeFilter
from cdp.client.models.webhook_list import WebhookList
from cdp.client.models.webhook_smart_contract_event_filter import WebhookSmartContractEventFilter
from cdp.client.models.webhook_wallet_activity_filter import WebhookWalletActivityFilter
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 679eafb

Please sign in to comment.