### Setting Up Aleph.im Toolshed Example (Shell) Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/examples/toolshed/readme.md This snippet provides shell commands to set up the Aleph.im toolshed example. It includes installing root project dependencies, building the project, navigating to the example directory, installing its dependencies, and finally running the development server. ```Shell # assumes you are in the root of the project npm install && npm run build # now we can go to the toolshed example cd examples/toolshed # install its dependencies npm install # and run the example npm run dev ``` -------------------------------- ### Listing Aleph SDK Packages for npm Installation Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/README.md This snippet provides a comprehensive list of available Aleph SDK packages for installation via npm. It categorizes packages into legacy, general, EVM chains, and non-EVM chains, allowing users to identify and install specific modules required for their projects using the `npm install ` command. ```shell # Legacy (3.9.2) aleph-sdk-ts # Current (1.0.0 or later) ## General @aleph-sdk/core @aleph-sdk/account @aleph-sdk/client @aleph-sdk/message @aleph-sdk/dns ## EVM chains @aleph-sdk/evm @aleph-sdk/ethereum @aleph-sdk/ethereum-ledger @aleph-sdk/avalanche @aleph-sdk/base @aleph-sdk/superfluid ## Non-EVM chains @aleph-sdk/solana @aleph-sdk/tezos @aleph-sdk/nuls2 @aleph-sdk/cosmos @aleph-sdk/substrate ``` -------------------------------- ### Building and Testing Aleph SDK from Source Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/README.md This snippet outlines the essential steps to set up, build, and test the Aleph SDK directly from its source code. It involves installing project dependencies, compiling the packages, and running the test suite, which is crucial for development, contributing, or accessing unreleased features. ```shell npm install npm run build npm run test ``` -------------------------------- ### Installing @aleph-sdk/dns Package - Bash Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/packages/dns/README.md This snippet demonstrates how to install the `@aleph-sdk/dns` package using npm, the standard package manager for Node.js and JavaScript. Executing this command adds the module to your project's `node_modules` directory and updates your `package.json` file, making its DNS utilities available for import and use. ```bash npm install @aleph-sdk/dns ``` -------------------------------- ### Installing Aleph SDK Client with Deno Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/README.md This snippet demonstrates how to install the `@aleph-sdk/client` package using Deno's built-in npm compatibility. This command allows Deno users to seamlessly integrate Aleph SDK functionalities into their projects, leveraging Deno as an alternative runtime environment to Node.js. ```bash deno install npm:@aleph-sdk/client ``` -------------------------------- ### Installing Aleph.im Client Package (NPM) Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/packages/client/README.md This command installs the core Aleph.im TypeScript client package from NPM, providing the main interface for interacting with the Aleph.im network. ```shell npm install @aleph-sdk/client ``` -------------------------------- ### Installing Aleph.im Ethereum Package (NPM) Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/packages/client/README.md This command installs the Aleph.im Ethereum package from NPM, which is required for using the AuthenticatedAlephHttpClient to sign messages on the Ethereum chain. ```shell npm install @aleph-sdk/ethereum ``` -------------------------------- ### Polyfilling Buffer for Browser in TypeScript Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/examples/toolshed/index.html This snippet imports the 'Buffer' class from the 'buffer' module and then assigns it to 'window.Buffer'. This is crucial for browser environments that do not natively provide the Node.js 'Buffer' class, allowing Node.js-compatible libraries within the Aleph.im SDK to function correctly for binary data handling. ```TypeScript import { Buffer } from 'buffer' window.Buffer = Buffer ``` -------------------------------- ### Initializing Global Object in TypeScript Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/examples/toolshed/index.html This snippet ensures that the 'window.global' object is set, falling back to 'window' if 'global' is not already defined. This is a common pattern for browser compatibility in environments that might expect a 'global' object, often found in polyfills for Node.js-like global contexts. ```TypeScript window.global ||= window; ``` -------------------------------- ### Executing the Staking Script (Shell) Source: https://github.com/aleph-im/aleph-sdk-ts/blob/main/examples/stake-on-me/readme.md This command runs the `cli.ts` TypeScript file directly using `npx ts-node`. `ts-node` enables execution of TypeScript code without a separate compilation step, making it convenient for development and scripting. This specific command initiates the staking process described in the project. ```shell npx ts-node cli.ts ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.