@helium/blockchain-api 0.1.2 → 0.2.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 (51) hide show
  1. package/README.md +106 -49
  2. package/dist/index.d.ts +2382 -0
  3. package/dist/index.js +852 -0
  4. package/package.json +36 -126
  5. package/src/server/api/errors.ts +0 -152
  6. package/src/server/api/index.ts +0 -40
  7. package/src/server/api/procedures.ts +0 -144
  8. package/src/server/api/routers/fiat/router.ts +0 -709
  9. package/src/server/api/routers/fiat/schemas.ts +0 -169
  10. package/src/server/api/routers/health/router.ts +0 -41
  11. package/src/server/api/routers/hotspots/procedures/claimRewards.ts +0 -258
  12. package/src/server/api/routers/hotspots/procedures/createSplit.ts +0 -253
  13. package/src/server/api/routers/hotspots/procedures/deleteSplit.ts +0 -156
  14. package/src/server/api/routers/hotspots/procedures/getHotspots.ts +0 -31
  15. package/src/server/api/routers/hotspots/procedures/getPendingRewards.ts +0 -44
  16. package/src/server/api/routers/hotspots/procedures/getSplit.ts +0 -88
  17. package/src/server/api/routers/hotspots/procedures/transferHotspot.ts +0 -204
  18. package/src/server/api/routers/hotspots/procedures/updateRewardsDestination.ts +0 -201
  19. package/src/server/api/routers/hotspots/router.ts +0 -30
  20. package/src/server/api/routers/hotspots/schemas.ts +0 -182
  21. package/src/server/api/routers/swap/procedures/getInstructions.ts +0 -152
  22. package/src/server/api/routers/swap/procedures/getQuote.ts +0 -53
  23. package/src/server/api/routers/swap/procedures/getTokens.ts +0 -88
  24. package/src/server/api/routers/swap/router.ts +0 -15
  25. package/src/server/api/routers/swap/schemas.ts +0 -96
  26. package/src/server/api/routers/tokens/procedures/createHntAccount.ts +0 -87
  27. package/src/server/api/routers/tokens/procedures/getBalances.ts +0 -27
  28. package/src/server/api/routers/tokens/procedures/transfer.ts +0 -159
  29. package/src/server/api/routers/tokens/router.ts +0 -15
  30. package/src/server/api/routers/tokens/schemas.ts +0 -80
  31. package/src/server/api/routers/transactions/procedures/get.ts +0 -46
  32. package/src/server/api/routers/transactions/procedures/getByPayer.ts +0 -111
  33. package/src/server/api/routers/transactions/procedures/getByPayerAndTag.ts +0 -119
  34. package/src/server/api/routers/transactions/procedures/resubmit.ts +0 -68
  35. package/src/server/api/routers/transactions/procedures/submit.ts +0 -216
  36. package/src/server/api/routers/transactions/router.ts +0 -21
  37. package/src/server/api/routers/transactions/schemas.ts +0 -119
  38. package/src/server/api/routers/webhooks/router.ts +0 -75
  39. package/src/server/api/routers/welcomePacks/procedures/claim.ts +0 -157
  40. package/src/server/api/routers/welcomePacks/procedures/create.ts +0 -247
  41. package/src/server/api/routers/welcomePacks/procedures/deletePack.ts +0 -118
  42. package/src/server/api/routers/welcomePacks/procedures/get.ts +0 -36
  43. package/src/server/api/routers/welcomePacks/procedures/getByAddress.ts +0 -26
  44. package/src/server/api/routers/welcomePacks/procedures/invite.ts +0 -44
  45. package/src/server/api/routers/welcomePacks/procedures/list.ts +0 -27
  46. package/src/server/api/routers/welcomePacks/router.ts +0 -27
  47. package/src/server/api/routers/welcomePacks/schemas.ts +0 -135
  48. package/src/server/api/schemas.ts +0 -281
  49. package/tsconfig.json +0 -45
  50. package/types/README.md +0 -86
  51. package/types/index.ts +0 -27
package/types/README.md DELETED
@@ -1,86 +0,0 @@
1
- # @helium/blockchain-api
2
-
3
- TypeScript types for the Helium Blockchain API. Provides full type safety when building clients for the Helium blockchain services.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @helium/blockchain-api
9
- # or
10
- yarn add @helium/blockchain-api
11
- ```
12
-
13
- ## Peer Dependencies
14
-
15
- - `@orpc/server` ^1.12.0
16
- - `zod` ^4.0.0
17
-
18
- ## Usage
19
-
20
- ### Setting up a typed client
21
-
22
- ```typescript
23
- import type { BlockchainAPIClient } from "@helium/blockchain-api"
24
- import { createORPCClient } from "@orpc/client"
25
- import { RPCLink } from "@orpc/client/fetch"
26
-
27
- const link = new RPCLink({
28
- url: "https://your-api-url.com/rpc",
29
- })
30
-
31
- const client: BlockchainAPIClient = createORPCClient(link)
32
- ```
33
-
34
- ### Example API calls
35
-
36
- ```typescript
37
- // Get token balances
38
- const balances = await client.tokens.getBalances({
39
- walletAddress: "your-wallet-address"
40
- })
41
-
42
- // Get swap quote
43
- const quote = await client.swap.getQuote({
44
- inputMint: "input-token-mint",
45
- outputMint: "output-token-mint",
46
- amount: "1000000"
47
- })
48
-
49
- // Claim hotspot rewards
50
- const { transactionData } = await client.hotspots.claimRewards({
51
- walletAddress: "your-wallet-address"
52
- })
53
- ```
54
-
55
- ### With TanStack Query
56
-
57
- ```typescript
58
- import { createRouterUtils } from "@orpc/tanstack-query"
59
-
60
- const orpc = createRouterUtils(client)
61
-
62
- // In a React component
63
- const { data, isLoading } = orpc.tokens.getBalances.useQuery({
64
- input: { walletAddress: "your-wallet-address" }
65
- })
66
- ```
67
-
68
- ## Available Routers
69
-
70
- - `hotspots` - Hotspot management, rewards, splits
71
- - `tokens` - Token balances, transfers
72
- - `swap` - Jupiter DEX integration
73
- - `transactions` - Transaction submission/tracking
74
- - `welcomePacks` - Onboarding rewards
75
- - `fiat` - Bank accounts, KYC, offramp
76
- - `health` - Health checks
77
-
78
- ## Exports
79
-
80
- - `ORPCRouter` - The full router type
81
- - `BlockchainAPIClient` - Helper type for typed clients
82
- - `RouterClient` - Re-exported from @orpc/server
83
-
84
- ## License
85
-
86
- Apache-2.0
package/types/index.ts DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * Type exports for @helium/blockchain-api
3
- *
4
- * This module exports the ORPC router types that can be used by external packages
5
- * to get full type safety when working with the blockchain API.
6
- *
7
- * @example
8
- * ```typescript
9
- * import type { BlockchainAPIClient, ORPCRouter } from "@helium/blockchain-api"
10
- * import { createORPCClient } from "@orpc/client"
11
- *
12
- * const client: BlockchainAPIClient = createORPCClient(link)
13
- * ```
14
- */
15
-
16
- import { RouterClient } from "@orpc/server";
17
-
18
- // Re-export the router type
19
- export type { ORPCRouter } from "../src/server/api";
20
-
21
- // Re-export RouterClient type for convenience
22
- export type { RouterClient } from "@orpc/server";
23
-
24
- // Export a helper type for creating typed clients
25
- export type BlockchainAPIClient = RouterClient<
26
- import("../src/server/api").ORPCRouter
27
- >;