@atomiqlabs/chain-starknet 8.4.4 → 8.4.5

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.
@@ -220,7 +220,7 @@ class StarknetBtcRelay extends StarknetContractBase_1.StarknetContractBase {
220
220
  return null;
221
221
  }
222
222
  catch (e) {
223
- if (e.baseError?.code === 40 && e.baseError?.revert_error != null)
223
+ if (e.baseError?.code === 40 && e.baseError?.data?.revert_error != null)
224
224
  return null;
225
225
  throw e;
226
226
  }
@@ -243,7 +243,7 @@ class StarknetBtcRelay extends StarknetContractBase_1.StarknetContractBase {
243
243
  return null;
244
244
  }
245
245
  catch (e) {
246
- if (e.baseError?.code === 40 && e.baseError?.revert_error != null)
246
+ if (e.baseError?.code === 40 && e.baseError?.data?.revert_error != null)
247
247
  return null;
248
248
  throw e;
249
249
  }
@@ -262,7 +262,7 @@ class StarknetBtcRelay extends StarknetContractBase_1.StarknetContractBase {
262
262
  const [isInBtcMainChain, btcRelayCommitHash] = await Promise.all([
263
263
  this._bitcoinRpc.isInMainChain(blockHashHex),
264
264
  this.contract.get_commit_hash(storedHeader.getBlockheight()).catch(e => {
265
- if (e.baseError?.code === 40 && e.baseError?.revert_error != null)
265
+ if (e.baseError?.code === 40 && e.baseError?.data?.revert_error != null)
266
266
  return 0n;
267
267
  throw e;
268
268
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/chain-starknet",
3
- "version": "8.4.4",
3
+ "version": "8.4.5",
4
4
  "description": "Starknet specific base implementation",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -286,7 +286,7 @@ export class StarknetBtcRelay<B extends BtcBlock>
286
286
  const chainCommitment = await this.contract.get_commit_hash(storedBlockHeader.getBlockheight());
287
287
  if(BigInt(chainCommitment)!==BigInt(commitHash)) return null;
288
288
  } catch (e: any) {
289
- if(e.baseError?.code===40 && e.baseError?.revert_error!=null) return null;
289
+ if(e.baseError?.code===40 && e.baseError?.data?.revert_error!=null) return null;
290
290
  throw e;
291
291
  }
292
292
 
@@ -310,7 +310,7 @@ export class StarknetBtcRelay<B extends BtcBlock>
310
310
  const chainCommitment = await this.contract.get_commit_hash(storedBlockHeader.getBlockheight());
311
311
  if(BigInt(chainCommitment)!==BigInt(commitHash)) return null;
312
312
  } catch (e: any) {
313
- if(e.baseError?.code===40 && e.baseError?.revert_error!=null) return null;
313
+ if(e.baseError?.code===40 && e.baseError?.data?.revert_error!=null) return null;
314
314
  throw e;
315
315
  }
316
316
 
@@ -339,7 +339,7 @@ export class StarknetBtcRelay<B extends BtcBlock>
339
339
  const [isInBtcMainChain, btcRelayCommitHash] = await Promise.all([
340
340
  this._bitcoinRpc.isInMainChain(blockHashHex),
341
341
  this.contract.get_commit_hash(storedHeader.getBlockheight()).catch(e => {
342
- if(e.baseError?.code===40 && e.baseError?.revert_error!=null) return 0n;
342
+ if(e.baseError?.code===40 && e.baseError?.data?.revert_error!=null) return 0n;
343
343
  throw e;
344
344
  })
345
345
  ]);