diff --git a/.env.example b/.env.example index 5aedbafe..82b3af2d 100644 --- a/.env.example +++ b/.env.example @@ -30,3 +30,9 @@ GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_CLIENT_SECRET" #neccesary # GitHub OAuth GITHUB_ID="YOUR_GITHUB_CLIENT_ID" #neccesary GITHUB_SECRET="YOUR_GITHUB_CLIENT_SECRET" #neccesary + + +PUBLIC_STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015" +PUBLIC_STELLAR_RPC_URL="https://soroban-testnet.stellar.org:443" +STELLAR_ACCOUNT="collins" +STELLAR_NETWORK="testnet" diff --git a/.gitignore b/.gitignore index 8847b689..08ecf089 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,15 @@ target # Local settings .soroban .stellar + +certificates + +.DS_Store +# generated contract clients +packages/* +# if you have other workspace packages, add them here +!packages/.gitkeep + +# generated contract client imports +src/contracts/* +!src/contracts/util.ts diff --git a/.husky/pre-push b/.husky/pre-push index d6cb2884..e69de29b 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1 +0,0 @@ -npm run build diff --git a/Cargo.lock b/Cargo.lock index 0c87680b..4d06fc2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,20 +3,17 @@ version = 4 [[package]] -name = "addr2line" -version = "0.24.2" +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "gimli", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", ] -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -42,37 +39,134 @@ dependencies = [ ] [[package]] -name = "autocfg" -version = "1.4.0" +name = "ark-bls12-381" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] [[package]] -name = "backtrace" -version = "0.3.74" +name = "ark-ec" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", ] [[package]] -name = "base16ct" -version = "0.2.0" +name = "ark-ff" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "base32" +name = "ark-std" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -122,7 +216,7 @@ dependencies = [ "num-bigint", "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -209,12 +303,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -241,7 +335,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -265,7 +359,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.87", ] [[package]] @@ -276,9 +370,15 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.87", ] +[[package]] +name = "data-encoding" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" + [[package]] name = "der" version = "0.7.9" @@ -299,6 +399,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -307,7 +418,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -454,12 +565,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "group" version = "0.13.0" @@ -477,6 +582,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.15.1" @@ -566,9 +680,9 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -633,15 +747,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -666,7 +771,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -687,15 +792,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.20.2" @@ -752,7 +848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.87", ] [[package]] @@ -830,12 +926,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustc_version" version = "0.4.1" @@ -887,7 +977,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -929,7 +1019,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -977,21 +1067,21 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "soroban-builtin-sdk-macros" -version = "21.2.1" +version = "22.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f57a68ef8777e28e274de0f3a88ad9a5a41d9a2eb461b4dd800b086f0e83b80" +checksum = "cf2e42bf80fcdefb3aae6ff3c7101a62cf942e95320ed5b518a1705bc11c6b2f" dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] name = "soroban-env-common" -version = "21.2.1" +version = "22.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1c89463835fe6da996318156d39f424b4f167c725ec692e5a7a2d4e694b3d" +checksum = "027cd856171bfd6ad2c0ffb3b7dfe55ad7080fb3050c36ad20970f80da634472" dependencies = [ "arbitrary", "crate-git-revision", @@ -1008,9 +1098,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "21.2.1" +version = "22.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bfb2536811045d5cd0c656a324cbe9ce4467eb734c7946b74410d90dea5d0ce" +checksum = "9a07dda1ae5220d975979b19ad4fd56bc86ec7ec1b4b25bc1c5d403f934e592e" dependencies = [ "soroban-env-common", "static_assertions", @@ -1018,11 +1108,14 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "21.2.1" +version = "22.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7a32c28f281c423189f1298960194f0e0fc4eeb72378028171e556d8cd6160" +checksum = "66e8b03a4191d485eab03f066336112b2a50541a7553179553dc838b986b94dd" dependencies = [ - "backtrace", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", "curve25519-dalek", "ecdsa", "ed25519-dalek", @@ -1051,9 +1144,9 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "21.2.1" +version = "22.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242926fe5e0d922f12d3796cd7cd02dd824e5ef1caa088f45fce20b618309f64" +checksum = "00eff744764ade3bc480e4909e3a581a240091f3d262acdce80b41f7069b2bd9" dependencies = [ "itertools", "proc-macro2", @@ -1061,14 +1154,14 @@ dependencies = [ "serde", "serde_json", "stellar-xdr", - "syn", + "syn 2.0.87", ] [[package]] name = "soroban-ledger-snapshot" -version = "21.7.7" +version = "22.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6edf92749fd8399b417192d301c11f710b9cdce15789a3d157785ea971576fa" +checksum = "80bbe59497cb50e81861187e6bd2a2c805df253573d44ed56e7d373f79530758" dependencies = [ "serde", "serde_json", @@ -1080,9 +1173,9 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "21.7.7" +version = "22.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcdf04484af7cc731a7a48ad1d9f5f940370edeea84734434ceaf398a6b862e" +checksum = "c85edd55eb09aa5dd7ba5ab595d2be7ac3f453e90e2f26d704ff26c130f2926f" dependencies = [ "arbitrary", "bytes-lit", @@ -1102,9 +1195,9 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "21.7.7" +version = "22.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0974e413731aeff2443f2305b344578b3f1ffd18335a7ba0f0b5d2eb4e94c9ce" +checksum = "a141230aa65006d4b3eeee9d0589172d734a2abfbe15b84670e38e76e200b370" dependencies = [ "crate-git-revision", "darling", @@ -1117,14 +1210,14 @@ dependencies = [ "soroban-spec", "soroban-spec-rust", "stellar-xdr", - "syn", + "syn 2.0.87", ] [[package]] name = "soroban-spec" -version = "21.7.7" +version = "22.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c70b20e68cae3ef700b8fa3ae29db1c6a294b311fba66918f90cb8f9fd0a1a" +checksum = "b54326e9516b33be99c701b37242b27efb8e66cc1f1eff994b9d9a013a4be136" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -1134,9 +1227,9 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "21.7.7" +version = "22.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2dafbde981b141b191c6c036abc86097070ddd6eaaa33b273701449501e43d3" +checksum = "f009cab4dfd653bc94a06c5022f1ca9d30e198b0e451f84cf307231563d11de2" dependencies = [ "prettyplease", "proc-macro2", @@ -1144,7 +1237,7 @@ dependencies = [ "sha2", "soroban-spec", "stellar-xdr", - "syn", + "syn 2.0.87", "thiserror", ] @@ -1185,20 +1278,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-strkey" -version = "0.0.8" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d2bf45e114117ea91d820a846fd1afbe3ba7d717988fee094ce8227a3bf8bd" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" dependencies = [ - "base32", "crate-git-revision", + "data-encoding", "thiserror", ] [[package]] name = "stellar-xdr" -version = "21.2.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" +checksum = "2ce69db907e64d1e70a3dce8d4824655d154749426a6132b25395c49136013e4" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1222,6 +1315,17 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.87" @@ -1250,7 +1354,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -1330,7 +1434,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -1352,7 +1456,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1491,7 +1595,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.87", ] [[package]] @@ -1499,3 +1603,17 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/app/layout.tsx b/app/layout.tsx index 3877b7d1..74efcd87 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,39 +3,41 @@ import localFont from "next/font/local"; import "./globals.css"; import { getServerSession } from "next-auth"; import { SessionProvider } from "@/components/session-provider"; +import { Toaster } from "sonner"; const geistSans = localFont({ - src: "./fonts/GeistVF.woff", - variable: "--font-geist-sans", - weight: "100 900", + src: "./fonts/GeistVF.woff", + variable: "--font-geist-sans", + weight: "100 900", }); const geistMono = localFont({ - src: "./fonts/GeistMonoVF.woff", - variable: "--font-geist-mono", - weight: "100 900", + src: "./fonts/GeistMonoVF.woff", + variable: "--font-geist-mono", + weight: "100 900", }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "Create Next App", + description: "Generated by create next app", }; export default async function RootLayout({ - children, + children, }: Readonly<{ - children: React.ReactNode; + children: React.ReactNode; }>) { - const session = await getServerSession() + const session = await getServerSession(); - return ( - - - - {children} - - - - ); + return ( + + + + {children} + + + + + ); } diff --git a/components/connect-wallet.tsx b/components/connect-wallet.tsx new file mode 100644 index 00000000..a86d6479 --- /dev/null +++ b/components/connect-wallet.tsx @@ -0,0 +1,95 @@ +"use client"; + +import React, { useState, useEffect } from "react"; +import { Button } from "@/components/ui/button"; +import { Loader2, LogOut } from "lucide-react"; +import { toast } from "sonner"; +import { connect, disconnect, getPublicKey } from "@/hooks/useStellarWallet"; + +const ConnectWalletButton = ({ className = "" }) => { + const [isChecking, setIsChecking] = useState(true); + const [isConnecting, setIsConnecting] = useState(false); + const [walletAddress, setWalletAddress] = useState(null); + + useEffect(() => { + const checkConnection = async () => { + try { + const address = await getPublicKey(); + if (address) { + setWalletAddress(address); + toast.success("Wallet Reconnected", { + description: `Welcome back! Address: ${address}`, + }); + } + } catch (error) { + console.log("No wallet connected.", error); + } finally { + setIsChecking(false); + } + }; + + checkConnection(); + }, []); + + const connectWallet = async () => { + try { + setIsConnecting(true); + await connect(async () => { + const address = await getPublicKey(); + if (!address) throw new Error("Failed to retrieve wallet address"); + + setWalletAddress(address); + toast.success("Wallet Connected", { + description: `Connected. Address: ${address}`, + }); + }); + } catch (error) { + console.log(error); + toast.error("Connection Failed", { + description: "Failed to connect to the wallet.", + }); + } finally { + setIsConnecting(false); + } + }; + + const disconnectWallet = async () => { + await disconnect(); + setWalletAddress(null); + toast.info("Wallet Disconnected", { + description: "You have been disconnected.", + }); + }; + + return ( +
+ + + {walletAddress && ( + + )} +
+ ); +}; + +export default ConnectWalletButton; diff --git a/components/dashboard/index.tsx b/components/dashboard/index.tsx index 10a671c4..48af2a0d 100644 --- a/components/dashboard/index.tsx +++ b/components/dashboard/index.tsx @@ -2,7 +2,6 @@ import { useState } from "react"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { Button } from "@/components/ui/button"; import { Wallet, TrendingUp, Compass, CheckCircle } from "lucide-react"; import { AnimatePresence } from "framer-motion"; @@ -20,6 +19,7 @@ import MyProjectsTab from "./tabs/my-projects-tab"; import TrendingTab from "./tabs/trending-tab"; import ExploreTab from "./tabs/explore-tab"; import CompletedTab from "./tabs/completed-tab"; +import ConnectWalletButton from "../connect-wallet"; export default function Dashboard() { const [exploreFilter, setExploreFilter] = useState("newest"); @@ -81,10 +81,12 @@ export default function Dashboard() {

Dashboard

- + */}
diff --git a/components/ui/sonner.tsx b/components/ui/sonner.tsx new file mode 100644 index 00000000..c5ba1bfe --- /dev/null +++ b/components/ui/sonner.tsx @@ -0,0 +1,31 @@ +"use client"; + +import { useTheme } from "next-themes"; +import { Toaster as Sonner } from "sonner"; + +type ToasterProps = React.ComponentProps; + +const Toaster = ({ ...props }: ToasterProps) => { + const { theme = "system" } = useTheme(); + + return ( + + ); +}; + +export { Toaster }; diff --git a/hooks/useStellarWallet.tsx b/hooks/useStellarWallet.tsx new file mode 100644 index 00000000..f4e2242b --- /dev/null +++ b/hooks/useStellarWallet.tsx @@ -0,0 +1,55 @@ +import { + allowAllModules, + FREIGHTER_ID, + StellarWalletsKit, + WalletNetwork, +} from "@creit.tech/stellar-wallets-kit"; + +const SELECTED_WALLET_ID = "selectedWalletId"; + +function getSelectedWalletId() { + if (typeof window === "undefined") return null; + return localStorage.getItem(SELECTED_WALLET_ID); +} + +const kit = new StellarWalletsKit({ + modules: allowAllModules(), + network: WalletNetwork.TESTNET, + selectedWalletId: getSelectedWalletId() ?? FREIGHTER_ID, +}); + +export const signTransaction = kit.signTransaction.bind(kit); + +export async function getPublicKey() { + if (!getSelectedWalletId()) return null; + const { address } = await kit.getAddress(); + return address; +} + +export async function setWallet(walletId: string) { + if (typeof window === "undefined") return; + localStorage.setItem(SELECTED_WALLET_ID, walletId); + kit.setWallet(walletId); +} + +export async function disconnect(callback?: () => Promise) { + if (typeof window !== "undefined") { + localStorage.removeItem(SELECTED_WALLET_ID); + } + kit.disconnect(); + if (callback) await callback(); +} + +export async function connect(callback?: () => Promise) { + await kit.openModal({ + onWalletSelected: async (option) => { + try { + await setWallet(option.id); + if (callback) await callback(); + } catch (e) { + console.error(e); + } + return option.id; + }, + }); +} diff --git a/initialize.js b/initialize.js new file mode 100644 index 00000000..a3b9f265 --- /dev/null +++ b/initialize.js @@ -0,0 +1,134 @@ +import "dotenv/config"; +import { mkdirSync, writeFileSync, rmSync, readFileSync } from "node:fs"; +import { execSync } from "node:child_process"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { sync as glob } from "glob"; + +// Load environment variables starting with PUBLIC_ into the environment, +// so we don't need to specify duplicate variables in .env +for (const key in process.env) { + if (key.startsWith("PUBLIC_")) { + process.env[key.substring(7)] = process.env[key]; + } +} + +console.log("###################### Initializing ########################"); + +// Get dirname (equivalent to the Bash version) +const __filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(__filename); +const contractsDir = `${dirname}/.stellar/contract-ids`; + +// variable for later setting pinned version of soroban in "$(dirname/target/bin/soroban)" +const cli = "stellar"; + +// Function to execute and log shell commands +function exe(command) { + console.log(command); + execSync(command, { stdio: "inherit" }); +} + +function fundAll() { + exe(`${cli} keys generate --fund ${process.env.STELLAR_ACCOUNT} | true`); +} + +function removeFiles(pattern) { + console.log(`remove ${pattern}`); + for (const entry of glob(pattern)) { + rmSync(entry); + } +} + +function buildAll() { + removeFiles(`${dirname}/target/wasm32-unknown-unknown/release/*.wasm`); + removeFiles(`${dirname}/target/wasm32-unknown-unknown/release/*.d`); + exe(`${cli} contract build`); +} + +function filenameNoExtension(filename) { + return path.basename(filename, path.extname(filename)); +} + +function deploy(wasm) { + exe( + `${cli} contract deploy --wasm ${wasm} --ignore-checks --alias ${filenameNoExtension( + wasm, + )}`, + ); +} + +function deployAll() { + mkdirSync(contractsDir, { recursive: true }); + + const wasmFiles = glob( + `${dirname}/target/wasm32-unknown-unknown/release/*.wasm`, + ); + + wasmFiles.forEach(deploy); +} + +function contracts() { + const contractFiles = glob(`${contractsDir}/*.json`); + + return contractFiles + .map((path) => ({ + alias: filenameNoExtension(path), + ...JSON.parse(readFileSync(path)), + })) + .filter((data) => data.ids[process.env.STELLAR_NETWORK_PASSPHRASE]) + .map((data) => ({ + alias: data.alias, + id: data.ids[process.env.STELLAR_NETWORK_PASSPHRASE], + })); +} + +function bind({ alias, id }) { + exe( + `${cli} contract bindings typescript --contract-id ${id} --output-dir ${dirname}/packages/${alias} --overwrite`, + ); + exe(`(cd ${dirname}/packages/${alias} && npm i && npm run build)`); +} + +function bindAll() { + contracts().forEach(bind); +} + +function importContract({ alias }) { + const outputDir = `${dirname}/src/contracts/`; + + mkdirSync(outputDir, { recursive: true }); + + const importContent = ` + import * as Client from '${alias}'; + import { rpcUrl } from './util'; + + export default new Client.Client({ + ...Client.networks.${process.env.STELLAR_NETWORK}, + rpcUrl, + ${ + process.env.STELLAR_NETWORK === "local" || + process.env.STELLAR_NETWORK === "standalone" + ? "allowHttp: true," + : "" + } + }); +`; + + const outputPath = `${outputDir}/${alias}.ts`; + + writeFileSync(outputPath, importContent); + + console.log(`Created import for ${alias}`); +} + +function importAll() { + contracts().forEach(importContract); +} + +// Calling the functions (equivalent to the last part of your bash script) +fundAll(); +buildAll(); +deployAll(); +bindAll(); +importAll(); diff --git a/package-lock.json b/package-lock.json index 6d53d986..ac95697f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,10 @@ "": { "name": "boundless", "version": "0.1.0", + "hasInstallScript": true, + "workspaces": [ + "packages/*" + ], "dependencies": { "@auth/prisma-adapter": "^2.7.4", "@creit.tech/stellar-wallets-kit": "^1.4.1", @@ -24,6 +28,7 @@ "@radix-ui/react-slot": "^1.1.2", "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.7", + "@stellar/freighter-api": "^3.1.0", "@stellar/stellar-sdk": "^13.1.0", "@tanstack/react-query": "^5.66.11", "@types/pg": "^8.11.11", @@ -31,18 +36,20 @@ "bcrypt": "^5.1.1", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "dotenv": "^16.4.7", "framer-motion": "^12.4.2", + "glob": "^11.0.1", "lucide-react": "^0.474.0", "next": "^15.1.6", "next-auth": "^4.24.11", + "next-themes": "^0.4.4", "pg": "^8.13.1", "react": "^18", "react-dom": "^18", "react-hook-form": "^7.54.2", "recharts": "^2.15.1", "resend": "^4.1.2", - "sonner": "^2.0.0", - "stellar-sdk": "^13.1.0", + "sonner": "^2.0.1", "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7", "zod": "^3.24.2" @@ -901,6 +908,12 @@ "@stellar/stellar-base": "^12.1.1" } }, + "node_modules/@creit.tech/stellar-wallets-kit/node_modules/@stellar/freighter-api": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-3.0.0.tgz", + "integrity": "sha512-AI1AeHnCPLMcM8d6182FScOJjCFd1tLZcNuu5M10NmtuLfNzavw+f991dWBoz6h41mOKjauIaojR+7VfU2nULg==", + "license": "Apache-2.0" + }, "node_modules/@creit.tech/stellar-wallets-kit/node_modules/@stellar/stellar-sdk": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-12.3.0.tgz", @@ -4431,10 +4444,14 @@ } }, "node_modules/@stellar/freighter-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-3.0.0.tgz", - "integrity": "sha512-AI1AeHnCPLMcM8d6182FScOJjCFd1tLZcNuu5M10NmtuLfNzavw+f991dWBoz6h41mOKjauIaojR+7VfU2nULg==", - "license": "Apache-2.0" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-3.1.0.tgz", + "integrity": "sha512-hsoZwAR/jNVIt8ee6aHYcRKVk09hDLHmsfK2nUfqHUo7LuHtuHI59y/mDyrT4bp/qlklGZNd2nr0hRJyjau8WQ==", + "license": "Apache-2.0", + "dependencies": { + "buffer": "^6.0.3", + "semver": "^7.6.3" + } }, "node_modules/@stellar/js-xdr": { "version": "3.1.2", @@ -7406,6 +7423,18 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -8851,21 +8880,23 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz", + "integrity": "sha512-zrQDm8XPnYEKawJScsnM0QzobJxlT/kHOOlRTio8IH/GrmxRE5fjllkzdaHclIuNjUQTJYH2xHNIGfdpJkDJUw==", "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -8883,6 +8914,70 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/jackspeak": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", + "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/lru-cache": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", + "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -10935,6 +11030,16 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/next-themes": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.4.tgz", + "integrity": "sha512-LDQ2qIOJF0VnuVrrMSMLrWGjRMkq+0mpgl6e0juCLqdJ+oo8Q84JRWT6Wh11VDQKkMMe+dVzDKLWs5n87T+PkQ==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" + } + }, "node_modules/next/node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -12013,6 +12118,10 @@ "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==", "license": "MIT" }, + "node_modules/project_contract": { + "resolved": "packages/project_contract", + "link": true + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -12610,6 +12719,27 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -13223,9 +13353,9 @@ } }, "node_modules/sonner": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.0.tgz", - "integrity": "sha512-3WeSl3WrEdhmdiTniT8JsCiVRVDOdn7k+4MG2drqzSMOeqrExm03HIwDBPKuq52JBqL7wRLG17QBIiSleUbljw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.1.tgz", + "integrity": "sha512-FRBphaehZ5tLdLcQ8g2WOIRE+Y7BCfWi5Zyd8bCvBjiW8TxxAyoWZIxS661Yz6TGPqFQ4VLzOF89WEYhfynSFQ==", "license": "MIT", "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", @@ -13272,40 +13402,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stellar-sdk": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/stellar-sdk/-/stellar-sdk-13.1.0.tgz", - "integrity": "sha512-b7fYK9kX4ljulXckt63jSwzAzTW43RlitSIJH4CHTft7Fce8zNqWuNwJ29FALt258SKlxiL0qKn58LcOA9iJIw==", - "deprecated": "⚠️ This package has moved to @stellar/stellar-sdk! 🚚", - "license": "Apache-2.0", - "dependencies": { - "@stellar/stellar-base": "^13.0.1", - "axios": "^1.7.9", - "bignumber.js": "^9.1.2", - "eventsource": "^2.0.2", - "feaxios": "^0.0.23", - "randombytes": "^2.1.0", - "toml": "^3.0.0", - "urijs": "^1.19.1" - } - }, - "node_modules/stellar-sdk/node_modules/@stellar/stellar-base": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/@stellar/stellar-base/-/stellar-base-13.0.1.tgz", - "integrity": "sha512-Xbd12mc9Oj/130Tv0URmm3wXG77XMshZtZ2yNCjqX5ZbMD5IYpbBs3DVCteLU/4SLj/Fnmhh1dzhrQXnk4r+pQ==", - "license": "Apache-2.0", - "dependencies": { - "@stellar/js-xdr": "^3.1.2", - "base32.js": "^0.1.0", - "bignumber.js": "^9.1.2", - "buffer": "^6.0.3", - "sha.js": "^2.3.6", - "tweetnacl": "^1.0.3" - }, - "optionalDependencies": { - "sodium-native": "^4.3.0" - } - }, "node_modules/stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -15032,6 +15128,58 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "packages/project_contract": { + "version": "0.0.0", + "dependencies": { + "@stellar/stellar-sdk": "13.0.0", + "buffer": "6.0.3" + }, + "devDependencies": { + "typescript": "^5.6.2" + } + }, + "packages/project_contract/node_modules/@stellar/stellar-base": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@stellar/stellar-base/-/stellar-base-13.0.1.tgz", + "integrity": "sha512-Xbd12mc9Oj/130Tv0URmm3wXG77XMshZtZ2yNCjqX5ZbMD5IYpbBs3DVCteLU/4SLj/Fnmhh1dzhrQXnk4r+pQ==", + "license": "Apache-2.0", + "dependencies": { + "@stellar/js-xdr": "^3.1.2", + "base32.js": "^0.1.0", + "bignumber.js": "^9.1.2", + "buffer": "^6.0.3", + "sha.js": "^2.3.6", + "tweetnacl": "^1.0.3" + }, + "optionalDependencies": { + "sodium-native": "^4.3.0" + } + }, + "packages/project_contract/node_modules/@stellar/stellar-sdk": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-13.0.0.tgz", + "integrity": "sha512-+wvmKi+XWwu27nLYTM17EgBdpbKohEkOfCIK4XKfsI4WpMXAqvnqSm98i9h5dAblNB+w8BJqzGs1JY0PtTGm4A==", + "license": "Apache-2.0", + "dependencies": { + "@stellar/stellar-base": "^13.0.1", + "axios": "^1.7.7", + "bignumber.js": "^9.1.2", + "eventsource": "^2.0.2", + "feaxios": "^0.0.20", + "randombytes": "^2.1.0", + "toml": "^3.0.0", + "urijs": "^1.19.1" + } + }, + "packages/project_contract/node_modules/feaxios": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/feaxios/-/feaxios-0.0.20.tgz", + "integrity": "sha512-g3hm2YDNffNxA3Re3Hd8ahbpmDee9Fv1Pb1C/NoWsjY7mtD8nyNeJytUzn+DK0Hyl9o6HppeWOrtnqgmhOYfWA==", + "license": "MIT", + "dependencies": { + "is-retry-allowed": "^3.0.0" + } } } } diff --git a/package.json b/package.json index 8d3adaf1..6d666004 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,10 @@ "name": "boundless", "version": "0.1.0", "private": true, + "type": "module", "scripts": { - "dev": "next dev", + "init": "node initialize.js", + "dev": "next dev --experimental-https", "build": "next build", "start": "next start", "lint": "next lint", @@ -40,6 +42,7 @@ "@radix-ui/react-slot": "^1.1.2", "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.7", + "@stellar/freighter-api": "^3.1.0", "@stellar/stellar-sdk": "^13.1.0", "@tanstack/react-query": "^5.66.11", "@types/pg": "^8.11.11", @@ -47,22 +50,25 @@ "bcrypt": "^5.1.1", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "dotenv": "^16.4.7", "framer-motion": "^12.4.2", + "glob": "^11.0.1", "lucide-react": "^0.474.0", "next": "^15.1.6", "next-auth": "^4.24.11", + "next-themes": "^0.4.4", "pg": "^8.13.1", "react": "^18", "react-dom": "^18", - "recharts": "^2.15.1", "react-hook-form": "^7.54.2", + "recharts": "^2.15.1", "resend": "^4.1.2", - "sonner": "^2.0.0", - "stellar-sdk": "^13.1.0", + "sonner": "^2.0.1", "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7", "zod": "^3.24.2" }, + "workspaces": ["packages/*"], "devDependencies": { "@biomejs/biome": "1.9.4", "@types/bcrypt": "^5.0.2", diff --git a/src/contracts/util.ts b/src/contracts/util.ts new file mode 100644 index 00000000..642466b0 --- /dev/null +++ b/src/contracts/util.ts @@ -0,0 +1,6 @@ +export const rpcUrl = + process.env.PUBLIC_STELLAR_RPC_URL ?? + "https://soroban-testnet.stellar.org:443"; +export const networkPassphrase = + process.env.PUBLIC_STELLAR_NETWORK_PASSPHRASE ?? + "Test SDF Network ; September 2015"; diff --git a/tsconfig.json b/tsconfig.json index d8b93235..eedb14e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,33 @@ { - "compilerOptions": { - "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./*"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "compilerOptions": { + "target": "ES2017", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./*"] + } + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "initialize.js" + ], + "exclude": ["node_modules", "packages"] }