File tree Expand file tree Collapse file tree 6 files changed +42
-6
lines changed Expand file tree Collapse file tree 6 files changed +42
-6
lines changed Original file line number Diff line number Diff line change 55 " plugin:prettier/recommended" ,
66 " prettier"
77 ],
8- "ignorePatterns" : [" **/**/ generated.ts" ],
8+ "ignorePatterns" : [" **/generated.ts" , " src/hooks/liquidity/gql/* " ],
99 "rules" : {
1010 "max-len" : [
1111 " warn" ,
Original file line number Diff line number Diff line change @@ -6,7 +6,22 @@ const config: CodegenConfig = {
66 documents : [ "src/hooks/liquidity/swapr.graphql" ] ,
77 generates : {
88 "./src/hooks/liquidity/gql/gql.ts" : {
9- plugins : [ "typescript" , "typescript-graphql-request" ] ,
9+ // preset: "client",
10+ plugins : [
11+ "typescript" ,
12+ "typescript-operations" ,
13+ "typescript-graphql-request" ,
14+ ] ,
15+ config : {
16+ strictScalars : true ,
17+ scalars : {
18+ BigDecimal : "string" ,
19+ BigInt : "string" ,
20+ Int8 : "string" ,
21+ Bytes : "`0x${string}`" ,
22+ Timestamp : "string" ,
23+ } ,
24+ } ,
1025 } ,
1126 } ,
1227} ;
Original file line number Diff line number Diff line change 4040 "@graphql-codegen/cli" : " ^5.0.2" ,
4141 "@graphql-codegen/typescript" : " ^5.0.2" ,
4242 "@graphql-codegen/typescript-graphql-request" : " ^6.3.0" ,
43+ "@graphql-codegen/typescript-operations" : " ^5.0.2" ,
4344 "@svgr/webpack" : " ^8.1.0" ,
4445 "@tailwindcss/postcss" : " ^4.1.4" ,
4546 "@types/node" : " ^20" ,
Original file line number Diff line number Diff line change 11import { Address } from "viem" ;
22
33import {
4- Tick ,
54 OrderDirection ,
65 Tick_OrderBy ,
76 getSdk as getSwaprSdk ,
7+ GetTicksQuery ,
88} from "./gql/gql" ;
99
1010import { PoolInfo , getPools } from "./useMarketPools" ;
@@ -17,7 +17,7 @@ async function getTicks(poolId: string) {
1717 }
1818
1919 const graphQLSdk = getSwaprSdk ;
20- let total : Tick [ ] = [ ] ;
20+ let total : GetTicksQuery [ "ticks" ] = [ ] ;
2121 let tickIdx = "" ;
2222 while ( true ) {
2323 const { ticks } = await graphQLSdk ( graphQLClient ) . GetTicks ( {
Original file line number Diff line number Diff line change 66 OrderDirection ,
77 Pool_OrderBy as SwaprPool_OrderBy ,
88 getSdk as getSwaprSdk ,
9- Pool ,
9+ GetPoolsQuery ,
1010} from "./gql/gql" ;
1111
1212import { getSwaprClient } from "./utils" ;
@@ -50,7 +50,7 @@ async function getSwaprPools(
5050 } ) ;
5151
5252 return await Promise . all (
53- pools . map ( async ( pool : Pool ) => ( {
53+ pools . map ( async ( pool : GetPoolsQuery [ "pools" ] [ number ] ) => ( {
5454 id : pool . id as Address ,
5555 dex : "Swapr" ,
5656 fee : Number ( pool . fee ) ,
Original file line number Diff line number Diff line change @@ -2705,6 +2705,25 @@ __metadata:
27052705 languageName: node
27062706 linkType: hard
27072707
2708+ "@graphql-codegen/typescript-operations@npm:^5.0.2":
2709+ version: 5.0.2
2710+ resolution: "@graphql-codegen/typescript-operations@npm:5.0.2"
2711+ dependencies:
2712+ "@graphql-codegen/plugin-helpers": "npm:^6.0.0"
2713+ "@graphql-codegen/typescript": "npm:^5.0.2"
2714+ "@graphql-codegen/visitor-plugin-common": "npm:6.1.0"
2715+ auto-bind: "npm:~4.0.0"
2716+ tslib: "npm:~2.6.0"
2717+ peerDependencies:
2718+ graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
2719+ graphql-sock: ^1.0.0
2720+ peerDependenciesMeta:
2721+ graphql-sock:
2722+ optional: true
2723+ checksum: 10c0/c3012666de69b1fc39a881f648b8a755904813223aaf9c7b5836f8cf5b40966171cbac645e0725cb7debcf30c73c9a262f4fbfe8f6a81cd9cd8791fd5aabe116
2724+ languageName: node
2725+ linkType: hard
2726+
27082727"@graphql-codegen/typescript@npm:^4.1.6":
27092728 version: 4.1.6
27102729 resolution: "@graphql-codegen/typescript@npm:4.1.6"
@@ -11042,6 +11061,7 @@ __metadata:
1104211061 "@graphql-codegen/cli": "npm:^5.0.2"
1104311062 "@graphql-codegen/typescript": "npm:^5.0.2"
1104411063 "@graphql-codegen/typescript-graphql-request": "npm:^6.3.0"
11064+ "@graphql-codegen/typescript-operations": "npm:^5.0.2"
1104511065 "@kleros/ui-components-library": "npm:^3.6.0"
1104611066 "@reown/appkit": "npm:^1.7.11"
1104711067 "@reown/appkit-adapter-wagmi": "npm:^1.7.11"
You can’t perform that action at this time.
0 commit comments