Skip to content

Commit

Permalink
Add initiate withdrawal action (#15)
Browse files Browse the repository at this point in the history
* Add initiateWithdrawal action

* 1.4.0
  • Loading branch information
gndelia authored Aug 5, 2024
1 parent a7aae77 commit 20a0d31
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
20 changes: 20 additions & 0 deletions src/actions/wallet/bitcoin-tunnel-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
}

0 comments on commit 20a0d31

Please sign in to comment.