diff --git a/package-lock.json b/package-lock.json index 3a974f4..ab3aa91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hemi-viem", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hemi-viem", - "version": "1.3.0", + "version": "1.4.0", "license": "MIT", "devDependencies": { "husky": "4.3.8", diff --git a/package.json b/package.json index 17aa37c..c2a777c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hemi-viem", - "version": "1.3.0", + "version": "1.4.0", "description": "Viem extension for the Hemi Network", "bugs": { "url": "https://github.com/hemilabs/hemi-viem/issues" diff --git a/src/actions/wallet/bitcoin-tunnel-manager.ts b/src/actions/wallet/bitcoin-tunnel-manager.ts index cdf13b3..ca9a6cf 100644 --- a/src/actions/wallet/bitcoin-tunnel-manager.ts +++ b/src/actions/wallet/bitcoin-tunnel-manager.ts @@ -21,3 +21,23 @@ export function confirmDeposit( functionName: "confirmDeposit", }); } + +export function initiateWithdrawal( + client: Client, + parameters: { + amount: bigint; + btcAddress: string; + from: Address; + ownerAddress: Address; + }, +) { + const { amount, btcAddress, from, ownerAddress } = parameters; + return writeContract(client, { + abi: bitcoinTunnelManagerAbi, + account: from, + address: bitcoinTunnelManagerAddresses[client.chain!.id], + args: [btcAddress, amount, ownerAddress], + chain: client.chain!, + functionName: "initiateWithdrawal", + }); +}