@xchainjs/xchain-bitcoin 0.15.10 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/lib/client.d.ts +6 -40
- package/lib/const.d.ts +1 -0
- package/lib/haskoin-api.d.ts +2 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.js +43467 -41952
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +43468 -41952
- package/lib/index.js.map +1 -1
- package/lib/sochain-api.d.ts +7 -7
- package/lib/types/client-types.d.ts +3 -3
- package/lib/types/common.d.ts +2 -6
- package/lib/types/ledger.d.ts +5 -4
- package/lib/types/sochain-api-types.d.ts +0 -1
- package/lib/utils.d.ts +12 -20
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# v.0.16.0 (2021-12-29)
|
|
2
|
+
|
|
3
|
+
## Breaking change
|
|
4
|
+
|
|
5
|
+
- Add stagenet environment handling for `Network` and `BaseXChainClient` changes client to default to mainnet values until stagenet is configured.
|
|
6
|
+
|
|
7
|
+
# v.0.15.13 (2021-11-12)
|
|
8
|
+
|
|
9
|
+
- updated haskoin api URL
|
|
10
|
+
|
|
11
|
+
# v.0.15.12 (2021-09-03)
|
|
12
|
+
|
|
13
|
+
- updated to the latest dependencies
|
|
14
|
+
|
|
15
|
+
# v.0.15.11 (2021-07-07)
|
|
16
|
+
|
|
17
|
+
- Use latest `xchain-client@0.10.1` + `xchain-util@0.3.0`
|
|
18
|
+
|
|
1
19
|
# v.0.15.10 (2021-07-03)
|
|
2
20
|
|
|
3
21
|
- refactored client methods to use regular method syntax (not fat arrow) in order for bcall to super.xxx() to work properly
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Initialize client and use class methods:
|
|
|
42
42
|
import { Client, Network } from '../src/client'
|
|
43
43
|
|
|
44
44
|
// Create a new client interface
|
|
45
|
-
const btcClient = new Client({ network:
|
|
45
|
+
const btcClient = new Client({ network: Network.Mainnet, nodeUrl: 'https://sochain.com/api/v2' })
|
|
46
46
|
|
|
47
47
|
// Set phrase
|
|
48
48
|
btcClient.setPhrase('phrase here')
|
package/lib/client.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* BitcoinClient Interface
|
|
4
|
-
*/
|
|
5
|
-
interface BitcoinClient {
|
|
6
|
-
getFeesWithRates(memo?: string): Promise<FeesWithRates>;
|
|
7
|
-
getFeesWithMemo(memo: string): Promise<Fees>;
|
|
8
|
-
getFeeRates(): Promise<FeeRates>;
|
|
9
|
-
}
|
|
1
|
+
import { Address, Balance, Fee, FeeRate, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, UTXOClient, XChainClientParams } from '@xchainjs/xchain-client';
|
|
10
2
|
export declare type BitcoinClientParams = XChainClientParams & {
|
|
11
3
|
sochainUrl?: string;
|
|
12
4
|
blockstreamUrl?: string;
|
|
@@ -14,7 +6,7 @@ export declare type BitcoinClientParams = XChainClientParams & {
|
|
|
14
6
|
/**
|
|
15
7
|
* Custom Bitcoin client
|
|
16
8
|
*/
|
|
17
|
-
declare class Client extends
|
|
9
|
+
declare class Client extends UTXOClient {
|
|
18
10
|
private sochainUrl;
|
|
19
11
|
private blockstreamUrl;
|
|
20
12
|
/**
|
|
@@ -93,7 +85,7 @@ declare class Client extends BaseXChainClient implements BitcoinClient, XChainCl
|
|
|
93
85
|
* Get the BTC balance of a given address.
|
|
94
86
|
*
|
|
95
87
|
* @param {Address} the BTC address
|
|
96
|
-
* @returns {
|
|
88
|
+
* @returns {Balance[]} The BTC balance of the address.
|
|
97
89
|
*/
|
|
98
90
|
getBalance(address: Address): Promise<Balance[]>;
|
|
99
91
|
/**
|
|
@@ -111,34 +103,8 @@ declare class Client extends BaseXChainClient implements BitcoinClient, XChainCl
|
|
|
111
103
|
* @returns {Tx} The transaction details of the given transaction id.
|
|
112
104
|
*/
|
|
113
105
|
getTransactionData(txId: string): Promise<Tx>;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
117
|
-
* @param {string} memo The memo to be used for fee calculation (optional)
|
|
118
|
-
* @returns {FeesWithRates} The fees and rates
|
|
119
|
-
*/
|
|
120
|
-
getFeesWithRates(memo?: string): Promise<FeesWithRates>;
|
|
121
|
-
/**
|
|
122
|
-
* Get the current fees.
|
|
123
|
-
*
|
|
124
|
-
* @returns {Fees} The fees without memo
|
|
125
|
-
*/
|
|
126
|
-
getFees(): Promise<Fees>;
|
|
127
|
-
/**
|
|
128
|
-
* Get the fees for transactions with memo.
|
|
129
|
-
* If you want to get `Fees` and `FeeRates` at once, use `getFeesAndRates` method
|
|
130
|
-
*
|
|
131
|
-
* @param {string} memo
|
|
132
|
-
* @returns {Fees} The fees with memo
|
|
133
|
-
*/
|
|
134
|
-
getFeesWithMemo(memo: string): Promise<Fees>;
|
|
135
|
-
/**
|
|
136
|
-
* Get the fee rates for transactions without a memo.
|
|
137
|
-
* If you want to get `Fees` and `FeeRates` at once, use `getFeesAndRates` method
|
|
138
|
-
*
|
|
139
|
-
* @returns {FeeRates} The fee rate
|
|
140
|
-
*/
|
|
141
|
-
getFeeRates(): Promise<FeeRates>;
|
|
106
|
+
protected getSuggestedFeeRate(): Promise<FeeRate>;
|
|
107
|
+
protected calcFee(feeRate: FeeRate, memo?: string): Promise<Fee>;
|
|
142
108
|
/**
|
|
143
109
|
* Transfer BTC.
|
|
144
110
|
*
|
|
@@ -149,4 +115,4 @@ declare class Client extends BaseXChainClient implements BitcoinClient, XChainCl
|
|
|
149
115
|
feeRate?: FeeRate;
|
|
150
116
|
}): Promise<TxHash>;
|
|
151
117
|
}
|
|
152
|
-
export { Client
|
|
118
|
+
export { Client };
|
package/lib/const.d.ts
CHANGED
package/lib/haskoin-api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address } from '@xchainjs/xchain-client
|
|
2
|
-
import { BaseAmount } from '@xchainjs/xchain-util
|
|
1
|
+
import { Address } from '@xchainjs/xchain-client';
|
|
2
|
+
import { BaseAmount } from '@xchainjs/xchain-util';
|
|
3
3
|
export declare type UtxoData = {
|
|
4
4
|
txid: string;
|
|
5
5
|
index: number;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export * from './client';
|
|
3
|
-
export
|
|
3
|
+
export * from './const';
|
|
4
|
+
export { broadcastTx, getDefaultFees, getDefaultFeesWithRates, getPrefix, scanUTXOs, buildTx, validateAddress, calcFee, } from './utils';
|
|
4
5
|
export { createTxInfo } from './ledger';
|