Skip to content

Commit

Permalink
Merge pull request #175 from radixdlt/RDT-201
Browse files Browse the repository at this point in the history
fix: don't request persona proof when updating data
  • Loading branch information
dawidsowardx authored Jan 30, 2024
2 parents 8dcd6bc + 74b2517 commit a4b5de5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 262 deletions.
19 changes: 14 additions & 5 deletions examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@ import {
RadixDappToolkit,
DataRequestBuilder,
RadixNetwork,
createLogger,
} from '../src/index.ts'

import { Buffer } from 'buffer'
document.querySelector('#app').innerHTML = `
<radix-connect-button />
`

const rdt = RadixDappToolkit({
dAppDefinitionAddress: '',
dAppDefinitionAddress:
'account_tdx_2_12xe9tn7ns389ervyuwxkhyyrscfyjug00y8a4lhk5hwt4lfq9jarft',
networkId: RadixNetwork.Stokenet,
useCache: false,
logger: createLogger(),
})

rdt.walletApi.setRequestData(DataRequestBuilder.accounts().atLeast(1))
rdt.walletApi.setRequestData(
DataRequestBuilder.persona().withProof(),
DataRequestBuilder.accounts().atLeast(1),
DataRequestBuilder.personaData().fullName().emailAddresses()
)

rdt.walletApi.walletData$.subscribe((state) => {
console.log(state)
})

rdt.walletApi.provideChallengeGenerator(async () =>
Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString('hex')
rdt.walletApi.provideChallengeGenerator(() =>
Promise.resolve(
Buffer.from(crypto.getRandomValues(new Uint8Array(32))).toString('hex')
)
)
Loading

0 comments on commit a4b5de5

Please sign in to comment.