sidebar_position | title | description | sidebar_custom_props | ||||||
---|---|---|---|---|---|---|---|---|---|
70 |
Freighter Wallet |
Freighter is a browser extension that can sign Soroban transactions. |
|
:::danger These are not the droids you're looking for
This page has been migrated to the Stellar Developers documentation. Please click here for the most up-to-date information
:::
Freighter is a browser extension wallet provided by the Stellar Development Foundation. It provides users a way to interact with Soroban tokens directly from the web browser.
-
Install the Freighter browser extension.
-
Create a keypair or import an existing account using a mnemonic phrase to complete setup.
-
Next, switch to Testnet or Futurenet. Testnet is available from the network dropdown. To add Futurenet, go to Settings > Network Settings > Add a custom network. Here you can add the following Futurenet settings:
- Horizon RPC URL: https://horizon-futurenet.stellar.org
- Soroban RPC URL: https://rpc-futurenet.stellar.org:443
- Passphrase: Test SDF Future Network ; October 2022
- Friendbot URL: https://friendbot-futurenet.stellar.org/
- If your account does not exist on the selected network, Freighter will prompt you to fund it the account using Friendbot. Alternatively, you can do so in the Stellar Laboratory.
With a funded Testnet or Futurenet account, you can now add Soroban tokens to your Freighter wallet.
-
On the Freighter account screen, click this
Manage Assets
button at the bottom of the screen. -
You will now see a button to
Add Soroban token
at the bottom of the screen. Click thisAdd Soroban token
button. -
On the next screen, enter the Token ID of the token you want to add to Freighter and click
Add New Token
. -
You will now see your token's balance on Freighter's account page. Clicking on the balance will show a history of payments sent using this token.
Once you have added a Soroban token to your Freighter wallet, you can now send a payment of that token directly from Freighter.
-
On the Freighter account screen, click the
Send Payment
icon in the upper right of the screen. -
Enter a recipient public key. Click
Continue
. -
Select your token from the asset dropdown at the bottom of the screen and enter a token amount. Click
Continue
. -
Enter a memo (optional). Click
Review Send
. -
Review the details of your payment. Click
Send
.
With a funded Testnet or Futurenet account, you can now sign Soroban XDRs using dApps that are integrated with Freighter. An example of an integrated dApp is Stellar's Laboratory.
-
On the Lab's transaction signer, enter a Soroban XDR into the form field.
-
Click
Sign with Freighter
. -
Freighter will open with the details of the XDR. Click
Approve
to sign orReject
to dismiss without a signature. -
If approved, Freighter will transmit a signed XDR back to the Lab.
If you're building a JS dapp, easily sign Soroban transactions using the Freighter browser extension and its corresponding client library @stellar/freighter-api:
-
Follow the setup instructions above.
-
Now, you can use the
signTransaction
method from@stellar/freighter-api
in your dapp to sign Soroban XDRs 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.
In order to take advantage of contract authorization, you can use Freighter's API to sign an authorization entry. A good example of how signing an authorization entry works can be found in the authorizeEntry
helper of
stellar-sdk
.
Like in the helper, you can construct a HashIdPreimageSorobanAuthorization
and use the xdr representation of that structure to call await freighterApi.signAuthEntry(preimageXdr)
. This call will return a Buffer
of the signed hash of the HashIdPreimageSorobanAuthorization
passed in, which can then be used to submit to the network during a contract authorization workflow.
For a full example of how to use contract authorization, the scaffold-soroban demo for an atomic swap makes use of both contract auth and Freighter's signAuthEntry
API.