Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
bcee34b
refactor: streamline PDP and session key handling
hugomrdias Jan 15, 2026
522a321
refactor: update test files to use bigint for identifiers and integra…
hugomrdias Jan 21, 2026
ac5e08f
feat: introduce new agents documentation and enhance core functionality
hugomrdias Jan 25, 2026
afff559
refactor: update PaymentsService to use Client and Chain types, and i…
hugomrdias Jan 25, 2026
4737678
chore: update biome configuration and linting scripts
hugomrdias Jan 25, 2026
6fbb446
refactor: clean up PaymentsAccount component and remove unused dialogs
hugomrdias Jan 26, 2026
7ab0577
refactor: standardize address parameter naming across accounts and op…
hugomrdias Jan 26, 2026
1d9adbd
refactor: streamline payment hooks and update parameter types
hugomrdias Jan 26, 2026
e32f168
refactor: update parameter names and remove unused SDK version utility
hugomrdias Jan 26, 2026
fe39db2
chore: update knip configuration and improve documentation formatting
hugomrdias Jan 26, 2026
79c2c3e
chore: add sideEffects property to package.json for better tree-shaking
hugomrdias Jan 26, 2026
d1e09b8
refactor: reorganize ERC20 module structure and update imports
hugomrdias Jan 26, 2026
1ec85f1
refactor: update ERC20 balance and approval types for consistency
hugomrdias Jan 26, 2026
fdc4b89
refactor: update ERC20 approval handling in PaymentsService
hugomrdias Jan 26, 2026
8712369
refactor: update knip configuration for package entry points
hugomrdias Jan 26, 2026
c87408c
refactor: enhance PaymentsService tests with event encoding
hugomrdias Jan 26, 2026
b953114
refactor: standardize address types across Synapse SDK
hugomrdias Jan 26, 2026
343b2a0
refactor: improve deposit documentation in useDeposit function
hugomrdias Jan 26, 2026
f2a9f35
refactor: update tokenAddress type in getServicePrice to Address
hugomrdias Jan 26, 2026
703b40d
refactor: update payment operations and storage documentation for con…
hugomrdias Jan 26, 2026
a621434
refactor: enhance theme provider and update documentation for clarity
hugomrdias Jan 27, 2026
3f9f831
refactor: move FilBeam domain to chain configuration (#570)
bajtos Jan 27, 2026
1a5542d
chore: update dependencies and enhance linting scripts
hugomrdias Jan 28, 2026
4ebeece
fix: update Filecoin Calibration Filscan contract addresses
hugomrdias Jan 28, 2026
44c6f46
refactor: enhance session key functionality and documentation
hugomrdias Jan 26, 2026
3ff0bc3
refactor: update Synapse and EndorsementsService for improved client …
hugomrdias Jan 26, 2026
1391d4d
refactor: update endorsements and payment address handling
hugomrdias Jan 26, 2026
230d6b9
refactor: rename providerIdSet to endorsements for consistency
hugomrdias Jan 27, 2026
924cf2b
refactor: simplify EndorsementsService and enhance SessionKey revoke …
hugomrdias Jan 28, 2026
9762d00
fix: update Filecoin Mainnet contract address in generated ABI files
hugomrdias Jan 30, 2026
31955bf
refactor: use Chain type for FilBeam retriever config
bajtos Jan 27, 2026
36385cd
refactor: make chain.filbeam nullable for devnet
bajtos Jan 28, 2026
f182413
docs: fix lint command name in AGENTS.md
bajtos Jan 28, 2026
97210e8
refactor: enhance service provider registry functionality and documen…
hugomrdias Jan 28, 2026
232e432
refactor: update data set and provider handling in warm-storage module
hugomrdias Jan 28, 2026
324d1b9
refactor: streamline provider and retrieval logic in Synapse SDK
hugomrdias Jan 28, 2026
8fe38b5
chore: add sp-registry to knip configuration for improved source trac…
hugomrdias Jan 28, 2026
69c9199
refactor: rename payments contract to filecoinPay and update related …
hugomrdias Jan 28, 2026
18be4cc
refactor: update provider handling in CLI commands to use sp-registry
hugomrdias Jan 28, 2026
061d6ce
refactor: update provider references to PDPProvider in documentation
hugomrdias Jan 28, 2026
4897e2f
refactor: update PDP product type handling in provider functions
hugomrdias Jan 30, 2026
70f3433
refactor: standardize ipniPeerId naming and update related logic
hugomrdias Jan 30, 2026
fe55a2f
refactor: update FilBeamRetriever instantiation in Synapse SDK
hugomrdias Feb 2, 2026
d751170
refactor: enhance service provider registry functionality and documen…
hugomrdias Jan 28, 2026
aa41156
refactor: simplify CLI command structure by removing unused privateKe…
hugomrdias Jan 30, 2026
1a372e9
feat: introduce endorsements functionality with getProviderIds
hugomrdias Jan 30, 2026
ad8a3f8
refactor: streamline Synapse SDK structure and remove endorsements se…
hugomrdias Jan 30, 2026
2f3daac
chore: update package dependencies across multiple projects
hugomrdias Jan 30, 2026
09ad0ae
refactor: standardize ipniPeerId usage in constants and decoding logic
hugomrdias Jan 30, 2026
73259ed
refactor: update SDK documentation and examples for viem integration
hugomrdias Jan 30, 2026
1cdf6c9
refactor: enhance Synapse SDK initialization and type handling
hugomrdias Jan 30, 2026
3a7328a
refactor: update Synapse instantiation in CLI commands
hugomrdias Jan 30, 2026
2363ea1
fix: improve type handling in getActivePieces options
hugomrdias Jan 31, 2026
8f92862
refactor: enhance type handling and documentation in Synapse core
hugomrdias Feb 2, 2026
7db8d5d
refactor: update registerProvider tests to use pdpOffering
hugomrdias Feb 2, 2026
00f5c28
refactor: update tsconfig and remove deprecated epoch utilities
hugomrdias Feb 2, 2026
32f8695
fix: update linting commands in documentation
hugomrdias Feb 2, 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
42 changes: 39 additions & 3 deletions .github/knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"ignore": [
".github/**",
"./packages/synapse-sdk/src/abis/gen.ts",
"./packages/synapse-core/src/abis/generated.ts",
"./packages/synapse-sdk/wagmi.config.ts",
"./packages/synapse-sdk/src/test/mocks/**",
"./packages/synapse-core/src/abis/generated.ts",
"./apps/synapse-playground/src/components/kibo-ui/dropzone/**",
Comment thread
rvagg marked this conversation as resolved.
"./apps/synapse-playground/src/components/ui/**",
"utils/**"
],
"ignoreWorkspaces": ["examples/script-tag"],
"ignoreDependencies": [
"@types/mocha",
"@types/*",
"assert",
"sharp",
"mocha",
"wrangler",
Expand All @@ -28,7 +31,40 @@
},
"workspaces": {
"docs": {
"ignoreDependencies": ["@types/*", "@filoz/synapse-sdk", "ethers"]
"ignoreDependencies": ["@filoz/synapse-sdk", "ethers", "@filoz/synapse-core", "viem"],
"ignoreFiles": ["src/custom.css"]
},
"packages/synapse-sdk": {
"entry": ["src/index.ts", "src/{payments,pdp,session,storage,subgraph,warm-storage,sp-registry,filbeam}/index.ts"]
},
"packages/synapse-react": {
"entry": ["src/index.ts", "src/filsnap.ts"]
},
"packages/synapse-core": {
"entry": [
"src/index.ts",
"src/sp.ts",
"src/chains.ts",
"src/piece.ts",
"src/usdfc.ts",
"src/abis/index.ts",
"src/auction/index.ts",
"src/endorsements/index.ts",
"src/erc20/index.ts",
"src/errors/index.ts",
"src/mocks/index.ts",
"src/pay/index.ts",
"src/pdp-verifier/index.ts",
"src/session-key/index.ts",
"src/sp-registry/index.ts",
"src/typed-data/index.ts",
"src/utils/index.ts",
"src/warm-storage/index.ts"
],
"ignoreFiles": ["wagmi.config.ts"]
},
"apps/synapse-playground": {
"ignoreDependencies": ["buffer", "globals"]
}
}
}
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ packages/synapse-sdk/src/

