Skip to content

Commit

Permalink
wip: revoke key
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Jan 10, 2025
1 parent f495dd3 commit c6cd76b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function App() {
<Accounts />
<GetCapabilities />
<AuthorizeKey />
<RevokeKey />
<GetKeys />
<SendCalls />
<SendTransaction />
Expand Down Expand Up @@ -309,6 +310,33 @@ function AuthorizeKey() {
)
}

function RevokeKey() {
const [revoked, setRevoked] = useState(false)
return (
<div>
<h3>experimental_revokeKey</h3>
<form
onSubmit={async (e) => {
e.preventDefault()
const formData = new FormData(e.target as HTMLFormElement)
const publicKey = formData.get('publicKey') as `0x${string}`

setRevoked(false)
await porto.provider.request({
method: 'experimental_revokeKey',
params: [{ publicKey }],
})
setRevoked(true)
}}
>
<input name="publicKey" placeholder="Public Key (0x...)" type="text" />
<button type="submit">Revoke Key</button>
</form>
{revoked && <p>Key revoked.</p>}
</div>
)
}

function GetKeys() {
const [result, setResult] = useState<unknown>(null)

Expand Down

0 comments on commit c6cd76b

Please sign in to comment.