@helium/blockchain-api 0.1.1 → 0.1.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.
Files changed (52) hide show
  1. package/README.md +24 -2
  2. package/package.json +31 -31
  3. package/types/README.md +24 -2
  4. package/types/generated/index.d.mts +2481 -0
  5. package/types/generated/index.d.ts +2481 -0
  6. package/types/generated/index.js +723 -0
  7. package/types/generated/index.mjs +614 -0
  8. package/types/index.ts +11 -8
  9. package/src/server/api/errors.ts +0 -152
  10. package/src/server/api/index.ts +0 -40
  11. package/src/server/api/procedures.ts +0 -144
  12. package/src/server/api/routers/fiat/router.ts +0 -709
  13. package/src/server/api/routers/fiat/schemas.ts +0 -157
  14. package/src/server/api/routers/health/router.ts +0 -41
  15. package/src/server/api/routers/hotspots/procedures/claimRewards.ts +0 -258
  16. package/src/server/api/routers/hotspots/procedures/createSplit.ts +0 -253
  17. package/src/server/api/routers/hotspots/procedures/deleteSplit.ts +0 -156
  18. package/src/server/api/routers/hotspots/procedures/getHotspots.ts +0 -31
  19. package/src/server/api/routers/hotspots/procedures/getPendingRewards.ts +0 -44
  20. package/src/server/api/routers/hotspots/procedures/getSplit.ts +0 -88
  21. package/src/server/api/routers/hotspots/procedures/transferHotspot.ts +0 -204
  22. package/src/server/api/routers/hotspots/procedures/updateRewardsDestination.ts +0 -201
  23. package/src/server/api/routers/hotspots/router.ts +0 -30
  24. package/src/server/api/routers/hotspots/schemas.ts +0 -182
  25. package/src/server/api/routers/swap/procedures/getInstructions.ts +0 -152
  26. package/src/server/api/routers/swap/procedures/getQuote.ts +0 -53
  27. package/src/server/api/routers/swap/procedures/getTokens.ts +0 -88
  28. package/src/server/api/routers/swap/router.ts +0 -15
  29. package/src/server/api/routers/swap/schemas.ts +0 -96
  30. package/src/server/api/routers/tokens/procedures/createHntAccount.ts +0 -87
  31. package/src/server/api/routers/tokens/procedures/getBalances.ts +0 -27
  32. package/src/server/api/routers/tokens/procedures/transfer.ts +0 -159
  33. package/src/server/api/routers/tokens/router.ts +0 -15
  34. package/src/server/api/routers/tokens/schemas.ts +0 -80
  35. package/src/server/api/routers/transactions/procedures/get.ts +0 -46
  36. package/src/server/api/routers/transactions/procedures/getByPayer.ts +0 -111
  37. package/src/server/api/routers/transactions/procedures/getByPayerAndTag.ts +0 -119
  38. package/src/server/api/routers/transactions/procedures/resubmit.ts +0 -68
  39. package/src/server/api/routers/transactions/procedures/submit.ts +0 -216
  40. package/src/server/api/routers/transactions/router.ts +0 -21
  41. package/src/server/api/routers/transactions/schemas.ts +0 -119
  42. package/src/server/api/routers/webhooks/router.ts +0 -75
  43. package/src/server/api/routers/welcomePacks/procedures/claim.ts +0 -157
  44. package/src/server/api/routers/welcomePacks/procedures/create.ts +0 -247
  45. package/src/server/api/routers/welcomePacks/procedures/deletePack.ts +0 -118
  46. package/src/server/api/routers/welcomePacks/procedures/get.ts +0 -36
  47. package/src/server/api/routers/welcomePacks/procedures/getByAddress.ts +0 -26
  48. package/src/server/api/routers/welcomePacks/procedures/invite.ts +0 -44
  49. package/src/server/api/routers/welcomePacks/procedures/list.ts +0 -27
  50. package/src/server/api/routers/welcomePacks/router.ts +0 -27
  51. package/src/server/api/routers/welcomePacks/schemas.ts +0 -135
  52. package/src/server/api/schemas.ts +0 -281
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @helium/blockchain-api
2
2
 
