Operation - Repay
Key Steps
Usage
Example
import { parseUnits } from 'viem';
import { publicClient, walletClient, protocolConfig, collateral } from 'satoshi-sdk';
async function repayDebt() {
// Step 1: Define the amount to repay
const repayAmt = parseUnits('5', DEBT_TOKEN_DECIMALS); // Repaying 5 SAT stablecoins
// Step 2: Execute the repayment transaction
const receipt = await satoshiClient.Postition.doRepay({
publicClient,
walletClient,
protocolConfig,
collateral,
repayAmt,
});
console.log('Repayment successful:', receipt);
}
repayDebt();Last updated