@xchainjs/xchain-doge 0.5.13 → 0.6.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/lib/blockcypher-api.d.ts +13 -13
- package/lib/client.d.ts +81 -81
- package/lib/const.d.ts +39 -39
- package/lib/index.d.ts +5 -5
- package/lib/index.esm.js +352 -83986
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +392 -84010
- package/lib/index.js.map +1 -1
- package/lib/types/client-types.d.ts +16 -16
- package/lib/types/common.d.ts +6 -6
- package/lib/types/index.d.ts +3 -3
- package/lib/types/ledger.d.ts +14 -14
- package/lib/types/sochain-api-types.d.ts +81 -81
- package/lib/utils.d.ts +70 -70
- package/package.json +13 -14
package/lib/blockcypher-api.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Network } from '@xchainjs/xchain-client';
|
|
2
|
-
/**
|
|
3
|
-
* Get Dogecoin suggested transaction fee.
|
|
4
|
-
*
|
|
5
|
-
* @returns {number} The Dogecoin suggested transaction fee per bytes in sat.
|
|
6
|
-
*/
|
|
7
|
-
export declare const getSuggestedTxFee: ({ blockcypherUrl }: {
|
|
8
|
-
blockcypherUrl: string;
|
|
9
|
-
}) => Promise<number>;
|
|
10
|
-
export declare const getSendTxUrl: ({ blockcypherUrl, network }: {
|
|
11
|
-
blockcypherUrl: string;
|
|
12
|
-
network: Network;
|
|
13
|
-
}) => string;
|
|
1
|
+
import { Network } from '@xchainjs/xchain-client';
|
|
2
|
+
/**
|
|
3
|
+
* Get Dogecoin suggested transaction fee.
|
|
4
|
+
*
|
|
5
|
+
* @returns {number} The Dogecoin suggested transaction fee per bytes in sat.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getSuggestedTxFee: ({ blockcypherUrl }: {
|
|
8
|
+
blockcypherUrl: string;
|
|
9
|
+
}) => Promise<number>;
|
|
10
|
+
export declare const getSendTxUrl: ({ blockcypherUrl, network }: {
|
|
11
|
+
blockcypherUrl: string;
|
|
12
|
+
network: Network;
|
|
13
|
+
}) => string;
|
package/lib/client.d.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { Fee, FeeRate, TxHash, TxParams, UTXO, UTXOClient, UtxoClientParams } from '@xchainjs/xchain-client';
|
|
2
|
-
import { Address } from '@xchainjs/xchain-util';
|
|
3
|
-
import * as Dogecoin from 'bitcoinjs-lib';
|
|
4
|
-
import { LedgerTxInfo, LedgerTxInfoParams } from './types/ledger';
|
|
5
|
-
export declare const defaultDogeParams: UtxoClientParams;
|
|
6
|
-
/**
|
|
7
|
-
* Custom Dogecoin client
|
|
8
|
-
*/
|
|
9
|
-
declare class Client extends UTXOClient {
|
|
10
|
-
/**
|
|
11
|
-
* Constructor
|
|
12
|
-
* Client is initialised with network type
|
|
13
|
-
* Pass strict null as nodeAuth to disable auth for node json rpc
|
|
14
|
-
*
|
|
15
|
-
* @param {DogecoinClientParams} params
|
|
16
|
-
*/
|
|
17
|
-
constructor(params?: UtxoClientParams);
|
|
18
|
-
/**
|
|
19
|
-
* Get the current address.
|
|
20
|
-
*
|
|
21
|
-
* Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF)
|
|
22
|
-
* The address is then decoded into type P2WPKH and returned.
|
|
23
|
-
*
|
|
24
|
-
* @returns {Address} The current address.
|
|
25
|
-
*
|
|
26
|
-
* @throws {"Phrase must be provided"} Thrown if phrase has not been set before.
|
|
27
|
-
* @throws {"Address not defined"} Thrown if failed creating account from phrase.
|
|
28
|
-
*/
|
|
29
|
-
getAddress(index?: number): Address;
|
|
30
|
-
/**
|
|
31
|
-
* @private
|
|
32
|
-
* Get private key.
|
|
33
|
-
*
|
|
34
|
-
* Private function to get keyPair from the this.phrase
|
|
35
|
-
*
|
|
36
|
-
* @param {string} phrase The phrase to be used for generating privkey
|
|
37
|
-
* @returns {ECPairInterface} The privkey generated from the given phrase
|
|
38
|
-
*
|
|
39
|
-
* @throws {"Could not get private key from phrase"} Throws an error if failed creating Doge keys from the given phrase
|
|
40
|
-
* */
|
|
41
|
-
private getDogeKeys;
|
|
42
|
-
/**
|
|
43
|
-
* Validate the given address.
|
|
44
|
-
*
|
|
45
|
-
* @param {Address} address
|
|
46
|
-
* @returns {boolean} `true` or `false`
|
|
47
|
-
*/
|
|
48
|
-
validateAddress(address: string): boolean;
|
|
49
|
-
protected getSuggestedFeeRate(): Promise<FeeRate>;
|
|
50
|
-
protected calcFee(feeRate: FeeRate, memo?: string): Promise<Fee>;
|
|
51
|
-
/**
|
|
52
|
-
* Transfer Doge.
|
|
53
|
-
*
|
|
54
|
-
* @param {TxParams&FeeRate} params The transfer options.
|
|
55
|
-
* @returns {TxHash} The transaction hash.
|
|
56
|
-
*/
|
|
57
|
-
transfer(params: TxParams & {
|
|
58
|
-
feeRate?: FeeRate;
|
|
59
|
-
}): Promise<TxHash>;
|
|
60
|
-
/**
|
|
61
|
-
* Build transcation.
|
|
62
|
-
*
|
|
63
|
-
* @param {BuildParams} params The transaction build options.
|
|
64
|
-
* @returns {Transaction}
|
|
65
|
-
*/
|
|
66
|
-
buildTx: ({ amount, recipient, memo, feeRate, sender, }: TxParams & {
|
|
67
|
-
feeRate: FeeRate;
|
|
68
|
-
sender: Address;
|
|
69
|
-
}) => Promise<{
|
|
70
|
-
psbt: Dogecoin.Psbt;
|
|
71
|
-
utxos: UTXO[];
|
|
72
|
-
}>;
|
|
73
|
-
/**
|
|
74
|
-
* Create transaction info.
|
|
75
|
-
*
|
|
76
|
-
* @param {LedgerTxInfoParams} params The transaction build options.
|
|
77
|
-
* @returns {LedgerTxInfo} The transaction info used for ledger sign.
|
|
78
|
-
*/
|
|
79
|
-
createTxInfo(params: LedgerTxInfoParams): Promise<LedgerTxInfo>;
|
|
80
|
-
}
|
|
81
|
-
export { Client };
|
|
1
|
+
import { Fee, FeeRate, TxHash, TxParams, UTXO, UTXOClient, UtxoClientParams } from '@xchainjs/xchain-client';
|
|
2
|
+
import { Address } from '@xchainjs/xchain-util';
|
|
3
|
+
import * as Dogecoin from 'bitcoinjs-lib';
|
|
4
|
+
import { LedgerTxInfo, LedgerTxInfoParams } from './types/ledger';
|
|
5
|
+
export declare const defaultDogeParams: UtxoClientParams;
|
|
6
|
+
/**
|
|
7
|
+
* Custom Dogecoin client
|
|
8
|
+
*/
|
|
9
|
+
declare class Client extends UTXOClient {
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
* Client is initialised with network type
|
|
13
|
+
* Pass strict null as nodeAuth to disable auth for node json rpc
|
|
14
|
+
*
|
|
15
|
+
* @param {DogecoinClientParams} params
|
|
16
|
+
*/
|
|
17
|
+
constructor(params?: UtxoClientParams);
|
|
18
|
+
/**
|
|
19
|
+
* Get the current address.
|
|
20
|
+
*
|
|
21
|
+
* Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF)
|
|
22
|
+
* The address is then decoded into type P2WPKH and returned.
|
|
23
|
+
*
|
|
24
|
+
* @returns {Address} The current address.
|
|
25
|
+
*
|
|
26
|
+
* @throws {"Phrase must be provided"} Thrown if phrase has not been set before.
|
|
27
|
+
* @throws {"Address not defined"} Thrown if failed creating account from phrase.
|
|
28
|
+
*/
|
|
29
|
+
getAddress(index?: number): Address;
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
* Get private key.
|
|
33
|
+
*
|
|
34
|
+
* Private function to get keyPair from the this.phrase
|
|
35
|
+
*
|
|
36
|
+
* @param {string} phrase The phrase to be used for generating privkey
|
|
37
|
+
* @returns {ECPairInterface} The privkey generated from the given phrase
|
|
38
|
+
*
|
|
39
|
+
* @throws {"Could not get private key from phrase"} Throws an error if failed creating Doge keys from the given phrase
|
|
40
|
+
* */
|
|
41
|
+
private getDogeKeys;
|
|
42
|
+
/**
|
|
43
|
+
* Validate the given address.
|
|
44
|
+
*
|
|
45
|
+
* @param {Address} address
|
|
46
|
+
* @returns {boolean} `true` or `false`
|
|
47
|
+
*/
|
|
48
|
+
validateAddress(address: string): boolean;
|
|
49
|
+
protected getSuggestedFeeRate(): Promise<FeeRate>;
|
|
50
|
+
protected calcFee(feeRate: FeeRate, memo?: string): Promise<Fee>;
|
|
51
|
+
/**
|
|
52
|
+
* Transfer Doge.
|
|
53
|
+
*
|
|
54
|
+
* @param {TxParams&FeeRate} params The transfer options.
|
|
55
|
+
* @returns {TxHash} The transaction hash.
|
|
56
|
+
*/
|
|
57
|
+
transfer(params: TxParams & {
|
|
58
|
+
feeRate?: FeeRate;
|
|
59
|
+
}): Promise<TxHash>;
|
|
60
|
+
/**
|
|
61
|
+
* Build transcation.
|
|
62
|
+
*
|
|
63
|
+
* @param {BuildParams} params The transaction build options.
|
|
64
|
+
* @returns {Transaction}
|
|
65
|
+
*/
|
|
66
|
+
buildTx: ({ amount, recipient, memo, feeRate, sender, }: TxParams & {
|
|
67
|
+
feeRate: FeeRate;
|
|
68
|
+
sender: Address;
|
|
69
|
+
}) => Promise<{
|
|
70
|
+
psbt: Dogecoin.Psbt;
|
|
71
|
+
utxos: UTXO[];
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Create transaction info.
|
|
75
|
+
*
|
|
76
|
+
* @param {LedgerTxInfoParams} params The transaction build options.
|
|
77
|
+
* @returns {LedgerTxInfo} The transaction info used for ledger sign.
|
|
78
|
+
*/
|
|
79
|
+
createTxInfo(params: LedgerTxInfoParams): Promise<LedgerTxInfo>;
|
|
80
|
+
}
|
|
81
|
+
export { Client };
|
package/lib/const.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { ExplorerProvider } from '@xchainjs/xchain-client';
|
|
2
|
-
import { Asset } from '@xchainjs/xchain-util';
|
|
3
|
-
import { BlockcypherProvider, SochainProvider } from '@xchainjs/xchain-utxo-providers';
|
|
4
|
-
/**
|
|
5
|
-
* Minimum transaction fee
|
|
6
|
-
* 100000 satoshi/kB (similar to current `minrelaytxfee`)
|
|
7
|
-
* @see https://github.com/dogecoin/dogecoin/blob/master/src/validation.h#L58
|
|
8
|
-
*/
|
|
9
|
-
export declare const MIN_TX_FEE = 100000;
|
|
10
|
-
export declare const DOGE_DECIMAL = 8;
|
|
11
|
-
export declare const LOWER_FEE_BOUND = 40000;
|
|
12
|
-
export declare const UPPER_FEE_BOUND = 20000000;
|
|
13
|
-
/**
|
|
14
|
-
* Chain identifier for Dogecoin
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export declare const DOGEChain: "DOGE";
|
|
18
|
-
/**
|
|
19
|
-
* Base "chain" asset on dogecoin
|
|
20
|
-
*
|
|
21
|
-
* Based on definition in Thorchain `common`
|
|
22
|
-
* @see https://gitlab.com/thorchain/thornode/-/blob/master/common/asset.go#L12-24
|
|
23
|
-
*/
|
|
24
|
-
export declare const AssetDOGE: Asset;
|
|
25
|
-
export declare const blockstreamExplorerProviders: {
|
|
26
|
-
testnet: ExplorerProvider;
|
|
27
|
-
stagenet: ExplorerProvider;
|
|
28
|
-
mainnet: ExplorerProvider;
|
|
29
|
-
};
|
|
30
|
-
export declare const sochainDataProviders: {
|
|
31
|
-
testnet: SochainProvider;
|
|
32
|
-
stagenet: SochainProvider;
|
|
33
|
-
mainnet: SochainProvider;
|
|
34
|
-
};
|
|
35
|
-
export declare const blockcypherDataProviders: {
|
|
36
|
-
testnet: undefined;
|
|
37
|
-
stagenet: BlockcypherProvider;
|
|
38
|
-
mainnet: BlockcypherProvider;
|
|
39
|
-
};
|
|
1
|
+
import { ExplorerProvider } from '@xchainjs/xchain-client';
|
|
2
|
+
import { Asset } from '@xchainjs/xchain-util';
|
|
3
|
+
import { BlockcypherProvider, SochainProvider } from '@xchainjs/xchain-utxo-providers';
|
|
4
|
+
/**
|
|
5
|
+
* Minimum transaction fee
|
|
6
|
+
* 100000 satoshi/kB (similar to current `minrelaytxfee`)
|
|
7
|
+
* @see https://github.com/dogecoin/dogecoin/blob/master/src/validation.h#L58
|
|
8
|
+
*/
|
|
9
|
+
export declare const MIN_TX_FEE = 100000;
|
|
10
|
+
export declare const DOGE_DECIMAL = 8;
|
|
11
|
+
export declare const LOWER_FEE_BOUND = 40000;
|
|
12
|
+
export declare const UPPER_FEE_BOUND = 20000000;
|
|
13
|
+
/**
|
|
14
|
+
* Chain identifier for Dogecoin
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare const DOGEChain: "DOGE";
|
|
18
|
+
/**
|
|
19
|
+
* Base "chain" asset on dogecoin
|
|
20
|
+
*
|
|
21
|
+
* Based on definition in Thorchain `common`
|
|
22
|
+
* @see https://gitlab.com/thorchain/thornode/-/blob/master/common/asset.go#L12-24
|
|
23
|
+
*/
|
|
24
|
+
export declare const AssetDOGE: Asset;
|
|
25
|
+
export declare const blockstreamExplorerProviders: {
|
|
26
|
+
testnet: ExplorerProvider;
|
|
27
|
+
stagenet: ExplorerProvider;
|
|
28
|
+
mainnet: ExplorerProvider;
|
|
29
|
+
};
|
|
30
|
+
export declare const sochainDataProviders: {
|
|
31
|
+
testnet: SochainProvider;
|
|
32
|
+
stagenet: SochainProvider;
|
|
33
|
+
mainnet: SochainProvider;
|
|
34
|
+
};
|
|
35
|
+
export declare const blockcypherDataProviders: {
|
|
36
|
+
testnet: undefined;
|
|
37
|
+
stagenet: BlockcypherProvider;
|
|
38
|
+
mainnet: BlockcypherProvider;
|
|
39
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './client';
|
|
3
|
-
export * from './const';
|
|
4
|
-
export { getDefaultFees, getDefaultFeesWithRates, validateAddress, calcFee, getPrefix } from './utils';
|
|
5
|
-
export { getSendTxUrl } from './blockcypher-api';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './client';
|
|
3
|
+
export * from './const';
|
|
4
|
+
export { getDefaultFees, getDefaultFeesWithRates, validateAddress, calcFee, getPrefix } from './utils';
|
|
5
|
+
export { getSendTxUrl } from './blockcypher-api';
|