Skip to content

Commit

Permalink
Merge pull request #26 from argentlabs/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
bluecco authored Jul 18, 2024
2 parents f9614b4 + 5cdcf18 commit 8573b32
Show file tree
Hide file tree
Showing 8 changed files with 473 additions and 106 deletions.
86 changes: 53 additions & 33 deletions src/app/starknetkitLatest/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ import { MintLatest } from "@/components/Actions/Mint"
import { SignMessageLatest } from "@/components/Actions/SignMessage"
import { SwitchNetworkLatest } from "@/components/Actions/SwitchNetwork"
import { TransferLatest } from "@/components/Actions/Transfer"
import { UniversalSignExecutorLatest } from "@/components/Actions/UniversalSignExecutor"
import { UniversalTransactionExecutorLatest } from "@/components/Actions/UniversalTransactionExecutor"
import { DisconnectButton } from "@/components/DisconnectButton"
import { Section } from "@/components/Section"
import { ARGENT_WEBWALLET_URL, provider } from "@/constants"
import { ARGENT_WEBWALLET_URL, CHAIN_ID, provider } from "@/constants"
import { useWaitForTx } from "@/hooks/useWaitForTx"
import { walletStarknetkitLatestAtom } from "@/state/connectedWalletStarknetkitLatest"
import { Flex, Switch } from "@chakra-ui/react"
import { Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react"
import { useAtom } from "jotai"
import { RESET } from "jotai/utils"
import { useRouter } from "next/navigation"
import { useEffect } from "react"
import { constants } from "starknet"
import { connect, disconnect } from "starknetkit-latest"

export default function StarknetkitLatest() {
Expand All @@ -38,7 +39,7 @@ export default function StarknetkitLatest() {
argentMobileOptions: {
dappName: "Starknetkit example dapp",
url: window.location.hostname,
chainId: constants.NetworkName.SN_SEPOLIA,
chainId: CHAIN_ID,
icons: [],
},
})
Expand Down Expand Up @@ -72,36 +73,55 @@ export default function StarknetkitLatest() {
address={wallet?.account?.address}
chainId={wallet.chainId}
/>
<Section>
<MintLatest />
</Section>
<Section>
<TransferLatest />
</Section>
<Section>
<SignMessageLatest />
</Section>
{wallet.id !== "argentWebWallet" &&
wallet.id !== "argentMobileWallet" && (
<Section>
<Flex alignItems="center" gap="10">
<Declare />
<DeployLatest />
<Tabs isLazy>
<TabList>
<Tab>Main functions</Tab>
<Tab>Universal transaction executor</Tab>
<Tab>Universal sign executor</Tab>
</TabList>
<TabPanels>
<TabPanel>
<Flex flexDirection="column" gap="4" w="full" h="full">
<Section>
<MintLatest />
</Section>
<Section>
<TransferLatest />
</Section>
<Section>
<SignMessageLatest />
</Section>
{wallet.id !== "argentWebWallet" &&
wallet.id !== "argentMobileWallet" && (
<Section>
<Flex alignItems="center" gap="10">
<Declare />
<DeployLatest />
</Flex>
</Section>
)}
<Section>
<Flex
flexDirection={{
base: "column",
md: "row",
}}
>
<AddTokenLatest />
<AddNetworkLatest />
<SwitchNetworkLatest />
</Flex>
</Section>
</Flex>
</Section>
)}
<Section>
<Flex
flexDirection={{
base: "column",
md: "row",
}}
>
<AddTokenLatest />
<AddNetworkLatest />
<SwitchNetworkLatest />
</Flex>
</Section>
</TabPanel>
<TabPanel>
<UniversalTransactionExecutorLatest />
</TabPanel>
<TabPanel>
<UniversalSignExecutorLatest />
</TabPanel>
</TabPanels>
</Tabs>
</>
)}
</Flex>
Expand Down
138 changes: 71 additions & 67 deletions src/app/starknetkitNext/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ import { SessionKeysTypedDataOutside } from "@/components/Actions/SessionKeysTyp
import { SignMessageNext } from "@/components/Actions/SignMessage"
import { SwitchNetworkNext } from "@/components/Actions/SwitchNetwork"
import { TransferNext } from "@/components/Actions/Transfer"
import { UniversalSignExecutorNext } from "@/components/Actions/UniversalSignExecutor"
import { UniversalTransactionExecutorNext } from "@/components/Actions/UniversalTransactionExecutor"
import { WalletRpcMsgContainer } from "@/components/Actions/WalletRpcMsgContainer"
import { DisconnectButton } from "@/components/DisconnectButton"
import { Section } from "@/components/Section"
import { ARGENT_WEBWALLET_URL } from "@/constants"
import { ARGENT_WEBWALLET_URL, CHAIN_ID } from "@/constants"
import { useWaitForTx } from "@/hooks/useWaitForTx"
import {
connectorAtom,
connectorDataAtom,
walletStarknetkitNextAtom,
} from "@/state/connectedWalletStarknetkitNext"
import { Flex } from "@chakra-ui/react"
import { Flex, Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react"
import { useAtom, useSetAtom } from "jotai"
import { RESET } from "jotai/utils"
import { useRouter } from "next/navigation"
import { useEffect } from "react"
import { constants } from "starknet"
import { connect, disconnect } from "starknetkit-next"

export default function StarknetkitLatest() {
Expand All @@ -51,7 +52,7 @@ export default function StarknetkitLatest() {
argentMobileOptions: {
dappName: "Starknetkit example dapp",
url: window.location.hostname,
chainId: constants.NetworkName.SN_SEPOLIA,
chainId: CHAIN_ID,
icons: [],
},
})
Expand Down Expand Up @@ -87,75 +88,78 @@ export default function StarknetkitLatest() {
setConnector(RESET)
}}
/>

