diff --git a/package.json b/package.json index 185b0569..d7c4b577 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,9 @@ "@ledgerhq/hw-transport-webhid": "^6.20.0", "@ledgerhq/hw-transport-webusb": "^6.20.0", "@quasar/extras": "^1.0.0", + "@walletconnect/browser-utils": "^1.7.8", + "@walletconnect/client": "^1.7.8", + "@walletconnect/qrcode-modal": "^1.7.8", "axios": "^0.21.1", "bech32": "^2.0.0", "bignumber.js": "^9.0.2", @@ -54,6 +57,7 @@ "@types/w3c-web-hid": "^1.0.2", "@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/parser": "^4.16.1", + "@walletconnect/types": "^1.7.8", "eslint": "^7.14.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.19.1", diff --git a/src/components/BalanceSummary.vue b/src/components/BalanceSummary.vue index 45ad434a..30e72eb9 100644 --- a/src/components/BalanceSummary.vue +++ b/src/components/BalanceSummary.vue @@ -41,7 +41,7 @@ - + SEND diff --git a/src/components/BalancesTable.vue b/src/components/BalancesTable.vue index eb8ac10e..74c94de1 100644 --- a/src/components/BalancesTable.vue +++ b/src/components/BalancesTable.vue @@ -56,11 +56,11 @@

- + - + diff --git a/src/components/FantokensSummary.vue b/src/components/FantokensSummary.vue index 18a8a67e..1cb26300 100644 --- a/src/components/FantokensSummary.vue +++ b/src/components/FantokensSummary.vue @@ -9,7 +9,7 @@ Try to istance your first fantoken serie.

- + CREATE FANTOKEN diff --git a/src/components/FantokensTable.vue b/src/components/FantokensTable.vue index 4507cd36..4e8f69b4 100644 --- a/src/components/FantokensTable.vue +++ b/src/components/FantokensTable.vue @@ -65,7 +65,7 @@

- + diff --git a/src/constants/network.ts b/src/constants/network.ts index 97542086..d1da1f48 100644 --- a/src/constants/network.ts +++ b/src/constants/network.ts @@ -2,16 +2,16 @@ import { NetworkConfig } from 'src/models'; // Default network export const network: NetworkConfig = { - id: 'bigbang-test-4', + id: 'b-public-testnet-1', name: 'BitSong Testnet', description: 'BitSong Testnet', logo: 'logo.svg', website: 'https://bitsong.io', - apiURL: 'https://api.testnet.bitsong.network', + apiURL: 'https://lcd.b-public-testnet-1.bitsong.network', faucetURL: 'https://faucet.testnet.bitsong.network', - rpcURL: 'https://rpc.testnet.bitsong.network', + rpcURL: 'https://rpc.b-public-testnet-1.bitsong.network', explorerURL: 'https://www.mintscan.io/bitsong/', - minBlockHeight: 1, + minBlockHeight: 6995667, stakingDenom: 'BTSG', coinLookup: [ { diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index eccce333..02a1df4f 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -18,7 +18,7 @@ - + @@ -91,6 +91,7 @@ import { useRouter } from 'vue-router'; import MenuLink from 'src/components/MenuLink.vue'; import FaucetDialog from 'src/components/FaucetDialog.vue'; +import { SessionType } from 'src/models'; export default defineComponent({ name: 'MainLayout', @@ -123,7 +124,9 @@ export default defineComponent({ }); window.addEventListener('keplr_keystorechange', async () => { - await store.dispatch('authentication/init'); + if (session.value && session.value.sessionType === SessionType.KEPLR) { + await store.dispatch('authentication/init'); + } }); onMounted(() => { diff --git a/src/models/index.ts b/src/models/index.ts index b18c3d3b..8cb0a34b 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -21,3 +21,4 @@ export * from './supply'; export * from './inflaction'; export * from './faucet'; export * from './fantoken'; +export * from './wallet-connect'; diff --git a/src/models/session.ts b/src/models/session.ts index a179d28e..ad7a78ad 100644 --- a/src/models/session.ts +++ b/src/models/session.ts @@ -2,6 +2,7 @@ export enum SessionType { KEPLR = 'keplr', LOCAL = 'local', LEDGER = 'ledger', + WALLET_CONNECT = 'walletconnect', EXTENSION = 'extension', EXPLORE = 'explore' } diff --git a/src/models/wallet-connect.ts b/src/models/wallet-connect.ts new file mode 100644 index 00000000..c4dfb429 --- /dev/null +++ b/src/models/wallet-connect.ts @@ -0,0 +1,18 @@ +export interface PeerMeta { + description: string + icons: string[] + name: string + url: string +} + +export interface WalletConnectPayload { + event: string + params: T[] +} + +export interface WalletConnectionParam { + accounts: string[] + chainId: number + peerId: string + peerMeta: PeerMeta +} diff --git a/src/modules/authentication/views/LoginHome.vue b/src/modules/authentication/views/LoginHome.vue index fd9e4f0c..ceb0c88c 100644 --- a/src/modules/authentication/views/LoginHome.vue +++ b/src/modules/authentication/views/LoginHome.vue @@ -7,16 +7,8 @@ - - - - + +