Coder Social home page Coder Social logo

rsbkmr / rn-bdk Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 520 KB

Bitcoin Dev Kit for React Native

License: MIT License

Kotlin 6.27% JavaScript 1.72% Ruby 1.98% Java 12.37% Makefile 1.23% C++ 5.64% TypeScript 4.67% Swift 61.06% C 0.08% Objective-C 2.04% Objective-C++ 2.94%
bitcoin bitcoindevkit react-native wallet

rn-bdk's Introduction

rn-bdk

MIT License

Bitcoin Dev Kit for React Native.

Installation

Install rn-bdk with npm

  npm install rn-bdk

or yarn

  yarn add rn-bdk

Example

import bdk from 'rn-bdk';

// generate extended key
const key = await bdk.generateExtendedKey({});

// or

// restore exteneded key
const key = await bdk.restoreExtendedKey({
  mnemonic: '...',
});

// create descriptor
const descriptor = bdk.createDescriptor({{ xprv: key.xprv }})

// create wallet
await bdk.createWallet({
  descriptor: bdk.createDescriptor({ xprv: key.xprv }),
  changeDescriptor: bdk.createDescriptor({
    xprv: key.xprv,
    change: true,
  }),
});

// get last unused address from wallet
const { address } = await bdk.getAddress();

// set your own node url
await bdk.setBlockchain({ url: 'ssl://electrum.blockstream.info:50002' });

// get transactions
const transactions = await bdk.getTransactions();

// send transaction
const txid = await bdk.send(to, amount);

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

rn-bdk's People

Contributors

rsbkmr avatar

Stargazers

Roman avatar

Watchers

 avatar

rn-bdk's Issues

Publishing to npmjs

Hi @@rsbkme Hope you are well.
You have published the fork to npmjs due to which we are not able to publish the main bdk-rn module. Although you have used rn-bdk as the package name, npmjs still doesn't allow us to publish bdk-rn.
Would you consider removing your package please so that we can ensure the latest and the main version of the bdk-rn is available for everyone to use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.