{wallet.id === "argentWebWallet" && (
<Flex gap="10">
<a
href={process.env.NEXT_PUBLIC_ARGENT_WEBWALLET_URL}
target="_blank"
rel="noopener noreferrer"
>
Webwallet dashboard href
</a>
<div onClick={handleDashboard}>
Webwallet dashboard window.open
</div>
</Flex>
)}

<AccountSection
address={connectorData?.account}
chainId={connectorData?.chainId}
/>
<Section>
<MintNext />
</Section>
<Section>
<TransferNext />
</Section>
<Section>
<SignMessageNext />
</Section>
<Section>
<SessionKeysSign />
<SessionKeysExecute />
<Flex
alignItems={{
base: "flex-start",
md: "center",
}}
gap={{ base: "5", md: "100" }}
flexDirection={{ base: "column", md: "row" }}
>
<SessionKeysExecuteOutside />
<SessionKeysTypedDataOutside />
</Flex>
</Section>

{wallet.id !== "argentWebWallet" &&
wallet.id !== "argentMobileWallet" && (
<Section>
<Flex alignItems="center" gap="10">
<Declare />
<DeployNext />
<Tabs isLazy>
<TabList>
<Tab>Main functions</Tab>
<Tab>Universal transaction executor</Tab>
<Tab>Universal sign executor</Tab>
</TabList>
<TabPanels>
<TabPanel>
<Flex flexDirection="column" gap="4" w="full" h="full">
<Section>
<MintNext />
</Section>
<Section>
<TransferNext />
</Section>
<Section>
<SignMessageNext />
</Section>
<Section>
<SessionKeysSign />
<SessionKeysExecute />
<Flex
alignItems={{
base: "flex-start",
md: "center",
}}
gap={{ base: "5", md: "100" }}
flexDirection={{ base: "column", md: "row" }}
>
<SessionKeysExecuteOutside />
<SessionKeysTypedDataOutside />
</Flex>
</Section>
{wallet.id !== "argentWebWallet" &&
wallet.id !== "argentMobileWallet" && (
<Section>
<Flex alignItems="center" gap="10">
<Declare />
<DeployNext />
</Flex>
</Section>
)}
<Section>
<Flex
flexDirection={{
base: "column",
md: "row",
}}
>
<AddTokenNext />
<AddNetworkNext />
<SwitchNetworkNext />
</Flex>
</Section>
<Section>
<WalletRpcMsgContainer wallet={wallet} />
</Section>
</Flex>
</Section>
)}
<Section>
<Flex
flexDirection={{
base: "column",
md: "row",
}}
>
<AddTokenNext />
<AddNetworkNext />
<SwitchNetworkNext />
</Flex>
</Section>
<Section>
<WalletRpcMsgContainer wallet={wallet} />
</Section>
</TabPanel>
<TabPanel>
<UniversalTransactionExecutorNext />
</TabPanel>
<TabPanel>
<UniversalSignExecutorNext />
</TabPanel>
</TabPanels>
</Tabs>
</>
)}
</Flex>
Expand Down
Loading

0 comments on commit 8573b32

Please sign in to comment.