@poolzfinance/api4 1.12.9 → 1.13.0
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 +55 -1
- package/dist/endpoints/adminGetAllocation.d.ts +3 -3
- package/dist/endpoints/approvedContracts.d.ts +3 -3
- package/dist/endpoints/boostProxy.d.ts +6 -6
- package/dist/endpoints/daoSenderHistory.d.ts +3 -3
- package/dist/endpoints/leaderboard.d.ts +3 -3
- package/dist/endpoints/myRoles.d.ts +6 -0
- package/dist/endpoints/simpleUrlShortener.d.ts +3 -6
- package/dist/endpoints/tokenInfo.d.ts +6 -6
- package/dist/endpoints/vaults.d.ts +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -11
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/graphql/gql.d.ts +2 -27
- package/dist/types/graphql/graphql.d.ts +31 -69
- package/package.json +18 -13
- package/dist/endpoints/adminCleanCache.d.ts +0 -7
- package/dist/endpoints/adminListOfCollateral.d.ts +0 -6
- package/dist/endpoints/autoSignUp.d.ts +0 -31
- package/dist/endpoints/getDownloader.d.ts +0 -0
- package/dist/endpoints/investedERC20.d.ts +0 -6
- package/dist/endpoints/myRole.d.ts +0 -6
- package/dist/endpoints/mySignUpCheck.d.ts +0 -3
- package/dist/endpoints/seasonPass.d.ts +0 -31
- package/dist/endpoints/signupV2.d.ts +0 -17
- package/dist/endpoints/status.d.ts +0 -3
- package/dist/endpoints/tokenRefundsNFT.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,2 +1,56 @@
|
|
|
1
|
+
[](https://sonarcloud.io/summary/new_code?id=The-Poolz_InterfaceAPI4)
|
|
2
|
+
|
|
1
3
|
# InterfaceAPI4
|
|
2
|
-
|
|
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:
|
|
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
|
}>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const useApprovedContracts: (onlyApproved: boolean) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").GetApprovedContractsQuery, {
|
|
2
|
-
onlyApproved:
|
|
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:
|
|
3
|
-
}
|
|
4
|
-
export declare const useBoostData: (campaignCodes?: string[]) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").BoostProxyDataQuery, {
|
|
5
|
-
campaignCodes:
|
|
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:
|
|
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
|
|
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
|
-
|
|
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:
|
|
3
|
-
}
|
|
4
|
-
export declare const useTokenInfoByChainAndAddress: (chainId: number, tokenAddress: string) => import("@apollo/client").QueryResult<import("../types/graphql/graphql").TokenInfoQuery, {
|
|
5
|
-
hashKey:
|
|
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
|
|
6
|
-
tokenAddress
|
|
7
|
-
fetchBalance
|
|
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"]>;
|