@atomiqlabs/chain-starknet 1.0.0-beta.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -149,9 +149,9 @@ class StarknetSwapContract extends StarknetContractBase_1.StarknetContractBase {
|
|
|
149
149
|
isExpired(signer, data) {
|
|
150
150
|
let currentTimestamp = BigInt(Math.floor(Date.now() / 1000));
|
|
151
151
|
if (data.isClaimer(signer))
|
|
152
|
-
currentTimestamp = currentTimestamp - BigInt(this.refundGracePeriod);
|
|
153
|
-
if (data.isOfferer(signer))
|
|
154
152
|
currentTimestamp = currentTimestamp + BigInt(this.claimGracePeriod);
|
|
153
|
+
if (data.isOfferer(signer))
|
|
154
|
+
currentTimestamp = currentTimestamp - BigInt(this.refundGracePeriod);
|
|
155
155
|
return Promise.resolve(data.getExpiry() < currentTimestamp);
|
|
156
156
|
}
|
|
157
157
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomiqlabs/chain-starknet",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Starknet specific base implementation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types:": "./dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "adambor",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atomiqlabs/base": "8.0.0
|
|
25
|
+
"@atomiqlabs/base": "8.0.0",
|
|
26
26
|
"@scure/btc-signer": "1.6.0",
|
|
27
27
|
"abi-wan-kanabi": "2.2.4",
|
|
28
28
|
"buffer": "6.0.3",
|
|
@@ -218,8 +218,8 @@ export class StarknetSwapContract
|
|
|
218
218
|
*/
|
|
219
219
|
isExpired(signer: string, data: StarknetSwapData): Promise<boolean> {
|
|
220
220
|
let currentTimestamp: bigint = BigInt(Math.floor(Date.now()/1000));
|
|
221
|
-
if(data.isClaimer(signer)) currentTimestamp = currentTimestamp
|
|
222
|
-
if(data.isOfferer(signer)) currentTimestamp = currentTimestamp
|
|
221
|
+
if(data.isClaimer(signer)) currentTimestamp = currentTimestamp + BigInt(this.claimGracePeriod);
|
|
222
|
+
if(data.isOfferer(signer)) currentTimestamp = currentTimestamp - BigInt(this.refundGracePeriod);
|
|
223
223
|
return Promise.resolve(data.getExpiry() < currentTimestamp);
|
|
224
224
|
}
|
|
225
225
|
|