Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tso-data-models

Package Overview
Dependencies
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tso-data-models - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

9

lib/models/epoch/PriceSubmission.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc