Skip to content

Affiliate updated #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3149c39
Merge pull request #1 from CoNET-project/test
CoNETProject Jan 20, 2025
3b8af17
Merge pull request #2 from CoNET-project/test
CoNETProject Jan 20, 2025
b7ab842
Merge pull request #3 from CoNET-project/test
CoNETProject Jan 20, 2025
6fe8cec
Merge pull request #4 from CoNET-project/test
CoNETProject Jan 25, 2025
3c05bf0
Merge branch 'test'
nicolastmaia Feb 17, 2025
06e6e57
Merge pull request #5 from CoNET-project/test
CoNETProject Feb 18, 2025
87620cc
Merge branch 'test'
nicolastmaia Feb 20, 2025
e48c049
Merge branch 'test'
nicolastmaia Feb 20, 2025
2f2264d
feat: affiliate structure
caiolima-stage Mar 15, 2025
f37f1bf
feat: subscription new structure
caiolima-stage Mar 15, 2025
59407ce
feat: loading ring component
caiolima-stage Mar 15, 2025
54de545
feat: new structures
caiolima-stage Mar 15, 2025
a7adf0c
feat: another adjustments
caiolima-stage Mar 15, 2025
86f76b8
feat: new corrections
caiolima-stage Mar 15, 2025
b1668a9
feat: last adjustments
caiolima-stage Mar 15, 2025
2b3f870
feat: toggle button for test purposes
caiolima-stage Mar 15, 2025
0095980
d
CoNETProject Mar 15, 2025
bdfa471
update
CoNETProject Mar 17, 2025
73c60aa
updated RedeemCode
CoNETProject Mar 18, 2025
ec36caf
Update wallets.ts
CoNETProject Mar 18, 2025
be4f089
feat: affiliate ui ready
caiolima-stage Mar 19, 2025
dc41566
feat: recover page ui
caiolima-stage Mar 19, 2025
7d0cb00
fix: unused snippets removed
caiolima-stage Mar 19, 2025
8d18ba5
chore: recover method functionality - pending ui adjustments
caiolima-stage Mar 19, 2025
64933ed
chore: asset
caiolima-stage Mar 19, 2025
1fd5efc
feat: recover method
caiolima-stage Mar 19, 2025
079744e
feat: affiliate ui adjustments
caiolima-stage Mar 19, 2025
be5de14
bug fix
CoNETProject Mar 19, 2025
ea1cf08
new SPPassportDistributor
CoNETProject Mar 20, 2025
31db641
bug fixed
CoNETProject Mar 21, 2025
533273c
change init
CoNETProject Mar 26, 2025
a69d57d
fix length than 200 bug
CoNETProject Apr 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dist/
# Maven
target/
dist/

package-lock.json
# JetBrains IDE
.idea/

Expand Down
91 changes: 87 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"axios": "^1.7.7",
"bip39": "^3.1.0",
"blobshape": "^1.0.0",
"bs58": "^6.0.0",
"copy-to-clipboard": "^3.3.3",
"ethers": "^6.13.4",
"motion": "^12.4.5",
Expand All @@ -30,6 +31,7 @@
"react-spring": "^9.7.4",
"stream-http": "^3.2.0",
"typescript": "^4.9.5",
"uuid62": "^1.0.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down Expand Up @@ -59,6 +61,7 @@
"devDependencies": {
"@types/async": "^3.2.24",
"@types/blobshape": "^1.0.3",
"@types/bs58": "^4.0.4",
"@types/node": "^22.9.3"
}
}
3 changes: 3 additions & 0 deletions public/assets/dentro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/assets/purchase-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@
color: white;
}

button {
background: 0;
border: 0;
display: flex;
align-items: center;
color: #FFFFFF;
gap: 12px;
}

button img {
height: 16px;
width: 16px;
}

.option-wrapper {
height: 53px;
overflow: hidden;

transition: height .12s ease;
}

.option-wrapper.open {
height: 212px;
}

