Giter Site home page Giter Site logo

trezor / trezor.js Goto Github PK

View Code? Open in Web Editor NEW
95.0 25.0 75.0 6.95 MB

:warning: OBSOLETE. DO NOT USE! Use https://github.com/trezor/connect instead

License: GNU Lesser General Public License v3.0

JavaScript 99.38% Makefile 0.62%
trezor javascript bitcoin

trezor.js's Introduction

trezor.js

Build Status

Javascript API for Trezor.

We are currently migrating from this library to Trezor Connect. When Trezor Connect is done and tested, this library will be deprecated.

Right now, you can use this library for integrating into node js apps.

Install with npm

npm install --save trezor.js

Flow

trezor.js is annotated with Flow types; if you want to use Flow and use the previous setup, it will use the right types. Note that you might have to set up .flowconfig to include all the modules and interface files in our flowconfig

to run flow use make flow

Build

to build production bundle run make build

eslint

make eslint

Using trezor.js in a web app

We are winding down trezor.js for web apps. Please use TREZOR Connect.

Using trezor.js in a node app

Trezor.js should be possible to use from node.js if the user has Trezor Bridge installed, because origin URLs are spoofed.

Trezor used to work with node HID API directly, but the binary API and the various node versions got too hard to manage, so we removed them.

trezor.js API

API is explained in API.md

trezor.js's People

Contributors

admin-slush avatar alepop avatar conejoninja avatar jpochyla avatar karelbilek avatar michal-novacek avatar mroz22 avatar ondra-novak avatar peterzen avatar prusnak avatar saleemrashid avatar slush0 avatar starcharles avatar szymonlesisz avatar tomaszorvan avatar vladimirvolek avatar wbobeirne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trezor.js's Issues

Support for arbitrary (non-standard) tx inputs

The TransactionInput type only supports a specific set of input types:

script_type?: 'SPENDADDRESS' | 'SPENDMULTISIG' | 'EXTERNAL' | 'SPENDWITNESS' | 'SPENDP2SHWITNESS';

I need to sign inputs that contain additional logic (eg. op_CHECKSEQUENCEVERIFY). Would it be possible to add support for a script_type NON_STANDARD that require the fields:

redeem_script?: string
witness_script?: string

In order to be able to sign them with the trezor?

Unable to connect to bridge on 21325

I just updated to the newest version of trezord and it appears to be running on port 21325. However, the trezor.js library appears to be trying to contact port 21324. I don't see an easy way of changing that from the api documentation, nor why exactly the ports changed. To be clear, I can successfully browse to localhost:21325 and see the attached device.

See the attached error message:

[trezor-link] Calling BridgeTransport.init( true )
[trezor-link] Error in BridgeTransport.init Error
    at _callee$ (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/trezor-link/lib/bridge/http.js:62:19)
    at tryCatch (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/trezor-link/lib/bridge/http.js:79:191)
    at /Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/trezor-link/lib/bridge/http.js:79:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
