@kadi.build/deploy-ability 0.0.3 → 0.0.5
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/dist/targets/akash/bids.d.ts +183 -0
- package/dist/targets/akash/bids.d.ts.map +1 -0
- package/dist/targets/akash/bids.js +247 -0
- package/dist/targets/akash/bids.js.map +1 -0
- package/dist/targets/akash/certificate-manager.d.ts +89 -167
- package/dist/targets/akash/certificate-manager.d.ts.map +1 -1
- package/dist/targets/akash/certificate-manager.js +193 -301
- package/dist/targets/akash/certificate-manager.js.map +1 -1
- package/dist/targets/akash/client.d.ts +644 -0
- package/dist/targets/akash/client.d.ts.map +1 -0
- package/dist/targets/akash/client.js +972 -0
- package/dist/targets/akash/client.js.map +1 -0
- package/dist/targets/akash/constants.d.ts +12 -149
- package/dist/targets/akash/constants.d.ts.map +1 -1
- package/dist/targets/akash/constants.js +14 -136
- package/dist/targets/akash/constants.js.map +1 -1
- package/dist/targets/akash/deployer.d.ts +3 -82
- package/dist/targets/akash/deployer.d.ts.map +1 -1
- package/dist/targets/akash/deployer.js +122 -160
- package/dist/targets/akash/deployer.js.map +1 -1
- package/dist/targets/akash/environment.d.ts +16 -214
- package/dist/targets/akash/environment.d.ts.map +1 -1
- package/dist/targets/akash/environment.js +20 -210
- package/dist/targets/akash/environment.js.map +1 -1
- package/dist/targets/akash/index.d.ts +95 -189
- package/dist/targets/akash/index.d.ts.map +1 -1
- package/dist/targets/akash/index.js +69 -197
- package/dist/targets/akash/index.js.map +1 -1
- package/dist/targets/akash/lease-monitor.d.ts +3 -21
- package/dist/targets/akash/lease-monitor.d.ts.map +1 -1
- package/dist/targets/akash/lease-monitor.js +39 -56
- package/dist/targets/akash/lease-monitor.js.map +1 -1
- package/dist/targets/akash/logs.d.ts +103 -4
- package/dist/targets/akash/logs.d.ts.map +1 -1
- package/dist/targets/akash/logs.js +12 -3
- package/dist/targets/akash/logs.js.map +1 -1
- package/dist/targets/akash/pricing.d.ts +12 -191
- package/dist/targets/akash/pricing.d.ts.map +1 -1
- package/dist/targets/akash/pricing.js +12 -188
- package/dist/targets/akash/pricing.js.map +1 -1
- package/dist/targets/akash/provider-manager.d.ts +120 -0
- package/dist/targets/akash/provider-manager.d.ts.map +1 -0
- package/dist/targets/akash/provider-manager.js +574 -0
- package/dist/targets/akash/provider-manager.js.map +1 -0
- package/dist/targets/akash/sdl-generator.d.ts +2 -2
- package/dist/targets/akash/sdl-generator.d.ts.map +1 -1
- package/dist/targets/akash/sdl-generator.js +6 -39
- package/dist/targets/akash/sdl-generator.js.map +1 -1
- package/dist/targets/akash/types.d.ts +66 -243
- package/dist/targets/akash/types.d.ts.map +1 -1
- package/dist/targets/akash/types.js +4 -41
- package/dist/targets/akash/types.js.map +1 -1
- package/dist/targets/akash/wallet-manager.d.ts +35 -352
- package/dist/targets/akash/wallet-manager.d.ts.map +1 -1
- package/dist/targets/akash/wallet-manager.js +37 -439
- package/dist/targets/akash/wallet-manager.js.map +1 -1
- package/dist/targets/local/compose-generator.d.ts.map +1 -1
- package/dist/targets/local/compose-generator.js +1 -0
- package/dist/targets/local/compose-generator.js.map +1 -1
- package/dist/targets/local/deployer.js +4 -4
- package/dist/targets/local/deployer.js.map +1 -1
- package/dist/targets/local/types.d.ts +4 -0
- package/dist/targets/local/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/options.d.ts +45 -4
- package/dist/types/options.d.ts.map +1 -1
- package/dist/utils/registry/manager.js +6 -6
- package/dist/utils/registry/manager.js.map +1 -1
- package/dist/utils/registry/setup.js +4 -4
- package/dist/utils/registry/setup.js.map +1 -1
- package/docs/KADI_ABILITY_CONVERSION.md +1365 -0
- package/docs/PIPELINE_BUILDER_DESIGN.md +1149 -0
- package/package.json +8 -11
- package/dist/targets/akash/bid-selectors.d.ts +0 -251
- package/dist/targets/akash/bid-selectors.d.ts.map +0 -1
- package/dist/targets/akash/bid-selectors.js +0 -322
- package/dist/targets/akash/bid-selectors.js.map +0 -1
- package/dist/targets/akash/bid-types.d.ts +0 -297
- package/dist/targets/akash/bid-types.d.ts.map +0 -1
- package/dist/targets/akash/bid-types.js +0 -89
- package/dist/targets/akash/bid-types.js.map +0 -1
- package/dist/targets/akash/blockchain-client.d.ts +0 -577
- package/dist/targets/akash/blockchain-client.d.ts.map +0 -1
- package/dist/targets/akash/blockchain-client.js +0 -803
- package/dist/targets/akash/blockchain-client.js.map +0 -1
- package/dist/targets/akash/logs.types.d.ts +0 -102
- package/dist/targets/akash/logs.types.d.ts.map +0 -1
- package/dist/targets/akash/logs.types.js +0 -9
- package/dist/targets/akash/logs.types.js.map +0 -1
- package/dist/targets/akash/provider-client.d.ts +0 -114
- package/dist/targets/akash/provider-client.d.ts.map +0 -1
- package/dist/targets/akash/provider-client.js +0 -318
- package/dist/targets/akash/provider-client.js.map +0 -1
- package/dist/targets/akash/provider-metadata.d.ts +0 -228
- package/dist/targets/akash/provider-metadata.d.ts.map +0 -1
- package/dist/targets/akash/provider-metadata.js +0 -14
- package/dist/targets/akash/provider-metadata.js.map +0 -1
- package/dist/targets/akash/provider-service.d.ts +0 -133
- package/dist/targets/akash/provider-service.d.ts.map +0 -1
- package/dist/targets/akash/provider-service.js +0 -391
- package/dist/targets/akash/provider-service.js.map +0 -1
- package/dist/targets/akash/query-client.d.ts +0 -125
- package/dist/targets/akash/query-client.d.ts.map +0 -1
- package/dist/targets/akash/query-client.js +0 -332
- package/dist/targets/akash/query-client.js.map +0 -1
- package/docs/EXAMPLES.md +0 -293
- package/docs/PLACEMENT.md +0 -433
- package/docs/STORAGE.md +0 -318
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @module targets/akash/sdl-generator
|
|
10
10
|
*/
|
|
11
11
|
import yaml from 'js-yaml';
|
|
12
|
-
import { SDL } from '@akashnetwork/
|
|
12
|
+
import { SDL } from '@akashnetwork/chain-sdk';
|
|
13
13
|
/**
|
|
14
14
|
* Generates Akash SDL YAML string from a loaded deployment profile.
|
|
15
15
|
*/
|
|
@@ -90,11 +90,11 @@ export function generateAkashSdl(loadedProfile, options = {}) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Generates SDL string and returns an instantiated SDL helper from
|
|
93
|
+
* Generates SDL string and returns an instantiated SDL helper from chain-sdk.
|
|
94
94
|
*/
|
|
95
95
|
export function createSdlObject(loadedProfile, options) {
|
|
96
96
|
const yamlString = generateAkashSdl(loadedProfile, options);
|
|
97
|
-
return SDL.fromString(yamlString
|
|
97
|
+
return SDL.fromString(yamlString);
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* Ensures service names are DNS-friendly (lowercase alphanumeric).
|
|
@@ -121,12 +121,7 @@ function normaliseEnvironment(env) {
|
|
|
121
121
|
.filter((value) => value !== null);
|
|
122
122
|
return entries.length > 0 ? entries : undefined;
|
|
123
123
|
}
|
|
124
|
-
/**
|
|
125
|
-
* Maps PortExposure definitions to Akash SDL format
|
|
126
|
-
*
|
|
127
|
-
* Transforms deploy-ability's port exposure format into Akash SDL YAML structure,
|
|
128
|
-
* including HTTP options for ingress timeout configuration.
|
|
129
|
-
*/
|
|
124
|
+
/** Maps PortExposure definitions to Akash SDL format */
|
|
130
125
|
function normaliseExpose(expose) {
|
|
131
126
|
if (!expose || expose.length === 0) {
|
|
132
127
|
return undefined;
|
|
@@ -175,19 +170,7 @@ function buildServiceSection(service) {
|
|
|
175
170
|
}
|
|
176
171
|
return section;
|
|
177
172
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Builds service params section for persistent volume mounts
|
|
180
|
-
*
|
|
181
|
-
* Generates the params.storage section that maps volume names to mount paths.
|
|
182
|
-
* This is required for Akash to mount persistent volumes into the container.
|
|
183
|
-
*
|
|
184
|
-
* @param volumes - Array of persistent volume specifications
|
|
185
|
-
* @returns Params object with storage mount configuration
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* Input: [{ name: "data", size: "10Gi", mount: "/data", class: "beta2" }]
|
|
189
|
-
* Output: { storage: { data: { mount: "/data" } } }
|
|
190
|
-
*/
|
|
173
|
+
/** Builds service params section for persistent volume mounts */
|
|
191
174
|
function buildServiceParams(volumes) {
|
|
192
175
|
const storage = {};
|
|
193
176
|
for (const volume of volumes) {
|
|
@@ -197,23 +180,7 @@ function buildServiceParams(volumes) {
|
|
|
197
180
|
}
|
|
198
181
|
return { storage };
|
|
199
182
|
}
|
|
200
|
-
/**
|
|
201
|
-
* Builds compute profile for CPU/memory/storage/GPU requirements
|
|
202
|
-
*
|
|
203
|
-
* Handles the new storage format with separate ephemeral and persistent storage.
|
|
204
|
-
*
|
|
205
|
-
* **Format:**
|
|
206
|
-
* ```yaml
|
|
207
|
-
* resources:
|
|
208
|
-
* storage:
|
|
209
|
-
* - size: "512Mi" # Ephemeral (from ephemeralStorage)
|
|
210
|
-
* - name: data # Persistent volume
|
|
211
|
-
* size: "10Gi"
|
|
212
|
-
* attributes:
|
|
213
|
-
* persistent: true
|
|
214
|
-
* class: beta2
|
|
215
|
-
* ```
|
|
216
|
-
*/
|
|
183
|
+
/** Builds compute profile for CPU/memory/storage/GPU requirements */
|
|
217
184
|
function buildComputeProfile(service, defaults) {
|
|
218
185
|
const cpuUnits = service.resources?.cpu ?? defaults.defaultCpuUnits;
|
|
219
186
|
const memory = service.resources?.memory ?? defaults.defaultMemorySize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdl-generator.js","sourceRoot":"","sources":["../../../src/targets/akash/sdl-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sdl-generator.js","sourceRoot":"","sources":["../../../src/targets/akash/sdl-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,SAA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AA2B;SACnE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,mBAAmB;QACnC,MAAM,EAAE,QAAQ,CAAC,oBAAoB;KACtC,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,SAAS,sBAAsB,CAC7B,kBAA0B,EAC1B,QAA2B,CAAE,wCAAwC;;IAErE,MAAM,KAAK,GAAG,CAAC,CAAC;IAEhB,OAAO;QACL,MAAM,EAAE;YACN,OAAO,EAAE,kBAAkB;YAC3B,KAAK;SACN;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Akash Network Type Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* with proper TypeScript interfaces from @cosmjs and @walletconnect libraries.
|
|
7
|
-
*
|
|
8
|
-
* Key Improvements from kadi-deploy:
|
|
9
|
-
* - ✅ ZERO `any` types (was 5 any types)
|
|
10
|
-
* - ✅ Proper imports from typed libraries
|
|
11
|
-
* - ✅ Readonly properties to prevent mutations
|
|
12
|
-
* - ✅ Comprehensive JSDoc documentation
|
|
4
|
+
* Type-safe interfaces for Akash Network deployment operations using proper
|
|
5
|
+
* TypeScript types from @cosmjs and @walletconnect libraries (zero `any` types).
|
|
13
6
|
*
|
|
14
7
|
* @module targets/akash/types
|
|
15
8
|
*/
|
|
@@ -17,269 +10,99 @@ import type { OfflineAminoSigner } from '@cosmjs/amino';
|
|
|
17
10
|
import type { OfflineDirectSigner } from '@cosmjs/proto-signing';
|
|
18
11
|
import type { SessionTypes } from '@walletconnect/types';
|
|
19
12
|
import { SignClient } from '@walletconnect/sign-client';
|
|
20
|
-
/**
|
|
21
|
-
* Keplr wallet signer with dual signing capabilities
|
|
22
|
-
*
|
|
23
|
-
* Keplr wallet provides BOTH Amino (legacy JSON) and Direct (protobuf) signing.
|
|
24
|
-
* This intersection type ensures we have access to both signing methods,
|
|
25
|
-
* which is required for compatibility with different Cosmos SDK versions.
|
|
26
|
-
*
|
|
27
|
-
* Note: There's a known type incompatibility between @keplr-wallet/types and
|
|
28
|
-
* @cosmjs/proto-signing (Long vs bigint for SignDoc.accountNumber). The actual
|
|
29
|
-
* runtime objects work fine - this is purely a TypeScript type issue.
|
|
30
|
-
*
|
|
31
|
-
* Why both?
|
|
32
|
-
* - Amino: Legacy format, required by some older chains
|
|
33
|
-
* - Direct: Modern protobuf format, more efficient and type-safe
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const signer: KeplrSigner = await keplrWallet.getOfflineSigner(chainId);
|
|
38
|
-
* // Can use both signing methods:
|
|
39
|
-
* await signer.signAmino(address, signDoc); // Amino signing
|
|
40
|
-
* await signer.signDirect(address, signDoc); // Direct signing
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
13
|
+
/** Keplr signer with both Amino (legacy) and Direct (modern protobuf) signing capabilities */
|
|
43
14
|
export type KeplrSigner = OfflineAminoSigner & OfflineDirectSigner;
|
|
44
|
-
/**
|
|
45
|
-
* Account data from the Cosmos blockchain
|
|
46
|
-
*
|
|
47
|
-
* Represents the on-chain state of a blockchain account.
|
|
48
|
-
* Used for transaction signing and nonce management.
|
|
49
|
-
*
|
|
50
|
-
* @property address - Bech32 encoded address (e.g., "akash1...")
|
|
51
|
-
* @property pubkey - Public key bytes (null if account never used)
|
|
52
|
-
* @property accountNumber - Unique account number (never changes)
|
|
53
|
-
* @property sequence - Transaction sequence/nonce (increments per tx)
|
|
54
|
-
*/
|
|
15
|
+
/** On-chain account state (address, pubkey, nonce) */
|
|
55
16
|
export interface AccountData {
|
|
56
|
-
/** Bech32 address of the account */
|
|
57
17
|
readonly address: string;
|
|
58
|
-
/** Public key bytes (null if account has never sent a transaction) */
|
|
59
18
|
readonly pubkey: Uint8Array | null;
|
|
60
|
-
/** Unique account number assigned when account first used */
|
|
61
19
|
readonly accountNumber: number;
|
|
62
|
-
/**
|
|
63
|
-
* Transaction sequence number (nonce)
|
|
64
|
-
* Increments with each transaction to prevent replays
|
|
65
|
-
*/
|
|
66
20
|
readonly sequence: number;
|
|
67
21
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Wallet connection context for Akash Network operations
|
|
70
|
-
*
|
|
71
|
-
* Contains all the data needed to interact with the Akash blockchain:
|
|
72
|
-
* - Signing transactions
|
|
73
|
-
* - Querying account state
|
|
74
|
-
* - Managing WalletConnect session
|
|
75
|
-
*
|
|
76
|
-
* This is the core data structure passed through all deployment operations.
|
|
77
|
-
*
|
|
78
|
-
* Key Design Decisions:
|
|
79
|
-
* - All properties are readonly to prevent accidental mutations
|
|
80
|
-
* - WalletConnect fields are optional (only needed when using WalletConnect)
|
|
81
|
-
* - Both signer and offlineSigner are KeplrSigner type (no more `any`!)
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* // Create wallet context after successful connection
|
|
86
|
-
* const walletCtx: WalletContext = {
|
|
87
|
-
* address: 'akash1abc...',
|
|
88
|
-
* signer: keplrSigner,
|
|
89
|
-
* offlineSigner: keplrSigner,
|
|
90
|
-
* chainId: 'akashnet-2',
|
|
91
|
-
* account: {
|
|
92
|
-
* address: 'akash1abc...',
|
|
93
|
-
* pubkey: new Uint8Array([...]),
|
|
94
|
-
* accountNumber: 12345,
|
|
95
|
-
* sequence: 0
|
|
96
|
-
* }
|
|
97
|
-
* };
|
|
98
|
-
*
|
|
99
|
-
* // Use in deployment operations
|
|
100
|
-
* const result = await deployToAkash({ walletCtx, ... });
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
22
|
+
/** Wallet connection context for Akash operations (signing, querying, WalletConnect session) */
|
|
103
23
|
export interface WalletContext {
|
|
104
|
-
/**
|
|
105
|
-
* Wallet address in bech32 format
|
|
106
|
-
* Example: "akash1abc123def456..."
|
|
107
|
-
*/
|
|
108
24
|
readonly address: string;
|
|
109
|
-
/**
|
|
110
|
-
* Keplr signer with both Amino and Direct signing capabilities
|
|
111
|
-
*
|
|
112
|
-
* This is a stable offline signer wrapper that provides consistent
|
|
113
|
-
* transaction signing across different signing modes.
|
|
114
|
-
*
|
|
115
|
-
* Type: KeplrSigner (OfflineAminoSigner & OfflineDirectSigner)
|
|
116
|
-
*/
|
|
117
25
|
readonly signer: KeplrSigner;
|
|
118
|
-
/**
|
|
119
|
-
* Offline signer for transaction creation
|
|
120
|
-
*
|
|
121
|
-
* Same as `signer` but explicitly typed for offline operations.
|
|
122
|
-
* Used when creating and signing transactions without network access.
|
|
123
|
-
*
|
|
124
|
-
* Type: KeplrSigner (OfflineAminoSigner & OfflineDirectSigner)
|
|
125
|
-
*/
|
|
126
26
|
readonly offlineSigner: KeplrSigner;
|
|
127
|
-
/**
|
|
128
|
-
* WalletConnect SignClient instance (optional)
|
|
129
|
-
*
|
|
130
|
-
* Only present when using WalletConnect for mobile wallet connection.
|
|
131
|
-
* Used for session management and connection lifecycle.
|
|
132
|
-
*
|
|
133
|
-
* If undefined, means using browser extension (Keplr) instead of mobile.
|
|
134
|
-
*/
|
|
135
27
|
readonly signClient?: InstanceType<typeof SignClient>;
|
|
136
|
-
/**
|
|
137
|
-
* Active WalletConnect session (optional)
|
|
138
|
-
*
|
|
139
|
-
* Contains session data needed for disconnection and session management.
|
|
140
|
-
* Only present when using WalletConnect.
|
|
141
|
-
*
|
|
142
|
-
* Type: SessionTypes.Struct from @walletconnect/types
|
|
143
|
-
*/
|
|
144
28
|
readonly session?: SessionTypes.Struct;
|
|
145
|
-
/**
|
|
146
|
-
* Connected Akash network chain ID (optional)
|
|
147
|
-
*
|
|
148
|
-
* Examples:
|
|
149
|
-
* - 'akashnet-2' (mainnet)
|
|
150
|
-
* - 'sandbox-01' (testnet)
|
|
151
|
-
*
|
|
152
|
-
* Used to verify we're connected to the correct network.
|
|
153
|
-
*/
|
|
154
29
|
readonly chainId?: string;
|
|
155
|
-
/**
|
|
156
|
-
* On-chain account data (optional)
|
|
157
|
-
*
|
|
158
|
-
* Cached account state from the blockchain.
|
|
159
|
-
* Used for transaction nonce (sequence) management.
|
|
160
|
-
*
|
|
161
|
-
* If undefined, means we haven't queried account state yet.
|
|
162
|
-
*/
|
|
163
30
|
readonly account?: AccountData;
|
|
164
31
|
}
|
|
165
32
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* X.509 certificate used for mutual TLS (mTLS) authentication with Akash providers.
|
|
169
|
-
* Required for secure communication with provider APIs after lease creation.
|
|
170
|
-
*
|
|
171
|
-
* Why mTLS?
|
|
172
|
-
* - Akash providers require client certificates for authentication
|
|
173
|
-
* - Prevents unauthorized access to deployment management APIs
|
|
174
|
-
* - Certificate is tied to wallet address via blockchain registration
|
|
175
|
-
*
|
|
176
|
-
* Certificate Lifecycle:
|
|
177
|
-
* 1. Generate key pair (privateKey, publicKey)
|
|
178
|
-
* 2. Create X.509 certificate signing request
|
|
179
|
-
* 3. Submit certificate to blockchain
|
|
180
|
-
* 4. Use for all provider API calls
|
|
181
|
-
*
|
|
182
|
-
* @property privateKey - Private key in PEM format (keep secret!)
|
|
183
|
-
* @property publicKey - Public key in PEM format
|
|
184
|
-
* @property cert - X.509 certificate in PEM format
|
|
185
|
-
* @property chain - Certificate chain in PEM format (optional)
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* ```typescript
|
|
189
|
-
* const certificate: AkashProviderTlsCertificate = {
|
|
190
|
-
* privateKey: '-----BEGIN PRIVATE KEY-----\n...',
|
|
191
|
-
* publicKey: '-----BEGIN PUBLIC KEY-----\n...',
|
|
192
|
-
* cert: '-----BEGIN CERTIFICATE-----\n...',
|
|
193
|
-
* chain: '-----BEGIN CERTIFICATE-----\n...' // Optional
|
|
194
|
-
* };
|
|
195
|
-
*
|
|
196
|
-
* // Use for provider API calls
|
|
197
|
-
* const response = await fetch(providerUri, {
|
|
198
|
-
* method: 'POST',
|
|
199
|
-
* headers: {
|
|
200
|
-
* 'Content-Type': 'application/json',
|
|
201
|
-
* },
|
|
202
|
-
* // mTLS authentication:
|
|
203
|
-
* cert: certificate.cert,
|
|
204
|
-
* key: certificate.privateKey
|
|
205
|
-
* });
|
|
206
|
-
* ```
|
|
33
|
+
* X.509 certificate for mTLS authentication with Akash providers.
|
|
34
|
+
* Required for secure communication after lease creation.
|
|
207
35
|
*/
|
|
208
36
|
export interface AkashProviderTlsCertificate {
|
|
209
|
-
/**
|
|
210
|
-
* Private key in PEM format
|
|
211
|
-
*
|
|
212
|
-
* SECURITY: Keep this secret! Never log or expose in errors.
|
|
213
|
-
* Used for mTLS client authentication with providers.
|
|
214
|
-
*
|
|
215
|
-
* Format: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
|
|
216
|
-
*/
|
|
37
|
+
/** Private key in PEM format (keep secret!) */
|
|
217
38
|
readonly privateKey: string;
|
|
218
|
-
/**
|
|
219
|
-
* Public key in PEM format
|
|
220
|
-
*
|
|
221
|
-
* Paired with privateKey, can be shared publicly.
|
|
222
|
-
* Used for certificate verification.
|
|
223
|
-
*
|
|
224
|
-
* Format: "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"
|
|
225
|
-
*/
|
|
226
39
|
readonly publicKey: string;
|
|
227
|
-
/**
|
|
228
|
-
* X.509 certificate in PEM format
|
|
229
|
-
*
|
|
230
|
-
* This is the actual certificate used for mTLS authentication.
|
|
231
|
-
* Contains public key + metadata signed by certificate authority.
|
|
232
|
-
*
|
|
233
|
-
* Format: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
|
|
234
|
-
*/
|
|
235
40
|
readonly cert: string;
|
|
236
|
-
/**
|
|
237
|
-
* Certificate chain in PEM format (optional)
|
|
238
|
-
*
|
|
239
|
-
* Some certificate sources provide the full certificate chain.
|
|
240
|
-
* Not always required for Akash provider communication.
|
|
241
|
-
*
|
|
242
|
-
* Format: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
|
|
243
|
-
*/
|
|
244
41
|
readonly chain?: string;
|
|
245
42
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Type guard: Check if wallet context has WalletConnect session
|
|
248
|
-
*
|
|
249
|
-
* @param ctx - Wallet context to check
|
|
250
|
-
* @returns True if using WalletConnect (has signClient and session)
|
|
251
|
-
*
|
|
252
|
-
* @example
|
|
253
|
-
* ```typescript
|
|
254
|
-
* if (isWalletConnectSession(walletCtx)) {
|
|
255
|
-
* // Can safely disconnect WalletConnect
|
|
256
|
-
* await walletCtx.signClient.disconnect({
|
|
257
|
-
* topic: walletCtx.session.topic,
|
|
258
|
-
* reason: { code: 1, message: 'User disconnected' }
|
|
259
|
-
* });
|
|
260
|
-
* }
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
43
|
+
/** Type guard: Check if wallet has WalletConnect session */
|
|
263
44
|
export declare function isWalletConnectSession(ctx: WalletContext): ctx is WalletContext & {
|
|
264
45
|
signClient: InstanceType<typeof SignClient>;
|
|
265
46
|
session: SessionTypes.Struct;
|
|
266
47
|
};
|
|
267
|
-
/**
|
|
268
|
-
* Type guard: Check if wallet context has account data
|
|
269
|
-
*
|
|
270
|
-
* @param ctx - Wallet context to check
|
|
271
|
-
* @returns True if account data is present
|
|
272
|
-
*
|
|
273
|
-
* @example
|
|
274
|
-
* ```typescript
|
|
275
|
-
* if (hasAccountData(walletCtx)) {
|
|
276
|
-
* // Can safely access account properties
|
|
277
|
-
* console.log('Account number:', walletCtx.account.accountNumber);
|
|
278
|
-
* console.log('Sequence:', walletCtx.account.sequence);
|
|
279
|
-
* }
|
|
280
|
-
* ```
|
|
281
|
-
*/
|
|
48
|
+
/** Type guard: Check if wallet has account data */
|
|
282
49
|
export declare function hasAccountData(ctx: WalletContext): ctx is WalletContext & {
|
|
283
50
|
account: AccountData;
|
|
284
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Geographic location from IP geolocation.
|
|
54
|
+
* May not be 100% accurate, especially for VPN/privacy-focused providers.
|
|
55
|
+
*/
|
|
56
|
+
export interface ProviderLocation {
|
|
57
|
+
readonly region: string;
|
|
58
|
+
readonly regionCode: string;
|
|
59
|
+
readonly country: string;
|
|
60
|
+
readonly countryCode: string;
|
|
61
|
+
readonly latitude?: string;
|
|
62
|
+
readonly longitude?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Provider uptime metrics over 1/7/30 day periods.
|
|
66
|
+
* Values are 0.0-1.0 (0%-100%). Not available for newly registered providers.
|
|
67
|
+
*/
|
|
68
|
+
export interface ProviderReliability {
|
|
69
|
+
readonly uptime1d: number;
|
|
70
|
+
readonly uptime7d: number;
|
|
71
|
+
readonly uptime30d: number;
|
|
72
|
+
readonly isOnline: boolean;
|
|
73
|
+
readonly lastCheckDate?: Date;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Complete provider information with identity, location, and reliability metrics.
|
|
77
|
+
* Optional fields may be unavailable depending on provider registration and indexer data.
|
|
78
|
+
*/
|
|
79
|
+
export interface ProviderInfo {
|
|
80
|
+
readonly owner: string;
|
|
81
|
+
readonly hostUri: string;
|
|
82
|
+
readonly name?: string;
|
|
83
|
+
readonly email?: string;
|
|
84
|
+
readonly website?: string;
|
|
85
|
+
/** Verified by community auditors (Overclock Labs) for hardware/uptime standards */
|
|
86
|
+
readonly isAudited: boolean;
|
|
87
|
+
readonly location?: ProviderLocation;
|
|
88
|
+
readonly reliability?: ProviderReliability;
|
|
89
|
+
readonly akashVersion?: string;
|
|
90
|
+
readonly cosmosSdkVersion?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Complete lease details from blockchain query
|
|
94
|
+
*/
|
|
95
|
+
export interface LeaseDetails {
|
|
96
|
+
readonly owner: string;
|
|
97
|
+
readonly provider: string;
|
|
98
|
+
readonly dseq: string;
|
|
99
|
+
readonly gseq: number;
|
|
100
|
+
readonly oseq: number;
|
|
101
|
+
readonly state: 'active' | 'closed' | 'insufficient_funds';
|
|
102
|
+
readonly price: {
|
|
103
|
+
readonly denom: string;
|
|
104
|
+
readonly amount: string;
|
|
105
|
+
};
|
|
106
|
+
readonly createdAt: string;
|
|
107
|
+
}
|
|
285
108
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/targets/akash/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/targets/akash/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,8FAA8F;AAC9F,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAEnE,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC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ploy:
|
|
9
|
-
* - ✅ ZERO `any` types (was 5 any types)
|
|
10
|
-
* - ✅ Proper imports from typed libraries
|
|
11
|
-
* - ✅ Readonly properties to prevent mutations
|
|
12
|
-
* - ✅ Comprehensive JSDoc documentation
|
|
4
|
+
* Type-safe interfaces for Akash Network deployment operations using proper
|
|
5
|
+
* TypeScript types from @cosmjs and @walletconnect libraries (zero `any` types).
|
|
13
6
|
*
|
|
14
7
|
* @module targets/akash/types
|
|
15
8
|
*/
|
|
16
|
-
/**
|
|
17
|
-
* Type guard: Check if wallet context has WalletConnect session
|
|
18
|
-
*
|
|
19
|
-
* @param ctx - Wallet context to check
|
|
20
|
-
* @returns True if using WalletConnect (has signClient and session)
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* if (isWalletConnectSession(walletCtx)) {
|
|
25
|
-
* // Can safely disconnect WalletConnect
|
|
26
|
-
* await walletCtx.signClient.disconnect({
|
|
27
|
-
* topic: walletCtx.session.topic,
|
|
28
|
-
* reason: { code: 1, message: 'User disconnected' }
|
|
29
|
-
* });
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
9
|
+
/** Type guard: Check if wallet has WalletConnect session */
|
|
33
10
|
export function isWalletConnectSession(ctx) {
|
|
34
11
|
return ctx.signClient !== undefined && ctx.session !== undefined;
|
|
35
12
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Type guard: Check if wallet context has account data
|
|
38
|
-
*
|
|
39
|
-
* @param ctx - Wallet context to check
|
|
40
|
-
* @returns True if account data is present
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* if (hasAccountData(walletCtx)) {
|
|
45
|
-
* // Can safely access account properties
|
|
46
|
-
* console.log('Account number:', walletCtx.account.accountNumber);
|
|
47
|
-
* console.log('Sequence:', walletCtx.account.sequence);
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
13
|
+
/** Type guard: Check if wallet has account data */
|
|
51
14
|
export function hasAccountData(ctx) {
|
|
52
15
|
return ctx.account !== undefined;
|
|
53
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/targets/akash/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/targets/akash/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyCH,4DAA4D;AAC5D,MAAM,UAAU,sBAAsB,CAAC,GAAkB;IAIvD,OAAO,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC;AACnE,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,cAAc,CAAC,GAAkB;IAG/C,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC;AACnC,CAAC"}
|