Skip to content

Commit

Permalink
Experimental integration with linenext, require push to dev.ixswap.io
Browse files Browse the repository at this point in the history
  • Loading branch information
thi-investax committed Dec 29, 2024
1 parent f841382 commit f2f8208
Show file tree
Hide file tree
Showing 3 changed files with 868 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
"dependencies": {
"@cyntler/react-doc-viewer": "^1.14.1",
"@date-io/dayjs": "1.x",
"@linenext/dapp-portal-sdk": "^0.9.1",
"@material-ui/core": "^4.12.3",
"@material-ui/pickers": "4.0.0-alpha.12",
"@metamask/detect-provider": "^2.0.0",
Expand Down
20 changes: 18 additions & 2 deletions src/components/NotAvailablePage/ConnectWalletCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@ import { useConnectModal } from '@rainbow-me/rainbowkit'
import { ConnectWalletContainer } from './styled'
import { PinnedContentButton } from 'components/Button'
import { useWhitelabelState } from 'state/whitelabel/hooks'
import DappPortalSDK from '@linenext/dapp-portal-sdk'

const ConnectWalletCard = () => {
const { config } = useWhitelabelState()
const { openConnectModal } = useConnectModal()

const initLineNext = async () => {
const sdk = await DappPortalSDK.init({ clientId: 'bab621cd-1d1e-45ef-8b42-c2b0917c645a' })
const provider = sdk.getWalletProvider()

const accounts = (await provider.request({ method: 'kaia_requestAccounts' })) as any
const accountAddress = accounts[0]
console.log('accounts', accounts)
console.log('accountAddress', accountAddress)

if (accounts.length > 0) {
window.ethereum = provider
}
}

return (
<ConnectWalletContainer>
<Text>
Expand All @@ -20,7 +35,7 @@ const ConnectWalletCard = () => {
Please Connect <br /> your Wallet to use <br /> the Application.
</div>
{openConnectModal && (
<PinnedContentButton style={{ boxShadow: '0px 16px 16px 0px #6666FF21' }} onClick={openConnectModal}>
<PinnedContentButton style={{ boxShadow: '0px 16px 16px 0px #6666FF21' }} onClick={initLineNext}>
<Text className="connect-wallet-button">
<Trans>Connect Wallet</Trans>
</Text>
Expand Down Expand Up @@ -63,4 +78,5 @@ const ConnectWalletCard = () => {
)
}

export default ConnectWalletCard;
export default ConnectWalletCard

Loading

0 comments on commit f2f8208

Please sign in to comment.