Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libs/starknet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getStarknet} from 'get-starknet-wallet';
import {getStarknet, connect as getStarknetWallet} from 'get-starknet-wallet';
import * as starknet from 'starknet';

export {starknet, getStarknet};
export {starknet, getStarknet, getStarknetWallet};
7 changes: 5 additions & 2 deletions src/providers/WalletsProvider/wallets-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useCallback, useContext, useEffect, useState} from 'react';

import {ChainInfo, ChainType, WalletErrorType, WalletStatus} from '../../enums';
import {useEnvs} from '../../hooks';
import {getStarknet} from '../../libs';
import {getStarknet, getStarknetWallet} from '../../libs';
import {useTransfer} from '../TransferProvider';
import {WalletsContext} from './wallets-context';

Expand Down Expand Up @@ -70,8 +70,11 @@ export const useStarknetWallet = () => {

const connect = async walletConfig => {
try {
const wallet = await getStarknetWallet();
if (!wallet) {
return;
}
setStatus(WalletStatus.CONNECTING);
const wallet = getStarknet();
const enabled = await wallet
.enable(!autoConnect && {showModal: true})
.then(address => !!address?.length);
Expand Down