Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bond & tokenomics) feat: bond migration final #75

Merged
merged 22 commits into from
Aug 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f20fd6c
fix: update dispenser ABI
mohandast52 Aug 8, 2024
3149f9c
fix: update tokenomics ABI
mohandast52 Aug 8, 2024
e104e99
feat: update bonding products
mohandast52 Aug 8, 2024
8165e72
feat: update deposit component tag
mohandast52 Aug 9, 2024
eac13e4
chore: raw send transaction for deposit
mohandast52 Aug 9, 2024
f7da5b5
chore: minor updates to deposit
mohandast52 Aug 9, 2024
a1386c0
chore: remove logs
mohandast52 Aug 9, 2024
b3a13f0
refactor: Remove unused code and optimize useWhirlPoolInformation hook
mohandast52 Aug 9, 2024
af689c3
chore: address Tanya's review request
mohandast52 Aug 9, 2024
0097a42
chore: remove duplicate middleware
mohandast52 Aug 12, 2024
43dae31
chore: remvoe support for goerli
mohandast52 Aug 12, 2024
3afe314
chore: remove goerli and some CSS change
mohandast52 Aug 12, 2024
aad7b57
fix: bond error resolved
mohandast52 Aug 13, 2024
6226a88
chore: add logs for issue faced on Solana Liquidity
mohandast52 Aug 16, 2024
7db34fc
feat: calculation fix for deposit
mohandast52 Aug 16, 2024
3ff28ac
feat: calculate OLAS payout
mohandast52 Aug 16, 2024
6cf8d7d
feat: enhance error message in Solana liquidity management
mohandast52 Aug 22, 2024
b7ac697
feat: add tooltip to MyBonds - OLAS payout column
mohandast52 Aug 22, 2024
5c33ca9
fix: Add missing file to .gitleaksignore
mohandast52 Aug 22, 2024
501e504
fix: minor chnages
mohandast52 Aug 22, 2024
91701fc
feat: fix bonds-footer
mohandast52 Aug 22, 2024
04202e3
feat: add RPC endpoint to allowed origins in CSP header
mohandast52 Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import {
import { useWallet } from '@solana/wallet-adapter-react';
import { SystemProgram, Transaction } from '@solana/web3.js';
import Decimal from 'decimal.js';
import Link from 'next/link';

import { notifyError, notifySuccess } from '@autonolas/frontend-library';

import { UNICODE_SYMBOLS } from 'libs/util-constants/src/lib/symbols';
import idl from 'libs/util-contracts/src/lib/abiAndAddresses/liquidityLockbox.json';

import { useSvmConnectivity } from 'common-util/hooks/useSvmConnectivity';
Expand Down Expand Up @@ -44,6 +46,19 @@ import {
import { useGetOrCreateAssociatedTokenAccount } from './useGetOrCreateAssociatedTokenAccount';
import { useWhirlpool } from './useWhirlpool';

const GetSomeOlas = () => (
<>
OLAS Associated token account does not exist.&nbsp;
<Link
Tanya-atatakai marked this conversation as resolved.
Show resolved Hide resolved
href="https://www.orca.so/?tokenIn=So11111111111111111111111111111111111111112&tokenOut=Ez3nzG9ofodYCvEmw73XhQ87LWNYVRM2s7diB5tBZPyM"
target="_blank"
rel="noreferrer noopener"
>
Get some OLAS first {UNICODE_SYMBOLS.EXTERNAL_LINK}.
</Link>
</>
);

const getOlasAmount = async (connection, walletPublicKey, tokenAddress) => {
const tokenAccounts = await connection.getTokenAccountsByOwner(walletPublicKey, {
programId: TOKEN_PROGRAM_ID,
Expand Down Expand Up @@ -153,7 +168,6 @@ export const useWsolDeposit = () => {
}

const { whirlpoolTokenA, whirlpoolTokenB } = await getWhirlpoolData();
console.log({ whirlpoolTokenA, whirlpoolTokenB });

const quote = await getDepositIncreaseLiquidityQuote({ sol, slippage });
const { solMax, olasMax } = await getDepositTransformedQuote(quote);
Expand All @@ -163,13 +177,13 @@ export const useWsolDeposit = () => {
whirlpoolTokenB.mint,
svmWalletPublicKey,
);
console.log({ tokenOwnerAccountB });

const accountInfo = await connection.getAccountInfo(tokenOwnerAccountB);
console.log({ accountInfo });

if (!accountInfo) {
notifyError('OLAS Associated token account does not exist');
if (accountInfo) {
mohandast52 marked this conversation as resolved.
Show resolved Hide resolved
// If the user has no associated token account, they need to get some OLAS first
// from orca
notifyError(<GetSomeOlas />);
return null;
}

Expand Down