| title | Sign authorization entries |
|---|---|
| hide_table_of_contents | true |
| description | Use Freighter's API to sign an authorization entry |
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.