Sprint: 1 — Foundations · Area: wallet · Size: 1.5 d · Depends on: —
Source: docs/SPRINT-1-ISSUES.md #1
Context
Today frontend/lib/wallet-context.tsx calls @stellar/freighter-api directly and hard-codes the testnet passphrase. We need an abstraction that also supports LOBSTR (via WalletConnect). The chosen library is @creit.tech/stellar-wallets-kit.
Scope
- Add
@creit.tech/stellar-wallets-kit to p2p-safe-swap/package.json.
- Refactor
WalletProvider / useWallet to use the kit internally while keeping the exact same public API (publicKey, network, isConnecting, connect, disconnect, signTransaction). No downstream call sites should need changes.
- Read the network from
NEXT_PUBLIC_STELLAR_NETWORK (testnet | mainnet) and pass the correct passphrase to the kit.
- Remove the direct
@stellar/freighter-api import from wallet-context.tsx. Keep the dep in package.json only if the kit needs it transitively.
Acceptance
Sprint: 1 — Foundations · Area: wallet · Size: 1.5 d · Depends on: —
Source:
docs/SPRINT-1-ISSUES.md#1Context
Today
frontend/lib/wallet-context.tsxcalls@stellar/freighter-apidirectly and hard-codes the testnet passphrase. We need an abstraction that also supports LOBSTR (via WalletConnect). The chosen library is@creit.tech/stellar-wallets-kit.Scope
@creit.tech/stellar-wallets-kittop2p-safe-swap/package.json.WalletProvider/useWalletto use the kit internally while keeping the exact same public API (publicKey,network,isConnecting,connect,disconnect,signTransaction). No downstream call sites should need changes.NEXT_PUBLIC_STELLAR_NETWORK(testnet|mainnet) and pass the correct passphrase to the kit.@stellar/freighter-apiimport fromwallet-context.tsx. Keep the dep inpackage.jsononly if the kit needs it transitively.Acceptance
signedTxXdrstring.NEXT_PUBLIC_STELLAR_NETWORKbetweentestnetandmainnetflips the passphrase used to sign.wallet-context.tsxand the env example.