-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
63 lines (53 loc) · 1.98 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import Web3 from "web3";
import { TransactionReceipt, Transaction as Web3Transaction } from "web3-core";
interface Transaction {
txHash: string,
method: BridgeMethod,
events: BridgeEvent[],
sender: string,
blockNumber: number,
blockTimestamp: number
}
interface BridgeMethod {
name: string,
signature: string,
arguments: {}
}
interface BridgeEvent {
name: string,
signature: string,
arguments: {}
}
export default class BridgeTransactionParser {
/**
*
* @param web3Client Web3 Instance
*/
constructor(web3Client: Web3);
/**
* Gets Bridge Transactions In a Specified Block Hash Or Block Number
* @param blockHashOrBlockNumber The block hash or block number.
* @returns Array - Array of transaction objects
*/
getBridgeTransactionsInThisBlock(blockHashOrBlockNumber: string | number): Promise<Array<Transaction>>;
/**
* Gets Bridge Transactions In a Specified Range of Blocks
* @param startingBlockHashOrBlockNumber The block hash or block number.
* @param blocksToSearch Number/Amount of blocks to search
* @returns Array - Array of transaction objects
*/
getBridgeTransactionsSinceThisBlock(startingBlockHashOrBlockNumber: string | number, blocksToSearch: string): Promise<Array<Transaction>>;
/**
* Gets a Single Bridge Transaction Via The Transaction Hash.
* @param transactionHash The transaction hash.
* @returns Object - A transaction object
*/
getBridgeTransactionByTxHash(transactionHash: string): Promise<Transaction>;
/**
* Gets a Bridge Transaction given a web3 transaction: web3TransactionObject and a bridgeTxReceipt: TransactionReceipt.
* @param web3Tx The web3TransactionObject.
* @param bridgeTxReceipt The bridgeTxReceipt: web3TransactionReceiptObject.
* @returns Object - A transaction object
*/
decodeBridgeTransaction(web3Tx: Web3Transaction, bridgeTxReceipt: TransactionReceipt): Promise<Transaction>;
}