Skip to content

Commit

Permalink
Adjusted for mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
faurdent committed Sep 29, 2024
1 parent c5aff8c commit 6065b55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
28 changes: 3 additions & 25 deletions lending-form/src/components/LendingForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const LendingForm = ({walletId}) => {
}).toString();

console.log("Query Params:", queryParams);
const response = await fetch(`http://0.0.0.0:8000/transaction-data?${queryParams}`, {
// TODO: Add .env file if possible
const response = await fetch(`http://127.0.0.1:8000/transaction-data?${queryParams}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand All @@ -65,35 +66,12 @@ const LendingForm = ({walletId}) => {
console.log("Response:", response);
if (response.ok) {
const data = await response.json();
const data1 = { // TODO: Remove, mock for sepolia
approve_data: {
to_address: "2087021424722619777119509474943472645767659996348769578120564519014510906823",
spender: "0x4aa8566337bf8dae0ae335e251dd0776702d52d8fb837e0557cd1917cee28a7",
amount: "1000"
},
loop_liquidity_data: {
caller: "0x06Cb0F3004Be46bcfc3d3030E08ebDDD64f13da663AD715FB4Aabe5423c7b862",
pool_price: 373309738263514,
pool_key: {
token0: "2087021424722619777119509474943472645767659996348769578120564519014510906823",
token1: "0x7ab0b8855a61f480b4423c46c32fa7c553f0aac3531bbddaa282d86244f7a23",
fee: "0x20c49ba5e353f80000000000000000",
tick_spacing: "354892",
extension: "0x73ec792c33b52d5f96940c2860d512b3884f2127d25e023eb9d44a678e4b971"
},
deposit_data: {
token: "2087021424722619777119509474943472645767659996348769578120564519014510906823",
amount: "1000",
multiplier: "2"
}
}
}
console.log(data);
setTransactionData(data);
console.log("Transaction data fetched successfully:", data);

try {
const txResult = await sendTransaction(data1);
const txResult = await sendTransaction(data);
console.log("Transaction result:", txResult);
setTransactionStatus('Transaction sent successfully!');
} catch (txError) {
Expand Down
2 changes: 1 addition & 1 deletion lending-form/src/utils/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function sendTransaction(transactionData) {
const callData = new CallData(abi);
const compiled = callData.compile("loop_liquidity", loopLiquidityData);
const depositTransaction = {
contractAddress: "0x04aa8566337bf8dae0ae335e251dd0776702d52d8fb837e0557cd1917cee28a7",
contractAddress: "0x0798b587e3da417796a56ffab835ab2a905fa08bab136843ce5749f76c7e45e4",
entrypoint: "loop_liquidity",
calldata: compiled
};
Expand Down

0 comments on commit 6065b55

Please sign in to comment.