Skip to content

Commit

Permalink
BTC Guide Updates
Browse files Browse the repository at this point in the history
BTC Guide Fixes
  • Loading branch information
awisniew207 authored Oct 18, 2024
2 parents 1282128 + 07d9d0e commit 5f714fc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/user-wallets/pkps/bitcoin/1of1-multi-sig.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { LitNodeClient } from "@lit-protocol/lit-node-client";

bitcoin.initEccLib(ecc);

async function oneOfOneMultiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
export async function oneOfOneMultiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
const network = bitcoin.networks.bitcoin;
const pubKeyBuffer_1 = Buffer.from(pkpPublicKey1, "hex");
const pubKeyBuffer_2 = Buffer.from(pkpPublicKey2, "hex");
Expand Down Expand Up @@ -104,7 +104,7 @@ async function oneOfOneMultiSig(litNodeClient: LitNodeClient, sessionSigs: any,
},
});

const signatureWithHashType = convertSignature(
const signatureWithHashType = await convertSignature(
litActionResponse.signatures.btcSignature
);

Expand Down
6 changes: 3 additions & 3 deletions docs/user-wallets/pkps/bitcoin/collaborative.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { LitNodeClient } from "@lit-protocol/lit-node-client";

bitcoin.initEccLib(ecc);

async function collaborativeMultiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
export async function collaborativeMultiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
const network = bitcoin.networks.bitcoin;
const pubKeyBuffer_1 = Buffer.from(pkpPublicKey1, "hex");
const pubKeyBuffer_2 = Buffer.from(pkpPublicKey2, "hex");
Expand Down Expand Up @@ -155,11 +155,11 @@ async function collaborativeMultiSig(litNodeClient: LitNodeClient, sessionSigs:
},
});

const signatureWithHashType1 = convertSignature(
const signatureWithHashType1 = await convertSignature(
litActionResponse1.signatures.btcSignature
);

const signatureWithHashType2 = convertSignature(
const signatureWithHashType2 = await convertSignature(
litActionResponse2.signatures.btcSignature
);

Expand Down
6 changes: 3 additions & 3 deletions docs/user-wallets/pkps/bitcoin/multi-sig.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { LitNodeClient } from "@lit-protocol/lit-node-client";

bitcoin.initEccLib(ecc);

async function multiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
export async function multiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey1: string, pkpPublicKey2: string, destinationAddress: string) {
const network = bitcoin.networks.bitcoin;
const pubKeyBuffer_1 = Buffer.from(pkpPublicKey1, "hex");
const pubKeyBuffer_2 = Buffer.from(pkpPublicKey2, "hex");
Expand Down Expand Up @@ -113,11 +113,11 @@ async function multiSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPubli
},
});

const signatureWithHashType1 = convertSignature(
const signatureWithHashType1 = await convertSignature(
litActionResponse1.signatures.btcSignature
);

const signatureWithHashType2 = convertSignature(
const signatureWithHashType2 = await convertSignature(
litActionResponse2.signatures.btcSignature
);

Expand Down
4 changes: 2 additions & 2 deletions docs/user-wallets/pkps/bitcoin/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import * as bip66 from "bip66";
import * as bitcoin from "bitcoinjs-lib";
import BN from "bn.js";

function convertSignature(litSignature: any) {
export const convertSignature = async (litSignature: any) => {
const EC = elliptic.ec;
let r = Buffer.from(litSignature.r, "hex");
let s = Buffer.from(litSignature.s, "hex");
Expand Down Expand Up @@ -177,7 +177,7 @@ Once the transaction is fully signed and formatted, it needs to be broadcasted t
```tsx
import fetch from "node-fetch";

const broadcastTransaction = async (txHex: string) => {
export const broadcastTransaction = async (txHex: string) => {
try {
const response = await fetch("https://mempool.space/api/tx", {
method: "POST",
Expand Down
4 changes: 2 additions & 2 deletions docs/user-wallets/pkps/bitcoin/single-sig.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { LitNodeClient } from "@lit-protocol/lit-node-client";

bitcoin.initEccLib(ecc);

async function singleSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey: string, destinationAddress: string) {
export async function singleSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPublicKey: string, destinationAddress: string) {
const network = bitcoin.networks.bitcoin;
const pubKeyBuffer = Buffer.from(pkpPublicKey, "hex");

Expand Down Expand Up @@ -98,7 +98,7 @@ async function singleSig(litNodeClient: LitNodeClient, sessionSigs: any, pkpPubl
},
});

const signatureWithHashType = convertSignature(
const signatureWithHashType = await convertSignature(
litActionResponse.signatures.btcSignature
);

Expand Down

0 comments on commit 5f714fc

Please sign in to comment.