Skip to content

Conversation

@phdargen
Copy link
Contributor

@phdargen phdargen commented Sep 5, 2025

Description

Fixes swap api action in python, equivalent to ts (#817)

Tests

Chatbot: python/examples/langchain-cdp-chatbot
Network: Base Mainnet

Prompt: swap 0.1 usdc (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) to 0x4200000000000000000000000000000000000006
-------------------
{"success": true, "transactionHash": "0x54264a593f91c517b2a1c0a196562bb04a9fb41c06a4719437236b8c560af45c", "fromAmount": "0.1", "fromTokenName": "USD Coin", "fromToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "toAmount": "2.2974650441925e-05", "minToAmount": "2.2745482644066e-05", "toTokenName": "Wrapped Ether", "toToken": "0x4200000000000000000000000000000000000006", "slippageBps": 100, "network": "base-mainnet"}
-------------------
The swap was successful! Here are the details:

- **Swapped**: 0.1 USDC
- **Received**: Approximately 0.000022974650441925 Wrapped Ether (WETH)
- **Transaction Hash**: [0x54264a593f91c517b2a1c0a196562bb04a9fb41c06a4719437236b8c560af45c](https://etherscan.io/tx/0x54264a593f91c517b2a1c0a196562bb04a9fb41c06a4719437236b8c560af45c)
-------------------

Checklist

A couple of things to include in your PR for completeness:

  • Added documentation to all relevant README.md files
  • Added a changelog entry

@cb-heimdall
Copy link

cb-heimdall commented Sep 5, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions bot added action provider New action provider example New example agent python labels Sep 5, 2025
@phdargen phdargen marked this pull request as draft September 5, 2025 09:25
@github-actions github-actions bot added documentation Improvements or additions to documentation wallet provider New wallet provider typescript labels Sep 5, 2025
@phdargen phdargen force-pushed the swap-api-py branch 2 times, most recently from 9f13f6a to 48ebbc7 Compare September 5, 2025 14:06
@phdargen phdargen marked this pull request as ready for review September 5, 2025 14:47
@phdargen phdargen changed the title Draft:Swap api py fix:swap api py Sep 5, 2025
Copy link
Contributor

@CarsonRoscoe CarsonRoscoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CarsonRoscoe CarsonRoscoe merged commit 02205c8 into coinbase:main Sep 5, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation example New example agent python typescript wallet provider New wallet provider

Development

Successfully merging this pull request may close these issues.

3 participants