Skip to content

Commit

Permalink
chore: update README and jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecco committed Feb 10, 2025
1 parent cb3ee93 commit 424b9a8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,31 @@ By default, the list of connectors is:
## Connect with specific connectors

```js
const webwallet = await connect([new WebWalletConnector()])
const webwallet = await connect({
connectors: [new WebWalletConnector()]
})

const webwallet = await connect({
connectors: [new WebwalletGoogleAuthConnector({
clientId: "YOUR_GOOGLE_CLIENT_ID",
authorizedPartyId: "STRING_IDENTIFYING YOUR PROJECT"
})]
})

const argentMobileWallet = await connect([
new ArgentMobileConnector()
])
const google

const wallet = await connect([
new InjectedConnector({ options: { id: "argentX" } }),
new InjectedConnector({ options: { id: "braavos" } })
])
const argentMobileWallet = await connect({
connectors: [
new ArgentMobileConnector()
]
})

const wallet = await connect({
connectors: [
new InjectedConnector({ options: { id: "argentX" } }),
new InjectedConnector({ options: { id: "braavos" } })
]
})
```

## Reconnect to a previously connected wallet on load:
Expand Down
10 changes: 10 additions & 0 deletions src/connectors/webwallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export class WebWalletConnector extends Connector {
protected _wallet: StarknetWindowObject | null = null
protected _options: WebWalletConnectorOptions

/**
* @param options.url - Webwallet URL
* @param options.theme - Theme
* @param options.ssoToken - SSO token - response from Google Auth
* @param options.authorizedPartyId - String identifying your project
*/
constructor(options: WebWalletConnectorOptions = {}) {
super()
this._options = options
Expand Down Expand Up @@ -239,6 +245,10 @@ export type { WebWalletStarknetWindowObject }
export class WebwalletGoogleAuthConnector extends WebWalletConnector {
private _clientId: string

/**
* @param options.clientId - Google client ID
* @param options.authorizedPartyId - String identifying your project
*/
constructor(
options: WebwalletGoogleAuthOptions = {
clientId: "",
Expand Down

0 comments on commit 424b9a8

Please sign in to comment.