-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: coinbase pay sdk integration (#1487)
Co-authored-by: Neel Ramachandran <[email protected]> Co-authored-by: 0xAsimetriq <[email protected]> Co-authored-by: tomiir <[email protected]> Co-authored-by: Derek <[email protected]>
- Loading branch information
1 parent
7186d23
commit 3b0eafb
Showing
82 changed files
with
2,226 additions
and
163 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
35 changes: 35 additions & 0 deletions
35
apps/gallery/stories/composites/wui-onramp-activity-item.stories.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,35 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@web3modal/ui/src/composites/wui-onramp-activity-item' | ||
import type { WuiOnRampActivityItem } from '@web3modal/ui/src/composites/wui-onramp-activity-item' | ||
import { html } from 'lit' | ||
import '../../components/gallery-container' | ||
|
||
type Component = Meta<WuiOnRampActivityItem> | ||
|
||
export default { | ||
title: 'Composites/wui-onramp-activity-item', | ||
args: { | ||
completed: true, | ||
inProgress: false, | ||
failed: false, | ||
purchaseCurrency: 'USD', | ||
purchaseValue: '1000', | ||
date: '2 days ago' | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html` | ||
<gallery-container width="340"> | ||
<wui-onramp-activity-item | ||
label="Bought" | ||
.completed=${args.completed} | ||
.inProgress=${args.inProgress} | ||
.failed=${args.failed} | ||
purchaseCurrency=${args.purchaseCurrency} | ||
purchaseValue=${args.purchaseValue} | ||
date=${args.date} | ||
></wui-onramp-activity-item> | ||
</gallery-container> | ||
` | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { subscribeKey as subKey } from 'valtio/utils' | ||
import { proxy } from 'valtio/vanilla' | ||
import { ONRAMP_PROVIDERS } from '../utils/ConstantsUtil.js' | ||
|
||
// -- Types --------------------------------------------- // | ||
export type OnRampProviderOption = 'coinbase' | 'moonpay' | 'stripe' | 'paypal' | ||
|
||
export type OnRampProvider = { | ||
label: string | ||
name: OnRampProviderOption | ||
feeRange: string | ||
url: string | ||
} | ||
|
||
export interface OnRampControllerState { | ||
providers: OnRampProvider[] | ||
selectedProvider: OnRampProvider | null | ||
error: string | null | ||
} | ||
|
||
type StateKey = keyof OnRampControllerState | ||
|
||
// -- State --------------------------------------------- // | ||
const state = proxy<OnRampControllerState>({ | ||
providers: ONRAMP_PROVIDERS as OnRampProvider[], | ||
selectedProvider: null, | ||
error: null | ||
}) | ||
|
||
// -- Controller ---------------------------------------- // | ||
export const OnRampController = { | ||
state, | ||
|
||
subscribeKey<K extends StateKey>(key: K, callback: (value: OnRampControllerState[K]) => void) { | ||
return subKey(state, key, callback) | ||
}, | ||
|
||
setSelectedProvider(provider: OnRampProvider | null) { | ||
state.selectedProvider = provider | ||
} | ||
} |
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.
3b0eafb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😃