@xchainjs/xchain-dash 0.1.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.
@@ -0,0 +1,41 @@
1
+ import { AssetInfo, Balance, Fee, FeeRate, Network, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, UTXOClient, UtxoClientParams } from '@xchainjs/xchain-client';
2
+ import { Address } from '@xchainjs/xchain-util';
3
+ import * as Dash from 'bitcoinjs-lib';
4
+ export type NodeAuth = {
5
+ username: string;
6
+ password: string;
7
+ };
8
+ export type NodeUrls = Record<Network, string>;
9
+ export declare const defaultDashParams: UtxoClientParams & {
10
+ nodeUrls: NodeUrls;
11
+ nodeAuth?: NodeAuth;
12
+ };
13
+ declare class Client extends UTXOClient {
14
+ private readonly nodeUrls;
15
+ private readonly nodeAuth?;
16
+ constructor(params?: import("@xchainjs/xchain-client").XChainClientParams & {
17
+ explorerProviders: import("@xchainjs/xchain-client").ExplorerProviders;
18
+ dataProviders: import("@xchainjs/xchain-client").UtxoOnlineDataProviders[];
19
+ } & {
20
+ nodeUrls: NodeUrls;
21
+ nodeAuth?: NodeAuth | undefined;
22
+ });
23
+ getAddress(index?: number): Address;
24
+ /**
25
+ *
26
+ * @returns BTC asset info
27
+ */
28
+ getAssetInfo(): AssetInfo;
29
+ getDashKeys(phrase: string, index?: number): Dash.ECPairInterface;
30
+ validateAddress(address: string): boolean;
31
+ getBalance(address: string): Promise<Balance[]>;
32
+ getTransactions(params?: TxHistoryParams): Promise<TxsPage>;
33
+ getTransactionData(txid: string): Promise<Tx>;
34
+ private insightTxToXChainTx;
35
+ protected getSuggestedFeeRate(): Promise<FeeRate>;
36
+ protected calcFee(feeRate: FeeRate, memo?: string): Promise<Fee>;
37
+ transfer(params: TxParams & {
38
+ feeRate?: FeeRate;
39
+ }): Promise<TxHash>;
40
+ }
41
+ export { Client };
package/lib/const.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import { ExplorerProvider, UtxoOnlineDataProviders } from '@xchainjs/xchain-client';
2
+ import { Asset } from '@xchainjs/xchain-util';
3
+ /**
4
+ * Minimum transaction fee
5
+ * 1000 duff/kB (similar to current `minrelaytxfee`)
6
+ * @see https://github.com/dashpay/dash/blob/master/src/validation.h
7
+ */
8
+ export declare const MIN_TX_FEE = 1000;
9
+ export declare const DASH_DECIMAL = 8;
10
+ export declare const LOWER_FEE_BOUND = 1;
11
+ export declare const UPPER_FEE_BOUND = 500;
12
+ export declare const DASH_SYMBOL = "\u0110";
13
+ export declare const DEFAULT_FEE_RATE = 1;
14
+ /**
15
+ * Chain identifier for Dash mainnet
16
+ *
17
+ */
18
+ export declare const DASHChain: "DASH";
19
+ /**
20
+ * Base "chain" asset on Dash main net.
21
+ *
22
+ * Based on definition in Thorchain `common`
23
+ * @see https://gitlab.com/thorchain/thornode/-/blob/master/common/asset.go#L12-24
24
+ */
25
+ export declare const AssetDASH: Asset;
26
+ export declare const explorerProviders: {
27
+ testnet: ExplorerProvider;
28
+ stagenet: ExplorerProvider;
29
+ mainnet: ExplorerProvider;
30
+ };
31
+ export declare const BlockcypherDataProviders: UtxoOnlineDataProviders;
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './client';
2
+ export { buildTx, getDefaultFees, getDefaultFeesWithRates, getPrefix, validateAddress, calcFee } from './utils';