Skip to content
Merged
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
16 changes: 11 additions & 5 deletions apps/web/lib/stellar-wallet.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { FreighterModule, StellarWalletsKit, WalletNetwork } from "@creit.tech/stellar-wallets-kit";
import {
FreighterModule,
LobstrModule,
StellarWalletsKit,
WalletNetwork,
} from "@creit.tech/stellar-wallets-kit";
import { env } from "./env";

/**
* Freighter only for now (Stellar Wallets Kit supports more, but auth-entry/transaction-signing
* parity across wallets isn't independently verified here — see docs/architecture.md §2's
* "verify at build time" note before adding more modules).
* Freighter and the LOBSTR browser extension. Stellar Wallets Kit supports more, but
* transaction-signing parity across wallets isn't independently verified here — see
* docs/architecture.md §2's "verify at build time" note before adding more modules. LOBSTR's
* extension has no `signAuthEntry`, which is fine: open-intent.ts signs the whole transaction.
*
* # The network is derived, never defaulted
*
Expand Down Expand Up @@ -32,6 +38,6 @@ export function createStellarWalletKit(): StellarWalletsKit {
return new StellarWalletsKit({
network,
selectedWalletId: "freighter",
modules: [new FreighterModule()],
modules: [new FreighterModule(), new LobstrModule()],
});
}
11 changes: 8 additions & 3 deletions apps/web/lib/wallets/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ import type { Connection, WalletEntry } from "./types";
* The Stellar wallets this app will sign with.
*
* Deliberately a short list. Every transfer and every admin call carries a Soroban authorization
* tree that the wallet must sign entry by entry, and signing parity across wallets has only been
* checked for Freighter (see stellar-wallet.ts). Listing a wallet here is a promise that money
* tree that the wallet must sign entry by entry, and signing parity across wallets has been
* checked for Freighter (see stellar-wallet.ts); LOBSTR is listed on the strength of its extension's
* `signTransaction`, which is the only call open-intent.ts needs, and still wants a real transfer. Listing a wallet here is a promise that money
* moves correctly through it, so it is added after a real transfer has gone through it, not
* because the kit happens to support it.
*/
export const VERIFIED_STELLAR_WALLETS: ReadonlyArray<{
id: string;
name: string;
installUrl: string;
}> = [{ id: "freighter", name: "Freighter", installUrl: "https://www.freighter.app" }];
}> = [
{ id: "freighter", name: "Freighter", installUrl: "https://www.freighter.app" },
// Browser extension only. LOBSTR's phone app is not reachable through this module.
{ id: "lobstr", name: "LOBSTR", installUrl: "https://lobstr.co/signer-extension" },
];

export async function stellarEntries(kit: StellarWalletsKit): Promise<WalletEntry[]> {
const supported = await kit.getSupportedWallets();
Expand Down
Loading