Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4c19e02
add good reserve sdk and reserve swap demo
Mar 9, 2026
4193f44
feat(reserve): finalize SDK simulation, XDC support, UI updates, and …
Mar 9, 2026
6c4bb76
feat(good-reserve): add xdc support and update demo
Mar 9, 2026
454dc1a
fix(good-reserve): correct celo quote path and decimals
Mar 9, 2026
0daee1a
feat(demo-reserve): add pricing, stats, and refresh UX
Mar 9, 2026
241c2ca
fix(good-reserve): avoid sell allowance under-approval by approving max
Mar 9, 2026
def15db
feat(demo-reserve): improve quote value display
Mar 9, 2026
dbc63b6
refactor(good-reserve): parallel pool reads, named struct helpers, ex…
Mar 9, 2026
1c37dcd
fix(reserve): finalize issue #34 validation and cleanup
Mar 10, 2026
3e35eee
refactor(good-reserve): optimize react hook and block lookups
Mar 10, 2026
621f715
chore: restore unrelated changes to main
Mar 10, 2026
dbfd7f3
fix(reserve): tighten demo config and add sell tests
Mar 10, 2026
aed0b4d
chore: refine sdk inline documentation and update test mocks
Mar 10, 2026
05d3cfe
fix(demo-reserve): resolve origin not allowed error during local wall…
Mar 10, 2026
84b9393
fix(demo-reserve): override WalletConnect RPCs with public endpoints …
Mar 10, 2026
e989628
fix(pr-35): address all 7 sourcery review comments
Mar 10, 2026
bc22e14
refactor: optimize token approvals and extract error utilities
Mar 20, 2026
e0498a1
fix: correct trailing zeros regex in ReserveSwap component
Mar 20, 2026
d637484
fix reserve sdk review follow-ups
Mar 24, 2026
f39792c
feat(demo): add transaction history UI to satisfy DoD requirements
Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ yarn-error.log*
*.pem
.yarn/install-state.gz
apps/engagement-app/tsconfig.tsbuildinfo
apps/demo-reserve-swap/tsconfig.tsbuildinfo
.vscode/settings.json
e2e.log
.bounties
Expand Down
28 changes: 28 additions & 0 deletions apps/demo-reserve-swap/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from "@eslint/js"
import globals from "globals"
import reactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"
import tseslint from "typescript-eslint"

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions apps/demo-reserve-swap/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GoodDollar Reserve Swap Demo</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions apps/demo-reserve-swap/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "demo-reserve-swap",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@goodsdks/good-reserve": "workspace:*",
"@goodsdks/react-hooks": "workspace:*",
"@reown/appkit": "^1.7.2",
"@reown/appkit-adapter-wagmi": "^1.7.2",
"@tanstack/react-query": "^5.64.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.22.10",
"wagmi": "^2.14.8"
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.17.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.14.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.18.2",
"vite": "6.3.5"
}
}
67 changes: 67 additions & 0 deletions apps/demo-reserve-swap/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { createAppKit } from "@reown/appkit/react"
import { WagmiProvider, http } from "wagmi"
import { celo, xdc, type AppKitNetwork } from "@reown/appkit/networks"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi"
import { ReserveSwap } from "./components/ReserveSwap"
import { TransactionHistory } from "./components/TransactionHistory"

const queryClient = new QueryClient()

// Prefer configuring via env (Vite exposes VITE_* vars). Keep a fallback so the
// demo works out-of-the-box in local dev.
const projectId =
(import.meta.env.VITE_APPKIT_PROJECT_ID as string | undefined) ??
"15372338f22e84803d4a413143c7b822" // GoodDollar public project ID

const networks: [AppKitNetwork, ...AppKitNetwork[]] = [celo, xdc]

// Override the default WalletConnect RCPs with native public endpoints
// to dramatically improve quote reliability in the demo.
const wagmiAdapter = new WagmiAdapter({
networks,
projectId,
transports: {
[celo.id]: http("https://forno.celo.org"),
[xdc.id]: http("https://rpc.ankr.com/xdc"),
},
})

createAppKit({
adapters: [wagmiAdapter],
networks,
projectId,
metadata: {
name: "GoodDollar Reserve Demo",
description: "GoodDollar Reserve Swap Integration",
// AppKit relay strictly enforces origin matching. While testing locally, it requires
// either the exact local origin or a valid https domain.
url: window.location.hostname === "localhost" ? "http://localhost:5173" : "https://gooddollar.org",
icons: ["https://gooddollar.org/favicon.ico"],
},
features: {
analytics: false,
},
})

export function App() {
return (
<WagmiProvider config={wagmiAdapter.wagmiConfig}>
<QueryClientProvider client={queryClient}>
<div className="app-container">
<div className="header">
<h1>GoodDollar Reserve Swap</h1>
<p>Connect a wallet on Celo or XDC to interact with the reserve.</p>
</div>

<div className="connect-wrapper">
<appkit-button />
</div>

<ReserveSwap />
<TransactionHistory />
</div>
</QueryClientProvider>
</WagmiProvider>
)
}
Loading