UNPKG

locklift

Version:

Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.

23 lines (22 loc) 820 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SeService = void 0; const httpService_1 = require("../httpService"); class SeService { rpcUrl; constructor(rpcUrl) { this.rpcUrl = rpcUrl; } getCurrentOffsetTime = () => { return httpService_1.httpService.post(`${this.rpcUrl}/se/time-delta`).then(res => Number(res.data)); }; setTimeOffset = (offsetInSeconds) => { return httpService_1.httpService .post(`${this.rpcUrl}/se/increase-time?delta=${offsetInSeconds.toString()}`) .then(() => this.getCurrentOffsetTime()); }; resetTimeOffset = () => { return httpService_1.httpService.post(`${this.rpcUrl}/se/reset-time`).then(() => this.getCurrentOffsetTime()); }; } exports.SeService = SeService;