Skip to content

Commit

Permalink
Co-authored-by: Polybius93 <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
sosaucily committed Jun 25, 2024
1 parent be7ce26 commit 04903f3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/attestor-handlers/attestor-handler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Transaction } from '@scure/btc-signer';

Check failure on line 1 in src/attestor-handlers/attestor-handler.ts

View workflow job for this annotation

GitHub Actions / lint-eslint

'Transaction' is defined but never used

import { AttestorError } from '../models/errors.js';

export class AttestorHandler {
Expand All @@ -14,18 +16,18 @@ export class AttestorHandler {

async createPSBTEvent(
vaultUUID: string,
fundingTransaction: string,
closingPSBT: string,
userNativeSegwitAddress: string
fundingTransactionPsbt: string,
mintAddress: string,
alicePubkey: string
): Promise<void> {
const createPSBTEndpoints = this.attestorRootURLs.map(url => `${url}/app/create-psbt-event`);

const body = JSON.stringify({
uuid: vaultUUID,
funding_transaction: fundingTransaction,
closing_psbt: closingPSBT,
mint_address: userNativeSegwitAddress,
funding_transaction_psbt: fundingTransactionPsbt,
mint_address: mintAddress,
chain: this.ethereumChainID,
alice_pubkey: alicePubkey,
});

const requests = createPSBTEndpoints.map(async url =>
Expand Down
2 changes: 1 addition & 1 deletion src/dlc-handlers/private-key-dlc-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface RequiredKeyPair {
}

export class PrivateKeyDLCHandler {
private derivedKeyPair: RequiredKeyPair;
public derivedKeyPair: RequiredKeyPair;
public payment: PaymentInformation | undefined;
private bitcoinNetwork: Network;
private bitcoinBlockchainAPI: string;
Expand Down
4 changes: 4 additions & 0 deletions src/dlc-handlers/software-wallet-dlc-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export class SoftwareWalletDLCHandler {
return this.payment;
}

getTaprootDerivedPublicKey(): string {
return this.taprootDerivedPublicKey;
}

getVaultRelatedAddress(paymentType: 'p2wpkh' | 'p2tr'): string {
const payment = this.getPayment();

Expand Down
7 changes: 3 additions & 4 deletions src/network-handlers/ethereum-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ export class EthereumHandler {
return vault;
}

async setupVault(bitcoinDepositAmount: number): Promise<any | undefined> {
async setupVault(): Promise<any | undefined> {
try {
await this.ethereumContracts.protocolContract.callStatic.setupVault(bitcoinDepositAmount);
const transaction =
await this.ethereumContracts.protocolContract.setupVault(bitcoinDepositAmount);
await this.ethereumContracts.protocolContract.callStatic.setupVault();
const transaction = await this.ethereumContracts.protocolContract.setupVault();
return await transaction.wait();
} catch (error: any) {
throw new EthereumError(`Could not setup Vault: ${error}`);
Expand Down

0 comments on commit 04903f3

Please sign in to comment.