Skip to content

Commit

Permalink
chore(commerce): extract TimelineStatus type
Browse files Browse the repository at this point in the history
  • Loading branch information
roushou committed Jul 7, 2024
1 parent 58486ca commit a0b3446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-mails-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coinbasejs/commerce": patch
---

chore(commerce): extract `TimelineStatus` type
10 changes: 9 additions & 1 deletion packages/commerce/src/charge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ export async function createCharge(

export type ChargePricingType = "fixed_price" | "no_price";

export type TimelineStatus =
| "COMPLETED"
| "EXPIRED"
| "FAILED"
| "NEW"
| "PENDING"
| "SIGNED";

export type Charge = {
brand_color: string;
brand_logo_url: string;
Expand Down Expand Up @@ -92,7 +100,7 @@ export type Charge = {
support_email: string;
third_party_provider: string;
timeline: Array<{
status: "COMPLETED" | "EXPIRED" | "FAILED" | "NEW" | "PENDING" | "SIGNED";
status: TimelineStatus;
time: string;
}>;
web3_data: {
Expand Down
1 change: 1 addition & 0 deletions packages/commerce/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type {
CreateChargeResponse,
GetChargeResponse,
GetChargesResponse,
TimelineStatus,
} from "./charge";
export { createCheckout, getCheckout, getCheckouts } from "./checkout";
export type {
Expand Down

0 comments on commit a0b3446

Please sign in to comment.