Connect Wallet
@@ -152,8 +169,16 @@ const ConnectWallet = ({ onClose }: ConnectWalletProps) => {
alt={provider.name}
/>
- {provider.name}{" "}
- {!available && " is not available click to install"}
+ {provider.walletProvider === WalletProvider.ASIGNA &&
+ !available ? (
+ "Open as an embedded app in Asigna"
+ ) : (
+ <>
+ {provider.name}
+ {""}
+ {!available && " is not available click to install"}
+ >
+ )}
{available ? (
diff --git a/src/comps/Deposit.tsx b/src/comps/Deposit.tsx
index 0e0e8357..1690ef18 100644
--- a/src/comps/Deposit.tsx
+++ b/src/comps/Deposit.tsx
@@ -40,6 +40,7 @@ import { sendBTCLeather, sendBTCXverse } from "@/util/wallet-utils";
import useMintCaps from "@/hooks/use-mint-caps";
import { getAggregateKey } from "@/util/get-aggregate-key";
import getBitcoinNetwork from "@/util/get-bitcoin-network";
+import { useAsignaConnect } from "@asigna/btc-connect";
import { useQuery } from "@tanstack/react-query";
import getBtcBalance from "@/actions/get-btc-balance";
import { useDepositStatus } from "@/hooks/use-deposit-status";
@@ -266,6 +267,8 @@ const DepositFlowConfirm = ({
const config = useAtomValue(bridgeConfigAtom);
const { notifyEmily, isPending: isPendingNotifyEmily } = useEmilyDeposit();
+ const { openSignBtcAmount } = useAsignaConnect();
+
const walletInfo = useAtomValue(walletInfoAtom);
const handleNextClick = async () => {
try {
@@ -278,14 +281,25 @@ const DepositFlowConfirm = ({
// user cannot continue if they're not connected
const paymentAddress = walletInfo.addresses.payment!;
- const reclaimPublicKey = paymentAddress.publicKey;
+ let reclaimPublicKeys = [paymentAddress.publicKey];
+ let signatureThreshold = 1;
+
+ if (walletInfo.selectedWallet === WalletProvider.ASIGNA) {
+ const { threshold, users } = walletInfo.addresses.musig!;
+ signatureThreshold = threshold;
+ reclaimPublicKeys = users.map((user) => user.publicKey);
+ }
// Parse lockTime from env variable
const parsedLockTime = parseInt(lockTime || "144");
// Create the reclaim script and convert to Buffer
const reclaimScript = Buffer.from(
- createReclaimScript(parsedLockTime, reclaimPublicKey),
+ createReclaimScript(
+ parsedLockTime,
+ reclaimPublicKeys,
+ signatureThreshold,
+ ),
);
const reclaimScriptHex = uint8ArrayToHexString(reclaimScript);
@@ -303,7 +317,8 @@ const DepositFlowConfirm = ({
maxFee,
parsedLockTime,
getBitcoinNetwork(config.WALLET_NETWORK),
- reclaimPublicKey,
+ reclaimPublicKeys,
+ signatureThreshold,
);
let txId = "";
@@ -331,6 +346,13 @@ const DepositFlowConfirm = ({
case WalletProvider.XVERSE:
txId = await sendBTCXverse(params);
break;
+ case WalletProvider.ASIGNA:
+ txId = (await openSignBtcAmount(
+ params,
+ true,
+ config.MEMPOOL_API_URL + "/",
+ )) as string;
+ break;
}
} catch (error) {
let errorMessage = error;
diff --git a/src/comps/Faqs.tsx b/src/comps/Faqs.tsx
index 0aa980d1..097c7a03 100644
--- a/src/comps/Faqs.tsx
+++ b/src/comps/Faqs.tsx
@@ -108,6 +108,17 @@ const faqs = [
wallets are supported — two leading wallets with seamless
integrations designed for Bitcoin and Stacks users.
+