forked from Joystream/atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚶♀️ WalletConnect integration (Joystream#5867)
* mvp of walletconnect integration * fixed empty class error * code refactor, visual fixes * fixed linter issues * build issues * fixed signer bugs, fixed reset after refresh, various bugs * moved chainId to env params * bugfix, code refactor, mobile implementation, minor fixes * fixed confirm action * linter * prioritise web2 login, enable walletConnect for mobile * moved WalletConnect deps to atlas package * cr fixes, bugfix * fixed disconnect functionality * lint * code refactor, secondary button * fixed wallet reject for nova wallet * moved towards dynamic set of url * removed unused var * unused dep --------- Co-authored-by: Artem <Artem Slugin>
- Loading branch information
Showing
24 changed files
with
2,228 additions
and
107 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
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,14 @@ | ||
// THIS FILE WAS AUTOGENERATED BY SVGR. DO NOT MODIFY IT MANUALLY; | ||
import { Ref, SVGProps, forwardRef, memo } from 'react' | ||
|
||
const SvgWcLogo = forwardRef((props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => ( | ||
<svg fill="none" height={24} viewBox="0 0 480 332" width={24} xmlns="http://www.w3.org/2000/svg" ref={ref} {...props}> | ||
<path | ||
d="M126.613 93.984c62.622-61.312 164.152-61.312 226.775 0l7.536 7.379a7.735 7.735 0 0 1 0 11.102l-25.781 25.242a4.07 4.07 0 0 1-5.67 0l-10.371-10.154c-43.687-42.773-114.517-42.773-158.204 0l-11.107 10.874a4.069 4.069 0 0 1-5.669 0l-25.781-25.242a7.733 7.733 0 0 1 0-11.102zm280.093 52.204 22.946 22.465a7.735 7.735 0 0 1 0 11.102L326.189 281.056c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896a2.034 2.034 0 0 0-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0L50.348 179.754a7.735 7.735 0 0 1 0-11.102l22.946-22.466c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897a2.033 2.033 0 0 0 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897a2.034 2.034 0 0 0 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z" | ||
fill="#3396ff" | ||
/> | ||
</svg> | ||
)) | ||
SvgWcLogo.displayName = 'SvgWcLogo' | ||
const Memo = memo(SvgWcLogo) | ||
export { Memo as SvgWcLogo } |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,4 @@ | ||
export const JOYSTREAM_DEFAULT_CHAIN_ID = 'polkadot:6b5e488e0fa8f9821110d5c13f4c468a' | ||
export const WC_VERSION = '2.0' | ||
|
||
export const JOYSTREAM_SS58_PREFIX = 126 |
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 @@ | ||
export * from './types.js' |
43 changes: 43 additions & 0 deletions
43
packages/atlas/src/providers/wallet/tmpwallet/core/types.ts
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,43 @@ | ||
import type { Signer } from '@polkadot/types/types' | ||
|
||
export type KeypairType = 'ed25519' | 'sr25519' | ||
|
||
export interface Account { | ||
address: string | ||
type?: KeypairType | ||
genesisHash?: string | null | ||
name?: string | ||
} | ||
|
||
export enum WalletType { | ||
INJECTED = 'INJECTED', | ||
WALLET_CONNECT = 'WALLET_CONNECT', | ||
LEDGER = 'LEDGER', | ||
} | ||
|
||
export interface BaseWalletProvider { | ||
getWallets: () => Promise<BaseWallet[]> | ||
} | ||
|
||
export interface WalletMetadata { | ||
id: string | ||
title: string | ||
description?: string | ||
urls?: { main?: string; browsers?: Record<string, string> } | ||
iconUrl?: string | ||
version?: string | ||
} | ||
|
||
export type UnsubscribeFn = () => void | ||
|
||
export interface BaseWallet { | ||
metadata: WalletMetadata | ||
type: WalletType | ||
// signer will be available when the wallet is connected, otherwise it is undefined | ||
signer: Signer | undefined | ||
connect: () => Promise<void> | ||
disconnect: () => Promise<void> | ||
isConnected: () => boolean | ||
getAccounts: () => Promise<Account[]> | ||
subscribeAccounts: (cb: (accounts: Account[]) => void) => Promise<UnsubscribeFn> | ||
} |
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,3 @@ | ||
export * from './wallet-connect.js' | ||
export * from './types.js' | ||
export * from './consts.js' |
Oops, something went wrong.