Skip to content

Commit

Permalink
Feat: Persistent User Data (#1617)
Browse files Browse the repository at this point in the history
* persistent user data with prisma

* fix lint

* ignore regular .env too

* remove unnecessary async

* address comments

* rename hooks and provider to userMetadata...

* add trade table and extend providers executeTrade with callback

* fix npm command

* update schema.prisma

* isminting passed in

* better schema without unnecessary stuff

* include view from materializedview

* remove comment

* remove totalFeesUSD

* fix linting

* merge master update prisma schema

* update prisma

* no need toBigInt anymore

* quoteType mapping, and indexcoop refid

* add placeholders for mint and redeem fees

* update prisma schema

* move to apiv2

* add eslint disable to generated files

* ts-nocheck for generated as well

* allow .ts imports in tsconfig

* fix linting and imports

* use api.indexcoop as baseurl

* handle ep errors and send messages back

* exclude admin endpoints from kubb generator

* comment fixes

* change url to cloudflare redirect

* fix kubb conf api baseUrl

* remove /api/v2 from the url for the redirect

* change api url back to render one for now

* remove url replace

* add fees to trade

* add working history and open positions

* underlyingAsset symbol & denominator

* use USD as default denominator

* lint fix

* move history sorting to backend too

* reinstall dependencies

* linting issues on gha

* linting again

* Fix lint

* fix gasestimatoor

* fix typeerrors in tests

* fix viem / wagmi versions

* lint with no cache

* update eslint

* full on transfer data

* adjust netBalance with transferAmount

* dont need to adjust netbalance

* fix unrealised pnl adjustment with tx

* scrollable history and positions

* move back to old your tokens for the ui

* add refId submission

* handle optional refid on app side

* simpify new history route

* remove shadow blur

* remove unnecessary address cast

* recreate lock

* chore: lint peristent user data (#1730)

* update github workflow to include generate

* update docs

* add sentry cli again

* remove sentri-cli dep

* update npm lint:fix command

* update lock

* readd lock

* fix deps

* remove underlyingAssetDenominator

* remove denominator function too

---------

Co-authored-by: 0xonramp <[email protected]>
Co-authored-by: JD <[email protected]>
  • Loading branch information
3 people authored Jan 14, 2025
1 parent 1d7a0fe commit 6b263d0
Show file tree
Hide file tree
Showing 38 changed files with 23,384 additions and 47,461 deletions.
2 changes: 2 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ NEXT_PUBLIC_TENDERLY_ACCESS_KEY=
NEXT_PUBLIC_TENDERLY_USER=
NEXT_PUBLIC_VERCEL_ENV=development
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=

INDEX_COOP_API_V2_KEY=
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
run: echo "NEXT_PUBLIC_ALCHEMY_ID=$(echo $NEXT_PUBLIC_ALCHEMY_ID | cut -c 1-6)" >> $NEXT_PUBLIC_ALCHEMY_ID
- name: Install
run: npm ci
- name: Generate kubb files
run: npm run generate
- name: Lint
run: npm run lint
- name: Run unit tests
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# debug
npm-debug.log*

yarn-debug.log*
yarn-error.log*

Expand All @@ -37,3 +38,6 @@ next-env.d.ts

# Sentry Config File
.env.sentry-build-plugin

# Generated
src/gen
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ cp .env.default .env.local
npm install
```

3. Start dev mode
3. Generate kubb files

```bash
npm run generate
```

4. Start dev mode

```bash
npm run dev
Expand Down
71 changes: 71 additions & 0 deletions kubb.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { defineConfig } from '@kubb/core'
import { pluginClient } from '@kubb/plugin-client'
import { pluginOas } from '@kubb/plugin-oas'
import { pluginTs } from '@kubb/plugin-ts'

const config = defineConfig({
root: '.',
input: {
path: 'https://api.indexcoop.com/v2/docs/json',
},
output: {
path: './src/gen',
clean: true,
},
plugins: [
pluginOas({
generators: [],
}),
pluginTs({
output: {
path: 'models',
barrelType: 'propagate',
banner: `/* eslint-disable */`,
},
exclude: [
{
type: 'tag',
pattern: 'admin',
},
],
group: {
type: 'tag',
},
enumType: 'asConst',
dateType: 'date',
}),
pluginClient({
baseURL: 'https://api-q513.onrender.com',
output: {
path: './clients/axios',
barrelType: 'propagate',
banner: `/* eslint-disable */`,
},
exclude: [
{
type: 'tag',
pattern: 'admin',
},
],
importPath: '@/lib/axios',
group: {
type: 'tag',
name({ group }) {
return `${group}Service`
},
},
operations: true,
pathParamsType: 'object',
dataReturnType: 'full',
}),
// pluginTanstackQuery({
// output: {
// path: './hooks',
// },
// framework: 'react',
// dataReturnType: 'full',
// }),
],
})

export default defineConfig(config)
Loading

0 comments on commit 6b263d0

Please sign in to comment.