![bark: Ark on bitcoin](https://gitlab.com/ark-bitcoin/bark-ffi-bindings/-/raw/master/react-native/assets/bark-react-native-header-white.jpg)

<div align="center">
  <h1>bark-react-native</h1>
  <p>React Native bindings for Bark</p>
</div>

<br />

Bark is an implementation of the Ark protocol on bitcoin, led by [Second](https://second.tech). The Ark protocol is a bitcoin layer 2 for making fast, low-cost, self-custodial payments at scale. Ark uses a client-server model to enable users to transact off-chain while still being able to "exit" their balances on-chain at any time.

## Installation

### Expo

1. Install the package:

```bash
npx expo install @secondts/bark-react-native
```

2. Add the plugin to `app.json` or `app.config.js`:

```json
{
  "expo": {
    "plugins": ["@secondts/bark-react-native"]
  }
}
```

Warning: If you are using pnpm v10+, run `pnpm approve-builds` and select `@secondts/bark-react-native` to allow the postinstall script to download the prebuilt native binaries.

3. Run prebuild

```bash
npx expo prebuild
```

Note: `bark-react-native` contains native code and requires a development build. It will not work with Expo Go.

### Bare React Native

1. Install the package

```bash
npm install @secondts/bark-react-native
```

Note: If you are running on iOS, navigate into the `ios` folder and run `pod install`.

### Beta/Pre-release Versions

To install a beta or pre-release version:

```bash
# Install latest beta
npx expo install @secondts/bark-react-native@beta
```

```bash
# Or install a specific beta version
npx expo install @secondts/bark-react-native@0.10.0
```

For bare React Native projects, use:

```bash
npm install @secondts/bark-react-native@beta
```

## License

Released under the **MIT** license.
