Skip to content

Commit

Permalink
Merge pull request #258 from radixdlt/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx authored Sep 20, 2024
2 parents 2309d51 + 3ee6308 commit ab6e22a
Show file tree
Hide file tree
Showing 22 changed files with 970 additions and 191 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
parse_json: true
- name: Run Snyk to check for code vulnerabilities
uses: RDXWorks-actions/snyk-actions/node@master
continue-on-error: true
with:
args: --all-projects --org=${{ env.SNYK_PROJECTS_ORG_ID }} --severity-threshold=high
command: code test
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ yarn-error.log*

.envrc

examples/cdn/radix-dapp-toolkit.bundle.umd.cjs

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
31 changes: 31 additions & 0 deletions examples/cdn/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RDT from CDN</title>
</head>
<body>
<style>
header {
display: flex;
justify-content: center;
}
</style>
<header><radix-connect-button /></header>
<div id="app"></div>

<script src="./radix-dapp-toolkit.bundle.umd.cjs"></script>
<script>
const rdt = window.RDT.RadixDappToolkit({
dAppDefinitionAddress:
'account_rdx12y7md4spfq5qy7e3mfjpa52937uvkxf0nmydsu5wydkkxw3qx6nghn',
networkId: RDT.RadixNetwork.Mainnet,
applicationName: 'Radix Web3 dApp',
applicationVersion: '1.0.0',
logger: window.RDT.Logger(1),
})
console.log(rdt);
</script>
</body>
</html>
7 changes: 6 additions & 1 deletion examples/simple-dapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
<title>Simple dApp</title>
</head>
<body>
<header><radix-connect-button /></header>
<style>
.header {
backdrop-filter: blur(10px);
}
</style>
<header class="header"><radix-connect-button /></header>
<div id="app"></div>

<script type="module" src="/src/main.ts"></script>
Expand Down
10 changes: 5 additions & 5 deletions examples/simple-dapp/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ const gatewayApi = GatewayApiClient.initialize(
dAppToolkit.gatewayApi.clientConfig,
)

dAppToolkit.walletApi.provideChallengeGenerator(async () => {
await new Promise((resolve) => setTimeout(resolve, 1000))
return generateRolaChallenge()
})
dAppToolkit.walletApi.provideChallengeGenerator(async () => generateRolaChallenge())

dAppToolkit.walletApi.setRequestData(DataRequestBuilder.persona().withProof())
dAppToolkit.walletApi.setRequestData(
DataRequestBuilder.persona().withProof(),
DataRequestBuilder.accounts().atLeast(1),
)

gatewayConfig.innerHTML = `
[Gateway]
Expand Down
1 change: 0 additions & 1 deletion examples/simple-dapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ fs.writeFileSync(
path.resolve(__dirname, 'public', '.well-known', 'radix.json'),
JSON.stringify(
{
callbackPath: process.env.VITE_RETURN_URL,
dApps: [
{
dAppDefinitionAddress: process.env.DAPP_DEFINITION_ADDRESS,
Expand Down
Loading

0 comments on commit ab6e22a

Please sign in to comment.