Skip to content

Commit c83dc24

Browse files
committed
feat(PSDK-782): allow users to send sponsored transactions immediately (#73)
1 parent 05910d7 commit c83dc24

16 files changed

+1198
-9
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
- Add `skip_batching` option to `Wallet.transfer` to allow for lower latency gasless transfers.
78
- Add `Webhook.delete_webhook` instance method to delete a webhook instance.
89
- Add `ExternalAddress` derived `Address` class.
910

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pip install cdp-sdk
3737
```
3838

3939
if you prefer to manage dependencies with Poetry:
40+
4041
```bash
4142
poetry add cdp-sdk
4243
```
@@ -155,6 +156,12 @@ print(f"Faucet transaction successfully completed: {usdc_faucet_tx}")
155156
transfer = wallet1.transfer(0.00001, "usdc", wallet3, gasless=True).wait()
156157
```
157158

159+
By default, gasless transfers are batched with other transfers, and might take longer to submit. If you want to opt out of batching, you can set the `skip_batching` option to `True`, which will submit the transaction immediately.
160+
161+
```python
162+
transfer = wallet1.transfer(0.00001, "usdc", wallet3, gasless=True, skip_batching=True).wait()
163+
```
164+
158165
### Listing Transfers
159166

160167
```python
@@ -239,7 +246,9 @@ fetched_wallet.load_seed(file_path)
239246
```
240247

241248
### Creating a Webhook
249+
242250
A webhook is a way to provide other applications with real-time information from the blockchain. When an event occurs on a blockchain address, it can send a POST request to a URL you specify. You can create a webhook to receive notifications about events that occur in your wallet or crypto address, such as when a user makes a transfer.
251+
243252
```python
244253
from cdp.client.models.webhook import WebhookEventType
245254
from cdp.client.models.webhook import WebhookEventFilter
@@ -252,10 +261,13 @@ wh1 = Webhook.create(
252261
)
253262
print(wh1)
254263
```
264+
255265
In the above example, parameter `network_id` is optional, if not provided, the default network is `base-sepolia`. Today we support Base mainnet and Base Sepolia networks.
256266

257267
### Creating a Webhook On A Wallet
268+
258269
A webhook can be attached to an existing wallet to monitor events that occur on the wallet, i.e. all addresses associated with this wallet. A list of supported blockchain events can be found [here](https://docs.cdp.coinbase.com/get-started/docs/webhooks/event-types).
270+
259271
```python
260272
import cdp
261273

@@ -265,9 +277,9 @@ print(wh1)
265277
```
266278

267279
## Examples
280+
268281
Examples, demo apps, and further code samples can be found in the [CDP SDK Python Documentation](https://docs.cdp.coinbase.com/cdp-apis/docs/welcome).
269282

270283
## Contributing
271284

272285
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
273-

cdp/client/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from cdp.client.models.asset import Asset
6161
from cdp.client.models.balance import Balance
6262
from cdp.client.models.broadcast_contract_invocation_request import BroadcastContractInvocationRequest
63+
from cdp.client.models.broadcast_external_transfer_request import BroadcastExternalTransferRequest
6364
from cdp.client.models.broadcast_staking_operation_request import BroadcastStakingOperationRequest
6465
from cdp.client.models.broadcast_trade_request import BroadcastTradeRequest
6566
from cdp.client.models.broadcast_transfer_request import BroadcastTransferRequest
@@ -70,6 +71,7 @@
7071
from cdp.client.models.contract_invocation_list import ContractInvocationList
7172
from cdp.client.models.create_address_request import CreateAddressRequest
7273
from cdp.client.models.create_contract_invocation_request import CreateContractInvocationRequest
74+
from cdp.client.models.create_external_transfer_request import CreateExternalTransferRequest
7375
from cdp.client.models.create_fund_operation_request import CreateFundOperationRequest
7476
from cdp.client.models.create_fund_quote_request import CreateFundQuoteRequest
7577
from cdp.client.models.create_payload_signature_request import CreatePayloadSignatureRequest

0 commit comments

Comments
 (0)