From 4e36d5bd12ce98d425182dbca3ea20ab65f8b2e4 Mon Sep 17 00:00:00 2001 From: kwiss Date: Tue, 5 Sep 2023 18:58:26 +0200 Subject: [PATCH 1/5] feat(listing): update listing api & different relate content --- .../components/collection-items-grid-item.tsx | 15 +- .../components/collection-items-grid.tsx | 4 +- .../collection-items-list-header.tsx | 2 +- .../components/collection-items-list-row.tsx | 18 +- .../components/collection-items-list.tsx | 3 - .../[address]/components/collection-items.tsx | 4 +- .../[address]/components/collection.tsx | 4 - .../(collection)/[address]/layout.tsx | 16 +- .../(collection)/[address]/page.tsx | 22 +- .../[token_id]/components/header.tsx | 20 +- .../[token_id]/components/token-actions.tsx | 36 +- .../components/token-owner-actions.tsx | 95 ++- .../components/token-public-actions.tsx | 31 +- .../(token)/[address]/[token_id]/page.tsx | 4 +- apps/arkmarket/app/components/providers.tsx | 2 +- apps/arkmarket/app/profile/[address]/page.tsx | 5 +- .../components/ui/icons/eth-icon.tsx | 20 + apps/arkmarket/components/ui/icons/index.tsx | 3 + apps/arkmarket/components/ui/toaster.tsx | 2 +- .../{components/ui => hooks}/use-toast.ts | 0 apps/arkmarket/hooks/useBurner.ts | 2 +- apps/arkmarket/lib/utils/convertPrice.ts | 9 + apps/arkmarket/package.json | 3 + apps/arkmarket/types/index.ts | 2 + yarn.lock | 582 +++++++++++++----- 25 files changed, 608 insertions(+), 296 deletions(-) create mode 100644 apps/arkmarket/components/ui/icons/eth-icon.tsx create mode 100644 apps/arkmarket/components/ui/icons/index.tsx rename apps/arkmarket/{components/ui => hooks}/use-toast.ts (100%) create mode 100644 apps/arkmarket/lib/utils/convertPrice.ts diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid-item.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid-item.tsx index ecffe48..2f01f83 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid-item.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid-item.tsx @@ -7,6 +7,7 @@ import { env } from "@/env.mjs"; import { CollectionItem } from "@/types"; import { removeLeadingZeros } from "@/lib/utils"; +import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; import { Card, CardContent, @@ -19,14 +20,13 @@ import Image from "@/components/ui/image"; interface CollectionItemsGridItemProps { item: CollectionItem; address: string; - name: string; } const CollectionItemsGridItem: React.FC = ({ item, address, - name }) => { + const price = convertWeiPriceToEth(item.listing_price || "0"); return ( @@ -73,10 +73,13 @@ const CollectionItemsGridItem: React.FC = ({ )} - - {`${name} #${removeLeadingZeros( - item.token_id - )}`} + + {item?.normalized_metadata?.name} + {item.listing_price !== "" ? ( + + {price} ETH + + ) :({" - "})} diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid.tsx index edb092d..e499960 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-grid.tsx @@ -5,20 +5,18 @@ import { CollectionItem } from "@/types"; import CollectionItemsGridItem from "./collection-items-grid-item"; interface CollectionItemsGridProps { - name: string; items: CollectionItem[]; address: string; } const CollectionItemsGrid: React.FC = ({ - name, items, address }) => { return (
{items.map((item: any) => ( - + ))}
); diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-header.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-header.tsx index 5a99aca..6fed6ff 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-header.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-header.tsx @@ -16,7 +16,7 @@ const CollectionListHeader = () => {
Item
-
+
Price {getIsSorted === "desc" ? ( diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-row.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-row.tsx index 1b6c99c..28c1fe6 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-row.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list-row.tsx @@ -7,6 +7,7 @@ import { env } from "@/env.mjs"; import { CollectionItem } from "@/types"; import { removeLeadingZeros } from "@/lib/utils"; +import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; import { Checkbox } from "@/components/ui/checkbox"; import Image from "@/components/ui/image"; import { Separator } from "@/components/ui/separator"; @@ -14,14 +15,13 @@ import { Separator } from "@/components/ui/separator"; interface CollectionRowProps { item: CollectionItem; address: string; - name: string; } const CollectionRow: React.FC = ({ item, address, - name }) => { + const price = convertWeiPriceToEth(item.listing_price || "0"); return (
@@ -51,10 +51,18 @@ const CollectionRow: React.FC = ({ alt={item.token_id} /> )} - {`${name} ${removeLeadingZeros(item.token_id)}`} + {item?.normalized_metadata?.name}
-
- 0.34 +
+ {item.listing_price !== "" ? ( + + {price} ETH + + ) : ( + + {" - "} + + )}
0.3 diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list.tsx index be827c8..c273885 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items-list.tsx @@ -21,13 +21,11 @@ interface item { interface CollectionItemsListProps { items: item[]; address: string; - name: string; } const CollectionsList: React.FC = ({ items, address, - name }) => { return (
@@ -38,7 +36,6 @@ const CollectionsList: React.FC = ({ key={item.token_id} address={address} item={item} - name={name} /> ))}
diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items.tsx index 149e7bd..b04f346 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection-items.tsx @@ -6,9 +6,9 @@ import Collection from "./collection"; interface CollectionItemsProps { address: string; - name: string; } +//?status=buy_now const fetchNfts = async (address: string) => { const res = await fetch( `${env.NEXT_PUBLIC_ARK_API_DOMAIN}/v1/nfts/${address}`, @@ -29,7 +29,6 @@ const fetchNfts = async (address: string) => { const CollectionItems: React.FC = async ({ address, - name }) => { const collectionItems = await fetchNfts(address); @@ -37,7 +36,6 @@ const CollectionItems: React.FC = async ({ ); }; diff --git a/apps/arkmarket/app/collection/(collection)/[address]/components/collection.tsx b/apps/arkmarket/app/collection/(collection)/[address]/components/collection.tsx index b22d909..d77caa3 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/components/collection.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/components/collection.tsx @@ -9,13 +9,11 @@ import CollectionItemsList from "./collection-items-list"; interface CollectionProps { collectionItems: any[]; address: string; - name: string; } const Collection: React.FC = ({ collectionItems, address, - name }) => { const [view, setView] = React.useState<"grid" | "list">("grid"); return ( @@ -27,13 +25,11 @@ const Collection: React.FC = ({ /> {view === "grid" ? ( ) : ( diff --git a/apps/arkmarket/app/collection/(collection)/[address]/layout.tsx b/apps/arkmarket/app/collection/(collection)/[address]/layout.tsx index 5d813c4..4105be5 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/layout.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/layout.tsx @@ -1,10 +1,14 @@ -import { PropsWithChildren } from "react"; +import * as React from "react"; import { env } from "@/env.mjs"; import { Collection } from "@/types"; import CollectionHeader from "./components/collection-header"; +interface PageProps { + params: { address: string }; +} + const getCollection = async (address: string) => { const res = await fetch( `${env.NEXT_PUBLIC_ARK_API_DOMAIN}/v1/collections/${address}`, @@ -19,14 +23,12 @@ const getCollection = async (address: string) => { return res.json(); }; -interface ProfileLayoutProps { +interface CollectionLayoutProps { + children: React.ReactNode; params: { address: string }; } -const ProfileLayout: React.FC> = async ({ - params, - children -}) => { +const CollectionLayout: React.FC = async ({ children, params }) => { const collection = (await getCollection(params.address)) as Collection; return ( @@ -37,4 +39,4 @@ const ProfileLayout: React.FC> = async ({ ); }; -export default ProfileLayout; +export default CollectionLayout; diff --git a/apps/arkmarket/app/collection/(collection)/[address]/page.tsx b/apps/arkmarket/app/collection/(collection)/[address]/page.tsx index b797adc..883f61b 100644 --- a/apps/arkmarket/app/collection/(collection)/[address]/page.tsx +++ b/apps/arkmarket/app/collection/(collection)/[address]/page.tsx @@ -1,33 +1,13 @@ import * as React from "react"; -import { env } from "@/env.mjs"; -import { Collection } from "@/types"; - -import CollectionHeader from "./components/collection-header"; import CollectionItems from "./components/collection-items"; interface PageProps { params: { address: string }; } -const getCollection = async (address: string) => { - const res = await fetch( - `${env.NEXT_PUBLIC_ARK_API_DOMAIN}/v1/collections/${address}`, - { - headers: { - "X-API-KEY": "yW0akON1f55mOFwBPXPme4AFfLktbRiQ2GNdT1Mc", - "Content-Type": "application/json" - }, - next: { revalidate: 30 } - } - ); - return res.json(); -}; - const Page: React.FC = async ({ params }) => { - const collection = (await getCollection(params.address)) as Collection; - - return ; + return ; }; export default Page; diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/header.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/header.tsx index f0a1f31..84514da 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/header.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/header.tsx @@ -1,4 +1,10 @@ +"use client"; + import React from "react"; +import Link from "next/link"; + +import { useAccount } from "@starknet-react/core"; +import { validateAndParseAddress } from "starknet"; import { Badge } from "@/components/ui/badge"; @@ -18,6 +24,14 @@ interface TokenSidebarProps { } const Header: React.FC = ({ token }) => { + const { address } = useAccount(); + const [walletAddress, setWalletAddress] = React.useState(""); + React.useEffect(() => { + if (address !== undefined) { + setWalletAddress(validateAndParseAddress(address)); + } + }, [address]); + return ( <>
@@ -35,7 +49,11 @@ const Header: React.FC = ({ token }) => {
Owner - {token.owner} + + + {token.owner === walletAddress ? "You" : token.owner} + +
Held for diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx index c40af45..cf34811 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx @@ -1,53 +1,37 @@ "use client"; -import React, { useEffect } from "react"; +import React from "react"; import { useAccount } from "@starknet-react/core"; import { validateAndParseAddress } from "starknet"; -import { Skeleton } from "@/components/ui/skeleton"; - import TokenOwnerActions from "./token-owner-actions"; import TokenPublicActions from "./token-public-actions"; interface TokenActionsProps { - tokenId: string; + token: any; contractAddress: string; - tokenOwnerAddress: string; } const TokenActions: React.FC = ({ - tokenId, - contractAddress, - tokenOwnerAddress + token, + contractAddress }) => { const { address } = useAccount(); const [walletAddress, setWalletAddress] = React.useState(""); - useEffect(() => { + React.useEffect(() => { if (address !== undefined) { setWalletAddress(validateAndParseAddress(address)); } }, [address]); - - if (!address) { - return ( -
- -
- ); - } - + return (
- {tokenOwnerAddress === walletAddress && ( - + {token.owner === walletAddress && ( + )} - {tokenOwnerAddress !== walletAddress && walletAddress !== undefined && ( - + {token.owner !== walletAddress && walletAddress !== undefined && ( + )}
); diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx index 836b9a7..1a1bf77 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx @@ -2,34 +2,35 @@ import React from "react"; +import { useToast } from "@/hooks/use-toast"; import { useBurner } from "@/hooks/useBurner"; import { ReloadIcon } from "@radix-ui/react-icons"; -import { Card } from "@/components/ui/card"; -import { useToast } from "@/components/ui/use-toast"; +import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { EthIcon } from "@/components/ui/icons"; +import { Input } from "@/components/ui/input"; interface TokenOwnerActionsProps { - tokenId: string; - tokenOwnerAddress: string; + token: any; contractAddress: string; } const TokenOwnerActions: React.FC = ({ - tokenId, - tokenOwnerAddress, + token, contractAddress }) => { const { toast } = useToast(); const { listItem } = useBurner(); const [isSubmitting, setIsSubmitting] = React.useState(false); - const onItemlist = async () => { try { setIsSubmitting(true); await listItem({ - tokenId: parseInt(tokenId), - tokenOwnerAddress, - contractAddress + tokenId: parseInt(token.token_id), + tokenOwnerAddress: token.owner, + contractAddress: token.token_address }); toast({ title: "Order placed", @@ -44,27 +45,69 @@ const TokenOwnerActions: React.FC = ({ }); } }; - + const price = convertWeiPriceToEth(token.listing_price || "0"); return ( -
-
Item not listed
- + + + ) : ( - <>List Item + )}
- -
+
+
+ Expiration + 3 days +
+
+ Listed + 5h ago +
+
+ Created by + Team Everai +
+
+ + Floor Difference + + +1% +
+
+
+ ); }; diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx index fa34b7a..4800694 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx @@ -1,22 +1,21 @@ import React from "react"; -import { cairo } from "starknet"; +import { useToast } from "@/hooks/use-toast"; import { useBurner } from "@/hooks/useBurner"; import { ReloadIcon } from "@radix-ui/react-icons"; import { useAccount, useContractWrite } from "@starknet-react/core"; -import { validateAndParseAddress } from "starknet"; +import { cairo, validateAndParseAddress } from "starknet"; import { Button } from "@/components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle -} from "@/components/ui/card"; -import { useToast } from "@/components/ui/use-toast"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { EthIcon } from "@/components/ui/icons"; +import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; -const TokenPublicActions = () => { +interface TokenPublicActionsProps { + token: any; +} + +const TokenPublicActions: React.FC = ({ token }) => { const { address } = useAccount(); const { toast } = useToast(); const { buyItem } = useBurner(); @@ -57,12 +56,16 @@ const TokenPublicActions = () => { // }); // } }; - + const price = convertWeiPriceToEth(token.listing_price || "0"); return ( - Listed for 4.245 $7.0K - Expires in 3d + +
+ Listed for {price ? price : "N/A"} + +
+
diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx index 1d83860..c494f8e 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx @@ -27,15 +27,13 @@ const getToken = async (address: string, token_id: string) => { const Page: React.FC = async ({ params }) => { const token = await getToken(params.address, params.token_id); - console.log(token); return (
diff --git a/apps/arkmarket/app/components/providers.tsx b/apps/arkmarket/app/components/providers.tsx index 1057b25..5edb08b 100644 --- a/apps/arkmarket/app/components/providers.tsx +++ b/apps/arkmarket/app/components/providers.tsx @@ -14,7 +14,7 @@ const Providers: React.FC = ({ children }) => { return ( - {children} + {children} ); diff --git a/apps/arkmarket/app/profile/[address]/page.tsx b/apps/arkmarket/app/profile/[address]/page.tsx index c6a3cc9..97e7c6b 100644 --- a/apps/arkmarket/app/profile/[address]/page.tsx +++ b/apps/arkmarket/app/profile/[address]/page.tsx @@ -1,3 +1,5 @@ +import { validateAndParseAddress } from "starknet"; + import OwnerCollection from "./components/owner-collection"; import OwnerHeader from "./components/owner-header"; @@ -8,5 +10,6 @@ export default function Owned({ address: string; }; }) { - return ; + const address = validateAndParseAddress(params.address); + return ; } diff --git a/apps/arkmarket/components/ui/icons/eth-icon.tsx b/apps/arkmarket/components/ui/icons/eth-icon.tsx new file mode 100644 index 0000000..fa05ef9 --- /dev/null +++ b/apps/arkmarket/components/ui/icons/eth-icon.tsx @@ -0,0 +1,20 @@ +import React from "react"; + +const EthIcon = () => { + return ( + + + + + ); +}; + +export default EthIcon; diff --git a/apps/arkmarket/components/ui/icons/index.tsx b/apps/arkmarket/components/ui/icons/index.tsx new file mode 100644 index 0000000..267ee9c --- /dev/null +++ b/apps/arkmarket/components/ui/icons/index.tsx @@ -0,0 +1,3 @@ +import EthIcon from "./eth-icon"; + +export { EthIcon }; diff --git a/apps/arkmarket/components/ui/toaster.tsx b/apps/arkmarket/components/ui/toaster.tsx index e223385..f6adb95 100644 --- a/apps/arkmarket/components/ui/toaster.tsx +++ b/apps/arkmarket/components/ui/toaster.tsx @@ -8,7 +8,7 @@ import { ToastTitle, ToastViewport, } from "@/components/ui/toast" -import { useToast } from "@/components/ui/use-toast" +import { useToast } from "@/hooks/use-toast" export function Toaster() { const { toasts } = useToast() diff --git a/apps/arkmarket/components/ui/use-toast.ts b/apps/arkmarket/hooks/use-toast.ts similarity index 100% rename from apps/arkmarket/components/ui/use-toast.ts rename to apps/arkmarket/hooks/use-toast.ts diff --git a/apps/arkmarket/hooks/useBurner.ts b/apps/arkmarket/hooks/useBurner.ts index e358abb..5c7b1c4 100644 --- a/apps/arkmarket/hooks/useBurner.ts +++ b/apps/arkmarket/hooks/useBurner.ts @@ -105,7 +105,7 @@ export const useBurner = () => { seller: tokenOwnerAddress, collection: contractAddress, token_id: cairo.uint256(tokenId), - price: cairo.uint256(1000), + price: cairo.uint256(100000000), end_date: "0", // Change broker name for current env broker broker_name: shortString.encodeShortString( diff --git a/apps/arkmarket/lib/utils/convertPrice.ts b/apps/arkmarket/lib/utils/convertPrice.ts new file mode 100644 index 0000000..0a7fd5e --- /dev/null +++ b/apps/arkmarket/lib/utils/convertPrice.ts @@ -0,0 +1,9 @@ +import { cairo, uint256 } from "starknet"; +import { formatEther } from "viem"; + +export const convertWeiPriceToEth = (price: string): string => { + const u256Price = cairo.uint256(price); + const priceAsBN = uint256.uint256ToBN(u256Price); + const formatedPrice = formatEther(priceAsBN); + return formatedPrice; +}; diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 29f1dc0..fb8bc00 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -34,6 +34,7 @@ "@types/react-dom": "18.2.7", "add": "^2.0.6", "autoprefixer": "10.4.15", + "bufferutil": "^4.0.7", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "cmdk": "^0.2.0", @@ -54,6 +55,8 @@ "tailwindcss": "3.3.3", "tailwindcss-animate": "^1.0.6", "typescript": "5.1.6", + "utf-8-validate": "^6.0.3", + "viem": "^1.10.3", "yarn": "^1.22.19", "zod": "^3.22.2" }, diff --git a/apps/arkmarket/types/index.ts b/apps/arkmarket/types/index.ts index 6340a67..0e58063 100644 --- a/apps/arkmarket/types/index.ts +++ b/apps/arkmarket/types/index.ts @@ -57,6 +57,8 @@ export interface CollectionItem { token_address: string; token_id: string; owner?: string; + listing_price?: string; + listing_status?: string; normalized_metadata?: { name: string; description: string; diff --git a/yarn.lock b/yarn.lock index e029d83..2e777c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@adraffy/ens-normalize@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" + integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== + "@algolia/autocomplete-core@^1.9.2": version "1.11.0" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.11.0.tgz#9db68f2aa38fe3149507d214082a1926b6b91fac" @@ -47,7 +52,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5": +"@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== @@ -61,43 +66,43 @@ integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== "@babel/core@^7.21.8": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.11.tgz#8033acaa2aa24c3f814edaaa057f3ce0ba559c24" - integrity sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ== + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.15.tgz#15d4fd03f478a459015a4b94cfbb3bd42c48d2f4" + integrity sha512-PtZqMmgRrvj8ruoEOIwVA3yoF91O+Hgw9o7DAUTNBA6Mo2jpu31clx9a7Nz/9JznqetTR6zwfC4L3LAjKQXUwA== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.10" - "@babel/generator" "^7.22.10" - "@babel/helper-compilation-targets" "^7.22.10" - "@babel/helper-module-transforms" "^7.22.9" - "@babel/helpers" "^7.22.11" - "@babel/parser" "^7.22.11" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.11" - "@babel/types" "^7.22.11" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.22.15" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.22.15" + "@babel/helpers" "^7.22.15" + "@babel/parser" "^7.22.15" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.22.15" + "@babel/types" "^7.22.15" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.21.5", "@babel/generator@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" - integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A== +"@babel/generator@^7.21.5", "@babel/generator@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.15.tgz#1564189c7ec94cb8f77b5e8a90c4d200d21b2339" + integrity sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA== dependencies: - "@babel/types" "^7.22.10" + "@babel/types" "^7.22.15" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz#01d648bbc25dd88f513d862ee0df27b7d4e67024" - integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q== +"@babel/helper-compilation-targets@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== dependencies: "@babel/compat-data" "^7.22.9" - "@babel/helper-validator-option" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" browserslist "^4.21.9" lru-cache "^5.1.1" semver "^6.3.1" @@ -122,23 +127,23 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" - integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" - integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== +"@babel/helper-module-transforms@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.15.tgz#40ad2f6950f143900e9c1c72363c0b431a606082" + integrity sha512-l1UiX4UyHSFsYt17iQ3Se5pQQZZHa22zyIXURmvkmLCD4t/aU+dvNWHatKac/D9Vm9UES7nvIqHs4jZqKviUmQ== dependencies: "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-module-imports" "^7.22.15" "@babel/helper-simple-access" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.15" "@babel/helper-simple-access@^7.22.5": version "7.22.5" @@ -159,24 +164,24 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== +"@babel/helper-validator-identifier@^7.22.15", "@babel/helper-validator-identifier@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz#601fa28e4cc06786c18912dca138cec73b882044" + integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ== -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== -"@babel/helpers@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.11.tgz#b02f5d5f2d7abc21ab59eeed80de410ba70b056a" - integrity sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg== +"@babel/helpers@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.15.tgz#f09c3df31e86e3ea0b7ff7556d85cdebd47ea6f1" + integrity sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw== dependencies: - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.11" - "@babel/types" "^7.22.11" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.22.15" + "@babel/types" "^7.22.15" "@babel/highlight@^7.10.4", "@babel/highlight@^7.22.13": version "7.22.13" @@ -187,50 +192,50 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.21.8", "@babel/parser@^7.22.11", "@babel/parser@^7.22.5": - version "7.22.13" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.13.tgz#23fb17892b2be7afef94f573031c2f4b42839a2b" - integrity sha512-3l6+4YOvc9wx7VlCSw4yQfcBo01ECA8TicQfbnCPuCEpRQrf+gTUyGdxNw+pyTUyywp6JRD1w0YQs9TpBXYlkw== +"@babel/parser@^7.21.8", "@babel/parser@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.15.tgz#d34592bfe288a32e741aa0663dbc4829fcd55160" + integrity sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA== "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.11.tgz#7a9ba3bbe406ad6f9e8dd4da2ece453eb23a77a4" - integrity sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA== + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" + integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== +"@babel/template@^7.22.15", "@babel/template@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" -"@babel/traverse@^7.21.5", "@babel/traverse@^7.22.11": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.11.tgz#71ebb3af7a05ff97280b83f05f8865ac94b2027c" - integrity sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ== +"@babel/traverse@^7.21.5", "@babel/traverse@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.15.tgz#75be4d2d6e216e880e93017f4e2389aeb77ef2d9" + integrity sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ== dependencies: - "@babel/code-frame" "^7.22.10" - "@babel/generator" "^7.22.10" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.22.15" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.11" - "@babel/types" "^7.22.11" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.21.5", "@babel/types@^7.22.10", "@babel/types@^7.22.11", "@babel/types@^7.22.5": - version "7.22.11" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.11.tgz#0e65a6a1d4d9cbaa892b2213f6159485fe632ea2" - integrity sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg== +"@babel/types@^7.21.5", "@babel/types@^7.22.15", "@babel/types@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.15.tgz#266cb21d2c5fd0b3931e7a91b6dd72d2f617d282" + integrity sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA== dependencies: "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.15" to-fast-properties "^2.0.0" "@eslint-community/eslint-utils@^4.2.0": @@ -330,9 +335,9 @@ client-only "^0.0.1" "@humanwhocodes/config-array@^0.11.10", "@humanwhocodes/config-array@^0.11.6": - version "0.11.10" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" - integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== + version "0.11.11" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" + integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -523,6 +528,13 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.19.tgz#648f79c4e09279212ac90d871646ae12d80cdfce" integrity sha512-YzA78jBDXMYiINdPdJJwGgPNT3YqBNNGhsthsDoWHL9p24tEJn9ViQf/ZqTbwSpX/RrkPupLfuuTH2sf73JBAw== +"@noble/curves@1.2.0", "@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + "@noble/curves@~1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.0.0.tgz#e40be8c7daf088aaf291887cbc73f43464a92932" @@ -535,7 +547,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== -"@noble/hashes@~1.3.0": +"@noble/hashes@1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== @@ -1177,11 +1189,71 @@ dependencies: "@babel/runtime" "^7.13.10" +"@rometools/cli-darwin-arm64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3.tgz#b00fe225e34047c4dac63588e237b11ebec47694" + integrity sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg== + +"@rometools/cli-darwin-x64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3.tgz#e5bbf02afb1aab7447e743092245dea992b4b29f" + integrity sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g== + +"@rometools/cli-linux-arm64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3.tgz#e75b01b74c134edc811e21fa7e1e440602930d59" + integrity sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg== + +"@rometools/cli-linux-x64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3.tgz#2b9f4a68079783f275d4d27df83e4fa2220ec6fc" + integrity sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg== + +"@rometools/cli-win32-arm64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3.tgz#714acb67ac4ea4c15e2bc6aea4dd290c76c8efc6" + integrity sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ== + +"@rometools/cli-win32-x64@12.1.3": + version "12.1.3" + resolved "https://registry.yarnpkg.com/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3.tgz#b4f53491d2ca8f1234b3613b7cc73418ad8d76bb" + integrity sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ== + "@rushstack/eslint-patch@^1.1.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.3.tgz#16ab6c727d8c2020a5b6e4a176a243ecd88d8d69" integrity sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw== +"@scure/base@~1.1.0", "@scure/base@~1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@scure/bip32@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" + integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.2" + +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + +"@scure/starknet@~0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@scure/starknet/-/starknet-0.3.0.tgz#b8273a42fc721025f8098b1f1d96368a7067e1c4" + integrity sha512-Ma66yZlwa5z00qI5alSxdWtIpky5LBhy22acVFdoC5kwwbd9uDyMWEYzWHdNyKmQg9t5Y2UOXzINMeb3yez+Gw== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -1305,6 +1377,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/node@*": + version "20.5.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.9.tgz#a70ec9d8fa0180a314c3ede0e20ea56ff71aed9a" + integrity sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ== + "@types/node@20.5.1": version "20.5.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30" @@ -1360,6 +1437,13 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367" integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg== +"@types/ws@^8.5.5": + version "8.5.5" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" + integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== + dependencies: + "@types/node" "*" + "@typescript-eslint/eslint-plugin@^5.59.8": version "5.62.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" @@ -1387,14 +1471,14 @@ debug "^4.3.4" "@typescript-eslint/parser@^5.4.2 || ^6.0.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.5.0.tgz#3d6ed231c5e307c5f5f4a0d86893ec01e92b8c77" - integrity sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ== - dependencies: - "@typescript-eslint/scope-manager" "6.5.0" - "@typescript-eslint/types" "6.5.0" - "@typescript-eslint/typescript-estree" "6.5.0" - "@typescript-eslint/visitor-keys" "6.5.0" + version "6.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.6.0.tgz#fe323a7b4eafb6d5ea82b96216561810394a739e" + integrity sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w== + dependencies: + "@typescript-eslint/scope-manager" "6.6.0" + "@typescript-eslint/types" "6.6.0" + "@typescript-eslint/typescript-estree" "6.6.0" + "@typescript-eslint/visitor-keys" "6.6.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.62.0": @@ -1405,13 +1489,13 @@ "@typescript-eslint/types" "5.62.0" "@typescript-eslint/visitor-keys" "5.62.0" -"@typescript-eslint/scope-manager@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz#f2cb20895aaad41b3ad27cc3a338ce8598f261c5" - integrity sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw== +"@typescript-eslint/scope-manager@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz#57105d4419d6de971f7d2c30a2ff4ac40003f61a" + integrity sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw== dependencies: - "@typescript-eslint/types" "6.5.0" - "@typescript-eslint/visitor-keys" "6.5.0" + "@typescript-eslint/types" "6.6.0" + "@typescript-eslint/visitor-keys" "6.6.0" "@typescript-eslint/type-utils@5.62.0": version "5.62.0" @@ -1428,10 +1512,10 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== -"@typescript-eslint/types@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.5.0.tgz#f4e55cfd99ac5346ea772770bf212a3e689a8f04" - integrity sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w== +"@typescript-eslint/types@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.6.0.tgz#95e7ea650a2b28bc5af5ea8907114a48f54618c2" + integrity sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg== "@typescript-eslint/typescript-estree@5.62.0": version "5.62.0" @@ -1446,13 +1530,13 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz#1cef6bc822585e9ef89d88834bc902d911d747ed" - integrity sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ== +"@typescript-eslint/typescript-estree@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz#373c420d2e12c28220f4a83352280a04823a91b7" + integrity sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA== dependencies: - "@typescript-eslint/types" "6.5.0" - "@typescript-eslint/visitor-keys" "6.5.0" + "@typescript-eslint/types" "6.6.0" + "@typescript-eslint/visitor-keys" "6.6.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -1481,14 +1565,30 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz#1a6f474a0170a447b76f0699ce6700110fd11436" - integrity sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA== +"@typescript-eslint/visitor-keys@6.6.0": + version "6.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz#1109088b4346c8b2446f3845db526374d9a3bafc" + integrity sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ== dependencies: - "@typescript-eslint/types" "6.5.0" + "@typescript-eslint/types" "6.6.0" eslint-visitor-keys "^3.4.1" +abi-wan-kanabi@^1.0.1, abi-wan-kanabi@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abi-wan-kanabi/-/abi-wan-kanabi-1.0.3.tgz#0d8607f2a2ccb2151a69debea1c3bb68b76c5aa2" + integrity sha512-Xwva0AnhXx/IVlzo3/kwkI7Oa7ZX7codtcSn+Gmoa2PmjGPF/0jeVud9puasIPtB7V50+uBdUj4Mh3iATqtBvg== + dependencies: + abi-wan-kanabi "^1.0.1" + fs-extra "^10.0.0" + rome "^12.1.3" + typescript "^4.9.5" + yargs "^17.7.2" + +abitype@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" + integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== + acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1623,14 +1723,14 @@ array-buffer-byte-length@^1.0.0: is-array-buffer "^3.0.1" array-includes@^3.1.4, array-includes@^3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" - integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + version "3.1.7" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.7.tgz#8cd2e01b26f7a3086cbc87271593fe921c62abda" + integrity sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - get-intrinsic "^1.1.3" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" is-string "^1.0.7" array-union@^2.1.0: @@ -1639,15 +1739,15 @@ array-union@^2.1.0: integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== array.prototype.findlastindex@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz#bc229aef98f6bd0533a2bc61ff95209875526c9b" - integrity sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw== + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz#b37598438f97b579166940814e2c0493a4f50207" + integrity sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" es-shim-unscopables "^1.0.0" - get-intrinsic "^1.1.3" + get-intrinsic "^1.2.1" array.prototype.flat@^1.3.1: version "1.3.1" @@ -1824,6 +1924,13 @@ buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +bufferutil@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" + integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== + dependencies: + node-gyp-build "^4.3.0" + builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -1868,9 +1975,9 @@ camelcase-css@^2.0.1: integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001520: - version "1.0.30001524" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001524.tgz#1e14bce4f43c41a7deaeb5ebfe86664fe8dadb80" - integrity sha512-Jj917pJtYg9HSJBF95HVX3Cdr89JUyLT4IZ8SvM5aDRni95swKgYi3TgYLH5hnGfPE/U1dg6IfZ50UsIlLkwSA== + version "1.0.30001527" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001527.tgz#813826554828245ccee776c850566dce12bdeaba" + integrity sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ== chalk@5.3.0: version "5.3.0" @@ -1941,6 +2048,15 @@ client-only@0.0.1, client-only@^0.0.1: resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-response@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" @@ -2217,9 +2333,9 @@ eastasianwidth@^0.2.0: integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== electron-to-chromium@^1.4.477: - version "1.4.504" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.504.tgz#975522945676cf2d55910988a169f07b83081488" - integrity sha512-cSMwIAd8yUh54VwitVRVvHK66QqHWE39C3DRj8SWiXitEpVSY3wNPD9y1pxQtLIi4w3UdzF9klLsmuPshz09DQ== + version "1.4.508" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.508.tgz#5641ff2f5ba11df4bd960fe6a2f9f70aa8b9af96" + integrity sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg== emoji-regex@^8.0.0: version "8.0.0" @@ -2979,15 +3095,24 @@ for-each@^0.3.3: is-callable "^1.1.3" fraction.js@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.1.tgz#14b4cc886575a5684f8d5fd5759c5db376bb7bb8" - integrity sha512-/KxoyCnPM0GwYI4NN0Iag38Tqt+od3/mLuguepLgCAKPn0ZhC544nssAW0tG2/00zXEYl9W+7hwAIpLHo6Oc7Q== + version "4.3.6" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.6.tgz#e9e3acec6c9a28cf7bc36cbe35eea4ceb2c5c92d" + integrity sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg== fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -3037,6 +3162,11 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" @@ -3338,7 +3468,7 @@ ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -internal-slot@^1.0.3, internal-slot@^1.0.5: +internal-slot@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== @@ -3563,15 +3693,19 @@ isomorphic-fetch@^3.0.0: node-fetch "^2.6.1" whatwg-fetch "^3.4.1" +isomorphic-ws@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz#e5529148912ecb9b451b46ed44d53dae1ce04bbf" + integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== + iterator.prototype@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.0.tgz#690c88b043d821f783843aaf725d7ac3b62e3b46" - integrity sha512-rjuhAk1AJ1fssphHD0IFV6TWL40CwRZ53FrztKx43yk2v6rguBYsY4Bj1VU4HmoMmKwZUlx7mfnhDf9cOp4YTw== + version "1.1.1" + resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.1.tgz#ab5b790e23ec00658f5974e032a2b05188bd3a5c" + integrity sha512-9E+nePc8C9cnQldmNl6bgpTY6zI4OPRZd97fhJ/iVZ1GifIUDVV5F6x1nEDqpe8KaMEZGT4xgrwKQDxXnjOIZQ== dependencies: - define-properties "^1.1.4" - get-intrinsic "^1.1.3" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" has-symbols "^1.0.3" - has-tostringtag "^1.0.0" reflect.getprototypeof "^1.0.3" jiti@^1.18.2: @@ -3668,6 +3802,15 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.3: version "3.3.5" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" @@ -4028,6 +4171,11 @@ node-fetch@^2.6.1: dependencies: whatwg-url "^5.0.0" +node-gyp-build@^4.3.0: + version "4.6.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" + integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== + node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" @@ -4095,13 +4243,13 @@ object.entries@^1.1.5, object.entries@^1.1.6: es-abstract "^1.22.1" object.fromentries@^2.0.5, object.fromentries@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" - integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== + version "2.0.7" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.7.tgz#71e95f441e9a0ea6baf682ecaaf37fa2a8d7e616" + integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" object.groupby@^1.0.0: version "1.0.1" @@ -4370,7 +4518,7 @@ postcss@8.4.14: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@8.4.28, postcss@^8.4.23: +postcss@8.4.28: version "8.4.28" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.28.tgz#c6cc681ed00109072816e1557f889ef51cf950a5" integrity sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw== @@ -4379,6 +4527,15 @@ postcss@8.4.28, postcss@^8.4.23: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.23: + version "8.4.29" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.29.tgz#33bc121cf3b3688d4ddef50be869b2a54185a1dd" + integrity sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw== + dependencies: + nanoid "^3.3.6" + picocolors "^1.0.0" + source-map-js "^1.0.2" + prebuild-install@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" @@ -4597,14 +4754,14 @@ readdirp@~3.6.0: picomatch "^2.2.1" reflect.getprototypeof@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.3.tgz#2738fd896fcc3477ffbd4190b40c2458026b6928" - integrity sha512-TTAOZpkJ2YLxl7mVHWrNo3iDMEkYlva/kgFcXndqMgbo/AZUmmavEkdXV+hXtE4P8xdyEKRzalaFqZVuwIk/Nw== + version "1.0.4" + resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz#aaccbf41aca3821b87bb71d9dcbc7ad0ba50a3f3" + integrity sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - get-intrinsic "^1.1.1" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" globalthis "^1.0.3" which-builtin-type "^1.1.3" @@ -4613,7 +4770,7 @@ regenerator-runtime@^0.14.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== -regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: +regexp.prototype.flags@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== @@ -4646,6 +4803,11 @@ remove-accents@0.4.2: resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" integrity sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA== +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" @@ -4711,6 +4873,18 @@ rimraf@3.0.2, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rome@^12.1.3: + version "12.1.3" + resolved "https://registry.yarnpkg.com/rome/-/rome-12.1.3.tgz#4d4d62cad16216843680bd3ca11a4c248134902a" + integrity sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg== + optionalDependencies: + "@rometools/cli-darwin-arm64" "12.1.3" + "@rometools/cli-darwin-x64" "12.1.3" + "@rometools/cli-linux-arm64" "12.1.3" + "@rometools/cli-linux-x64" "12.1.3" + "@rometools/cli-win32-arm64" "12.1.3" + "@rometools/cli-win32-x64" "12.1.3" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4890,14 +5064,15 @@ sprintf-js@~1.0.2: integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== starknet@^5.14.1: - version "5.14.1" - resolved "https://registry.yarnpkg.com/starknet/-/starknet-5.14.1.tgz#97fa5f99c4c24e42ffa315cfda525461d09d6087" - integrity sha512-EtJwQ6RmFsqSLGuMP+PRp4DwNsMYXy63HDnd1plLCdQKl3FMYajqNKf5RbDl03uGU0uE5ctGp+OW3firHuv6IA== + version "5.19.5" + resolved "https://registry.yarnpkg.com/starknet/-/starknet-5.19.5.tgz#59a2e0f707dc1f64fbe9894195984ae97f623449" + integrity sha512-S7V4ifyYd+ApsIwYTd7YA5U2Px+NZkCsQPnmgY/wkc5LLFKhYMNpzHQ5nIA15p70AwtSXCcsEBnHNRBOuci13Q== dependencies: - "@noble/curves" "~1.0.0" + "@noble/curves" "~1.2.0" + "@scure/starknet" "~0.3.0" + abi-wan-kanabi "^1.0.3" isomorphic-fetch "^3.0.0" lossless-json "^2.0.8" - micro-starknet "~0.2.1" pako "^2.0.4" url-join "^4.0.1" @@ -4930,7 +5105,7 @@ string-argv@0.3.2: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4949,17 +5124,17 @@ string-width@^5.0.0, string-width@^5.0.1: strip-ansi "^7.0.1" string.prototype.matchall@^4.0.6, string.prototype.matchall@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" - integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== + version "4.0.9" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.9.tgz#148779de0f75d36b13b15885fec5cadde994520d" + integrity sha512-6i5hL3MqG/K2G43mWXWgP+qizFW/QH/7kCNN13JrJS5q48FN5IKksLDscexKP3dnmB6cdm9jlNgAsWNLpSykmA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - get-intrinsic "^1.1.3" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" has-symbols "^1.0.3" - internal-slot "^1.0.3" - regexp.prototype.flags "^1.4.3" + internal-slot "^1.0.5" + regexp.prototype.flags "^1.5.0" side-channel "^1.0.4" string.prototype.trim@^1.2.7: @@ -4981,13 +5156,13 @@ string.prototype.trimend@^1.0.6: es-abstract "^1.20.4" string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string_decoder@^1.1.1: version "1.3.0" @@ -5350,6 +5525,11 @@ typescript@5.1.6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + typescript@^5.1.6: version "5.2.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" @@ -5370,6 +5550,11 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + unload@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/unload/-/unload-2.2.0.tgz#ccc88fdcad345faa06a92039ec0f80b488880ef7" @@ -5425,6 +5610,13 @@ use-sync-external-store@^1.2.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== +utf-8-validate@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-6.0.3.tgz#7d8c936d854e86b24d1d655f138ee27d2636d777" + integrity sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA== + dependencies: + node-gyp-build "^4.3.0" + util-deprecate@^1.0.1, util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -5442,6 +5634,21 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +viem@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.10.3.tgz#e558ec568f961a5472ba6999528cb4eb7ae31c6f" + integrity sha512-7L35k0JmxTa7xIx1s8lCsTLGrTEUXTYnLppZ56EVBjtvE2OKSfDjL8No0Fnedu6Ye0zi/VX2BQC3arhpKOVIlw== + dependencies: + "@adraffy/ens-normalize" "1.9.4" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@scure/bip32" "1.3.2" + "@scure/bip39" "1.2.1" + "@types/ws" "^8.5.5" + abitype "0.9.8" + isomorphic-ws "5.0.0" + ws "8.13.0" + watchpack@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" @@ -5532,6 +5739,15 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -5546,6 +5762,16 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -5571,6 +5797,24 @@ yaml@^2.1.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yarn@^1.22.19: version "1.22.19" resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" From e699f9242311fba94898b4c95af73d4d8af59deb Mon Sep 17 00:00:00 2001 From: "Yohan @ ScreenshotLabs" Date: Tue, 5 Sep 2023 10:18:45 -0700 Subject: [PATCH 2/5] feat: ability to approve an nft and to list it (#44) * fix: owned link * started listing page * components to approve and list an nft * added type declaration for useLocalStorage --- .../components/token-owner-actions.tsx | 65 ++++++-------- apps/arkmarket/app/components/main-nav.tsx | 3 +- apps/arkmarket/app/profile/page.tsx | 2 - .../profile/sell/components/approve-token.tsx | 25 ++++++ .../profile/sell/components/list-token.tsx | 62 +++++++++++++ .../profile/sell/components/sell-actions.tsx | 58 ++++++++++++ apps/arkmarket/app/profile/sell/page.tsx | 15 ++++ apps/arkmarket/env.mjs | 6 +- apps/arkmarket/hooks/use-local-storage.ts | 90 +++++++++++++++++++ apps/arkmarket/package.json | 1 + yarn.lock | 5 ++ 11 files changed, 291 insertions(+), 41 deletions(-) create mode 100644 apps/arkmarket/app/profile/sell/components/approve-token.tsx create mode 100644 apps/arkmarket/app/profile/sell/components/list-token.tsx create mode 100644 apps/arkmarket/app/profile/sell/components/sell-actions.tsx create mode 100644 apps/arkmarket/app/profile/sell/page.tsx create mode 100644 apps/arkmarket/hooks/use-local-storage.ts diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx index 1a1bf77..bac059a 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx @@ -1,16 +1,21 @@ "use client"; import React from "react"; +import { useRouter } from "next/navigation"; -import { useToast } from "@/hooks/use-toast"; -import { useBurner } from "@/hooks/useBurner"; -import { ReloadIcon } from "@radix-ui/react-icons"; +import { useLocalStorage } from "@/hooks/use-local-storage"; import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { EthIcon } from "@/components/ui/icons"; -import { Input } from "@/components/ui/input"; + +declare module "@uidotdev/usehooks" { + function useLocalStorage( + storageKey: string, + initialState: T + ): [T, (value: T) => void]; +} interface TokenOwnerActionsProps { token: any; @@ -21,30 +26,27 @@ const TokenOwnerActions: React.FC = ({ token, contractAddress }) => { - const { toast } = useToast(); - const { listItem } = useBurner(); - const [isSubmitting, setIsSubmitting] = React.useState(false); - const onItemlist = async () => { - try { - setIsSubmitting(true); - await listItem({ - tokenId: parseInt(token.token_id), - tokenOwnerAddress: token.owner, - contractAddress: token.token_address - }); - toast({ - title: "Order placed", - description: "Your order has been submitted" - }); - setIsSubmitting(false); - } catch (error: any) { - setIsSubmitting(false); - toast({ - title: "Error", - description: error.message - }); + const [listing, setListing] = useLocalStorage<{ + contractAddress: string; + tokenId: string; + }>("listing", { + contractAddress: "", + tokenId: "" + }); + + const router = useRouter(); + + const triggerListing = () => { + if (listing.contractAddress === contractAddress) { + // setListing({ ...listing, tokenIds: [...listing.tokenIds, tokenId] }); + setListing({ ...listing, tokenId: token.tokenId }); + } else { + // setListing({ contractAddress, tokenIds: [tokenId] }); + setListing({ contractAddress, tokenId: token.tokenId }); } + router.push("/profile/sell"); }; + const price = convertWeiPriceToEth(token.listing_price || "0"); return ( @@ -74,16 +76,7 @@ const TokenOwnerActions: React.FC = ({ ) : ( - + )}
diff --git a/apps/arkmarket/app/components/main-nav.tsx b/apps/arkmarket/app/components/main-nav.tsx index 08c7c74..c47653a 100644 --- a/apps/arkmarket/app/components/main-nav.tsx +++ b/apps/arkmarket/app/components/main-nav.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { useAccount } from "@starknet-react/core"; +import { validateAndParseAddress } from "starknet"; import { cn } from "@/lib/utils"; @@ -29,7 +30,7 @@ export function MainNav({ Watchlist Owned diff --git a/apps/arkmarket/app/profile/page.tsx b/apps/arkmarket/app/profile/page.tsx index 3e170d1..f0c0ab5 100644 --- a/apps/arkmarket/app/profile/page.tsx +++ b/apps/arkmarket/app/profile/page.tsx @@ -5,8 +5,6 @@ import { redirect } from "next/navigation"; import { useAccount } from "@starknet-react/core"; -import { Button } from "@/components/ui/button"; - import ConnectWallet from "./components/connect-wallet"; /** diff --git a/apps/arkmarket/app/profile/sell/components/approve-token.tsx b/apps/arkmarket/app/profile/sell/components/approve-token.tsx new file mode 100644 index 0000000..97f3cbe --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/approve-token.tsx @@ -0,0 +1,25 @@ +import React from "react"; + +import { env } from "@/env.mjs"; +import { useContractWrite } from "@starknet-react/core"; + +import { Button } from "@/components/ui/button"; + +interface ApproveTokenProps { + contractAddress: string; +} + +const ApproveToken: React.FC = ({ contractAddress }) => { + const { write } = useContractWrite({ + calls: [ + { + contractAddress, + entrypoint: "set_approval_for_all", + calldata: [env.NEXT_PUBLIC_OPERATOR_ADDRESS, 1] + } + ] + }); + return ; +}; + +export default ApproveToken; diff --git a/apps/arkmarket/app/profile/sell/components/list-token.tsx b/apps/arkmarket/app/profile/sell/components/list-token.tsx new file mode 100644 index 0000000..2ba9455 --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/list-token.tsx @@ -0,0 +1,62 @@ +import { useState } from "react"; + +import { useBurner } from "@/hooks/useBurner"; +import { ReloadIcon } from "@radix-ui/react-icons"; +import { useAccount } from "@starknet-react/core"; + +import { Button } from "@/components/ui/button"; +import { useToast } from "@/components/ui/use-toast"; + +interface ListTokenProps { + contractAddress: string; + tokenId: string; +} + +const ListToken: React.FC = ({ contractAddress, tokenId }) => { + const { address } = useAccount(); + const [isSubmitting, setIsSubmitting] = useState(false); + const { toast } = useToast(); + const { listItem } = useBurner(); + + const onItemlist = async () => { + try { + setIsSubmitting(true); + await listItem({ + tokenId: parseInt(tokenId), + tokenOwnerAddress: address ?? "", + contractAddress + }); + toast({ + title: "Order placed", + description: "Your order has been submitted" + }); + setIsSubmitting(false); + } catch (error: any) { + setIsSubmitting(false); + toast({ + title: "Error", + description: error.message + }); + } + }; + + return ( + + ); +}; + +export default ListToken; diff --git a/apps/arkmarket/app/profile/sell/components/sell-actions.tsx b/apps/arkmarket/app/profile/sell/components/sell-actions.tsx new file mode 100644 index 0000000..775c49f --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/sell-actions.tsx @@ -0,0 +1,58 @@ +"use client"; + +import { env } from "@/env.mjs"; +import { useAccount, useContractRead } from "@starknet-react/core"; +import { useLocalStorage } from "@uidotdev/usehooks"; + +import ApproveToken from "./approve-token"; +import ListToken from "./list-token"; + +const SellActions = () => { + const { address } = useAccount(); + const [{ contractAddress, tokenId }] = useLocalStorage<{ + contractAddress: string; + tokenId: string; + }>("listing", { + contractAddress: "", + tokenId: "" + }); + const { data: isApprovedForAll } = useContractRead({ + abi: [ + { + type: "function", + name: "is_approved_for_all", + inputs: [ + { + name: "owner", + type: "core::starknet::contract_address::ContractAddress" + }, + { + name: "operator", + type: "core::starknet::contract_address::ContractAddress" + } + ], + outputs: [ + { + type: "core::bool" + } + ], + state_mutability: "view" + } + ], + address: contractAddress, + functionName: "is_approved_for_all", + args: [address, env.NEXT_PUBLIC_OPERATOR_ADDRESS], + watch: true + }); + + return ( + <> + {isApprovedForAll ? ( + + ) : ( + + )} + + ); +}; +export default SellActions; diff --git a/apps/arkmarket/app/profile/sell/page.tsx b/apps/arkmarket/app/profile/sell/page.tsx new file mode 100644 index 0000000..fc29933 --- /dev/null +++ b/apps/arkmarket/app/profile/sell/page.tsx @@ -0,0 +1,15 @@ +"use client"; + +import React from "react"; + +import SellActions from "./components/sell-actions"; + +const SellPage = () => { + return ( +
+ +
+ ); +}; + +export default SellPage; diff --git a/apps/arkmarket/env.mjs b/apps/arkmarket/env.mjs index 1054e27..12c2672 100644 --- a/apps/arkmarket/env.mjs +++ b/apps/arkmarket/env.mjs @@ -24,7 +24,8 @@ export const env = createEnv({ NEXT_PUBLIC_ARK_API_DOMAIN: z.string(), NEXT_PUBLIC_ARK_CONTRACT_ADDRESS: z.string(), NEXT_PUBLIC_BROKER_NAME: z.string(), - NEXT_PUBLIC_ARK_CHAIN_ID: z.string() + NEXT_PUBLIC_ARK_CHAIN_ID: z.string(), + NEXT_PUBLIC_OPERATOR_ADDRESS: z.string() }, /* * Due to how Next.js bundles environment variables on Edge and Client, @@ -43,6 +44,7 @@ export const env = createEnv({ NEXT_PUBLIC_ARK_CONTRACT_ADDRESS: process.env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, NEXT_PUBLIC_BROKER_NAME: process.env.NEXT_PUBLIC_BROKER_NAME, - NEXT_PUBLIC_ARK_CHAIN_ID: process.env.NEXT_PUBLIC_ARK_CHAIN_ID + NEXT_PUBLIC_ARK_CHAIN_ID: process.env.NEXT_PUBLIC_ARK_CHAIN_ID, + NEXT_PUBLIC_OPERATOR_ADDRESS: process.env.NEXT_PUBLIC_OPERATOR_ADDRESS } }); diff --git a/apps/arkmarket/hooks/use-local-storage.ts b/apps/arkmarket/hooks/use-local-storage.ts new file mode 100644 index 0000000..e044b3b --- /dev/null +++ b/apps/arkmarket/hooks/use-local-storage.ts @@ -0,0 +1,90 @@ +import React, { useCallback, useEffect } from "react"; + +const dispatchStorageEvent = (key: string, newValue: string | null): void => { + window.dispatchEvent(new StorageEvent("storage", { key, newValue })); +}; + +const setLocalStorageItem = (key: string, value: any): void => { + const stringifiedValue = JSON.stringify(value); + window.localStorage.setItem(key, stringifiedValue); + // Assuming dispatchStorageEvent is defined elsewhere in your code + dispatchStorageEvent(key, stringifiedValue); +}; + +const removeLocalStorageItem = (key: string): void => { + window.localStorage.removeItem(key); + dispatchStorageEvent(key, null); +}; + +const getLocalStorageItem = (key: string): string | null => { + return window.localStorage.getItem(key); +}; + +const useLocalStorageSubscribe = ( + callback: EventListenerOrEventListenerObject +): (() => void) => { + window.addEventListener("storage", callback); + return () => window.removeEventListener("storage", callback); +}; + +const getLocalStorageServerSnapshot = (): never => { + throw Error("useLocalStorage is a client-only hook"); +}; + +export function useLocalStorage( + key: string, + initialValue: T +): [T, React.Dispatch>] { + const getSnapshot = (): T | null => { + const item = getLocalStorageItem(key); + return item ? JSON.parse(item) : null; + }; + + const store = React.useSyncExternalStore( + useLocalStorageSubscribe, + getSnapshot, + getLocalStorageServerSnapshot + ); + + const setState = useCallback( + (v: React.SetStateAction): void => { + try { + const parsedStore = + store && typeof store === "string" ? JSON.parse(store) : null; + + let nextState: T | null = null; + + if (typeof v === "function") { + const updaterFn = v as (prevState: T) => T; // Type assertion here + nextState = updaterFn(parsedStore); + } else { + // If v is not a function, it must be of type T + nextState = v; + } + + if (nextState === undefined || nextState === null) { + removeLocalStorageItem(key); + } else { + setLocalStorageItem(key, nextState); + } + } catch (e) { + console.warn(e); + } + }, + [key, store] + ); + + useEffect(() => { + if ( + getLocalStorageItem(key) === null && + typeof initialValue !== "undefined" + ) { + setLocalStorageItem(key, initialValue); + } + }, [key, initialValue]); + + return [ + store && typeof store === "string" ? JSON.parse(store) : initialValue, + setState + ]; +} diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index fb8bc00..3d12aec 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -32,6 +32,7 @@ "@types/node": "20.5.1", "@types/react": "18.2.20", "@types/react-dom": "18.2.7", + "@uidotdev/usehooks": "^2.2.0", "add": "^2.0.6", "autoprefixer": "10.4.15", "bufferutil": "^4.0.7", diff --git a/yarn.lock b/yarn.lock index 2e777c8..e8fb42a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1573,6 +1573,11 @@ "@typescript-eslint/types" "6.6.0" eslint-visitor-keys "^3.4.1" +"@uidotdev/usehooks@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@uidotdev/usehooks/-/usehooks-2.2.0.tgz#62e811350b95145d780145c1bf715005ec02282a" + integrity sha512-K4tirEf3lvEgi/Z6Pv2aNR8r6YCobfg0N5AOkn3hhuWtGS8n7mMSL7RGFpE2Bj56oeLGGZXrVKteEwg4vGitGA== + abi-wan-kanabi@^1.0.1, abi-wan-kanabi@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abi-wan-kanabi/-/abi-wan-kanabi-1.0.3.tgz#0d8607f2a2ccb2151a69debea1c3bb68b76c5aa2" From 4e3f1566427e0d7d658924c0f7f7b859ad12e59d Mon Sep 17 00:00:00 2001 From: kwiss Date: Wed, 6 Sep 2023 01:38:10 +0200 Subject: [PATCH 3/5] feat(listing): add listing page with date & price + adjust approuve --- .../components/token-owner-actions.tsx | 36 +++--- .../profile/sell/components/approve-token.tsx | 5 +- .../profile/sell/components/date-picker.tsx | 59 ++++++++++ .../profile/sell/components/list-token.tsx | 55 ++++++--- .../profile/sell/components/sell-actions.tsx | 58 --------- .../profile/sell/components/sell-content.tsx | 60 ++++++++++ .../profile/sell/components/sell-sidebar.tsx | 110 ++++++++++++++++++ .../app/profile/sell/components/sell.tsx | 60 ++++++++++ apps/arkmarket/app/profile/sell/page.tsx | 8 +- apps/arkmarket/components/ui/calendar.tsx | 71 +++++++++++ apps/arkmarket/hooks/use-local-storage.ts | 90 -------------- apps/arkmarket/hooks/useBurner.ts | 11 +- apps/arkmarket/package.json | 4 + 13 files changed, 429 insertions(+), 198 deletions(-) create mode 100644 apps/arkmarket/app/profile/sell/components/date-picker.tsx delete mode 100644 apps/arkmarket/app/profile/sell/components/sell-actions.tsx create mode 100644 apps/arkmarket/app/profile/sell/components/sell-content.tsx create mode 100644 apps/arkmarket/app/profile/sell/components/sell-sidebar.tsx create mode 100644 apps/arkmarket/app/profile/sell/components/sell.tsx create mode 100644 apps/arkmarket/components/ui/calendar.tsx diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx index bac059a..57472be 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx @@ -3,47 +3,41 @@ import React from "react"; import { useRouter } from "next/navigation"; -import { useLocalStorage } from "@/hooks/use-local-storage"; +import { useLocalStorage } from "usehooks-ts"; import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { EthIcon } from "@/components/ui/icons"; -declare module "@uidotdev/usehooks" { - function useLocalStorage( - storageKey: string, - initialState: T - ): [T, (value: T) => void]; -} - interface TokenOwnerActionsProps { token: any; contractAddress: string; } +interface Listing { + contractAddress: string | null; + tokenId: string | null; +} + const TokenOwnerActions: React.FC = ({ token, contractAddress }) => { - const [listing, setListing] = useLocalStorage<{ - contractAddress: string; - tokenId: string; - }>("listing", { - contractAddress: "", - tokenId: "" + + const [listing, setListing] = useLocalStorage("listing", { + contractAddress: null, + tokenId: null }); const router = useRouter(); const triggerListing = () => { - if (listing.contractAddress === contractAddress) { - // setListing({ ...listing, tokenIds: [...listing.tokenIds, tokenId] }); - setListing({ ...listing, tokenId: token.tokenId }); - } else { - // setListing({ contractAddress, tokenIds: [tokenId] }); - setListing({ contractAddress, tokenId: token.tokenId }); - } + // if (listing.contractAddress === contractAddress) { + // setListing((prevValue: Listing) => ({ ...prevValue, tokenId: token.tokenId })) + // } else { + setListing({ contractAddress: contractAddress, tokenId: token.token_id }); + // } router.push("/profile/sell"); }; diff --git a/apps/arkmarket/app/profile/sell/components/approve-token.tsx b/apps/arkmarket/app/profile/sell/components/approve-token.tsx index 97f3cbe..dcfb7fb 100644 --- a/apps/arkmarket/app/profile/sell/components/approve-token.tsx +++ b/apps/arkmarket/app/profile/sell/components/approve-token.tsx @@ -3,13 +3,16 @@ import React from "react"; import { env } from "@/env.mjs"; import { useContractWrite } from "@starknet-react/core"; + import { Button } from "@/components/ui/button"; interface ApproveTokenProps { contractAddress: string; } -const ApproveToken: React.FC = ({ contractAddress }) => { +const ApproveToken: React.FC = ({ + contractAddress +}) => { const { write } = useContractWrite({ calls: [ { diff --git a/apps/arkmarket/app/profile/sell/components/date-picker.tsx b/apps/arkmarket/app/profile/sell/components/date-picker.tsx new file mode 100644 index 0000000..24f3249 --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/date-picker.tsx @@ -0,0 +1,59 @@ +"use client"; + +import * as React from "react"; + +import { CalendarIcon } from "@radix-ui/react-icons"; +import { format } from "date-fns"; +import dayjs from "dayjs"; + +import { cn } from "@/lib/utils"; +import { Button } from "@/components/ui/button"; +import { Calendar } from "@/components/ui/calendar"; +import { + Popover, + PopoverContent, + PopoverTrigger +} from "@/components/ui/popover"; + +interface DatePickerProps { + orderData: { + price: string; + endDate: number; + }; + setOrderData: (data: { price: string; endDate: number }) => void; +} + +const DatePicker: React.FC = ({ setOrderData, orderData }) => { + const date = dayjs.unix(orderData.endDate).toDate(); + return ( + + + + + + { + setOrderData({ + price: orderData.price, + endDate: dayjs(date).unix() + }); + }} + initialFocus + /> + + + ); +}; + +export { DatePicker }; diff --git a/apps/arkmarket/app/profile/sell/components/list-token.tsx b/apps/arkmarket/app/profile/sell/components/list-token.tsx index 2ba9455..a6d2998 100644 --- a/apps/arkmarket/app/profile/sell/components/list-token.tsx +++ b/apps/arkmarket/app/profile/sell/components/list-token.tsx @@ -1,30 +1,52 @@ +import { format } from "path"; import { useState } from "react"; +import { useToast } from "@/hooks/use-toast"; import { useBurner } from "@/hooks/useBurner"; import { ReloadIcon } from "@radix-ui/react-icons"; import { useAccount } from "@starknet-react/core"; +import dayjs from "dayjs"; +import { parseEther } from "viem"; import { Button } from "@/components/ui/button"; -import { useToast } from "@/components/ui/use-toast"; interface ListTokenProps { contractAddress: string; tokenId: string; + orderData: { + price: string; + endDate: number; + }; } -const ListToken: React.FC = ({ contractAddress, tokenId }) => { +const ListToken: React.FC = ({ + orderData, + contractAddress, + tokenId +}) => { const { address } = useAccount(); const [isSubmitting, setIsSubmitting] = useState(false); const { toast } = useToast(); const { listItem } = useBurner(); - + const endDate = dayjs().add(30, "day").unix(); + const price = parseEther(orderData.price); const onItemlist = async () => { + if (orderData.price === undefined) { + toast({ + variant: "destructive", + title: "Error", + description: "Please enter a price" + }); + return; + } try { setIsSubmitting(true); await listItem({ tokenId: parseInt(tokenId), tokenOwnerAddress: address ?? "", - contractAddress + contractAddress, + endDate, + price }); toast({ title: "Order placed", @@ -41,21 +63,16 @@ const ListToken: React.FC = ({ contractAddress, tokenId }) => { }; return ( - + ); }; diff --git a/apps/arkmarket/app/profile/sell/components/sell-actions.tsx b/apps/arkmarket/app/profile/sell/components/sell-actions.tsx deleted file mode 100644 index 775c49f..0000000 --- a/apps/arkmarket/app/profile/sell/components/sell-actions.tsx +++ /dev/null @@ -1,58 +0,0 @@ -"use client"; - -import { env } from "@/env.mjs"; -import { useAccount, useContractRead } from "@starknet-react/core"; -import { useLocalStorage } from "@uidotdev/usehooks"; - -import ApproveToken from "./approve-token"; -import ListToken from "./list-token"; - -const SellActions = () => { - const { address } = useAccount(); - const [{ contractAddress, tokenId }] = useLocalStorage<{ - contractAddress: string; - tokenId: string; - }>("listing", { - contractAddress: "", - tokenId: "" - }); - const { data: isApprovedForAll } = useContractRead({ - abi: [ - { - type: "function", - name: "is_approved_for_all", - inputs: [ - { - name: "owner", - type: "core::starknet::contract_address::ContractAddress" - }, - { - name: "operator", - type: "core::starknet::contract_address::ContractAddress" - } - ], - outputs: [ - { - type: "core::bool" - } - ], - state_mutability: "view" - } - ], - address: contractAddress, - functionName: "is_approved_for_all", - args: [address, env.NEXT_PUBLIC_OPERATOR_ADDRESS], - watch: true - }); - - return ( - <> - {isApprovedForAll ? ( - - ) : ( - - )} - - ); -}; -export default SellActions; diff --git a/apps/arkmarket/app/profile/sell/components/sell-content.tsx b/apps/arkmarket/app/profile/sell/components/sell-content.tsx new file mode 100644 index 0000000..4a0a7ec --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/sell-content.tsx @@ -0,0 +1,60 @@ +"use client"; + +import React from "react"; + +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import Image from "@/components/ui/image"; +import { Input } from "@/components/ui/input"; + +import { DatePicker } from "./date-picker"; + +interface SellContentProps { + contractAddress: string; + tokenId: string; + setOrderData: (data: { price: string; endDate: number }) => void; + orderData: { + price: string; + endDate: number; + }; +} + +const SellContent: React.FC = ({ + contractAddress, + tokenId, + orderData, + setOrderData +}) => { + return ( + + + Summary + + +
+ placeholder +
{contractAddress}
+
{tokenId}
+ { + setOrderData({ + price: e.target.value, + endDate: orderData.endDate + }); + }} + /> +
+ +
+
+
+
+ ); +}; + +export default SellContent; diff --git a/apps/arkmarket/app/profile/sell/components/sell-sidebar.tsx b/apps/arkmarket/app/profile/sell/components/sell-sidebar.tsx new file mode 100644 index 0000000..c941caa --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/sell-sidebar.tsx @@ -0,0 +1,110 @@ +"use client"; + +import { env } from "@/env.mjs"; +import { useContractRead } from "@starknet-react/core"; +import dayjs from "dayjs"; + +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle +} from "@/components/ui/card"; + +import ApproveToken from "./approve-token"; +import ListToken from "./list-token"; + +interface SellSidebarProps { + contractAddress: string; + tokenId: string; + address: string; + orderData: { + price: string; + endDate: number; + }; +} + +const SellSidebar: React.FC = ({ + contractAddress, + tokenId, + address, + orderData +}) => { + const { data: isApprovedForAll } = useContractRead({ + abi: [ + { + type: "function", + name: "is_approved_for_all", + inputs: [ + { + name: "owner", + type: "core::starknet::contract_address::ContractAddress" + }, + { + name: "operator", + type: "core::starknet::contract_address::ContractAddress" + } + ], + outputs: [ + { + type: "core::bool" + } + ], + state_mutability: "view" + } + ], + address: contractAddress, + functionName: "is_approved_for_all", + args: [address, env.NEXT_PUBLIC_OPERATOR_ADDRESS], + watch: true + }); + + if (!contractAddress || !tokenId || !address) + return ( +
+

Sell

+

Select a token to sell

+
+ ); + + const date = dayjs.unix(orderData.endDate).toDate().toISOString(); + const formattedDate = dayjs(date).format("DD/MM/YYYY"); + + return ( + + + Summary + +
+
+ {orderData.price && ( +
Listing price: {orderData.price} eth
+ )} +
+
+ {orderData.endDate && ( +
Listing end date: {formattedDate}
+ )} +
+
+
+
+ + <> + {isApprovedForAll ? ( + + ) : ( + + )} + + +
+ ); +}; + +export default SellSidebar; diff --git a/apps/arkmarket/app/profile/sell/components/sell.tsx b/apps/arkmarket/app/profile/sell/components/sell.tsx new file mode 100644 index 0000000..821aa58 --- /dev/null +++ b/apps/arkmarket/app/profile/sell/components/sell.tsx @@ -0,0 +1,60 @@ +"use client"; + +import React from "react"; + +import { useAccount } from "@starknet-react/core"; +import { useReadLocalStorage } from "usehooks-ts"; + +import SellContent from "./sell-content"; +import SellSidebar from "./sell-sidebar"; +import dayjs from "dayjs"; + +interface ListTokenProps { + contractAddress: string; + tokenId: string; +} + +const Sell = () => { + const listing = useReadLocalStorage("listing"); + const contractAddress = listing?.contractAddress ?? null; + const tokenId = listing?.tokenId ?? null; + const { address } = useAccount(); + const [orderData, setOrderData] = React.useState<{ + price: string; + endDate: number; + }>({ + price: "0.1", + endDate: dayjs().add(30, "day").unix() + }); + + if (!contractAddress || !tokenId || !address) + return ( +
+

Sell

+

Select a token to sell

+
+ ); + + return ( + <> +
+ +
+
+ +
+ + ); +}; + +export default Sell; diff --git a/apps/arkmarket/app/profile/sell/page.tsx b/apps/arkmarket/app/profile/sell/page.tsx index fc29933..3c7ab57 100644 --- a/apps/arkmarket/app/profile/sell/page.tsx +++ b/apps/arkmarket/app/profile/sell/page.tsx @@ -1,13 +1,11 @@ -"use client"; - import React from "react"; -import SellActions from "./components/sell-actions"; +import Sell from "./components/sell"; const SellPage = () => { return ( -
- +
+
); }; diff --git a/apps/arkmarket/components/ui/calendar.tsx b/apps/arkmarket/components/ui/calendar.tsx new file mode 100644 index 0000000..6c08e3a --- /dev/null +++ b/apps/arkmarket/components/ui/calendar.tsx @@ -0,0 +1,71 @@ +"use client" + +import * as React from "react" +import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons" +import { DayPicker } from "react-day-picker" + +import { cn } from "@/lib/utils" +import { buttonVariants } from "@/components/ui/button" + +export type CalendarProps = React.ComponentProps + +function Calendar({ + className, + classNames, + showOutsideDays = true, + ...props +}: CalendarProps) { + return ( + .day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" + : "[&:has([aria-selected])]:rounded-md" + ), + day: cn( + buttonVariants({ variant: "ghost" }), + "h-8 w-8 p-0 font-normal aria-selected:opacity-100" + ), + day_range_start: "day-range-start", + day_range_end: "day-range-end", + day_selected: + "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", + day_today: "bg-accent text-accent-foreground", + day_outside: "text-muted-foreground opacity-50", + day_disabled: "text-muted-foreground opacity-50", + day_range_middle: + "aria-selected:bg-accent aria-selected:text-accent-foreground", + day_hidden: "invisible", + ...classNames, + }} + components={{ + IconLeft: ({ ...props }) => , + IconRight: ({ ...props }) => , + }} + {...props} + /> + ) +} +Calendar.displayName = "Calendar" + +export { Calendar } diff --git a/apps/arkmarket/hooks/use-local-storage.ts b/apps/arkmarket/hooks/use-local-storage.ts index e044b3b..e69de29 100644 --- a/apps/arkmarket/hooks/use-local-storage.ts +++ b/apps/arkmarket/hooks/use-local-storage.ts @@ -1,90 +0,0 @@ -import React, { useCallback, useEffect } from "react"; - -const dispatchStorageEvent = (key: string, newValue: string | null): void => { - window.dispatchEvent(new StorageEvent("storage", { key, newValue })); -}; - -const setLocalStorageItem = (key: string, value: any): void => { - const stringifiedValue = JSON.stringify(value); - window.localStorage.setItem(key, stringifiedValue); - // Assuming dispatchStorageEvent is defined elsewhere in your code - dispatchStorageEvent(key, stringifiedValue); -}; - -const removeLocalStorageItem = (key: string): void => { - window.localStorage.removeItem(key); - dispatchStorageEvent(key, null); -}; - -const getLocalStorageItem = (key: string): string | null => { - return window.localStorage.getItem(key); -}; - -const useLocalStorageSubscribe = ( - callback: EventListenerOrEventListenerObject -): (() => void) => { - window.addEventListener("storage", callback); - return () => window.removeEventListener("storage", callback); -}; - -const getLocalStorageServerSnapshot = (): never => { - throw Error("useLocalStorage is a client-only hook"); -}; - -export function useLocalStorage( - key: string, - initialValue: T -): [T, React.Dispatch>] { - const getSnapshot = (): T | null => { - const item = getLocalStorageItem(key); - return item ? JSON.parse(item) : null; - }; - - const store = React.useSyncExternalStore( - useLocalStorageSubscribe, - getSnapshot, - getLocalStorageServerSnapshot - ); - - const setState = useCallback( - (v: React.SetStateAction): void => { - try { - const parsedStore = - store && typeof store === "string" ? JSON.parse(store) : null; - - let nextState: T | null = null; - - if (typeof v === "function") { - const updaterFn = v as (prevState: T) => T; // Type assertion here - nextState = updaterFn(parsedStore); - } else { - // If v is not a function, it must be of type T - nextState = v; - } - - if (nextState === undefined || nextState === null) { - removeLocalStorageItem(key); - } else { - setLocalStorageItem(key, nextState); - } - } catch (e) { - console.warn(e); - } - }, - [key, store] - ); - - useEffect(() => { - if ( - getLocalStorageItem(key) === null && - typeof initialValue !== "undefined" - ) { - setLocalStorageItem(key, initialValue); - } - }, [key, initialValue]); - - return [ - store && typeof store === "string" ? JSON.parse(store) : initialValue, - setState - ]; -} diff --git a/apps/arkmarket/hooks/useBurner.ts b/apps/arkmarket/hooks/useBurner.ts index 5c7b1c4..7dc1f92 100644 --- a/apps/arkmarket/hooks/useBurner.ts +++ b/apps/arkmarket/hooks/useBurner.ts @@ -89,11 +89,15 @@ export const useBurner = () => { async ({ tokenId, tokenOwnerAddress, - contractAddress + contractAddress, + endDate, + price }: { tokenId: number; tokenOwnerAddress: string; contractAddress: string; + endDate: number; + price: bigint; }) => { if (account === undefined) { throw new Error("Burner not deployed"); @@ -105,8 +109,8 @@ export const useBurner = () => { seller: tokenOwnerAddress, collection: contractAddress, token_id: cairo.uint256(tokenId), - price: cairo.uint256(100000000), - end_date: "0", + price: cairo.uint256(price), + end_date: endDate, // Change broker name for current env broker broker_name: shortString.encodeShortString( env.NEXT_PUBLIC_BROKER_NAME @@ -187,7 +191,6 @@ export const useBurner = () => { setAccount(burner); setIsDeploying(false); Storage.set("burners", storage); - console.log("burner created: ", address); return address; }, []); diff --git a/apps/arkmarket/package.json b/apps/arkmarket/package.json index 3d12aec..3f10a66 100644 --- a/apps/arkmarket/package.json +++ b/apps/arkmarket/package.json @@ -39,6 +39,8 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "cmdk": "^0.2.0", + "date-fns": "^2.30.0", + "dayjs": "^1.11.9", "dotenv-cli": "^7.3.0", "eslint": "8.47.0", "eslint-config-next": "13.4.19", @@ -49,6 +51,7 @@ "next-themes": "^0.2.1", "postcss": "8.4.28", "react": "18.2.0", + "react-day-picker": "^8.8.1", "react-dom": "18.2.0", "react-query": "^3.39.3", "starknet": "https://github.com/kwiss/starknet.js/#9f32bb26408132c521b7bdb113a7d3b5a199e292", @@ -56,6 +59,7 @@ "tailwindcss": "3.3.3", "tailwindcss-animate": "^1.0.6", "typescript": "5.1.6", + "usehooks-ts": "^2.9.1", "utf-8-validate": "^6.0.3", "viem": "^1.10.3", "yarn": "^1.22.19", From 25b9467d5683f34fb6da416fa04712c725b8315b Mon Sep 17 00:00:00 2001 From: kwiss Date: Wed, 6 Sep 2023 14:25:24 +0200 Subject: [PATCH 4/5] feat(buy): add buy & approuve, it miss orderhash --- .../components/token-public-actions.tsx | 104 +++++++++++++----- .../(token)/[address]/[token_id]/page.tsx | 6 +- .../[address]/components/owner-collection.tsx | 4 +- apps/arkmarket/app/profile/[address]/page.tsx | 6 +- apps/arkmarket/env.mjs | 7 +- yarn.lock | 24 +++- 6 files changed, 110 insertions(+), 41 deletions(-) diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx index 4800694..fccb253 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx @@ -1,15 +1,21 @@ -import React from "react"; +import React, { useEffect } from "react"; +import { env } from "@/env.mjs"; import { useToast } from "@/hooks/use-toast"; import { useBurner } from "@/hooks/useBurner"; import { ReloadIcon } from "@radix-ui/react-icons"; -import { useAccount, useContractWrite } from "@starknet-react/core"; -import { cairo, validateAndParseAddress } from "starknet"; +import { + useAccount, + useContractRead, + useContractWrite +} from "@starknet-react/core"; +import { cairo, uint256, validateAndParseAddress } from "starknet"; +import { parseEther } from "viem"; +import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { EthIcon } from "@/components/ui/icons"; -import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; interface TokenPublicActionsProps { token: any; @@ -21,42 +27,84 @@ const TokenPublicActions: React.FC = ({ token }) => { const { buyItem } = useBurner(); const [isSubmitting, setIsSubmitting] = React.useState(false); + const price = convertWeiPriceToEth(token.listing_price || "0"); + + const u256Price = cairo.uint256(token.listing_price); const { write } = useContractWrite({ calls: [ { - contractAddress: - "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + contractAddress: env.NEXT_PUBLIC_ETH_CONTRACT_ADDRESS, entrypoint: "approve", calldata: [ - "0x06495ae175214d51ce8cff05ce3ea0c75aa50c7fdcd7531eee358f2065bf524b", - cairo.uint256(100) + env.NEXT_PUBLIC_OPERATOR_ADDRESS, + u256Price.low, + u256Price.high ] } ] }); + const { data: amount } = useContractRead({ + abi: [ + { + type: "function", + name: "allowance", + inputs: [ + { + name: "owner", + type: "core::starknet::contract_address::ContractAddress" + }, + { + name: "spender", + type: "core::starknet::contract_address::ContractAddress" + } + ], + outputs: [ + { + type: "core::uint256" + } + ], + state_mutability: "view" + } + ], + address: env.NEXT_PUBLIC_ETH_CONTRACT_ADDRESS, + functionName: "allowance", + args: [address, env.NEXT_PUBLIC_OPERATOR_ADDRESS], + watch: true + }); + const onItemBuy = async () => { - await write(); - // try { - // setIsSubmitting(true); - // if (!address) throw new Error("Please connect your wallet first."); - // await buyItem({ - // address: validateAndParseAddress(address) - // }); - // toast({ - // title: "Item bought", - // description: "You have successfully bought this item." - // }); - // setIsSubmitting(false); - // } catch (error: any) { - // setIsSubmitting(false); - // toast({ - // title: "Error", - // description: error.message - // }); - // } + if (amount === undefined) { + await write(); + } + setIsSubmitting(true); }; - const price = convertWeiPriceToEth(token.listing_price || "0"); + + useEffect(() => { + const buyItemAsync = async () => { + try { + if (!address) throw new Error("Please connect your wallet first."); + await buyItem({ + address: validateAndParseAddress(address) + }); + toast({ + title: "Item bought", + description: "You have successfully bought this item." + }); + setIsSubmitting(false); + } catch (error: any) { + setIsSubmitting(false); + toast({ + title: "Error", + description: error.message + }); + } + }; + if (amount !== undefined && isSubmitting) { + buyItemAsync(); + } + }, [amount, isSubmitting, address, buyItem, toast]); + return ( diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx index c494f8e..970b75f 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx @@ -27,15 +27,13 @@ const getToken = async (address: string, token_id: string) => { const Page: React.FC = async ({ params }) => { const token = await getToken(params.address, params.token_id); + return (
- +
diff --git a/apps/arkmarket/app/profile/[address]/components/owner-collection.tsx b/apps/arkmarket/app/profile/[address]/components/owner-collection.tsx index 917015d..cfd39fc 100644 --- a/apps/arkmarket/app/profile/[address]/components/owner-collection.tsx +++ b/apps/arkmarket/app/profile/[address]/components/owner-collection.tsx @@ -1,6 +1,7 @@ import React from "react"; import { env } from "@/env.mjs"; +import { validateAndParseAddress } from "starknet"; import OnwerCollectionItems from "./owner-collection-items"; @@ -31,7 +32,8 @@ const OwnerCollection: React.FC = async ({ address, name }) => { - const collectionItems = await fetchNfts(address); + const validAddress = validateAndParseAddress(address); + const collectionItems = await fetchNfts(validAddress); return ( ; + return ; } diff --git a/apps/arkmarket/env.mjs b/apps/arkmarket/env.mjs index 12c2672..e5b6245 100644 --- a/apps/arkmarket/env.mjs +++ b/apps/arkmarket/env.mjs @@ -25,7 +25,8 @@ export const env = createEnv({ NEXT_PUBLIC_ARK_CONTRACT_ADDRESS: z.string(), NEXT_PUBLIC_BROKER_NAME: z.string(), NEXT_PUBLIC_ARK_CHAIN_ID: z.string(), - NEXT_PUBLIC_OPERATOR_ADDRESS: z.string() + NEXT_PUBLIC_OPERATOR_ADDRESS: z.string(), + NEXT_PUBLIC_ETH_CONTRACT_ADDRESS: z.string() }, /* * Due to how Next.js bundles environment variables on Edge and Client, @@ -45,6 +46,8 @@ export const env = createEnv({ process.env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, NEXT_PUBLIC_BROKER_NAME: process.env.NEXT_PUBLIC_BROKER_NAME, NEXT_PUBLIC_ARK_CHAIN_ID: process.env.NEXT_PUBLIC_ARK_CHAIN_ID, - NEXT_PUBLIC_OPERATOR_ADDRESS: process.env.NEXT_PUBLIC_OPERATOR_ADDRESS + NEXT_PUBLIC_OPERATOR_ADDRESS: process.env.NEXT_PUBLIC_OPERATOR_ADDRESS, + NEXT_PUBLIC_ETH_CONTRACT_ADDRESS: + process.env.NEXT_PUBLIC_ETH_CONTRACT_ADDRESS } }); diff --git a/yarn.lock b/yarn.lock index e8fb42a..29b8be9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -197,7 +197,7 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.15.tgz#d34592bfe288a32e741aa0663dbc4829fcd55160" integrity sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA== -"@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.20.7", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2": +"@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== @@ -2195,6 +2195,18 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== +date-fns@^2.30.0: + version "2.30.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== + dependencies: + "@babel/runtime" "^7.21.0" + +dayjs@^1.11.9: + version "1.11.9" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a" + integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA== + debug@4.3.4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -4648,6 +4660,11 @@ rc@1.2.8, rc@^1.2.7, rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-day-picker@^8.8.1: + version "8.8.1" + resolved "https://registry.yarnpkg.com/react-day-picker/-/react-day-picker-8.8.1.tgz#44474c6f7f346ea28796974d7a065d5572f4cd38" + integrity sha512-U7RsRoRI5pyMXhKq54hS9yM11WEGkPf8hIdrxIM/sefgmQjuxazqgwcZFMiPZW/K9vtmzLZFf9bLW0wVsGYd5w== + react-dom@18.2.0, react-dom@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" @@ -5615,6 +5632,11 @@ use-sync-external-store@^1.2.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== +usehooks-ts@^2.9.1: + version "2.9.1" + resolved "https://registry.yarnpkg.com/usehooks-ts/-/usehooks-ts-2.9.1.tgz#953d3284851ffd097432379e271ce046a8180b37" + integrity sha512-2FAuSIGHlY+apM9FVlj8/oNhd+1y+Uwv5QNkMQz1oSfdHk4PXo1qoCw9I5M7j0vpH8CSWFJwXbVPeYDjLCx9PA== + utf-8-validate@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-6.0.3.tgz#7d8c936d854e86b24d1d655f138ee27d2636d777" From 73de5925724f7365343ee038e2c88279c95112ce Mon Sep 17 00:00:00 2001 From: kwiss Date: Mon, 11 Sep 2023 11:23:15 +0200 Subject: [PATCH 5/5] feat(manager): update managers --- .vscode/settings.json | 14 +++++++++++++ .../[token_id]/components/token-actions.tsx | 1 + .../components/token-owner-actions.tsx | 20 ------------------- .../components/token-public-actions.tsx | 13 +++++++----- .../(token)/[address]/[token_id]/page.tsx | 1 - apps/arkmarket/env.mjs | 6 +++--- apps/arkmarket/hooks/useBurner.ts | 17 ++++++++++------ apps/starknet/src/executor.cairo | 1 - 8 files changed, 37 insertions(+), 36 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..aab1f65 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "workbench.colorCustomizations": { + "sash.hoverBorder": "#ae91f6", + "statusBar.background": "#8c62f2", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#ae91f6", + "statusBarItem.remoteBackground": "#8c62f2", + "statusBarItem.remoteForeground": "#e7e7e7" + }, + "peacock.color": "#8c62f2", + "peacock.affectActivityBar": false, + "peacock.affectStatusBar": true, + "peacock.affectTitleBar": false, +} \ No newline at end of file diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx index cf34811..90ad7a3 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-actions.tsx @@ -17,6 +17,7 @@ const TokenActions: React.FC = ({ token, contractAddress }) => { + console.log(token); const { address } = useAccount(); const [walletAddress, setWalletAddress] = React.useState(""); React.useEffect(() => { diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx index 57472be..d9fe815 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-owner-actions.tsx @@ -73,26 +73,6 @@ const TokenOwnerActions: React.FC = ({ )}
-
-
- Expiration - 3 days -
-
- Listed - 5h ago -
-
- Created by - Team Everai -
-
- - Floor Difference - - +1% -
-
diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx index fccb253..ba520a9 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/components/token-public-actions.tsx @@ -9,7 +9,7 @@ import { useContractRead, useContractWrite } from "@starknet-react/core"; -import { cairo, uint256, validateAndParseAddress } from "starknet"; +import { cairo, validateAndParseAddress } from "starknet"; import { parseEther } from "viem"; import { convertWeiPriceToEth } from "@/lib/utils/convertPrice"; @@ -26,8 +26,8 @@ const TokenPublicActions: React.FC = ({ token }) => { const { toast } = useToast(); const { buyItem } = useBurner(); const [isSubmitting, setIsSubmitting] = React.useState(false); - const price = convertWeiPriceToEth(token.listing_price || "0"); + const bigNumberPrice = parseEther(price); const u256Price = cairo.uint256(token.listing_price); const { write } = useContractWrite({ @@ -44,7 +44,7 @@ const TokenPublicActions: React.FC = ({ token }) => { ] }); - const { data: amount } = useContractRead({ + const { data } = useContractRead({ abi: [ { type: "function", @@ -73,8 +73,10 @@ const TokenPublicActions: React.FC = ({ token }) => { watch: true }); + const amount = data as bigint | undefined; + const isAllowed = amount && amount >= bigNumberPrice; const onItemBuy = async () => { - if (amount === undefined) { + if (!isAllowed) { await write(); } setIsSubmitting(true); @@ -85,6 +87,7 @@ const TokenPublicActions: React.FC = ({ token }) => { try { if (!address) throw new Error("Please connect your wallet first."); await buyItem({ + order_hash: token.listing_order_hash, address: validateAndParseAddress(address) }); toast({ @@ -103,7 +106,7 @@ const TokenPublicActions: React.FC = ({ token }) => { if (amount !== undefined && isSubmitting) { buyItemAsync(); } - }, [amount, isSubmitting, address, buyItem, toast]); + }, [amount, isSubmitting, address, buyItem, toast, token]); return ( diff --git a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx index 970b75f..196294a 100644 --- a/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx +++ b/apps/arkmarket/app/collection/(token)/[address]/[token_id]/page.tsx @@ -27,7 +27,6 @@ const getToken = async (address: string, token_id: string) => { const Page: React.FC = async ({ params }) => { const token = await getToken(params.address, params.token_id); - return (
diff --git a/apps/arkmarket/env.mjs b/apps/arkmarket/env.mjs index e5b6245..ddf4a0a 100644 --- a/apps/arkmarket/env.mjs +++ b/apps/arkmarket/env.mjs @@ -22,7 +22,7 @@ export const env = createEnv({ NEXT_PUBLIC_ADMIN_PRIVATE_KEY: z.string(), NEXT_PUBLIC_ACCOUNT_CLASS_HASH: z.string(), NEXT_PUBLIC_ARK_API_DOMAIN: z.string(), - NEXT_PUBLIC_ARK_CONTRACT_ADDRESS: z.string(), + NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS: z.string(), NEXT_PUBLIC_BROKER_NAME: z.string(), NEXT_PUBLIC_ARK_CHAIN_ID: z.string(), NEXT_PUBLIC_OPERATOR_ADDRESS: z.string(), @@ -42,8 +42,8 @@ export const env = createEnv({ NEXT_PUBLIC_ADMIN_PRIVATE_KEY: process.env.NEXT_PUBLIC_ADMIN_PRIVATE_KEY, NEXT_PUBLIC_ACCOUNT_CLASS_HASH: process.env.NEXT_PUBLIC_ACCOUNT_CLASS_HASH, NEXT_PUBLIC_ARK_API_DOMAIN: process.env.NEXT_PUBLIC_ARK_API_DOMAIN, - NEXT_PUBLIC_ARK_CONTRACT_ADDRESS: - process.env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, + NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS: + process.env.NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS, NEXT_PUBLIC_BROKER_NAME: process.env.NEXT_PUBLIC_BROKER_NAME, NEXT_PUBLIC_ARK_CHAIN_ID: process.env.NEXT_PUBLIC_ARK_CHAIN_ID, NEXT_PUBLIC_OPERATOR_ADDRESS: process.env.NEXT_PUBLIC_OPERATOR_ADDRESS, diff --git a/apps/arkmarket/hooks/useBurner.ts b/apps/arkmarket/hooks/useBurner.ts index 7dc1f92..1fdd09d 100644 --- a/apps/arkmarket/hooks/useBurner.ts +++ b/apps/arkmarket/hooks/useBurner.ts @@ -71,7 +71,7 @@ export const useBurner = () => { } const { transaction_hash } = await account.execute({ - contractAddress: env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, + contractAddress: env.NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS, entrypoint: "register_broker", calldata: CallData.compile({ name: shortString.encodeShortString(env.NEXT_PUBLIC_BROKER_NAME), @@ -103,7 +103,7 @@ export const useBurner = () => { throw new Error("Burner not deployed"); } const result = await account.execute({ - contractAddress: env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, + contractAddress: env.NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS, entrypoint: "add_order_listing", calldata: CallData.compile({ seller: tokenOwnerAddress, @@ -127,16 +127,21 @@ export const useBurner = () => { ); const buyItem = useCallback( - async ({ address }: { address: string }) => { + async ({ + address, + order_hash + }: { + address: string; + order_hash: string; + }) => { if (account === undefined) { throw new Error("Burner not deployed"); } const result = await account.execute({ - contractAddress: env.NEXT_PUBLIC_ARK_CONTRACT_ADDRESS, + contractAddress: env.NEXT_PUBLIC_ARK_OB_CONTRACT_ADDRESS, entrypoint: "submit_order_buy", calldata: CallData.compile({ - order_listing_hash: - "0x1d754530a860554fa548286877c63cf3da711a1bfb6f4ca5595fe258513b0cc", + order_listing_hash: order_hash, buyer: address, // Broker footprint. broker_name: env.NEXT_PUBLIC_BROKER_NAME, diff --git a/apps/starknet/src/executor.cairo b/apps/starknet/src/executor.cairo index 74c97be..c9c6606 100644 --- a/apps/starknet/src/executor.cairo +++ b/apps/starknet/src/executor.cairo @@ -50,7 +50,6 @@ mod executor { self.messaging_address.write(messaging_address); } - #[external(v0)] impl ExecutorImpl of IExecutor {