Skip to content

Commit

Permalink
Merge pull request #73 from XDeFi-tech/fix/keplr-conneciton
Browse files Browse the repository at this point in the history
fix: keplr window if connected xdefi XDEFI-5937
  • Loading branch information
taran-a committed Jan 31, 2024
2 parents c75a352 + 30794fd commit bd1a037
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xdefi/wallets-connector",
"version": "2.1.0",
"version": "2.1.1",
"description": "Cross chain wallets connector with react hooks",
"author": "garageinc",
"license": "MIT",
Expand Down
10 changes: 5 additions & 5 deletions src/providers/injected/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ const getCosmosTemplate = (chainId: string) => ({
methods: {
getAccounts: () => {
return new Promise((resolve, reject) => {
return window.keplr
return window.xfi.keplr
.enable(chainId)
.then(() => {
return window.keplr.getOfflineSigner(chainId).getAccounts()
return window.xfi.keplr.getOfflineSigner(chainId).getAccounts()
})
.then((accounts: any) => {
resolve(accounts.map((addressItem: any) => addressItem.address))
Expand All @@ -158,7 +158,7 @@ const getCosmosTemplate = (chainId: string) => ({
request: (method: string, data: any) => {
if (method === 'getKey') {
return new Promise((resolve, reject) => {
return window.keplr
return window.xfi.keplr
.getKey(data)
.then((result: any) => {
resolve(result)
Expand All @@ -171,7 +171,7 @@ const getCosmosTemplate = (chainId: string) => ({

if (method === 'getSigner') {
return new Promise((resolve, reject) => {
const signer = window.getOfflineSigner?.(chainId)
const signer = window.xfi.keplr.getOfflineSigner?.(chainId)
if (signer) {
resolve(signer)
} else {
Expand All @@ -181,7 +181,7 @@ const getCosmosTemplate = (chainId: string) => ({
}
if (method === 'sendTx') {
return new Promise((resolve, reject) => {
window.keplr
window.xfi.keplr
.sendTx?.(chainId, data.tx, data.mode)
.then(resolve)
.catch(reject)
Expand Down

0 comments on commit bd1a037

Please sign in to comment.