**Commands**:

- Root: `pnpm run fix` (Biome auto-fix all), `pnpm run build` (all packages), `pnpm test`
- Root: `pnpm run lint:fix` (Biome auto-fix all), `pnpm run build` (all packages), `pnpm test`
- Package: `pnpm run lint:fix`, `pnpm run build`, `pnpm test` (from `packages/synapse-sdk/`)

**Build**: TypeScript → `dist/` (in package), ES modules with `.js` extensions, strict mode, NodeNext resolution
Expand All @@ -59,7 +59,7 @@ packages/synapse-sdk/src/
**NO** semicolons at line end (`semicolons: "asNeeded"`)
**MUST** use kebab-case filenames

Run `pnpm run fix` before commits.
Run `pnpm run lint:fix` before commits.

## Key Components

Expand Down
10 changes: 4 additions & 6 deletions apps/synapse-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"format": "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true .",
"dev": "wireit",
"build": "wireit",
"lint": "wireit",
Expand All @@ -26,7 +25,7 @@
]
},
"lint": {
"command": "biome check --no-errors-on-unmatched --files-ignore-unknown=true .",
"command": "biome check --fix .",
"files": [
"src/**/*.{tsx,ts}",
"tsconfig.json",
Expand Down Expand Up @@ -75,15 +74,14 @@
"lucide-react": "^0.562.0",
"nanostores": "^1.0.1",
"next-themes": "^0.4.6",
"p-retry": "^7.1.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-dropzone": "^14.3.8",
"react-hook-form": "^7.66.1",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1",
"tailwindcss": "^4.1.14",
"viem": "catalog:",
"viem": "2.x",
"wagmi": "catalog:",
"zod": "^4.1.13"
},
Expand Down
8 changes: 7 additions & 1 deletion apps/synapse-playground/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useAccount } from 'wagmi'
import * as Icons from '@/components/icons.tsx'
import { NetworkSelector } from '@/components/network-selector.tsx'
import { Button } from '@/components/ui/button.tsx'
import { Toaster } from '@/components/ui/sonner.tsx'
import { ConnectSection } from './components/connect-section.tsx'
import { PaymentsAccount } from './components/payments-account.tsx'
Expand All @@ -25,9 +26,14 @@ export function App() {
</a>
<span className="text-xl font-bold">Filecoin Onchain Cloud</span>
</div>
<div className="flex flex-row gap-2 items-center">
<div className="flex flex-row gap-3 items-center">
{isConnected && <WalletMenu />}
<NetworkSelector />
<Button asChild size="icon" variant="ghost">
<a href="https://github.com/FilOzone/synapse-sdk" rel="noopener noreferrer" target="_blank">
<Icons.Github />
</a>
</Button>
</div>
</nav>
</header>
Expand Down
12 changes: 12 additions & 0 deletions apps/synapse-playground/src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,15 @@ export function Filecoin(props: React.SVGProps<SVGSVGElement>) {
</svg>
)
}

