Skip to content

Commit

Permalink
proxy app v 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CoNETProject committed Dec 9, 2023
1 parent 2853212 commit bccd86d
Show file tree
Hide file tree
Showing 21 changed files with 1,473 additions and 678 deletions.
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@

},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@reduxjs/toolkit": "^1.9.7",
"@storybook/addon-actions": "^7.6.3",
"@storybook/addon-essentials": "^7.6.3",
Expand Down Expand Up @@ -94,7 +97,10 @@
"typescript": "^5.3.2",
"wait-on": "^7.2.0",
"caniuse-lite": "^1.0.30001565",
"react-swipeable-views": "^0.14.0"
"react-swipeable-views": "^0.14.0",
"react-d3-speedometer": "^1.1.0",
"react-gauge-chart": "^0.4.1",
"@types/react-gauge-chart": "^0.4.3"
},
"browserslist": {
"production": [
Expand Down
35 changes: 32 additions & 3 deletions src/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type WorkerCommandErrorType = 'NOT_READY'|'INVALID_DATA'|

type WorkerCommandType = 'READY'|'encrypt_TestPasscode'|'getCONETBalance'|'getRegiestNodes'|
'encrypt_createPasscode'|'encrypt_lock'|'encrypt_deletePasscode'|'storePreferences'|
'newProfile'|'storeProfile'|'invitation'|'WORKER_MESSAGE'|
'newProfile'|'storeProfile'|'invitation'|'WORKER_MESSAGE'|'startProxy'|
'isAddress'|'getFaucet'|'syncAsset'|'sendAsset'|'getUSDCPrice'|
'buyUSDC'|'mintCoNETCash'|'getSINodes'|'getRecipientCoNETCashAddress'|
'getUserProfile'|'sendMessage'|'setRegion'
'getUserProfile'|'sendMessage'|'setRegion'|'ipaddress'

export type WorkerCallStatus = 'SUCCESS' | 'NOT_READY' | 'UNKNOWN_COMMAND' |
'TIME_OUT' | 'SYSTEM_ERROR'
Expand All @@ -27,6 +27,13 @@ export type SeguroNetworkStatus = WorkerCallStatus |
'LOCAL_SERVER_ERROR'|'INVITATION_CODE_ERROR'|
'SEGURO_ERROR'|'UNKNOW_ERROR'|'SEGURO_DATA_FORMAT_ERROR'



const ver = '0.0.12'




/*eslint-disable */
export interface profile {
bio: string
Expand Down Expand Up @@ -163,7 +170,7 @@ export const postPasscode: (passcode: string) => Promise<null|boolean|WorkerComm
}

export const testLocalServer = async () => {
const ver = '0.0.6'

const result = await postUrl(`http://localhost:3001/ver`, '', false)
if (result) {
if (result.ver === ver) {
Expand Down Expand Up @@ -241,6 +248,17 @@ export const setRegion: (region: regionType) => Promise < StartWorkerResolveForA
})
}

export const startProxy: () => Promise < StartWorkerResolveForAPI > = () => {
return new Promise( resolve => {
const cmd: WorkerCommand = {
cmd: 'startProxy',
uuid: v4(),
data: []
}
return postMessage (cmd, resolve)
})
}

export const getRegiestNodes : () => Promise < StartWorkerResolveForAPI > = () => {
return new Promise( resolve => {
const cmd: WorkerCommand = {
Expand All @@ -264,6 +282,17 @@ export const createPasscode : (passcord: string, local: string) => Promise < Sta
})
}

export const getIPaddress: () => Promise < StartWorkerResolveForAPI > = () => {
return new Promise(resolve => {
const cmd: WorkerCommand = {
cmd: 'ipaddress',
uuid: v4(),
data: []
}
return postMessage (cmd, resolve)
})
}

export const encrypt_deletePasscode : () => Promise < StartWorkerResolveForAPI > = () => {
return new Promise( resolve => {

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bccd86d

Please sign in to comment.