Skip to content

feat(sdk): add futurenet and standalone network config - #1008

Closed
arkhindi12 wants to merge 1 commit into
conduit-protocol:mainfrom
arkhindi12:feat/981-network-config
Closed

arkhindi12 wants to merge 1 commit into
conduit-protocol:mainfrom
arkhindi12:feat/981-network-config

Conversation

@arkhindi12

@arkhindi12 arkhindi12 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #981.

What this adds

NETWORK_CONFIG — one entry per network the SDK can target, with the RPC URL,
the passphrase the SDK signs with, the explorer bases and the published
contract IDs.

import { NETWORK_CONFIG, contractIdFor } from './constants.js';

const { rpcUrl, networkPassphrase } = NETWORK_CONFIG.standalone;
network RPC passphrase
mainnet soroban-mainnet.stellar.org Networks.PUBLIC
testnet soroban-testnet.stellar.org Networks.TESTNET
futurenet soroban-futurenet.stellar.org Networks.FUTURENET
standalone localhost:8000/soroban/rpc Networks.STANDALONE

Explorer entries are EXPLORER_URLS itself, not copies of the strings, and
standalone is null because no public explorer follows a network that only
exists on your machine.

About the contract IDs — please read

The issue asks for predefined contract IDs on futurenet/standalone. I did not
add any, deliberately: StreamFi contract IDs are derived per deployment from
sha256(networkPassphrase + ContractIdPreimageFromAddress(deployer, salt)),
so a hardcoded ID would point at somebody else's contract — worse than none.

Instead contracts is null per role and contractIdFor() throws with the
next step spelled out:

No canonical factory contract ID is published for the 'futurenet' network —
StreamFi contract IDs are generated per deployment. Deploy the contracts and
pass the factory address explicitly, e.g. new ConduitClient({ network:
'futurenet', factoryAddress: '<your factory contract ID>' }).

If you would rather have a mutable registry that deployments write into, say
so and I will add it — but I did not want to ship an address that looks
authoritative and is not.

Tests

src/tests/network-config.test.ts — 7 cases: all four networks present, the
passphrases match what the SDK signs with, futurenet/standalone point at their
own RPC, explorer entries equal EXPLORER_URLS, no invented contract IDs, the
error message is actionable, and a published ID is returned when one exists.

Test Files  1 passed (1)
     Tests  7 passed (7)

Rebased on main after #1004. npx tsc --noEmit and this PR's test suite are green on the current head.

…col#981)

Adds NETWORK_CONFIG with RPC URL, passphrase, explorer bases and contract
IDs for all four networks. Explorer entries reuse EXPLORER_URLS rather than
duplicating the strings.

No contract ID is hardcoded: StreamFi contract IDs are derived per
deployment from the deployer address and salt, so publishing one would
point at somebody else's contract. contractIdFor() therefore throws with
instructions instead of returning an empty string that fails later inside
a transaction.
@arkhindi12

Copy link
Copy Markdown
Contributor Author

Closing this — the issue was resolved by #1015, so this PR is superseded. Thanks for the review queue space.

@arkhindi12 arkhindi12 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

src/constants.ts: export contract IDs for Stellar Futurenet and local standalone networks

1 participant