Merge remote-tracking branch 'origin/master' into feature/init-store
This commit is contained in:
commit
43255f2616
|
@ -36,7 +36,8 @@ export const MAX_METADATA_LEN =
|
|||
export const MAX_MASTER_EDITION_KEN = 1 + 9 + 8 + 32 + 32;
|
||||
|
||||
export enum MetadataKey {
|
||||
MetadataV1 = 0,
|
||||
Uninitialized = 0,
|
||||
MetadataV1 = 4,
|
||||
EditionV1 = 1,
|
||||
MasterEditionV1 = 2,
|
||||
ReservationListV1 = 3,
|
||||
|
|
|
@ -10,7 +10,8 @@ import BN from 'bn.js';
|
|||
|
||||
export const VAULT_PREFIX = 'vault';
|
||||
export enum VaultKey {
|
||||
VaultV1 = 0,
|
||||
Uninitialized = 0,
|
||||
VaultV1 = 3,
|
||||
SafetyDepositBoxV1 = 1,
|
||||
ExternalPriceAccountV1 = 2,
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ export async function addTokensToVault(
|
|||
}
|
||||
}
|
||||
|
||||
if (instructions[instructions.length - 1] != currInstructions) {
|
||||
if (instructions[instructions.length - 1] !== currInstructions) {
|
||||
signers.push(currSigners);
|
||||
instructions.push(currInstructions);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ export async function sendCancelBid(
|
|||
let instructions: Array<TransactionInstruction[]> = [];
|
||||
if (
|
||||
auctionView.auction.info.ended() &&
|
||||
auctionView.auction.info.state != AuctionState.Ended
|
||||
auctionView.auction.info.state !== AuctionState.Ended
|
||||
) {
|
||||
await setupPlaceBid(
|
||||
connection,
|
||||
|
|
|
@ -308,7 +308,7 @@ export async function createAuctionManager(
|
|||
instructions = instructions.slice(stopPoint, instructions.length);
|
||||
filteredSigners = filteredSigners.slice(stopPoint, filteredSigners.length);
|
||||
|
||||
if (instructions.length == lastInstructionsLength) tries = tries + 1;
|
||||
if (instructions.length === lastInstructionsLength) tries = tries + 1;
|
||||
else tries = 0;
|
||||
|
||||
try {
|
||||
|
|
|
@ -52,7 +52,7 @@ export async function createReservationListForTokens(
|
|||
batchCounter++;
|
||||
}
|
||||
|
||||
if (instructions[instructions.length - 1] != currInstructions) {
|
||||
if (instructions[instructions.length - 1] !== currInstructions) {
|
||||
signers.push(currSigners);
|
||||
instructions.push(currInstructions);
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ export async function populatePrintingTokens(
|
|||
}
|
||||
}
|
||||
|
||||
if (instructions[instructions.length - 1] != currInstructions) {
|
||||
if (instructions[instructions.length - 1] !== currInstructions) {
|
||||
signers.push(currSigners);
|
||||
instructions.push(currInstructions);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ export async function sendRedeemBid(
|
|||
|
||||
if (
|
||||
auctionView.auction.info.ended() &&
|
||||
auctionView.auction.info.state != AuctionState.Ended
|
||||
auctionView.auction.info.state !== AuctionState.Ended
|
||||
) {
|
||||
await setupPlaceBid(
|
||||
connection,
|
||||
|
@ -112,7 +112,7 @@ export async function sendRedeemBid(
|
|||
const winningConfigItem = winningConfig.items[j];
|
||||
|
||||
if (
|
||||
winningConfigItem.safetyDepositBoxIndex == safetyDeposit.info.order
|
||||
winningConfigItem.safetyDepositBoxIndex === safetyDeposit.info.order
|
||||
) {
|
||||
const stateItem =
|
||||
auctionView.auctionManager.info.state.winningConfigStates[
|
||||
|
@ -232,7 +232,7 @@ export async function sendRedeemBid(
|
|||
instructions = instructions.slice(stopPoint, instructions.length);
|
||||
filteredSigners = filteredSigners.slice(stopPoint, filteredSigners.length);
|
||||
|
||||
if (instructions.length == lastInstructionsLength) tries = tries + 1;
|
||||
if (instructions.length === lastInstructionsLength) tries = tries + 1;
|
||||
else tries = 0;
|
||||
|
||||
try {
|
||||
|
@ -575,8 +575,8 @@ async function setupRedeemParticipationInstructions(
|
|||
);
|
||||
|
||||
if (
|
||||
participationBalance.value.uiAmount == 0 &&
|
||||
tokenBalance.value.uiAmount == 1
|
||||
participationBalance.value.uiAmount === 0 &&
|
||||
tokenBalance.value.uiAmount === 1
|
||||
) {
|
||||
// I'm the first, I need to populate for the others with a crank turn.
|
||||
let fillParticipationStashSigners: Keypair[] = [];
|
||||
|
@ -694,7 +694,7 @@ async function setupRedeemParticipationInstructions(
|
|||
}
|
||||
}
|
||||
|
||||
if (newTokenAccount && newTokenBalance == 1) {
|
||||
if (newTokenAccount && newTokenBalance === 1) {
|
||||
await redeemPrintingToken(
|
||||
wallet,
|
||||
updateAuth,
|
||||
|
|
|
@ -117,11 +117,11 @@ async function emptyPaymentAccountForAllTokens(
|
|||
auctionView.auction.pubkey,
|
||||
wallet.publicKey,
|
||||
addresses[k],
|
||||
item == auctionView.participationItem ? null : i,
|
||||
item == auctionView.participationItem ? null : j,
|
||||
item === auctionView.participationItem ? null : i,
|
||||
item === auctionView.participationItem ? null : j,
|
||||
creatorIndex === -1 ||
|
||||
creatorIndex === null ||
|
||||
(edgeCaseWhereCreatorIsAuctioneer && k == addresses.length - 1)
|
||||
(edgeCaseWhereCreatorIsAuctioneer && k === addresses.length - 1)
|
||||
? null
|
||||
: creatorIndex,
|
||||
settleInstructions,
|
||||
|
@ -134,7 +134,7 @@ async function emptyPaymentAccountForAllTokens(
|
|||
settleInstructions = [];
|
||||
}
|
||||
|
||||
if (currInstrBatch.length == BATCH_SIZE) {
|
||||
if (currInstrBatch.length === BATCH_SIZE) {
|
||||
signers.push(currSignerBatch);
|
||||
instructions.push(currInstrBatch);
|
||||
currSignerBatch = [];
|
||||
|
@ -213,14 +213,14 @@ async function claimAllBids(
|
|||
claimBidInstructions,
|
||||
);
|
||||
|
||||
if (claimBidInstructions.length == CLAIM_TRANSACTION_SIZE) {
|
||||
if (claimBidInstructions.length === CLAIM_TRANSACTION_SIZE) {
|
||||
currSignerBatch.push(claimBidSigners);
|
||||
currInstrBatch.push(claimBidInstructions);
|
||||
claimBidSigners = [];
|
||||
claimBidInstructions = [];
|
||||
}
|
||||
|
||||
if (currInstrBatch.length == BATCH_SIZE) {
|
||||
if (currInstrBatch.length === BATCH_SIZE) {
|
||||
signers.push(currSignerBatch);
|
||||
instructions.push(currInstrBatch);
|
||||
currSignerBatch = [];
|
||||
|
|
|
@ -5,11 +5,11 @@ import { formatUSD } from '@oyster/common'
|
|||
import './index.less';
|
||||
|
||||
interface IAmountLabel {
|
||||
amount: number | string,
|
||||
displayUSD?: boolean,
|
||||
title?: string,
|
||||
style?: object,
|
||||
containerStyle?: object,
|
||||
amount: number | string;
|
||||
displayUSD?: boolean;
|
||||
title?: string;
|
||||
style?: object;
|
||||
containerStyle?: object;
|
||||
}
|
||||
|
||||
export const AmountLabel = (props: IAmountLabel) => {
|
||||
|
|
|
@ -15,7 +15,6 @@ import {
|
|||
// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
|
||||
// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move
|
||||
|
||||
|
||||
const TouchableOrbitControls = function (object, domElement) {
|
||||
if (domElement === undefined)
|
||||
console.warn(
|
||||
|
@ -574,7 +573,7 @@ const TouchableOrbitControls = function (object, domElement) {
|
|||
}
|
||||
|
||||
function handleTouchStartRotate(event) {
|
||||
if (event.touches.length == 1) {
|
||||
if (event.touches.length === 1) {
|
||||
rotateStart.set(event.touches[0].pageX, event.touches[0].pageY);
|
||||
} else {
|
||||
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
||||
|
@ -585,7 +584,7 @@ const TouchableOrbitControls = function (object, domElement) {
|
|||
}
|
||||
|
||||
function handleTouchStartPan(event) {
|
||||
if (event.touches.length == 1) {
|
||||
if (event.touches.length === 1) {
|
||||
panStart.set(event.touches[0].pageX, event.touches[0].pageY);
|
||||
} else {
|
||||
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
||||
|
@ -617,7 +616,7 @@ const TouchableOrbitControls = function (object, domElement) {
|
|||
}
|
||||
|
||||
function handleTouchMoveRotate(event) {
|
||||
if (event.touches.length == 1) {
|
||||
if (event.touches.length === 1) {
|
||||
rotateEnd.set(event.touches[0].pageX, event.touches[0].pageY);
|
||||
} else {
|
||||
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
||||
|
@ -640,7 +639,7 @@ const TouchableOrbitControls = function (object, domElement) {
|
|||
}
|
||||
|
||||
function handleTouchMovePan(event) {
|
||||
if (event.touches.length == 1) {
|
||||
if (event.touches.length === 1) {
|
||||
panEnd.set(event.touches[0].pageX, event.touches[0].pageY);
|
||||
} else {
|
||||
const x = 0.5 * (event.touches[0].pageX + event.touches[1].pageX);
|
||||
|
|
|
@ -29,13 +29,15 @@ import {
|
|||
useConnectionConfig,
|
||||
} from '@oyster/common';
|
||||
import { MintInfo } from '@solana/spl-token';
|
||||
import {
|
||||
Connection,
|
||||
PublicKey,
|
||||
PublicKeyAndAccount
|
||||
} from '@solana/web3.js';
|
||||
import { Connection, PublicKey, PublicKeyAndAccount } from '@solana/web3.js';
|
||||
import BN from 'bn.js';
|
||||
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import React, {
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import {
|
||||
AuctionManager,
|
||||
AuctionManagerStatus,
|
||||
|
@ -165,18 +167,18 @@ export function MetaProvider({ children = null as any }) {
|
|||
setSafetyDepositBoxesByVaultAndIndex,
|
||||
] = useState<Record<string, ParsedAccount<SafetyDepositBox>>>({});
|
||||
|
||||
const updateMints = useCallback(async (metadataByMint) => {
|
||||
const updateMints = useCallback(
|
||||
async metadataByMint => {
|
||||
try {
|
||||
const m = await queryExtendedMetadata(
|
||||
connection,
|
||||
metadataByMint,
|
||||
);
|
||||
const m = await queryExtendedMetadata(connection, metadataByMint);
|
||||
setMetadata(m.metadata);
|
||||
setMetadataByMint(m.mintToMetadata);
|
||||
} catch (er) {
|
||||
console.error(er);
|
||||
}
|
||||
}, [setMetadata, setMetadataByMint]);
|
||||
},
|
||||
[setMetadata, setMetadataByMint],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
let dispose = () => {};
|
||||
|
@ -435,7 +437,7 @@ export function MetaProvider({ children = null as any }) {
|
|||
setPayoutTickets,
|
||||
setStore,
|
||||
setWhitelistedCreatorsByCreator,
|
||||
updateMints
|
||||
updateMints,
|
||||
]);
|
||||
|
||||
const filteredMetadata = useMemo(
|
||||
|
@ -576,6 +578,8 @@ const processAuctions = (
|
|||
setBidderMetadataByAuctionAndBidder: any,
|
||||
setBidderPotsByAuctionAndBidder: any,
|
||||
) => {
|
||||
if (a.account.owner.toBase58() != programIds().auction.toBase58()) return;
|
||||
|
||||
try {
|
||||
const account = cache.add(
|
||||
a.pubkey,
|
||||
|
@ -638,9 +642,15 @@ const processMetaplexAccounts = async (
|
|||
setStore: any,
|
||||
setWhitelistedCreatorsByCreator: any,
|
||||
) => {
|
||||
if (a.account.owner.toBase58() != programIds().metaplex.toBase58()) return;
|
||||
|
||||
try {
|
||||
const STORE_ID = programIds().store.toBase58()
|
||||
if (a.account.data[0] === MetaplexKey.AuctionManagerV1) {
|
||||
const STORE_ID = programIds().store.toBase58();
|
||||
|
||||
if (
|
||||
a.account.data[0] === MetaplexKey.AuctionManagerV1 ||
|
||||
a.account.data[0] === 0
|
||||
) {
|
||||
const storeKey = new PublicKey(a.account.data.slice(1, 33));
|
||||
if (storeKey.toBase58() === STORE_ID) {
|
||||
const auctionManager = decodeAuctionManager(a.account.data);
|
||||
|
@ -697,7 +707,7 @@ const processMetaplexAccounts = async (
|
|||
whitelistedCreator.address,
|
||||
);
|
||||
if (
|
||||
creatorKeyIfCreatorWasPartOfThisStore.toBase58() == a.pubkey.toBase58()
|
||||
creatorKeyIfCreatorWasPartOfThisStore.toBase58() === a.pubkey.toBase58()
|
||||
) {
|
||||
const account = cache.add(
|
||||
a.pubkey,
|
||||
|
@ -734,8 +744,13 @@ const processMetaData = async (
|
|||
setmasterEditionsByPrintingMint: any,
|
||||
setMasterEditionsByOneTimeAuthMint: any,
|
||||
) => {
|
||||
if (meta.account.owner.toBase58() != programIds().metadata.toBase58()) return;
|
||||
|
||||
try {
|
||||
if (meta.account.data[0] === MetadataKey.MetadataV1) {
|
||||
if (
|
||||
meta.account.data[0] === MetadataKey.MetadataV1 ||
|
||||
meta.account.data[0] === 0
|
||||
) {
|
||||
const metadata = await decodeMetadata(meta.account.data);
|
||||
|
||||
if (
|
||||
|
@ -795,6 +810,7 @@ const processVaultData = (
|
|||
setSafetyDepositBoxesByVaultAndIndex: any,
|
||||
setVaults: any,
|
||||
) => {
|
||||
if (a.account.owner.toBase58() != programIds().vault.toBase58()) return;
|
||||
try {
|
||||
if (a.account.data[0] === VaultKey.SafetyDepositBoxV1) {
|
||||
const safetyDeposit = decodeSafetyDeposit(a.account.data);
|
||||
|
@ -807,7 +823,10 @@ const processVaultData = (
|
|||
...e,
|
||||
[safetyDeposit.vault.toBase58() + '-' + safetyDeposit.order]: account,
|
||||
}));
|
||||
} else if (a.account.data[0] === VaultKey.VaultV1) {
|
||||
} else if (
|
||||
a.account.data[0] === VaultKey.VaultV1 ||
|
||||
a.account.data[0] === 0
|
||||
) {
|
||||
const vault = decodeVault(a.account.data);
|
||||
const account: ParsedAccount<Vault> = {
|
||||
pubkey: a.pubkey,
|
||||
|
|
|
@ -19,12 +19,14 @@ export const METAPLEX_PREFIX = 'metaplex';
|
|||
export const ORIGINAL_AUTHORITY_LOOKUP_SIZE = 33;
|
||||
|
||||
export enum MetaplexKey {
|
||||
AuctionManagerV1 = 0,
|
||||
Uninitialized = 0,
|
||||
OriginalAuthorityLookupV1 = 1,
|
||||
BidRedemptionTicketV1 = 2,
|
||||
StoreV1 = 3,
|
||||
WhitelistedCreatorV1 = 4,
|
||||
PayoutTicketV1 = 5,
|
||||
SafetyDepositValidationTicketV1 = 6,
|
||||
AuctionManagerV1 = 7,
|
||||
}
|
||||
|
||||
export class PayoutTicket {
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import { Col, Divider, Row } from 'antd';
|
||||
import React from 'react';
|
||||
import { Row, Col, Divider, Layout, Tag, Badge } from 'antd';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useCreator } from '../../hooks';
|
||||
import Masonry from 'react-masonry-css';
|
||||
import { Link, useParams } from 'react-router-dom';
|
||||
import { ArtCard } from '../../components/ArtCard';
|
||||
import { useCreatorArts } from '../../hooks';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { CardLoader } from '../../components/MyLoader';
|
||||
import { MetaAvatar } from '../../components/MetaAvatar';
|
||||
import { useCreator, useCreatorArts } from '../../hooks';
|
||||
|
||||
export const ArtistView = () => {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
import React, { useState } from 'react';
|
||||
import { ArtCard } from '../../components/ArtCard';
|
||||
import { Layout, Row, Col, Tabs } from 'antd';
|
||||
import { Col, Layout } from 'antd';
|
||||
import React from 'react';
|
||||
import Masonry from 'react-masonry-css';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useUserArts } from '../../hooks';
|
||||
import { useMeta } from '../../contexts';
|
||||
import { ArtistCard } from '../../components/ArtistCard';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
import { useMeta } from '../../contexts';
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
export const ArtistsView = () => {
|
||||
const ownedMetadata = useUserArts();
|
||||
const { whitelistedCreatorsByCreator } = useMeta();
|
||||
const breakpointColumnsObj = {
|
||||
default: 4,
|
||||
|
|
Loading…
Reference in New Issue