export function Github(props: React.SVGProps<SVGSVGElement>) {
return (
<svg height={24} viewBox="0 0 24 24" width={24} xmlns="http://www.w3.org/2000/svg" {...props}>
<title>Github</title>
<path
d="M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
fill="currentColor"
></path>
</svg>
)
}
201 changes: 3 additions & 198 deletions apps/synapse-playground/src/components/payments-account.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatFraction } from '@filoz/synapse-core/utils'
import { useAccountInfo, useApproveAllowance, useDeposit, useWithdraw } from '@filoz/synapse-react'
import { useAccountInfo, useWithdraw } from '@filoz/synapse-react'
import { useState } from 'react'
import { useForm } from 'react-hook-form'
import { parseEther } from 'viem'
Expand Down Expand Up @@ -111,212 +111,17 @@ export function PaymentsAccount() {
</CardContent>
<CardFooter className="flex-row gap-2">
<DepositAndApproveDialog />
{/* <AllowanceDialog /> */}
{/* <DepositDialog /> */}
<WithdrawDialog />
</CardFooter>
</Card>
)
}

const formSchema = z.object({
amount: z.string().min(1),
})
export function AllowanceDialog() {
const [hash, setHash] = useState<string | null>(null)
const {
mutate: approve,
isPending,
isSuccess,
error,
reset,
} = useApproveAllowance({
onHash: (hash) => {
setHash(hash)
},
mutation: {
onSettled: () => {
setHash(null)
},
},
})

const form = useForm<z.infer<typeof formSchema>>({
defaultValues: {
amount: '1',
},
})

function onSubmit(values: z.infer<typeof formSchema>) {
const amount = parseEther(values.amount)
approve({ amount })
}

return (
<Dialog
onOpenChange={() => {
reset()
}}
>
<DialogTrigger asChild>
<Button>Allowance</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[425px]">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<DialogHeader>
<DialogTitle>Manage Allowance</DialogTitle>
<DialogDescription>
Manage the allowance for the Payments contract to spend your USDFC tokens.
</DialogDescription>
</DialogHeader>

<div className="grid gap-4 py-4">
<div className="grid gap-3">
<FormField
control={form.control}
name="amount"
render={({ field }) => (
<FormItem>
<FormLabel>Amount</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormDescription>Amount of USDFC to approve.</FormDescription>
<FormMessage />
</FormItem>
)}
rules={{
required: 'Amount is required',
validate: (value) => {
const amount = parseEther(value)
if (amount < 0n) {
return 'Amount must be greater than 0'
}
return true
},
}}
/>
</div>
<HashAlert hash={hash} />
<ErrorAlert error={error} />
<SuccessAlert message="Allowance approved" show={isSuccess} />
</div>
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<ButtonLoading className="sm:w-24 w-full" loading={isPending} type="submit">
Approve
</ButtonLoading>
</DialogFooter>
</form>
</Form>
</DialogContent>
</Dialog>
)
}

