open-index/open-npm huggingface dataset:
npm package: @harmony-js/crypto
Description: crypto libraries for harmony
Author: neeboo@firestack.one
Latest version: 0.1.56

# @harmony-js/crypto

This package provides a collection of apis related to address management, kestore, encoding, and encrypt/decrypt.

## Installation

```
npm install @harmony-js/crypto
```

## Usage

```javascript
const {
  encode,
  decode,
  randomBytes,
  toBech32,
  fromBech32,
  HarmonyAddress,
  generatePrivateKey,
  getPubkeyFromPrivateKey,
  getAddressFromPublicKey,
  getAddressFromPrivateKey,
  encryptPhrase,
  decryptPhrase
} = require('@harmony-js/crypto');
const { isPrivateKey, isAddress, isPublicKey } = require('@harmony-js/utils');
```

Address apis
```javascript
const bytes = randomBytes(20);
const addr = new HarmonyAddress(bytes);

console.log(addr.checksum);
console.log(addr.bech32);

console.log(HarmonyAddress.isValidBech32(addr.bech32));
```

RLP apis
```javascript
const encoded = '0x89010101010101010101';
const decoded = '0x010101010101010101';
console.log(encode(decoded));
console.log(decode(encoded));
```

Keystore apis
```javascript
const prv = generatePrivateKey();
const pub = getPubkeyFromPrivateKey(prv);
const addr = getAddressFromPublicKey(pub);
const addrPrv = getAddressFromPrivateKey(prv);
console.log(isPrivateKey(prv));
console.log(isPublicKey(pub));
console.log(isAddress(addr));
console.log(isAddress(addrPrv));
```

Encrypt/decrypt apis
```javascript
const { Wallet } = require('@harmony-js/account');

const myPhrase = new Wallet().newMnemonic();
console.log(myPhrase);
const pwd = '1234';
encryptPhrase(myPhrase, pwd).then((value) => {
  console.log(value);
  decryptPhrase(JSON.parse(value), pwd).then(value => {
    console.log(value);
  });
});
```
npm package: @harmony-js/network
Description: network suites for harmony
Author: neeboo@firestack.one
Latest version: 0.1.56

# @harmony-js/network

This package provides a collection of apis to create messengers (HTTP, WebSocket) to connect to blockchain networks.

## Installation

```
npm install @harmony-js/network
```

## Usage

```javascript
const { Messenger, HttpProvider, WSProvider } = require('@harmony-js/network');
const { ChainID, ChainType } = require('@harmony-js/utils');
const testnetHTTP = 'https://api.s0.b.hmny.io';
const testnetWS = 'wss://ws.s0.b.hmny.io';
const localHTTP = 'http://localhost:9500/';
const localWS = 'http://localhost:9800/';
const http = new HttpProvider(testnetHTTP); // for local use localHTTP
const ws = new WSProvider(testnetWS); // for local use testnetWS
const customHTTPMessenger = new Messenger(http, ChainType.Harmony, ChainID.HmyTestnet); // for local ChainID.HmyLocal
const customWSMessenger = new Messenger(ws, ChainType.Harmony, ChainID.HmyTestnet); // for local ChainID.HmyLocal
```
npm package: @harmony-js/staking
Description: staking transaction package for harmony
Latest version: 0.1.56

# @harmony-js/staking

This package provides a collection of apis to create, sign/send staking transaction, and receive confirm/receipt.

## Installation

```
npm install @harmony-js/staking
```

## Usage

Create a Harmony instance connecting to testnet

```javascript
const { Harmony } = require('@harmony-js/core');
const {
  ChainID,
  ChainType,
  hexToNumber,
  numberToHex,
  fromWei,
  Units,
  Unit,
} = require('@harmony-js/utils');

const hmy = new Harmony(
    'https://api.s0.b.hmny.io/',
    {
        chainType: ChainType.Harmony,
        chainId: ChainID.HmyTestnet,
    },
);
```
Below, examples show how to send delegate, undelegate, and collect rewards staking transactions. First, set the chainId, gasLimit, gasPrice for all subsequent staking transactions
```javascript
hmy.stakings.setTxParams({
  gasLimit: 25000,
  gasPrice: numberToHex(new hmy.utils.Unit('1').asGwei().toWei()),
  chainId: 2
});
```
<span style="color:red">Note: create and edit validator transactions are not fully supported in the sdk</span>

Create delegate staking transaction
```javascript
const delegate = hmy.stakings.delegate({
  delegatorAddress: 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7',
  validatorAddress: 'one1vfqqagdzz352mtvdl69v0hw953hm993n6v26yl',
  amount: numberToHex(new Unit(1000).asOne().toWei())
});
const delegateStakingTx = delegate.build();
```

