open-index/open-npm huggingface dataset:
npm package: @open_brainiac/electron-ipc-router
Description: > electron-ipc-router is used to send messages between the main, and the renderer process. > and helps debug the main process.
Author: Opensource Brainiac
Latest version: 1.0.3

# electron-ipc-router
> electron-ipc-router is used to send messages between the main, and the renderer process.
> and helps debug the main process.    

[![NPM](https://img.shields.io/npm/v/@open_brainiac/electron-ipc-router.svg)](https://www.npmjs.com/package/@open_brainiac/electron-ipc-router) 

##Install
```bash
npm i @open_brainiac/electron-ipc-router
```
## 🚀 Usage:
```javascript
// main process
import {subscriber} from "@open_brainiac/electron-ipc-router"

const routes = {
  foo: function(a,b){
    return a+b;
  },
  bar: async function(){
    // getData is an async function, like getting data from DB
    let data = await getData()
    return  data;
  }
}

subscriber({routes})
```

```html
<!--  Renderer process -->
<script>
    import {ipc} from "@open_brainiac/electron-ipc-router"
    console.log(ipc("foo", 1,2))// => prints: 3
    ipc("bar").then(res=>console.log(res)) // => prints the data variable
</script>
```
### Debugging server
Using the electron-ipc-router you can start a node server that exposes the functions of the routes
object.

**Note:** this functionality should be used only for debugging the routes and not for production.

```javascript
  let options = {
    routes,
    server: true,
    port: 3000,
  }
  subscriber(options)
```

```bash
  curl --location --request POST 'http://localhost:3000/foo' \ // => the name of the function
  --header 'Content-Type: application/json' \
  --data-raw '{
      "args": [1,2] //=> array of the function arguments
  }'
```     
## 🤝 Contributing
Contributions, issues and feature requests are welcome!

## 📝 License
This project is **MIT** licensed
npm package: @open_social_protocol/osp-api-index-types
Description: open social protocol index server api
Latest version: 0.0.2

# @open_social_protocol/osp-api-index-types@0.0.1

open social protocol indexServer apiClient

## Installation

```bash

pnpm add @open_social_protocol/osp-api-index-types
```

or

```bash
npm i @open_social_protocol/osp-api-index-types
```

## Usage

```javascript
import { IndexClient } from "@open_social_protocol/osp-api-index-types";

const indexClient = new IndexClient({
  baseUrl: indexUrl,
  baseApiParams: {
    headers,
  },
});
```

# Changelog

## [0.0.1]

### Change

- init commit

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.
npm package: @open_social_protocol/osp-blockchain-types
Description: open social protocol contract typechain
Latest version: 0.0.2

# @open_social_protocol/osp-blockchain-types@0.0.1

osp-client-js is a osp clent js sdk.

## Installation

```bash

pnpm add osp-blockchain-types
```

or

```bash
npm i osp-blockchain-types --save-dev
```

# Changelog

## [0.0.1]

### Change

- init commit

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.
npm package: @open_social_protocol/osp-client
Description: open social protocol sdk
Latest version: 0.0.2

# @open_social_protocol/osp-client@1.12.9

osp-client-js is a osp clent js sdk.

## Installation

Use the package manager [pnpm] or [npm] to install osp-client-js.

```bash
pnpm add @open_social_protocol/osp-client
```

or

```bash
npm i @open_social_protocol/osp-client
```

## Usage

```ts
import { OspClient, Environment } from "@open_social_protocol/osp-client";
import { ethers } from "ethers";

const env: Environment = Environment.dev;

const client = OspClient.create({
  env,
  storage: localStorage,
  app_id: "<APP_ID>",
  guest_id_marketing: "<GUEST_ID_MARKETING>",
});

const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);

await client.authentication.login(provider.getSigner());
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.
npm package: @open_social_protocol/osp-wallet
Description: open social protocol abstract account sdk
Latest version: 0.0.2

# @open_social_protocol/osp-wallet@0.0.1

## Usage

```typescript
const provider = new BundlerJsonRpcProvider(url, bundlerRpcUrl);
const ospAccount = new OspAccount(signer, accountFactoryAddress);
const sender = new Sender(provider, ospAccount);

async function main() {
  const userOperationReceipt = await sender.sendUserOperation({
    target: "0x490Dd3cCc7ff94823d4F10bb6d97c7802957e6bf",
    value: 0,
    data: "0x",
  });
  console.log(userOperationReceipt);
}
```
npm package: @open_social_protocol/stakekit-use-inject-provider
Description: React hook for injecting a provider into a react-native-webview
Author: Petar Todorovic
Latest version: 0.0.11

## React hook for injecting a provider into a react-native-webview

Utility hook for injecting EIP-1193 provider in react-native-webview

```bash
npm install @stakekit/use-inject-provider
```

or

```bash
yarn add @stakekit/use-inject-provider
```

or

```bash
pnpm add @stakekit/use-inject-provider
```

Example:

```ts
import React, { useRef } from 'react';
import { StyleSheet } from 'react-native';
import WebView from 'react-native-webview';
import { useInjectProvider } from '@stakekit/use-inject-provider';

// Some EIP1193Provider thats managed by wallet
const provider = new Provider();

export const WebViewStake = () => {
  const webViewRef = useRef<WebView>(null);

  const { injectedJavaScript, onMessage } = useInjectProvider({
    webViewRef,
    provider,
  });

  return (
    <WebView
      ref={webViewRef}
      source={{ uri: 'https://stakek.it' }}
      onMessage={onMessage}
      injectedJavaScript={injectedJavaScript}
      style={styles.container}
      cacheEnabled={false}
    />
  );
};

const styles = StyleSheet.create({
  container: { flex: 1 },
});
```