Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
feat(wallet): adds wallet feature using xpubs (#27)
Browse files Browse the repository at this point in the history
* Adds new testing suite for testing hardware wallet interactions

* Updates the landing page

* Updates the navigation

* Adds full-featured, semi-stateless wallet for spending from, receiving to, and tracking balances of the deposit and change braids for a given set of xpubs in a multisig wallet

* Adds selectors for better performance in interacting with pieces of the redux state

* Adds ability to import watch-only addresses to private bitcoind node via RPC

* Adds testing suites for e2e and front-end unit tests

Co-authored-by: Dhruv Bansal <[email protected]>
Co-authored-by: Richard Bondi <[email protected]>
Co-authored-by: Walden Raines <[email protected]>
Co-authored-by: Justin Moore <[email protected]>
  • Loading branch information
5 people authored May 20, 2020
1 parent 5b47948 commit 3514039
Show file tree
Hide file tree
Showing 200 changed files with 31,672 additions and 21,692 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"react",
"es2015"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"@commitlint/config-conventional",
"cz"
]
}
59 changes: 59 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const types = [
` feat: A new feature`,
` fix: A bug fix`,
` docs: Documentation only changes`,
` style: Changes that do not affect the meaning of the code
(white-space, formatting, missing semi-colons, etc)`,
` refactor: A code change that neither fixes a bug nor adds a feature`,
` perf: A code change that improves performance`,
` test: Adding missing tests`,
` revert: Revert to a commit`,
` WIP: Work in progress`,
` chore: Changes to the build process or auxiliary tools
and libraries such as documentation generation`
];

const messages = {
type: `Select the type of change that you're committing:`,

subject: `Write a SHORT, IMPERATIVE tense description of the change:\n`,

body: `Provide a LONGER description of the change (optional). Use "|" to break new line:\n`,

breaking: `Describe any BREAKING CHANGES (optional):\n`,

footer: ` List any RELATED ISSUES to this change (optional).\n`,

confirmCommit: `Are you sure you want to proceed with the commit above?`
};

const scopes = [
"card",
"clientpicker",
"createaddress",
"hermit",
"slices",
"testrunner",
"wallet",
"other",
];

module.exports = {
types: types.map((type) => ({
value: type.split(":")[0].trim(),
name: type
})),

scopes: scopes.map((scope) => ({
name: scope
})),

messages,

subjectLimit: 65,
allowCustomScopes: false,
allowTicketNumber: false,
allowBreakingChanges: ["feat", "fix"],
breakingPrefix: "BREAKING CHANGE:",
footerPrefix: "ISSUES:"
};
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// .env

NODE_PATH=src/utils
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
node_modules
package-lock.json
package.json
26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"cypress/globals": true,
"jasmine": true,
"node": true,
"jest": true
},
"plugins": ["prettier"],
"extends": [
"airbnb",
"prettier",
"prettier/react",
"plugin:testing-library/recommended",
"plugin:jest-dom/recommended",
"plugin:cypress/recommended"
],
"rules": {
"prettier/prettier": "error",
"react/jsx-props-no-spreading": "off"
},
"settings": {
"import/core-modules": ["test-utils"]
}
}
16 changes: 0 additions & 16 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
<!--- Provide a general summary of your changes in the Title above -->

## PR Type

<!---
What types of change(s) does your code introduce?
Put an `x` in all the boxes that apply:
-->

* [ ] Bug fix
* [ ] Feature
* [ ] Code style update (whitespace, formatting, missing semicolons, etc.)
* [ ] Refactor (i.e., no functional changes)
* [ ] Build related changes
* [ ] CI related changes
* [ ] Documentation changes
* [ ] Other (please describe below):

## Description

<!---
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ build/

# misc
.DS_Store
junit.xml

# cypress
cypress/videos/
75 changes: 56 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,63 @@
language: node_js
node_js:
- 8

script:
- CI=true npm run build

deploy:
provider: script
script: "npm run deploy"
skip_cleanup: true
on:
tags: true

notifications:
email:
recipients:
- chris@unchained-capital.com
- bugs@unchained-capital.com
on_success: change
on_failure: always