Sign and send the delegate transaction and receive confirmation
```javascript
// key corresponds to one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7, only has testnet balance
hmy.wallet.addByPrivateKey('45e497bd45a9049bcb649016594489ac67b9f052a6cdf5cb74ee2427a60bf25e');

hmy.wallet.signStaking(delegateStakingTx).then(signedTxn => {
  signedTxn.sendTransaction().then(([tx, hash]) => {
    console.log(hash);
    signedTxn.confirm(hash).then(response => {
      console.log(response.receipt);
    });
  });
});
```

Similarily, undelegate and collect reward transactions can be composed, signed and sent
Create undelegate staking transaction
```javascript
const undelegate = hmy.stakings.undelegate({
  delegatorAddress: 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7',
  validatorAddress: 'one1vfqqagdzz352mtvdl69v0hw953hm993n6v26yl',
  amount: numberToHex(new Unit(1000).asOne().toWei())
});
const undelegateStakingTx = undelegate.build();
```

Create collect rewards staking transaction
```javascript
const collectRewards = hmy.stakings.collectRewards({
  delegatorAddress: 'one103q7qe5t2505lypvltkqtddaef5tzfxwsse4z7'
});
const collectRewardsStakingTx = collectRewards.build();
```

Also, similar to normal transaction, signing and sending can be performed asynchronously.
npm package: @harmony-js/utils
Description: utils for harmony
Author: neeboo@firestack.one
Latest version: 0.1.56

# @harmony-js/utils

This package provides a collection of utility apis for unit conversions like `fromWei`, `toWei`, `hexToNumber`, `numberToHex`, `isAddress`, etc.

## Installation

```
npm install @harmony-js/utils
```

## Usage

Available units
```
const { Units } = require('@harmony-js/utils');

[Units.wei, '1'], // 1 wei
[Units.Kwei, '1000'], // 1e3 wei
[Units.Mwei, '1000000'], // 1e6 wei
[Units.Gwei, '1000000000'], // 1e9 wei
[Units.szabo, '1000000000000'], // 1e12 wei
[Units.finney, '1000000000000000'], // 1e15 wei
[Units.ether, '1000000000000000000'], // 1e18 wei
[Units.one, '1000000000000000000'], // 1e18 wei
[Units.Kether, '1000000000000000000000'], // 1e21 wei
[Units.Mether, '1000000000000000000000000'], // 1e24 wei
[Units.Gether, '1000000000000000000000000000'], // 1e27 wei
[Units.Tether, '1000000000000000000000000000000'], // 1e30 wei
```

Converting between different units
```javascript
const { Units, Unit, numberToString, add0xToString, fromWei, toWei, numToStr} = require('@harmony-js/utils');
const { BN } = require('@harmony-js/crypto');

const one = new Unit('1').asOne();
const oneToGwei = one.toGwei();
console.log(oneToGwei);

// numberToString
const num = 123;
const str = numberToString(num)
console.log(str);

// add0xToString
const str = '12345';
const expected = add0xToString(str)
console.log(expected);

// fromWei
const Wei = new BN('1000000000000000000');
const expected = fromWei(Wei, Units.one);
console.log(expected);

// toWei
const one = new BN('1');
const expected = toWei(one, hmy.utils.Units.one);
const num = numToStr(expected);
console.log(num);
```
npm package: @harmony-technology/design-system
Description: Harmony UI is a collection of React components and hooks that help you build beautiful and accessible user interfaces. 
Latest version: 0.0.6

# Harmony/design-system

[![npm version](https://badge.fury.io/js/%40harmony-technology%2Fdesign-system.svg)](https://badge.fury.io/js/%40harmony-technology%2Fdesign-system)

[ ![Harmony](https://img.shields.io/badge/Powered%20by-Harmony%20Technology-blue)](https://www.harmony-technology.net/)

🎶🙌 This is the Harmony design system. It is a collection of reusable components and guidelines for building consistent and accessible user interfaces.

## Features

- 🎨 **Consistent design**: All components are designed to work together and look great out of the box.
- 📱 **Responsive**: Components are designed to work on all devices and screen sizes.
- ♿ **Accessible**: All components are designed to be accessible to all users.
- 📦 **Easy to use**: Components are easy to use and require minimal configuration.
- 📚 **Well documented**: All components are well documented with examples and guidelines.

## Getting started

To get started, install the Harmony design system package from npm:

```bash
npm install @harmony-technology/design-system

```

# or

```bash
yarn add @harmony-technology/design-system
```

## Usage

To use the Harmony design system, import the components you need and use them in your application:

```javascript
import { Button } from "@harmony-technology/design-system";

function App() {
  return <Button>Click me</Button>;
}
```

## Contributors:

[@AmineElazzab](https://github.com/AmineElazzab)

## License

MIT

## Keywords

design, system, harmony, technology, ui, components, react, library, npm, package, styled-components, styled, components, ui, kit



Copyright (c)