Skip to content
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 python/coinbase-agentkit/changelog.d/882.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed polygon network details
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
optimism,
optimism_sepolia,
polygon,
polygon_mumbai,
polygon_amoy,
sepolia,
)
from .network import (
Expand All @@ -30,6 +30,6 @@
"base",
"arbitrum",
"optimism",
"polygon_mumbai",
"polygon_amoy",
"polygon",
]
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,20 @@ class Chain(BaseModel):
},
)

polygon_mumbai = Chain(
id="80001",
name="Polygon Mumbai",
native_currency={"name": "MATIC", "symbol": "MATIC", "decimals": 18},
polygon_amoy = Chain(
id="80002",
name="Polygon Amoy",
native_currency={"name": "POL", "symbol": "POL", "decimals": 18},
rpc_urls={
"default": {
"http": ["https://rpc.ankr.com/polygon_mumbai"],
"http": ["https://rpc-amoy.polygon.technology"],
},
},
block_explorers={
"default": {
"name": "PolygonScan",
"url": "https://mumbai.polygonscan.com",
"api_url": "https://api-testnet.polygonscan.com/api",
"url": "https://amoy.polygonscan.com/",
"api_url": "https://api.etherscan.io/v2/api",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"api_url": "https://api.etherscan.io/v2/api",
"api_url": "https://api-amoy.polygonscan.com/api",

},
},
contracts={
Expand All @@ -347,7 +347,7 @@ class Chain(BaseModel):
"default": {
"name": "PolygonScan",
"url": "https://polygonscan.com",
"api_url": "https://api.polygonscan.com/api",
"api_url": "https://api.etherscan.io/v2/api",
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert

},
},
contracts={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
optimism,
optimism_sepolia,
polygon,
polygon_mumbai,
polygon_amoy,
sepolia,
)

Expand All @@ -27,7 +27,7 @@ class Network(BaseModel):
"1": "ethereum-mainnet",
"11155111": "ethereum-sepolia",
"137": "polygon-mainnet",
"80001": "polygon-mumbai",
"80002": "polygon-amoy",
"8453": "base-mainnet",
"84532": "base-sepolia",
"42161": "arbitrum-mainnet",
Expand All @@ -46,7 +46,7 @@ class Network(BaseModel):
"ethereum-mainnet": mainnet,
"ethereum-sepolia": sepolia,
"polygon-mainnet": polygon,
"polygon-mumbai": polygon_mumbai,
"polygon-amoy": polygon_amoy,
"base-mainnet": base,
"base-sepolia": base_sepolia,
"arbitrum-mainnet": arbitrum,
Expand Down
5 changes: 5 additions & 0 deletions typescript/.changeset/neat-tables-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coinbase/agentkit": patch
---

Updated polygon network apiUrl for both mainnet and amoy
6 changes: 3 additions & 3 deletions typescript/agentkit/src/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
base,
arbitrum,
optimism,
polygonMumbai,
polygonAmoy,
polygon,
} from "viem/chains";
import * as chains from "viem/chains";
Expand All @@ -20,7 +20,7 @@ export const CHAIN_ID_TO_NETWORK_ID: Record<number, string> = {
1: "ethereum-mainnet",
11155111: "ethereum-sepolia",
137: "polygon-mainnet",
80001: "polygon-mumbai",
80002: "polygon-amoy",
8453: "base-mainnet",
84532: "base-sepolia",
42161: "arbitrum-mainnet",
Expand Down Expand Up @@ -49,7 +49,7 @@ export const NETWORK_ID_TO_VIEM_CHAIN: Record<string, Chain> = {
"ethereum-mainnet": mainnet,
"ethereum-sepolia": sepolia,
"polygon-mainnet": polygon,
"polygon-mumbai": polygonMumbai,
"polygon-amoy": polygonAmoy,
"base-mainnet": base,
"base-sepolia": baseSepolia,
"arbitrum-mainnet": arbitrum,
Expand Down
Loading