Use N-API ThreadsafeFunction

This commit is contained in:
junderw
2023-06-24 12:21:33 -07:00
committed by Mononaut
parent 152d2c364b
commit 4661bea2f0
2 changed files with 38 additions and 24 deletions

View File

@@ -3,8 +3,16 @@
/* auto-generated by NAPI-RS */
export function make(mempoolBuffer: Uint8Array, callback: (arg0: GbtResult) => void): void
export function update(newTxs: Uint8Array, removeTxs: Uint8Array, callback: (arg0: GbtResult) => void): void
export function make(mempoolBuffer: Uint8Array, callback: (result: GbtResult) => void): void
export function update(newTxs: Uint8Array, removeTxs: Uint8Array, callback: (result: GbtResult) => void): void
/**
* The result from calling the gbt function.
*
* This tuple contains the following:
* blocks: A 2D Vector of transaction IDs (u32), the inner Vecs each represent a 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)
*/
export class GbtResult {
blocks: Array<Array<number>>
clusters: Array<Array<number>>