@multiplechain/bitcoin 0.4.4 → 0.4.6

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.
@@ -3,22 +3,22 @@ import { Transaction } from './Transaction';
3
3
 
4
4
  export declare class CoinTransaction extends Transaction implements CoinTransactionInterface {
5
5
  /**
6
- * @returns {Promise<WalletAddress>} Wallet address of the receiver of transaction
6
+ * @returns Wallet address of the receiver of transaction
7
7
  */
8
8
  getReceiver(): Promise<WalletAddress>;
9
9
  /**
10
- * @returns {Promise<WalletAddress>} Wallet address of the sender of transaction
10
+ * @returns Wallet address of the sender of transaction
11
11
  */
12
12
  getSender(): Promise<WalletAddress>;
13
13
  /**
14
- * @returns {Promise<TransferAmount>} Amount of coin that will be transferred
14
+ * @returns Amount of coin that will be transferred
15
15
  */
16
16
  getAmount(): Promise<TransferAmount>;
17
17
  /**
18
- * @param {AssetDirectionEnum} direction - Direction of the transaction (asset)
19
- * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction
20
- * @param {TransferAmount} amount Amount of assets that will be transferred
21
- * @returns {Promise<TransactionStatusEnum>} Status of the transaction
18
+ * @param direction - Direction of the transaction (asset)
19
+ * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction
20
+ * @param amount Amount of assets that will be transferred
21
+ * @returns Status of the transaction
22
22
  */
23
23
  verifyTransfer(direction: AssetDirectionEnum, address: WalletAddress, amount: TransferAmount): Promise<TransactionStatusEnum>;
24
24
  }
@@ -54,53 +54,53 @@ export declare class Transaction implements TransactionInterface<TransactionData
54
54
  */
55
55
  data: TransactionData | null;
56
56
  /**
57
- * @param {TransactionId} id Transaction id
58
- * @param {Provider} provider Blockchain network provider
57
+ * @param id Transaction id
58
+ * @param provider Blockchain network provider
59
59
  */
60
60
  constructor(id: TransactionId, provider?: Provider);
61
61
  /**
62
- * @returns {Promise<TransactionData | null>} Transaction data
62
+ * @returns Transaction data
63
63
  */
64
64
  getData(): Promise<TransactionData | null>;
65
65
  /**
66
- * @param {number} ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms
67
- * @returns {Promise<TransactionStatusEnum>} Status of the transaction
66
+ * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms
67
+ * @returns Status of the transaction
68
68
  */
69
69
  wait(ms?: number): Promise<TransactionStatusEnum>;
70
70
  /**
71
- * @returns {TransactionId} Transaction ID
71
+ * @returns Transaction ID
72
72
  */
73
73
  getId(): TransactionId;
74
74
  /**
75
- * @returns {Promise<TransactionTypeEnum>} Transaction type
75
+ * @returns Transaction type
76
76
  */
77
77
  getType(): Promise<TransactionTypeEnum>;
78
78
  /**
79
- * @returns {string} Transaction URL
79
+ * @returns Transaction URL
80
80
  */
81
81
  getUrl(): string;
82
82
  /**
83
- * @returns {Promise<WalletAddress>} Wallet address of the sender of transaction
83
+ * @returns Wallet address of the sender of transaction
84
84
  */
85
85
  getSigner(): Promise<WalletAddress>;
86
86
  /**
87
- * @returns {Promise<TransactionFee>} Transaction fee
87
+ * @returns Transaction fee
88
88
  */
89
89
  getFee(): Promise<TransactionFee>;
90
90
  /**
91
- * @returns {Promise<BlockNumber>} Block number that transaction
91
+ * @returns Block number that transaction
92
92
  */
93
93
  getBlockNumber(): Promise<BlockNumber>;
94
94
  /**
95
- * @returns {Promise<BlockTimestamp>} Block timestamp that transaction
95
+ * @returns Block timestamp that transaction
96
96
  */
97
97
  getBlockTimestamp(): Promise<BlockTimestamp>;
98
98
  /**
99
- * @returns {Promise<BlockConfirmationCount>} Confirmation count of the block
99
+ * @returns Confirmation count of the block
100
100
  */
