@tapforce/pod-bridge-sdk 1.1.16 → 1.1.17

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.
@@ -43,7 +43,7 @@ export declare class SourceChainTrackerService {
43
43
  blockNumber: number;
44
44
  }>>;
45
45
  /**
46
- * Get current finalized block number
46
+ * Get current finalized block number using RPC's finalized block tag
47
47
  */
48
48
  getFinalizedBlockNumber(): Promise<number>;
49
49
  /**
@@ -135,9 +135,19 @@ class SourceChainTrackerService {
135
135
  return claimedMap;
136
136
  }
137
137
  /**
138
- * Get current finalized block number
138
+ * Get current finalized block number using RPC's finalized block tag
139
139
  */
140
140
  async getFinalizedBlockNumber() {
141
+ try {
142
+ const finalizedBlock = await this.provider.getBlock('finalized');
143
+ if (finalizedBlock) {
144
+ return finalizedBlock.number;
145
+ }
146
+ }
147
+ catch (error) {
148
+ console.warn('[SourceChain] Failed to fetch finalized block, falling back to manual calculation:', error);
149
+ }
150
+ // Fallback: Use manual calculation if RPC doesn't support finalized tag
141
151
  const currentBlock = await this.provider.getBlockNumber();
142
152
  return currentBlock - 64; // 2 epochs (32 x 2 blocks) ~15 minutes on Sepolia
143
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapforce/pod-bridge-sdk",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "SDK for interacting with Bridges between pod and other chains",
5
5
  "keywords": [
6
6
  "pod",