@xchainjs/xchain-doge 0.1.2 → 0.2.1
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 +24 -0
- package/README.md +7 -39
- package/lib/blockcypher-api.d.ts +1 -1
- package/lib/client.d.ts +11 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.js +564 -683
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +566 -683
- package/lib/index.js.map +1 -1
- package/lib/sochain-api.d.ts +22 -5
- package/lib/types/sochain-api-types.d.ts +0 -6
- package/lib/utils.d.ts +15 -6
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v.0.2.1 (2022-05-05)
|
|
2
|
+
|
|
3
|
+
## Update
|
|
4
|
+
|
|
5
|
+
- Add `deposit` function to Doge `Client`
|
|
6
|
+
- Update latest dependencies
|
|
7
|
+
- Add tests for `deposit`
|
|
8
|
+
|
|
9
|
+
## Fix
|
|
10
|
+
|
|
11
|
+
- Fix import of `xchain-client`
|
|
12
|
+
|
|
13
|
+
# v.0.2.0 (2022-03-23)
|
|
14
|
+
|
|
15
|
+
## Update
|
|
16
|
+
|
|
17
|
+
- Fetch `txHex` optionally by scanning UTXOs #489
|
|
18
|
+
- Cache list of `txHex`s in `getTxHexFromCache` to avoid same requests for same data #490
|
|
19
|
+
- Export `buildTx` (from `utils`) and `getSendTxUrl` (from `blockcypher-api`)
|
|
20
|
+
|
|
21
|
+
## Breaking change
|
|
22
|
+
|
|
23
|
+
- Remove unspecific `AddressParams` type
|
|
24
|
+
|
|
1
25
|
# v.0.1.2 (2022-02-04)
|
|
2
26
|
|
|
3
27
|
- Use latest axios@0.25.0
|
package/README.md
CHANGED
|
@@ -16,6 +16,13 @@ Following peer dependencies have to be installed into your project. These are no
|
|
|
16
16
|
yarn add @xchainjs/xchain-client @xchainjs/xchain-crypto @xchainjs/xchain-util axios bitcoinjs-lib coininfo wif
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
### [`xchain doge`](http://docs.xchainjs.org/xchain-client/xchain-doge/)
|
|
22
|
+
[`How xchain-doge works`](http://docs.xchainjs.org/xchain-client/xchain-doge/how-it-works.html)\
|
|
23
|
+
[`How to use xchain-doge`](http://docs.xchainjs.org/xchain-client/xchain-doge/how-to-use.html)
|
|
24
|
+
|
|
25
|
+
|
|
19
26
|
## Service Providers
|
|
20
27
|
|
|
21
28
|
This package uses the following service providers:
|
|
@@ -32,42 +39,3 @@ This package uses the following service providers:
|
|
|
32
39
|
Sochain API rate limits: https://sochain.com/api#rate-limits (300 requests/minute)
|
|
33
40
|
|
|
34
41
|
BlockCypher API rate limits: https://api.blockcypher.com/v1/doge/main (5 requests/second)
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
37
|
-
|
|
38
|
-
Initialize client and use class methods:
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
import { Client, Network } from '../src/client'
|
|
42
|
-
|
|
43
|
-
// Create a new client interface
|
|
44
|
-
const dogeClient = new Client({ network: Network.Testnet })
|
|
45
|
-
|
|
46
|
-
// Set phrase
|
|
47
|
-
dogeClient.setPhrase('phrase here')
|
|
48
|
-
|
|
49
|
-
// Get address
|
|
50
|
-
const address = dogeClient.getAddress()
|
|
51
|
-
|
|
52
|
-
// Get balance
|
|
53
|
-
const balance = await dogeClient.getBalance()
|
|
54
|
-
|
|
55
|
-
// Transfer with feeRate
|
|
56
|
-
const txid = await dogeClient.transfer({ asset: AssetDoge, recipient: 'recipient address here', amount: baseAmount(100, DOGE_DECIMAL), feeRate: 1 })
|
|
57
|
-
|
|
58
|
-
// Transfer with default feeRate (default is `fast`)
|
|
59
|
-
const txid = await dogeClient.transfer({ asset: AssetDoge, recipient: 'recipient address here', amount: baseAmount(100, DOGE_DECIMAL) })
|
|
60
|
-
|
|
61
|
-
// Get fee estimations
|
|
62
|
-
const { fast, fastest, average } = await dogeClient.getFees()
|
|
63
|
-
|
|
64
|
-
// Get feeRate estimations
|
|
65
|
-
const { fast, fastest, average } = await dogeClient.getFeeRates()
|
|
66
|
-
|
|
67
|
-
// Search transactions
|
|
68
|
-
const transactions = await dogeClient.getTransactions({ address: 'address here', limit: 4 })
|
|
69
|
-
|
|
70
|
-
// Get a transaction with a given txId/hash
|
|
71
|
-
const txData = await dogeClient.getTransactionData('b660ee07167cfa32681e2623f3a29dc64a089cabd9a3a07dd17f9028ac956eb8')
|
|
72
|
-
|
|
73
|
-
```
|
package/lib/blockcypher-api.d.ts
CHANGED
package/lib/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Balance, Fee, FeeRate, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, UTXOClient, XChainClientParams } from '@xchainjs/xchain-client';
|
|
1
|
+
import { Address, Balance, DepositParams, Fee, FeeRate, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, UTXOClient, XChainClientParams } from '@xchainjs/xchain-client';
|
|
2
2
|
export declare type DogecoinClientParams = XChainClientParams & {
|
|
3
3
|
sochainUrl?: string;
|
|
4
4
|
blockcypherUrl?: string;
|
|
@@ -115,5 +115,15 @@ declare class Client extends UTXOClient {
|
|
|
115
115
|
transfer(params: TxParams & {
|
|
116
116
|
feeRate?: FeeRate;
|
|
117
117
|
}): Promise<TxHash>;
|
|
118
|
+
/**
|
|
119
|
+
* Transaction to THORChain inbound address.
|
|
120
|
+
*
|
|
121
|
+
* @param {DepositParams} params The transaction options.
|
|
122
|
+
* @returns {TxHash} The transaction hash.
|
|
123
|
+
*
|
|
124
|
+
* @throws {"halted chain"} Thrown if chain is halted.
|
|
125
|
+
* @throws {"halted trading"} Thrown if trading is halted.
|
|
126
|
+
*/
|
|
127
|
+
deposit({ walletIndex, asset, amount, memo }: DepositParams): Promise<TxHash>;
|
|
118
128
|
}
|
|
119
129
|
export { Client };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export * from './client';
|
|
3
3
|
export * from './const';
|
|
4
|
-
export { broadcastTx, getDefaultFees, getDefaultFeesWithRates, validateAddress, calcFee, scanUTXOs, getPrefix, } from './utils';
|
|
4
|
+
export { broadcastTx, buildTx, getDefaultFees, getDefaultFeesWithRates, validateAddress, calcFee, scanUTXOs, getPrefix, } from './utils';
|
|
5
|
+
export { getSendTxUrl } from './blockcypher-api';
|
|
5
6
|
export { createTxInfo } from './ledger';
|