# tsoposki-ptokens-pbtc

> repo holding the code for interacting with pBTC

Latest version **0.2.1-alpha.0** (published 2020-02-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install tsoposki-ptokens-pbtc
pnpm add tsoposki-ptokens-pbtc
yarn add tsoposki-ptokens-pbtc
bun add tsoposki-ptokens-pbtc
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1-alpha.0 |
| Published | 2020-02-18 |
| First published | 2020-02-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 194.8 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | alle.manfredi@gmail.com @provable-things |
| Maintainers | cryptorobot |

## Links

- npm: https://www.npmjs.com/package/tsoposki-ptokens-pbtc
- npm.io page: https://npm.io/package/tsoposki-ptokens-pbtc

## Dependencies (10)

- [chai](https://npm.io/package/chai.md) ^4.2.0
- [web3](https://npm.io/package/web3.md) ^1.2.2
- [axios](https://npm.io/package/axios.md) ^0.19.0
- [web3-utils](https://npm.io/package/web3-utils.md) ^1.2.4
- [bitcoinjs-lib](https://npm.io/package/bitcoinjs-lib.md) ^5.1.6
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.3.1
- [light-async-polling](https://npm.io/package/light-async-polling.md) ^1.0.2
- [web3-core-promievent](https://npm.io/package/web3-core-promievent.md) ^1.2.1
- [tsoposki-ptokens-utils](https://npm.io/package/tsoposki-ptokens-utils.md) ^0.2.1-alpha.0
- [tsoposki-ptokens-enclave](https://npm.io/package/tsoposki-ptokens-enclave.md) ^0.2.1-alpha.0

## Recent versions

- 0.2.1-alpha.0 (latest) — 2020-02-18

## README

# ptokens-pbtc

Module for interacting only with pBTC.

&nbsp;

***

&nbsp;

### Installation:

```
npm install ptokens-pbtc
```

&nbsp;

***

&nbsp;

### Usage:

```js
const pBTC = require('ptokens-pbtc')

const pbtc = new pBTC({
  ethPrivateKey: 'Eth private key',
  ethProvider: 'Eth provider',
  btcNetwork: 'testnet' //'testnet' or 'bitcoin', default 'testnet'
})
```
It is possible to pass a standard Ethereum Provider as the __`ethProvider`__ value, such as the one injected 
into the content script of each web page by Metamask(__`window.web3.currentProvider`__).

```js
const pBTC = require('ptokens-pbtc')

if (window.web3) {
  
  const pbtc = new pBTC({
    ethProvider: window.web3.currentProvider,
    btcNetwork: 'testnet'
  })
} else {
  console.log('No web3 detected')
}
```

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