@bosonprotocol/eth-connect-sdk
Advanced tools
Comparing version
@@ -18,2 +18,3 @@ import { RequestManager } from "eth-connect"; | ||
constructor(requestManager: RequestManager, externalFeatures: ExternalFeatures, requestManagerSigner?: RequestManager); | ||
getCurrentTimeMs(): Promise<number>; | ||
getSignerAddress(): Promise<string>; | ||
@@ -20,0 +21,0 @@ isSignerContract(): Promise<boolean>; |
@@ -25,2 +25,8 @@ "use strict"; | ||
} | ||
getCurrentTimeMs() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { timestamp } = yield this._requestManager.eth_getBlockByNumber("latest", false); | ||
return Number(timestamp.valueOf()) * 1000; // Convert seconds to milliseconds | ||
}); | ||
} | ||
getSignerAddress() { | ||
@@ -86,6 +92,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
const blockNumber = yield this._requestManager.eth_blockNumber(); | ||
return this._requestManager.eth_call({ | ||
data: transactionRequest.data, | ||
to: transactionRequest.to | ||
}, blockNumber); | ||
return this._requestManager.eth_call({ data: transactionRequest.data, to: transactionRequest.to }, blockNumber); | ||
}); | ||
@@ -92,0 +95,0 @@ } |
@@ -18,2 +18,3 @@ import { RequestManager } from "eth-connect"; | ||
constructor(requestManager: RequestManager, externalFeatures: ExternalFeatures, requestManagerSigner?: RequestManager); | ||
getCurrentTimeMs(): Promise<number>; | ||
getSignerAddress(): Promise<string>; | ||
@@ -20,0 +21,0 @@ isSignerContract(): Promise<boolean>; |
@@ -18,2 +18,6 @@ const TX_POLLING_DELAY = 2000; | ||
} | ||
async getCurrentTimeMs() { | ||
const { timestamp } = await this._requestManager.eth_getBlockByNumber("latest", false); | ||
return Number(timestamp.valueOf()) * 1000; // Convert seconds to milliseconds | ||
} | ||
async getSignerAddress() { | ||
@@ -66,6 +70,3 @@ if (this._externalFeatures?.getSignerAddress) { | ||
const blockNumber = await this._requestManager.eth_blockNumber(); | ||
return this._requestManager.eth_call({ | ||
data: transactionRequest.data, | ||
to: transactionRequest.to | ||
}, blockNumber); | ||
return this._requestManager.eth_call({ data: transactionRequest.data, to: transactionRequest.to }, blockNumber); | ||
} | ||
@@ -72,0 +73,0 @@ async estimateGas(transactionRequest) { |
{ | ||
"name": "@bosonprotocol/eth-connect-sdk", | ||
"version": "1.8.0-alpha.10", | ||
"version": "1.8.0-alpha.11", | ||
"description": "Implementation of the Web3LibAdapter interface and contract abstractions targeting eth-connect for the Boson Protocol.", | ||
@@ -34,3 +34,3 @@ "main": "./dist/cjs/index.js", | ||
"dependencies": { | ||
"@bosonprotocol/common": "^1.31.0-alpha.10" | ||
"@bosonprotocol/common": "^1.31.0-alpha.11" | ||
}, | ||
@@ -51,3 +51,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "40d4ae1898ec1eeda499376adb93246f9356552b" | ||
"gitHead": "811cf4e62fa187e2092d4f6484b7929eb45547fd" | ||
} |
@@ -39,2 +39,10 @@ import { RequestManager } from "eth-connect"; | ||
async getCurrentTimeMs(): Promise<number> { | ||
const { timestamp } = await this._requestManager.eth_getBlockByNumber( | ||
"latest", | ||
false | ||
); | ||
return Number(timestamp.valueOf()) * 1000; // Convert seconds to milliseconds | ||
} | ||
public async getSignerAddress() { | ||
@@ -101,6 +109,3 @@ if (this._externalFeatures?.getSignerAddress) { | ||
return this._requestManager.eth_call( | ||
{ | ||
data: transactionRequest.data, | ||
to: transactionRequest.to | ||
}, | ||
{ data: transactionRequest.data, to: transactionRequest.to }, | ||
blockNumber | ||
@@ -107,0 +112,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52509
2.35%551
1.85%