Skip to content

Commit

Permalink
chore: Update analytics type definitions to union with undefined (#2039)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer authored Feb 26, 2025
1 parent e7e902f commit f729273
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/analytics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export type WalletEventData = {
};
[WalletEvent.ConnectError]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[WalletEvent.ConnectSuccess]: CommonAnalyticsData & {
address: string;
Expand Down Expand Up @@ -191,7 +191,7 @@ export type SwapEventData = {
};
[SwapEvent.SwapFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[SwapEvent.SwapInitiated]: CommonAnalyticsData & {
amount: number;
Expand All @@ -201,7 +201,7 @@ export type SwapEventData = {
export type BuyEventData = {
[BuyEvent.BuyFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[BuyEvent.BuyInitiated]: CommonAnalyticsData & {
amount: number;
Expand Down Expand Up @@ -230,11 +230,11 @@ export type CheckoutEventData = {
productId: string;
chargeHandlerId: string;
isSponsored: boolean;
transactionHash?: string;
transactionHash: string | undefined;
};
[CheckoutEvent.CheckoutFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[CheckoutEvent.CheckoutInitiated]: CommonAnalyticsData & {
amount: number;
Expand All @@ -248,7 +248,7 @@ export type CheckoutEventData = {
export type MintEventData = {
[MintEvent.MintFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[MintEvent.MintInitiated]: CommonAnalyticsData & {
contractAddress: string;
Expand All @@ -273,7 +273,7 @@ export type MintEventData = {
export type TransactionEventData = {
[TransactionEvent.TransactionFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[TransactionEvent.TransactionInitiated]: CommonAnalyticsData & {
address: string | undefined;
Expand All @@ -295,7 +295,7 @@ export type FundEventData = {
};
[FundEvent.FundFailure]: CommonAnalyticsData & {
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
[FundEvent.FundInitiated]: CommonAnalyticsData & {
currency: string;
Expand Down Expand Up @@ -412,6 +412,6 @@ export type AnalyticsEventData = {
[ErrorEvent.ComponentError]: CommonAnalyticsData & {
component: string;
error: string;
metadata?: Record<string, unknown>;
metadata: Record<string, unknown> | undefined;
};
};

0 comments on commit f729273

Please sign in to comment.