-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
348 additions
and
511 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AuthProvider } from "@arcana/auth"; | ||
|
||
let auth = null; | ||
|
||
export const getAuthProvider = () => { | ||
if (!auth) { | ||
auth = new AuthProvider( | ||
"xar_dev_19527cdf585cd31d0bd06bfc1b008accea781404" | ||
); | ||
} | ||
return auth; | ||
}; |
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 |
---|---|---|
@@ -1,50 +1,70 @@ | ||
# Arcana auth wagmi connector | ||
# Arcana Auth Wagmi Connector | ||
|
||
|
||
## Install | ||
|
||
```sh | ||
yarn add @arcana/auth-wagmi @arcana/auth | ||
``` | ||
|
||
## Usage | ||
|
||
With connect modal | ||
|
||
```ts | ||
import { ArcanaConnector } from "@arcana/auth-wagmi" | ||
import { AuthProvider } from "@arcana/auth" | ||
|
||
const auth = new AuthProvider(`${arcana_client_id}`) // Singleton | ||
const connector = new ArcanaConnector({ | ||
options: { | ||
clientId: `${arcana_client_id}`, | ||
auth, | ||
} | ||
}) | ||
|
||
``` | ||
|
||
## Configuration | ||
|
||
## chains | ||
|
||
Chains supported by app. | ||
With custom UI | ||
|
||
```ts | ||
import { mainnet, optimism, polygon } from '@wagmi/core/chains' | ||
import { ArcanaConnector } from "@arcana/auth-wagmi" | ||
|
||
import { AuthProvider } from "@arcana/auth" | ||
|
||
const auth = new AuthProvider(`${arcana_client_id}`) // Singleton | ||
const connector = new ArcanaConnector({ | ||
chains: [mainnet, optimism, polygon], | ||
options: { | ||
clientId: `${arcana_client_id}`, | ||
}, | ||
options: { | ||
auth, | ||
login: { | ||
provider: "google" | ||
} // Optional, specify here or in setLogin function | ||
} | ||
}) | ||
|
||
// OR | ||
|
||
connector.setLogin({ | ||
provider: "google" | ||
}) | ||
``` | ||
|
||
## options | ||
## Configuration | ||
|
||
## Add Chains | ||
|
||
Options to be passed to Arcana auth SDK. | ||
Configure the chains that will show up in the Arcana wallet within your app's context. In the example below, the chains configured are: Optimism, Polygon and Ethereum Mainnet. | ||
|
||
```ts | ||
import { mainnet, optimism, polygon } from '@wagmi/core/chains' | ||
import { ArcanaConnector } from "@arcana/auth-wagmi" | ||
import { AuthProvider } from "@arcana/auth" | ||
|
||
const auth = new AuthProvider(`${arcana_client_id}`) | ||
|
||
const connector = new ArcanaConnector({ | ||
chains: [mainnet, optimism, polygon], | ||
options: { | ||
clientId: `${arcana_client_id}`, | ||
theme: 'light', // Defaults to 'dark' | ||
alwaysVisible: false, // Defaults to true | ||
position: 'left' // Defaults to 'right' | ||
auth, | ||
}, | ||
}) | ||
``` | ||
|
||
Remaining integration documentation can be found at [wagmi](https://wagmi.sh/core/getting-started) docs. | ||
For more details on connectors and integrating your app with Wagmi, see [Wagmi documentation](https://wagmi.sh/core/getting-started). |
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.