Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
openventures committed Jan 13, 2023
0 parents commit 40c366a
Show file tree
Hide file tree
Showing 6 changed files with 4,593 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.parcel-cache/
dist/
node_modules/
Binary file added favicon.ico
Binary file not shown.
24 changes: 24 additions & 0 deletions gateway.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const PATH_REGEX = /^\/(?:([a-zA-Z0-9-]+)\/)?(\d+)$/;

function showError(msg: string) {
document.getElementById("msg").textContent = msg;
}

const onLoad = () => {
const path = window.location.pathname;
if (!PATH_REGEX.test(path)) {
return showError("Invalid link");
}
const parts = PATH_REGEX.exec(path);
const chainID = parts[1] ?? "wax-mainnet";
const linkID = parseInt(parts[2], 10);

const urlParams = new URLSearchParams(location.search);

const key = urlParams.get("key") ?? "";

const target = `https://wax.atomichub.io/trading/link/${chainID}/${linkID}?key=${key}`;
window.location.href = target;
};

document.addEventListener("DOMContentLoaded", onLoad);
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>WAX Claim Link by cryptomonKeys</title>
<script src="gateway.ts"></script>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<span id="msg"></span>
</body>
</html>
Loading

1 comment on commit 40c366a

@vercel
Copy link

@vercel vercel bot commented on 40c366a Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.