Skip to content

Commit

Permalink
feat: update sbtc package
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf committed Dec 14, 2024
1 parent 0a12712 commit be2723f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
"redux-persist": "6.0.0",
"remark-gfm": "4.0.0",
"rxjs": "7.8.1",
"sbtc": "0.2.5",
"sbtc": "0.3.0",
"style-loader": "3.3.4",
"ts-debounce": "4.0.0",
"url": "0.11.3",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

11 changes: 4 additions & 7 deletions src/app/pages/swap/hooks/use-sbtc-deposit-transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import { useMemo } from 'react';
import { useNavigate } from 'react-router-dom';

import { bytesToHex } from '@noble/hashes/utils';
import * as btc from '@scure/btc-signer';
import type { P2TROut } from '@scure/btc-signer/payment';
import {
MAINNET,
REGTEST,
SbtcApiClient,
SbtcApiClientMainnet,
SbtcApiClientTestnet,
TESTNET,
buildSbtcDepositTx,
Expand Down Expand Up @@ -57,12 +58,7 @@ function getSbtcNetworkConfig(network: BitcoinNetworkModes) {
}

// TODO: Set config paths, or likely remove when defaults are published
const clientMainnet = new SbtcApiClient({
sbtcContract: '',
btcApiUrl: '',
stxApiUrl: '',
sbtcApiUrl: '',
});
const clientMainnet = new SbtcApiClientMainnet();
const clientTestnet = new SbtcApiClientTestnet();

export function useSbtcDepositTransaction() {
Expand Down Expand Up @@ -96,6 +92,7 @@ export function useSbtcDepositTransaction() {
signersPublicKey: await client.fetchSignersPublicKey(),
maxSignerFee,
reclaimLockTime,
reclaimPublicKey: bytesToHex(signer.publicKey).slice(2),
});

const { inputs, outputs, fee } = determineUtxosForSpend({
Expand Down

0 comments on commit be2723f

Please sign in to comment.