@tapforce/pod-bridge-sdk 1.1.5 → 1.1.7

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.
@@ -45,7 +45,6 @@ export declare class BridgedToPodActionClient {
45
45
  id: string | bigint;
46
46
  token: string;
47
47
  blockNumber: string | bigint | number;
48
- contractAddress: string;
49
48
  from?: string;
50
49
  }): UnsignedTransaction;
51
50
  /**
@@ -60,7 +59,6 @@ export declare class BridgedToPodActionClient {
60
59
  claimNativeWithBlockNumber(args: {
61
60
  id: string | bigint;
62
61
  blockNumber: string | bigint | number;
63
- contractAddress: string;
64
62
  from?: string;
65
63
  }): UnsignedTransaction;
66
64
  }
@@ -66,7 +66,8 @@ class PodBridgeTrackerClient {
66
66
  to: parsed.args.to,
67
67
  token: parsed.args.token,
68
68
  amount: parsed.args.amount.toString(),
69
- isClaimed: false
69
+ isClaimed: false,
70
+ isClaimable: false
70
71
  });
71
72
  }
72
73
  }
@@ -86,7 +87,8 @@ class PodBridgeTrackerClient {
86
87
  to: parsed.args.to,
87
88
  token: ethers_1.ethers.ZeroAddress, // Native token
88
89
  amount: parsed.args.amount.toString(),
89
- isClaimed: false
90
+ isClaimed: false,
91
+ isClaimable: false
90
92
  });
91
93
  }
92
94
  }
@@ -142,7 +144,8 @@ class PodBridgeTrackerClient {
142
144
  to: parsed.args.to,
143
145
  token: parsed.args.token,
144
146
  amount: parsed.args.amount.toString(),
145
- isClaimed: false
147
+ isClaimed: false,
148
+ isClaimable: false
146
149
  });
147
150
  }
148
151
  }
@@ -162,7 +165,8 @@ class PodBridgeTrackerClient {
162
165
  to: parsed.args.to,
163
166
  token: ethers_1.ethers.ZeroAddress,
164
167
  amount: parsed.args.amount.toString(),
165
- isClaimed: false
168
+ isClaimed: false,
169
+ isClaimable: false
166
170
  });
167
171
  }
168
172
  }
@@ -274,6 +278,9 @@ class PodBridgeTrackerClient {
274
278
  });
275
279
  }
276
280
  }
281
+ // Get current block to check finalization
282
+ const currentBlock = await this.bridgedProvider.getBlockNumber();
283
+ const finalizedBlock = currentBlock - 15; // ~15 minutes on Sepolia
277
284
  // Update deposit status
278
285
  for (const deposit of deposits) {
279
286
  const claimInfo = claimedMap.get(deposit.requestId);
@@ -283,10 +290,23 @@ class PodBridgeTrackerClient {
283
290
  deposit.claimedAt = claimInfo.timestamp;
284
291
  deposit.claimedBy = claimInfo.claimer;
285
292
  }
293
+ // Check if deposit is claimable (finalized and not claimed)
294
+ deposit.isClaimable = deposit.blockNumber <= finalizedBlock && !deposit.isClaimed;
286
295
  }
287
296
  }
288
297
  catch (error) {
289
298
  console.error('Error checking claim status:', error);
299
+ // Fallback: Still calculate isClaimable based on finalization even if claim check fails
300
+ try {
301
+ const currentBlock = await this.bridgedProvider.getBlockNumber();
302
+ const finalizedBlock = currentBlock - 15;
303
+ for (const deposit of deposits) {
304
+ deposit.isClaimable = deposit.blockNumber <= finalizedBlock && !deposit.isClaimed;
305
+ }
306
+ }
307
+ catch (fallbackError) {
308
+ console.error('Error calculating isClaimable:', fallbackError);
309
+ }
290
310
  }
291
311
  }
292
312
  /**
@@ -30,6 +30,7 @@ export interface BridgeRequest {
30
30
  token: string;
31
31
  amount: string;
32
32
  isClaimed: boolean;
33
+ isClaimable: boolean;
33
34
  claimedTxHash?: string;
34
35
  claimedAt?: number;
35
36
  claimedBy?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapforce/pod-bridge-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "SDK for interacting with Bridges between pod and other chains",
5
5
  "keywords": [
6
6
  "pod",