0.1.11 • Published 2 years ago

motor-react-native v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Motor for React-Native

React Native bindings for the Sonr Motor Node.

Installation

For a react-native project

npm install motor-react-native

For a expo project

  1. Eject the expo project.
expo eject

// or

yarn eject
  1. Install the motor-react-native package.*
npm install motor-react-native
  1. Embed Motor to your iOS project:

    • Build Phases > Link Binary With Libraries > Add Motor.xcframework
  2. Run pod install in the ios directory.

Usage

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.

MethodDescriptionParamsReturns
NewWalletCreate a new mpc walletThreshold:intERROR
ExportWalletMarshals wallet to json and returns - TESTING ONLYBYTES
LoadWalletUnmarshals the buffer into a walletBuf: bytesERROR
AddressGet wallet addressSTRING
DidDocGet DidDocument of accountSTRING
ImportCredentialImport a webauthn/biometric credential proto bytes into wallet did documentCred:bytesERROR
SignSign a buffer with MPC wallet, completes entire process and returns a tx rawMsg:bytesBYTES
VerifyVerify a signature of a bufferMsg:bytes, Sig:bytesBOOL

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT