crosslightning-evm
Advanced tools
Comparing version 3.0.9 to 3.1.0
{ | ||
"name": "crosslightning-evm", | ||
"version": "3.0.9", | ||
"version": "3.1.0", | ||
"description": "EVM specific base implementation", | ||
@@ -27,3 +27,3 @@ "main": "./dist/index.js", | ||
"bn.js": "^5.2.1", | ||
"crosslightning-base": "^3.0.8", | ||
"crosslightning-base": "^3.2.0", | ||
"ethers": "^5.7.2", | ||
@@ -30,0 +30,0 @@ "typescript": "^4.9.5" |
@@ -14,2 +14,3 @@ import * as BN from "bn.js"; | ||
import {EVMBtcStoredHeader} from "../btcrelay/headers/EVMBtcStoredHeader"; | ||
import {SolanaSwapData} from "../../../../crosslightning-solana/src"; | ||
@@ -257,2 +258,19 @@ const STATE_SEED = "state"; | ||
async getClaimInitAuthorizationExpiry(swapData: EVMSwapData, timeout: string, prefix: string, signature: string, nonce: number): Promise<number> { | ||
const now = Date.now(); | ||
const expiry = (parseInt(timeout)-this.authGracePeriod)*1000; | ||
if(expiry<now) { | ||
return 0; | ||
} | ||
return expiry; | ||
} | ||
async isClaimInitAuthorizationExpired(swapData: EVMSwapData, timeout: string, prefix: string, signature: string, nonce: number): Promise<boolean> { | ||
if((parseInt(timeout)+this.authGracePeriod)*1000 < Date.now()) return true; | ||
return false; | ||
} | ||
getInitMessage(swapData: EVMSwapData, nonce: number, prefix: string, timeout: string): Buffer { | ||
@@ -321,2 +339,19 @@ | ||
async getInitAuthorizationExpiry(swapData: EVMSwapData, timeout: string, prefix: string, signature: string, nonce: number): Promise<number> { | ||
const now = Date.now(); | ||
const expiry = (parseInt(timeout)-this.authGracePeriod)*1000; | ||
if(expiry<now) { | ||
return 0; | ||
} | ||
return expiry; | ||
} | ||
async isInitAuthorizationExpired(swapData: EVMSwapData, timeout: string, prefix: string, signature: string, nonce: number): Promise<boolean> { | ||
if((parseInt(timeout)+this.authGracePeriod)*1000 < Date.now()) return true; | ||
return false; | ||
} | ||
getRefundMessage(swapData: EVMSwapData, prefix: string, timeout: string): Buffer { | ||
@@ -323,0 +358,0 @@ return this.getMessage(swapData, prefix, timeout); |
681530
82
16394
5
Updatedcrosslightning-base@^3.2.0