Speedstake
Embed Speedstake on your website in minutes
Last updated
npm install --legacy-peer-deps @pyefi/sdk @pyefi/widget \
react react-dom \
@solana/web3.js @solana/spl-token \
@solana/wallet-adapter-react @solana/wallet-adapter-base @solana/wallet-adapter-wallets \
@solana/kit@^2 @cks-systems/manifest-sdk \
@supabase/supabase-js \
buffer stream-browserify assertpnpm add @pyefi/sdk @pyefi/widget \
react react-dom \
@solana/web3.js @solana/spl-token \
@solana/wallet-adapter-react @solana/wallet-adapter-base @solana/wallet-adapter-wallets \
@solana/kit@^2 @cks-systems/manifest-sdk \
@supabase/supabase-js \
buffer stream-browserify assertimport { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
define: {
"process.env": {},
"process.version": JSON.stringify("v18.0.0"),
"process.browser": true,
},
resolve: {
alias: {
stream: "stream-browserify",
assert: "assert",
},
},
});{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"types": ["vite/client"]
},
"include": ["src"]
}import { Buffer } from "buffer";
(window as any).Buffer = Buffer;
// ...rest of your importsVITE_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
VITE_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
VITE_SUPABASE_ANON_KEY=YOUR_ANON_KEY
VITE_VOTE_ACCOUNT=YOUR_VOTE_ACCOUNTimport { useState } from "react";
import { PyeWidget } from "@pyefi/widget";
export default function App() {
const [open, setOpen] = useState(false);
return (
<>
<button onClick={() => setOpen(true)}>Get paid now</button>
{open && (
<div
style={{
position: "fixed", inset: 0,
display: "flex", alignItems: "center", justifyContent: "center",
background: "rgba(0,0,0,0.5)", backdropFilter: "blur(8px)",
zIndex: 9999,
}}
onClick={(e) => { if (e.target === e.currentTarget) setOpen(false); }}
>
<PyeWidget
rpcUrl={import.meta.env.VITE_RPC_URL}
supabaseUrl={import.meta.env.VITE_SUPABASE_URL}
supabaseAnonKey={import.meta.env.VITE_SUPABASE_ANON_KEY}
voteAccount={import.meta.env.VITE_VOTE_ACCOUNT}
theme="pye-dark"
onClose={() => setOpen(false)}
/>
</div>
)}
</>
);
}npm install --legacy-peer-deps @pyefi/sdk @pyefi/widget \
react react-dom \
@solana/web3.js @solana/spl-token \
@solana/wallet-adapter-react @solana/wallet-adapter-base @solana/wallet-adapter-wallets \
"@solana/kit@^2" @cks-systems/manifest-sdk \
@supabase/supabase-js \
nextimport type { NextConfig } from "next";
const nextConfig: NextConfig = {
transpilePackages: ["@pyefi/sdk", "@pyefi/widget"],
turbopack: {},
};
export default nextConfig;webpack: (config) => {
config.resolve.fallback = { ...config.resolve.fallback, fs: false, net: false, tls: false };
return config;
},NEXT_PUBLIC_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
NEXT_PUBLIC_SUPABASE_URL=https://tfrickmnrfyjkvjhmuik.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InRmcmlja21ucmZ5amt2amhtdWlrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM0NDkyMDksImV4cCI6MjA1OTAyNTIwOX0.1wl2FWa5g0tkUn6yRcg1AyF6ixWN7SyoD89cFGxkQKM
NEXT_PUBLIC_VOTE_ACCOUNT=YOUR_VOTE_ACCOUNT"use client";
import { useState } from "react";
import { PyeWidget } from "@pyefi/widget";
export default function Page() {
const [open, setOpen] = useState(false);
return (
<>
<button onClick={() => setOpen(true)}>Get paid now</button>
{open && (
<div
style={{
position: "fixed", inset: 0,
display: "flex", alignItems: "center", justifyContent: "center",
background: "rgba(0,0,0,0.5)", backdropFilter: "blur(8px)",
zIndex: 9999,
}}
onClick={(e) => { if (e.target === e.currentTarget) setOpen(false); }}
>
<PyeWidget
rpcUrl={process.env.NEXT_PUBLIC_RPC_URL!}
supabaseUrl={process.env.NEXT_PUBLIC_SUPABASE_URL!}
supabaseAnonKey={process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!}
voteAccount={process.env.NEXT_PUBLIC_VOTE_ACCOUNT!}
theme="pye-dark"
onClose={() => setOpen(false)}
/>
</div>
)}
</>
);
}<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Validator</title>
</head>
<body>
<div id="pye-widget"></div>
<script
data-pye-widget
data-vote-account="YOUR_VOTE_ACCOUNT"
data-theme="pye-dark"
data-rpc-url="https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
data-supabase-url="https://YOUR_PROJECT.supabase.co"
data-supabase-anon-key="YOUR_ANON_KEY"
src="REPLACE_WITH_CDN_URL"
></script>
</body>
</html><script
data-pye-widget
data-theme="pye-dark"
data-rpc-url="https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
data-supabase-url="https://YOUR_PROJECT.supabase.co"
data-supabase-anon-key="YOUR_ANON_KEY"
src="REPLACE_WITH_CDN_URL"
></script>