You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Akash client-js library aims to provide a simplified, high-level interface for interacting with the Akash Network. This specification outlines the transition from the current akashjs implementation to a more streamlined client library.
Goals
Simplified API Surface
Create intuitive, promise-based APIs
Abstract complex blockchain interactions
Provide strong TypeScript types
Implement comprehensive error handling
Move Low-Level Logic
Transfer protocol buffers to akash-api (chain-sdk)
import{createClient}from"@akashnetwork/client";constclient=createClient({network: "mainnet",wallet: awaitgetKeplrWallet()});// Create a deploymentconstdeployment=awaitclient.deployments.create({sdl: sdlContent,autoSelectBid: false,// this could be set to true to select the cheapest bidprovider: "akash1824w2vqx57n8zr8707dnyh85kjrkfkrrs94pk9",// this would force to select a bid for a specific provider});// Get lease informationconstlease=awaitclient.leases.get(deployment.leaseId);
Node.js Environment
import{createClient}from"@akashnetwork/client";constclient=createClient({network: "mainnet",mnemonic: "your mnemonic phrase"});// List active leasesconstleases=awaitclient.leases.list({state: "active"});// Close a deploymentawaitclient.deployments.close(deploymentId);
This library refactor will be BREAKING and previous applications that used it will have to refactor their code to the latest version. A new package entirely will be generated so the old package will remain and work for old applications.
Phase 1: Core Implementation
Create new repository structure
Implement core interfaces
Write comprehensive tests
Document API surface
Phase 2: Migration Support
Create migration guides
Provide compatibility layer
Support transition period
Phase 3: Legacy Deprecation
Mark old akashjs as deprecated
Communicate timeline
Complete documentation
Documentation Requirements
Getting Started Guide
Installation instructions
Basic configuration
Simple examples
Environment setup
API Documentation
Method descriptions
Type definitions
Error handling
Best practices
Migration Guide
Comparison with old API
Step-by-step migration
Breaking changes
Common pitfalls
Examples
Basic deployment workflow
Provider selection
Error handling
Advanced scenarios
Installation
npm install @akashnetwork/client
Basic Usage
import{createClient}from"@akashnetwork/client";// Create client instanceconstclient=createClient({network: "mainnet",// Wallet configuration (Cosmos-kit or mnemonic)});// Create deploymentconstdeployment=awaitclient.deployments.create({sdl: sdlContent,autoSelectBid: false,// this could be set to true to select the cheapest bidprovider: "akash1824w2vqx57n8zr8707dnyh85kjrkfkrrs94pk9",// this would force to select a bid for a specific provider});// Get deployment infoconstinfo=awaitclient.deployments.get(deployment.dseq);
The text was updated successfully, but these errors were encountered:
Akash client-js Specification
Overview
The Akash client-js library aims to provide a simplified, high-level interface for interacting with the Akash Network. This specification outlines the transition from the current akashjs implementation to a more streamlined client library.
Goals
Simplified API Surface
Move Low-Level Logic
New client-js project structure
Core library package (@akashnetwork/client-js)
This package will contain the high level interactions with the Akash Network.
For example when creating a deployment, we need:
Post creation:
An example of how it will look like to use the new client-js API
Core Package Architecture
Client Configuration
Main Client Interface
Type Definitions
Usage Examples
Browser Environment
Node.js Environment
Error Handling
Migration Strategy
This library refactor will be BREAKING and previous applications that used it will have to refactor their code to the latest version. A new package entirely will be generated so the old package will remain and work for old applications.
Phase 1: Core Implementation
Phase 2: Migration Support
Phase 3: Legacy Deprecation
Documentation Requirements
Getting Started Guide
API Documentation
Migration Guide
Examples
Installation
Basic Usage
The text was updated successfully, but these errors were encountered: