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 deploy_token, deploy_nft, deploy_multi_token #18

Merged
merged 27 commits into from
Oct 1, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Contract invocation support.
- Arbitrary message signing support.
- Deploy ERC20, ERC721, and ERC1155 smart contracts.

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions cdp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from cdp.contract_invocation import ContractInvocation
from cdp.faucet_transaction import FaucetTransaction
from cdp.payload_signature import PayloadSignature
from cdp.smart_contract import SmartContract
from cdp.sponsored_send import SponsoredSend
from cdp.trade import Trade
from cdp.transaction import Transaction
Expand All @@ -32,4 +33,5 @@
"Trade",
"SponsoredSend",
"PayloadSignature",
"SmartContract",
]
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.contract_invocations_api import ContractInvocationsApi
from cdp.client.api.external_addresses_api import ExternalAddressesApi
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
from cdp.client.api.transfers_api import TransfersApi
from cdp.client.api.wallets_api import WalletsApi
Expand Down Expand Up @@ -44,6 +45,7 @@ def __init__(self, cdp_client: CdpApiClient) -> None:
self._assets: AssetsApi | None = None
self._trades: TradesApi | None = None
self._contract_invocations: ContractInvocationsApi | None = None
self._smart_contracts: SmartContractsApi | None = None

@property
def wallets(self) -> WalletsApi:
Expand Down Expand Up @@ -164,3 +166,18 @@ def contract_invocations(self) -> ContractInvocationsApi:
if self._contract_invocations is None:
self._contract_invocations = ContractInvocationsApi(api_client=self._cdp_client)
return self._contract_invocations

@property
def smart_contracts(self) -> SmartContractsApi:
"""Get the SmartContractsApi client instance.

Returns:
SmartContractsApi: The SmartContractsApi client instance.

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

"""
if self._smart_contracts is None:
self._smart_contracts = SmartContractsApi(api_client=self._cdp_client)
return self._smart_contracts
26 changes: 12 additions & 14 deletions cdp/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# flake8: noqa

"""
Coinbase Platform API
Coinbase Platform API

This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.

The version of the OpenAPI document: 0.0.1-alpha
Generated by OpenAPI Generator (https://openapi-generator.tech)
The version of the OpenAPI document: 0.0.1-alpha
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
Do not edit the class manually.
""" # noqa: E501


__version__ = "1.0.0"

# import apis into sdk package
Expand All @@ -27,6 +28,7 @@
from cdp.client.api.smart_contracts_api import SmartContractsApi
from cdp.client.api.stake_api import StakeApi
from cdp.client.api.trades_api import TradesApi
from cdp.client.api.transaction_history_api import TransactionHistoryApi
from cdp.client.api.transfers_api import TransfersApi
from cdp.client.api.users_api import UsersApi
from cdp.client.api.validators_api import ValidatorsApi
Expand All @@ -53,9 +55,7 @@
from cdp.client.models.address_transaction_list import AddressTransactionList
from cdp.client.models.asset import Asset
from cdp.client.models.balance import Balance
from cdp.client.models.broadcast_contract_invocation_request import (
BroadcastContractInvocationRequest,
)
from cdp.client.models.broadcast_contract_invocation_request import BroadcastContractInvocationRequest
from cdp.client.models.broadcast_staking_operation_request import BroadcastStakingOperationRequest
from cdp.client.models.broadcast_trade_request import BroadcastTradeRequest
from cdp.client.models.broadcast_transfer_request import BroadcastTransferRequest
Expand All @@ -74,6 +74,7 @@
from cdp.client.models.create_transfer_request import CreateTransferRequest
from cdp.client.models.create_wallet_request import CreateWalletRequest
from cdp.client.models.create_wallet_request_wallet import CreateWalletRequestWallet
from cdp.client.models.create_wallet_webhook_request import CreateWalletWebhookRequest
from cdp.client.models.create_webhook_request import CreateWebhookRequest
from cdp.client.models.deploy_smart_contract_request import DeploySmartContractRequest
from cdp.client.models.erc20_transfer_event import ERC20TransferEvent
Expand All @@ -86,13 +87,12 @@
from cdp.client.models.ethereum_validator_metadata import EthereumValidatorMetadata
from cdp.client.models.faucet_transaction import FaucetTransaction
from cdp.client.models.feature_set import FeatureSet
from cdp.client.models.fetch_historical_staking_balances200_response import (
FetchHistoricalStakingBalances200Response,
)
from cdp.client.models.fetch_historical_staking_balances200_response import FetchHistoricalStakingBalances200Response
from cdp.client.models.fetch_staking_rewards200_response import FetchStakingRewards200Response
from cdp.client.models.fetch_staking_rewards_request import FetchStakingRewardsRequest
from cdp.client.models.get_staking_context_request import GetStakingContextRequest
from cdp.client.models.historical_balance import HistoricalBalance
from cdp.client.models.multi_token_contract_options import MultiTokenContractOptions
from cdp.client.models.nft_contract_options import NFTContractOptions
from cdp.client.models.network import Network
from cdp.client.models.network_identifier import NetworkIdentifier
Expand All @@ -107,9 +107,7 @@
from cdp.client.models.server_signer_list import ServerSignerList
from cdp.client.models.signature_creation_event import SignatureCreationEvent
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.signed_voluntary_exit_message_metadata import SignedVoluntaryExitMessageMetadata
from cdp.client.models.smart_contract import SmartContract
from cdp.client.models.smart_contract_list import SmartContractList
from cdp.client.models.smart_contract_options import SmartContractOptions
Expand Down
2 changes: 2 additions & 0 deletions cdp/client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
from cdp.client.api.smart_contracts_api import SmartContractsApi
from cdp.client.api.stake_api import StakeApi
from cdp.client.api.trades_api import TradesApi
from cdp.client.api.transaction_history_api import TransactionHistoryApi
from cdp.client.api.transfers_api import TransfersApi
from cdp.client.api.users_api import UsersApi
from cdp.client.api.validators_api import ValidatorsApi
from cdp.client.api.wallet_stake_api import WalletStakeApi
from cdp.client.api.wallets_api import WalletsApi
from cdp.client.api.webhooks_api import WebhooksApi

Loading
Loading