# motor-react-native

> React Native bindings for the Sonr Motor Node

Latest version **0.1.11** (published 2022-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install motor-react-native
pnpm add motor-react-native
yarn add motor-react-native
bun add motor-react-native
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2022-06-27 |
| First published | 2022-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sonr Inc. |
| Maintainers | pradn |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/motor-react-native
- Repository: https://github.com/sonr-io/motor-react-native
- Homepage: https://github.com/sonr-io/motor-react-native#readme
- Issues: https://github.com/sonr-io/motor-react-native/issues
- npm.io page: https://npm.io/package/motor-react-native

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.11 (latest) — 2022-06-27
- 0.0.2 — 2022-06-19

## README

# Motor for React-Native

React Native bindings for the Sonr Motor Node.

## Installation

### For a `react-native` project

```sh
npm install motor-react-native
```

### For a `expo` project

1. Eject the `expo` project.

```sh
expo eject

// or

yarn eject
```

2. Install the `motor-react-native` package.*

```sh
npm install motor-react-native
```

3. Embed Motor to your iOS project:
    - Build Phases > Link Binary With Libraries > Add `Motor.xcframework`

4. Run `pod install` in the `ios` directory.

## Usage

```js
import { newWallet } from "motor-react-native";

// ...

const result = await newWallet();
```

## To Do
- [ ] Implement ExportWallet in Swift/Java/JS
- [ ] Implement LoadWallet in Swift/Java/JS
- [ ] Implement Address in Swift/Java/JS
- [ ] Implement DidDoc in Swift/Java/JS
- [ ] Implement ImportCredential in Swift/Java/JS
- [ ] Implement Sign in Swift/Java/JS
- [ ] Implement Verify in Swift/Java/JS

## API Reference

These methods are subject to change, as the library is being actively developed.

| **Method**         | **Description**                                                              |        **Params**        | **Returns** |
|--------------------|------------------------------------------------------------------------------|:------------------------:|:-----------:|
| `NewWallet`        | Create a new mpc wallet                                                      |      Threshold:`int`     |    ERROR    |
| `ExportWallet`     | Marshals wallet to json and returns - TESTING ONLY                           |                          |    BYTES    |
| `LoadWallet`       | Unmarshals the buffer into a wallet                                          |       Buf: `bytes`       |    ERROR    |
| `Address`          | Get wallet address                                                           |                          |    STRING   |
| `DidDoc`           | Get DidDocument of account                                                   |                          |    STRING   |
| `ImportCredential` | Import a webauthn/biometric credential proto bytes into wallet did document  |       Cred:`bytes`       |    ERROR    |
| `Sign`             | Sign a buffer with MPC wallet, completes entire process and returns a tx raw |        Msg:`bytes`       |    BYTES    |
| `Verify`           | Verify a signature of a buffer                                               | Msg:`bytes`, Sig:`bytes` |     BOOL    |

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/motor-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
