Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validation.mdx #93

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ true
```

#### onValidationRequired callback

The `onValidationRequired` callback is triggered when a session validation is required. This can happen when a user tries to perform an action that requires validation, such as sending a transaction or signing a message. It determines whether the session validation should be triggered or not. If the callback returns `true`, the session validation is triggered. If it returns `false`, the action is cancelled.
### **Control Session Validation**
The **`onValidationRequired`** callback is used to determine the need for session validation during actions like sending transactions or signing messages. If the callback returns **`true`**, it triggers session validation. If it returns **`false`**, the related action is cancelled. This mechanism ensures that only validated sessions can proceed with sensitive operations.

```ts
const tx = await waas.sendERC20({
Expand Down Expand Up @@ -79,9 +79,8 @@ await waas.sendTransaction({ chainId: 1 }, { to: "0x...", value: "1" });
Session has been triggered for validation
```

## Automatic session validation

Session validation is automatic when certain actions requiring validation are performed. This can be managed using the `onValidationRequired` hook.
## Manage Automatic session validation
Automatic session validation occurs during actions that require validation. Manage this process using the onValidationRequired hook.

```ts
const tx = await waas.sendTransaction({
Expand Down