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

embed: use real order type #842

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .changeset/silent-countries-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@crossmint/client-sdk-react-ui": patch
"@crossmint/client-sdk-base": patch
---

embed: add Order type
2 changes: 2 additions & 0 deletions packages/client/base/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from "./lib";

export * from "./utils";
export * from "./types";
export * from "./services";
Expand Down
4,493 changes: 4,493 additions & 0 deletions packages/client/base/src/lib/hosted-checkout/Order.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/client/base/src/lib/hosted-checkout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Order";
1 change: 1 addition & 0 deletions packages/client/base/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./hosted-checkout";
4 changes: 2 additions & 2 deletions packages/client/ui/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"types": "./dist/index.d.ts",
"files": ["dist", "src", "LICENSE"],
"scripts": {
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
"dev": "NODE_OPTIONS='--max-old-space-size=8192' tsup --watch",
"build": "cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",
"dev": "cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch",
"test": "vitest run"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { createContext, type ReactNode, useContext, useEffect, useState } from "react";
import type { embeddedCheckoutV3IncomingEvents } from "@crossmint/client-sdk-base";
import type { embeddedCheckoutV3IncomingEvents, Order } from "@crossmint/client-sdk-base";
import type { z } from "zod";
import { useCrossmint } from "./useCrossmint";
import { createCrossmintApiClient } from "@/utils/createCrossmintApiClient";

export interface CrossmintCheckoutContext {
order?: any;
order?: Order;
orderClientSecret?: string;
}

const CrossmintCheckoutContext = createContext<CrossmintCheckoutContext | undefined>(undefined);

export function CrossmintCheckoutProvider({ children }: { children: ReactNode }) {
const [order, setOrder] = useState<any>();
const [orderClientSecret, setOrderClientSecret] = useState<string>();
const [order, setOrder] = useState<Order | undefined>(undefined);
const [orderClientSecret, setOrderClientSecret] = useState<string | undefined>(undefined);

const { crossmint } = useCrossmint();
const apiClient = createCrossmintApiClient(crossmint);
Expand Down
Loading