diff --git a/.gitignore b/.gitignore index cf8d8b2ea..d92341dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ i18n/po/*.mo i18n/crowdin_api_key.txt src/js/translations.js +# Coinbase API ClientID/Secret +coinbase.json +src/js/coinbase.js + # version src/js/version.js diff --git a/Gruntfile.js b/Gruntfile.js index bf463a00b..01406f682 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,6 +7,9 @@ module.exports = function(grunt) { version: { command: 'node ./util/version.js' }, + coinbase: { + command: 'node ./util/coinbase.js' + }, clear: { command: 'rm -Rf bower_components node_modules' }, @@ -75,6 +78,7 @@ module.exports = function(grunt) { 'src/js/controllers/*.js', 'src/js/translations.js', 'src/js/version.js', + 'src/js/coinbase.js', 'src/js/init.js', 'src/js/trezor-url.js', 'bower_components/trezor-connect/login.js' @@ -209,7 +213,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-node-webkit-builder'); grunt.loadNpmTasks('grunt-contrib-compress'); - grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'browserify', 'concat', 'copy:icons']); + grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'exec:coinbase', 'browserify', 'concat', 'copy:icons']); grunt.registerTask('prod', ['default', 'uglify']); grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('test', ['karma:unit']); diff --git a/public/img/coinbase-logo-inverse.png b/public/img/coinbase-logo-inverse.png new file mode 100644 index 000000000..b6470219d Binary files /dev/null and b/public/img/coinbase-logo-inverse.png differ diff --git a/public/img/coinbase-logo.png b/public/img/coinbase-logo.png new file mode 100644 index 000000000..53da54f52 Binary files /dev/null and b/public/img/coinbase-logo.png differ diff --git a/public/views/buyAndSell.html b/public/views/buyAndSell.html new file mode 100644 index 000000000..f38e5772c --- /dev/null +++ b/public/views/buyAndSell.html @@ -0,0 +1,20 @@ +
+
+ +
+ +
diff --git a/public/views/buyCoinbase.html b/public/views/buyCoinbase.html new file mode 100644 index 000000000..ce7eb33dd --- /dev/null +++ b/public/views/buyCoinbase.html @@ -0,0 +1,183 @@ +
+
+ + +
+ +
+
+
+
+
+
+
+
+
+ {{buy.loading}} +
+
+ +
+
+
+
    +
  • +
+
+
+
+ +
+
+ +
+ +
+ + +
+ + + +
+ + + + + BTC + USD +
+ +
+ + Enter the amount to get the exchange rate + + + Not available + + + ~ {{buy.buyPrice.amount * amount | currency : 'USD ' : 2}} + +
+ +
+ +
+ +
+ +
+ + + + +
+
+ +
+ +
+
+
+
+ +
+
+

Funds sent to Copay Wallet

+

+ Buy confirmed. Funds will be send soon to your selected Copay Wallet +

+ +
+
+ +
+

Confirm transaction

+ + +
+
+ +
+
+
+
+
+

Purchase initiated

+

+ Bitcoin purchase completed. Coinbase has queued the transfer to your selected Copay wallet. +

+ + +
+
+ +
+
diff --git a/public/views/coinbase.html b/public/views/coinbase.html new file mode 100644 index 000000000..9883212fc --- /dev/null +++ b/public/views/coinbase.html @@ -0,0 +1,186 @@ + +
+ +
+ +
+ +
+
+
+
+
+
+
+
+
+ Connecting to Coinbase... + {{index.coinbaseLoading}} +
+
+ +
+
+
    +
  • +
+
+
+
+ Your primary account should be a WALLET. Set your wallet account as primary and try again. +
+
+
+ +
+ Or go to Preferences and log out manually. +
+
+
+ +
+
+ + Testnet wallets only work with Coinbase Sandbox Accounts +
+
+
+ +
+
+ +

Connect your Coinbase account to get started

+ + + Connect to Coinbase + +
+ + Do you already have the Oauth Code? + +
+
+
+
+
    +
  • +
+
+
+ + + +
+ +
+
+
+ +
+ +
+ +
+ + + +
+

Activity

+
+
    +
  • +
+
+
+
+ bought + bought + sold + sold +
+ +
+
+ Sold + Bought + + -{{tx.amount.amount.replace('-','')}} + {{tx.amount.currency}} + +
+
+
+
+ Error +
+
+
+ +
+
+ Pending +
+
+
+
+ +
+
+
+ +
+ +
+
diff --git a/public/views/coinbaseUri.html b/public/views/coinbaseUri.html new file mode 100644 index 000000000..b5475440e --- /dev/null +++ b/public/views/coinbaseUri.html @@ -0,0 +1,35 @@ +
+
+ +
+ +
+
+
+
+
+
+
+
+
+ Connecting to Coinbase... +
+
+ +
+
+
+ +
+ +
+
{{coinbase.error}}
+ +
+
+
+
diff --git a/public/views/includes/confirm-tx.html b/public/views/includes/confirm-tx.html index 239ea591a..57f348423 100644 --- a/public/views/includes/confirm-tx.html +++ b/public/views/includes/confirm-tx.html @@ -3,7 +3,7 @@
-

Confirm transaction

+

Send bitcoin

{{tx.amountStr}}
diff --git a/public/views/includes/sidebar.html b/public/views/includes/sidebar.html index 3f2d93506..752e3cbbb 100644 --- a/public/views/includes/sidebar.html +++ b/public/views/includes/sidebar.html @@ -28,14 +28,13 @@
Create, join or import
-
  • - +
  • + -
  • diff --git a/public/views/modals/coinbase-confirmation.html b/public/views/modals/coinbase-confirmation.html new file mode 100644 index 000000000..ad8e7207b --- /dev/null +++ b/public/views/modals/coinbase-confirmation.html @@ -0,0 +1,16 @@ +
    +
    +

    Are you sure you would like to log out of your Coinbase account?

    +

    You will need to log back in to buy or sell bitcoin in Copay.

    +
    + +
    +
    + +
    +
    +
    diff --git a/public/views/modals/coinbase-tx-details.html b/public/views/modals/coinbase-tx-details.html new file mode 100644 index 000000000..c3252dfb4 --- /dev/null +++ b/public/views/modals/coinbase-tx-details.html @@ -0,0 +1,107 @@ + + + diff --git a/public/views/modals/glidera-wallets.html b/public/views/modals/wallets.html similarity index 86% rename from public/views/modals/glidera-wallets.html rename to public/views/modals/wallets.html index 52b4d55e3..47fb14d9a 100644 --- a/public/views/modals/glidera-wallets.html +++ b/public/views/modals/wallets.html @@ -7,8 +7,8 @@

    - Choose your destination wallet - Choose your source wallet + Choose your destination wallet + Choose your source wallet

    diff --git a/public/views/preferencesCoinbase.html b/public/views/preferencesCoinbase.html new file mode 100644 index 000000000..55fc293a2 --- /dev/null +++ b/public/views/preferencesCoinbase.html @@ -0,0 +1,60 @@ +
    +
    + +
    + +
      +

      Account

      +
    • + ID + + {{index.coinbaseAccount.id}} + +
    • +
    • + Name + + {{index.coinbaseAccount.name}} + +
    • +
    • + Balance + + {{index.coinbaseAccount.balance.amount}} {{index.coinbaseAccount.balance.currency}} + +
    • +
    • + Native Balance + + {{index.coinbaseAccount.native_balance.amount}} {{index.coinbaseAccount.native_balance.currency}} + +
    • + +

      User Information

      +
    • + ID + + {{index.coinbaseUser.id}} + +
    • +
    • + Email + + {{index.coinbaseUser.email}} + +
    • +
    +
      +

      +
    • + + Log out +
    • +
    +

    + +
    +
    diff --git a/public/views/preferencesGlobal.html b/public/views/preferencesGlobal.html index 2b80961e5..0af10d193 100644 --- a/public/views/preferencesGlobal.html +++ b/public/views/preferencesGlobal.html @@ -63,13 +63,13 @@
    Enable Glidera Service
  • - -