-
Notifications
You must be signed in to change notification settings - Fork 31
feat: implemented runtime network switching #276
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tansu canceled.
|
✅ Deploy Preview for staging-tansu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Resolved conflict in Navbar.astro to include NetworkPicker - Updated with latest responsive modal and other improvements from main
tupui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems unrelated no?
tupui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dapp/src/utils/networks.ts
Outdated
| export function getNetworkByName(network: NetworkName) { | ||
| return networks[network]; | ||
| } | ||
|
|
||
| export function getNetworkConfig() { | ||
| return networks[getCurrentNetwork()]; | ||
| } | ||
|
|
||
| export function getNetwork(network: NetworkName) { | ||
| return networks[network]; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need 3 functions doing the same thing.
| const config = getNetworkConfig(); | ||
| const defaultFee = "100"; | ||
| const defaultTimeout = 30; | ||
| const simulationAccount = "GCMFQP44AR32S7IRIUKNOEJW5PNWOCLRHLQWSHUCSV4QZOMUXZOVA7Q2"; // From tansu.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing from import.meta.env.PUBLIC_TANSU_OWNER_ID? We need this address. This is helpful for fees, etc.
| tansu_contract: import.meta.env.PUBLIC_TANSU_CONTRACT_ID, | ||
| domain_contract: import.meta.env.PUBLIC_SOROBAN_DOMAIN_CONTRACT_ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make new env variables for these otherwise that does not make sense. Contracts have diff addresses on mainnet and testnet.
| return createWalletKit(); | ||
| } | ||
|
|
||
| export const kit = getKit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really dynamic then?
tupui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made another pass. Please answer the conversations as well. Let me close the threads myself.
|
Hey @davedumto do you want to continue? |
|
Hi there, I could but is it paid now?
…On Sun, Nov 30, 2025 at 7:04 PM Pamphile Roy ***@***.***> wrote:
*tupui* left a comment (tupui/soroban-versioning#276)
<#276 (comment)>
Hey @davedumto <https://github.com/davedumto> do you want to continue?
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A25EILX4OTMDG7F7QULG66T37MWSHAVCNFSM6AAAAACH6JK246VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJSHE4DEMBXGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|




Add Network Picker for Unified Deployment
closes #247
Problem
Previously, we had 2 separate deployments (testnet and mainnet) which created maintenance overhead and limited our ability to test UI changes across networks efficiently. Users couldn't easily switch between networks without separate deployment URLs.
Solution
Implemented a unified deployment approach with runtime network selection:
🎯 Key Changes
utils/networks.tsfor all network settings🔧 Technical Implementation
NetworkPicker Component (
src/components/page/network/NetworkPicker.tsx)Network Configuration (
src/utils/networks.ts)Service Updates
stellar-wallets-kit.ts: Dynamic wallet configurationsoroban_domain_sdk.ts: Network-aware domain SDKsoroban_tansu.ts: Dynamic contract client creationDevelopment Proxy (
astro.config.mjs)x-client-nameheader from Stellar SDK🎨 UI/UX Features
✅ Benefits
🧪 Testing
##Video
Screen.Recording.2025-09-30.at.23.55.36.mov