open-index/open-npm huggingface dataset:
npm package: @realiotech/address-generator
Description: Exposes functionality to generate Realio Network addresses and convert between `ETH` address and `ethsecp256k1`/`realio` addresses.
Latest version: 1.0.1

# Address generator

Exposes functionality to generate Realio Network addresses and convert between `ETH` address and `ethsecp256k1`/`realio` addresses.

## Installation

``` sh
npm install @realiotech/address-generator
```

## Usage


### Generate

``` ts
import {generateWallet} "@realiotech/address-generator"

let wallet = generateWallet()
{
  realioAddress: 'realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m',
  ethAddress: '0x7338f54D573b74AdeC18AcE21e839bfbCb7Ee750',
  mnemonic: 'lumber flight plunge wait repair knee year deer chuckle cherry involve start'
}

```


### Converter

``` ts
import {realioNetworkToEth, ethToRealionetwork} from "@realiotech/address-generator"

let address = realioNetworkToEth("realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m")
// "0x7338f54D573b74AdeC18AcE21e839bfbCb7Ee750"

let address = ethToRealionetwork("0x7338f54D573b74AdeC18AcE21e839bfbCb7Ee750")
// "realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m"
```

### Decoders

``` ts
import {ETH, REALIONETWORK} from "@realiotech/address-generator"
let hex = ETH.decoder("0x7338f54D573b74AdeC18AcE21e839bfbCb7Ee750")
// hex.toString('hex') === "7338f54d573b74adec18ace21e839bfbcb7ee750"

hex = REALIONETWORK.decoder("realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m")
// hex.toString('hex') === "7338f54d573b74adec18ace21e839bfbcb7ee750"
```

### Encoders

``` ts
import {ETH, REALIONETWORK} from "@realiotech/address-generator"
let address = ETH.encoder(Buffer.from("7338f54D573b74AdeC18AcE21e839bfbCb7Ee750","hex"))
// address === "0x7338f54D573b74AdeC18AcE21e839bfbCb7Ee750"

address = REALIONETWORK.encoder(Buffer.from("7338f54D573b74AdeC18AcE21e839bfbCb7Ee750","hex"))
// address === "realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m"
```



## Reference

- [ENSDOMAINS-AddressEnconder](https://github.com/ensdomains/address-encoder)
npm package: @realiotech/proto
Description: Protobuf files for RealioNetwork
Latest version: 2.7.0

# Proto

Protobuf files used to generate cosmos/realionetwork transactions.

## Local generation

Requirements:

- `brew install protoc`
- `npm install -g protoc-gen-ts` 

### Note
There seems to be a problem with typescript ~4.8.x and `protoc-gen-ts`.
`protoc-gen-ts` lists the dependency with the semantic version of `"^4.3.4"`, and
upon getting the version 4.8.x installed, the compiler was failing.
On typescript `4.3.4` it works which is the quick solution for now.


To generate the protobuf files on linux instead of OSX, remove the empty string after `sed -i ''`

```sh
./scripts/get_proto_files.sh
./scripts/create_proto_files.sh
./scripts/remove_grpc.sh
./scripts/remove_unused_dependencies.sh
```

## Note

The lib `@grpc/grpc-js` was not included in the `package.json`, and all the services were manually removed from the autogenerated proto files to avoid having that dependency.
This lib is just a tool to create the transactions, not to interact with a GRPC server, if you need the complete proto file you can locally run `./scripts/get_proto_files.sh` and `./scripts/create_proto_files.sh`
npm package: @realiotech/provider
Description: Simple provider to query the RealioNetwork rest api.
Latest version: 2.0.1

# Provider

Simple provider to query the RealioNetwork rest api.

## Installation

``` sh
npm install @realiotech/provider
```

## Usage
```javascript
import { provider } from '@realiotech/provider'
let accountEndpoint = provider.generateEndpointAccount('realio1wvu02n2h8d62mmqc4n3paquml09hae6sdnlu6m');

```
npm package: @realiotech/transactions
Description: Transactions generator for RealioNetwork
Latest version: 2.7.0

# transactions

Transaction generator for Realio Network

## Installation

``` sh
npm install @realiotech/transactions
```

## Usage
```javascript
import { provider, transactions, addressGenerator } from '@realiotech/realiojs'

const sender = { accountAddress: 'realio10hxw5znr0pz7w0gyvczkjp2530e3kj2u4fc', sequence: 0, accountNumber: 0, pubkey: 'A3JQVwyAybWURqXDEa2xOKj5q7Ra9V6dQhR1sIMj', }
const params = { destinationAddress: 'realio1smp04p5qmzdnhz72w3erlxch3q9hw9cwxk', amount: '5500', denom: 'urio', }
let fee = { amount: '3000000000000000000', denom: 'ario', gas: '300000', }
const memo = 'a memo'
const chain = { chainId: 1000, cosmosChainId: 'realionetwork_1000-2', }
 
const tx = createMessageSend(chain, sender, fee, memo, params)

// msg.signDirect is the transaction in Keplr format
// msg.legacyAmino is the transaction with legacy amino
// msg.eipToSign is the EIP712 data to sign with metamask
  
//...sign and broadcast..
// todo add examples for keplr, metamask (when eip added)

if (signedTx !== undefined) {
    let rawTx = createTxRaw(sign.signed.bodyBytes, sign.signed.authInfoBytes, [
        new Uint8Array(Buffer.from(sign.signature.signature, 'base64')),
    ])

    // Broadcast it
    const postOptions = {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: generatePostBodyBroadcast(rawTx),
    }

    let broadcastPost = await fetch(
        `http://localhost:1317${generateEndpointBroadcast()}`,
        postOptions,
    )
    let response = await broadcastPost.json()
}

```

# todo
- add txns for staking module
- add eip712 txn support