36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
|
|
var Flowee = require('bindings')('flowee')
|
||
|
|
// some fun logging callbacks.
|
||
|
|
Flowee.onConnectHub = function(version) {
|
||
|
|
console.log("connected to Flowee the Hub!")
|
||
|
|
console.log("version reported: " + version)
|
||
|
|
}
|
||
|
|
|
||
|
|
// some fun logging callbacks.
|
||
|
|
Flowee.onConnectIndexer = function(services) {
|
||
|
|
console.log("Connected to Flowee Indexer! " + services)
|
||
|
|
}
|
||
|
|
|
||
|
|
function detailTx(txid) {
|
||
|
|
return Flowee.search([
|
||
|
|
{
|
||
|
|
value: txid,
|
||
|
|
type: Flowee.Job.FetchTx,
|
||
|
|
txFilter: [ Flowee.IncludeInputs, Flowee.IncludeOutputs ]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
type: Flowee.Job.FetchBlockHeader
|
||
|
|
}
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
|
||
|
|
Flowee.connect().then(async function() {
|
||
|
|
try {
|
||
|
|
const result = await detailTx("b39fa6c39b99683ac8f456721b270786c627ecb246700888315991877024b983");
|
||
|
|
console.log("Promise finished. " + result.transactions);
|
||
|
|
console.log(" " + result.block300000.hash);
|
||
|
|
} catch (error) {
|
||
|
|
console.log("Failure: " + error);
|
||
|
|
}
|
||
|
|
process.exit();
|
||
|
|
});
|