before_deploy:
- git remote set-url origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git config --global user.email "Travis CI<[email protected]>"
- git config --global user.name "TravisCI"

jobs:
include:
- stage: "Tests"
node_js: 8
name: "Node JS 8"
script: npm run test
- node_js: 10
name: "Node JS 10"
script: npm run test
- node_js: 12
name: "Node JS 12"
script: npm run ci
- stage: "Cypress Tests"
node_js: 10
addons:
apt:
packages:
# Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
- libgconf-2-4
cache:
# Caches $HOME/.npm when npm ci is default script commandK
# Caches node_modules in all other cases
npm: true
directories:
# we also need to cache folder with Cypress binary
- ~/.cache
install:
- npm ci
before_script:
- npm run build:ci
# The server from create-react-app doesn't work well with travis
- npm i -g http-server
# Necessary because create-react-app assumes you want to deploy to /caravan
- mkdir ./build/caravan
- shopt -s extglob
- mv ./build/!(caravan) ./build/caravan/
- http-server build -p 3000 -c-1 --silent &
script:
- $(npm bin)/cypress run --env configFile=travis
- stage: build
node_js: 10
script: npm run build:ci
node_js: 12
script: npm run build:ci
before_deploy:
- git remote set-url origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git config --global user.email "Travis CI<[email protected]>"
- git config --global user.name "TravisCI"
deploy:
provider: script
script: "npm run deploy"
skip_cleanup: true
on:
tags: true
branch: master
74 changes: 74 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributing

Contributions are always welcome, no matter how large or small.

**Working on your first Pull Request?** You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

## Project setup

First, [fork](https://guides.github.com/activities/forking) and then clone the caravan repository:

```sh
git clone https://github.com/your-username/caravan
cd caravan
git remote add upstream https://github.com/unchained-capital/caravan
```

Install dependencies:

```sh
npm install
```

Starting caravan locally (this will open caravan in your default browser):

```sh
npm run start
```

## Creating Pull Requests

1. Create a branch:

```sh
git checkout -b my-branch
```

2. Happy Hacking 🎉: Author your awesome code changes.

3. Ensure your changes pass linting and testing:

To test:
```sh
npm test
```

To lint your changes:

```sh
npm run lint
```

4. Commit your changes:

`caravan` uses [commitizen](https://github.com/commitizen/cz-cli) to create commit messages so it can automatically create semantic releases.

```sh
git add .
npm run commit
# answer the questions
```

5. Push your changes:

```sh
git push origin my-branch
```

5. Open [this project on GitHub](https://github.com/unchained-capital/caravan), then click “Compare & pull request”.

## Help needed

Please checkout the open issues for ideas of things to work on.

Also, please watch the repo and respond to questions/bug reports/feature requests, Thanks!
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Caravan - Stateless Multisig Coordinator

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Build Status](https://travis-ci.com/unchained-capital/caravan.svg?branch=master)](https://travis-ci.com/unchained-capital/caravan)
[![dependencies Status](https://david-dm.org/unchained-capital/caravan/status.svg)](https://david-dm.org/unchained-capital/caravan)
[![devDependencies Status](https://david-dm.org/unchained-capital/caravan/dev-status.svg)](https://david-dm.org/unchained-capital/caravan?type=dev)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Caravan is making bitcoin multisig custody easier and safer through
transparency and standards.
Expand Down Expand Up @@ -126,3 +130,7 @@ npm module. Instructions to install and run the module are on its
If you are running a local bitcoind node on your local machine on port 8332,
and you run `corsproxy` with the default settings, you should be able to
point caravan at 'http://localhost:1337/localhost:8332'.

## Contributing

Please see the [`CONTRIBUTING.md`](./CONTRIBUTING.md) and the open [GitHub Issues](https://github.com/caravan/issues).
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 4 additions & 0 deletions cypress/config/development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"baseUrl": "https://localhost:3000/caravan#/",
"chromeWebSecurity": false
}
4 changes: 4 additions & 0 deletions cypress/config/travis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"baseUrl": "http://localhost:3000/caravan/#/",
"chromeWebSecurity": false
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
Loading

0 comments on commit 3514039

Please sign in to comment.