@atomiqlabs/chain-starknet 1.0.0-beta.0 → 1.0.0-beta.1

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-beta.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "Starknet specific base implementation",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -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 - BigInt(this.refundGracePeriod);
222
- if(data.isOfferer(signer)) currentTimestamp = currentTimestamp + BigInt(this.claimGracePeriod);
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