-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connectors): expose ready as static method
- Loading branch information
Showing
7 changed files
with
50 additions
and
49 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,19 @@ | ||
import { AccountInterface } from 'starknet' | ||
|
||
export abstract class Connector<Options = any> { | ||
/** Unique connector id */ | ||
abstract readonly id: string | ||
/** Connector name */ | ||
abstract readonly name: string | ||
/** Whether connector is usable */ | ||
static readonly ready: boolean | ||
/** Options to use with connector */ | ||
readonly options: Options | ||
|
||
constructor({ options }: { options: Options }) { | ||
this.options = options | ||
} | ||
|
||
abstract connect(): Promise<AccountInterface> | ||
abstract account(): Promise<AccountInterface> | ||
} |
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 |
---|---|---|
@@ -1,21 +1,2 @@ | ||
import { AccountInterface } from 'starknet' | ||
|
||
export abstract class Connector<Options = any> { | ||
/** Unique connector id */ | ||
abstract readonly id: string | ||
/** Connector name */ | ||
abstract readonly name: string | ||
/** Whether connector is usable */ | ||
abstract readonly ready: boolean | ||
/** Options to use with connector */ | ||
readonly options: Options | ||
|
||
constructor({ options }: { options: Options }) { | ||
this.options = options | ||
} | ||
|
||
abstract connect(): Promise<AccountInterface> | ||
abstract account(): Promise<AccountInterface> | ||
} | ||
|
||
export { Connector } from './base' | ||
export { InjectedConnector } from './injected' |
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