tso-data-models
Advanced tools
Comparing version 1.0.10 to 1.0.11
import { BigNumber } from "ethers"; | ||
import { OpenEpoch } from "./OpenEpoch"; | ||
export declare class PriceSubmission { | ||
epochNumber: number; | ||
assetName: string; | ||
assetAddress: string; | ||
ftsoRegistryAddress: string; | ||
providerAddress: string; | ||
submitTime?: number; | ||
targetSubmitTime?: number; | ||
actualSubmitTime?: number; | ||
randomNumber?: number; | ||
@@ -11,7 +15,8 @@ submitPrice?: BigNumber; | ||
wonReward: boolean; | ||
constructor(providerAddress: string, assetName: string, assetAddress: string); | ||
constructor(submitterAddress: string, assetName: string, assetAddress: string, epochData: OpenEpoch, submitDelay: number); | ||
getSubmitPriceHash(): string; | ||
setSubmissionData(submissionPrice: BigNumber): void; | ||
initializeSubmissionData(epochData: OpenEpoch, submitDelay: number): void; | ||
setResults(outputPrice: BigNumber, wonReward: boolean): void; | ||
} | ||
//# sourceMappingURL=PriceSubmission.d.ts.map |
@@ -6,7 +6,8 @@ "use strict"; | ||
var PriceSubmission = /** @class */ (function () { | ||
function PriceSubmission(providerAddress, assetName, assetAddress) { | ||
function PriceSubmission(submitterAddress, assetName, assetAddress, epochData, submitDelay) { | ||
this.wonReward = false; | ||
this.assetName = assetName; | ||
this.providerAddress = providerAddress; | ||
this.providerAddress = submitterAddress; | ||
this.assetAddress = assetAddress; | ||
this.initializeSubmissionData(epochData, submitDelay); | ||
} | ||
@@ -19,7 +20,9 @@ PriceSubmission.prototype.getSubmitPriceHash = function () { | ||
this.submitPrice = submissionPrice; | ||
this.submitTime = Date.now(); | ||
//TODO Set Random Number | ||
// Generate Random Number | ||
this.randomNumber = 0; | ||
this.actualSubmitTime = Date.now(); | ||
this.randomNumber = Math.floor(Math.random() * 100000); | ||
}; | ||
PriceSubmission.prototype.initializeSubmissionData = function (epochData, submitDelay) { | ||
this.epochNumber = epochData.epochNumber; | ||
this.targetSubmitTime = epochData.calculateSubmitTime(submitDelay); | ||
}; | ||
PriceSubmission.prototype.setResults = function (outputPrice, wonReward) { | ||
@@ -26,0 +29,0 @@ this.outputPrice = outputPrice; |
{ | ||
"name": "tso-data-models", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
import { BigNumber, ethers } from "ethers"; | ||
import { OpenEpoch } from "./OpenEpoch"; | ||
export class PriceSubmission { | ||
epochNumber: number; | ||
assetName: string; | ||
assetAddress: string; | ||
ftsoRegistryAddress: string; | ||
providerAddress: string; | ||
submitTime?: number; | ||
targetSubmitTime?: number; | ||
actualSubmitTime?: number; | ||
randomNumber?: number; | ||
@@ -13,6 +17,7 @@ submitPrice?: BigNumber; | ||
constructor(providerAddress: string, assetName: string, assetAddress: string) { | ||
constructor(submitterAddress: string, assetName: string, assetAddress: string, epochData: OpenEpoch, submitDelay: number) { | ||
this.assetName = assetName; | ||
this.providerAddress = providerAddress; | ||
this.providerAddress = submitterAddress; | ||
this.assetAddress = assetAddress; | ||
this.initializeSubmissionData(epochData, submitDelay); | ||
} | ||
@@ -26,8 +31,11 @@ | ||
this.submitPrice = submissionPrice; | ||
this.submitTime = Date.now(); | ||
//TODO Set Random Number | ||
// Generate Random Number | ||
this.randomNumber = 0; | ||
this.actualSubmitTime = Date.now(); | ||
this.randomNumber = Math.floor(Math.random() * 100000); | ||
} | ||
initializeSubmissionData(epochData: OpenEpoch, submitDelay: number) { | ||
this.epochNumber = epochData.epochNumber; | ||
this.targetSubmitTime = epochData.calculateSubmitTime(submitDelay); | ||
} | ||
setResults(outputPrice: BigNumber, wonReward: boolean) { | ||
@@ -34,0 +42,0 @@ this.outputPrice = outputPrice; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
49672
730