@kadi.build/deploy-ability 0.0.1

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 (198) hide show
  1. package/README.md +523 -0
  2. package/dist/constants.d.ts +82 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +82 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/errors/certificate-error.d.ts +95 -0
  7. package/dist/errors/certificate-error.d.ts.map +1 -0
  8. package/dist/errors/certificate-error.js +111 -0
  9. package/dist/errors/certificate-error.js.map +1 -0
  10. package/dist/errors/deployment-error.d.ts +122 -0
  11. package/dist/errors/deployment-error.d.ts.map +1 -0
  12. package/dist/errors/deployment-error.js +185 -0
  13. package/dist/errors/deployment-error.js.map +1 -0
  14. package/dist/errors/index.d.ts +13 -0
  15. package/dist/errors/index.d.ts.map +1 -0
  16. package/dist/errors/index.js +18 -0
  17. package/dist/errors/index.js.map +1 -0
  18. package/dist/errors/profile-error.d.ts +106 -0
  19. package/dist/errors/profile-error.d.ts.map +1 -0
  20. package/dist/errors/profile-error.js +127 -0
  21. package/dist/errors/profile-error.js.map +1 -0
  22. package/dist/errors/provider-error.d.ts +104 -0
  23. package/dist/errors/provider-error.d.ts.map +1 -0
  24. package/dist/errors/provider-error.js +120 -0
  25. package/dist/errors/provider-error.js.map +1 -0
  26. package/dist/errors/wallet-error.d.ts +131 -0
  27. package/dist/errors/wallet-error.d.ts.map +1 -0
  28. package/dist/errors/wallet-error.js +154 -0
  29. package/dist/errors/wallet-error.js.map +1 -0
  30. package/dist/index.d.ts +49 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +53 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/targets/akash/bid-selectors.d.ts +251 -0
  35. package/dist/targets/akash/bid-selectors.d.ts.map +1 -0
  36. package/dist/targets/akash/bid-selectors.js +322 -0
  37. package/dist/targets/akash/bid-selectors.js.map +1 -0
  38. package/dist/targets/akash/bid-types.d.ts +297 -0
  39. package/dist/targets/akash/bid-types.d.ts.map +1 -0
  40. package/dist/targets/akash/bid-types.js +89 -0
  41. package/dist/targets/akash/bid-types.js.map +1 -0
  42. package/dist/targets/akash/blockchain-client.d.ts +577 -0
  43. package/dist/targets/akash/blockchain-client.d.ts.map +1 -0
  44. package/dist/targets/akash/blockchain-client.js +803 -0
  45. package/dist/targets/akash/blockchain-client.js.map +1 -0
  46. package/dist/targets/akash/certificate-manager.d.ts +228 -0
  47. package/dist/targets/akash/certificate-manager.d.ts.map +1 -0
  48. package/dist/targets/akash/certificate-manager.js +395 -0
  49. package/dist/targets/akash/certificate-manager.js.map +1 -0
  50. package/dist/targets/akash/constants.d.ts +231 -0
  51. package/dist/targets/akash/constants.d.ts.map +1 -0
  52. package/dist/targets/akash/constants.js +225 -0
  53. package/dist/targets/akash/constants.js.map +1 -0
  54. package/dist/targets/akash/deployer.d.ts +136 -0
  55. package/dist/targets/akash/deployer.d.ts.map +1 -0
  56. package/dist/targets/akash/deployer.js +599 -0
  57. package/dist/targets/akash/deployer.js.map +1 -0
  58. package/dist/targets/akash/environment.d.ts +241 -0
  59. package/dist/targets/akash/environment.d.ts.map +1 -0
  60. package/dist/targets/akash/environment.js +245 -0
  61. package/dist/targets/akash/environment.js.map +1 -0
  62. package/dist/targets/akash/index.d.ts +1113 -0
  63. package/dist/targets/akash/index.d.ts.map +1 -0
  64. package/dist/targets/akash/index.js +909 -0
  65. package/dist/targets/akash/index.js.map +1 -0
  66. package/dist/targets/akash/lease-monitor.d.ts +51 -0
  67. package/dist/targets/akash/lease-monitor.d.ts.map +1 -0
  68. package/dist/targets/akash/lease-monitor.js +110 -0
  69. package/dist/targets/akash/lease-monitor.js.map +1 -0
  70. package/dist/targets/akash/logs.d.ts +71 -0
  71. package/dist/targets/akash/logs.d.ts.map +1 -0
  72. package/dist/targets/akash/logs.js +311 -0
  73. package/dist/targets/akash/logs.js.map +1 -0
  74. package/dist/targets/akash/logs.types.d.ts +102 -0
  75. package/dist/targets/akash/logs.types.d.ts.map +1 -0
  76. package/dist/targets/akash/logs.types.js +9 -0
  77. package/dist/targets/akash/logs.types.js.map +1 -0
  78. package/dist/targets/akash/pricing.d.ts +247 -0
  79. package/dist/targets/akash/pricing.d.ts.map +1 -0
  80. package/dist/targets/akash/pricing.js +246 -0
  81. package/dist/targets/akash/pricing.js.map +1 -0
  82. package/dist/targets/akash/provider-client.d.ts +114 -0
  83. package/dist/targets/akash/provider-client.d.ts.map +1 -0
  84. package/dist/targets/akash/provider-client.js +318 -0
  85. package/dist/targets/akash/provider-client.js.map +1 -0
  86. package/dist/targets/akash/provider-metadata.d.ts +228 -0
  87. package/dist/targets/akash/provider-metadata.d.ts.map +1 -0
  88. package/dist/targets/akash/provider-metadata.js +14 -0
  89. package/dist/targets/akash/provider-metadata.js.map +1 -0
  90. package/dist/targets/akash/provider-service.d.ts +133 -0
  91. package/dist/targets/akash/provider-service.d.ts.map +1 -0
  92. package/dist/targets/akash/provider-service.js +391 -0
  93. package/dist/targets/akash/provider-service.js.map +1 -0
  94. package/dist/targets/akash/query-client.d.ts +125 -0
  95. package/dist/targets/akash/query-client.d.ts.map +1 -0
  96. package/dist/targets/akash/query-client.js +332 -0
  97. package/dist/targets/akash/query-client.js.map +1 -0
  98. package/dist/targets/akash/sdl-generator.d.ts +31 -0
  99. package/dist/targets/akash/sdl-generator.d.ts.map +1 -0
  100. package/dist/targets/akash/sdl-generator.js +279 -0
  101. package/dist/targets/akash/sdl-generator.js.map +1 -0
  102. package/dist/targets/akash/types.d.ts +285 -0
  103. package/dist/targets/akash/types.d.ts.map +1 -0
  104. package/dist/targets/akash/types.js +54 -0
  105. package/dist/targets/akash/types.js.map +1 -0
  106. package/dist/targets/akash/wallet-manager.d.ts +526 -0
  107. package/dist/targets/akash/wallet-manager.d.ts.map +1 -0
  108. package/dist/targets/akash/wallet-manager.js +953 -0
  109. package/dist/targets/akash/wallet-manager.js.map +1 -0
  110. package/dist/targets/local/compose-generator.d.ts +244 -0
  111. package/dist/targets/local/compose-generator.d.ts.map +1 -0
  112. package/dist/targets/local/compose-generator.js +324 -0
  113. package/dist/targets/local/compose-generator.js.map +1 -0
  114. package/dist/targets/local/deployer.d.ts +82 -0
  115. package/dist/targets/local/deployer.d.ts.map +1 -0
  116. package/dist/targets/local/deployer.js +367 -0
  117. package/dist/targets/local/deployer.js.map +1 -0
  118. package/dist/targets/local/engine-manager.d.ts +155 -0
  119. package/dist/targets/local/engine-manager.d.ts.map +1 -0
  120. package/dist/targets/local/engine-manager.js +250 -0
  121. package/dist/targets/local/engine-manager.js.map +1 -0
  122. package/dist/targets/local/index.d.ts +40 -0
  123. package/dist/targets/local/index.d.ts.map +1 -0
  124. package/dist/targets/local/index.js +43 -0
  125. package/dist/targets/local/index.js.map +1 -0
  126. package/dist/targets/local/network-manager.d.ts +160 -0
  127. package/dist/targets/local/network-manager.d.ts.map +1 -0
  128. package/dist/targets/local/network-manager.js +337 -0
  129. package/dist/targets/local/network-manager.js.map +1 -0
  130. package/dist/targets/local/types.d.ts +327 -0
  131. package/dist/targets/local/types.d.ts.map +1 -0
  132. package/dist/targets/local/types.js +9 -0
  133. package/dist/targets/local/types.js.map +1 -0
  134. package/dist/types/common.d.ts +585 -0
  135. package/dist/types/common.d.ts.map +1 -0
  136. package/dist/types/common.js +13 -0
  137. package/dist/types/common.js.map +1 -0
  138. package/dist/types/index.d.ts +15 -0
  139. package/dist/types/index.d.ts.map +1 -0
  140. package/dist/types/index.js +12 -0
  141. package/dist/types/index.js.map +1 -0
  142. package/dist/types/options.d.ts +329 -0
  143. package/dist/types/options.d.ts.map +1 -0
  144. package/dist/types/options.js +10 -0
  145. package/dist/types/options.js.map +1 -0
  146. package/dist/types/profiles.d.ts +329 -0
  147. package/dist/types/profiles.d.ts.map +1 -0
  148. package/dist/types/profiles.js +27 -0
  149. package/dist/types/profiles.js.map +1 -0
  150. package/dist/types/results.d.ts +443 -0
  151. package/dist/types/results.d.ts.map +1 -0
  152. package/dist/types/results.js +64 -0
  153. package/dist/types/results.js.map +1 -0
  154. package/dist/types/validators.d.ts +118 -0
  155. package/dist/types/validators.d.ts.map +1 -0
  156. package/dist/types/validators.js +198 -0
  157. package/dist/types/validators.js.map +1 -0
  158. package/dist/utils/command-runner.d.ts +128 -0
  159. package/dist/utils/command-runner.d.ts.map +1 -0
  160. package/dist/utils/command-runner.js +210 -0
  161. package/dist/utils/command-runner.js.map +1 -0
  162. package/dist/utils/index.d.ts +10 -0
  163. package/dist/utils/index.d.ts.map +1 -0
  164. package/dist/utils/index.js +10 -0
  165. package/dist/utils/index.js.map +1 -0
  166. package/dist/utils/logger.d.ts +68 -0
  167. package/dist/utils/logger.d.ts.map +1 -0
  168. package/dist/utils/logger.js +93 -0
  169. package/dist/utils/logger.js.map +1 -0
  170. package/dist/utils/profile-loader.d.ts +76 -0
  171. package/dist/utils/profile-loader.d.ts.map +1 -0
  172. package/dist/utils/profile-loader.js +194 -0
  173. package/dist/utils/profile-loader.js.map +1 -0
  174. package/dist/utils/registry/index.d.ts +27 -0
  175. package/dist/utils/registry/index.d.ts.map +1 -0
  176. package/dist/utils/registry/index.js +29 -0
  177. package/dist/utils/registry/index.js.map +1 -0
  178. package/dist/utils/registry/manager.d.ts +319 -0
  179. package/dist/utils/registry/manager.d.ts.map +1 -0
  180. package/dist/utils/registry/manager.js +671 -0
  181. package/dist/utils/registry/manager.js.map +1 -0
  182. package/dist/utils/registry/setup.d.ts +135 -0
  183. package/dist/utils/registry/setup.d.ts.map +1 -0
  184. package/dist/utils/registry/setup.js +207 -0
  185. package/dist/utils/registry/setup.js.map +1 -0
  186. package/dist/utils/registry/transformer.d.ts +92 -0
  187. package/dist/utils/registry/transformer.d.ts.map +1 -0
  188. package/dist/utils/registry/transformer.js +131 -0
  189. package/dist/utils/registry/transformer.js.map +1 -0
  190. package/dist/utils/registry/types.d.ts +241 -0
  191. package/dist/utils/registry/types.d.ts.map +1 -0
  192. package/dist/utils/registry/types.js +10 -0
  193. package/dist/utils/registry/types.js.map +1 -0
  194. package/docs/EXAMPLES.md +293 -0
  195. package/docs/PLACEMENT.md +433 -0
  196. package/docs/STORAGE.md +318 -0
  197. package/docs/building-provider-reliability-tracker.md +2581 -0
  198. package/package.json +109 -0
