-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(types): add JSDoc documentation for network and global types
- Add comprehensive JSDoc for network type definitions (MainnetNetworkId, TestnetNetworkId, SandboxNetworkId) - Document Window interface extension for Keplr wallet integration - Include usage examples and parameter descriptions for getOfflineSignerAuto - Improve type definitions readability with detailed descriptions Signed-off-by: Greg Osuri <[email protected]>
- Loading branch information
Showing
6 changed files
with
234 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
/** | ||
* SDL (Stack Definition Language) module exports | ||
* Provides functionality for parsing and validating Akash deployment manifests | ||
* | ||
* @example | ||
* ```ts | ||
* import { SDL } from './sdl'; | ||
* | ||
* const yaml = ` | ||
* version: "2.0" | ||
* services: | ||
* web: | ||
* image: nginx | ||
* expose: | ||
* - port: 80 | ||
* as: 80 | ||
* to: | ||
* - global: true | ||
* `; | ||
* | ||
* const sdl = SDL.fromString(yaml); | ||
* const manifest = sdl.manifest(); | ||
* ``` | ||
*/ | ||
export * from "./SDL/SDL"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
import { MessageType, messageTypeRegistry, UnknownMessage } from "@akashnetwork/akash-api/typeRegistry"; | ||
|
||
/** | ||
* Retrieves the Akash type registry. | ||
* @returns An array of tuples containing the type URL and the corresponding message type. | ||
*/ | ||
export const getAkashTypeRegistry: () => [string, MessageType<UnknownMessage>][] = () => | ||
Array.from(messageTypeRegistry).map(([path, type]) => [`/${path}`, type]); | ||
|
||
/** | ||
* Gets the type URL for a given message type. | ||
* @param type - The message type for which to get the URL. | ||
* @returns The URL string for the specified message type. | ||
*/ | ||
export const getTypeUrl: (type: MessageType) => string = type => `/${type.$type}`; | ||
|
||
/* TODO: this should be generated from the proto files */ | ||
/** | ||
* Enum for Akash message types. | ||
* @enum {string} | ||
*/ | ||
export enum Message { | ||
/** Message type for creating a certificate. */ | ||
MsgCreateCertificate = "/akash.cert.v1beta3.MsgCreateCertificate", | ||
/** Message type for revoking a certificate. */ | ||
MsgRevokeCertificate = "/akash.cert.v1beta3.MsgRevokeCertificate", | ||
/** Message type for creating a deployment. */ | ||
MsgCreateDeployment = "/akash.deployment.v1beta3.MsgCreateDeployment", | ||
/** Message type for closing a deployment. */ | ||
MsgCloseDeployment = "/akash.deployment.v1beta3.MsgCloseDeployment", | ||
/** Message type for depositing into a deployment. */ | ||
MsgDepositDeployment = "/akash.deployment.v1beta3.MsgDepositDeployment", | ||
/** Message type for updating a deployment. */ | ||
MsgUpdateDeployment = "/akash.deployment.v1beta3.MsgUpdateDeployment", | ||
/** Message type for closing a group. */ | ||
MsgCloseGroup = "/akash.deployment.v1beta3.MsgCloseGroup", | ||
/** Message type for pausing a group. */ | ||
MsgPauseGroup = "/akash.deployment.v1beta3.MsgPauseGroup", | ||
/** Message type for starting a group. */ | ||
MsgStartGroup = "/akash.deployment.v1beta3.MsgStartGroup", | ||
/** Message type for creating a lease. */ | ||
MsgCreateLease = "/akash.market.v1beta4.MsgCreateLease" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
/** | ||
* Type representing the mainnet network identifier. | ||
* Used for production environment connections. | ||
*/ | ||
export type MainnetNetworkId = "mainnet"; | ||
|
||
/** | ||
* Type representing the testnet network identifier. | ||
* Used for testing and development purposes. | ||
*/ | ||
export type TestnetNetworkId = "testnet"; | ||
|
||
/** | ||
* Type representing the sandbox network identifier. | ||
* Used for local development and testing. | ||
*/ | ||
export type SandboxNetworkId = "sandbox"; | ||
|
||
/** | ||
* Union type combining all possible network identifiers. | ||
* Can be either "mainnet", "testnet", or "sandbox". | ||
* @typedef {MainnetNetworkId | TestnetNetworkId | SandboxNetworkId} NetworkId | ||
*/ | ||
export type NetworkId = MainnetNetworkId | TestnetNetworkId | SandboxNetworkId; |