btcrelay-bitcoind
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -44,2 +44,3 @@ /// <reference types="node" /> | ||
constructor(protocol: string, user: string, pass: string, host: string, port: number); | ||
getTipHeight(): Promise<number>; | ||
getBlockHeader(blockhash: string): Promise<BitcoindBlock>; | ||
@@ -46,0 +47,0 @@ isInMainChain(blockhash: string): Promise<boolean>; |
@@ -27,2 +27,16 @@ "use strict"; | ||
} | ||
getTipHeight() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const retrievedInfo = yield new Promise((resolve, reject) => { | ||
this.rpc.getBlockchainInfo((err, info) => { | ||
if (err) { | ||
reject(err); | ||
return; | ||
} | ||
resolve(info.result); | ||
}); | ||
}); | ||
return retrievedInfo.blocks; | ||
}); | ||
} | ||
getBlockHeader(blockhash) { | ||
@@ -29,0 +43,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "btcrelay-bitcoind", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Connector and synchronizer using bitcoind for bitcoin relay", | ||
@@ -29,5 +29,5 @@ "main": "./dist/index.js", | ||
"bn.js": "^5.2.1", | ||
"crosslightning-base": "^2.0.2", | ||
"crosslightning-base": "^3.0.4", | ||
"typescript": "^4.9.5" | ||
} | ||
} |
@@ -88,2 +88,18 @@ import {BitcoindBlock, BitcoindBlockType} from "./BitcoindBlock"; | ||
async getTipHeight(): Promise<number> { | ||
const retrievedInfo: any = await new Promise((resolve, reject) => { | ||
this.rpc.getBlockchainInfo((err, info) => { | ||
if(err) { | ||
reject(err); | ||
return; | ||
} | ||
resolve(info.result); | ||
}); | ||
}); | ||
return retrievedInfo.blocks; | ||
} | ||
async getBlockHeader(blockhash: string): Promise<BitcoindBlock> { | ||
@@ -90,0 +106,0 @@ const retrievedHeader = await new Promise<BitcoindBlockType>((resolve, reject) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49116
968
+ Addedcrosslightning-base@3.3.1(transitive)
- Removedcrosslightning-base@2.0.3(transitive)
Updatedcrosslightning-base@^3.0.4