@@ -0,0 +1,1113 @@
1
+ /**
2
+ * Akash Network Deployment SDK
3
+ *
4
+ * A delightful API for deploying to Akash Network with excellent TypeScript support.
5
+ *
6
+ * This module provides a clean, organized public API for all Akash deployment operations.
7
+ * Functions are grouped by responsibility for easy discovery and intuitive usage.
8
+ *
9
+ * @example Quick Start - Simple Deployment
10
+ * ```typescript
11
+ * import { deployToAkash, connectWallet, ensureCertificate, createSigningClient } from '@deploy-ability/akash';
12
+ *
13
+ * // 1. Connect wallet
14
+ * const walletResult = await connectWallet({ network: 'mainnet' });
15
+ * if (!walletResult.success) throw walletResult.error;
16
+ *
17
+ * // 2. Create signing client
18
+ * const clientResult = await createSigningClient(walletResult.data, 'mainnet');
19
+ * if (!clientResult.success) throw clientResult.error;
20
+ *
21
+ * // 3. Ensure certificate exists
22
+ * const certResult = await ensureCertificate(
23
+ * walletResult.data,
24
+ * 'mainnet',
25
+ * clientResult.data.client
26
+ * );
27
+ * if (!certResult.success) throw certResult.error;
28
+ *
29
+ * // 4. Deploy!
30
+ * const result = await deployToAkash({
31
+ * wallet: walletResult.data,
32
+ * certificate: certResult.data,
33
+ * projectRoot: './my-app',
34
+ * profile: 'production',
35
+ * network: 'mainnet'
36
+ * });
37
+ *
38
+ * if (result.success) {
39
+ * console.log(`🚀 Deployed! DSEQ: ${result.data.dseq}`);
40
+ * console.log(`🌐 Endpoints:`, result.data.endpoints);
41
+ * }
42
+ * ```
43
+ *
44
+ * @example Advanced - Custom Bid Selection
45
+ * ```typescript
46
+ * import { createDeployment, queryBids, createLease } from '@deploy-ability/akash';
47
+ *
48
+ * // Create deployment
49
+ * const deployment = await createDeployment(clientContext, wallet, sdl, 5);
50
+ * if (!deployment.success) throw deployment.error;
51
+ *
52
+ * // Get bids
53
+ * const bids = await queryBids(wallet, 'mainnet', deployment.data.dseq);
54
+ * if (!bids.success) throw bids.error;
55
+ *
56
+ * // Filter for cheapest GPU bid under budget
57
+ * const affordableBids = bids.data.filter(bid =>
58
+ * parseInt(bid.price?.amount ?? '0') < 1000 // uakt per block
59
+ * );
60
+ *
61
+ * if (affordableBids.length === 0) {
62
+ * throw new Error('No affordable bids found');
63
+ * }
64
+ *
65
+ * // Create lease with selected bid
66
+ * const lease = await createLease(clientContext, affordableBids[0]);
67
+ * if (!lease.success) throw lease.error;
68
+ * ```
69
+ *
70
+ * @example Expert - Full Control with Primitives
71
+ * ```typescript
72
+ * import * as akash from '@deploy-ability/akash';
73
+ *
74
+ * // Full access to all primitives for custom workflows
75
+ * const wallet = await akash.connectWallet({ network: 'mainnet' });
76
+ * const cert = await akash.generateCertificate(wallet.data.address);
77
+ * const sdl = akash.createSdlObject(profile);
78
+ * // ... compose your own deployment flow with complete control
79
+ * ```
80
+ *
81
+ * @module akash
82
+ */
83
+ /**
84
+ * Main deployment orchestration function
85
+ *
86
+ * Handles the complete deployment workflow:
87
+ * - Profile loading and SDL generation
88
+ * - Deployment creation on blockchain
89
+ * - Provider bid collection
90
+ * - Lease creation
91
+ * - Manifest delivery
92
+ * - Optional container readiness monitoring
93
+ */
94
+ export { deployToAkash } from './deployer.js';
95
+ /**
96
+ * Deployment execution parameters
97
+ *
98
+ * Requires wallet context and optional certificate for provider communication
99
+ */
100
+ export type { AkashDeploymentExecution } from './deployer.js';
101
+ /**
102
+ * Connect wallet (Keplr browser extension or WalletConnect)
103
+ *
104
+ * Primary wallet connection method. Automatically detects and uses Keplr
105
+ * if available, otherwise falls back to WalletConnect if project ID provided.
106
+ *
107
+ * @example Connect with Keplr
108
+ * ```typescript
109
+ * const result = await connectWallet({ network: 'mainnet' });
110
+ * if (result.success) {
111
+ * console.log('Connected:', result.data.address);
112
+ * }
113
+ * ```
114
+ *
115
+ * @example Connect with WalletConnect
116
+ * ```typescript
117
+ * const result = await connectWallet({
118
+ * network: 'mainnet',
119
+ * walletConnectProjectId: 'your-project-id'
120
+ * });
121
+ * ```
122
+ */
123
+ export { connectWallet } from './wallet-manager.js';
124
+ /**
125
+ * Initialize WalletConnect client
126
+ *
127
+ * Lower-level function for manual WalletConnect setup.
128
+ * Use connectWallet() for most cases.
129
+ */
130
+ export { initWalletConnect } from './wallet-manager.js';
131
+ /**
132
+ * Generate WalletConnect connection URI
133
+ *
134
+ * Creates connection URI for QR code display.
135
+ */
136
+ export { generateConnectionUri } from './wallet-manager.js';
137
+ /**
138
+ * Wait for WalletConnect approval
139
+ *
140
+ * Polls for user approval from mobile wallet.
141
+ */
142
+ export { waitForApproval } from './wallet-manager.js';
143
+ /**
144
+ * Create wallet context from signer
145
+ *
146
+ * Converts offline signer into full wallet context with account info.
147
+ */
148
+ export { createWalletContext } from './wallet-manager.js';
149
+ /**
150
+ * Create wallet context from signer (for automated deployments)
151
+ *
152
+ * Use this for **automated deployments** where you have direct access to a signer
153
+ * instead of interactive wallet connection. Perfect for agents, CI/CD, hardware
154
+ * wallets, or KMS - accepts signer interface without requiring mnemonic exposure.
155
+ *
156
+ * **Security Model**: Signers can sign transactions without exposing private keys!
157
+ *
158
+ * @example Agent with encrypted wallet
159
+ * ```typescript
160
+ * const agentSigner = await myAgent.wallet.getSigner();
161
+ * const walletCtx = await createWalletContextFromSigner(agentSigner, 'mainnet');
162
+ *
163
+ * if (walletCtx.success) {
164
+ * await deployToAkash({
165
+ * wallet: walletCtx.data,
166
+ * certificate: cert,
167
+ * projectRoot: './',
168
+ * profile: 'prod'
169
+ * });
170
+ * }
171
+ * ```
172
+ *
173
+ * @example CI/CD with secrets manager
174
+ * ```typescript
175
+ * const signer = await loadSignerFromSecretsManager();
176
+ * const walletCtx = await createWalletContextFromSigner(signer, 'mainnet');
177
+ * ```
178
+ */
179
+ export { createWalletContextFromSigner } from './wallet-manager.js';
180
+ /**
181
+ * Create wallet context from mnemonic (for agent-controlled wallets)
182
+ *
183
+ * ⚠️ **SECURITY WARNING**: Only use this for wallets YOU control!
184
+ *
185
+ * Use this for:
186
+ * - ✅ Your own CI/CD automation
187
+ * - ✅ Your own agents (running on your infrastructure)
188
+ * - ✅ Custodial services you operate
189
+ *
190
+ * **NEVER** give your mnemonic to third-party agents!
191
+ * For third-party services, use `connectWallet()` with WalletConnect instead.
192
+ *
193
+ * @example CI/CD deployment
194
+ * ```typescript
195
+ * // Mnemonic from GitHub Secrets
196
+ * const mnemonic = process.env.DEPLOYMENT_WALLET_MNEMONIC!;
197
+ * const wallet = await createWalletFromMnemonic(mnemonic, 'mainnet');
198
+ *
199
+ * if (wallet.success) {
200
+ * await deployToAkash({ wallet: wallet.data, ... });
201
+ * }
202
+ * ```
203
+ *
204
+ * **Note**: This function is not yet fully implemented - see function documentation
205
+ * for complete implementation plan and security considerations.
206
+ */
207
+ export { createWalletFromMnemonic } from './wallet-manager.js';
208
+ /**
209
+ * Disconnect wallet
210
+ *
211
+ * Safely disconnects wallet and cleans up WalletConnect sessions if applicable.
212
+ */
213
+ export { disconnectWallet } from './wallet-manager.js';
214
+ /**
215
+ * Wallet connection types
216
+ */
217
+ export type { WalletConnectClient, ConnectionUriResult, ApprovalResult, } from './wallet-manager.js';
218
+ /**
219
+ * Generate a new Akash certificate
220
+ *
221
+ * Creates fresh X.509 certificate for mTLS authentication with providers.
222
+ * Certificate must be broadcast to blockchain before use.
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const cert = generateCertificate(wallet.address);
227
+ * if (cert.success) {
228
+ * // Now broadcast to blockchain
229
+ * await broadcastCertificate(wallet, cert.data, client);
230
+ * }
231
+ * ```
232
+ */
233
+ export { generateCertificate } from './certificate-manager.js';
234
+ /**
235
+ * Parse and validate certificate from JSON
236
+ *
237
+ * Validates certificate structure and PEM format before use.
238
+ */
239
+ export { parseCertificate } from './certificate-manager.js';
240
+ /**
241
+ * Broadcast certificate to blockchain
242
+ *
243
+ * Submits certificate transaction, making it available for provider authentication.
244
+ */
245
+ export { broadcastCertificate } from './certificate-manager.js';
246
+ /**
247
+ * Query certificate from blockchain
248
+ *
249
+ * Checks if valid certificate exists on-chain for wallet address.
250
+ */
251
+ export { queryCertificate } from './certificate-manager.js';
252
+ /**
253
+ * Ensure certificate exists (convenience)
254
+ *
255
+ * High-level helper that handles complete certificate workflow:
256
+ * - Use existing certificate if provided
257
+ * - Query blockchain for existing certificate
258
+ * - Generate and broadcast new certificate if needed
259
+ *
260
+ * @example
261
+ * ```typescript
262
+ * const cert = await ensureCertificate(wallet, 'mainnet', client);
263
+ * // Certificate is guaranteed ready to use
264
+ * ```
265
+ */
266
+ export { ensureCertificate } from './certificate-manager.js';
267
+ /**
268
+ * Certificate broadcast result with transaction details
269
+ */
270
+ export type { CertificateBroadcastResult, OnChainCertificateInfo, } from './certificate-manager.js';
271
+ /**
272
+ * Create signing client for Akash blockchain
273
+ *
274
+ * Creates SigningStargateClient configured with Akash-specific message types.
275
+ * Required for all blockchain transactions.
276
+ *
277
+ * @example
278
+ * ```typescript
279
+ * const result = await createSigningClient(wallet, 'mainnet');
280
+ * if (result.success) {
281
+ * const { client, account } = result.data;
282
+ * // Use client for transactions
283
+ * }
284
+ * ```
285
+ */
286
+ export { createSigningClient } from './blockchain-client.js';
287
+ /**
288
+ * Create deployment on Akash blockchain
289
+ *
290
+ * Submits deployment transaction with SDL manifest.
291
+ * Returns deployment sequence number (dseq) for tracking.
292
+ */
293
+ export { createDeployment } from './blockchain-client.js';
294
+ /**
295
+ * Query provider bids for deployment
296
+ *
297
+ * Fetches current bids from providers willing to host your deployment.
298
+ * Supports provider blacklisting.
299
+ */
300
+ export { queryBids } from './blockchain-client.js';
301
+ /**
302
+ * Wait for provider bids (polling)
303
+ *
304
+ * Continuously polls for bids until timeout.
305
+ * Useful when bids don't appear immediately.
306
+ */
307
+ export { waitForBids } from './blockchain-client.js';
308
+ /**
309
+ * Create lease with selected provider
310
+ *
311
+ * Accepts provider bid and creates lease on blockchain.
312
+ * After this, you can send manifest to provider.
313
+ */
314
+ export { createLease } from './blockchain-client.js';
315
+ /**
316
+ * Close/terminate a deployment
317
+ *
318
+ * Closes an active deployment on the blockchain, terminating the lease
319
+ * and stopping all containers on the provider. The provider will release
320
+ * resources and stop billing.
321
+ *
322
+ * **Important Notes:**
323
+ * - Closing a deployment is permanent and cannot be undone
324
+ * - You'll lose access to all data in ephemeral storage
325
+ * - Persistent storage may be retained by provider for a limited time
326
+ * - You can redeploy using the same SDL if needed
327
+ *
328
+ * **When to Use:**
329
+ * - Gracefully shut down deployments you no longer need
330
+ * - Stop billing for inactive services
331
+ * - Clean up test/development deployments
332
+ * - Migrate to a different provider
333
+ *
334
+ * @example Close a deployment
335
+ * ```typescript
336
+ * import { createSigningClient, closeDeployment } from 'deploy-ability/akash';
337
+ *
338
+ * const clientResult = await createSigningClient(wallet, 'mainnet');
339
+ * if (!clientResult.success) throw clientResult.error;
340
+ *
341
+ * const result = await closeDeployment(
342
+ * clientResult.data,
343
+ * wallet,
344
+ * '12345' // DSEQ from deployment
345
+ * );
346
+ *
347
+ * if (result.success) {
348
+ * console.log('Deployment closed:', result.data.transactionHash);
349
+ * }
350
+ * ```
351
+ *
352
+ * @see DeploymentCloseResult for details on the response structure
353
+ */
354
+ export { closeDeployment } from './blockchain-client.js';
355
+ /**
356
+ * Blockchain operation result types
357
+ */
358
+ export type { SigningClientContext, DeploymentResult, LeaseResult, ProviderBid, LeaseId, DeploymentCloseResult, } from './blockchain-client.js';
359
+ /**
360
+ * Enhanced bid with complete provider information
361
+ *
362
+ * Combines raw blockchain bid data with enriched provider metadata,
363
+ * comprehensive pricing calculations, and reliability metrics. This is
364
+ * the primary type for working with provider bids.
365
+ *
366
+ * **What's Included:**
367
+ * - Provider identity (name, owner address, host URI)
368
+ * - Location information (country, region, coordinates)
369
+ * - Reliability metrics (uptime1d, uptime7d, uptime30d)
370
+ * - Audit status
371
+ * - Complete pricing across multiple time periods (hour/day/week/month)
372
+ * - Pricing in multiple currencies (uAKT, AKT, USD via conversion)
373
+ *
374
+ * **Data Availability:**
375
+ * - Some providers may not have complete metadata
376
+ * - Reliability data requires provider to be tracked by indexer
377
+ * - Location data comes from IP geolocation
378
+ * - Always check for undefined before using optional fields
379
+ *
380
+ * @example Working with enhanced bids
381
+ * ```typescript
382
+ * const bidsResult = await queryBids(wallet, 'mainnet', dseq);
383
+ * if (!bidsResult.success) throw bidsResult.error;
384
+ *
385
+ * for (const bid of bidsResult.data) {
386
+ * console.log('Provider:', bid.provider.name || bid.provider.owner);
387
+ * console.log('Location:', bid.provider.location?.country || 'Unknown');
388
+ * console.log('Price:', bid.pricing.akt.perMonth, 'AKT/month');
389
+ *
390
+ * if (bid.provider.reliability) {
391
+ * console.log('Uptime (7d):', (bid.provider.reliability.uptime7d * 100).toFixed(1) + '%');
392
+ * }
393
+ * }
394
+ * ```
395
+ *
396
+ * @see BidPricing for pricing structure details
397
+ * @see ProviderInfo for provider metadata structure
398
+ */
399
+ export type { EnhancedBid } from './bid-types.js';
400
+ /**
401
+ * Bid selector function type
402
+ *
403
+ * Function signature for selecting a provider from available bids.
404
+ * Can be synchronous or asynchronous to support both algorithmic
405
+ * and interactive selection strategies.
406
+ *
407
+ * **Contract:**
408
+ * - Input: Non-empty array of EnhancedBid
409
+ * - Output: Selected EnhancedBid or null if none acceptable
410
+ * - Should not throw - return null instead for unacceptable bids
411
+ *
412
+ * **Use Cases:**
413
+ * - Algorithmic selection (cheapest, most reliable, balanced)
414
+ * - Interactive selection (CLI prompts, UI selection)
415
+ * - External validation (check against allowlist, query external APIs)
416
+ * - Complex business logic (budget constraints, compliance requirements)
417
+ *
418
+ * @example Simple algorithmic selector
419
+ * ```typescript
420
+ * const selector: BidSelector = (bids) => {
421
+ * if (bids.length === 0) return null;
422
+ * return bids.reduce((cheapest, current) =>
423
+ * current.pricing.uakt.perMonth < cheapest.pricing.uakt.perMonth
424
+ * ? current : cheapest
425
+ * );
426
+ * };
427
+ * ```
428
+ *
429
+ * @example Async interactive selector
430
+ * ```typescript
431
+ * const selector: BidSelector = async (bids) => {
432
+ * console.log('Available providers:');
433
+ * bids.forEach((bid, i) => {
434
+ * console.log(`${i + 1}. ${bid.provider.name} - ${bid.pricing.akt.perMonth} AKT/month`);
435
+ * });
436
+ *
437
+ * const choice = await promptUser('Select provider: ');
438
+ * return bids[parseInt(choice) - 1] || null;
439
+ * };
440
+ * ```
441
+ *
442
+ * @see Pre-built selectors: selectCheapestBid, selectMostReliableBid, selectBalancedBid
443
+ */
444
+ export type { BidSelector } from './bid-types.js';
445
+ /**
446
+ * Comprehensive bid pricing structure
447
+ *
448
+ * Pre-calculated pricing across multiple time periods and currencies.
449
+ * All calculations are derived from the raw per-block price returned
450
+ * by the blockchain.
451
+ *
452
+ * **Time Periods:**
453
+ * - Per block: Raw blockchain price
454
+ * - Per hour: ~590.8 blocks (based on 6.098s average block time)
455
+ * - Per day: ~14,179 blocks
456
+ * - Per week: ~99,254 blocks
457
+ * - Per month: ~431,572 blocks (30.437 days average)
458
+ *
459
+ * **Currencies:**
460
+ * - uAKT: Micro AKT (1 AKT = 1,000,000 uAKT)
461
+ * - AKT: Standard token denomination
462
+ * - USD: Via toUSD() method with market price
463
+ *
464
+ * @example Display pricing
465
+ * ```typescript
466
+ * const bid: EnhancedBid = // ... from queryBids
467
+ *
468
+ * // Native currency
469
+ * console.log(`${bid.pricing.uakt.perMonth} uAKT/month`);
470
+ * console.log(`${bid.pricing.akt.perMonth.toFixed(2)} AKT/month`);
471
+ *
472
+ * // USD conversion
473
+ * const aktPrice = 0.50; // $0.50 per AKT
474
+ * const usd = bid.pricing.toUSD(aktPrice);
475
+ * console.log(`$${usd.perMonth.toFixed(2)}/month`);
476
+ * console.log(`$${usd.perHour.toFixed(4)}/hour`);
477
+ * ```
478
+ *
479
+ * @see createBidPricing to create pricing from raw blockchain data
480
+ */
481
+ export type { BidPricing } from './bid-types.js';
482
+ /**
483
+ * Create BidPricing from raw blockchain price
484
+ *
485
+ * Calculates all time-period prices from per-block price.
486
+ * Used internally by queryBids, but exposed for advanced use cases.
487
+ *
488
+ * @example
489
+ * ```typescript
490
+ * const pricing = createBidPricing({
491
+ * denom: 'uakt',
492
+ * amount: '1234' // uAKT per block
493
+ * });
494
+ *
495
+ * console.log(pricing.akt.perMonth); // Monthly cost in AKT
496
+ * ```
497
+ */
498
+ export { createBidPricing } from './bid-types.js';
499
+ /**
500
+ * Select cheapest bid
501
+ *
502
+ * Returns the bid with the lowest monthly price. Best for development
503
+ * and testing where cost is the primary concern.
504
+ *
505
+ * **Considerations:**
506
+ * - Only considers price, not reliability or location
507
+ * - For production, combine with filterBids for quality constraints
508
+ * - Cheapest doesn't always mean best value
509
+ *
510
+ * @example Simple cheapest selection
511
+ * ```typescript
512
+ * import { deployToAkash, selectCheapestBid } from 'deploy-ability/akash';
513
+ *
514
+ * const result = await deployToAkash({
515
+ * wallet,
516
+ * certificate,
517
+ * projectRoot: './',
518
+ * profile: 'dev',
519
+ * bidSelector: selectCheapestBid
520
+ * });
521
+ * ```
522
+ *
523
+ * @example With quality filtering
524
+ * ```typescript
525
+ * const result = await deployToAkash({
526
+ * wallet,
527
+ * certificate,
528
+ * projectRoot: './',
529
+ * profile: 'prod',
530
+ * bidSelector: (bids) => {
531
+ * const qualityBids = filterBids(bids, {
532
+ * requireAudited: true,
533
+ * minUptime: { value: 0.95, period: '7d' }
534
+ * });
535
+ * return selectCheapestBid(qualityBids);
536
+ * }
537
+ * });
538
+ * ```
539
+ */
540
+ export { selectCheapestBid } from './bid-selectors.js';
541
+ /**
542
+ * Select most reliable bid
543
+ *
544
+ * Returns the bid with highest uptime percentage. Best for production
545
+ * deployments where reliability is critical.
546
+ *
547
+ * **Uptime Periods:**
548
+ * - '1d': Last 24 hours (most recent, limited sample)
549
+ * - '7d': Last 7 days (recommended default)
550
+ * - '30d': Last 30 days (long-term stability)
551
+ *
552
+ * **Fallback:**
553
+ * If no providers have reliability data, returns first bid.
554
+ *
555
+ * @example Default 7-day uptime
556
+ * ```typescript
557
+ * const result = await deployToAkash({
558
+ * wallet,
559
+ * certificate,
560
+ * projectRoot: './',
561
+ * profile: 'production',
562
+ * bidSelector: selectMostReliableBid
563
+ * });
564
+ * ```
565
+ *
566
+ * @example Custom 30-day period
567
+ * ```typescript
568
+ * const result = await deployToAkash({
569
+ * wallet,
570
+ * certificate,
571
+ * projectRoot: './',
572
+ * profile: 'production',
573
+ * bidSelector: (bids) => selectMostReliableBid(bids, '30d')
574
+ * });
575
+ * ```
576
+ */
577
+ export { selectMostReliableBid } from './bid-selectors.js';
578
+ /**
579
+ * Select balanced bid (price + reliability)
580
+ *
581
+ * Calculates weighted score combining normalized price and uptime,
582
+ * then selects highest-scoring bid. Best for production where both
583
+ * cost and reliability matter.
584
+ *
585
+ * **Scoring:**
586
+ * - Price score: 0-1 (lower price = higher score)
587
+ * - Reliability score: uptime7d (0-1)
588
+ * - Total: (price × weight) + (reliability × weight)
589
+ *
590
+ * **Default weights:** 0.5 price, 0.5 reliability (equal balance)
591
+ *
592
+ * @example Equal balance (default)
593
+ * ```typescript
594
+ * const result = await deployToAkash({
595
+ * wallet,
596
+ * certificate,
597
+ * projectRoot: './',
598
+ * profile: 'production',
599
+ * bidSelector: selectBalancedBid
600
+ * });
601
+ * ```
602
+ *
603
+ * @example Prioritize reliability (70/30)
604
+ * ```typescript
605
+ * const result = await deployToAkash({
606
+ * wallet,
607
+ * certificate,
608
+ * projectRoot: './',
609
+ * profile: 'critical-prod',
610
+ * bidSelector: (bids) => selectBalancedBid(bids, {
611
+ * price: 0.3,
612
+ * reliability: 0.7
613
+ * })
614
+ * });
615
+ * ```
616
+ *
617
+ * @example Prioritize cost (80/20)
618
+ * ```typescript
619
+ * const result = await deployToAkash({
620
+ * wallet,
621
+ * certificate,
622
+ * projectRoot: './',
623
+ * profile: 'dev',
624
+ * bidSelector: (bids) => selectBalancedBid(bids, {
625
+ * price: 0.8,
626
+ * reliability: 0.2
627
+ * })
628
+ * });
629
+ * ```
630
+ */
631
+ export { selectBalancedBid } from './bid-selectors.js';
632
+ /**
633
+ * Filter bids by criteria
634
+ *
635
+ * Apply multiple filters to narrow down options. All criteria are
636
+ * optional and combined with AND logic.
637
+ *
638
+ * **Philosophy:**
639
+ * Use this to establish minimum quality standards, then apply a
640
+ * selection strategy to choose from acceptable bids.
641
+ *
642
+ * **Available Filters:**
643
+ * - maxPricePerMonth: Budget constraint (uAKT or USD)
644
+ * - minUptime: Minimum reliability requirement
645
+ * - requireAudited: Only audited providers
646
+ * - preferredRegions: Geographic requirements
647
+ * - requireOnline: Only currently online providers
648
+ *
649
+ * @example Price and uptime filtering
650
+ * ```typescript
651
+ * const filtered = filterBids(bids, {
652
+ * maxPricePerMonth: { usd: 50, aktPrice: 0.45 },
653
+ * minUptime: { value: 0.95, period: '7d' }
654
+ * });
655
+ * const selected = selectCheapestBid(filtered);
656
+ * ```
657
+ *
658
+ * @example Audit and location filtering
659
+ * ```typescript
660
+ * const filtered = filterBids(bids, {
661
+ * requireAudited: true,
662
+ * preferredRegions: ['US', 'EU'],
663
+ * requireOnline: true
664
+ * });
665
+ * ```
666
+ *
667
+ * @example Price filtering in uAKT
668
+ * ```typescript
669
+ * const filtered = filterBids(bids, {
670
+ * maxPricePerMonth: { uakt: 500_000_000 }
671
+ * });
672
+ * ```
673
+ */
674
+ export { filterBids } from './bid-selectors.js';
675
+ /**
676
+ * Provider information with metadata and metrics
677
+ *
678
+ * Complete provider profile including identity, location, reliability,
679
+ * and audit status. Returned as part of EnhancedBid.
680
+ *
681
+ * **Data Sources:**
682
+ * - Blockchain: Owner address, host URI, audit status
683
+ * - Cloudmos API: Reliability metrics, location, version info
684
+ *
685
+ * **Field Availability:**
686
+ * - owner, hostUri, isAudited: Always present
687
+ * - name, email, website: Optional (provider-specified)
688
+ * - location: Optional (from IP geolocation)
689
+ * - reliability: Optional (requires indexer tracking)
690
+ * - versions: Optional (from provider status)
691
+ */
692
+ export type { ProviderInfo } from './provider-metadata.js';
693
+ /**
694
+ * Provider geographic location
695
+ *
696
+ * IP-based geolocation data for the provider's host.
697
+ * Useful for latency optimization and compliance requirements.
698
+ */
699
+ export type { ProviderLocation } from './provider-metadata.js';
700
+ /**
701
+ * Provider reliability metrics
702
+ *
703
+ * Uptime statistics tracked by the Cloudmos indexer.
704
+ * Shows provider availability over different time periods.
705
+ *
706
+ * **Uptime Values:**
707
+ * - Range: 0.0 to 1.0 (0% to 100%)
708
+ * - Example: 0.95 = 95% uptime
709
+ *
710
+ * **Time Periods:**
711
+ * - uptime1d: Last 24 hours
712
+ * - uptime7d: Last 7 days (recommended)
713
+ * - uptime30d: Last 30 days
714
+ */
715
+ export type { ProviderReliability } from './provider-metadata.js';
716
+ /**
717
+ * Fetch provider metadata
718
+ *
719
+ * Fetches complete provider information from Cloudmos API with
720
+ * blockchain fallback. Includes reliability metrics, location,
721
+ * and audit status.
722
+ *
723
+ * **Use Cases:**
724
+ * - Pre-deployment provider research
725
+ * - Building custom provider directories
726
+ * - Monitoring provider status
727
+ *
728
+ * @example Fetch single provider
729
+ * ```typescript
730
+ * const result = await fetchProviderInfo('mainnet', 'akash1...');
731
+ * if (result.success) {
732
+ * const provider = result.data;
733
+ * console.log('Provider:', provider.name || provider.owner);
734
+ * if (provider.reliability) {
735
+ * console.log('Uptime:', (provider.reliability.uptime7d * 100) + '%');
736
+ * }
737
+ * }
738
+ * ```
739
+ */
740
+ export { fetchProviderInfo } from './provider-service.js';
741
+ /**
742
+ * Fetch multiple providers in parallel
743
+ *
744
+ * Efficiently fetches information for multiple providers at once.
745
+ * Used internally by queryBids, but exposed for advanced use cases.
746
+ *
747
+ * @example Batch fetch
748
+ * ```typescript
749
+ * const addresses = ['akash1...', 'akash2...', 'akash3...'];
750
+ * const result = await fetchProviderInfoBatch('mainnet', addresses);
751
+ *
752
+ * if (result.success) {
753
+ * for (const [address, info] of result.data) {
754
+ * console.log(address, ':', info.name || 'Unknown');
755
+ * }
756
+ * }
757
+ * ```
758
+ */
759
+ export { fetchProviderInfoBatch } from './provider-service.js';
760
+ /**
761
+ * Fetch lease records from blockchain
762
+ *
763
+ * Query leases with flexible filtering (owner, provider, dseq, etc.)
764
+ */
765
+ export { getLeaseRecords } from './query-client.js';
766
+ /**
767
+ * Fetch single lease by ID
768
+ *
769
+ * Get detailed lease information for specific deployment.
770
+ */
771
+ export { getLeaseById } from './query-client.js';
772
+ /**
773
+ * Fetch deployment details
774
+ *
775
+ * Get deployment configuration, resource specs, and group information.
776
+ */
777
+ export { getDeploymentDetails } from './query-client.js';
778
+ /**
779
+ * Fetch provider metadata
780
+ *
781
+ * Get provider host URI and attributes for deployment monitoring.
782
+ */
783
+ export { getProviderMetadata } from './query-client.js';
784
+ /**
785
+ * Get complete deployment overview
786
+ *
787
+ * Aggregates lease, deployment, and provider info into single object.
788
+ */
789
+ export { getDeploymentOverview } from './query-client.js';
790
+ /**
791
+ * Query result types
792
+ */
793
+ export type { LeaseDetails, DeploymentDetails, DeploymentGroupDetails, DeploymentGroupResource, ProviderMetadata, ProviderAttribute, DeploymentOverview, LeaseFilters, } from './query-client.js';
794
+ /**
795
+ * Wait for containers to reach running state
796
+ *
797
+ * Polls provider for container status until all containers are running or timeout.
798
+ */
799
+ export { waitForContainersRunning } from './lease-monitor.js';
800
+ /**
801
+ * Monitoring configuration and result types
802
+ */
803
+ export type { LeaseMonitorOptions } from './lease-monitor.js';
804
+ /**
805
+ * Send manifest to provider
806
+ *
807
+ * Delivers deployment manifest to provider via HTTPS with mTLS authentication.
808
+ */
809
+ export { sendManifestToProvider } from './provider-client.js';
810
+ /**
811
+ * Fetch lease status from provider
812
+ *
813
+ * Query provider for current lease status and service URIs.
814
+ */
815
+ export { fetchProviderLeaseStatus } from './provider-client.js';
816
+ /**
817
+ * Provider communication types
818
+ */
819
+ export type { LeaseReference, ProviderLeaseStatus, ProviderServiceStatus, } from './provider-client.js';
820
+ /**
821
+ * Stream container logs from Akash deployment in real-time
822
+ *
823
+ * Returns an EventEmitter that emits parsed log lines as they arrive from the provider.
824
+ * Uses WebSocket with mTLS authentication to connect directly to the Akash provider.
825
+ *
826
+ * **Key Features:**
827
+ * - Real-time log streaming with WebSocket
828
+ * - Service filtering (filter by specific containers)
829
+ * - Tail support (show last N lines)
830
+ * - Automatic log parsing and service name extraction
831
+ * - Event-based API for flexible consumption
832
+ *
833
+ * @example Stream logs and watch for specific messages
834
+ * ```typescript
835
+ * const stream = streamDeploymentLogs({
836
+ * deployment: deploymentData,
837
+ * wallet: walletContext,
838
+ * certificate: certData,
839
+ * network: 'mainnet',
840
+ * services: ['ollama'],
841
+ * follow: true,
842
+ * tail: 100
843
+ * });
844
+ *
845
+ * stream.on('log', (log) => {
846
+ * console.log(`[${log.service}] ${log.message}`);
847
+ *
848
+ * // Watch for specific events
849
+ * if (log.message.includes('Model ready!')) {
850
+ * console.log('✅ Model is ready!');
851
+ * stream.close();
852
+ * }
853
+ * });
854
+ *
855
+ * stream.on('error', (error) => {
856
+ * console.error('Stream error:', error);
857
+ * });
858
+ * ```
859
+ *
860
+ * @example Monitor model weight downloads
861
+ * ```typescript
862
+ * const stream = streamDeploymentLogs({
863
+ * deployment: modelDeployment,
864
+ * wallet: walletContext,
865
+ * certificate: certData,
866
+ * network: 'mainnet',
867
+ * tail: 0 // Start from now
868
+ * });
869
+ *
870
+ * stream.on('log', (log) => {
871
+ * if (log.message.includes('pulling manifest')) {
872
+ * console.log('📦 Downloading model weights...');
873
+ * }
874
+ * if (log.message.includes('100%')) {
875
+ * console.log('✅ Download complete!');
876
+ * }
877
+ * });
878
+ * ```
879
+ */
880
+ export { streamDeploymentLogs } from './logs.js';
881
+ /**
882
+ * Get deployment logs as a complete array (non-streaming)
883
+ *
884
+ * Collects logs up to maxLogs or timeout, then returns them as an array.
885
+ * Useful for downloading full logs or one-time log retrieval.
886
+ *
887
+ * @example Download logs to file
888
+ * ```typescript
889
+ * const logs = await getDeploymentLogs({
890
+ * deployment: deploymentData,
891
+ * wallet: walletContext,
892
+ * certificate: certData,
893
+ * network: 'mainnet',
894
+ * tail: 1000,
895
+ * maxLogs: 1000
896
+ * });
897
+ *
898
+ * const logText = logs.map(log =>
899
+ * `[${log.receivedAt.toISOString()}] [${log.service}] ${log.message}`
900
+ * ).join('\n');
901
+ *
902
+ * fs.writeFileSync('deployment.log', logText);
903
+ * ```
904
+ */
905
+ export { getDeploymentLogs } from './logs.js';
906
+ /**
907
+ * Log streaming types
908
+ */
909
+ export type { StreamLogsOptions, GetLogsOptions, LogEntry, LogStream, } from './logs.types.js';
910
+ /**
911
+ * Generate Akash SDL YAML from profile
912
+ *
913
+ * Transforms deployment profile into SDL format for blockchain submission.
914
+ *
915
+ * @example
916
+ * ```typescript
917
+ * const yaml = generateAkashSdl(profile, {
918
+ * defaultCpuUnits: 1.0,
919
+ * defaultMemorySize: '1Gi'
920
+ * });
921
+ * ```
922
+ */
923
+ export { generateAkashSdl } from './sdl-generator.js';
924
+ /**
925
+ * Create SDL object instance
926
+ *
927
+ * Generates SDL YAML and returns instantiated SDL helper from akashjs.
928
+ * Provides access to groups() and manifestVersion() methods.
929
+ */
930
+ export { createSdlObject } from './sdl-generator.js';
931
+ /**
932
+ * SDL generation options
933
+ */
934
+ export type { AkashSdlGenerationOptions } from './sdl-generator.js';
935
+ /**
936
+ * Lease price calculator with multi-format support
937
+ *
938
+ * Calculates lease costs in multiple formats (per block, per hour, per month)
939
+ * and supports USD conversion when AKT market price is provided.
940
+ *
941
+ * **Key Features:**
942
+ * - Pre-computed prices in uAKT and AKT
943
+ * - Per-block, per-hour, and per-month calculations
944
+ * - USD conversion with custom AKT price
945
+ * - Matches Akash Console calculations exactly
946
+ *
947
+ * **Constants Used:**
948
+ * - Average block time: 6.098 seconds
949
+ * - Average days per month: 30.437 days
950
+ *
951
+ * @example Display pricing in uAKT
952
+ * ```typescript
953
+ * const result = await deployToAkash({ ... });
954
+ * if (result.success) {
955
+ * const { leasePrice } = result.data;
956
+ * console.log(`Cost: ${leasePrice.uakt.perMonth} uAKT/month`);
957
+ * console.log(`Cost: ${leasePrice.akt.perMonth} AKT/month`);
958
+ * }
959
+ * ```
960
+ *
961
+ * @example Convert to USD
962
+ * ```typescript
963
+ * // Fetch AKT price from CoinGecko or other source
964
+ * const aktPrice = 0.50; // $0.50 per AKT
965
+ *
966
+ * const result = await deployToAkash({ ... });
967
+ * if (result.success) {
968
+ * const usd = result.data.leasePrice.toUSD(aktPrice);
969
+ * console.log(`💰 Cost: $${usd.perMonth.toFixed(2)}/month`);
970
+ * console.log(`💰 Cost: $${usd.perHour.toFixed(4)}/hour`);
971
+ * }
972
+ * ```
973
+ *
974
+ * @see LeasePrice class documentation for detailed usage
975
+ */
976
+ export { LeasePrice } from './pricing.js';
977
+ /**
978
+ * Pricing constants
979
+ *
980
+ * Average block time and days in month used for price calculations.
981
+ * These match the values used by Akash Console.
982
+ */
983
+ export { AVERAGE_BLOCK_TIME_SECONDS, AVERAGE_DAYS_IN_MONTH, UAKT_PER_AKT, } from './pricing.js';
984
+ /**
985
+ * Get network configuration
986
+ *
987
+ * Returns RPC endpoint and chain ID for specified network.
988
+ *
989
+ * @example
990
+ * ```typescript
991
+ * const config = getNetworkConfig('mainnet');
992
+ * console.log('RPC:', config.rpc);
993
+ * ```
994
+ */
995
+ export { getNetworkConfig } from './environment.js';
996
+ /**
997
+ * Network configurations for mainnet and testnet
998
+ */
999
+ export { AKASH_NETWORKS } from './environment.js';
1000
+ /**
1001
+ * Check if provider is blacklisted
1002
+ *
1003
+ * Verifies provider against known problematic providers.
1004
+ */
1005
+ export { isProviderBlacklisted } from './environment.js';
1006
+ /**
1007
+ * Environment configuration types
1008
+ */
1009
+ export type { AkashNetwork, NetworkConfiguration } from './environment.js';
1010
+ /**
1011
+ * Placement attribute constants
1012
+ *
1013
+ * Valid values for geographic and provider targeting when deploying to Akash.
1014
+ * These reflect **actual provider values** from mainnet, not the official schema.
1015
+ *
1016
+ * @example
1017
+ * ```typescript
1018
+ * import { AKASH_REGIONS, AKASH_TIERS } from 'deploy-ability';
1019
+ *
1020
+ * console.log(AKASH_REGIONS['us-west']);
1021
+ * // "Western United States (California, Oregon, Washington, Nevada)"
1022
+ *
1023
+ * console.log(AKASH_TIERS['community']);
1024
+ * // "Community-tier providers (standard pricing, good for most workloads)"
1025
+ * ```
1026
+ */
1027
+ export { AKASH_REGIONS, AKASH_TIERS, getAkashRegions, getAkashTiers, } from './constants.js';
1028
+ /**
1029
+ * Placement attribute types
1030
+ */
1031
+ export type { AkashRegion, AkashTier, } from './constants.js';
1032
+ /**
1033
+ * Setup temporary registry for local images
1034
+ *
1035
+ * Automatically detects local images and makes them accessible to Akash providers:
1036
+ * 1. Starts temporary registry on localhost
1037
+ * 2. Pushes local images to registry
1038
+ * 3. Exposes registry publicly via tunnel (ngrok/serveo/bore)
1039
+ * 4. Rewrites profile to use public registry URLs
1040
+ * 5. Returns cleanup function to shut down registry after deployment
1041
+ *
1042
+ * **Three Outcomes:**
1043
+ * - No local images → Returns profile unchanged
1044
+ * - User opted out (useRemoteRegistry: true) → Returns profile unchanged
1045
+ * - Local images found → Starts registry, transforms profile
1046
+ *
1047
+ * @example
1048
+ * ```typescript
1049
+ * const ctx = await setupRegistryIfNeeded(profile, logger, {
1050
+ * containerEngine: 'docker',
1051
+ * tunnelService: 'serveo'
1052
+ * });
1053
+ *
1054
+ * try {
1055
+ * await deployToAkash({
1056
+ * loadedProfile: { profile: ctx.deployableProfile }
1057
+ * });
1058
+ * } finally {
1059
+ * await ctx.cleanup(); // Always cleanup
1060
+ * }
1061
+ * ```
1062
+ */
1063
+ export { setupRegistryIfNeeded } from '../../utils/registry/index.js';
1064
+ /**
1065
+ * Check if profile contains local images
1066
+ *
1067
+ * Uses reality-based detection (docker images -q) to check if images
1068
+ * actually exist locally rather than guessing based on name patterns.
1069
+ *
1070
+ * @example
1071
+ * ```typescript
1072
+ * if (hasLocalImages(profile, 'docker')) {
1073
+ * console.log('Local images detected - registry will be needed');
1074
+ * }
1075
+ * ```
1076
+ */
1077
+ export { hasLocalImages } from '../../utils/registry/index.js';
1078
+ /**
1079
+ * Registry manager class for advanced use cases
1080
+ *
1081
+ * Provides low-level control over registry operations. Most users should
1082
+ * use `setupRegistryIfNeeded()` instead.
1083
+ */
1084
+ export { TemporaryContainerRegistryManager } from '../../utils/registry/index.js';
1085
+ /**
1086
+ * Registry types
1087
+ */
1088
+ export type { RegistryContext, RegistryOptions, ContainerMapping, RegistryCredentials } from '../../utils/registry/types.js';
1089
+ /**
1090
+ * Wallet context for Akash operations
1091
+ *
1092
+ * Contains wallet address, signers, and optional WalletConnect session.
1093
+ */
1094
+ export type { WalletContext } from './types.js';
1095
+ /**
1096
+ * Akash provider TLS certificate
1097
+ *
1098
+ * X.509 certificate for mTLS authentication with providers.
1099
+ */
1100
+ export type { AkashProviderTlsCertificate } from './types.js';
1101
+ /**
1102
+ * Keplr signer with dual signing capabilities
1103
+ */
1104
+ export type { KeplrSigner } from './types.js';
1105
+ /**
1106
+ * Account data from blockchain
1107
+ */
1108
+ export type { AccountData } from './types.js';
1109
+ /**
1110
+ * Type guards for wallet context
1111
+ */
1112
+ export { isWalletConnectSession, hasAccountData } from './types.js';
1113
+ //# sourceMappingURL=index.d.ts.map