Skip to content

Commit

Permalink
Add protocol-kit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Dec 2, 2024
1 parent eee807a commit 90eb2a3
Show file tree
Hide file tree
Showing 4 changed files with 9,681 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/reference-sdk-protocol-kit/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"messages": "Messages",
"safe-modules": "Safe Modules",
"safe-guards": "Safe Guards",
"fallback-handler": "Fallback Handler"
"fallback-handler": "Fallback Handler",
"passkeys": "Passkeys"
}
3 changes: 3 additions & 0 deletions pages/reference-sdk-protocol-kit/passkeys/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"createpasskeysigner": "createPasskeySigner"
}
37 changes: 37 additions & 0 deletions pages/reference-sdk-protocol-kit/passkeys/createpasskeysigner.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Tabs } from 'nextra/components'

# `createPasskeySigner`

Creates a new passkey signer using a [WebAuthn credential](https://developer.mozilla.org/en-US/docs/Web/API/Credential).

## Usage

```typescript
const rpcUrl = "https://..."
const credential = window.navigator.credentials.create({ ... })

const passkeySigner = await Safe.createPasskeySigner(credential)

const protocolKit = await Safe.init({
provider: rpcURL,
signer: passkeySigner,
safeAddress
})
```

## Parameters

### `credential`

- **Type**: `Credential`

The WebAuthn credential to use for signing.

## Returns

`Promise<Pick<PasskeyArgType, 'rawId' | 'coordinates'>>`

An object containing the passkey signer that should be stored securely containing:

- `rawId`: The `rawId` of the credential.
- `coordinates`: The coordinates of the credential. The coordinates are used to sign using Safe smart contracts
Loading

0 comments on commit 90eb2a3

Please sign in to comment.