const depositFormSchema = z.object({
amount: z.string().min(1),
})
export function DepositDialog() {
const [hash, setHash] = useState<string | null>(null)
const {
mutate: deposit,
isPending,
isSuccess,
error,
reset,
} = useDeposit({
onHash: (hash) => {
setHash(hash)
},
mutation: {
onSettled: () => {
setHash(null)
},
},
})

const form = useForm<z.infer<typeof depositFormSchema>>({
defaultValues: {
amount: '1',
},
})

function onSubmit(values: z.infer<typeof depositFormSchema>) {
const amount = parseEther(values.amount)
deposit({ amount })
}

return (
<Dialog
onOpenChange={() => {
reset()
}}
>
<DialogTrigger asChild>
<Button variant="secondary">Deposit</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[425px]">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<DialogHeader>
<DialogTitle>Deposit USDFC</DialogTitle>
<DialogDescription>Deposit USDFC tokens to the Payments contract.</DialogDescription>
</DialogHeader>

<div className="grid gap-4 py-4">
<div className="grid gap-3">
<FormField
control={form.control}
name="amount"
render={({ field }) => (
<FormItem>
<FormLabel>Amount</FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormDescription>Amount of USDFC to deposit.</FormDescription>
<FormMessage />
</FormItem>
)}
rules={{
required: 'Amount is required',
validate: (value) => {
const amount = parseEther(value)
if (amount <= 0n) {
return 'Amount must be greater than 0'
}
return true
},
}}
/>
</div>
<HashAlert hash={hash} />
<ErrorAlert error={error} />
<SuccessAlert message="USDFC deposited" show={isSuccess} />
</div>
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<ButtonLoading className="sm:w-24 w-full" loading={isPending} type="submit">
Deposit
</ButtonLoading>
</DialogFooter>
</form>
</Form>
</DialogContent>
</Dialog>
)
}

const withdrawFormSchema = z.object({
amount: z.string().min(1),
})
export function WithdrawDialog() {

function WithdrawDialog() {
const [hash, setHash] = useState<string | null>(null)
const {
mutate: withdraw,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function StorageMenu() {
<span>Rate</span>
<span className="text-muted-foreground">
{formatFraction({
value: operatorApprovals?.rateUsed,
value: operatorApprovals?.rateUsage,
digits: 12,
})}
</span>
Expand All @@ -62,7 +62,7 @@ export function StorageMenu() {
<span>Lockup </span>
<span className="text-muted-foreground">
{formatFraction({
value: operatorApprovals?.lockupUsed,
value: operatorApprovals?.lockupUsage,
})}
</span>
</DropdownMenuLabel>
Expand Down
3 changes: 0 additions & 3 deletions apps/synapse-playground/src/config.ts

This file was deleted.

Loading