@fenelabs/fene-sdk 0.3.0 → 0.3.3

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/package.json CHANGED
@@ -1,65 +1,51 @@
1
1
  {
2
2
  "name": "@fenelabs/fene-sdk",
3
- "version": "0.3.0",
4
- "description": "Resonance Network SDK for TypeScript/JavaScript - Official SDK for interacting with Resonance FPoS blockchain",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
3
+ "version": "0.3.3",
4
+ "description": "TypeScript SDK for Fene API",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/index.d.ts",
11
10
  "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
13
  }
14
14
  },
15
15
  "files": [
16
- "dist",
17
- "README.md",
18
- "CHANGELOG.md",
19
- "LICENSE"
16
+ "dist"
20
17
  ],
21
18
  "scripts": {
22
- "build": "tsup src/index.ts --format cjs,esm --dts",
19
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
23
20
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
24
- "lint": "eslint src",
25
- "type-check": "tsc --noEmit",
26
- "prepublishOnly": "npm run build && npm run type-check"
27
- },
28
- "dependencies": {
29
- "ethers": "^6.9.0"
30
- },
31
- "devDependencies": {
32
- "@types/node": "^20.10.0",
33
- "tsup": "^8.0.1",
34
- "typescript": "^5.3.0"
21
+ "lint": "tsc --noEmit",
22
+ "test": "vitest run",
23
+ "prepublishOnly": "pnpm run build"
35
24
  },
36
25
  "keywords": [
37
26
  "resonance",
38
- "blockchain",
39
- "ethereum",
40
- "staking",
27
+ "api",
41
28
  "sdk",
42
- "poa",
43
- "proof-of-authority",
44
- "web3",
45
- "validator",
46
- "delegator",
47
- "typescript"
29
+ "blockchain",
30
+ "fene"
48
31
  ],
49
- "author": "avenbreaks",
32
+ "author": "Fene Labs",
50
33
  "license": "MIT",
51
34
  "repository": {
52
35
  "type": "git",
53
- "url": "https://github.com/avenbreaks/resonance-sdk.git"
36
+ "url": "https://github.com/fenelabs/fene-sdk"
54
37
  },
