diff --git a/src/connectors/argentMobile/helpers/inAppBrowser.ts b/src/connectors/argentMobile/helpers/inAppBrowser.ts new file mode 100644 index 0000000..77f21a2 --- /dev/null +++ b/src/connectors/argentMobile/helpers/inAppBrowser.ts @@ -0,0 +1,13 @@ +import type { StarknetWindowObject } from "get-starknet-core" + +export const isInArgentMobileAppBrowser = (): boolean => { + if (!window?.starknet_argentX) { + return false + } + + const starknetMobile = window?.starknet_argentX as StarknetWindowObject & { + isInAppBrowser: boolean + } + + return starknetMobile?.isInAppBrowser +} diff --git a/src/connectors/argentMobile/helpers/index.ts b/src/connectors/argentMobile/helpers/index.ts new file mode 100644 index 0000000..bfe3f22 --- /dev/null +++ b/src/connectors/argentMobile/helpers/index.ts @@ -0,0 +1 @@ +export * from "./inAppBrowser" diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index f97206c..e1939d8 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -184,3 +184,5 @@ export class ArgentMobileConnector extends Connector { }) } } + +export { isInArgentMobileAppBrowser } from "./helpers"