# @gamedust-ph/presendsnap

> Metamask snap to manage your bitcoin

Latest version **0.4.4** (published 2022-08-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @gamedust-ph/presendsnap
pnpm add @gamedust-ph/presendsnap
yarn add @gamedust-ph/presendsnap
bun add @gamedust-ph/presendsnap
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.4 |
| Published | 2022-08-22 |
| First published | 2022-08-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 673.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joseph Christopher Pimentel pimentjc@thegamedust.com |
| Maintainers | gamedust-ph |

## Links

- npm: https://www.npmjs.com/package/@gamedust-ph/presendsnap
- Repository: https://github.com/gamedust-ph/presendsnap
- Homepage: https://github.com/gamedust-ph/presendsnap#readme
- Issues: https://github.com/gamedust-ph/presendsnap/issues
- npm.io page: https://npm.io/package/@gamedust-ph/presendsnap

## Dependencies (3)

- [bip32](https://npm.io/package/bip32.md) ^2.0.6
- [bitcoinjs-lib](https://npm.io/package/bitcoinjs-lib.md) ^6.0.1
- [@metamask/snaps-cli](https://npm.io/package/@metamask/snaps-cli.md) ^0.18.0

## Recent versions

- 0.4.4 (latest) — 2022-08-22
- 0.4.3 — 2022-08-22
- 0.4.2 — 2022-08-22
- 0.4.1 — 2022-08-22
- 0.4.0 — 2022-08-22

## README

# `btcsnap`

[![0.3.1](https://badge.fury.io/js/btcsnap.png)](https://badge.fury.io/js/btcsnap)

btcsnap help you manage your bitcoin on Metamask Flask

## Snap Introducion
For more about snap, please fellow metamask snap guide [here](https://docs.metamask.io/guide/snaps.html)

### Usage

1. Enable this snap on your dapp

```
const result: boolean = await ethereum.request({
    method: 'wallet_enable',
    params: [
      {
        wallet_snap: { "npm:btcsnap": {} },
      },
    ],
  });
```

2. get extended your extended public keys

```
const result: string = await ethereum.request({
    method: 'wallet_invokeSnap',
    params: [
      "npm:btcsnap",
      {
        method: 'btc_getPublicExtendedKey',
        params: {
          network: "Main" // for testnet use "Test" ,
        },
      },
    ],
  });
```

3. sign Psbt

```
const result: { txId:string, txHex:string } = await ethereum.request({
      method: 'wallet_invokeSnap',
      params: [
        snapId,
        {
          method: 'btc_signPsbt',
          params: {
            psbt: base64Psbt // base64 string for the pbst,
            network: "Main" // for testnet use "Test",
          },
        },
      ],
    })
```


### Build

For Build the snap and test your snap locally please run

```
yarn rebuild
```

### Test

For run all tests run the following command:
```
yarn test
```

## Live Example

If you would like to use this snap on your dapp, you can follow the code on [here](https://github.com/KeystoneHQ/btcsnap/tree/master/packages/example)

---
_Source: https://npm.io/package/@gamedust-ph/presendsnap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
