Closed ElliotFriend closed 1 month ago
Hi @ElliotFriend , please can I be assigned this once od hack starts?
Hi @od-hunter! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.
I am applying to this issue via OnlyDust platform.
I'm Poulav Bhowmick, a software engineer at Invisible Studios with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet, Ethereum ecosystem.
Modify the fetchAccount
Function to Handle 404 Errors:
fetchAccount
function to check if the 404 error occurs when querying the Horizon server. Instead of throwing an error immediately, I will trigger a call to the fundWithFriendbot
function to fund the account in case of a 404 error (i.e., the account no longer exists on the Testnet after a reset).Add Logic to Fund Accounts Automatically:
fundWithFriendbot
utility. Once funded, I will retry fetching the account details to confirm the account's existence and return the account data.Update fetchAccount
Function:
fetchAccount
function to include the automatic funding step:export async function fetchAccount(publicKey) {
if (StrKey.isValidEd25519PublicKey(publicKey)) {
try {
let account = await server.accounts().accountId(publicKey).call()
return account
} catch (err) {
if (err.response?.status === 404) {
console.log(`Account ${publicKey} not found on the network. Funding with Friendbot...`)
// Attempt to fund the account
try {
await fundWithFriendbot(publicKey)
console.log(`Account ${publicKey} successfully funded!`)
// Retry fetching the account
let account = await server.accounts().accountId(publicKey).call()
return account
} catch (fundError) {
throw error(500, { message: `Failed to fund account ${publicKey}: ${fundError.message}` })
}
} else {
throw error(err.response?.status ?? 400, {
message: `${err.response?.title} - ${err.response?.detail}`,
})
}
}
} else {
throw error(400, { message: 'invalid public key' })
}
}
Test the Changes:
ETA - 3 days
I am applying to this issue via OnlyDust platform.
I'm a Solidity developer skilled in building decentralized applications and integrating multi-token support . My experience can help address issues like automatically funding accounts on Testnet after resets, ensuring a seamless user experience.
To approach this issue ----- >
fetchAccount
function when logging in./src/lib/stellar/horizonQueries.js
to handle the response and trigger the funding process when needed.I am applying to this issue via OnlyDust platform.
Hi, please can I be assigned this please? This would be my first time contributing to this repo and I'd love to be given the opportunity. I have experience in html, css, react, JavaScript,TypeScript and solidity, python and Cairo.
To solve this issue, I’d take the following steps: 1. First of all, I’ll have to understand the current logic of the fetchAccount function. 2. I’ll update the function to check for a 404 response when fetching the account.
Please assign me. I'm ready to work.
I am applying to this issue via OnlyDust platform.
Hello @ElliotFriend I am Joseph I am a Software developer and blockchain developer and I am also an active contributor here on only dust here is my profile https://app.onlydust.com/u/josephchimebuka. This is my first time to contribute to this repo ill appreciate the opportunity to contribute.
To solve this, I will modify the fetchAccount function in /src/lib/stellar/horizonQueries.js to handle the 404 error. When a 404 response is received from the Horizon server (indicating that the account is no longer live on the Testnet), I will add logic to automatically fund the account. This will involve checking the response for the 404 status and, if detected, triggering the account funding process before retrying the login. This ensures that accounts that were set up before the Testnet reset are automatically funded and can log in successfully. I will complete this in 2-3 days
I am applying to this issue via OnlyDust platform.
I am a blockchain developer with a strong background in html, css, javascript , typescript , this would be my first time contributing to this ecosystem . and i would be glad to work on this issue
I will approach this issue by modifying the fetchAccount function in /src/lib/stellar/horizonQueries.js to detect a 404 error, then automatically fund the account if the account doesn't exist on the Testnet after a reset.
Following a Testnet reset, when logging into an account that was set up before the reset, the login will fail with a 404 error, since the account is no longer live on the Testnet.
The
fetchAccount
function in/src/lib/stellar/horizonQueries.js
should be modified to go ahead and fund the account in the event it finds a 404 response from the Horizon server.