Skip to main content

4. Connect Freighter Wallet

Signing Transactions with Freighter‚Äč

If you're building a JS dapp, easily sign Soroban transactions using the Freighter browser extension and its corresponding client library @stellar/freighter-api:

  1. Install the Freighter browser extension.

  2. Create a keypair or import an existing account using a mnemonic phrase to complete setup.

  3. Next, switch to Experimental Mode to enable the Soroban SDK. In the extension, click the gear in the lower right corner and then navigate to Preferences. Toggle on Experimental Mode.

  4. Now, you can use the signTransaction method from @stellar/freighter-api in your dapp to sign Soroban XDR's using the account in Freighter.

Upon calling signTransaction, Freighter will open and prompt the user to sign the transaction. Approving the transaction will return the signed XDR to the requesting dapp.