-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
ad8edb0
commit 52f059b
Showing
7 changed files
with
405 additions
and
327 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 { CanvasClient } from '@dscvr-one/canvas-client-sdk'; | ||
import { registerCanvasWallet } from '@dscvr-one/canvas-wallet-adapter'; | ||
import type { WalletName } from '@solana/wallet-adapter-base'; | ||
|
||
export const checkIframe = () => { | ||
try { | ||
return window.self !== window.top; | ||
} catch (e) { | ||
return true; | ||
} | ||
}; | ||
|
||
export const isIframe = checkIframe(); | ||
export const canvasClient = isIframe ? new CanvasClient() : undefined; | ||
const canvasWallet = canvasClient | ||
? registerCanvasWallet(canvasClient) | ||
: undefined; | ||
|
||
export const CANVAS_WALLET_NAME = canvasWallet | ||
? (canvasWallet.name as WalletName) | ||
: undefined; |
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,10 +1,20 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.tsx' | ||
import './index.css' | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import { | ||
WalletProvider, | ||
ConnectionProvider, | ||
} from '@solana/wallet-adapter-react'; | ||
import App from './App.tsx'; | ||
import './index.css'; | ||
|
||
const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
<WalletProvider wallets={[]}> | ||
<ConnectionProvider endpoint={RPC_ENDPOINT}> | ||
<App /> | ||
</ConnectionProvider> | ||
</WalletProvider> | ||
</React.StrictMode> | ||
); |
Oops, something went wrong.