@poolzfinance/api4 1.12.9 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,2 +1,56 @@
1
+ [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=The-Poolz_InterfaceAPI4&token=f0ba11edcd186439dd94a0e63b805bff7b46d80e)](https://sonarcloud.io/summary/new_code?id=The-Poolz_InterfaceAPI4)
2
+
1
3
  # InterfaceAPI4
2
- Bridge between front and back
4
+
5
+ InterfaceAPI4 provides a small React wrapper around the Poolz GraphQL API. It exposes an `API4Provider` component and a collection of hooks for querying and mutating data.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ pnpm install
11
+ ```
12
+
13
+ ## Building the package
14
+
15
+ ```
16
+ pnpm build
17
+ ```
18
+
19
+ ## Running tests
20
+
21
+ ```
22
+ pnpm test
23
+ ```
24
+
25
+ ## Basic usage
26
+
27
+ Wrap your application with `API4Provider` and pass it your GraphQL endpoint and a function that signs messages for authentication:
28
+
29
+ ```tsx
30
+ import API4Provider from "@poolzfinance/api4/dist/components/API4Provider";
31
+
32
+ const App = () => (
33
+ <API4Provider
34
+ account={address}
35
+ options={{
36
+ uri: "https://api4.poolz.finance/graphql",
37
+ siweCallBack: async () => ({
38
+ eip4361message: "...",
39
+ signature: "..."
40
+ })
41
+ }}
42
+ >
43
+ {/** your routes */}
44
+ </API4Provider>
45
+ );
46
+ ```
47
+
48
+ After the provider is configured you can start using the generated hooks:
49
+
50
+ ```tsx
51
+ import { useGetCurrentTime } from "@poolzfinance/api4";
52
+
53
+ const { data, loading } = useGetCurrentTime();
54
+ ```
55
+
56
+ The project also includes many other hooks located in `src/endpoints` for interacting with different parts of the API.
@@ -1,6 +1,6 @@
1
- export declare const useAdminGetAllocation: (projectId: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").AdminGetAllocationQuery, {
2
- projectId: string;
3
- }>;
1
+ export declare const useAdminGetAllocation: (projectId: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").AdminGetAllocationQuery, import("../types/graphql/graphql").Exact<{
2
+ projectId: import("../types/graphql/graphql").Scalars["String"]["input"];
3
+ }>>;
4
4
  export declare const useLazyAdminGetAllocation: () => import("@apollo/client").LazyQueryResultTuple<import("../types/graphql/graphql").AdminGetAllocationQuery, import("../types/graphql/graphql").Exact<{
5
5
  projectId: import("../types/graphql/graphql").Scalars["String"]["input"];
6
6
  }>>;
@@ -0,0 +1,3 @@
1
+ export declare const useLazyAdminReadAssets: () => import("@apollo/client").LazyQueryResultTuple<import("../types/graphql/graphql").AdminReadAssetsQuery, import("../types/graphql/graphql").Exact<{
2
+ request: Array<import("../types/graphql/graphql").ReadAssetsRequest> | import("../types/graphql/graphql").ReadAssetsRequest;
3
+ }>>;
@@ -1,3 +1,3 @@
1
- export declare const useApprovedContracts: (onlyApproved: boolean) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetApprovedContractsQuery, {
2
- onlyApproved: boolean;
3
- }>;
1
+ export declare const useApprovedContracts: (onlyApproved: boolean) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetApprovedContractsQuery, import("../types/graphql/graphql").Exact<{
2
+ onlyApproved: import("../types/graphql/graphql").Scalars["Boolean"]["input"];
3
+ }>>;
@@ -1,9 +1,9 @@
1
- export declare const useBoostUsers: (campaignCodes?: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").BoostProxyUsersQuery, {
2
- campaignCodes: string | never[];
3
- }>;
4
- export declare const useBoostData: (campaignCodes?: string[]) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").BoostProxyDataQuery, {
5
- campaignCodes: string[];
6
- }>;
1
+ export declare const useBoostUsers: (campaignCodes?: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").BoostProxyUsersQuery, import("../types/graphql/graphql").Exact<{
2
+ campaignCodes: Array<import("../types/graphql/graphql").Scalars["String"]["input"]> | import("../types/graphql/graphql").Scalars["String"]["input"];
3
+ }>>;
4
+ export declare const useBoostData: (campaignCodes?: string[]) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").BoostProxyDataQuery, import("../types/graphql/graphql").Exact<{
5
+ campaignCodes: Array<import("../types/graphql/graphql").Scalars["String"]["input"]> | import("../types/graphql/graphql").Scalars["String"]["input"];
6
+ }>>;
7
7
  export declare const useLazyBoostUsers: () => import("@apollo/client").LazyQueryResultTuple<import("../types/graphql/graphql").BoostProxyUsersQuery, import("../types/graphql/graphql").Exact<{
8
8
  campaignCodes: Array<import("../types/graphql/graphql").Scalars["String"]["input"]> | import("../types/graphql/graphql").Scalars["String"]["input"];
9
9
  }>>;
@@ -1,3 +1,3 @@
1
- export declare const useDaoSenderHistory: (page: number) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").DaoSenderHistoryQuery, {
2
- page: number;
3
- }>;
1
+ export declare const useDaoSenderHistory: (page: number) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").DaoSenderHistoryQuery, import("../types/graphql/graphql").Exact<{
2
+ page: import("../types/graphql/graphql").Scalars["Int"]["input"];
3
+ }>>;
@@ -1,6 +1,6 @@
1
- export declare const useLeaderboardByAddress: (address?: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetLeaderboardByAddressQuery, {
2
- address: string | undefined;
3
- }>;
1
+ export declare const useLeaderboardByAddress: (address?: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetLeaderboardByAddressQuery, import("../types/graphql/graphql").Exact<{
2
+ address?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["String"]["input"]>;
3
+ }>>;
4
4
  export declare const useLeaderboard: () => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetLeaderboardQuery, import("../types/graphql/graphql").Exact<{
5
5
  [key: string]: never;
6
6
  }>>;
@@ -0,0 +1,6 @@
1
+ export declare const useMyRoles: () => import("@apollo/client").QueryResult<import("../types/graphql/graphql").MyRolesQuery, import("../types/graphql/graphql").Exact<{
2
+ [key: string]: never;
3
+ }>>;
4
+ export declare const useLazyMyRoles: () => import("@apollo/client").LazyQueryResultTuple<import("../types/graphql/graphql").MyRolesQuery, import("../types/graphql/graphql").Exact<{
5
+ [key: string]: never;
6
+ }>>;
@@ -1,6 +1,3 @@
1
- export declare const useSimpleUrlShortener: (TxHash: string, ChainId: number) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").SimpleUrlShortenerQuery, {
2
- input: {
3
- TxHash: string;
4
- ChainId: number;
5
- };
6
- }>;
1
+ export declare const useSimpleUrlShortener: (TxHash: string, ChainId: number) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").SimpleUrlShortenerQuery, import("../types/graphql/graphql").Exact<{
2
+ input: import("../types/graphql/graphql").TxHashChainIdInput;
3
+ }>>;
@@ -1,6 +1,6 @@
1
- export declare const useTokenInfo: (hashKey: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").TokenInfoQuery, {
2
- hashKey: string;
3
- }>;
4
- export declare const useTokenInfoByChainAndAddress: (chainId: number, tokenAddress: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").TokenInfoQuery, {
5
- hashKey: string;
6
- }>;
1
+ export declare const useTokenInfo: (hashKey: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").TokenInfoQuery, import("../types/graphql/graphql").Exact<{
2
+ hashKey: import("../types/graphql/graphql").Scalars["String"]["input"];
3
+ }>>;
4
+ export declare const useTokenInfoByChainAndAddress: (chainId: number, tokenAddress: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").TokenInfoQuery, import("../types/graphql/graphql").Exact<{
5
+ hashKey: import("../types/graphql/graphql").Scalars["String"]["input"];
6
+ }>>;
@@ -1,11 +1,11 @@
1
1
  type ChainIdType = number | null;
2
2
  type TokenAddressType = string | null;
3
3
  type FetchBalanceType = boolean | null;
4
- export declare const useVaults: (chainId: ChainIdType, tokenAddress: TokenAddressType, fetchBalance: FetchBalanceType) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").DataQuery, {
5
- chainId: ChainIdType;
6
- tokenAddress: TokenAddressType;
7
- fetchBalance: FetchBalanceType;
8
- }>;
4
+ export declare const useVaults: (chainId: ChainIdType, tokenAddress: TokenAddressType, fetchBalance: FetchBalanceType) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").DataQuery, import("../types/graphql/graphql").Exact<{
5
+ chainId?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["Int"]["input"]>;
6
+ tokenAddress?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["String"]["input"]>;
7
+ fetchBalance?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["Boolean"]["input"]>;
8
+ }>>;
9
9
  export declare const useLazyGetVaults: () => import("@apollo/client").LazyQueryResultTuple<import("../types/graphql/graphql").DataQuery, import("../types/graphql/graphql").Exact<{
10
10
  chainId?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["Int"]["input"]>;
11
11
  tokenAddress?: import("../types/graphql/graphql").InputMaybe<import("../types/graphql/graphql").Scalars["String"]["input"]>;