Skip to content
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

feat: initial page and transfer with starknetkit@latest #5

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
258 changes: 258 additions & 0 deletions src/abi/ERC20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
[
{
"members": [
{
"name": "low",
"offset": 0,
"type": "felt"
},
{
"name": "high",
"offset": 1,
"type": "felt"
}
],
"name": "Uint256",
"size": 2,
"type": "struct"
},
{
"inputs": [
{
"name": "name",
"type": "felt"
},
{
"name": "symbol",
"type": "felt"
},
{
"name": "recipient",
"type": "felt"
}
],
"name": "constructor",
"outputs": [],
"type": "constructor"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"name": "name",
"type": "felt"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "symbol",
"type": "felt"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "totalSupply",
"type": "Uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "decimals",
"type": "felt"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "account",
"type": "felt"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "Uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "owner",
"type": "felt"
},
{
"name": "spender",
"type": "felt"
}
],
"name": "allowance",
"outputs": [
{
"name": "remaining",
"type": "Uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "recipient",
"type": "felt"
},
{
"name": "amount",
"type": "Uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "success",
"type": "felt"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "sender",
"type": "felt"
},
{
"name": "recipient",
"type": "felt"
},
{
"name": "amount",
"type": "Uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "success",
"type": "felt"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "spender",
"type": "felt"
},
{
"name": "amount",
"type": "Uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "success",
"type": "felt"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "spender",
"type": "felt"
},
{
"name": "added_value",
"type": "Uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"name": "success",
"type": "felt"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "spender",
"type": "felt"
},
{
"name": "subtracted_value",
"type": "Uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"name": "success",
"type": "felt"
}
],
"type": "function"
},
{
"inputs": [
{
"name": "recipient",
"type": "felt"
},
{
"name": "amount",
"type": "Uint256"
}
],
"name": "mint",
"outputs": [],
"type": "function"
},
{
"inputs": [
{
"name": "user",
"type": "felt"
},
{
"name": "amount",
"type": "Uint256"
}
],
"name": "burn",
"outputs": [],
"type": "function"
}
]
8 changes: 4 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Box } from "@chakra-ui/react"
import type { Metadata } from "next"
import { Inter } from "next/font/google"
import { Providers } from "./providers"
import { Box } from "@chakra-ui/react"

const inter = Inter({ subsets: ["latin"] })

export const metadata: Metadata = {
title: "Starknetkit example dapp",
description: "Example dapp for Starknetkit",
title: "Create Next App",
description: "Generated by create next app",
}

export default function RootLayout({
Expand All @@ -17,7 +17,7 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<Box as="body" className={inter.className} bgColor="#f9f9f9">
<Box as="body" className={inter.className} bgColor="#f0f0f0">
<Providers>{children}</Providers>
</Box>
</html>
Expand Down
62 changes: 61 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
"use client"
import { ConnectButtonStarknetkitLatest } from "@/components/connect/ConnectButtonStarknetkitLatest"
import { ConnectButtonStarknetkitNext } from "@/components/connect/ConnectButtonStarknetkitNext"
import { Flex, SimpleGrid, GridItem } from "@chakra-ui/react"

export default function Home() {
return <>home page</>
return (
<Flex as="main" p="10" gap="4" flexWrap="wrap" w="100dvw" h="100dvh">
<SimpleGrid columnGap="16" rowGap="16" columns={2} w="100%">
<GridItem
display="flex"
w="100%"
h="100%"
border="solid 1px black"
borderRadius="8px"
alignItems="center"
justifyContent="center"
bgColor="white"
boxShadow="0px 12px 30px 0px #0000001A"
>
<ConnectButtonStarknetkitLatest />
</GridItem>
<GridItem
display="flex"
w="100%"
h="100%"
border="solid 1px black"
borderRadius="8px"
alignItems="center"
justifyContent="center"
bgColor="white"
boxShadow="0px 12px 30px 0px #0000001A"
>
<ConnectButtonStarknetkitNext />
</GridItem>
<GridItem
display="flex"
w="100%"
h="100%"
border="solid 1px black"
borderRadius="8px"
alignItems="center"
justifyContent="center"
bgColor="white"
boxShadow="0px 12px 30px 0px #0000001A"
>
Starknetkit@next + starknet-react
</GridItem>
<GridItem
display="flex"
w="100%"
h="100%"
border="solid 1px black"
borderRadius="8px"
alignItems="center"
justifyContent="center"
bgColor="white"
boxShadow="0px 12px 30px 0px #0000001A"
>
Starknetkit@latest + starknet-react
</GridItem>
</SimpleGrid>
</Flex>
)
}
Loading
Loading