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
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
**DEPRECATED:** akashjs examples are deprecated and won't be updated with the next network upgrade. Please switch to [chain-sdk](https://github.com/akash-network/chain-sdk/tree/main/ts) which provides more developer-friendly API with IDE autocomplete support
6
+
7
+
5
8
Connect and communicate with the Akash Network. Pure JS library can be used in browser for unsigned transactions, and with node.js for full compatibility.
6
9
7
10
## Packages
@@ -143,4 +146,3 @@ npm run setup-git-hooks
143
146
- Set `DEBUG=akashjs:*` environment variable for detailed logs
144
147
145
148
PRs are welcome! By adhering to these guidelines and leveraging our automated systems, we can maintain a high-quality codebase and streamline our development processes.
Copy file name to clipboardExpand all lines: examples/README.md
+7-11Lines changed: 7 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# AkashJS Examples
2
2
3
+
**DEPRECATED:** akashjs examples are deprecated and won't be updated with the next network upgrade. Please switch to [chain-sdk](https://github.com/akash-network/chain-sdk/tree/main/ts) which provides more developer-friendly API with IDE autocomplete support
4
+
3
5
This directory contains several examples of how to interact with the Akash networking using AkashJS and CosmJS.
4
6
5
7
## Setup
@@ -62,13 +64,7 @@ Install the following dependencies for general usage and signing transactions wi
62
64
npm i @akashnetwork/akash-api @akashnetwork/akashjs @cosmjs/stargate @cosmjs/proto-signing
63
65
```
64
66
65
-
If you want to create wallets
66
-
67
-
```bash
68
-
npm i @cosmjs/launchpad
69
-
```
70
-
71
-
For [amino encoding](https://docs.cosmos.network/main/learn/advanced/encoding#encoding-1)
67
+
If you want to create wallets with [amino encoding](https://docs.cosmos.network/main/learn/advanced/encoding#encoding-1)
72
68
73
69
```bash
74
70
npm i @cosmjs/amino
@@ -81,7 +77,7 @@ The following code shows an example of the process for creating a new Akash wall
81
77
A new wallet can be initialized by calling `Secp256k1HdWallet.generate` from @cosmjs/launchpad, and passing `{ prefix: "akash" }`.
Cosmjs does not publicly expose the private key for accounts. Instead, messages are passed into the wallet for signing. This can be done directly, as shown below.
thrownewError("RPC_ENDPOINT environment variable is not set. Please set the environment variable in the .env file. See .env.sample for more information.");
28
+
}
24
29
25
30
// Update this environment variable with your wallet mnemonic
thrownewError("RPC_ENDPOINT environment variable is not set. Please set the environment variable in the .env file. See .env.sample for more information.");
15
+
}
16
+
17
+
if(!process.env.PROVIDER_ADDRESS){
18
+
thrownewError("PROVIDER_ADDRESS environment variable is not set.");
// You can use your own RPC node, or get a list of public nodes from akashjs
16
+
constrpcEndpoint=process.env.RPC_ENDPOINT||"";
17
+
if(!rpcEndpoint){
18
+
thrownewError("RPC_ENDPOINT environment variable is not set. Please set the environment variable in the .env file. See .env.sample for more information.");
19
+
}
6
20
7
-
dotenv.config({path: "../.env"});
21
+
constmnemonic=process.env.MNEMONIC||"";
22
+
if(!mnemonic){
23
+
thrownewError("MNEMONIC environment variable is not set. Please set the environment variable in the .env file. See .env.sample for more information.");
24
+
}
8
25
9
26
asyncfunctionmain(){
10
-
constmnemonic=process.env.MNEMONIC||"";
11
-
if(!mnemonic){
12
-
thrownewError("MNEMONIC environment variable is not set. Please set the environment variable in the .env file. See .env.sample for more information.");
0 commit comments