-
Notifications
You must be signed in to change notification settings - Fork 13
feat(streaming): implement superfluid sdk and react hooks #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
8b8ca73
deeda20
23ae225
42091d2
ead6715
4ef249b
aa82b15
5df9d13
4a09487
0791279
a441adc
168af8c
389bc15
bc12016
e14148d
72427d3
8ff61e7
f1f3bd4
76e4bc6
9670b4a
f24af64
fe10910
75d6e37
2165ec9
0f508b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| node_modules | ||
| .git | ||
| .env.*.local | ||
| .DS_Store | ||
| *.md | ||
| coverage | ||
| artifacts | ||
| cache | ||
| dist | ||
| .next | ||
| .turbo | ||
| .eslintcache | ||
| .vercel | ||
| packages/*/dist | ||
| apps/*/dist | ||
| apps/*/.next |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| VITE_GRAPH_API_KEY= | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [{"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/App.tsx":"1","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/config.tsx":"2","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/globals.d.ts":"3","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/main.tsx":"4","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/ClaimButton.tsx":"5","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/IdentityCard.tsx":"6","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/SigningModal.tsx":"7","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/StreamingTestPage.tsx":"8","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/VerifyButton.tsx":"9","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/shorthands.ts":"10","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/themes.ts":"11","/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/tokens.ts":"12"},{"size":10830,"mtime":1771229604239,"results":"13","hashOfConfig":"14"},{"size":1751,"mtime":1771229604240,"results":"15","hashOfConfig":"14"},{"size":243,"mtime":1770982121179,"results":"16","hashOfConfig":"14"},{"size":435,"mtime":1771000415050,"results":"17","hashOfConfig":"14"},{"size":5342,"mtime":1771229604239,"results":"18","hashOfConfig":"14"},{"size":1843,"mtime":1770982121179,"results":"19","hashOfConfig":"14"},{"size":1309,"mtime":1770982121179,"results":"20","hashOfConfig":"14"},{"size":16379,"mtime":1771229604251,"results":"21","hashOfConfig":"14"},{"size":1022,"mtime":1771229604239,"results":"22","hashOfConfig":"14"},{"size":62,"mtime":1770982121179,"results":"23","hashOfConfig":"14"},{"size":327,"mtime":1770982121179,"results":"24","hashOfConfig":"14"},{"size":222,"mtime":1770982121179,"results":"25","hashOfConfig":"14"},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1dpe6ia",{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","suppressedMessages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","suppressedMessages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","suppressedMessages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/App.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/config.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/globals.d.ts",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/main.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/ClaimButton.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/IdentityCard.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/SigningModal.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/StreamingTestPage.tsx",[],["62"],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/components/VerifyButton.tsx",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/shorthands.ts",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/themes.ts",[],[],"/home/maryjane/Desktop/workspace/job/HushLuxe/GoodSDKs/apps/demo-identity-app/src/styles/tokens.ts",[],[],{"ruleId":"63","severity":2,"message":"64","line":277,"column":107,"nodeType":"65","messageId":"66","endLine":277,"endColumn":110,"suggestions":"67","suppressions":"68"},"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["69","70"],["71"],{"messageId":"72","fix":"73","desc":"74"},{"messageId":"75","fix":"76","desc":"77"},{"kind":"78","justification":"79"},"suggestUnknown",{"range":"80","text":"81"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"82","text":"83"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.","directive","",[9937,9940],"unknown",[9937,9940],"never"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .vercel | ||
| .certs | ||
| .yalc | ||
| yalc.lock | ||
| yalc.lock | ||
| .env |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| node_modules | ||
| .git | ||
| .env.*.local | ||
| .DS_Store | ||
| *.md | ||
| coverage | ||
| .eslintcache | ||
| .turbo | ||
| src/**/*.test.ts | ||
| src/**/*.test.tsx |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Streaming SDK Test Guide | ||
|
|
||
| This page explains how to use the interactive test UI for the Superfluid Streaming SDK. | ||
|
|
||
| ## Location | ||
| The test page is built into the demo app: | ||
| `src/components/StreamingTestPage.tsx` | ||
|
|
||
| ## Quick Start | ||
| To start the development server, you can run the standard dev command from the root: | ||
|
|
||
| ```bash | ||
| yarn dev | ||
| ``` | ||
|
|
||
| Alternatively, if you want to run just the demo app: | ||
|
|
||
| 1. `cd apps/demo-identity-app` | ||
| 2. `yarn dev` | ||
|
|
||
| Once started, open [http://localhost:3000/streaming](http://localhost:3000/streaming) in your browser. | ||
|
|
||
| ## Features | ||
|
|
||
| ### Money Streaming | ||
| - Create: Set up a new stream by entering a receiver address and amount. The SDK handles the flow rate math for you. | ||
| - Update: Change the flow rate for an existing recipient. | ||
| - Delete: Stop an active stream. | ||
|
|
||
| ### Distribution Pools (GDA) | ||
| - Connect: Join a distribution pool to start receiving funds. | ||
| - Disconnect: Leave a pool when you no longer want to receive distributions. | ||
| - Visibility: Check your connection status and current units directly in the UI. | ||
|
|
||
| ## Testing the Frontend | ||
| To properly test the data fetching: | ||
| 1. Make sure your `.env` file in the app folder has a `VITE_GRAPH_API_KEY`. | ||
| 2. Connect your wallet and switch to a supported network (Celo is best for G$ testing). | ||
| 3. If you're on Base, you can view SUP reserve holdings to verify the subgraph integration. | ||
|
|
||
| ## Unit Tests | ||
| If you want to run the underlying logic tests: | ||
| ```bash | ||
| cd packages/streaming-sdk | ||
| npm test | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| 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'] }, | ||
| 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 }, | ||
| ], | ||
| }, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for vercel deployment fixes, all reverted though