101
101
  getBlockConfirmationCount(): Promise<BlockConfirmationCount>;
102
102
  /**
103
- * @returns {Promise<TransactionStatusEnum>} Status of the transaction
103
+ * @returns Status of the transaction
104
104
  */
105
105
  getStatus(): Promise<TransactionStatusEnum>;
106
106
  }
@@ -1,7 +1,6 @@
1
- import { ProviderInterface } from '@multiplechain/types';
1
+ import { NetworkConfigInterface, ProviderInterface } from '@multiplechain/types';
2
2
 
3
- export interface BitcoinNetworkConfigInterface {
4
- testnet: boolean;
3
+ export interface BitcoinNetworkConfigInterface extends NetworkConfigInterface {
5
4
  blockCypherToken?: string;
6
5
  }
7
6
  export declare class Provider implements ProviderInterface<BitcoinNetworkConfigInterface> {
@@ -39,42 +38,40 @@ export declare class Provider implements ProviderInterface<BitcoinNetworkConfigI
39
38
  constructor(network: BitcoinNetworkConfigInterface);
40
39
  /**
41
40
  * Get the static instance of the provider
42
- * @returns {Provider} Provider
41
+ * @returns Provider
43
42
  */
44
43
  static get instance(): Provider;
45
44
  /**
46
45
  * Initialize the static instance of the provider
47
- * @param {BitcoinNetworkConfigInterface} network - Network configuration of the provider
48
- * @returns {void}
46
+ * @param network - Network configuration of the provider
49
47
  */
50
48
  static initialize(network: BitcoinNetworkConfigInterface): void;
51
49
  /**
52
50
  * Check RPC connection
53
- * @param {string} url - RPC URL
54
- * @returns {Promise<boolean | Error>}
51
+ * @param url - RPC URL
52
+ * @returns Connection status
55
53
  */
56
54
  checkRpcConnection(url?: string): Promise<boolean | Error>;
57
55
  /**
58
56
  * Check WS connection
59
- * @param {string} url - Websocket URL
60
- * @returns {Promise<boolean | Error>}
57
+ * @param url - Websocket URL
58
+ * @returns Connection status
61
59
  */
62
60
  checkWsConnection(url?: string): Promise<boolean | Error>;
63
61
  /**
64
62
  * Update network configuration of the provider
65
- * @param {BitcoinNetworkConfigInterface} network - Network configuration
66
- * @returns {void}
63
+ * @param network - Network configuration
67
64
  */
68
65
  update(network: BitcoinNetworkConfigInterface): void;
69
66
  /**
70
67
  * Create a new endpoint
71
- * @param {string} endpoint - Endpoint
72
- * @returns {string} Endpoint
68
+ * @param endpoint - Endpoint
69
+ * @returns Endpoint
73
70
  */
74
71
  createEndpoint(endpoint: string): string;
75
72
  /**
76
73
  * Get the current network configuration is testnet or not
77
- * @returns {boolean} Testnet or not
74
+ * @returns Testnet or not
78
75
  */
79
76
  isTestnet(): boolean;
80
77
  }
@@ -46,74 +46,66 @@ export declare class TransactionListener<T extends TransactionTypeEnum, DTransac
46
46
  */
47
47
  dynamicStop: () => void;
48
48
  /**
49
- * @param {T} type - Transaction type
50
- * @param {DynamicTransactionListenerFilterType<T>} filter - Transaction listener filter
51
- * @param {Provider} provider - Provider
49
+ * @param type - Transaction type
50
+ * @param filter - Transaction listener filter
51
+ * @param provider - Provider
52
52
  */
53
53
  constructor(type: T, filter?: DynamicTransactionListenerFilterType<T>, provider?: Provider);
54
54
  /**
55
55
  * Close the listener
56
- * @returns {void}
57
56
  */
58
57
  stop(): void;
59
58
  /**
60
59
  * Start the listener
61
- * @returns {void}
62
60
  */
63
61
  start(): void;
64
62
  /**
65
63
  * Get the listener status
66
- * @returns {boolean} Listener status
64
+ * @returns Listener status
67
65
  */
68
66
  getStatus(): boolean;
69
67
  /**
70
68
  * Listen to the transaction events
71
- * @param {CallBackType} callback - Transaction listener callback
72
- * @returns {Promise<boolean>}
69
+ * @param callback - Transaction listener callback
70
+ * @returns Connection status
73
71
  */
74
72
  on(callback: CallBackType): Promise<boolean>;
75
73
  /**
76
74
  * Trigger the event when a transaction is detected
77
- * @param {TransactionListenerTriggerType<T>} transaction - Transaction data
78
- * @returns {void}
75
+ * @param transaction - Transaction data
79
76
  */
80
77
  trigger<T extends TransactionTypeEnum>(transaction: TransactionListenerTriggerType<T>): void;
81
78
  isBlockCypherProcess(): boolean;
82
79
  /**
83
80
  * Create message for the listener
84
- * @param {string} receiver - Receiver address
85
- * @returns {string} Message
81
+ * @param receiver - Receiver address
82
+ * @returns Message
86
83
  */
87
84
  createMessage(receiver?: string): string;
88
85
  /**
89
86
  * Parse the data
90
- * @param {any} data - Data
91
- * @returns {Values} Parsed data
87
+ * @param data - Data
88
+ * @returns Parsed data
92
89
  */
93
90
  getValues(data: any): Values;
94
91
  /**
95
92
  * General transaction process
96
- * @returns {void}
97
93
  */
98
94
  generalProcess(): void;
99
95
  /**
100
96
  * Contract transaction process
101
- * @returns {void}
102
97
  */
103
98
  contractProcess(): void;
104
99
  /**
105
100
  * Coin transaction process
106
- * @returns {void}
107
101
  */
108
102
  coinProcess(): void;
109
103
  /**
110
104
  * Token transaction process
111
- * @returns {void}
112
105
  */
113
106
  tokenProcess(): void;
114
107
  /**
115
108
  * NFT transaction process
116
- * @returns {void}
117
109
  */
118
110
  nftProcess(): void;
119
111
  }
