-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Rts.utxo(addr)
implementaion in BCH-JS backen that was using ol…
…d BITBOX REST endpoint.
- Loading branch information
Showing
15 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import BCHJS from "@chris.troutner/bch-js"; | ||
import { P2PKHFactory } from "@spedn/rts"; | ||
import { BchJsRts } from "@spedn/rts-bchjs"; | ||
import { BitboxRts } from "@spedn/rts-bitbox"; | ||
import { BITBOX } from "bitbox-sdk"; | ||
|
||
const bchjs = new BCHJS({ restURL: "https://testnet3.fullstack.cash/v3/" }); | ||
const bitbox = new BITBOX({ restURL: "https://trest.bitcoin.com/v2/" }); | ||
|
||
describe.each([ | ||
new BchJsRts("testnet", bchjs) | ||
// new BitboxRts("testnet", bitbox) // tREST seems to be dysfunctional | ||
])("%s REST API", rts => { | ||
it("can find coins", async () => { | ||
const factory = new P2PKHFactory(rts); | ||
// testnet : draw parade crater busy book swim soldier tragic exit feel top civil : m/44'/145'/0'/0/3 | ||
const account = factory.fromAddress("bchtest:qzca95r68adkek2we4jvws5dex6pwg3vt52mkhsqjg"); | ||
const [coin] = await account.findCoins("testnet"); | ||
expect(coin).toBeDefined(); | ||
expect(coin).toHaveProperty("utxo.txid"); | ||
expect(coin).toHaveProperty("utxo.vout"); | ||
expect(coin).toHaveProperty("utxo.satoshis"); | ||
expect(coin).toHaveProperty("utxo.height"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -564,27 +564,29 @@ | |
"@sinonjs/commons" "^1.7.0" | ||
|
||
"@spedn/rts-bchjs@../rts-bchjs": | ||
version "1.0.0" | ||
version "3.1.1" | ||
dependencies: | ||
"@chris.troutner/bch-js" "^3.4.1" | ||
"@spedn/rts" "../rts" | ||
"@spedn/rts" "^3.1.1" | ||
|
||
"@spedn/rts-bitbox@../rts-bitbox": | ||
version "1.0.0" | ||
version "3.1.1" | ||
dependencies: | ||
"@spedn/rts" "../rts" | ||
"@spedn/rts" "^3.1.1" | ||
bitbox-sdk "^8.11.2" | ||
|
||
"@spedn/rts@../rts": | ||
version "3.1.0" | ||
"@spedn/rts@^3.1.1": | ||
version "3.1.1" | ||
resolved "https://registry.yarnpkg.com/@spedn/rts/-/rts-3.1.1.tgz#b45b2cb49df994f448aca5c490696f942544699d" | ||
integrity sha512-r3YjixGB/zLXq/kcnypx6oKSVm2fri+LW+PrExB3u/5Tu0gorUieHd33KWaKaSWYam3VKTBeyzPADoAq96EAtw== | ||
dependencies: | ||
lodash "^4.17.20" | ||
varuint-bitcoin "1.1.2" | ||
|
||
"@spedn/sdk@../sdk": | ||
version "1.0.0" | ||
version "3.1.1" | ||
dependencies: | ||
"@spedn/rts" "../rts" | ||
"@spedn/rts" "^3.1.1" | ||
|
||
"@transloadit/[email protected]": | ||
version "0.0.7" | ||
|