.header {
width: 100%;
display: flex;
Expand Down Expand Up @@ -41,5 +66,10 @@
.page-container {
width: 100%;

flex: 1;

display: flex;
flex-direction: column;

padding: 42px 16px 100px;
}
101 changes: 28 additions & 73 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,24 @@
import { useEffect } from "react";
import "./App.css";
import { HashRouter as Router, Route, Routes } from "react-router-dom";
import { Home, Region } from "./pages";
import { useDaemonContext } from "./providers/DaemonProvider";
import { createOrGetWallet, getFreePassportInfo, tryToRequireFreePassport } from "./services/wallets";
import { createOrGetWallet, tryToRequireFreePassport } from "./services/wallets";
import { getAllNodes, startMiningV2 } from "./services/mining";
import { CoNET_Data, setCoNET_Data } from "./utils/globals";
import { listenProfileVer } from "./services/listeners";
import Vip from './pages/Vip';
import Wallet from './pages/Wallet';
import Settings from './pages/Settings';
import Languages from './pages/Languages';
import Applications from './pages/Applications';
import Subscription from './pages/Subscription';
import Support from './pages/Support';
import FAQ from './pages/FAQ';
import ConfigDevice from './pages/ConfigDevice';
import Passcode from './pages/Passcode';
import { getServerIpAddress } from "./api";
import { parseQueryParams } from "./utils/utils";
import Subscription from './pages/Subscription';
import Management from './pages/Management';
import Recover from './pages/Recover';

global.Buffer = require('buffer').Buffer;

function App() {
const { setProfiles, setMiningData, allRegions, setClosestRegion, setaAllNodes, setServerIpAddress, setServerPort, _vpnTimeUsedInMin, setActivePassportUpdated } = useDaemonContext();

const { setProfiles, _vpnTimeUsedInMin } = useDaemonContext();
let process = false
useEffect(() => {
const handlePassport = async () => {
await tryToRequireFreePassport();
const info = await getFreePassportInfo();

const tmpData = CoNET_Data;

if (!tmpData) {
return;
}

tmpData.profiles[0] = {
...tmpData?.profiles[0],
activeFreePassport: {
nftID: info?.nftIDs?.[0]?.toString(),
expires: info?.expires?.[0]?.toString(),
expiresDays: info?.expiresDays?.[0]?.toString()
},
};

setCoNET_Data(tmpData);

if (!CoNET_Data) return;

setProfiles(CoNET_Data?.profiles);
setActivePassportUpdated(true);
}

const _getServerIpAddress = async () => {
try {
const response = await getServerIpAddress();
const tmpIpAddress = response.data;

setServerIpAddress(tmpIpAddress?.ip || "");
setServerPort('3002');
} catch (ex) {
console.log(ex)
}
};

const init = async () => {
const vpnTimeUsedInMin = parseInt(localStorage.getItem("vpnTimeUsedInMin") || "0");
Expand All @@ -77,46 +32,46 @@ function App() {
secretPhrase = secretPhrase ? secretPhrase.replaceAll("-", " ") : null;
}

await createOrGetWallet(secretPhrase);
const profiles = await createOrGetWallet(secretPhrase);
setProfiles(profiles)
listenProfileVer(setProfiles);

if (!window?.webkit) {
_getServerIpAddress();
}

await getAllNodes(allRegions, setClosestRegion, (allNodes: nodes_info[]) => {
setaAllNodes(allNodes)
// await getAllNodes(allRegions, setClosestRegion, (allNodes: nodes_info[]) => {
// setaAllNodes(allNodes)

if (!CoNET_Data || !CoNET_Data?.profiles) {
return
}
// if (!CoNET_Data || !CoNET_Data?.profiles) {
// return
// }

startMiningV2(CoNET_Data?.profiles?.[0], allRegions, setMiningData);
});

await handlePassport();
// startMiningV2(CoNET_Data?.profiles?.[0], allRegions, setMiningData);
// });
};

if (process) {
return
}
process = true
init();
}, []);

return (
<div className="App">
<Router>
<Routes>
<Route path="/regions" element={<Region />}></Route>
{/* <Route path="/regions" element={<Region />}></Route>
<Route path="/faq" element={<FAQ />}></Route>
<Route path="/config-device" element={<ConfigDevice />}></Route>
<Route path="/vip" element={<Vip />}></Route>
<Route path="/wallet" element={<Wallet />}></Route>
<Route path="/settings" element={<Settings />}></Route>
<Route path="/vip" element={<Vip />}></Route> */}
<Route path="/" element={<Wallet />}></Route>
{/* <Route path="/settings" element={<Settings />}></Route>
<Route path="/passcode/new" element={<Passcode new />}></Route>
<Route path="/passcode/change" element={<Passcode />}></Route>
<Route path="/languages" element={<Languages />}></Route>
<Route path="/applications" element={<Applications />}></Route>
<Route path="/applications" element={<Applications />}></Route> */}
<Route path="/subscription" element={<Subscription />}></Route>
<Route path="/support" element={<Support />}></Route>
<Route path="/" element={<Home />}></Route>
<Route path="/management" element={<Management />}></Route>
<Route path="/recover" element={<Recover />}></Route>
{/* <Route path="/support" element={<Support />}></Route>
<Route path="/ww" element={<Home />}></Route> */}
</Routes>
</Router>
</div>
Expand Down
Loading