forked from passportxyz/passport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(platforms): adds coinbase config files
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { PlatformOptions } from "../types"; | ||
import { Platform } from "../utils/platform"; | ||
export class CoinbasePlatform extends Platform { | ||
platformId = "Coinbase"; | ||
path = "coinbase"; | ||
clientId: string = null; | ||
redirectUri: string = null; | ||
|
||
constructor(options: PlatformOptions = {}) { | ||
super(); | ||
this.clientId = options.clientId as string; | ||
this.redirectUri = options.redirectUri as string; | ||
} | ||
|
||
async getOAuthUrl(state: string): Promise<string> { | ||
const coinbasebUrl = await Promise.resolve( | ||
`https://www.coinbase.com/oauth/authorize?response_type=code&client_id=${this.clientId}&redirect_uri=${this.redirectUri}&state=${state}` | ||
); | ||
return coinbasebUrl; | ||
} | ||
} |
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,16 @@ | ||
import { PlatformSpec, PlatformGroupSpec } from "../types"; | ||
|
||
export const CoinbasePlatformDetails: PlatformSpec = { | ||
icon: "./assets/coinbaseStampIcon.svg", | ||
platform: "Coinbase", | ||
name: "Coinbase", | ||
description: "Connect your existing account to verify with Coinbase.", | ||
connectMessage: "Connect Account", | ||
}; | ||
|
||
export const CoinbaseProviderConfig: PlatformGroupSpec[] = [ | ||
{ | ||
platformGroup: "Account Name", | ||
providers: [{ title: "Encrypted", name: "Coinbase" }], | ||
}, | ||
]; |
Empty file.
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,3 @@ | ||
export { CoinbasePlatform } from "./App-Bindings"; | ||
export { CoinbaseProviderConfig, CoinbasePlatformDetails } from "./Providers-config"; | ||
export { CoinbaseProvider } from "./Providers/coinbase"; |