@thorwallet/xchain-bitcoin
Advanced tools
Comparing version 0.1.0-lazy.0 to 0.1.1-lazy.0
@@ -0,1 +1,34 @@ | ||
# v.0.17.0 (2022-01-05) | ||
## Breaking change | ||
- Make `haskoinUrl` configurable (change default haskoin url back to `https://api.haskoin.com/btc`) | ||
- `haskoinUrl` needs to be passed as parameter into misc. `utils` functions | ||
# v.0.16.0 (2021-12-29) | ||
## Breaking change | ||
- Add stagenet environment handling for `Network` and `BaseXChainClient` changes client to default to mainnet values until stagenet is configured. | ||
# v.0.15.13 (2021-11-12) | ||
- updated haskoin api URL | ||
# v.0.15.12 (2021-09-03) | ||
- updated to the latest dependencies | ||
# v.0.15.11 (2021-07-07) | ||
- Use latest `xchain-client@0.10.1` + `xchain-util@0.3.0` | ||
# v.0.15.10 (2021-07-03) | ||
- refactored client methods to use regular method syntax (not fat arrow) in order for bcall to super.xxx() to work properly | ||
# v.0.15.9 (2021-06-29) | ||
- added support for pulling fees from thornode. | ||
# v.0.15.8 (2021-06-18) | ||
@@ -2,0 +35,0 @@ |
@@ -0,0 +0,0 @@ import { BroadcastTxParams } from './types/common'; |
@@ -1,3 +0,3 @@ | ||
import { TxHistoryParams, TxsPage, Address, XChainClient, Tx, TxParams, TxHash, Network, Fees, XChainClientParams } from '@thorwallet/xchain-client'; | ||
import { FeesWithRates, FeeRate, FeeRates, Signature } from './types/client-types'; | ||
import { Address, Fees, Tx, TxHistoryParams, TxsPage, XChainClient, TxParams, TxHash, Network, XChainClientParams } from '@thorwallet/xchain-client'; | ||
import { ClientUrl, FeeRate, FeeRates, FeesWithRates, Signature } from './types/client-types'; | ||
/** | ||
@@ -14,2 +14,3 @@ * BitcoinClient Interface | ||
blockstreamUrl?: string; | ||
haskoinUrl?: ClientUrl; | ||
}; | ||
@@ -25,3 +26,3 @@ /** | ||
private rootDerivationPaths; | ||
private addrCache; | ||
private haskoinUrl; | ||
/** | ||
@@ -33,3 +34,3 @@ * Constructor | ||
*/ | ||
constructor({ network, sochainUrl, blockstreamUrl, rootDerivationPaths, }: BitcoinClientParams); | ||
constructor({ network, sochainUrl, blockstreamUrl, haskoinUrl, rootDerivationPaths, }: BitcoinClientParams); | ||
/** | ||
@@ -109,14 +110,2 @@ * Set/Update the sochain url. | ||
/** | ||
* Get the current address. | ||
* | ||
* Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF) | ||
* The address is then decoded into type P2WPKH and returned. | ||
* | ||
* @returns {Address} The current address. | ||
* | ||
* @throws {"Phrase must be provided"} Thrown if phrase has not been set before. | ||
* @throws {"Address not defined"} Thrown if failed creating account from phrase. | ||
*/ | ||
getAddress: (index?: number) => Promise<Address>; | ||
/** | ||
* @private | ||
@@ -123,0 +112,0 @@ * Get private key. |
@@ -0,0 +0,0 @@ /** |
import { Network } from './client'; | ||
export declare const getBalance: (network: Network, address: string) => Promise<import("../../xchain-client/lib").Balance[]>; | ||
export declare const getBalance: ({ network, address }: { | ||
network: Network; | ||
address: string; | ||
}) => Promise<import("../../xchain-client/lib").Balance[]>; |
@@ -17,4 +17,13 @@ import { Address } from '@thorwallet/xchain-client/lib'; | ||
}; | ||
export declare const getBalance: (address: string) => Promise<BaseAmount>; | ||
export declare const getUnspentTxs: (address: string) => Promise<UtxoData[]>; | ||
export declare const getConfirmedUnspentTxs: (address: string) => Promise<UtxoData[]>; | ||
export declare const getBalance: ({ haskoinUrl, address, }: { | ||
haskoinUrl: string; | ||
address: string; | ||
}) => Promise<BaseAmount>; | ||
export declare const getUnspentTxs: ({ haskoinUrl, address, }: { | ||
haskoinUrl: string; | ||
address: string; | ||
}) => Promise<UtxoData[]>; | ||
export declare const getConfirmedUnspentTxs: ({ haskoinUrl, address, }: { | ||
haskoinUrl: string; | ||
address: string; | ||
}) => Promise<UtxoData[]>; |
@@ -0,1 +1,3 @@ | ||
export { getAddress } from './get-address'; | ||
export { getBalance } from './get-balance'; | ||
export * from './types'; | ||
@@ -2,0 +4,0 @@ export * from './client'; |
@@ -0,0 +0,0 @@ import { LedgerTxInfo, LedgerTxInfoParams } from './types/ledger'; |
@@ -0,0 +0,0 @@ import { BtcAddressUTXOs, BtcAddressDTO, Transaction, AddressParams, TxHashParams, TxConfirmedStatus } from './types/sochain-api-types'; |
@@ -26,1 +26,2 @@ import { Address, FeeOptionKey, Fees, Network } from '@thorwallet/xchain-client'; | ||
}; | ||
export declare type ClientUrl = Record<Network, string>; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
export * from './client-types'; | ||
export * from './common'; | ||
export * from './ledger'; |
@@ -13,2 +13,3 @@ import { Address, Network, TxParams } from '@thorwallet/xchain-client'; | ||
sochainUrl: string; | ||
haskoinUrl: string; | ||
}; |
@@ -89,2 +89,3 @@ import { Network, TxHash } from '@thorwallet/xchain-client'; | ||
sochainUrl: string; | ||
haskoinUrl: string; | ||
network: Network; | ||
@@ -91,0 +92,0 @@ address: string; |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
import { FeeRate, FeesWithRates } from './types/client-types'; | ||
import { BroadcastTxParams, UTXOs } from './types/common'; | ||
import { BroadcastTxParams, UTXO, UTXOs } from './types/common'; | ||
export declare const BTC_DECIMAL = 8; | ||
@@ -72,3 +72,3 @@ /** | ||
*/ | ||
export declare const scanUTXOs: ({ sochainUrl, network, address, confirmedOnly, }: ScanUTXOParam) => Promise<UTXOs>; | ||
export declare const scanUTXOs: ({ sochainUrl, haskoinUrl, network, address, confirmedOnly, }: ScanUTXOParam) => Promise<UTXOs>; | ||
/** | ||
@@ -80,3 +80,3 @@ * Build transcation. | ||
*/ | ||
export declare const buildTx: ({ amount, recipient, memo, feeRate, sender, network, sochainUrl, spendPendingUTXO, }: TxParams & { | ||
export declare const buildTx: ({ amount, recipient, memo, feeRate, sender, network, sochainUrl, haskoinUrl, spendPendingUTXO, }: TxParams & { | ||
feeRate: FeeRate; | ||
@@ -86,6 +86,7 @@ sender: Address; | ||
sochainUrl: string; | ||
haskoinUrl: string; | ||
spendPendingUTXO?: boolean | undefined; | ||
}) => Promise<{ | ||
psbt: Bitcoin.Psbt; | ||
utxos: UTXOs; | ||
utxos: UTXO[]; | ||
}>; | ||
@@ -92,0 +93,0 @@ /** |
{ | ||
"name": "@thorwallet/xchain-bitcoin", | ||
"version": "0.1.0-lazy.0", | ||
"version": "0.1.1-lazy.0", | ||
"description": "Custom Bitcoin client and utilities used by XChainJS clients", | ||
@@ -13,4 +13,3 @@ "keywords": [ | ||
"main": "lib/index.js", | ||
"module": "lib/index.esm.js", | ||
"typings": "lib/index.d.ts", | ||
"types": "lib/index.d.ts", | ||
"directories": { | ||
@@ -29,3 +28,3 @@ "lib": "lib", | ||
"clean": "rimraf lib/**", | ||
"build": "yarn clean && rollup -c", | ||
"build": "tsc", | ||
"test": "jest", | ||
@@ -37,9 +36,11 @@ "lint": "eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0", | ||
"devDependencies": { | ||
"@thorwallet/xchain-client": "0.1.0-lazy.0", | ||
"@thorwallet/xchain-crypto": "0.1.0-lazy.0", | ||
"@thorwallet/xchain-util": "0.1.0-lazy.0", | ||
"@thorwallet/xchain-client": "^0.1.1-lazy.0", | ||
"@thorwallet/xchain-crypto": "^0.1.1-lazy.0", | ||
"@thorwallet/xchain-util": "^0.1.1-lazy.0", | ||
"@types/bitcoinjs-lib": "^5.0.0", | ||
"@types/wif": "^2.0.1", | ||
"axios": "^0.21.0", | ||
"axios-mock-adapter": "^1.19.0", | ||
"@types/wif": "^2.0.2", | ||
"axios": "^0.21.1", | ||
"axios-mock-adapter": "^1.20.0" | ||
}, | ||
"dependencies": { | ||
"bitcoinjs-lib": "^5.2.0", | ||
@@ -53,3 +54,3 @@ "coinselect": "^3.1.12", | ||
"@thorwallet/xchain-util": "0.0.1-alpha.869+49db531", | ||
"axios": "^0.21.0", | ||
"axios": "^0.21.1", | ||
"bitcoinjs-lib": "^5.2.0", | ||
@@ -62,3 +63,3 @@ "coinselect": "^3.1.12", | ||
}, | ||
"gitHead": "225d9a291955c53caa553410986334369fda6d22" | ||
"gitHead": "0dc4d61a742de600168a09b1c3ca521c590a9432" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7
51
7684923
10
87204
+ Addedbitcoinjs-lib@^5.2.0
+ Addedcoinselect@^3.1.12
+ Addedwif@^2.0.6