{"action":"created","issue":{"url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/7","repository_url":"https://api.github.com/repos/Bitcoin-com/wormholecash","labels_url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/7/comments","events_url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/7/events","html_url":"https://github.com/Bitcoin-com/wormholecash/issues/7","id":356208193,"node_id":"MDU6SXNzdWUzNTYyMDgxOTM=","number":7,"title":"Missing BitBox Classes","user":{"login":"christroutner","id":9870991,"node_id":"MDQ6VXNlcjk4NzA5OTE=","avatar_url":"https://avatars0.githubusercontent.com/u/9870991?v=4","gravatar_id":"","url":"https://api.github.com/users/christroutner","html_url":"https://github.com/christroutner","followers_url":"https://api.github.com/users/christroutner/followers","following_url":"https://api.github.com/users/christroutner/following{/other_user}","gists_url":"https://api.github.com/users/christroutner/gists{/gist_id}","starred_url":"https://api.github.com/users/christroutner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christroutner/subscriptions","organizations_url":"https://api.github.com/users/christroutner/orgs","repos_url":"https://api.github.com/users/christroutner/repos","events_url":"https://api.github.com/users/christroutner/events{/privacy}","received_events_url":"https://api.github.com/users/christroutner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-01T14:51:59Z","updated_at":"2018-09-01T22:55:28Z","closed_at":null,"author_association":"NONE","body":"I'm currently working on migrating my Wormhole code from 0.2.4 to the latest version of 0.5.3. I tried using following this [grant.js](https://gist.github.com/cgcardona/68f9247584ca13ca9d3647e736d79033) example, which uses `Wormhole.Address.utxo` Address class inherited from Bitbox, shown on [Line 22](https://gist.github.com/cgcardona/68f9247584ca13ca9d3647e736d79033#file-grant-js-L22).\r\n\r\nTrying to follow that example, I was getting an error trying to use any of the inherited Bitbox classes. The example code below shows that those classes are not attached to the `wormhole` instantiation of `Wormhole`. The result is the same if I use my local wormhole full node, or the bitcoin.com rest service.\r\n\r\n```javascript\r\n// wormholecash version 0.5.3\r\nlet Wormhole = require(\"wormholecash/lib/Wormhole\").default;\r\n//let wormhole = new Wormhole({ restURL: `http://localhost:3000/v1/` });\r\nlet wormhole = new Wormhole({ restURL: `http://trest.bitcoin.com/v1/` });\r\n\r\n// Inspect JavaScript objects.\r\nconst util = require(\"util\");\r\nutil.inspect.defaultOptions = {\r\n  showHidden: true,\r\n  colors: true\r\n};\r\n\r\nconsole.log(`Wormhole: ${util.inspect(Wormhole)}`);\r\nconsole.log(`wormhole.Address: ${util.inspect(wormhole.Address)}`);\r\n\r\n/*\r\nOutput:\r\n  Wormhole: { [Function: Wormhole]\r\n  [length]: 1,\r\n  [name]: 'Wormhole',\r\n  [prototype]: Wormhole { [constructor]: [Circular] } }\r\n  \r\n  wormhole.Address: Address { restURL: 'http://trest.bitcoin.com/v1/' }\r\n*/\r\n```\r\n\r\nThere is every possibility that I'm instantiating thing incorrectly. Please correct me if you see a problem in the code above."},"comment":{"url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/comments/417892893","html_url":"https://github.com/Bitcoin-com/wormholecash/issues/7#issuecomment-417892893","issue_url":"https://api.github.com/repos/Bitcoin-com/wormholecash/issues/7","id":417892893,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzg5Mjg5Mw==","user":{"login":"christroutner","id":9870991,"node_id":"MDQ6VXNlcjk4NzA5OTE=","avatar_url":"https://avatars0.githubusercontent.com/u/9870991?v=4","gravatar_id":"","url":"https://api.github.com/users/christroutner","html_url":"https://github.com/christroutner","followers_url":"https://api.github.com/users/christroutner/followers","following_url":"https://api.github.com/users/christroutner/following{/other_user}","gists_url":"https://api.github.com/users/christroutner/gists{/gist_id}","starred_url":"https://api.github.com/users/christroutner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christroutner/subscriptions","organizations_url":"https://api.github.com/users/christroutner/orgs","repos_url":"https://api.github.com/users/christroutner/repos","events_url":"https://api.github.com/users/christroutner/events{/privacy}","received_events_url":"https://api.github.com/users/christroutner/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T22:55:28Z","updated_at":"2018-09-01T22:55:28Z","author_association":"NONE","body":"Did a bit more sleuthing. This does appear to be an issue with the npm package. Including the wormholecash library at the top of my script like this:\r\n\r\n`let Wormhole = require(\"wormholecash/lib/Wormhole\").default;`\r\n\r\nresults in errors as described above when I execute this command:\r\n\r\n`let rawTx = await wormhole.RawTransactions.create([utxo], {});`\r\n\r\nHowever, that command passes just fine if I install a local clone of the wormholecash repo, build it, and replace the `require` line above with this:\r\n\r\n`let Wormhole = require(\"../../wormholecash/lib/Wormhole\").default`"}}
{"actor":{"display_login":"christroutner"}}