2023-06-24 11:21:58 -07:00
|
|
|
/* tslint:disable */
|
|
|
|
/* eslint-disable */
|
|
|
|
|
|
|
|
/* auto-generated by NAPI-RS */
|
|
|
|
|
2023-06-28 16:31:59 -04:00
|
|
|
export interface ThreadTransaction {
|
|
|
|
uid: number
|
2023-07-02 20:05:30 -04:00
|
|
|
order: number
|
2023-06-28 16:31:59 -04:00
|
|
|
fee: number
|
|
|
|
weight: number
|
|
|
|
sigops: number
|
|
|
|
effectiveFeePerVsize: number
|
|
|
|
inputs: Array<number>
|
|
|
|
}
|
2023-07-18 15:05:44 +09:00
|
|
|
export interface ThreadAcceleration {
|
|
|
|
uid: number
|
|
|
|
delta: number
|
|
|
|
}
|
2023-06-24 23:05:43 -07:00
|
|
|
export class GbtGenerator {
|
|
|
|
constructor()
|
2023-06-25 16:08:16 -07:00
|
|
|
/**
|
|
|
|
* # Errors
|
|
|
|
*
|
|
|
|
* Rejects if the thread panics or if the Mutex is poisoned.
|
|
|
|
*/
|
2023-07-18 15:05:44 +09:00
|
|
|
make(mempool: Array<ThreadTransaction>, accelerations: Array<ThreadAcceleration>, maxUid: number): Promise<GbtResult>
|
2023-06-25 16:08:16 -07:00
|
|
|
/**
|
|
|
|
* # Errors
|
|
|
|
*
|
|
|
|
* Rejects if the thread panics or if the Mutex is poisoned.
|
|
|
|
*/
|
2023-07-18 15:05:44 +09:00
|
|
|
update(newTxs: Array<ThreadTransaction>, removeTxs: Array<number>, accelerations: Array<ThreadAcceleration>, maxUid: number): Promise<GbtResult>
|
2023-06-24 23:05:43 -07:00
|
|
|
}
|
2023-06-24 12:21:33 -07:00
|
|
|
/**
|
|
|
|
* The result from calling the gbt function.
|
|
|
|
*
|
|
|
|
* This tuple contains the following:
|
2023-06-26 14:22:10 -04:00
|
|
|
* blocks: A 2D Vector of transaction IDs (u32), the inner Vecs each represent a block.
|
|
|
|
* block_weights: A Vector of total weights per block.
|
|
|
|
* clusters: A 2D Vector of transaction IDs representing clusters of dependent mempool transactions
|
|
|
|
* rates: A Vector of tuples containing transaction IDs (u32) and effective fee per vsize (f64)
|
2023-06-24 12:21:33 -07:00
|
|
|
*/
|
2023-06-24 11:21:58 -07:00
|
|
|
export class GbtResult {
|
|
|
|
blocks: Array<Array<number>>
|
2023-06-26 14:22:10 -04:00
|
|
|
blockWeights: Array<number>
|
2023-06-24 11:21:58 -07:00
|
|
|
clusters: Array<Array<number>>
|
|
|
|
rates: Array<Array<number>>
|
2024-01-09 17:08:25 +00:00
|
|
|
overflow: Array<number>
|
|
|
|
constructor(blocks: Array<Array<number>>, blockWeights: Array<number>, clusters: Array<Array<number>>, rates: Array<Array<number>>, overflow: Array<number>)
|
2023-06-24 11:21:58 -07:00
|
|
|
}
|