-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 40c366a
Showing
6 changed files
with
4,593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.parcel-cache/ | ||
dist/ | ||
node_modules/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.
40c366a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
claimlink-gateway – ./
claimlink-gateway-git-main-openventures.vercel.app
claimlink-gateway.vercel.app
claimlink-gateway-openventures.vercel.app