UNPKG

@covenance/dlc

Version:

Crypto and Bitcoin functions for Covenance DLC implementation

52 lines (45 loc) 1.08 kB
import { Address, Script, Transaction } from '../btc'; import { Point } from '../crypto/secp256k1'; import { EventOutcomeHash } from '../crypto/types'; export type UTXO = { txId: string; outputIndex: number; satoshis: number; script: Script; address?: Address; } export type DlcInitTx = { tx: Transaction; dlcUtxo: UTXO; witnessScript: Script; cBlock: string; tPubKey: string; } export type P2trOutputScript = { scriptPubKey: Script; tPubKey: string; cBlock: string; } export interface OracleEvent { id: string; outcomeSignaturePoints: Point[]; outcomePrices: number[]; outcomeHashes: EventOutcomeHash[]; timestamp: number; nonce?: bigint; } export interface OracleCET { cetTx: Transaction; eventId: string; outcomeSignaturePoint: Point; outcomeLiquidationPrice: number; lenderAmount: number; borrowerAmount: number; } export interface LoanConfig { collateralAmount: number; // C annualInterestRate: number; // r liquidationThreshold: number; // LT borrowedAmount: number; // D_0 penaltyPercentage: number; // pen }