Skip to content

Commit

Permalink
feat: add bakosfe connector (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
guimroque authored Jun 29, 2024
1 parent a6af7f3 commit f3e7c4b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-phones-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuels/connectors": minor
---

add bako safe connector to the default connectors
5 changes: 5 additions & 0 deletions .changeset/olive-islands-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-connectors/bako-safe": minor
---

fix positioning/size of bako popup
8 changes: 5 additions & 3 deletions packages/bako-safe/src/DAPPWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export class DAppWindow {
top: WINDOW.innerHeight / 2 - height / 2,
left: WINDOW.innerWidth / 2 - width / 2,
width,
height: WINDOW.innerHeight >= height ? height : WINDOW.innerHeight,
height:
!this.isMobile && WINDOW.innerHeight >= height
? height
: WINDOW.innerHeight,
};
}

open(method: string, reject: (e: Error) => void) {
if (this.isOpen) reject(new Error('Window is already open'));
const _isConnection = !method.includes('/dapp/');

if (!this.isSafariBrowser) {
// if is not safari, we can use popup for both cases
Expand Down Expand Up @@ -80,7 +82,7 @@ export class DAppWindow {
frame.src = `${this.config.appUrl}${method}${this.queryString}${
isSafari ? '&byConnector=true' : ''
}`;
frame.style.position = 'absolute';
frame.style.position = 'fixed';
frame.style.zIndex = '99999999';
frame.style.top = `${w.top}`;
frame.style.left = `${w.left}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/bako-safe/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const APP_IMAGE_LIGHT =
'https://safe.bako.global/BAKO_CONNECTOR_ICON.svg';

export const APP_URL = 'https://safe.bako.global';
export const HOST_URL = 'https://api-safe.bako.global';
export const SOCKET_URL = 'https://api-safe.bako.global';
export const HOST_URL = 'https://api.bako.global';
export const SOCKET_URL = 'https://api.bako.global';

// Window object
export const HAS_WINDOW = typeof window !== 'undefined';
Expand Down
2 changes: 2 additions & 0 deletions packages/connectors/src/defaultConnectors.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BakoSafeConnector } from '@fuel-connectors/bako-safe';
import { BurnerWalletConnector } from '@fuel-connectors/burner-wallet-connector';
import { FuelWalletDevelopmentConnector } from '@fuel-connectors/fuel-development-wallet';
import { FuelWalletConnector } from '@fuel-connectors/fuel-wallet';
Expand All @@ -14,6 +15,7 @@ export function defaultConnectors({
}: DefaultConnectors = {}): Array<FuelConnector> {
const connectors = [
new FuelWalletConnector(),
new BakoSafeConnector(),
new FueletWalletConnector(),
new WalletConnectConnector(),
new BurnerWalletConnector(),
Expand Down

0 comments on commit f3e7c4b

Please sign in to comment.