Skip to content
Open
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
6 changes: 6 additions & 0 deletions .changeset/add-radius-network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'mcpay': minor
'@mcpay/app': minor
---

Add Radius Network and Radius Testnet to the network registry and signer chain mapping. Bumps viem to ^2.48.0 to pick up the bundled Radius chain definitions.
7 changes: 4 additions & 3 deletions apps/app/src/lib/client/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { metaMask, coinbaseWallet } from 'wagmi/connectors'
import { http, createConfig, createStorage } from 'wagmi'
import { baseSepolia, seiTestnet } from 'wagmi/chains'
import { baseSepolia, radiusTestnet, seiTestnet } from 'wagmi/chains'

export const wagmiConfig = createConfig({
chains: [baseSepolia, seiTestnet],
chains: [baseSepolia, radiusTestnet, seiTestnet],
connectors: [
metaMask({
dappMetadata: {
Expand All @@ -25,6 +25,7 @@ export const wagmiConfig = createConfig({
: undefined,
transports: {
[baseSepolia.id]: http(),
[radiusTestnet.id]: http(),
[seiTestnet.id]: http(),
},
})
6 changes: 5 additions & 1 deletion apps/app/src/lib/client/signer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Account, type Chain } from 'viem'
import { createWalletClient, custom, publicActions } from 'viem'
import { base, baseSepolia, avalancheFuji, sei, seiTestnet, polygon, polygonAmoy } from 'viem/chains'
import { base, baseSepolia, avalancheFuji, sei, seiTestnet, polygon, polygonAmoy, radius, radiusTestnet } from 'viem/chains'

// Create a wallet client that signs using the injected browser provider (e.g., MetaMask, Coinbase Wallet)
// This ensures signing happens via the user's wallet, not a public RPC
Expand All @@ -24,6 +24,10 @@ function getChainFromNetwork(network: string | undefined): Chain {
return polygon
case 'polygon-amoy':
return polygonAmoy
case 'radius':
return radius
case 'radius-testnet':
return radiusTestnet
default:
throw new Error(`Unsupported network: ${network}`)
}
Expand Down
102 changes: 95 additions & 7 deletions apps/app/src/lib/commons/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ export type UnifiedNetwork =
| 'solana-mainnet'
| 'solana-devnet'
| 'near-mainnet'
| 'near-testnet';
| 'near-testnet'
| 'radius'
| 'radius-testnet';

export type EVMNetwork = Extract<UnifiedNetwork,
| 'base-sepolia'
| 'base'
export type EVMNetwork = Extract<UnifiedNetwork,
| 'base-sepolia'
| 'base'
| 'sei-testnet'
| 'avalanche-fuji'
| 'avalanche'
| 'avalanche-fuji'
| 'avalanche'
| 'iotex'
| 'ethereum'
| 'ethereum-sepolia'
| 'polygon'
| 'arbitrum'>;
| 'arbitrum'
| 'radius'
| 'radius-testnet'>;

export type SolanaNetwork = Extract<UnifiedNetwork, 'solana-mainnet' | 'solana-devnet'>;
export type NearNetwork = Extract<UnifiedNetwork, 'near-mainnet' | 'near-testnet'>;
Expand Down Expand Up @@ -755,6 +759,90 @@ export const UNIFIED_NETWORKS: Record<UnifiedNetwork, NetworkConfig> = {
},
},

// RADIUS TESTNET
'radius-testnet': {
name: 'Radius Testnet',
chainId: 72344,
architecture: 'evm',
isTestnet: true,
isSupported: true,
nativeCurrency: {
name: 'Radius USD',
symbol: 'RUSD',
decimals: 18,
},
rpcUrls: ['https://rpc.testnet.radiustech.xyz'],
blockExplorerUrls: ['https://testnet.radiustech.xyz'],
iconUrl: '/networks/radius.svg',
cdpSupported: false,
// TODO: flip to true once x402 npm ships with Radius defaults
// (x402-foundation/x402#2038 merged 2026-05-07; awaiting next release)
x402Supported: false,
tokens: {
'0x0000000000000000000000000000000000000000': {
symbol: 'RUSD',
name: 'Radius USD',
decimals: 18,
isNative: true,
isStablecoin: false,
verified: true,
verificationSource: 'Radius Network Official',
},
'0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb': {
symbol: 'SBC',
name: 'Stablecoin (Brale)',
decimals: 6,
address: '0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb',
isNative: false,
isStablecoin: true,
verified: true,
verificationSource: 'Brale / Radius Official',
},
},
},

// RADIUS MAINNET
'radius': {
name: 'Radius',
chainId: 723487,
architecture: 'evm',
isTestnet: false,
isSupported: true,
nativeCurrency: {
name: 'Radius USD',
symbol: 'RUSD',
decimals: 18,
},
rpcUrls: ['https://rpc.radiustech.xyz'],
blockExplorerUrls: ['https://network.radiustech.xyz'],
iconUrl: '/networks/radius.svg',
cdpSupported: false,
// TODO: flip to true once x402 npm ships with Radius defaults
// (x402-foundation/x402#2038 merged 2026-05-07; awaiting next release)
x402Supported: false,
tokens: {
'0x0000000000000000000000000000000000000000': {
symbol: 'RUSD',
name: 'Radius USD',
decimals: 18,
isNative: true,
isStablecoin: false,
verified: true,
verificationSource: 'Radius Network Official',
},
'0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb': {
symbol: 'SBC',
name: 'Stablecoin (Brale)',
decimals: 6,
address: '0x33ad9e4BD16B69B5BFdED37D8B5D9fF9aba014Fb',
isNative: false,
isStablecoin: true,
verified: true,
verificationSource: 'Brale / Radius Official',
},
},
},

// NEAR TESTNET
'near-testnet': {
name: 'NEAR Testnet',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"overrides": {
"ai": "5.0.0-beta.20",
"@modelcontextprotocol/sdk": "1.18.2",
"viem": "2.37.13"
"viem": "^2.48.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@modelcontextprotocol/sdk": "1.18.2",
"commander": "^12.1.0",
"dotenv": "^16.5.0",
"viem": "2.37.13",
"viem": "^2.48.0",
"x402": "^0.6.5",
"x402-fetch": "^0.6.0",
"zod": "^3.25.76",
Expand Down
6 changes: 5 additions & 1 deletion packages/js-sdk/src/utils/signer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Account, Chain, Client, PublicActions, RpcSchema, Transport, WalletActions } from "viem";
import { base, baseSepolia, avalancheFuji, sei, seiTestnet, polygon, polygonAmoy } from "viem/chains";
import { base, baseSepolia, avalancheFuji, sei, seiTestnet, polygon, polygonAmoy, radius, radiusTestnet } from "viem/chains";
import { createWalletClient, http } from "viem";
import { publicActions } from "viem";

Expand Down Expand Up @@ -35,6 +35,10 @@ function getChainFromNetwork(network: string | undefined): Chain {
return polygon;
case "polygon-amoy":
return polygonAmoy;
case "radius":
return radius;
case "radius-testnet":
return radiusTestnet;
default:
throw new Error(`Unsupported network: ${network}`);
}
Expand Down
Loading