Skip to content

Commit

Permalink
docs: add pre-auth readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed Nov 15, 2024
1 parent 1a40691 commit 84b90e9
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions packages/dapp-toolkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ Use our [CLI tool](https://github.com/radixdlt/create-radix-dapp) to scaffold a
npx create-radix-dapp@latest
```

## Using `create-radix-dapp`

You can easily start experimenting with Radix dApp Toolkit and various frameworks by using our [CLI tool](https://github.com/radixdlt/create-radix-dapp) to scaffold a new project. Just paste following command into your terminal and it will walk you through all required steps!

```bash
npx create-radix-dapp@latest
```

# Usage

## Getting started
Expand Down Expand Up @@ -492,6 +484,26 @@ const transactionIntentHash = result.value.transactionIntentHash

</details>

## Preauthorization Requests

It is very similar to a transaction request, but it describes only a part of a final transaction – specifically the part that the user cares about, such as a swap they wish to perform within certain acceptable bounds. The pre-authorization is signed and returned to the dApp, which can then include it in a full transaction. A time bound is put on the pre-authorization, so the user knows for how long their pre-authorization is usable.

Creation of preauthorization request object is abstracted away into `SubintentRequestBuilder`. You can set exipration date either for "delay after signed" `.setExpiration('afterDelay', 3600)` or at a certain date by using `.setExpiration('atTime', 1234567890)`

**Example:**
```typescript
const result = await dAppToolkit.walletApi.sendPreAuthorizationRequest(
SubintentRequestBuilder()
.manifest(subintentManifest)
.setExpiration(
'afterDelay',
3600,
)
// .addBlobs('blob1', 'blob2')
.message('This is a message')
)
```

# ROLA (Radix Off-Ledger Authentication)

ROLA is method of authenticating something claimed by the user connected to your dApp with the Radix Wallet. It uses the capabilities of the Radix Network to make this possible in a way that is decentralized and flexible for the user.
Expand Down

0 comments on commit 84b90e9

Please sign in to comment.