Pass gbt mempool data directly without serialization

This commit is contained in:
Mononaut
2023-06-28 16:31:59 -04:00
parent 5065fa42d0
commit 0886e850f9
8 changed files with 70 additions and 131 deletions

View File

@@ -3,6 +3,14 @@
/* auto-generated by NAPI-RS */
export interface ThreadTransaction {
uid: number
fee: number
weight: number
sigops: number
effectiveFeePerVsize: number
inputs: Array<number>
}
export class GbtGenerator {
constructor()
/**
@@ -10,13 +18,13 @@ export class GbtGenerator {
*
* Rejects if the thread panics or if the Mutex is poisoned.
*/
make(mempoolBuffer: Uint8Array): Promise<GbtResult>
make(mempool: Array<ThreadTransaction>): Promise<GbtResult>
/**
* # Errors
*
* Rejects if the thread panics or if the Mutex is poisoned.
*/
update(newTxs: Uint8Array, removeTxs: Uint8Array): Promise<GbtResult>
update(newTxs: Array<ThreadTransaction>, removeTxs: Array<number>): Promise<GbtResult>
}
/**
* The result from calling the gbt function.