3
- TypeScript types for the Helium Blockchain API. Provides full type safety when building clients for the Helium blockchain services.
3
+ TypeScript types and Zod schemas for the Helium Blockchain API. Provides full type safety when building clients for the Helium blockchain services.
4
4
 
5
5
  ## Installation
6
6
 
@@ -12,7 +12,7 @@ yarn add @helium/blockchain-api
12
12
 
13
13
  ## Peer Dependencies
14
14
 
15
- - `@orpc/server` ^1.12.0
15
+ - `@orpc/client` ^1.12.0
16
16
  - `zod` ^4.0.0
17
17
 
18
18
  ## Usage
@@ -52,6 +52,18 @@ const { transactionData } = await client.hotspots.claimRewards({
52
52
  })
53
53
  ```
54
54
 
55
+ ### Using Zod schemas for validation
56
+
57
+ ```typescript
58
+ import { HotspotSchema, TokenAccountSchema } from "@helium/blockchain-api"
59
+
60
+ // Validate data
61
+ const hotspot = HotspotSchema.parse(rawData)
62
+
63
+ // Type inference
64
+ type Hotspot = z.infer<typeof HotspotSchema>
65
+ ```
66
+
55
67
  ### With TanStack Query
56
68
 
57
69
  ```typescript
@@ -77,10 +89,20 @@ const { data, isLoading } = orpc.tokens.getBalances.useQuery({
77
89
 
78
90
  ## Exports
79
91
 
92
+ ### Types
80
93
  - `ORPCRouter` - The full router type
81
94
  - `BlockchainAPIClient` - Helper type for typed clients
82
95
  - `RouterClient` - Re-exported from @orpc/server
83
96
 
97
+ ### Zod Schemas
98
+ - `HotspotSchema`, `HotspotsDataSchema` - Hotspot data validation
99
+ - `TokenAccountSchema`, `TokenBalanceDataSchema` - Token data validation
100
+ - `TransactionDataSchema`, `TransactionItemSchema` - Transaction validation
101
+ - `QuoteResponseSchema` - Swap quote validation
102
+ - `WelcomePackSchema` - Welcome pack validation
103
+ - `BankAccountSchema`, `KycStatusOutputSchema` - Fiat/KYC validation
104
+ - And many more input/output schemas for each router
105
+
84
106
  ## License
85
107
 
86
108
  Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helium/blockchain-api",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "TypeScript types for the Helium Blockchain API",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -11,21 +11,21 @@
11
11
  "types": "./types/index.ts",
12
12
  "files": [
13
13
  "types/",
14
- "src/server/api/",
15
14
  "tsconfig.json"
16
15
  ],
17
16
  "exports": {
18
17
  ".": {
19
18
  "types": "./types/index.ts",
20
- "default": "./types/index.ts"
19
+ "import": "./types/generated/index.mjs",
20
+ "require": "./types/generated/index.js"
21
21
  }
22
22
  },
23
23
  "peerDependencies": {
24
- "@orpc/server": "^1.12.0",
24
+ "@orpc/client": "^1.12.0",
25
25
  "zod": "^4.0.0"
26
26
  },
27
27
  "peerDependenciesMeta": {
28
- "@orpc/server": {
28
+ "@orpc/client": {
29
29
  "optional": false
30
30
  },
31
31
  "zod": {
@@ -33,19 +33,21 @@
33
33
  }
34
34
  },
35
35
  "scripts": {
36
- "prepublishOnly": "mv README.md DEV_README.md && cp types/README.md README.md && npm run lint && echo 'Ready to publish!'",
36
+ "build:types": "tsup",
37
+ "prepublishOnly": "yarn build:types && mv README.md DEV_README.md && cp types/README.md README.md && npm run lint && echo 'Ready to publish!'",
37
38
  "postpublish": "mv DEV_README.md README.md",
38
39
  "dev": "node scripts/dev-with-background.js",
39
40
  "dev:next-only": "next dev --turbopack",
40
41
  "build": "next build",
41
42
  "start": "next start",
42
- "lint": "prettier --check \"src/**/*.{js,ts,tsx}\" && eslint src/",
43
+ "lint": "prettier --check --write \"src/**/*.{js,ts,tsx}\" && eslint src/",
43
44
  "background-service": "node scripts/start-background-service.js",
44
45
  "test:e2e": "mocha -r @swc-node/register \"tests/e2e/**/*.test.ts\" --timeout 100000",
45
46
  "test:e2e:file": "mocha -r @swc-node/register --timeout 100000"
46
47
  },
47
- "dependencies": {
48
+ "devDependencies": {
48
49
  "@coral-xyz/anchor": "^0.31.1",
50
+ "@eslint/eslintrc": "^3.3.3",
49
51
  "@helium/cron-sdk": "^0.0.10",
50
52
  "@helium/distributor-oracle": "^0.11.6",
51
53
  "@helium/helium-entity-manager-sdk": "^0.11.6",
@@ -80,25 +82,41 @@
80
82
  "@radix-ui/react-slot": "^1.2.3",
81
83
  "@solana/spl-token": "^0.4.13",
82
84
  "@solana/web3.js": "^1.98.2",
85
+ "@swc-node/register": "^1.11.1",
86
+ "@swc/core": "^1.13.5",
87
+ "@swc/register": "^0.1.10",
83
88
  "@t3-oss/env-nextjs": "^0.13.8",
89
+ "@tailwindcss/postcss": "^4",
84
90
  "@tanstack/react-query": "^5.80.10",
85
91
  "@types/bn.js": "^5.2.0",
92
+ "@types/chai": "^5.2.3",
93
+ "@types/mocha": "^10.0.10",
94
+ "@types/node": "^20",
86
95
  "@types/node-cron": "^3.0.11",
96
+ "@types/pg": "^8.15.4",
97
+ "@types/react": "^19",
98
+ "@types/react-dom": "^19",
87
99
  "angry-purple-tiger": "^1.0.5",
88
100
  "aws-sdk": "^2.1692.0",
89
101
  "axios": "^1.10.0",
90
102
  "bn.js": "^5.2.2",
103
+ "chai": "^6.2.0",
91
104
  "class-variance-authority": "^0.7.1",
92
105
  "classnames": "^2.5.1",
93
106
  "clsx": "^2.1.1",
107
+ "dotenv": "^17.2.2",
108
+ "eslint": "^9",
109
+ "eslint-config-next": "15.4.6",
94
110
  "jito-ts": "^4.2.0",
95
111
  "js-sha256": "^0.11.1",
96
112
  "lucide-react": "^0.522.0",
113
+ "mocha": "^11.7.5",
97
114
  "next": "^16.0.10",
98
115
  "next-themes": "^0.4.6",
99
116
  "node-cron": "^4.2.1",
100
117
  "pg": "^8.16.2",
101
118
  "pg-hstore": "^2.3.4",
119
+ "prettier": "^3.7.4",
102
120
  "qrcode.react": "^4.2.0",
103
121
  "react": "^19.0.0",
104
122
  "react-async-hook": "^4.0.0",
@@ -106,38 +124,20 @@
106
124
  "react-hook-form": "^7.60.0",
107
125
  "react-jazzicon": "^1.0.4",
108
126
  "sequelize": "^6.37.7",
127
+ "sequelize-cli": "^6.6.3",
109
128
  "sonner": "^2.0.5",
110
129
  "sqlite3": "^5.1.7",
111
130
  "tailwind-merge": "^3.3.1",
112
- "uuid": "^11.1.0",
113
- "zod": "^4.0.5"
114
- },
115
- "devDependencies": {
116
- "@eslint/eslintrc": "^3.3.3",
117
- "@swc-node/register": "^1.11.1",
118
- "@swc/core": "^1.13.5",
119
- "@swc/register": "^0.1.10",
120
- "@tailwindcss/postcss": "^4",
121
- "@types/chai": "^5.2.3",
122
- "@types/mocha": "^10.0.10",
123
- "@types/node": "^20",
124
- "@types/pg": "^8.15.4",
125
- "@types/react": "^19",
126
- "@types/react-dom": "^19",
127
- "chai": "^6.2.0",
128
- "dotenv": "^17.2.2",
129
- "eslint": "^9",
130
- "eslint-config-next": "15.4.6",
131
- "mocha": "^11.7.5",
132
- "prettier": "^3.7.4",
133
- "sequelize-cli": "^6.6.3",
134
131
  "tailwindcss": "^4",
135
132
  "ts-node": "^10.9.2",
133
+ "tsup": "^8.5.1",
136
134
  "tsx": "^4.19.2",
137
135
  "tw-animate-css": "^1.3.4",
138
136
  "typescript": "^5",
137
+ "uuid": "^11.1.0",
139
138
  "why-is-node-running": "^3.2.2",
140
- "yaml": "^2.8.1"
139
+ "yaml": "^2.8.1",
140
+ "zod": "^4.0.5"
141
141
  },
142
142
  "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
143
143
  }
package/types/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @helium/blockchain-api
2
2
 
3
- TypeScript types for the Helium Blockchain API. Provides full type safety when building clients for the Helium blockchain services.
3
+ TypeScript types and Zod schemas for the Helium Blockchain API. Provides full type safety when building clients for the Helium blockchain services.
4
4
 
5
5
  ## Installation
6
6
 
@@ -12,7 +12,7 @@ yarn add @helium/blockchain-api
12
12
 
13
13
  ## Peer Dependencies
14
14
 
15
- - `@orpc/server` ^1.12.0
15
+ - `@orpc/client` ^1.12.0
16
16
  - `zod` ^4.0.0
17
17
 
18
18
  ## Usage
@@ -52,6 +52,18 @@ const { transactionData } = await client.hotspots.claimRewards({
52
52
  })
53
53
  ```
54
54
 
55
+ ### Using Zod schemas for validation
56
+
57
+ ```typescript
58
+ import { HotspotSchema, TokenAccountSchema } from "@helium/blockchain-api"
59
+
60
+ // Validate data
61
+ const hotspot = HotspotSchema.parse(rawData)
62
+
63
+ // Type inference
64
+ type Hotspot = z.infer<typeof HotspotSchema>
65
+ ```
66
+
55
67
  ### With TanStack Query
56
68
 
57
69
  ```typescript
@@ -77,10 +89,20 @@ const { data, isLoading } = orpc.tokens.getBalances.useQuery({
77
89
 
78
90
  ## Exports
79
91
 
92
+ ### Types
80
93
  - `ORPCRouter` - The full router type
81
94
  - `BlockchainAPIClient` - Helper type for typed clients
82
95
  - `RouterClient` - Re-exported from @orpc/server
83
96
 
97
+ ### Zod Schemas
98
+ - `HotspotSchema`, `HotspotsDataSchema` - Hotspot data validation
99
+ - `TokenAccountSchema`, `TokenBalanceDataSchema` - Token data validation
100
+ - `TransactionDataSchema`, `TransactionItemSchema` - Transaction validation
101
+ - `QuoteResponseSchema` - Swap quote validation
102
+ - `WelcomePackSchema` - Welcome pack validation
103
+ - `BankAccountSchema`, `KycStatusOutputSchema` - Fiat/KYC validation
104
+ - And many more input/output schemas for each router
105
+
84
106
  ## License
85
107
 
86
108
  Apache-2.0