Skip to content

Commit

Permalink
base deploy, constants update, custom rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
dekanbro committed Mar 15, 2024
1 parent 71bc01a commit 7c63104
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/ClaimList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const ClaimList = ({
shamanAddress: shamanAddress,
});


if (isLoading) return <Loading />;

if (!isLoading && accountNfts?.length === 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/NftCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export const NftCard = ({ nft, isClaim, isHolder }: NftCardProps) => {
});
const [open, setOpen] = useState(false);

// console.log(">>>>> nft", nft);

return (
<CardContainer>
<Dialog open={open} onOpenChange={setOpen}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ProfileCard = ({
address: member?.memberAddress || profileAddress || "",
});

console.log("currentProfile", currentProfile);
console.log("currentProfile >>>", currentProfile);

if (
// !member ||
Expand Down
6 changes: 5 additions & 1 deletion src/components/ProfileNftList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const ProfileNftList = ({
dao: MolochV3Dao;
isHolder?: boolean;
}) => {
const { sdata, shamanAddress } = useClaimShaman({
const { sdata, shamanAddress, error } = useClaimShaman({
dao,
chainId: daoChain,
});
Expand All @@ -54,6 +54,10 @@ export const ProfileNftList = ({
chainId: daoChain,
});

// console.log(">>>> accountNfts", accountNfts, isLoading);
// console.log(">>>> sdata", sdata);
// console.log(">>>> shamanAddress", shamanAddress, address, daoChain);

if (isLoading) return <Loading />;

return (
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useAccountNfts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const fetchNftsForAccount = async ({
throw new Error("Missing Args");
}
const sequenceEndPoint = SEQUENCE_ENDPOINTS[chainId as ValidNetwork];

if (!sequenceEndPoint) {
throw new Error("Invalid ChainId");
}
Expand All @@ -33,6 +32,8 @@ const fetchNftsForAccount = async ({
includeMetadata: true,
});

console.log(">>>> nftBalances", nftBalances);

const nftsWithClaimStatus = await Promise.all(
nftBalances.balances.map(async (nft, i) => {
return {
Expand Down
9 changes: 7 additions & 2 deletions src/hooks/useClaimShaman.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const fetchShaman = async ({
chainId?: ValidNetwork;
rpcs?: Keychain;
}) => {

if (!chainId || !shamen) {
throw new Error("Missing Args");
}
Expand All @@ -22,8 +23,11 @@ const fetchShaman = async ({
rpcs,
});

const targetShamanNameV2 = "NFT6551ClaimerShamanV2";
const targetShamanName = "NFT6551ClaimerShaman";



const claimShaman = shamen.find(async (shaman) => {
try {
const shamanName = await client.readContract({
Expand All @@ -33,8 +37,9 @@ const fetchShaman = async ({
args: [],
});

return shamanName === targetShamanName;
return shamanName === targetShamanNameV2 || shamanName === targetShamanName;
} catch (e) {
console.log("error", e);
return false;
}
});
Expand Down Expand Up @@ -88,7 +93,7 @@ export const useClaimShaman = ({
throw new Error("Missing Args");
}
const { data, error, ...rest } = useQuery(
[`claimShaman-${dao?.id}}`],
[`claimShaman-${dao?.id}`],
() => fetchShaman({ shamen: dao?.shamen, chainId }),
{ enabled: !!dao && !!dao.shamen && !!chainId }
);
Expand Down
4 changes: 4 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const SEQUENCE_ENDPOINTS: Keychain = {
"0x89": "https://polygon-indexer.sequence.app",
"0xa": "https://optimism-indexer.sequence.app",
"0xa4b1": "https://arbitrum-indexer.sequence.app",
"0x2105": "https://base-indexer.sequence.app",
};

// TODO: check these urls
Expand All @@ -19,6 +20,7 @@ export const TOKENBOUND_URL: Keychain = {
"0x89": "https://tokenbound.org/assets/polygon",
"0xa": "https://tokenbound.org/assets/optimism",
"0xa4b1": "https://tokenbound.org/assets/arbitrum",
"0x2105": "https://tokenbound.org/assets/base",
};

export const OPENSEA_URL: Keychain = {
Expand All @@ -28,6 +30,7 @@ export const OPENSEA_URL: Keychain = {
"0x89": "https://opensea.io/assets/polygon",
"0xa": "https://opensea.io/assets/optimism",
"0xa4b1": "https://opensea.io/assets/arbitrum",
"0x2105": "https://opensea.io/assets/base",
};

export const SEQUENCE_CHAIN_NAME: Keychain = {
Expand All @@ -37,4 +40,5 @@ export const SEQUENCE_CHAIN_NAME: Keychain = {
"0x89": "polygon",
"0xa": "optimism",
"0xa4b1": "arbitrum",
"0x2105": "base"
};
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default ({ mode }) => {
NX_POLYGONPOS_ALCHEMY_KEY: process.env.VITE_POLYGONPOS_ALCHEMY_KEY,
NX_GOERLI_RPC: process.env.VITE_GOERLI_RPC,
NX_OPTIMISM_RPC: process.env.VITE_OPTIMISM_RPC,
NX_BASE_RPC: process.env.VITE_BASE_RPC,
},
},
optimizeDeps: {
Expand Down

0 comments on commit 7c63104

Please sign in to comment.