-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO CHANGELOG][Checkout widget] Feature: Add Checkout Widget (#2188)
- Loading branch information
Showing
32 changed files
with
972 additions
and
895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
packages/checkout/widgets-lib/src/context/view-context/CheckoutWidgetViewContextTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { | ||
BridgeWidgetConfiguration, | ||
BridgeWidgetParams, | ||
OnrampWidgetConfiguration, | ||
OnRampWidgetParams, | ||
SaleWidgetConfiguration, | ||
SaleWidgetParams, | ||
SwapWidgetConfiguration, | ||
SwapWidgetParams, | ||
AddFundsWidgetParams, | ||
AddFundsWidgetConfiguration, | ||
CheckoutFlowType, | ||
ConnectWidgetParams, | ||
ConnectWidgetConfiguration, | ||
WalletWidgetParams, | ||
WalletWidgetConfiguration, | ||
} from '@imtbl/checkout-sdk'; | ||
import { ViewType } from './ViewType'; | ||
|
||
export type CheckoutWidgetView = | ||
| ConnectView | ||
| WalletView | ||
| AddFundsView | ||
| SaleView | ||
| SwapView | ||
| OnRampView | ||
| BrdigeView; | ||
|
||
interface ConnectView extends ViewType { | ||
type: CheckoutFlowType.CONNECT; | ||
data: { | ||
params: ConnectWidgetParams; | ||
config: ConnectWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface WalletView extends ViewType { | ||
type: CheckoutFlowType.WALLET; | ||
data: { | ||
params: WalletWidgetParams; | ||
config: WalletWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface AddFundsView extends ViewType { | ||
type: CheckoutFlowType.ADD_FUNDS; | ||
data: { | ||
params: AddFundsWidgetParams; | ||
config: AddFundsWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface SaleView extends ViewType { | ||
type: CheckoutFlowType.SALE; | ||
data: { | ||
params: Required<SaleWidgetParams>; | ||
config: SaleWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface SwapView extends ViewType { | ||
type: CheckoutFlowType.SWAP; | ||
data: { | ||
params: SwapWidgetParams; | ||
config: SwapWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface OnRampView extends ViewType { | ||
type: CheckoutFlowType.ONRAMP; | ||
data: { | ||
params: OnRampWidgetParams; | ||
config: OnrampWidgetConfiguration; | ||
}; | ||
} | ||
|
||
interface BrdigeView extends ViewType { | ||
type: CheckoutFlowType.BRIDGE; | ||
data: { | ||
params: BridgeWidgetParams; | ||
config: BridgeWidgetConfiguration; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.