Skip to content

Commit

Permalink
Merge pull request #190 from radixdlt/add-utils
Browse files Browse the repository at this point in the history
code: add utils
  • Loading branch information
xstelea authored May 7, 2024
2 parents 7aa6a6f + 2b069d1 commit 5fa299c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/dapp-toolkit/src/helpers/generate-rola-challenge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const generateRolaChallenge = () =>
[...globalThis.crypto.getRandomValues(new Uint8Array(32))]
.map((x) => x.toString(16).padStart(2, '0'))
.join('')
2 changes: 2 additions & 0 deletions packages/dapp-toolkit/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ export * from './stringify'
export * from './typed-error'
export * from './unwrap-observable'
export * from './validate-wallet-response'
export * from './generate-rola-challenge'
export * from './parse-rola-proof'
4 changes: 4 additions & 0 deletions packages/dapp-toolkit/src/helpers/parse-rola-proof.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { safeParse } from 'valibot'
import { Proof } from '../schemas'

export const parseRolaProof = (proof: Proof) => safeParse(Proof, proof)

0 comments on commit 5fa299c

Please sign in to comment.