Adapter is PUBNET-only: testnet dapps using the Wallets Kit default modules connect, then fail on first signature
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 57/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- authentication
Research direction
Start with dist/types.mjs and dist/adapter.mjs, then inspect the corresponding source files and tests for Scope, requestAccess(), disconnect(), and selectScopeWithPriority(). Check whether the MetaMask multichain API supports the proposed testnet and futurenet scopes before implementing the change. Done means supported scopes can be selected and revoked correctly while existing callers still default to pubnet, with tests covering network details and signing.
Written by the indexing model from the issue text.
Description
Summary
MetaMaskStellarAdapter only ever knows about stellar:pubnet, so dapps running on testnet or futurenet cannot use it. Because MetaMaskModule is now in the Stellar Wallets Kit's defaultModules() and sep43Modules() (kit 2.7.0+), those dapps don't just miss out — MetaMask appears in the wallet picker, connects, and then fails at the first signing call.
Would you accept a PR adding testnet (and futurenet) scopes?
Why this affects more than one dapp
In @creit.tech/[email protected], esm/sdk/modules/utils.js:
export function defaultModules(opts) {
const modules = [ ..., new MetaMaskModule(), new GhostsigModule() ];
...
}
export function sep43Modules(opts) {
const modules = [ new FreighterModule(), new DcentModule(), new MetaMaskModule(), new GhostsigModule() ];
...
}
Any kit dapp that takes the defaults and runs on testnet — which is most of them during development — now offers MetaMask and breaks on it. The dapp author hasn't opted into anything.
What happens today
On a testnet dapp, in order:
isAvailable()→truefor every visitor with MetaMask installed, so it shows up in the picker.requestAccess()→createSession(Scope.PUBNET), i.e. it opens a mainnet session regardless of the dapp's network.getNetwork()→{ network: 'PUBLIC', networkPassphrase: 'Public Global Stellar Network ; September 2015' }.signTransaction/signMessage/signAuthEntrywith the dapp's testnet passphrase →networkPassphraseToScope()throwsUnknown network passphrase: Test SDF Network ; September 2015, surfacing asUNSUPPORTED_NETWORK (-4).
A dapp that checks getNetwork() at connect time can at least block it, but only after the user has picked MetaMask. A dapp that doesn't check gets the failure at step 4, which reads as the wallet being broken.
Where it's pinned (0.3.0)
dist/types.mjs:
export var Scope;
(function (Scope) {
Scope["PUBNET"] = "stellar:pubnet";
})(Scope || (Scope = {}));
export const NETWORK_PASSPHRASE = {
[Scope.PUBNET]: 'Public Global Stellar Network ; September 2015',
};
export const NETWORK_NAME = {
[Scope.PUBNET]: 'PUBLIC',
};
Plus the two hardcoded call sites in dist/adapter.mjs — createSession(Scope.PUBNET) in requestAccess(), and revokeSession({ scopes: [Scope.PUBNET] }) in disconnect() — and selectScopeWithPriority(), whose name suggests multiple scopes were the intent:
selectScopeWithPriority(session) {
const available = new Set(Object.keys(session?.sessionScopes ?? {}));
return available.has(Scope.PUBNET) ? Scope.PUBNET : undefined;
}
There's also a NOTE in types.mjs that reads like this was known to be unfinished:
NOTE: Confirm these scope values with the MetaMask Stellar snap team before finalizing.
What we'd need
Per CAIP-2 for Stellar, adding stellar:testnet (and stellar:futurenet) to Scope, NETWORK_PASSPHRASE and NETWORK_NAME, then letting the scope be chosen rather than fixed:
requestAccess()taking the desired scope (defaulting toPUBNET, so no behaviour change for current callers)disconnect()revoking whichever scopes the session actually holdsselectScopeWithPriority()honouring its name
Happy to open the PR if the shape is agreeable — the main thing we can't determine from outside is whether the MetaMask multichain API will grant a stellar:testnet scope today, or whether the wallet side needs to land first. If it's the latter, that's useful to know too, and we'll track it.
Our use case, for context
We're ProofBridge, a P2P cross-chain settlement protocol bridging EVM and Stellar. We're on testnet through our current build phase, so this adapter is unusable for us right now — despite being, on capability, the best Stellar wallet integration available to us: it's the only module in the kit implementing signAuthEntry, and its signMessage is proper SEP-53, which several kit modules either stub out or implement non-standardly.
MetaMask holding native Stellar accounts is genuinely significant for a protocol like ours, because it collapses a two-wallet onboarding step (an EVM wallet and a Stellar wallet) into one. We'd like to ship it. Testnet is the only thing in the way.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zapcooking/frontend#946 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WiliamRosa/cosmos-semantic-platform#40 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
liberation-data/drivine#733 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
makecindy/cindy#10062 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day