diff --git a/next_app/src/components/menubar/index.tsx b/next_app/src/components/menubar/index.tsx
index 6c18829..b8902e2 100644
--- a/next_app/src/components/menubar/index.tsx
+++ b/next_app/src/components/menubar/index.tsx
@@ -17,13 +17,15 @@ import DuplicateProject from "./components/duplicate-project"
import DuplicateFile from "./components/duplicate-file"
import { toast } from "sonner"
import { GitHubLogoIcon, TwitterLogoIcon } from "@radix-ui/react-icons"
-import { Github } from "lucide-react"
import Link from "next/link"
+import Arweave from "arweave"
+import { Tag } from "arweave/node/lib/transaction"
+import { AppVersion, BetterIDEaWallet, SponsorWebhookUrl } from "@/lib/ao-vars"
export default function Menubar() {
const globalState = useGlobalState()
const manager = useProjectManager()
-
+ const arweave = new Arweave({ host: "arweave.net", port: 443, protocol: "https" })
const project = globalState.activeProject && manager.getProject(globalState.activeProject)
function logoClicked() {
@@ -40,16 +42,41 @@ export default function Menubar() {
Building a better developer experience on ao
Feel free to support the development of our tools by sponsoring us or donating :)
- , {position:"top-center", icon:"/icon.svg", duration:15000, style:{backgroundColor:"transparent", boxShadow:"none", color:"transparent"}})
+ , { position: "top-center", icon: "/icon.svg", duration: 15000, style: { backgroundColor: "transparent", boxShadow: "none", color: "transparent" } })
}
-
async function oneTime(amount: number) {
+ const txn = await arweave.createTransaction({
+ target: BetterIDEaWallet,
+ quantity: arweave.ar.arToWinston(amount.toString()),
+ }, "use_wallet")
+ txn.addTag("App-Name", "BetterIDEa")
+ txn.addTag("BetterIDEa-Function", `Sponsor ${amount} $AR`)
+ txn.addTag("App-Version", AppVersion)
+
+ const res = await arweave.transactions.post(await window.arweaveWallet.sign(txn))
+ if (res.status === 200) {
+ await fetch(SponsorWebhookUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ content:`\`\`\`\n${await window.arweaveWallet.getActiveAddress()} has sponsored ${amount} $AR! 🎉\n\`\`\``,
+ })
+ })
+ toast.success("Thank you for sponsoring us! 🎉", { position: "top-center" })
+ } else {
+ toast.error(res.statusText, { position: "top-center" })
+ }
+ }
+
+ async function subscribe(amount: number) {
// connect to the extension
await window.arweaveWallet.connect(["ACCESS_ALL_ADDRESSES"]);
- // submit the subscription information
- const subscription = await window.arweaveWallet.subscription({
+
+ const subscription = await (window.arweaveWallet as any)?.subscription({
arweaveAccountAddress: "flBS223GKLwM0yiJGCk55BA_mdH_1QTLR5VFKejIi7c",
applicationName: "BetterIDEa",
subscriptionName: "BetterIDEa Sponsor",
@@ -67,7 +94,7 @@ export default function Menubar() {
return
-
+
Project
@@ -78,8 +105,8 @@ export default function Menubar() {
document.getElementById("new-project")?.click()}>New Project
document.getElementById("all-projects")?.click()}>All Projects
- document.getElementById("rename-project")?.click()}>Rename
- document.getElementById("duplicate-project")?.click()}>Duplicate
+ document.getElementById("rename-project")?.click()}>Rename
+ document.getElementById("duplicate-project")?.click()}>Duplicate
document.getElementById("share")?.click()}>Share
document.getElementById("blueprints")?.click()}>Load Blueprint
document.getElementById("download")?.click()}>Download zip
@@ -97,46 +124,66 @@ export default function Menubar() {
document.getElementById("new-file")?.click()}>New File
- document.getElementById("rename-file")?.click()}>Rename
- document.getElementById("duplicate-file")?.click()}>Duplicate
- document.getElementById("download-file")?.click()}>Download File
+ document.getElementById("rename-file")?.click()}>Rename
+ document.getElementById("duplicate-file")?.click()}>Duplicate
+ document.getElementById("download-file")?.click()}>Download File
document.getElementById("delete-file")?.click()} className="!text-destructive-foreground hover:!bg-destructive">Delete File
globalState.closeOpenedFile(globalState.activeFile)}>Close File
+
- Sponsor Us
+ More from us
+ Our products in the ecosystem
+
+ LearnAO
+ Portable Codecells
+ APM - ao Package Manager
+ VSCode Extension (releasing soon)
+
+ Socials
+
+ Chat with us on Discord
+ Follow us on X (Twitter)
+
+
+
+ Sponsor Us
+
- Sponsor a one time amount or a recurring amount (TODO)
+ Sponsor a one time or recurring amount to support the development of BetterIDEa and all of its services (APM, LearnAO, Portable Codecell, VSCode extension)
+
+ oneTime(0.5)}>0.5 $AR (one time)
+
+ subscribe(5)} disabled>0.5 $AR (monthly)
{/* oneTime(0.05)}>0.05 $AR (onetime)
oneTime(0.5)}>0.5 $AR (onetime)
oneTime(1)}>1 $AR (onetime)
-
$5 (monthly) */}
-
+
-
+
-
+
-
+
-
+
-
+
}
\ No newline at end of file
diff --git a/next_app/src/lib/ao-vars.ts b/next_app/src/lib/ao-vars.ts
index e738aeb..baaa7e6 100644
--- a/next_app/src/lib/ao-vars.ts
+++ b/next_app/src/lib/ao-vars.ts
@@ -1,12 +1,15 @@
import { connect, createDataItemSigner } from "@permaweb/aoconnect";
import { createDataItemSigner as nodeCDIS } from "@permaweb/aoconnect/node";
-const AppVersion = "3.0.0";
+export const AppVersion = "3.0.0";
export const AOModule = "nI_jcZgPd0rcsnjaHtaaJPpMCW847ou-3RGA5_W3aZg";
export const AOScheduler = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
export const APM_ID = "UdPDhw5S7pByV3pVqwyr1qzJ8mR8ktzi9olgsdsyZz4";
+export const BetterIDEaWallet = "MnZ8JrR5SoswAwWtX-HTnl4Kq5k6Kx1Y7vPxmlAyl_g"
+export const SponsorWebhookUrl = "https://discord.com/api/webhooks/1258731411033030726/T6rl7Ciuw8cgiR30MOVeOsbEcvAEWM45IRpc37TqAoXBbH3ZQDoxQzLAW0bmgcsxnCI9"
+
export const modules = {
"Default (WASM64)": AOModule,
"SQLite64": "u1Ju_X8jiuq4rX9Nh-ZGRQuYQZgV2MKLMT3CZsykk54",
@@ -49,7 +52,7 @@ export async function spawnProcess(name?: string, tags?: Tag[], newProcessModule
module: newProcessModule ? newProcessModule : AOModule,
scheduler: AOScheduler,
tags,
- signer: window.arweaveWallet?.signDataItem ? createDataItemSigner(window.arweaveWallet) : nodeCDIS(window.arweaveWallet),
+ signer: (window.arweaveWallet as any)?.signDataItem ? createDataItemSigner(window.arweaveWallet) : nodeCDIS(window.arweaveWallet),
});
return result;
@@ -78,7 +81,7 @@ export async function runLua(code: string, process: string, tags?: Tag[]) {
const message = await ao.message({
process,
data: code,
- signer: window.arweaveWallet?.signDataItem ? createDataItemSigner(window.arweaveWallet) : nodeCDIS(window.arweaveWallet),
+ signer: (window.arweaveWallet as any)?.signDataItem ? createDataItemSigner(window.arweaveWallet) : nodeCDIS(window.arweaveWallet),
tags,
});
diff --git a/next_app/src/pages/_app.tsx b/next_app/src/pages/_app.tsx
index 195e56a..a2067c1 100644
--- a/next_app/src/pages/_app.tsx
+++ b/next_app/src/pages/_app.tsx
@@ -8,17 +8,17 @@ import { ThemeProvider } from "@/components/theme-provider";
import { GoogleAnalytics } from "@next/third-parties/google";
// import { GoogleAnalytics } from "nextjs-google-analytics";
-declare global {
- interface Window {
- arweaveWallet: {
- connect: Function;
- disconnect: Function;
- getActiveAddress:()=> Promise;
- signDataItem: Function;
- subscription: Function;
- };
- }
-}
+// declare global {
+// interface Window {
+// arweaveWallet: {
+// connect: Function;
+// disconnect: Function;
+// getActiveAddress:()=> Promise;
+// signDataItem: Function;
+// subscription: Function;
+// };
+// }
+// }
export default function App({ Component, pageProps }: AppProps) {