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:
Install the Freighter browser extension.
Create a keypair or import an existing account using a mnemonic phrase to complete setup.
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 onExperimental Mode
.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.