chore: cleanup

This commit is contained in:
bartosz-lipinski 2021-06-29 23:23:47 -05:00
parent c44a2b7157
commit 75ecc33764
11 changed files with 20 additions and 45 deletions

View File

@ -4,13 +4,11 @@ import {
PublicKey,
TransactionInstruction,
} from '@solana/web3.js';
import { utils, actions, models, findProgramAddress } from '@oyster/common';
import { actions, models } from '@oyster/common';
import { AccountLayout } from '@solana/spl-token';
import BN from 'bn.js';
import { METAPLEX_PREFIX } from '../models/metaplex';
const { createTokenAccount, activateVault, combineVault, AUCTION_PREFIX } =
actions;
const { createTokenAccount, activateVault, combineVault } = actions;
const { approve } = models;
// This command "closes" the vault, by activating & combining it in one go, handing it over to the auction manager
@ -28,25 +26,12 @@ export async function closeVault(
instructions: TransactionInstruction[];
signers: Keypair[];
}> {
const PROGRAM_IDS = utils.programIds();
const accountRentExempt = await connection.getMinimumBalanceForRentExemption(
AccountLayout.span,
);
let signers: Keypair[] = [];
let instructions: TransactionInstruction[] = [];
const auctionKey: PublicKey = (
await findProgramAddress(
[
Buffer.from(AUCTION_PREFIX),
PROGRAM_IDS.auction.toBuffer(),
vault.toBuffer(),
],
PROGRAM_IDS.auction,
)
)[0];
await activateVault(
new BN(0),
vault,

View File

@ -7,7 +7,6 @@ import {
CreateAuctionArgs,
} from '@oyster/common';
import { METAPLEX_PREFIX } from '../models/metaplex';
const { AUCTION_PREFIX, createAuction } = actions;
// This command makes an auction

View File

@ -11,7 +11,6 @@ import {
Data,
Creator,
findProgramAddress,
MetadataCategory,
} from '@oyster/common';
import React from 'react';
import { MintLayout, Token } from '@solana/spl-token';
@ -337,7 +336,7 @@ export const mintNFT = async (
notify({
message: 'Art created on Solana',
description: (
<a href={arweaveLink} target="_blank">
<a href={arweaveLink} target="_blank" rel="noopener noreferrer">
Arweave Link
</a>
),

View File

@ -214,7 +214,7 @@ export async function sendRedeemBid(
}
if (
wallet.publicKey.toBase58() ==
wallet.publicKey.toBase58() ===
auctionView.auctionManager.info.authority.toBase58()
) {
await claimUnusedPrizes(

View File

@ -1,4 +1,4 @@
import React, { Ref, useCallback, useEffect, useRef, useState } from 'react';
import React, { Ref, useCallback, useEffect, useState } from 'react';
import { Image } from 'antd';
import { MetadataCategory, MetadataFile } from '@oyster/common';
import { MeshViewer } from '../MeshViewer';
@ -47,7 +47,7 @@ const CachedImageContent = ({
style?: React.CSSProperties;
}) => {
const [loaded, setLoaded] = useState<boolean>(false);
const { cachedBlob, isLoading } = useCachedImage(uri || '');
const { cachedBlob } = useCachedImage(uri || '');
return <Image
src={cachedBlob}

View File

@ -63,7 +63,7 @@ function useGapTickCheck(
const higherExpectedAmount = expected * ((100 + gapTick) / 100);
return higherExpectedAmount > toLamportVal;
} else if (expected == toLamportVal) {
} else if (expected === toLamportVal) {
// If gap tick is set, no way you can bid in this case - you must bid higher.
return true;
}

View File

@ -1,19 +1,15 @@
import React from 'react';
import { useParams } from 'react-router-dom';
import { Row, Col, Button } from 'antd';
import { Col, Button } from 'antd';
import {
useArt,
useAuction,
} from '../../hooks';
import {
useConnectionConfig,
} from '@oyster/common';
export const ViewOn = () => {
const { id } = useParams<{ id: string }>();
export const ViewOn = ({ id }: { id: string }) => {
const { env } = useConnectionConfig();
const auction = useAuction(id);
const art = useArt(auction?.thumbnail.metadata.pubkey);
const art = useArt(id);
return (
<>

View File

@ -33,7 +33,6 @@ import {
} from '@oyster/common';
import { MintInfo } from '@solana/spl-token';
import { Connection, PublicKey, PublicKeyAndAccount } from '@solana/web3.js';
import BN from 'bn.js';
import React, {
useCallback,
useContext,
@ -43,7 +42,6 @@ import React, {
} from 'react';
import {
AuctionManager,
AuctionManagerStatus,
BidRedemptionTicket,
decodeAuctionManager,
decodeBidRedemptionTicket,

View File

@ -342,6 +342,14 @@ export class Store {
}
}
export enum AuctionManagerStatus {
Initialized,
Validated,
Running,
Disbursing,
Finished,
}
export class AuctionManagerState {
status: AuctionManagerStatus = AuctionManagerStatus.Initialized;
winningConfigItemsValidated: number = 0;
@ -355,14 +363,6 @@ export class AuctionManagerState {
}
}
export enum AuctionManagerStatus {
Initialized,
Validated,
Running,
Disbursing,
Finished,
}
export class BidRedemptionTicket {
key: MetaplexKey = MetaplexKey.BidRedemptionTicketV1;
participationRedeemed: boolean = false;

View File

@ -1,5 +1,3 @@
import { Creator, MetadataCategory } from '@oyster/common';
export interface Auction {
name: string;
auctionerName: string;

View File

@ -5,7 +5,7 @@ import { useArt, useExtendedArt } from './../../hooks';
import './index.less';
import { ArtContent } from '../../components/ArtContent';
import { shortenAddress, TokenAccount, useConnection, useUserAccounts, useWallet } from '@oyster/common';
import { shortenAddress, useConnection, useWallet } from '@oyster/common';
import { MetaAvatar } from '../../components/MetaAvatar';
import { sendSignMetadata } from '../../actions/sendSignMetadata';
import { PublicKey } from '@solana/web3.js';
@ -84,7 +84,7 @@ export const ArtView = () => {
</div>
</Col>
<Col span={12}>
<ViewOn />
<ViewOn id={id} />
</Col>
</Row>
<Row>