@@ -22,29 +22,29 @@ export declare class TransactionSigner implements TransactionSignerInterface<Tra
22
22
  */
23
23
  provider: Provider;
24
24
  /**
25
- * @param {TransactionData} rawData - Transaction data
26
- * @param {Provider} provider - Blockchain network provider
25
+ * @param rawData - Transaction data
26
+ * @param provider - Blockchain network provider
27
27
  */
28
28
  constructor(rawData: TransactionData, provider?: Provider);
29
29
  /**
30
30
  * Sign the transaction
31
- * @param {PrivateKey} privateKey - Transaction data
32
- * @returns {Promise<this>} Signed transaction data
31
+ * @param privateKey - Transaction data
32
+ * @returns Signed transaction data
33
33
  */
34
34
  sign(privateKey: PrivateKey): Promise<this>;
35
35
  /**
36
36
  * Send the transaction to the blockchain network
37
- * @returns {Promise<TransactionId>}
37
+ * @returns Transaction ID
38
38
  */
39
39
  send(): Promise<TransactionId>;
40
40
  /**
41
41
  * Get the raw transaction data
42
- * @returns {TransactionData}
42
+ * @returns Transaction data
43
43
  */
44
44
  getRawData(): TransactionData;
45
45
  /**
46
46
  * Get the signed transaction data
47
- * @returns {string}
47
+ * @returns Signed transaction data
48
48
  */
49
49
  getSignedData(): string;
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplechain/bitcoin",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.es.js",
@@ -72,15 +72,17 @@
72
72
  "url": "https://github.com/MultipleChain/js/issues"
73
73
  },
74
74
  "dependencies": {
75
- "@multiplechain/types": "^0.1.66",
75
+ "@multiplechain/types": "^0.1.68",
76
76
  "@multiplechain/utils": "^0.1.21",
77
77
  "axios": "^1.6.8",
78
78
  "bitcore-lib": "^10.0.28",
79
+ "lodash": "^4.17.21",
79
80
  "sats-connect": "^2.3.1",
80
81
  "ws": "^8.17.0"
81
82
  },
82
83
  "devDependencies": {
83
84
  "@types/bitcore-lib": "^0.15.6",
85
+ "@types/lodash": "^4.17.7",
84
86
  "@types/ws": "^8.5.10"
85
87
  }
86
88
  }