@hu-fi/subgraph-sdk 1.0.0-beta.4 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,44 @@ Set your Graph Studio API key (used as a Bearer token):
16
16
  export HUFI_SUBGRAPH_API_KEY="your_api_key"
17
17
  ```
18
18
 
19
+ ### Usage Examples
20
+
21
+ #### Fetching Campaigns
22
+
23
+ ```typescript
24
+ import hufiSdk, { CampaignOrderBy, OrderDirection } from '@hu-fi/subgraph-sdk';
25
+
26
+ const campaigns = await hufiSdk.getCampaigns(137, {
27
+ first: 3,
28
+ filters: {
29
+ fundTokenAddress: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
30
+ },
31
+ orderBy: CampaignOrderBy.FUND_AMOUNT,
32
+ orderDirection: OrderDirection.DESC,
33
+ });
34
+
35
+ console.log('Campaigns:', campaigns);
36
+ ```
37
+
38
+ #### Fetching Statistics
39
+
40
+ ```typescript
41
+ import hufiSdk from '@hu-fi/subgraph-sdk';
42
+
43
+ // Get overall statistics
44
+ const overallStats = await hufiSdk.getOverallStats(137);
45
+ console.log('Overall stats:', overallStats);
46
+
47
+ // Get statistics by oracles
48
+ const oraclesStats = await hufiSdk.getStatsByOracles(
49
+ 137,
50
+ '0x5b74d007ea08217bcde942a2132df43d568a6dca',
51
+ '0x3a2292c684e289fe5f07737b598fe0027ead5a0e',
52
+ '0x1519964f5cd2d9ef162b2b1b66f33669cca065c8',
53
+ );
54
+ console.log('Oracles stats:', oraclesStats);
55
+ ```
56
+
19
57
  ## Local Development
20
58
 
21
59
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hu-fi/subgraph-sdk",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0",
4
4
  "type": "commonjs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",