-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cartesify nestjs WIP finishing touches
- Loading branch information
Showing
265 changed files
with
67,855 additions
and
5,525 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
npm-debug.log | ||
. | ||
.DS_Store | ||
.mypy_cache | ||
.mypy_cache | ||
.vscode |
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 @@ | ||
NEXT_PUBLIC_WALLECT_CONNECT_PROJECT_ID = 61aeba5659fdc68cec3a40d7359401de |
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 @@ | ||
NEXT_PUBLIC_WALLECT_CONNECT_PROJECT_ID = YOUR_PROJECT_ID |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": "next/core-web-vitals", | ||
"rules": { | ||
"react/display-name": "off" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -34,3 +34,4 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
app/cartesi/generated |
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,42 @@ | ||
import React from "react"; | ||
import { ethers } from "ethers"; | ||
import { | ||
Table, | ||
Thead, | ||
Tbody, | ||
Tr, | ||
Th, | ||
Td, | ||
TableContainer, | ||
Button, | ||
Stack, | ||
Box, | ||
} from '@chakra-ui/react' | ||
|
||
export const Balance: React.FC = () => { | ||
|
||
return ( | ||
<Box borderWidth='0.1px' padding='4' borderRadius='lg' overflow='hidden'> | ||
<TableContainer> | ||
<Stack> | ||
<Table variant='striped' size="lg"> | ||
<Thead> | ||
<Tr> | ||
<Th textAlign={'center'} textColor={'slategray'}>Ether</Th> | ||
<Th textAlign={'center'} textColor={'slategray'}>ERC-20</Th> | ||
<Th textAlign={'center'} textColor={'slategray'}>ERC-721</Th> | ||
<Th textAlign={'center'} textColor={'slategray'}>ERC-1155</Th> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
<Tr> | ||
<Td colSpan={4} textAlign={'center'} fontSize='14' color='grey' >looks like your cartesi dapp balance is zero! 🙁</Td> | ||
</Tr> | ||
</Tbody> | ||
</Table> | ||
<Button backgroundColor={"#9395D3"}>Get Balance</Button> | ||
</Stack> | ||
</TableContainer> | ||
</Box> | ||
); | ||
}; |
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,23 @@ | ||
'use client' | ||
import { Button } from "@chakra-ui/react"; | ||
|
||
import { sendRPCCommand } from "./services/RestApiCalls"; | ||
import { useState } from "react"; | ||
|
||
export function Epoch() { | ||
const [loading, setLoading] = useState(false) | ||
return ( | ||
<div className="text-center text-slate-400"> | ||
<h2 className="mt-8 text-2xl mb-4">Epoch</h2> | ||
<p>Advance the epoch by running this command on terminal:</p> | ||
<pre>ETH_RPC_URL=http://localhost:8545 cast rpc evm_increaseTime 5184000</pre> | ||
<p>Or click </p> | ||
<Button className=" p-2 text-black rounded m-2" onClick={ async () => { | ||
setLoading(true) | ||
await sendRPCCommand('evm_increaseTime', [5184000]); | ||
setLoading(true) | ||
}}>{loading ? "loading please wait..." : "Increase Time"}</Button> | ||
|
||
</div> | ||
) | ||
} |
34 changes: 34 additions & 0 deletions
34
apps/cartesify/frontend/next-app/app/cartesi/RestExample.tsx
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,34 @@ | ||
'use client' | ||
import { useState } from "react" | ||
import { Button } from "@chakra-ui/react" | ||
import { useEthersSigner } from "../utils/useEtherSigner" | ||
import { createOrUpdateRequest, getRequest } from "./services/RestApiCalls" | ||
|
||
export function RestExample() { | ||
const [backendResponse, setResponse] = useState('') | ||
const signer = useEthersSigner() | ||
|
||
return ( | ||
<div className="flex justify-center text-white"> | ||
<div> | ||
<Button colorScheme="blue" className="p-2 rounded m-2" onClick={async () => { | ||
await getRequest(setResponse, "health") | ||
}}>GET</Button> | ||
<Button colorScheme="green" className=" p-2 rounded m-2" onClick={async () => { | ||
await createOrUpdateRequest(signer, "greeting", "POST", JSON.stringify({ any: 'body' }),) | ||
}}>POST</Button> | ||
<Button colorScheme="orange" className=" p-2 rounded m-2" onClick={async () => { | ||
await createOrUpdateRequest(signer, "greeting", "PUT", JSON.stringify({ any: 'body' })) | ||
}}>PUT</Button> | ||
<Button colorScheme="red" className=" p-2 rounded m-2" onClick={async () => { | ||
await createOrUpdateRequest(signer, "delete?some=body", "DELETE") | ||
}}>DELETE</Button> | ||
|
||
<div className="text-lg my-4 text-slate-400"> | ||
Backend response: <pre>{backendResponse}</pre> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
) | ||
} |
Oops, something went wrong.