@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/lib/sochain-api.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { Network } from '@xchainjs/xchain-client';
|
|
1
2
|
import { BaseAmount } from '@xchainjs/xchain-util';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getSendTxUrl: ({ sochainUrl, network }:
|
|
3
|
+
import { DogeAddressDTO, DogeAddressUTXO, Transaction, TxHashParams } from './types/sochain-api-types';
|
|
4
|
+
export declare const getSendTxUrl: ({ sochainUrl, network }: {
|
|
5
|
+
sochainUrl: string;
|
|
6
|
+
network: Network;
|
|
7
|
+
}) => string;
|
|
4
8
|
/**
|
|
5
9
|
* Get address information.
|
|
6
10
|
*
|
|
@@ -11,7 +15,11 @@ export declare const getSendTxUrl: ({ sochainUrl, network }: AddressParams) => s
|
|
|
11
15
|
* @param {string} address
|
|
12
16
|
* @returns {DogeAddressDTO}
|
|
13
17
|
*/
|
|
14
|
-
export declare const getAddress: ({ sochainUrl, network, address }:
|
|
18
|
+
export declare const getAddress: ({ sochainUrl, network, address, }: {
|
|
19
|
+
sochainUrl: string;
|
|
20
|
+
network: Network;
|
|
21
|
+
address: string;
|
|
22
|
+
}) => Promise<DogeAddressDTO>;
|
|
15
23
|
/**
|
|
16
24
|
* Get transaction by hash.
|
|
17
25
|
*
|
|
@@ -33,7 +41,11 @@ export declare const getTx: ({ sochainUrl, network, hash }: TxHashParams) => Pro
|
|
|
33
41
|
* @param {string} address
|
|
34
42
|
* @returns {number}
|
|
35
43
|
*/
|
|
36
|
-
export declare const getBalance: ({ sochainUrl, network, address }:
|
|
44
|
+
export declare const getBalance: ({ sochainUrl, network, address, }: {
|
|
45
|
+
sochainUrl: string;
|
|
46
|
+
network: Network;
|
|
47
|
+
address: string;
|
|
48
|
+
}) => Promise<BaseAmount>;
|
|
37
49
|
/**
|
|
38
50
|
* Get unspent txs
|
|
39
51
|
*
|
|
@@ -44,4 +56,9 @@ export declare const getBalance: ({ sochainUrl, network, address }: AddressParam
|
|
|
44
56
|
* @param {string} address
|
|
45
57
|
* @returns {DogeAddressUTXO[]}
|
|
46
58
|
*/
|
|
47
|
-
export declare const getUnspentTxs: ({ sochainUrl, network, address, startingFromTxId, }:
|
|
59
|
+
export declare const getUnspentTxs: ({ sochainUrl, network, address, startingFromTxId, }: {
|
|
60
|
+
sochainUrl: string;
|
|
61
|
+
network: Network;
|
|
62
|
+
address: string;
|
|
63
|
+
startingFromTxId?: string | undefined;
|
|
64
|
+
}) => Promise<DogeAddressUTXO[]>;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Network, TxHash } from '@xchainjs/xchain-client';
|
|
2
|
-
export declare type AddressParams = {
|
|
3
|
-
sochainUrl: string;
|
|
4
|
-
network: Network;
|
|
5
|
-
address: string;
|
|
6
|
-
startingFromTxId?: string;
|
|
7
|
-
};
|
|
8
2
|
export declare type TxHashParams = {
|
|
9
3
|
sochainUrl: string;
|
|
10
4
|
network: Network;
|
package/lib/utils.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Address, Balance, FeeRate, Fees, FeesWithRates, Network, TxHash, TxPara
|
|
|
3
3
|
import { BaseAmount } from '@xchainjs/xchain-util';
|
|
4
4
|
import * as Dogecoin from 'bitcoinjs-lib';
|
|
5
5
|
import { BroadcastTxParams, UTXO } from './types/common';
|
|
6
|
-
import { AddressParams } from './types/sochain-api-types';
|
|
7
6
|
/**
|
|
8
7
|
* Compile memo.
|
|
9
8
|
*
|
|
@@ -37,10 +36,14 @@ export declare const dogeNetwork: (network: Network) => Dogecoin.networks.Networ
|
|
|
37
36
|
/**
|
|
38
37
|
* Get the balances of an address.
|
|
39
38
|
*
|
|
40
|
-
* @param
|
|
39
|
+
* @param params
|
|
41
40
|
* @returns {Balance[]} The balances of the given address.
|
|
42
41
|
*/
|
|
43
|
-
export declare const getBalance: (params:
|
|
42
|
+
export declare const getBalance: (params: {
|
|
43
|
+
sochainUrl: string;
|
|
44
|
+
network: Network;
|
|
45
|
+
address: string;
|
|
46
|
+
}) => Promise<Balance[]>;
|
|
44
47
|
/**
|
|
45
48
|
* Validate the Doge address.
|
|
46
49
|
*
|
|
@@ -52,21 +55,27 @@ export declare const validateAddress: (address: Address, network: Network) => bo
|
|
|
52
55
|
/**
|
|
53
56
|
* Scan UTXOs from sochain.
|
|
54
57
|
*
|
|
55
|
-
* @param
|
|
58
|
+
* @param params
|
|
56
59
|
* @returns {UTXO[]} The UTXOs of the given address.
|
|
57
60
|
*/
|
|
58
|
-
export declare const scanUTXOs: (
|
|
61
|
+
export declare const scanUTXOs: ({ sochainUrl, network, address, withTxHex, }: {
|
|
62
|
+
sochainUrl: string;
|
|
63
|
+
network: Network;
|
|
64
|
+
address: string;
|
|
65
|
+
withTxHex: boolean;
|
|
66
|
+
}) => Promise<UTXO[]>;
|
|
59
67
|
/**
|
|
60
68
|
* Build transcation.
|
|
61
69
|
*
|
|
62
70
|
* @param {BuildParams} params The transaction build options.
|
|
63
71
|
* @returns {Transaction}
|
|
64
72
|
*/
|
|
65
|
-
export declare const buildTx: ({ amount, recipient, memo, feeRate, sender, network, sochainUrl, }: TxParams & {
|
|
73
|
+
export declare const buildTx: ({ amount, recipient, memo, feeRate, sender, network, sochainUrl, withTxHex, }: TxParams & {
|
|
66
74
|
feeRate: FeeRate;
|
|
67
75
|
sender: Address;
|
|
68
76
|
network: Network;
|
|
69
77
|
sochainUrl: string;
|
|
78
|
+
withTxHex?: boolean | undefined;
|
|
70
79
|
}) => Promise<{
|
|
71
80
|
psbt: Dogecoin.Psbt;
|
|
72
81
|
utxos: UTXO[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-doge",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Custom Doge client and utilities used by XChain clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Xchain",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"postversion": "git push --follow-tags"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@xchainjs/xchain-client": "^0.11.
|
|
35
|
+
"@xchainjs/xchain-client": "^0.11.2",
|
|
36
36
|
"@xchainjs/xchain-crypto": "^0.2.6",
|
|
37
|
-
"@xchainjs/xchain-util": "^0.
|
|
37
|
+
"@xchainjs/xchain-util": "^0.7.1",
|
|
38
38
|
"@types/bitcoinjs-lib": "^5.0.0",
|
|
39
39
|
"@types/wif": "^2.0.2",
|
|
40
40
|
"axios": "^0.25.0",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"wif": "^2.0.6"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@xchainjs/xchain-client": "^0.11.
|
|
48
|
+
"@xchainjs/xchain-client": "^0.11.2",
|
|
49
49
|
"@xchainjs/xchain-crypto": "^0.2.6",
|
|
50
|
-
"@xchainjs/xchain-util": "^0.
|
|
50
|
+
"@xchainjs/xchain-util": "^0.7.1",
|
|
51
51
|
"axios": "^0.25.0",
|
|
52
52
|
"bitcoinjs-lib": "^5.2.0",
|
|
53
53
|
"coininfo": "5.1.0",
|