Sign authorization entries
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.
Guides in this category:
📄️ Connect to the Testnet
1. Install the Freighter browser extension.
📄️ Enable Soroban tokens
With a funded Stellar account, you can now add Soroban tokens to your Freighter wallet.
📄️ Integrate Freighter with a React dapp
Wallets are an essential part of any dapp. They allow users to interact with the blockchain and sign transactions. In this section, you'll learn how to integrate the Freighter wallet into your React dapps.
📄️ As a dapp developer, prompt Freighter to sign transactions
If you're building a JS dapp, easily sign Soroban transactions using the Freighter browser extension and its corresponding client library @stellar/freighter-api:
📄️ Send Soroban token payments
Once you have added a Soroban token to your Freighter wallet, you can now send a payment of that token directly from Freighter.
📄️ Sign authorization entries
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.
📄️ Sign Soroban XDRs
With a funded Testnet account, you can now sign Soroban XDRs using dApps that are integrated with Freighter. An example of an integrated dApp is Stellar's Laboratory.