Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
crossmint integration
Browse files Browse the repository at this point in the history
  • Loading branch information
intergalacticspacehighway committed Nov 7, 2023
1 parent f103895 commit cb4bce2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
3 changes: 2 additions & 1 deletion apps/expo/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ NEXT_PUBLIC_KV_REST_API_URL=https://patient-gar-40486.kv.vercel-storage.com
NEXT_PUBLIC_KV_REST_API_TOKEN=Ap4mASQgZmRhZDFlNTYtOTViMi00ZDQzLTg3N2ItOWEzYWQwY2Y5NGJmXFJxyhlB-QtE3C_-WS3HwhtKmaDdlHR65OjUS1jFTok=

# regarding to Expo, this could increase ANRs slighty but fixes the SplashScreen issue for now
EX_UPDATES_ANDROID_DELAY_LOAD_APP="false"
EX_UPDATES_ANDROID_DELAY_LOAD_APP="false"
NEXT_PUBLIC_CROSSMINT_PROJECT_ID=043c259c-878c-49a9-bd86-cf99f583125b
3 changes: 2 additions & 1 deletion apps/expo/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ NEXT_PUBLIC_KV_REST_API_URL=https://patient-gar-40486.kv.vercel-storage.com
NEXT_PUBLIC_KV_REST_API_TOKEN=Ap4mASQgZmRhZDFlNTYtOTViMi00ZDQzLTg3N2ItOWEzYWQwY2Y5NGJmXFJxyhlB-QtE3C_-WS3HwhtKmaDdlHR65OjUS1jFTok=

# regarding to Expo, this could increase ANRs slighty but fixes the SplashScreen issue for now
EX_UPDATES_ANDROID_DELAY_LOAD_APP="false"
EX_UPDATES_ANDROID_DELAY_LOAD_APP="false"
NEXT_PUBLIC_CROSSMINT_PROJECT_ID=ebde9457-61c1-469c-98e7-26e209defcaf
35 changes: 21 additions & 14 deletions packages/app/components/creator-token/buy-creator-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,27 @@ export const BuyCreatorToken = () => {
<View tw="h-8" />
{renderBuyButton()}
<View tw="mx-auto my-4 h-[1px] w-[20%] rounded-full bg-gray-400" />
<CrossmintPayButton
style={{
borderRadius: 100,
}}
collectionId="e91b3e6a-27ef-4c90-aa02-10af5ecfa0fb"
projectId="043c259c-878c-49a9-bd86-cf99f583125b"
mintConfig={{
totalPrice: priceToBuyNext.data?.totalPrice?.toString(),
_numOfTokens: tokenAmount,
_maxPayment: priceToBuyNext.data?.totalPrice?.toString(),
}}
environment="staging"
mintTo={"0xD60FB1e898eeacD5D1935FA161DaDf96AC3b0EDa"}
/>
{profileData?.data?.profile.creator_token?.crossmint_id !== null ? (
<CrossmintPayButton
style={{
borderRadius: 100,
}}
collectionId="e91b3e6a-27ef-4c90-aa02-10af5ecfa0fb"
projectId={process.env.NEXT_PUBLIC_CROSSMINT_PROJECT_ID}
mintConfig={{
totalPrice: priceToBuyNext.data?.totalPrice?.toString(),
_numOfTokens: tokenAmount,
_maxPayment: priceToBuyNext.data?.totalPrice?.toString(),
}}
environment={
process.env.NEXT_PUBLIC_STAGE === "production"
? "production"
: "staging"
}
mintTo={wallet.address}
/>
) : null}

<View tw="items-center pt-4">
<Text tw="text-center text-xs text-gray-500 dark:text-gray-400">
{paymentMethod === "USDC"
Expand Down
1 change: 1 addition & 0 deletions packages/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export interface Profile {
| "opted_in";
creator_token?: {
address: `0x${string}`;
crossmint_id: string | null;
id: number;
};
}
Expand Down
2 changes: 2 additions & 0 deletions packages/app/types/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export {};
declare global {
namespace NodeJS {
interface ProcessEnv {
NEXT_PUBLIC_STAGE: "development" | "staging" | "production";
NEXT_PUBLIC_MAGIC_PUB_KEY: string;
NEXT_PUBLIC_WEBSITE_DOMAIN: string;
NEXT_PUBLIC_STRIPE_KEY: string;
Expand All @@ -11,6 +12,7 @@ declare global {
NEXT_PUBLIC_ALCHEMY_API_KEY: string;
E2E: string;
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: string;
NEXT_PUBLIC_CROSSMINT_PROJECT_ID: string;
}
}
interface Window {
Expand Down

0 comments on commit cb4bce2

Please sign in to comment.