[trezor-link] Calling BridgeTransport.init( true )
[trezor-link] Error in BridgeTransport.init { FetchError: request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324
    at ClientRequest.<anonymous> (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324',
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED' }
[trezor-link] Error in FallbackTransport.init { FetchError: request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324
    at ClientRequest.<anonymous> (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324',
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED' }
List error: { FetchError: request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324
    at ClientRequest.<anonymous> (/Users/patwhite/Source/bitalpha/trezor-test-2/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'FetchError',
  message: 'request to https://localback.net:21324 failed, reason: connect ECONNREFUSED 127.0.0.1:21324',
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED' }```

typo on the readme

When one navigates to this repo, the readme summary says:
npm install trezor.js for the browser version.

npm install trezor.js-node for the browser version.

I assume the latter should be "for node version" or similar, instead of having 2 browser versions.

Refactoring session.js

While added new coins functionality to Session class (eth, lisk, nem... ) it becomes bigger and bigger and has a lot of same methods with different names. To avoid this type of mess, I suggest moving altcoins logic to separate classes and extend Session with it on initialization process. We can extend session object with all altcoins methods, this will allow using trezor.js API like how it is now, or move each altcoin logic to the namespace.
How it looks now:
session.liskGetAddress
How it can looks:

  1. session.lisk.getAddress
  2. session.altcoins.liskGetAddress

Hi, I'm having trouble with the resetDevice function

Sorry for the dumb question, but I can't figure it out. I'm trying to call a resetDevice function, bunt when I send a Cancel to it, it does not end the Promise, not call the release and get stuck. Someone?

Example missing

Readme says:
Example of usage is on example-browser/, example-node/ and example-electron-webpack/ on github.

However in the example folder there is only one example.js

regeneratorRuntime is not defined

When I try to require trezor.js i get the following error message:

trezor/node_modules/trezor.js-node/lib/device.js:297
            var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(session) {
                                                       ^

ReferenceError: regeneratorRuntime is not defined
    at .../trezor/node_modules/trezor.js-node/lib/device.js:297:56
    at .../trezor/node_modules/trezor.js-node/lib/device.js:341:10
    at Object.<anonymous> (.../trezor/node_modules/trezor.js-node/lib/device.js:780:2)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)

i just used npm install trezor.js

Ability to check if Trezor connection is available

Currently, if connection cannot be established (either due to device not connected or support not available) the error callback on DeviceList will return with:
Error: Loading timed out

That is because the load order as of 4.1.0 is chrome, bridge, plugin and the plugin has the error message.

I am displaying messages (and errors) on DeviceList events via Toastr, which is working nicely. However this one error is a bit confusing as in many cases I shouldn't display it.

It is possible to check for that given message and not display it, but there must be a better solution.

I think another event, such as notsupported would be better, while keeping other errors in the error event.

bchaddrjs missing from package.json

bchaddrjs is imported here:

import bchaddr from 'bchaddrjs';
but is not located in package.json dependencies. This causes the following error:

ERROR in ./node_modules/trezor.js/lib/utils/signbjstx.js
Module not found: Error: Can't resolve 'bchaddrjs' in 
  '/<redacted>/node_modules/trezor.js/lib/utils'

It can be fixed by installing the dependency yourself, but it should be included in trezor.js' package.json

Possible light-weight js library

I would like my web app to be able to connect to trezord-go so that I can enumerate my accounts and potentially sign transactions. I compiled trezor.js using browserify and it resulted in a 2Mb bundle (1.2Mb compressed). That seems quite high. Is it possible to get a simplified version that just does the basics? Or would it not save much?

Unable to install on node v10

Tried installing library on new node v10.1
exited with the error about node-hid.

It seems to me node-hid can't be compiled for node v10.

as a workaround downgraded to node v9

fsm.c:218:Failed to derive private key

I get this error when i try to create NEM address
code:

device.waitForSessionAndRun(function (session) {
        //bip44id for NEM Coin
        var network=104;
       return session.nemGetAddress([
        (44 | hardeningConstant) >>> 0,
        (43| hardeningConstant) >>> 0,
        (0 | hardeningConstant) >>> 0,
        0,
        0
        ],network,false);
});

Connected 'unacquired'

I am wondering if this is desired behaviour or I am doing something wrong. Pages shouldn't be refreshed while being connected, but it can and will happen.

I have the following scenario (using code based on the 'list example')

  • Device is connected and displays the signMessage() state (connect is emitted)
  • Cancel the signing with the button and wait till all the callbacks execute (the error catch in the promise is called)
  • Do not disconnect the device
  • Refresh browser page (e.g. reload the code)
  • Issue: at this stage it won't be connected, see the messages below (connect is not emitted)
  • Unplugging and plugging it again makes it to connect properly (it emits the disconnect event with an undefined device, then everything goes normal)

After refreshing:

[trezor] Attempting to load Chrome Extension transport at jcjjhjgimijdkoamemaghajlhegmoclj
trezor.js:1986 [trezor] Loaded Chrome Extension transport
trezor.js:346 Connected unacquired

And it just stays here, nothing will happen.

After unplugging the Trezor:

Disconnected a device: undefined

This is my callback on the disconnect event:

list.on('disconnect', function (device) {
    console.log('Disconnected a device:', device);
});

After plugging in the Trezor again:

[trezor] Sending Initialize Object {}
trezor.js:1728 [trezor] Received Features Object {vendor: "bitcointrezor.com", major_version: 1, minor_version: 2, patch_version: 1, bootloader_mode: null…}
trezor.js:1321 [trezor] Releasing session
app.js:123364 Connected a device: Device {_events: Object, _maxListeners: undefined, transport: ChromeExtensionTransport, path: 119, deviceList: DeviceList…}
app.js:123365 Devices: [Device]
trezor.js:1722 [trezor] Sending Initialize Object {}
trezor.js:1728 [trezor] Received Features Object {vendor: "bitcointrezor.com", major_version: 1, minor_version: 2, patch_version: 1, bootloader_mode: null…}

I guess in the unacquired state, it might be possible to do a cleanup (what would happen prior the disconnected event) to get it working?

Error: Cannot read TXMETA from signed transaction

I am signing bitcoin transaction at testnet using signTx(). I am getting this issue, any help from team will be appreciated.

  var inputs=[];
      var outputs=[];  
    var tx = new bitcore.Transaction() //using litecore-lib to create a transaction
    .from(requestData.utxos)
    .to(requestData.toAddress, requestData.amountToSend) 
    .fee(requestData.trxFee)
    .change(requestData.fromAddress);
    var hardeningConstant = 0x80000000;
    var address_n=[(44 | hardeningConstant) >>> 0,(requestData.bip44id | hardeningConstant) >>> 0,
      (0 | hardeningConstant) >>> 0,
      0,
      requestData.accountIndex
    ]
    for(var i=0;i<tx.inputs.length;i++){
      var inputObj={
        address_n: address_n,
        prev_index: 0,
        amount:tx.inputs[i].output.satoshis,
        prev_hash: "0x"+"11279cc9565685f92bd5b784e588cf99c6dbd3f36aa86a4339ef42a05b96da7f",//Dogecoin.Util.bytesToHex (tx.inputs[i].prevTxId),
        script_type: 'SPENDADDRESS',
    };
    inputs.push(inputObj);
    }
    for(var i=0;i<tx.outputs.length;i++){
    if(i==0){
      var outputObj={
        script_type: 'SPENDADDRESS',
        amount: tx.outputs[i].satoshis,
        address: requestData.toAddress
    }
  }
  if(i==1){
    var outputObj={
      script_type: 'SPENDADDRESS',
      amount: tx.outputs[i].satoshis,
      address: requestData.fromAddress
  }
}
outputs.push(outputObj);
    }
   data.inputs=inputs;
   data.outputs=outputs;
      this.getTrxInsOutsTest(trxInsOutsUrl).then(function(response){
          var result=response["data"];
          data.txs=result["txs"];
         // data.inputs=result["txs"][0]["inputs"];
         // data.outputs=result["txs"][0]["out"];    
          opoloUsbService.signTx(data);
        },(error)=>console.log(error));
    

Recommended way to interface directly with bridge if this library is no longer being supported?

This library is relied upon by https://frame.sh, which runs locally on the user's machine. We've been using trezor.js to talk to Trezor Bridge and support all Trezor devices after the node-hid integration also became unsupported. If this library is no longer being maintained, what is the recommended way to interface directly with the bridge? We need to be able to interface to multiple devices at once and cannot support popup UI flows. Thank you for any info!

Pinpad callback

In the example the pinpad callback is defined as:

function pinCallback(type, callback) {
    // We should ask the user for PIN and send it back as '1234', where 1 is the
    // top left position, 2 is the top middle position, etc.
    throw new Error('Nothing defined');
}

However while implementing an app, all my PINs were rejected. Looking at the mytrezor.com PIN popup it seems like that the layout is:

789
456
123

Doing the callback based on that works. Is only the example wrong or something else is going on?

(I have also opensourced a React component for this: https://github.com/axic/trezor-react-pinpad)

Incoming m-of-n transaction resulted in a loop of fail

Hey, first of all, hope I'm right here (given the many repos).

It seems to be the case that a m-of-n multisig transaction ultimately resulted in a neverending loop with the following error. Testnet, firmware: 1.2.1, running on Chrome 36.0.1 on Win 8.1.

I was not able to reproduce the freeze, but it's in the log each time I reload the wallet overview on test.mytrezor.com:

[account] Analysis failed for tx fc87d26fb63ab3c33e9128ee115d9ad6387c8206ca6d63e19e0b4957271b2f25 with: Error: Encountered non-standard scriptPubKey
    at Script.simpleOutHash (https://test.mytrezor.com/scripts/236e24b4.libs.js:7:8779)
    at b.analyze (https://test.mytrezor.com/scripts/236e24b4.libs.js:7:15456)
    at https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:13835
    at Array.forEach (native)
    at j._analyzeTxs (https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:13783)
    at j._processTransactionsUpdate (https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:12241)
    at k (https://test.mytrezor.com/scripts/236e24b4.libs.js:12:13522)
    at https://test.mytrezor.com/scripts/236e24b4.libs.js:12:14183
    at k.$eval (https://test.mytrezor.com/scripts/236e24b4.libs.js:12:19418)
    at k.$digest (https://test.mytrezor.com/scripts/236e24b4.libs.js:12:17943)
TypeError: Cannot read property 'type' of null
    at d (https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:14369)
    at https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:14182
    at Array.reduce (native)
    at https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:14150
    at Array.sort (native)
    at j._balanceTxs (https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:14436)
    at j._processTransactionsUpdate (https://test.mytrezor.com/scripts/50c5b593.scripts.js:2:12308)
    at k (https://test.mytrezor.com/scripts/236e24b4.libs.js:12:13522)
    at https://test.mytrezor.com/scripts/236e24b4.libs.js:12:14183
    at k.$eval (https://test.mytrezor.com/scripts/236e24b4.libs.js:12:19418)
[account] Received txs update for Account #1
[account] Analysis failed for tx fc87d26fb63ab3c33e9128ee115d9ad6387c8206ca6d63e19e0b4957271b2f25 with: Error: Encountered non-standard scriptPubKey
    at Script.simpleOutHash (https://test.mytrezor.com/scripts/236e24b4.libs.js:7:8779)
    at b.analyze (https://test.mytrezor.com/scripts/236e24b4.libs.js:7:15456)
...

During the total freeze this was repeated until I manually forced a stop and unplugged the device.

Generating receiver addresses

I want to be able to generate a lot of receiver addresses that I can associate with users of my site (created of individual transactions or "invoices" as recommended in bitcoin documentation).

From reading through the trezor user documentation, there's a way to generate a new address to be used for different things, but I'd like to be able to generate bulk addresses that I can then use later. I see there is a session.getAddress api call, but I'm a little confused as to how this works. Is this the same as generating the new address and the "path" is just the coin type?

Are there any other ways that I can generate the addresses dynamically while the trezor device is disconnected?

Thanks for the help... I should be receiving my device soon so I'll be able to try this out first hand.

Generate bitcoin address?

I am generating bitcoin address like way, is it right with derivation path?

var bip44id=0//0 for bitcoin, 2 for litecoin
var accountIndex=0//it may be any number starting from zero
 var address_n=[
                (44 | hardeningConstant) >>> 0,
                (bip44id | hardeningConstant) >>> 0,
                (0 | hardeningConstant) >>> 0,
                0,
                accountIndex
            ];
        getAddress(address_n,coinName,false);


```but how can i use this path,
`44'/c'/a'/y/i`
if i use then what is c,a,y,i in it.




No 'Access-Control-Allow-Origin' header is present on the requested resource

Hi,

im using a Trezor device to sign transactions and then send it to a ethereum network.

I have successfully sign and send transactions to truffle, ropste, go-ethereum nodes, etc when using the device from Linux (using the trezor bridge or the chrome extention)

On Windows, i get this error:

Failed to load http://mynetworkip:blockchainport/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mynetworkip' is therefore not allowed access.

Im using trezor connect js from a single page application built with reactjs

If i run the SPA locally, on localhost:3000 i get no errors..

any idea of why is this happening and only happens on windows?

waitForSessionAndRun won't work after an error (at least for signMessage)

I'm not entirely sure this is a problem for all calls, but it does happen for signMessage.

The sample code:

    trezorDevice.waitForSessionAndRun(function (session) {
      console.log('Calling signMessage');
      var addr = bippath.fromString(trezorDefaultPath).toTrezor();
      var message = 'test';
      return session.signMessage(addr, new Buffer(message).toString('hex'), { coin_name: 'Bitcoin' });
    })
    .then(function (result) {
      console.log('Result from signMessage', result.message.signature);
    })
    .catch(function (error) {
      console.error('Trezor call (signMessage) rejected:', error);
    })

If everything goes well, this code can be called multiple times. If an error happens, signMessage will stall, no matter how many times it is called.

Both of these errors cause this behaviour:

Trezor call (signMessage) rejected: Object {code: "Failure_ActionCancelled", message: "Sign message cancelled"}
Trezor call (signMessage) rejected: Object {code: "Failure_PinCancelled", message: "PIN Cancelled"}

From this point on only reconnecting the device helps.

Flow vs Typescript

What about to switch to support typescript as it is more common in the Javascript space.
Just wanted to raise the discussion before, I maybe invest my time in create a typescript'ed version of this repo :)

Node js v8 throws babel error trezor.js v6.17.6

Please advice

Code

'use strict';

// installed from npm
var trezor = require('trezor.js');

var debug = true;
var list = new trezor.DeviceList();

console.log(list)
module.js:487
    throw err;
    ^

Error: Cannot find module 'babel-runtime/regenerator'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/www/html/trezor-node-app/node_modules/trezor.js/lib/session.js:8:20)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

signMessage is returning incorrect signature

We try to sign a message with this piece:

function getAddressPath(index) {
  var hardeningConstant = 0x80000000;
  return [
    40,
    (0 | hardeningConstant),
    (0 | hardeningConstant),
    0,
    index
  ]
}

runWithTrezorSession(function (session) {
  return session.signMessage(getAddressPath(parseInt(accountIndex)), message, 'Bitcoin', false)
    .then(function (result) {
      console.log('Address:', result.message.address);
      console.log('Signature:', result.message.signature);
      console.log('Base64 Signature:', Buffer.from(result.message.signature, "hex").toString('base64'))
      process.exit();
    })
});

What we get is always the incorrect result.
For example, in an attempt signing Yes, we get:

Address: 1JpuhENnetCt6DbkygLYnNwiREuheFkjH2
Signature: 1f92233d0b922ad724c2a4d93f338a567758a15c8eb207eb4c477dc05e1bdceee6218b16113a02d8167d7614fe000491d66909bba38b3b7b6ef777b3966b9eb430
Base64 Signature: H5IjPQuSKtckwqTZPzOKVndYoVyOsgfrTEd9wF4b3O7mIYsWEToC2BZ9dhT+AASR1mkJu6OLO3tu93ezlmuetDA=

But that signature is incorrect when verify with bx or https://tools.bitcoin.com/verify-message/

insufficient funds for gas * price + value

{v: 41, r: "6bf92ebeda9154e0b5a712958688567c289f75e15461d3db9d3eea57c3249881", s: "0068d2b442fed991aeaa09c92204744fa2b694cfd7d5262652f24f0585fe8d57"}r: "6bf92ebeda9154e0b5a712958688567c289f75e15461d3db9d3eea57c3249881"s: "0068d2b442fed991aeaa09c92204744fa2b694cfd7d5262652f24f0585fe8d57"v: 41__proto__: Object
transactionService.js:441 0xf86a80850737be7600825208948af6b8fa24314d2eae3bf804323a02a3bffa7af88711c37937e080008029a06bf92ebeda9154e0b5a712958688567c289f75e15461d3db9d3eea57c32498819f68d2b442fed991aeaa09c92204744fa2b694cfd7d5262652f24f0585fe8d57
transactionService.js:450 Error: insufficient funds for gas * price + value
    at Object.InvalidResponse (web3.min.js:1)
    at web3.min.js:1
    at XMLHttpRequest.r.onreadystatechange (web3.min.js:1)

When signing bitcoin tx

 var inputs = [{
    address_n: address_n,
    prev_index: 0,
    prev_hash: 'a29a7084f6d74d1eb2ae7c92695279d42f31ce4fb3651c2cbb5c7767dab1d220'
}];
var outputs = [{
    address_n: address_n,
    amount: 13943185,
    script_type: 'PAYTOADDRESS'
}, {
    address: 'myrm2aoP2zREDA6xASbCSRqdpnmrdtvUDA',
    amount: 5000000,
    script_type: 'PAYTOADDRESS'
}];
var coinName="bitcoin"
signTx(inputs, outputs, txs, , locktime, overwinter);
//All parameters are known but not sure about txs where to get it.?
Kindly help in this regard.

Invalid coin name

I get this error when trying to create addresses for the following coin using this method.
//for like BCH:145

var hardeningConstant = 0x80000000;
        return device.waitForSessionAndRun(function (session) { 
            return session.getAddress([
                (44 | hardeningConstant) >>> 0,
                (145| hardeningConstant) >>> 0,
                (0 | hardeningConstant) >>> 0,
                0,
                0
            ], "Bitcoin Cash", false)
        })

Bitcoin Cash
Bitcoin Gold
MonaCoin
ZCoin
FujiCoin
Pesetacoin

Note:Does trezor support above coins?

Trying to use device after release.

when i call reset device function. i get this error.

var settings={
        strength: null,
        passphrase_protection:false,
        pin_protection: false,
        label: "Reset Device",
        language: "english",
        u2f_counter: 2,
        skip_backup: false };
        list.stealFirstDevice().then(function(device){
         device.waitForSessionAndRun(function(session){
         session.resetDevice(settings).then(function(response){
         console.log(response);
         },(error)=>console.log(error));
        });
    });

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.