55
- "bugs": {
56
- "url": "https://github.com/avenbreaks/resonance-sdk/issues"
38
+ "devDependencies": {
39
+ "tsup": "^8.0.0",
40
+ "typescript": "^5.3.0",
41
+ "vitest": "^1.0.0"
57
42
  },
58
- "homepage": "https://github.com/avenbreaks/resonance-sdk#readme",
59
- "publishConfig": {
60
- "access": "public"
43
+ "peerDependencies": {
44
+ "viem": "^2.0.0"
61
45
  },
62
- "engines": {
63
- "node": ">=16.0.0"
46
+ "peerDependenciesMeta": {
47
+ "viem": {
48
+ "optional": true
49
+ }
64
50
  }
65
- }
51
+ }
package/CHANGELOG.md DELETED
@@ -1,152 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to the Resonance SDK will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [0.2.0] - 2025-12-10
9
-
10
- ### Added
11
-
12
- #### Analytics API Module (Subgraph Data)
13
- - **New `analytics` module** for accessing subgraph-indexed blockchain data
14
- - `getProtocolStats()` - Get protocol-level statistics (total staking, validator counts, rewards)
15
- - `getSyncStatus()` - Check synchronization status of analytics workers
16
- - `getAllValidators()` - Get paginated list of validators with analytics data
17
- - `getTopValidators()` - Get top validators sorted by uptime
18
- - `getValidatorAnalytics()` - Get detailed analytics for a specific validator
19
- - `getValidatorRewards()` - Get validator rewards and stakes with **mandatory pagination**
20
- - `getAllValidatorRewards()` - Auto-pagination helper for fetching complete reward data
21
-
22
- #### New Types
23
- - `ValidatorAnalytics` - Validator analytics data structure
24
- - `ValidatorAnalyticsListResponse` - Paginated validator list response
25
- - `ProtocolStats` - Protocol-level statistics
26
- - `ValidatorRewardsResponse` - Validator rewards with metadata
27
- - `SyncStatusResponse` - Worker synchronization status
28
- - `RewardDTO`, `StakeDTO`, `RewardSummary` - Reward-related types
29
- - `ResponseMetadata` - Response metadata with cache and pagination info
30
- - `PaginationOptions`, `ValidatorListOptions` - Pagination interfaces
31
-
32
- ### Changed
33
- - Updated main SDK class to include `analytics` module
34
- - Enhanced README with comprehensive analytics documentation
35
- - Added `examples/analytics-usage.ts` with complete usage examples
36
-
37
- ### Notes
38
- - Analytics data is sourced from The Graph subgraph and may have slight delays
39
- - Rewards endpoint requires pagination to prevent excessive data transfer
40
- - Always check `metadata.cached` and `metadata.stale` flags for data freshness
41
- - Use `getSyncStatus()` to verify subgraph synchronization before critical operations
42
-
43
- ## [0.1.1] - 2025-11-26
44
-
45
- ### Fixed
46
- - Fixed referral validate endpoint to use correct query parameter `code` instead of `referral_code`
47
- - Fixed indentation in referrals.ts validate method
48
-
49
- ### Changed
50
- - Updated JSDoc comment to reflect correct query parameter format `?code=CODE`
51
-
52
- ## [0.1.0] - 2024-11-26
53
-
54
- ### Added
55
-
56
- #### Core SDK Features
57
- - Initial release of Resonance Network SDK
58
- - Full TypeScript support with comprehensive type definitions
59
- - Support for both CommonJS and ES modules
60
- - Browser and Node.js compatibility
61
-
62
- #### API Modules
63
- - **Global API**: Network statistics, APR calculations, and leaderboards
64
- - `getStats()` - Get global network statistics
65
- - `getNetworkAPR()` - Get network APR
66
- - `getNetworkAPRBreakdown()` - Get detailed APR breakdown
67
- - `getLeaderboardDelegators()` - Get delegator leaderboard
68
- - `getLeaderboardValidators()` - Get validator leaderboard
69
-
70
- - **Validators API**: Complete validator information and metrics
71
- - `getAll()` - List all validators
72
- - `get()` - Get validator details
73
- - `getDelegators()` - Get validator's delegators
74
- - `getStakeBreakdown()` - Get stake distribution
75
- - `getEpoch()` - Get epoch-specific data
76
- - `getHistory()` - Get historical data
77
- - `getWithdrawals()` - Get withdrawal history
78
- - `getMetrics()` - Get performance metrics
79
- - `getSlashing()` - Get slashing events
80
- - `getAPR()` - Get validator-specific APR
81
-
82
- - **Delegators API**: Delegator data and staking information
83
- - `getAll()` - List all delegators
84
- - `get()` - Get delegator details
85
- - `getStakes()` - Get stake breakdown
86
- - `getRewards()` - Get reward history
87
- - `getWithdrawals()` - Get withdrawal history
88
- - `getUnbonding()` - Get unbonding status
89
- - `getValidators()` - Get active validators
90
-
91
- - **Referrals API**: Referral code management
92
- - `validate()` - Validate referral code
93
- - `create()` - Create new referral code (authenticated)
94
- - `apply()` - Apply referral code
95
- - `delete()` - Delete referral code (authenticated)
96
- - `unlink()` - Unlink delegator from referral (authenticated)
97
- - `getDelegatorReferral()` - Get delegator's referral info
98
- - `getValidatorReferral()` - Get validator's referral info
99
-
100
- - **Slashing API**: Slashing events and penalties
101
- - `getEvents()` - Get slashing events with optional filters
102
-
103
- #### Authentication
104
- - Web3 wallet authentication support
105
- - JWT token management
106
- - Session storage for token persistence
107
- - Automatic token expiration checking
108
- - Support for both validator and delegator roles
109
-
110
- #### HTTP Client
111
- - Custom timeout configuration
112
- - Custom header support
113
- - Automatic error handling
114
- - Query parameter building
115
- - Request/response type safety
116
-
117
- #### Developer Experience
118
- - Comprehensive TypeScript types for all API responses
119
- - Example files for common use cases
120
- - React hooks example for authentication
121
- - Full JSDoc documentation
122
- - ESLint configuration
123
- - Build tooling with tsup
124
-
125
- ### Documentation
126
- - Complete README with usage examples
127
- - API reference documentation
128
- - React and Next.js integration examples
129
- - Node.js usage examples
130
- - Authentication flow examples
131
- - Error handling examples
132
-
133
- ### Build & Distribution
134
- - CommonJS (CJS) build for Node.js
135
- - ES Module (ESM) build for modern bundlers
136
- - TypeScript declaration files (.d.ts)
137
- - Tree-shakeable exports
138
-
139
- ## [Unreleased]
140
-
141
- ### Planned Features
142
- - WebSocket support for real-time updates
143
- - Caching layer for frequently accessed data
144
- - Rate limiting and retry logic
145
- - GraphQL support (if API adds GraphQL)
146
- - Additional utility functions for common operations
147
- - React hooks package (@resonance/sdk-react)
148
- - Vue composables package (@resonance/sdk-vue)
149
-
150
- ---
151
-
152
- [0.1.0]: https://github.com/resonance-network/sdk/releases/tag/v0.1.0