From a3679e2f9c14b52c6869553dfd071b474da40e44 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 22 Apr 2024 11:26:40 +0200 Subject: [PATCH] Adjust to tBTC SDK v2.4.1 --- src/tbtc/mock-bitcoin-client.ts | 4 ++++ src/threshold-ts/tbtc/index.ts | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tbtc/mock-bitcoin-client.ts b/src/tbtc/mock-bitcoin-client.ts index b2af9265a..0a73f24b6 100644 --- a/src/tbtc/mock-bitcoin-client.ts +++ b/src/tbtc/mock-bitcoin-client.ts @@ -292,4 +292,8 @@ export class MockBitcoinClient implements BitcoinClient { } }) } + + getCoinbaseTxHash(blockHeight: number): Promise { + throw new Error("Method not implemented") + } } diff --git a/src/threshold-ts/tbtc/index.ts b/src/threshold-ts/tbtc/index.ts index 3aaa0921f..40281d999 100644 --- a/src/threshold-ts/tbtc/index.ts +++ b/src/threshold-ts/tbtc/index.ts @@ -11,10 +11,11 @@ import { ElectrumClient, ethereumAddressFromSigner, EthereumBridge, - ethereumNetworkFromSigner, + chainIdFromSigner, Hex, - loadEthereumContracts, + loadEthereumCoreContracts, TBTC as SDK, + Chains, } from "@keep-network/tbtc-v2.ts" import { BigNumber, @@ -506,11 +507,11 @@ export class TBTC implements ITBTC { // For both of these cases we will use SDK.initializeCustom() method if (clientFromConfig || shouldUseTestnetDevelopmentContracts) { const depositorAddress = await ethereumAddressFromSigner(signer) - const ethereumNetwork = await ethereumNetworkFromSigner(signer) + const chainId = await chainIdFromSigner(signer) const tbtcContracts = shouldUseTestnetDevelopmentContracts ? getSepoliaDevelopmentContracts(signer) - : await loadEthereumContracts(signer, ethereumNetwork) + : await loadEthereumCoreContracts(signer, chainId as Chains.Ethereum) this._sdk = await SDK.initializeCustom(tbtcContracts, this._bitcoinClient)