@xyo-network/xl1-react-client-sdk 1.28.4 → 1.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client/context/GatewayContext.d.ts +2 -7
- package/dist/browser/client/context/GatewayContext.d.ts.map +1 -1
- package/dist/browser/client/context/in-page/InPageGatewaysContext.d.ts +2 -7
- package/dist/browser/client/context/in-page/InPageGatewaysContext.d.ts.map +1 -1
- package/dist/browser/client/context/in-page/useProvidedInPageGateways.d.ts +2 -3
- package/dist/browser/client/context/in-page/useProvidedInPageGateways.d.ts.map +1 -1
- package/dist/browser/client/context/useProvidedGateway.d.ts +2 -3
- package/dist/browser/client/context/useProvidedGateway.d.ts.map +1 -1
- package/dist/browser/client/index.mjs.map +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +38 -38
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GatewayStateFields } from './GatewayProviderState.ts';
|
|
1
2
|
/**
|
|
2
3
|
* Shared React context that decouples gateway *sources* from gateway
|
|
3
4
|
* *consumers*. Any provider that can resolve an `XyoGateway` publishes to
|
|
@@ -18,11 +19,5 @@
|
|
|
18
19
|
* to this same context — do not create a parallel context, or consumers
|
|
19
20
|
* will silently stop receiving updates.
|
|
20
21
|
*/
|
|
21
|
-
export declare const GatewayContext: import("react").Context<
|
|
22
|
-
provided: true;
|
|
23
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<import("./GatewayProviderState.ts").GatewayStateFields>, never> & {
|
|
24
|
-
provided: false;
|
|
25
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<import("./GatewayProviderState.ts").GatewayStateFields>, never> & {
|
|
26
|
-
provided: false;
|
|
27
|
-
})>;
|
|
22
|
+
export declare const GatewayContext: import("react").Context<import("@xylabs/react-shared").ContextExState<GatewayStateFields>>;
|
|
28
23
|
//# sourceMappingURL=GatewayContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayContext.d.ts","sourceRoot":"","sources":["../../../../src/client/context/GatewayContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GatewayContext.d.ts","sourceRoot":"","sources":["../../../../src/client/context/GatewayContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,4FAAwC,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InPageGatewaysStateFields } from './InPageGatewaysState.ts';
|
|
1
2
|
/**
|
|
2
3
|
* Narrow, provider-internal context that `InPageGatewaysProvider` writes
|
|
3
4
|
* to and `GatewayProvider` reads from. Do not consume this in application
|
|
@@ -6,11 +7,5 @@
|
|
|
6
7
|
* single in-page *builder* from the many single-gateway *adapters* that
|
|
7
8
|
* sit between it and the shared gateway surface.
|
|
8
9
|
*/
|
|
9
|
-
export declare const InPageGatewaysContext: import("react").Context<
|
|
10
|
-
provided: true;
|
|
11
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<import("./InPageGatewaysState.ts").InPageGatewaysStateFields>, never> & {
|
|
12
|
-
provided: false;
|
|
13
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<import("./InPageGatewaysState.ts").InPageGatewaysStateFields>, never> & {
|
|
14
|
-
provided: false;
|
|
15
|
-
})>;
|
|
10
|
+
export declare const InPageGatewaysContext: import("react").Context<import("@xylabs/react-shared").ContextExState<InPageGatewaysStateFields>>;
|
|
16
11
|
//# sourceMappingURL=InPageGatewaysContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InPageGatewaysContext.d.ts","sourceRoot":"","sources":["../../../../../src/client/context/in-page/InPageGatewaysContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InPageGatewaysContext.d.ts","sourceRoot":"","sources":["../../../../../src/client/context/in-page/InPageGatewaysContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,mGAA+C,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InPageGatewaysStateFields } from './InPageGatewaysState.ts';
|
|
1
2
|
/**
|
|
2
3
|
* Reads the `InPageGatewaysContext` map of per-network in-page gateways.
|
|
3
4
|
* Intended for internal use by `GatewayProvider` — application code
|
|
@@ -7,7 +8,5 @@
|
|
|
7
8
|
* @param required - When `true` (default), throws if no
|
|
8
9
|
* `InPageGatewaysProvider` is mounted above.
|
|
9
10
|
*/
|
|
10
|
-
export declare const useProvidedInPageGateways: (required?: boolean) => Omit<import("
|
|
11
|
-
provided: true;
|
|
12
|
-
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<import("./InPageGatewaysState.ts").InPageGatewaysState>, "provided">;
|
|
11
|
+
export declare const useProvidedInPageGateways: (required?: boolean) => Omit<import("@xylabs/react-shared").ProvidedContextExState<InPageGatewaysStateFields>, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<InPageGatewaysStateFields>, "provided">;
|
|
13
12
|
//# sourceMappingURL=useProvidedInPageGateways.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidedInPageGateways.d.ts","sourceRoot":"","sources":["../../../../../src/client/context/in-page/useProvidedInPageGateways.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProvidedInPageGateways.d.ts","sourceRoot":"","sources":["../../../../../src/client/context/in-page/useProvidedInPageGateways.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEzE;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,kBAAe,+MAA+F,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GatewayStateFields } from './GatewayProviderState.ts';
|
|
1
2
|
/**
|
|
2
3
|
* The sole consumer entry point for gateway state. Reads the nearest
|
|
3
4
|
* `GatewayContext` in the tree, regardless of which provider published
|
|
@@ -10,7 +11,5 @@
|
|
|
10
11
|
* without a gateway. When `false`, returns default state (all fields
|
|
11
12
|
* undefined) so the component can render a graceful fallback.
|
|
12
13
|
*/
|
|
13
|
-
export declare const useProvidedGateway: (required?: boolean) => Omit<import("
|
|
14
|
-
provided: true;
|
|
15
|
-
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<import("./GatewayProviderState.ts").GatewayContextState>, "provided">;
|
|
14
|
+
export declare const useProvidedGateway: (required?: boolean) => Omit<import("@xylabs/react-shared").ProvidedContextExState<GatewayStateFields>, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<GatewayStateFields>, "provided">;
|
|
16
15
|
//# sourceMappingURL=useProvidedGateway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidedGateway.d.ts","sourceRoot":"","sources":["../../../../src/client/context/useProvidedGateway.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProvidedGateway.d.ts","sourceRoot":"","sources":["../../../../src/client/context/useProvidedGateway.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,kBAAe,iMAA0E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client/components/connected/account/Connected.tsx","../../../src/client/components/connected/ConnectAccountsStack.tsx","../../../src/client/components/connected/hooks/useConnectAccount.ts","../../../src/client/hooks/client/helpers/findCaveat.ts","../../../src/client/hooks/client/useClientFromWallet.ts","../../../src/client/hooks/helpers/getXyoClient.ts","../../../src/client/hooks/client/permissions/usePermissions.ts","../../../src/client/hooks/client/permissions/usePermissionsAccounts.ts","../../../src/client/hooks/client/useGatewayFromWallet.ts","../../../src/client/context/GatewayContext.ts","../../../src/client/context/in-page/InPageGatewaysContext.ts","../../../src/client/context/in-page/Provider.tsx","../../../src/client/context/in-page/lib/buildGateway.ts","../../../src/client/context/in-page/useProvidedInPageGateways.ts","../../../src/client/context/providers/GatewayProvider.tsx","../../../src/client/context/providers/WalletGatewayProvider.tsx","../../../src/client/context/useProvidedGateway.ts"],"sourcesContent":["import {\n Stack, Tooltip, Typography,\n} from '@mui/material'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport { BlockiesAvatarAddress } from '@xyo-network/xl1-blockies'\nimport React from 'react'\n\nexport const ConnectedAccount: React.FC<{ address: string }> = ({ address }) => {\n const shortenedAddress = `${EthAddressWrapper.fromString(address)?.toShortString(4)}`\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" spacing={1}>\n <BlockiesAvatarAddress address={address} size={21} />\n <Tooltip title={address}>\n <Typography color=\"textSecondary\" variant=\"caption\" fontFamily=\"monospace\">{shortenedAddress}</Typography>\n </Tooltip>\n </Stack>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Button, Stack,\n Typography,\n} from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { Address } from '@xylabs/sdk-js'\nimport { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport type { ComponentType, MouseEventHandler } from 'react'\nimport React, { useEffect } from 'react'\n\nimport { ConnectedAccount } from './account/index.ts'\nimport { useConnectAccount } from './hooks/index.ts'\n\nconst DefaultConnectComponent: React.FC<ButtonExProps> = props => (\n <ButtonEx variant=\"contained\" size=\"small\" {...props} />\n)\n\nconst DefaultNoWalletInstalledComponent: React.FC = () => (\n <Alert severity=\"warning\">\n <AlertTitle>XL1 Wallet Not Found</AlertTitle>\n <Typography gutterBottom>\n Please ensure that your XL1 Wallet is installed to connect your account.\n </Typography>\n <Button\n sx={{ display: 'flex', justifySelf: 'end' }}\n size=\"small\"\n variant=\"outlined\"\n href=\"https://chromewebstore.google.com/detail/xl1-wallet/fblbagcjeigmhakkfgjpdlcapcgmcfbm\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n Get XL1 Wallet\n </Button>\n </Alert>\n)\n\nexport interface ConnectClientAccountsStackProps extends StackProps {\n AccountComponent?: ComponentType<{ account?: string }>\n ConnectComponent?: ComponentType<{ onClick?: MouseEventHandler<HTMLElement> }>\n NoWalletInstalledComponent?: ComponentType\n onAccountConnected?: (account: Address) => void\n onCancel?: () => void\n timeout?: number\n}\n\n/**\n * Renders a horizontal stack that surfaces the current state of the user's\n * connection to an XL1 wallet (e.g. the XL1 Chrome extension) and lets them\n * kick off a connection.\n *\n * Connection state is derived from `useConnectAccount`, which wraps\n * `useGatewayFromWallet` (wallet/gateway discovery with a configurable\n * `timeout`) and `useAccountPermissions` (already-authorized addresses).\n * The hook returns: `address` (resolved once the wallet exposes one),\n * `connectSigner` (prompts the wallet for an address), `timedout` (the\n * gateway never appeared within `timeout`), and `error` (the first of\n * gateway, permissions, or signer-connect failures).\n *\n * The component renders exactly one of the following wallet states, plus\n * an always-present error slot:\n *\n * - **Connected** — `address` is defined: renders `AccountComponent` for\n * that address. Also fires `onAccountConnected(address)` once via effect.\n * - **Disconnected, wallet available** — no `address` and not `timedout`:\n * renders `ConnectComponent` as a \"Connect\" button that invokes\n * `connectSigner()`. This covers both \"wallet installed but no account\n * authorized yet\" and \"gateway still resolving\".\n * - **Wallet missing / unreachable** — no `address` and `timedout` is true:\n * renders `NoWalletInstalledComponent` (defaults to an Alert linking to\n * the XL1 Wallet Chrome Web Store listing).\n * - **Error** — any error from the hook is rendered via `ErrorRender`\n * alongside the state above, and `onCancel()` is fired once via effect\n * so the host UI can close/abort its connect flow.\n *\n * All three slot components (`AccountComponent`, `ConnectComponent`,\n * `NoWalletInstalledComponent`) are injectable so consumers can restyle\n * any state without forking this component.\n */\nexport const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps> = ({\n AccountComponent = ConnectedAccount,\n ConnectComponent = DefaultConnectComponent,\n NoWalletInstalledComponent = DefaultNoWalletInstalledComponent,\n onAccountConnected,\n onCancel,\n timeout,\n ...props\n}) => {\n const {\n address, connectSigner, error, timedout,\n } = useConnectAccount(undefined, timeout)\n\n useEffect(() => {\n if (isDefined(error) && isDefined(onCancel)) {\n onCancel()\n }\n }, [error, onCancel])\n\n useEffect(() => {\n if (isDefined(address) && isDefined(onAccountConnected)) {\n onAccountConnected(address)\n }\n }, [address, onAccountConnected])\n\n return (\n <Stack direction=\"row\" alignItems=\"start\" spacing={2} {...props}>\n {isDefined(address)\n ? <AccountComponent address={address} />\n : null}\n {isUndefined(address) && !timedout\n ? (\n <ConnectComponent onClick={() => void connectSigner()}>Connect</ConnectComponent>\n )\n : null}\n {isUndefined(address) && timedout\n ? (\n <NoWalletInstalledComponent />\n )\n : null}\n <ErrorRender error={error} scope=\"ConnectSigner:error\" />\n </Stack>\n )\n}\n","import { type Address, asAddress } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\nimport { MainNetwork } from '@xyo-network/xl1-sdk'\nimport { useCallback, useState } from 'react'\n\nimport { useAccountPermissions, useGatewayFromWallet } from '../../../hooks/index.ts'\n\nexport const useConnectAccount = (gatewayName: GatewayName = MainNetwork.id, timeout?: number) => {\n const [connectError, setConnectError] = useState<Error>()\n\n const {\n gateway, error, timedout,\n } = useGatewayFromWallet(gatewayName, timeout)\n\n const [accountPermissions, accountPermissionsError] = useAccountPermissions()\n\n const [address, setAddress] = useState<Address>()\n\n const connectSigner = useCallback(async () => {\n try {\n setConnectError(undefined)\n const assertedGateway = assertEx(gateway, () => `Gateway ${gatewayName} is not available`)\n const signer = assertedGateway.signer\n const address = await signer.address()\n setAddress(address)\n return address\n } catch (e) {\n setConnectError(e as Error)\n }\n }, [gateway, gatewayName])\n\n return {\n address: asAddress(accountPermissions?.[0] ?? address), connectSigner, error: error ?? accountPermissionsError ?? connectError, gateway, timedout,\n }\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type {\n CaveatTypes, ParentCapability, XyoPermissions,\n} from '@xyo-network/xl1-sdk'\n\nexport const findCaveat = async (\n permissions: XyoPermissions,\n targetCapability: ParentCapability,\n targetCaveatType: CaveatTypes,\n) => {\n const existingPermissions = await permissions.getPermissions()\n if (isDefined(existingPermissions) && existingPermissions.length > 0) {\n const foundPermissions = existingPermissions\n .find(p => p.parentCapability === targetCapability)\n if (isDefined(foundPermissions)) {\n return foundPermissions.caveats?.find(caveat => caveat.type === targetCaveatType)?.value ?? []\n }\n }\n return existingPermissions\n}\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\nimport { useEffect, useState } from 'react'\n\nimport { getXyoClient } from '../helpers/index.ts'\n\ninterface ClientState {\n client?: XyoClient | null\n error: Error | null\n isLoading: boolean\n timedout: boolean\n}\n\nconst initialState: ClientState = {\n client: undefined,\n error: null,\n isLoading: false,\n timedout: false,\n}\n\nexport const useClientFromWallet = (timeout?: number): ClientState => {\n const [state, setState] = useState<ClientState>(initialState)\n\n useEffect(() => {\n let cancelled = false\n\n const initialize = async () => {\n setState((prev) => {\n if (prev.isLoading) return prev\n return {\n ...prev, isLoading: true, error: null,\n }\n })\n\n try {\n const client = await getXyoClient(timeout)\n if (cancelled) return\n if (client === null) {\n setState({\n client: null, timedout: true, isLoading: false, error: null,\n })\n } else {\n setState({\n client, isLoading: false, error: null, timedout: false,\n })\n }\n } catch (error) {\n if (cancelled) return\n setState({\n client: undefined, isLoading: false, error: error as Error, timedout: false,\n })\n }\n }\n\n void initialize()\n\n // Late recovery: if wallet loads after timeout, update state\n const onPluginReady = () => {\n if (cancelled) return\n const client = isUndefined(globalThis.xyo) ? null : globalThis.xyo?.client ?? null\n setState({\n client, isLoading: false, timedout: false, error: null,\n })\n }\n globalThis.addEventListener('xyo:plugin-ready', onPluginReady)\n\n return () => {\n cancelled = true\n globalThis.removeEventListener('xyo:plugin-ready', onPluginReady)\n }\n }, [timeout])\n\n return state\n}\n\n/** @deprecated - use useClientFromWallet instead */\nexport const useClient = useClientFromWallet\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\n\nconst CLIENT_LISTENER_TIMEOUT = 2000\n\nconst hasXyoClient = () => {\n return 'client' in globalThis.xyo\n}\n\nexport const listenForClientInjection = (onClientReady: () => void, timeout: number, onTimeout: () => void) => {\n let resolved = false\n const listener: EventListener = () => {\n onClientReady()\n resolved = true\n }\n globalThis.addEventListener('xyo:plugin-ready', listener)\n setTimeout(() => {\n if (!resolved) {\n globalThis.removeEventListener('xyo:plugin-ready', listener)\n onTimeout()\n }\n }, timeout)\n}\n\ntype ReturnType = XyoClient | undefined | null\n\nexport async function getXyoClient(timeout = CLIENT_LISTENER_TIMEOUT): Promise<ReturnType> {\n // if no xyo object, we can bail early\n if (isUndefined(globalThis.xyo)) {\n return null\n }\n return hasXyoClient()\n ? globalThis.xyo.client\n // listen for the XyoWallet to be injected\n : await new Promise<ReturnType>((resolve) => {\n listenForClientInjection(\n () => {\n resolve(globalThis.xyo.client)\n },\n timeout,\n () => {\n resolve(null)\n },\n )\n })\n}\n","import { useClientFromWallet } from '../useClientFromWallet.ts'\n\nexport const usePermissions = () => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet()\n const permissions = client?.permissions\n return {\n permissions,\n isLoading,\n error,\n timedout,\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { JsonValue } from '@xylabs/sdk-js'\nimport {\n isArray, isDefined, isDefinedNotNull, isString,\n} from '@xylabs/sdk-js'\n\nimport { findCaveat } from '../helpers/index.ts'\nimport { usePermissions } from './usePermissions.ts'\n\nconst validateRestrictedAccounts = (restrictedAccounts: JsonValue): readonly string [] => {\n if (isDefined(restrictedAccounts)) {\n if (isArray(restrictedAccounts) && restrictedAccounts.every(isString)) {\n return restrictedAccounts\n }\n throw new Error(\n `Unrecognized format for restrictReturnedAccounts caveat found on permissions. \\n\n Should be an array of strings: ${JSON.stringify(restrictedAccounts)}`,\n )\n }\n return []\n}\n\nexport const useAccountPermissions = () => {\n const { permissions, error } = usePermissions()\n\n return usePromise(async () => {\n if (isDefinedNotNull(error)) throw error\n if (isDefined(permissions)) {\n const restrictedAccounts = await findCaveat(\n permissions,\n // TODO - extract to constant in protocol package\n 'xyoWallet_getAccounts',\n 'restrictReturnedAccounts',\n )\n return validateRestrictedAccounts(restrictedAccounts)\n }\n }, [permissions])\n}\n","import { isNull } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\n\nimport type { GatewayFromWallet } from '../../types/index.ts'\nimport { useClientFromWallet } from './useClientFromWallet.ts'\n\n/**\n * Resolves a gateway from the injected XL1 Wallet extension.\n *\n * The returned `gateway` uses a three-state contract:\n * - `undefined` — wallet detection is still in progress (isLoading=true),\n * or no gatewayName was provided. Consumers should treat this as \"not yet known\"\n * and avoid committing to either a present or absent UI state.\n * - `null` — wallet is definitively absent. Either globalThis.xyo was never set,\n * or detection timed out. Safe to show fallback UI (e.g. \"Get XL1 Wallet\").\n * A late-recovery listener may still transition this to a real gateway if\n * the extension loads after the timeout.\n * - `XyoGatewayRunner` — wallet is present and exposes this gateway for the\n * requested network. Ready to use for transactions and queries.\n */\nexport const useGatewayFromWallet = (gatewayName?: GatewayName, timeout?: number): GatewayFromWallet => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet(timeout)\n\n const resolveGateway = () => {\n // null client = wallet confirmed absent (no globalThis.xyo or timed out)\n if (isNull(client)) return null\n // client is undefined (still loading) or defined (wallet present) —\n // optional chain returns undefined while loading, or the gateway if available\n return client?.gateways?.[gatewayName!]\n }\n\n return {\n // no gatewayName requested = undefined (opt-out, not \"absent\")\n gateway: gatewayName ? resolveGateway() : undefined,\n isLoading,\n error,\n timedout,\n }\n}\n\n/** @deprecated - useGatewayFromWallet */\nexport const useGateway = useGatewayFromWallet\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { GatewayContextState } from './GatewayProviderState.ts'\n\n/**\n * Shared React context that decouples gateway *sources* from gateway\n * *consumers*. Any provider that can resolve an `XyoGateway` publishes to\n * this context; any hook or component that needs a gateway reads from it\n * via `useProvidedGateway`. Consumers never import a specific provider —\n * they just require that *some* provider is mounted above them in the\n * tree.\n *\n * Current publishers:\n * - `WalletGatewayProvider` (this package) — sources gateways from the\n * injected XL1 wallet extension.\n * - `GatewayProvider` in `@xyo-network/react-chain-provider` — sources\n * gateways built in-page against RPC endpoints, falling back to the\n * wallet when available.\n *\n * To add a new source (e.g. a mock provider for tests, an iframe-bridged\n * provider, a server-rendered provider), publish a `GatewayContextState`\n * to this same context — do not create a parallel context, or consumers\n * will silently stop receiving updates.\n */\nexport const GatewayContext = createContextEx<GatewayContextState>()\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\n\n/**\n * Narrow, provider-internal context that `InPageGatewaysProvider` writes\n * to and `GatewayProvider` reads from. Do not consume this in application\n * code — use `useProvidedGateway` (which reads the shared\n * `GatewayContext`) instead. This context only exists to decouple the\n * single in-page *builder* from the many single-gateway *adapters* that\n * sit between it and the shared gateway surface.\n */\nexport const InPageGatewaysContext = createContextEx<InPageGatewaysState>()\n","import type {\n GatewayName, RpcTransport, XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport { DefaultNetworks } from '@xyo-network/xl1-sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n startTransition,\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport type { ContextGatewayType } from '../../types/index.ts'\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\nimport { buildGateway } from './lib/index.ts'\n\nexport interface InPageGatewaysProviderProps extends PropsWithChildren {\n signerTransport?: RpcTransport<XyoSignerRpcSchemas>\n}\n\n/**\n * Publishes a keyed map of in-page gateways — one per network in\n * `DefaultNetworks` — under the narrow `InPageGatewaysContext`.\n *\n * This provider is deliberately *not* a direct publisher of the shared\n * `GatewayContext` that `useProvidedGateway` reads. Its consumer is the\n * wrapping `GatewayProvider` in this same package, which picks the\n * `gatewayName` the consumer asked for out of this map, adapts it into\n * the single-gateway `GatewayContextState` shape, and then publishes *that*\n * to the shared context. Splitting the work this way lets one\n * `InPageGatewaysProvider` near the root build every network's gateway\n * once, while many `GatewayProvider` instances deeper in the tree each\n * expose whichever gateway their subtree cares about.\n *\n * Unlike `WalletGatewayProvider`, gateways here are constructed directly\n * in the page (via `buildGateway`) against each network's RPC endpoint\n * — no browser wallet extension is required. `signerTransport` switches\n * between viewer (read-only) and runner (can sign/send) locators; supply\n * it only when the app needs to sign.\n *\n * Behavior:\n * - On mount, and whenever `signerTransport` changes, `buildGateway` is\n * called in parallel for every network in `DefaultNetworks` via\n * `Promise.allSettled`. Networks that resolve populate `gateways[id]`;\n * networks that reject populate `errors[id]`. One failed network does\n * not block the others.\n * - If `signerTransport` is provided, gateways are built with a remote\n * *runner* locator, otherwise with a remote *viewer* locator.\n * - When `signerTransport` changes identity mid-life, the provider clears\n * all cached gateways and errors synchronously during render (via\n * `previousSignerTransport` state) so consumers never see gateways\n * bound to the previous transport, then rebuilds in the effect.\n * - State updates from the rebuild are wrapped in `startTransition` so a\n * slow network doesn't stall higher-priority UI updates.\n * - A `cancelled` flag in the effect's cleanup discards results from a\n * prior `signerTransport` once a new one is in flight.\n *\n * Published `InPageGatewaysState` (narrower than `GatewayContextState` —\n * this is an internal handoff shape, not the cross-publisher surface):\n * - `gateways` — `Partial<Record<GatewayName, ContextGatewayType>>`. Keys\n * are only present for networks that built successfully.\n * - `errors` — `Partial<Record<GatewayName, Error>>`. Per-network build\n * failures, keyed by `GatewayName`.\n * - `clearAll()` — manually empties both maps. Also invoked internally on\n * transport changes. Forwarded by `GatewayProvider` to consumers as\n * `resetGatewaysFromConfig`.\n * - `provided: true` — lets descendants detect a real provider.\n *\n * Note: the commented-out `SimpleXyoClient` at the top is intentionally\n * disabled pending a type unification between `XyoGateway` and\n * `XyoGatewayRunner`.\n */\nexport const InPageGatewaysProvider: React.FC<InPageGatewaysProviderProps> = ({ signerTransport, children }) => {\n const [gateways, setGateways] = useState<Partial<Record<GatewayName, ContextGatewayType>>>({})\n const [errors, setErrors] = useState<Partial<Record<GatewayName, Error>>>({})\n const [previousSignerTransport, setPreviousSignerTransport] = useState<RpcTransport<XyoSignerRpcSchemas> | undefined>(signerTransport)\n\n // This can come back once we homogenize the type for XyoGateway.\n // Right now, SimpleXyoClient takes XyoGatewayRunners but ideally it would take XyoGateway.\n // const clientInPage = useMemo(() => new SimpleXyoClient(gateways, {}), [gateways])\n\n const clearAll = useCallback(() => {\n setGateways({})\n setErrors({})\n }, [])\n\n if (previousSignerTransport !== signerTransport) {\n clearAll()\n setPreviousSignerTransport(signerTransport)\n }\n\n useEffect(() => {\n let cancelled = false\n\n const buildAll = async () => {\n const results = await Promise.allSettled(\n DefaultNetworks.map(async (network) => {\n const gateway = await buildGateway(network.id, signerTransport)\n return { id: network.id, gateway }\n }),\n )\n\n if (cancelled) return\n\n const nextGateways: Partial<Record<GatewayName, ContextGatewayType>> = {}\n const nextErrors: Partial<Record<GatewayName, Error>> = {}\n\n for (const [index, result] of results.entries()) {\n const networkId = DefaultNetworks[index].id as GatewayName\n if (result.status === 'fulfilled') {\n nextGateways[networkId] = result.value.gateway\n } else {\n nextErrors[networkId] = result.reason instanceof Error ? result.reason : new Error(String(result.reason))\n }\n }\n\n startTransition(() => {\n setGateways(nextGateways)\n setErrors(nextErrors)\n })\n }\n\n void buildAll()\n return () => {\n cancelled = true\n }\n }, [signerTransport])\n\n const value = useMemo(() => {\n const value: InPageGatewaysState = {\n clearAll,\n errors,\n gateways,\n provided: true,\n }\n return value\n }, [clearAll, errors, gateways])\n\n return <InPageGatewaysContext value={value}>{children}</InPageGatewaysContext>\n}\n","import { assertEx, isDefined } from '@xylabs/sdk-js'\nimport type {\n GatewayName,\n RemoteConfig, RpcTransport, SimpleXyoGateway,\n XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport {\n basicRemoteRunnerLocator,\n basicRemoteViewerLocator,\n DefaultNetworks, NetworkDataLakeUrls, XyoGatewayMoniker,\n} from '@xyo-network/xl1-sdk'\n\nexport const buildGateway = async (gatewayName: GatewayName, signerTransport?: RpcTransport<XyoSignerRpcSchemas>) => {\n const network = DefaultNetworks.find(network => network.id === gatewayName)\n const resolvedNetwork = assertEx(network, () => `No network found for id ${gatewayName}`)\n\n const remoteConfig: RemoteConfig = {\n rpc: {\n protocol: 'http',\n url: `${resolvedNetwork.url}/rpc`,\n },\n }\n\n const dataLakeEndpoint = NetworkDataLakeUrls[gatewayName]\n\n const locator = isDefined(signerTransport)\n ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport, dataLakeEndpoint)\n : await basicRemoteViewerLocator(gatewayName, remoteConfig, dataLakeEndpoint)\n\n return await locator.getInstance<SimpleXyoGateway>(XyoGatewayMoniker)\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\n\n/**\n * Reads the `InPageGatewaysContext` map of per-network in-page gateways.\n * Intended for internal use by `GatewayProvider` — application code\n * should prefer `useProvidedGateway`, which returns a single resolved\n * gateway regardless of source.\n *\n * @param required - When `true` (default), throws if no\n * `InPageGatewaysProvider` is mounted above.\n */\nexport const useProvidedInPageGateways = (required = true) => useContextEx(InPageGatewaysContext, 'InPageGateways', required)\n","import { ErrorRender } from '@xylabs/react-error'\nimport { isDefinedNotNull, isNull } from '@xylabs/sdk-js'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\nimport { useProvidedInPageGateways } from '../in-page/index.ts'\n\n/**\n * Publishes the shared `GatewayContext` backed by two sources: the\n * injected XL1 Wallet extension *and* the in-page gateways built by\n * `InPageGatewaysProvider`. Use this provider when the host app can\n * function without a wallet (falling back to the in-page client) but\n * should still prefer the wallet when it is present.\n *\n * Required ancestry: an `InPageGatewaysProvider` must be mounted above\n * this provider — `useProvidedInPageGateways(true)` throws if missing.\n * If you only need a wallet-backed gateway, use `WalletGatewayProvider`\n * instead.\n *\n * Source precedence for `defaultGateway`:\n * - Wallet present and resolved (`XyoGatewayRunner`) → wallet wins; the\n * in-page gateway is still exposed via `gateways.inPageGateway` for\n * the rare consumer that needs to target it specifically.\n * - Wallet definitively absent (`null`) → fall back to the in-page\n * gateway matching `gatewayName`.\n * - Wallet still resolving (`undefined`) → leave `defaultGateway`\n * `undefined` so consumers render a loading state rather than\n * committing to the in-page fallback prematurely.\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — resolved per the precedence above. Three-state:\n * `undefined` = loading, `null` is not produced by this provider\n * (wallet-null collapses to `gatewayFromConfig`), `XyoGateway` = ready.\n * - `gateways.walletGateway` — raw wallet result (tri-state).\n * - `gateways.inPageGateway` — raw in-page result for the requested\n * `gatewayName`, or `undefined` if no `gatewayName` was passed.\n * - `error` — first non-null of wallet error, then in-page build error\n * for this `gatewayName`. Also rendered inline via `ErrorRender` above\n * `children` so mount-time failures surface even when no consumer\n * reads `error`.\n * - `resetGatewaysFromConfig` — forwards `clearAll` from\n * `InPageGatewaysProvider`, letting consumers force a rebuild of the\n * in-page gateways (e.g. after a network or endpoint change).\n * - `provided: true` — lets descendants detect a real provider in the\n * tree.\n *\n * `defaultGateway`, `gateways`, and the context `value` are memoized so\n * consumers only re-render when wallet or in-page sources actually\n * change identity.\n */\nexport const GatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const {\n gateways: allGateways,\n errors: allGatewayErrors,\n clearAll,\n } = useProvidedInPageGateways(true)\n\n const gatewayFromConfig = gatewayName ? allGateways[gatewayName] : undefined\n const gatewayFromConfigError = gatewayName ? allGatewayErrors[gatewayName] : undefined\n\n const { defaultGateway, gateways } = useMemo(() => {\n if (isNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromConfig,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: null,\n },\n }\n } else if (isDefinedNotNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: gatewayFromWallet,\n },\n }\n }\n return {\n defaultGateway: undefined,\n gateways: {\n inPageGateway: undefined,\n walletGateway: undefined,\n },\n }\n }, [gatewayFromConfig, gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError ?? gatewayFromConfigError,\n gateways,\n provided: true,\n resetGatewaysFromConfig: clearAll,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gatewayFromConfigError,\n gateways,\n clearAll,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromConfigError} />\n {children}\n </GatewayContext>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\n\n/**\n * Publishes a `GatewayContext` backed exclusively by the injected XL1 Wallet\n * extension (i.e. `globalThis.xyo`). This is the provider to use when the\n * host app is a browser UI that expects the user to bring their own wallet,\n * rather than running an in-page gateway.\n *\n * The requested `gatewayName` is forwarded to `useGatewayFromWallet`, whose\n * returned gateway uses a three-state contract (`undefined` = still\n * resolving, `null` = wallet confirmed absent / timed out,\n * `XyoGatewayRunner` = ready). That tri-state is passed through to\n * consumers unchanged as `defaultGateway` / `gateways.walletGateway`, so\n * downstream hooks can distinguish \"loading\" from \"missing\".\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — the wallet gateway, used when consumers don't\n * specify which gateway they want.\n * - `gateways.walletGateway` — same instance as `defaultGateway`.\n * - `gateways.inPageGateway` — always `null` here; this provider does not\n * stand up an in-page client. Pair with a different provider if you need\n * both.\n * - `error` — surfaced from `useGatewayFromWallet` (detection / timeout /\n * wallet errors). Also rendered inline via `ErrorRender` above `children`\n * so mount-time failures are visible even if no consumer reads `error`.\n * - `provided: true` — lets descendants detect that a real provider (not\n * the default empty context) is in the tree.\n *\n * The `defaultGateway`, `gateways`, and context `value` are memoized so\n * consumers only re-render when the underlying wallet gateway reference or\n * error actually changes.\n */\nexport const WalletGatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const { defaultGateway, gateways } = useMemo(() => {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: null,\n walletGateway: gatewayFromWallet,\n },\n }\n }, [gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError,\n gateways,\n provided: true,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gateways,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromWalletError} />\n {children}\n </GatewayContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { GatewayContext } from './GatewayContext.ts'\n\n/**\n * The sole consumer entry point for gateway state. Reads the nearest\n * `GatewayContext` in the tree, regardless of which provider published\n * it — this is the decoupling that lets a component work unchanged when\n * the surrounding app swaps `WalletGatewayProvider` for\n * `GatewayProvider` (or a test double).\n *\n * @param required - When `true` (default), throws if no gateway provider\n * is mounted above — use this when the component is meaningless\n * without a gateway. When `false`, returns default state (all fields\n * undefined) so the component can render a graceful fallback.\n */\nexport const useProvidedGateway = (required = true) => useContextEx(GatewayContext, 'Gateway', required)\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAO;AAAA,EAAS;AAAA,OACX;AACP,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AAOlC,SACE,KADF;AAJG,IAAM,mBAAkD,CAAC,EAAE,QAAQ,MAAM;AAC9E,QAAM,mBAAmB,GAAG,kBAAkB,WAAW,OAAO,GAAG,cAAc,CAAC,CAAC;AAEnF,SACE,qBAAC,SAAM,WAAU,OAAM,YAAW,UAAS,SAAS,GAClD;AAAA,wBAAC,yBAAsB,SAAkB,MAAM,IAAI;AAAA,IACnD,oBAAC,WAAQ,OAAO,SACd,8BAAC,cAAW,OAAM,iBAAgB,SAAQ,WAAU,YAAW,aAAa,4BAAiB,GAC/F;AAAA,KACF;AAEJ;;;ACjBA;AAAA,EACE;AAAA,EAAO;AAAA,EAAY;AAAA,EAAQ,SAAAA;AAAA,EAC3B,cAAAC;AAAA,OACK;AAEP,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAE5B,SAAS,aAAAC,YAAW,eAAAC,oBAAmB;AAEvC,SAAgB,aAAAC,kBAAiB;;;ACXjC,SAAuB,iBAAiB;AACxC,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB;AAC5B,SAAS,aAAa,YAAAC,iBAAgB;;;ACJtC,SAAS,iBAAiB;AAKnB,IAAM,aAAa,OACxB,aACA,kBACA,qBACG;AACH,QAAM,sBAAsB,MAAM,YAAY,eAAe;AAC7D,MAAI,UAAU,mBAAmB,KAAK,oBAAoB,SAAS,GAAG;AACpE,UAAM,mBAAmB,oBACtB,KAAK,OAAK,EAAE,qBAAqB,gBAAgB;AACpD,QAAI,UAAU,gBAAgB,GAAG;AAC/B,aA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CAAC,iBAAiB,CAAC;AAEtB,QAAM,QAAQA,SAAQ,MAAM;AAC1B,UAAMC,SAA6B;AAAA,MACjC;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,UAAU;AAAA,IACZ;AACA,WAAOA;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE,gBAAAF,MAAC,kBAAe,OACd;AAAA,oBAAAD,KAACI,cAAA,EAAY,OAAO,wBAAwB;AAAA,IAC3C;AAAA,KACH;AAEJ;;;AC1EA,SAAS,gBAAAC,qBAAoB;AAgBtB,IAAM,qBAAqB,CAAC,WAAW,SAASC,cAAa,gBAAgB,WAAW,QAAQ;","names":["Stack","Typography","isDefined","isUndefined","useEffect","useState","isUndefined","isUndefined","isDefined","isDefined","useState","address","jsx","jsxs","Typography","useEffect","isDefined","Stack","isUndefined","createContextEx","DefaultNetworks","useCallback","useEffect","useState","assertEx","isDefined","network","jsx","useState","useCallback","useEffect","DefaultNetworks","value","ErrorRender","isDefinedNotNull","isNull","useMemo","jsx","jsxs","useMemo","isNull","isDefinedNotNull","value","ErrorRender","ErrorRender","useMemo","jsx","jsxs","useMemo","value","ErrorRender","useContextEx","useContextEx"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/client/components/connected/account/Connected.tsx","../../../src/client/components/connected/ConnectAccountsStack.tsx","../../../src/client/components/connected/hooks/useConnectAccount.ts","../../../src/client/hooks/client/helpers/findCaveat.ts","../../../src/client/hooks/client/useClientFromWallet.ts","../../../src/client/hooks/helpers/getXyoClient.ts","../../../src/client/hooks/client/permissions/usePermissions.ts","../../../src/client/hooks/client/permissions/usePermissionsAccounts.ts","../../../src/client/hooks/client/useGatewayFromWallet.ts","../../../src/client/context/GatewayContext.ts","../../../src/client/context/in-page/InPageGatewaysContext.ts","../../../src/client/context/in-page/Provider.tsx","../../../src/client/context/in-page/lib/buildGateway.ts","../../../src/client/context/in-page/useProvidedInPageGateways.ts","../../../src/client/context/providers/GatewayProvider.tsx","../../../src/client/context/providers/WalletGatewayProvider.tsx","../../../src/client/context/useProvidedGateway.ts"],"sourcesContent":["import {\n Stack, Tooltip, Typography,\n} from '@mui/material'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport { BlockiesAvatarAddress } from '@xyo-network/xl1-blockies'\nimport React from 'react'\n\nexport const ConnectedAccount: React.FC<{ address: string }> = ({ address }) => {\n const shortenedAddress = `${EthAddressWrapper.fromString(address)?.toShortString(4)}`\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" spacing={1}>\n <BlockiesAvatarAddress address={address} size={21} />\n <Tooltip title={address}>\n <Typography color=\"textSecondary\" variant=\"caption\" fontFamily=\"monospace\">{shortenedAddress}</Typography>\n </Tooltip>\n </Stack>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Button, Stack,\n Typography,\n} from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { Address } from '@xylabs/sdk-js'\nimport { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport type { ComponentType, MouseEventHandler } from 'react'\nimport React, { useEffect } from 'react'\n\nimport { ConnectedAccount } from './account/index.ts'\nimport { useConnectAccount } from './hooks/index.ts'\n\nconst DefaultConnectComponent: React.FC<ButtonExProps> = props => (\n <ButtonEx variant=\"contained\" size=\"small\" {...props} />\n)\n\nconst DefaultNoWalletInstalledComponent: React.FC = () => (\n <Alert severity=\"warning\">\n <AlertTitle>XL1 Wallet Not Found</AlertTitle>\n <Typography gutterBottom>\n Please ensure that your XL1 Wallet is installed to connect your account.\n </Typography>\n <Button\n sx={{ display: 'flex', justifySelf: 'end' }}\n size=\"small\"\n variant=\"outlined\"\n href=\"https://chromewebstore.google.com/detail/xl1-wallet/fblbagcjeigmhakkfgjpdlcapcgmcfbm\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n Get XL1 Wallet\n </Button>\n </Alert>\n)\n\nexport interface ConnectClientAccountsStackProps extends StackProps {\n AccountComponent?: ComponentType<{ account?: string }>\n ConnectComponent?: ComponentType<{ onClick?: MouseEventHandler<HTMLElement> }>\n NoWalletInstalledComponent?: ComponentType\n onAccountConnected?: (account: Address) => void\n onCancel?: () => void\n timeout?: number\n}\n\n/**\n * Renders a horizontal stack that surfaces the current state of the user's\n * connection to an XL1 wallet (e.g. the XL1 Chrome extension) and lets them\n * kick off a connection.\n *\n * Connection state is derived from `useConnectAccount`, which wraps\n * `useGatewayFromWallet` (wallet/gateway discovery with a configurable\n * `timeout`) and `useAccountPermissions` (already-authorized addresses).\n * The hook returns: `address` (resolved once the wallet exposes one),\n * `connectSigner` (prompts the wallet for an address), `timedout` (the\n * gateway never appeared within `timeout`), and `error` (the first of\n * gateway, permissions, or signer-connect failures).\n *\n * The component renders exactly one of the following wallet states, plus\n * an always-present error slot:\n *\n * - **Connected** — `address` is defined: renders `AccountComponent` for\n * that address. Also fires `onAccountConnected(address)` once via effect.\n * - **Disconnected, wallet available** — no `address` and not `timedout`:\n * renders `ConnectComponent` as a \"Connect\" button that invokes\n * `connectSigner()`. This covers both \"wallet installed but no account\n * authorized yet\" and \"gateway still resolving\".\n * - **Wallet missing / unreachable** — no `address` and `timedout` is true:\n * renders `NoWalletInstalledComponent` (defaults to an Alert linking to\n * the XL1 Wallet Chrome Web Store listing).\n * - **Error** — any error from the hook is rendered via `ErrorRender`\n * alongside the state above, and `onCancel()` is fired once via effect\n * so the host UI can close/abort its connect flow.\n *\n * All three slot components (`AccountComponent`, `ConnectComponent`,\n * `NoWalletInstalledComponent`) are injectable so consumers can restyle\n * any state without forking this component.\n */\nexport const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps> = ({\n AccountComponent = ConnectedAccount,\n ConnectComponent = DefaultConnectComponent,\n NoWalletInstalledComponent = DefaultNoWalletInstalledComponent,\n onAccountConnected,\n onCancel,\n timeout,\n ...props\n}) => {\n const {\n address, connectSigner, error, timedout,\n } = useConnectAccount(undefined, timeout)\n\n useEffect(() => {\n if (isDefined(error) && isDefined(onCancel)) {\n onCancel()\n }\n }, [error, onCancel])\n\n useEffect(() => {\n if (isDefined(address) && isDefined(onAccountConnected)) {\n onAccountConnected(address)\n }\n }, [address, onAccountConnected])\n\n return (\n <Stack direction=\"row\" alignItems=\"start\" spacing={2} {...props}>\n {isDefined(address)\n ? <AccountComponent address={address} />\n : null}\n {isUndefined(address) && !timedout\n ? (\n <ConnectComponent onClick={() => void connectSigner()}>Connect</ConnectComponent>\n )\n : null}\n {isUndefined(address) && timedout\n ? (\n <NoWalletInstalledComponent />\n )\n : null}\n <ErrorRender error={error} scope=\"ConnectSigner:error\" />\n </Stack>\n )\n}\n","import { type Address, asAddress } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\nimport { MainNetwork } from '@xyo-network/xl1-sdk'\nimport { useCallback, useState } from 'react'\n\nimport { useAccountPermissions, useGatewayFromWallet } from '../../../hooks/index.ts'\n\nexport const useConnectAccount = (gatewayName: GatewayName = MainNetwork.id, timeout?: number) => {\n const [connectError, setConnectError] = useState<Error>()\n\n const {\n gateway, error, timedout,\n } = useGatewayFromWallet(gatewayName, timeout)\n\n const [accountPermissions, accountPermissionsError] = useAccountPermissions()\n\n const [address, setAddress] = useState<Address>()\n\n const connectSigner = useCallback(async () => {\n try {\n setConnectError(undefined)\n const assertedGateway = assertEx(gateway, () => `Gateway ${gatewayName} is not available`)\n const signer = assertedGateway.signer\n const address = await signer.address()\n setAddress(address)\n return address\n } catch (e) {\n setConnectError(e as Error)\n }\n }, [gateway, gatewayName])\n\n return {\n address: asAddress(accountPermissions?.[0] ?? address), connectSigner, error: error ?? accountPermissionsError ?? connectError, gateway, timedout,\n }\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type {\n CaveatTypes, ParentCapability, XyoPermissions,\n} from '@xyo-network/xl1-sdk'\n\nexport const findCaveat = async (\n permissions: XyoPermissions,\n targetCapability: ParentCapability,\n targetCaveatType: CaveatTypes,\n) => {\n const existingPermissions = await permissions.getPermissions()\n if (isDefined(existingPermissions) && existingPermissions.length > 0) {\n const foundPermissions = existingPermissions\n .find(p => p.parentCapability === targetCapability)\n if (isDefined(foundPermissions)) {\n return foundPermissions.caveats?.find(caveat => caveat.type === targetCaveatType)?.value ?? []\n }\n }\n return existingPermissions\n}\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\nimport { useEffect, useState } from 'react'\n\nimport { getXyoClient } from '../helpers/index.ts'\n\ninterface ClientState {\n client?: XyoClient | null\n error: Error | null\n isLoading: boolean\n timedout: boolean\n}\n\nconst initialState: ClientState = {\n client: undefined,\n error: null,\n isLoading: false,\n timedout: false,\n}\n\nexport const useClientFromWallet = (timeout?: number): ClientState => {\n const [state, setState] = useState<ClientState>(initialState)\n\n useEffect(() => {\n let cancelled = false\n\n const initialize = async () => {\n setState((prev) => {\n if (prev.isLoading) return prev\n return {\n ...prev, isLoading: true, error: null,\n }\n })\n\n try {\n const client = await getXyoClient(timeout)\n if (cancelled) return\n if (client === null) {\n setState({\n client: null, timedout: true, isLoading: false, error: null,\n })\n } else {\n setState({\n client, isLoading: false, error: null, timedout: false,\n })\n }\n } catch (error) {\n if (cancelled) return\n setState({\n client: undefined, isLoading: false, error: error as Error, timedout: false,\n })\n }\n }\n\n void initialize()\n\n // Late recovery: if wallet loads after timeout, update state\n const onPluginReady = () => {\n if (cancelled) return\n const client = isUndefined(globalThis.xyo) ? null : globalThis.xyo?.client ?? null\n setState({\n client, isLoading: false, timedout: false, error: null,\n })\n }\n globalThis.addEventListener('xyo:plugin-ready', onPluginReady)\n\n return () => {\n cancelled = true\n globalThis.removeEventListener('xyo:plugin-ready', onPluginReady)\n }\n }, [timeout])\n\n return state\n}\n\n/** @deprecated - use useClientFromWallet instead */\nexport const useClient = useClientFromWallet\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\n\nconst CLIENT_LISTENER_TIMEOUT = 2000\n\nconst hasXyoClient = () => {\n return 'client' in globalThis.xyo\n}\n\nexport const listenForClientInjection = (onClientReady: () => void, timeout: number, onTimeout: () => void) => {\n let resolved = false\n const listener: EventListener = () => {\n onClientReady()\n resolved = true\n }\n globalThis.addEventListener('xyo:plugin-ready', listener)\n setTimeout(() => {\n if (!resolved) {\n globalThis.removeEventListener('xyo:plugin-ready', listener)\n onTimeout()\n }\n }, timeout)\n}\n\ntype ReturnType = XyoClient | undefined | null\n\nexport async function getXyoClient(timeout = CLIENT_LISTENER_TIMEOUT): Promise<ReturnType> {\n // if no xyo object, we can bail early\n if (isUndefined(globalThis.xyo)) {\n return null\n }\n return hasXyoClient()\n ? globalThis.xyo.client\n // listen for the XyoWallet to be injected\n : await new Promise<ReturnType>((resolve) => {\n listenForClientInjection(\n () => {\n resolve(globalThis.xyo.client)\n },\n timeout,\n () => {\n resolve(null)\n },\n )\n })\n}\n","import { useClientFromWallet } from '../useClientFromWallet.ts'\n\nexport const usePermissions = () => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet()\n const permissions = client?.permissions\n return {\n permissions,\n isLoading,\n error,\n timedout,\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { JsonValue } from '@xylabs/sdk-js'\nimport {\n isArray, isDefined, isDefinedNotNull, isString,\n} from '@xylabs/sdk-js'\n\nimport { findCaveat } from '../helpers/index.ts'\nimport { usePermissions } from './usePermissions.ts'\n\nconst validateRestrictedAccounts = (restrictedAccounts: JsonValue): readonly string [] => {\n if (isDefined(restrictedAccounts)) {\n if (isArray(restrictedAccounts) && restrictedAccounts.every(isString)) {\n return restrictedAccounts\n }\n throw new Error(\n `Unrecognized format for restrictReturnedAccounts caveat found on permissions. \\n\n Should be an array of strings: ${JSON.stringify(restrictedAccounts)}`,\n )\n }\n return []\n}\n\nexport const useAccountPermissions = () => {\n const { permissions, error } = usePermissions()\n\n return usePromise(async () => {\n if (isDefinedNotNull(error)) throw error\n if (isDefined(permissions)) {\n const restrictedAccounts = await findCaveat(\n permissions,\n // TODO - extract to constant in protocol package\n 'xyoWallet_getAccounts',\n 'restrictReturnedAccounts',\n )\n return validateRestrictedAccounts(restrictedAccounts)\n }\n }, [permissions])\n}\n","import { isNull } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\n\nimport type { GatewayFromWallet } from '../../types/index.ts'\nimport { useClientFromWallet } from './useClientFromWallet.ts'\n\n/**\n * Resolves a gateway from the injected XL1 Wallet extension.\n *\n * The returned `gateway` uses a three-state contract:\n * - `undefined` — wallet detection is still in progress (isLoading=true),\n * or no gatewayName was provided. Consumers should treat this as \"not yet known\"\n * and avoid committing to either a present or absent UI state.\n * - `null` — wallet is definitively absent. Either globalThis.xyo was never set,\n * or detection timed out. Safe to show fallback UI (e.g. \"Get XL1 Wallet\").\n * A late-recovery listener may still transition this to a real gateway if\n * the extension loads after the timeout.\n * - `XyoGatewayRunner` — wallet is present and exposes this gateway for the\n * requested network. Ready to use for transactions and queries.\n */\nexport const useGatewayFromWallet = (gatewayName?: GatewayName, timeout?: number): GatewayFromWallet => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet(timeout)\n\n const resolveGateway = () => {\n // null client = wallet confirmed absent (no globalThis.xyo or timed out)\n if (isNull(client)) return null\n // client is undefined (still loading) or defined (wallet present) —\n // optional chain returns undefined while loading, or the gateway if available\n return client?.gateways?.[gatewayName!]\n }\n\n return {\n // no gatewayName requested = undefined (opt-out, not \"absent\")\n gateway: gatewayName ? resolveGateway() : undefined,\n isLoading,\n error,\n timedout,\n }\n}\n\n/** @deprecated - useGatewayFromWallet */\nexport const useGateway = useGatewayFromWallet\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { GatewayStateFields } from './GatewayProviderState.ts'\n\n/**\n * Shared React context that decouples gateway *sources* from gateway\n * *consumers*. Any provider that can resolve an `XyoGateway` publishes to\n * this context; any hook or component that needs a gateway reads from it\n * via `useProvidedGateway`. Consumers never import a specific provider —\n * they just require that *some* provider is mounted above them in the\n * tree.\n *\n * Current publishers:\n * - `WalletGatewayProvider` (this package) — sources gateways from the\n * injected XL1 wallet extension.\n * - `GatewayProvider` in `@xyo-network/react-chain-provider` — sources\n * gateways built in-page against RPC endpoints, falling back to the\n * wallet when available.\n *\n * To add a new source (e.g. a mock provider for tests, an iframe-bridged\n * provider, a server-rendered provider), publish a `GatewayContextState`\n * to this same context — do not create a parallel context, or consumers\n * will silently stop receiving updates.\n */\nexport const GatewayContext = createContextEx<GatewayStateFields>()\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { InPageGatewaysStateFields } from './InPageGatewaysState.ts'\n\n/**\n * Narrow, provider-internal context that `InPageGatewaysProvider` writes\n * to and `GatewayProvider` reads from. Do not consume this in application\n * code — use `useProvidedGateway` (which reads the shared\n * `GatewayContext`) instead. This context only exists to decouple the\n * single in-page *builder* from the many single-gateway *adapters* that\n * sit between it and the shared gateway surface.\n */\nexport const InPageGatewaysContext = createContextEx<InPageGatewaysStateFields>()\n","import type {\n GatewayName, RpcTransport, XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport { DefaultNetworks } from '@xyo-network/xl1-sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n startTransition,\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport type { ContextGatewayType } from '../../types/index.ts'\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\nimport { buildGateway } from './lib/index.ts'\n\nexport interface InPageGatewaysProviderProps extends PropsWithChildren {\n signerTransport?: RpcTransport<XyoSignerRpcSchemas>\n}\n\n/**\n * Publishes a keyed map of in-page gateways — one per network in\n * `DefaultNetworks` — under the narrow `InPageGatewaysContext`.\n *\n * This provider is deliberately *not* a direct publisher of the shared\n * `GatewayContext` that `useProvidedGateway` reads. Its consumer is the\n * wrapping `GatewayProvider` in this same package, which picks the\n * `gatewayName` the consumer asked for out of this map, adapts it into\n * the single-gateway `GatewayContextState` shape, and then publishes *that*\n * to the shared context. Splitting the work this way lets one\n * `InPageGatewaysProvider` near the root build every network's gateway\n * once, while many `GatewayProvider` instances deeper in the tree each\n * expose whichever gateway their subtree cares about.\n *\n * Unlike `WalletGatewayProvider`, gateways here are constructed directly\n * in the page (via `buildGateway`) against each network's RPC endpoint\n * — no browser wallet extension is required. `signerTransport` switches\n * between viewer (read-only) and runner (can sign/send) locators; supply\n * it only when the app needs to sign.\n *\n * Behavior:\n * - On mount, and whenever `signerTransport` changes, `buildGateway` is\n * called in parallel for every network in `DefaultNetworks` via\n * `Promise.allSettled`. Networks that resolve populate `gateways[id]`;\n * networks that reject populate `errors[id]`. One failed network does\n * not block the others.\n * - If `signerTransport` is provided, gateways are built with a remote\n * *runner* locator, otherwise with a remote *viewer* locator.\n * - When `signerTransport` changes identity mid-life, the provider clears\n * all cached gateways and errors synchronously during render (via\n * `previousSignerTransport` state) so consumers never see gateways\n * bound to the previous transport, then rebuilds in the effect.\n * - State updates from the rebuild are wrapped in `startTransition` so a\n * slow network doesn't stall higher-priority UI updates.\n * - A `cancelled` flag in the effect's cleanup discards results from a\n * prior `signerTransport` once a new one is in flight.\n *\n * Published `InPageGatewaysState` (narrower than `GatewayContextState` —\n * this is an internal handoff shape, not the cross-publisher surface):\n * - `gateways` — `Partial<Record<GatewayName, ContextGatewayType>>`. Keys\n * are only present for networks that built successfully.\n * - `errors` — `Partial<Record<GatewayName, Error>>`. Per-network build\n * failures, keyed by `GatewayName`.\n * - `clearAll()` — manually empties both maps. Also invoked internally on\n * transport changes. Forwarded by `GatewayProvider` to consumers as\n * `resetGatewaysFromConfig`.\n * - `provided: true` — lets descendants detect a real provider.\n *\n * Note: the commented-out `SimpleXyoClient` at the top is intentionally\n * disabled pending a type unification between `XyoGateway` and\n * `XyoGatewayRunner`.\n */\nexport const InPageGatewaysProvider: React.FC<InPageGatewaysProviderProps> = ({ signerTransport, children }) => {\n const [gateways, setGateways] = useState<Partial<Record<GatewayName, ContextGatewayType>>>({})\n const [errors, setErrors] = useState<Partial<Record<GatewayName, Error>>>({})\n const [previousSignerTransport, setPreviousSignerTransport] = useState<RpcTransport<XyoSignerRpcSchemas> | undefined>(signerTransport)\n\n // This can come back once we homogenize the type for XyoGateway.\n // Right now, SimpleXyoClient takes XyoGatewayRunners but ideally it would take XyoGateway.\n // const clientInPage = useMemo(() => new SimpleXyoClient(gateways, {}), [gateways])\n\n const clearAll = useCallback(() => {\n setGateways({})\n setErrors({})\n }, [])\n\n if (previousSignerTransport !== signerTransport) {\n clearAll()\n setPreviousSignerTransport(signerTransport)\n }\n\n useEffect(() => {\n let cancelled = false\n\n const buildAll = async () => {\n const results = await Promise.allSettled(\n DefaultNetworks.map(async (network) => {\n const gateway = await buildGateway(network.id, signerTransport)\n return { id: network.id, gateway }\n }),\n )\n\n if (cancelled) return\n\n const nextGateways: Partial<Record<GatewayName, ContextGatewayType>> = {}\n const nextErrors: Partial<Record<GatewayName, Error>> = {}\n\n for (const [index, result] of results.entries()) {\n const networkId = DefaultNetworks[index].id as GatewayName\n if (result.status === 'fulfilled') {\n nextGateways[networkId] = result.value.gateway\n } else {\n nextErrors[networkId] = result.reason instanceof Error ? result.reason : new Error(String(result.reason))\n }\n }\n\n startTransition(() => {\n setGateways(nextGateways)\n setErrors(nextErrors)\n })\n }\n\n void buildAll()\n return () => {\n cancelled = true\n }\n }, [signerTransport])\n\n const value = useMemo(() => {\n const value: InPageGatewaysState = {\n clearAll,\n errors,\n gateways,\n provided: true,\n }\n return value\n }, [clearAll, errors, gateways])\n\n return <InPageGatewaysContext value={value}>{children}</InPageGatewaysContext>\n}\n","import { assertEx, isDefined } from '@xylabs/sdk-js'\nimport type {\n GatewayName,\n RemoteConfig, RpcTransport, SimpleXyoGateway,\n XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport {\n basicRemoteRunnerLocator,\n basicRemoteViewerLocator,\n DefaultNetworks, NetworkDataLakeUrls, XyoGatewayMoniker,\n} from '@xyo-network/xl1-sdk'\n\nexport const buildGateway = async (gatewayName: GatewayName, signerTransport?: RpcTransport<XyoSignerRpcSchemas>) => {\n const network = DefaultNetworks.find(network => network.id === gatewayName)\n const resolvedNetwork = assertEx(network, () => `No network found for id ${gatewayName}`)\n\n const remoteConfig: RemoteConfig = {\n rpc: {\n protocol: 'http',\n url: `${resolvedNetwork.url}/rpc`,\n },\n }\n\n const dataLakeEndpoint = NetworkDataLakeUrls[gatewayName]\n\n const locator = isDefined(signerTransport)\n ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport, dataLakeEndpoint)\n : await basicRemoteViewerLocator(gatewayName, remoteConfig, dataLakeEndpoint)\n\n return await locator.getInstance<SimpleXyoGateway>(XyoGatewayMoniker)\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysStateFields } from './InPageGatewaysState.ts'\n\n/**\n * Reads the `InPageGatewaysContext` map of per-network in-page gateways.\n * Intended for internal use by `GatewayProvider` — application code\n * should prefer `useProvidedGateway`, which returns a single resolved\n * gateway regardless of source.\n *\n * @param required - When `true` (default), throws if no\n * `InPageGatewaysProvider` is mounted above.\n */\nexport const useProvidedInPageGateways = (required = true) => useContextEx<InPageGatewaysStateFields>(InPageGatewaysContext, 'InPageGateways', required)\n","import { ErrorRender } from '@xylabs/react-error'\nimport { isDefinedNotNull, isNull } from '@xylabs/sdk-js'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\nimport { useProvidedInPageGateways } from '../in-page/index.ts'\n\n/**\n * Publishes the shared `GatewayContext` backed by two sources: the\n * injected XL1 Wallet extension *and* the in-page gateways built by\n * `InPageGatewaysProvider`. Use this provider when the host app can\n * function without a wallet (falling back to the in-page client) but\n * should still prefer the wallet when it is present.\n *\n * Required ancestry: an `InPageGatewaysProvider` must be mounted above\n * this provider — `useProvidedInPageGateways(true)` throws if missing.\n * If you only need a wallet-backed gateway, use `WalletGatewayProvider`\n * instead.\n *\n * Source precedence for `defaultGateway`:\n * - Wallet present and resolved (`XyoGatewayRunner`) → wallet wins; the\n * in-page gateway is still exposed via `gateways.inPageGateway` for\n * the rare consumer that needs to target it specifically.\n * - Wallet definitively absent (`null`) → fall back to the in-page\n * gateway matching `gatewayName`.\n * - Wallet still resolving (`undefined`) → leave `defaultGateway`\n * `undefined` so consumers render a loading state rather than\n * committing to the in-page fallback prematurely.\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — resolved per the precedence above. Three-state:\n * `undefined` = loading, `null` is not produced by this provider\n * (wallet-null collapses to `gatewayFromConfig`), `XyoGateway` = ready.\n * - `gateways.walletGateway` — raw wallet result (tri-state).\n * - `gateways.inPageGateway` — raw in-page result for the requested\n * `gatewayName`, or `undefined` if no `gatewayName` was passed.\n * - `error` — first non-null of wallet error, then in-page build error\n * for this `gatewayName`. Also rendered inline via `ErrorRender` above\n * `children` so mount-time failures surface even when no consumer\n * reads `error`.\n * - `resetGatewaysFromConfig` — forwards `clearAll` from\n * `InPageGatewaysProvider`, letting consumers force a rebuild of the\n * in-page gateways (e.g. after a network or endpoint change).\n * - `provided: true` — lets descendants detect a real provider in the\n * tree.\n *\n * `defaultGateway`, `gateways`, and the context `value` are memoized so\n * consumers only re-render when wallet or in-page sources actually\n * change identity.\n */\nexport const GatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const {\n gateways: allGateways,\n errors: allGatewayErrors,\n clearAll,\n } = useProvidedInPageGateways(true)\n\n const gatewayFromConfig = gatewayName ? allGateways[gatewayName] : undefined\n const gatewayFromConfigError = gatewayName ? allGatewayErrors[gatewayName] : undefined\n\n const { defaultGateway, gateways } = useMemo(() => {\n if (isNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromConfig,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: null,\n },\n }\n } else if (isDefinedNotNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: gatewayFromWallet,\n },\n }\n }\n return {\n defaultGateway: undefined,\n gateways: {\n inPageGateway: undefined,\n walletGateway: undefined,\n },\n }\n }, [gatewayFromConfig, gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError ?? gatewayFromConfigError,\n gateways,\n provided: true,\n resetGatewaysFromConfig: clearAll,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gatewayFromConfigError,\n gateways,\n clearAll,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromConfigError} />\n {children}\n </GatewayContext>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\n\n/**\n * Publishes a `GatewayContext` backed exclusively by the injected XL1 Wallet\n * extension (i.e. `globalThis.xyo`). This is the provider to use when the\n * host app is a browser UI that expects the user to bring their own wallet,\n * rather than running an in-page gateway.\n *\n * The requested `gatewayName` is forwarded to `useGatewayFromWallet`, whose\n * returned gateway uses a three-state contract (`undefined` = still\n * resolving, `null` = wallet confirmed absent / timed out,\n * `XyoGatewayRunner` = ready). That tri-state is passed through to\n * consumers unchanged as `defaultGateway` / `gateways.walletGateway`, so\n * downstream hooks can distinguish \"loading\" from \"missing\".\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — the wallet gateway, used when consumers don't\n * specify which gateway they want.\n * - `gateways.walletGateway` — same instance as `defaultGateway`.\n * - `gateways.inPageGateway` — always `null` here; this provider does not\n * stand up an in-page client. Pair with a different provider if you need\n * both.\n * - `error` — surfaced from `useGatewayFromWallet` (detection / timeout /\n * wallet errors). Also rendered inline via `ErrorRender` above `children`\n * so mount-time failures are visible even if no consumer reads `error`.\n * - `provided: true` — lets descendants detect that a real provider (not\n * the default empty context) is in the tree.\n *\n * The `defaultGateway`, `gateways`, and context `value` are memoized so\n * consumers only re-render when the underlying wallet gateway reference or\n * error actually changes.\n */\nexport const WalletGatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const { defaultGateway, gateways } = useMemo(() => {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: null,\n walletGateway: gatewayFromWallet,\n },\n }\n }, [gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError,\n gateways,\n provided: true,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gateways,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromWalletError} />\n {children}\n </GatewayContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { GatewayContext } from './GatewayContext.ts'\nimport type { GatewayStateFields } from './GatewayProviderState.ts'\n\n/**\n * The sole consumer entry point for gateway state. Reads the nearest\n * `GatewayContext` in the tree, regardless of which provider published\n * it — this is the decoupling that lets a component work unchanged when\n * the surrounding app swaps `WalletGatewayProvider` for\n * `GatewayProvider` (or a test double).\n *\n * @param required - When `true` (default), throws if no gateway provider\n * is mounted above — use this when the component is meaningless\n * without a gateway. When `false`, returns default state (all fields\n * undefined) so the component can render a graceful fallback.\n */\nexport const useProvidedGateway = (required = true) => useContextEx<GatewayStateFields>(Gat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A,IACD;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE,gBAAAF,MAAC,kBAAe,OACd;AAAA,oBAAAD,KAACI,cAAA,EAAY,OAAO,wBAAwB;AAAA,IAC3C;AAAA,KACH;AAEJ;;;AC1EA,SAAS,gBAAAC,qBAAoB;AAiBtB,IAAM,qBAAqB,CAAC,WAAW,SAASC,cAAiC,gBAAgB,WAAW,QAAQ;","names":["Stack","Typography","isDefined","isUndefined","useEffect","useState","isUndefined","isUndefined","isDefined","isDefined","useState","address","jsx","jsxs","Typography","useEffect","isDefined","Stack","isUndefined","createContextEx","DefaultNetworks","useCallback","useEffect","useState","assertEx","isDefined","network","jsx","useState","useCallback","useEffect","DefaultNetworks","value","ErrorRender","isDefinedNotNull","isNull","useMemo","jsx","jsxs","useMemo","isNull","isDefinedNotNull","value","ErrorRender","ErrorRender","useMemo","jsx","jsxs","useMemo","value","ErrorRender","useContextEx","useContextEx"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/components/connected/account/Connected.tsx","../../src/client/components/connected/ConnectAccountsStack.tsx","../../src/client/components/connected/hooks/useConnectAccount.ts","../../src/client/hooks/client/helpers/findCaveat.ts","../../src/client/hooks/client/useClientFromWallet.ts","../../src/client/hooks/helpers/getXyoClient.ts","../../src/client/hooks/client/permissions/usePermissions.ts","../../src/client/hooks/client/permissions/usePermissionsAccounts.ts","../../src/client/hooks/client/useGatewayFromWallet.ts","../../src/client/context/GatewayContext.ts","../../src/client/context/in-page/InPageGatewaysContext.ts","../../src/client/context/in-page/Provider.tsx","../../src/client/context/in-page/lib/buildGateway.ts","../../src/client/context/in-page/useProvidedInPageGateways.ts","../../src/client/context/providers/GatewayProvider.tsx","../../src/client/context/providers/WalletGatewayProvider.tsx","../../src/client/context/useProvidedGateway.ts","../../src/model/types/XyoGlobal.ts","../../src/shared/components/menu-item/ActiveMenuItem.tsx","../../src/shared/components/stack/DetailsStack.tsx","../../src/shared/components/stack/LabelValueStack.tsx","../../src/shared/decorators/IframeWalletWarningDecorator.tsx"],"sourcesContent":["import {\n Stack, Tooltip, Typography,\n} from '@mui/material'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport { BlockiesAvatarAddress } from '@xyo-network/xl1-blockies'\nimport React from 'react'\n\nexport const ConnectedAccount: React.FC<{ address: string }> = ({ address }) => {\n const shortenedAddress = `${EthAddressWrapper.fromString(address)?.toShortString(4)}`\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" spacing={1}>\n <BlockiesAvatarAddress address={address} size={21} />\n <Tooltip title={address}>\n <Typography color=\"textSecondary\" variant=\"caption\" fontFamily=\"monospace\">{shortenedAddress}</Typography>\n </Tooltip>\n </Stack>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Button, Stack,\n Typography,\n} from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { Address } from '@xylabs/sdk-js'\nimport { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport type { ComponentType, MouseEventHandler } from 'react'\nimport React, { useEffect } from 'react'\n\nimport { ConnectedAccount } from './account/index.ts'\nimport { useConnectAccount } from './hooks/index.ts'\n\nconst DefaultConnectComponent: React.FC<ButtonExProps> = props => (\n <ButtonEx variant=\"contained\" size=\"small\" {...props} />\n)\n\nconst DefaultNoWalletInstalledComponent: React.FC = () => (\n <Alert severity=\"warning\">\n <AlertTitle>XL1 Wallet Not Found</AlertTitle>\n <Typography gutterBottom>\n Please ensure that your XL1 Wallet is installed to connect your account.\n </Typography>\n <Button\n sx={{ display: 'flex', justifySelf: 'end' }}\n size=\"small\"\n variant=\"outlined\"\n href=\"https://chromewebstore.google.com/detail/xl1-wallet/fblbagcjeigmhakkfgjpdlcapcgmcfbm\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n Get XL1 Wallet\n </Button>\n </Alert>\n)\n\nexport interface ConnectClientAccountsStackProps extends StackProps {\n AccountComponent?: ComponentType<{ account?: string }>\n ConnectComponent?: ComponentType<{ onClick?: MouseEventHandler<HTMLElement> }>\n NoWalletInstalledComponent?: ComponentType\n onAccountConnected?: (account: Address) => void\n onCancel?: () => void\n timeout?: number\n}\n\n/**\n * Renders a horizontal stack that surfaces the current state of the user's\n * connection to an XL1 wallet (e.g. the XL1 Chrome extension) and lets them\n * kick off a connection.\n *\n * Connection state is derived from `useConnectAccount`, which wraps\n * `useGatewayFromWallet` (wallet/gateway discovery with a configurable\n * `timeout`) and `useAccountPermissions` (already-authorized addresses).\n * The hook returns: `address` (resolved once the wallet exposes one),\n * `connectSigner` (prompts the wallet for an address), `timedout` (the\n * gateway never appeared within `timeout`), and `error` (the first of\n * gateway, permissions, or signer-connect failures).\n *\n * The component renders exactly one of the following wallet states, plus\n * an always-present error slot:\n *\n * - **Connected** — `address` is defined: renders `AccountComponent` for\n * that address. Also fires `onAccountConnected(address)` once via effect.\n * - **Disconnected, wallet available** — no `address` and not `timedout`:\n * renders `ConnectComponent` as a \"Connect\" button that invokes\n * `connectSigner()`. This covers both \"wallet installed but no account\n * authorized yet\" and \"gateway still resolving\".\n * - **Wallet missing / unreachable** — no `address` and `timedout` is true:\n * renders `NoWalletInstalledComponent` (defaults to an Alert linking to\n * the XL1 Wallet Chrome Web Store listing).\n * - **Error** — any error from the hook is rendered via `ErrorRender`\n * alongside the state above, and `onCancel()` is fired once via effect\n * so the host UI can close/abort its connect flow.\n *\n * All three slot components (`AccountComponent`, `ConnectComponent`,\n * `NoWalletInstalledComponent`) are injectable so consumers can restyle\n * any state without forking this component.\n */\nexport const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps> = ({\n AccountComponent = ConnectedAccount,\n ConnectComponent = DefaultConnectComponent,\n NoWalletInstalledComponent = DefaultNoWalletInstalledComponent,\n onAccountConnected,\n onCancel,\n timeout,\n ...props\n}) => {\n const {\n address, connectSigner, error, timedout,\n } = useConnectAccount(undefined, timeout)\n\n useEffect(() => {\n if (isDefined(error) && isDefined(onCancel)) {\n onCancel()\n }\n }, [error, onCancel])\n\n useEffect(() => {\n if (isDefined(address) && isDefined(onAccountConnected)) {\n onAccountConnected(address)\n }\n }, [address, onAccountConnected])\n\n return (\n <Stack direction=\"row\" alignItems=\"start\" spacing={2} {...props}>\n {isDefined(address)\n ? <AccountComponent address={address} />\n : null}\n {isUndefined(address) && !timedout\n ? (\n <ConnectComponent onClick={() => void connectSigner()}>Connect</ConnectComponent>\n )\n : null}\n {isUndefined(address) && timedout\n ? (\n <NoWalletInstalledComponent />\n )\n : null}\n <ErrorRender error={error} scope=\"ConnectSigner:error\" />\n </Stack>\n )\n}\n","import { type Address, asAddress } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\nimport { MainNetwork } from '@xyo-network/xl1-sdk'\nimport { useCallback, useState } from 'react'\n\nimport { useAccountPermissions, useGatewayFromWallet } from '../../../hooks/index.ts'\n\nexport const useConnectAccount = (gatewayName: GatewayName = MainNetwork.id, timeout?: number) => {\n const [connectError, setConnectError] = useState<Error>()\n\n const {\n gateway, error, timedout,\n } = useGatewayFromWallet(gatewayName, timeout)\n\n const [accountPermissions, accountPermissionsError] = useAccountPermissions()\n\n const [address, setAddress] = useState<Address>()\n\n const connectSigner = useCallback(async () => {\n try {\n setConnectError(undefined)\n const assertedGateway = assertEx(gateway, () => `Gateway ${gatewayName} is not available`)\n const signer = assertedGateway.signer\n const address = await signer.address()\n setAddress(address)\n return address\n } catch (e) {\n setConnectError(e as Error)\n }\n }, [gateway, gatewayName])\n\n return {\n address: asAddress(accountPermissions?.[0] ?? address), connectSigner, error: error ?? accountPermissionsError ?? connectError, gateway, timedout,\n }\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type {\n CaveatTypes, ParentCapability, XyoPermissions,\n} from '@xyo-network/xl1-sdk'\n\nexport const findCaveat = async (\n permissions: XyoPermissions,\n targetCapability: ParentCapability,\n targetCaveatType: CaveatTypes,\n) => {\n const existingPermissions = await permissions.getPermissions()\n if (isDefined(existingPermissions) && existingPermissions.length > 0) {\n const foundPermissions = existingPermissions\n .find(p => p.parentCapability === targetCapability)\n if (isDefined(foundPermissions)) {\n return foundPermissions.caveats?.find(caveat => caveat.type === targetCaveatType)?.value ?? []\n }\n }\n return existingPermissions\n}\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\nimport { useEffect, useState } from 'react'\n\nimport { getXyoClient } from '../helpers/index.ts'\n\ninterface ClientState {\n client?: XyoClient | null\n error: Error | null\n isLoading: boolean\n timedout: boolean\n}\n\nconst initialState: ClientState = {\n client: undefined,\n error: null,\n isLoading: false,\n timedout: false,\n}\n\nexport const useClientFromWallet = (timeout?: number): ClientState => {\n const [state, setState] = useState<ClientState>(initialState)\n\n useEffect(() => {\n let cancelled = false\n\n const initialize = async () => {\n setState((prev) => {\n if (prev.isLoading) return prev\n return {\n ...prev, isLoading: true, error: null,\n }\n })\n\n try {\n const client = await getXyoClient(timeout)\n if (cancelled) return\n if (client === null) {\n setState({\n client: null, timedout: true, isLoading: false, error: null,\n })\n } else {\n setState({\n client, isLoading: false, error: null, timedout: false,\n })\n }\n } catch (error) {\n if (cancelled) return\n setState({\n client: undefined, isLoading: false, error: error as Error, timedout: false,\n })\n }\n }\n\n void initialize()\n\n // Late recovery: if wallet loads after timeout, update state\n const onPluginReady = () => {\n if (cancelled) return\n const client = isUndefined(globalThis.xyo) ? null : globalThis.xyo?.client ?? null\n setState({\n client, isLoading: false, timedout: false, error: null,\n })\n }\n globalThis.addEventListener('xyo:plugin-ready', onPluginReady)\n\n return () => {\n cancelled = true\n globalThis.removeEventListener('xyo:plugin-ready', onPluginReady)\n }\n }, [timeout])\n\n return state\n}\n\n/** @deprecated - use useClientFromWallet instead */\nexport const useClient = useClientFromWallet\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\n\nconst CLIENT_LISTENER_TIMEOUT = 2000\n\nconst hasXyoClient = () => {\n return 'client' in globalThis.xyo\n}\n\nexport const listenForClientInjection = (onClientReady: () => void, timeout: number, onTimeout: () => void) => {\n let resolved = false\n const listener: EventListener = () => {\n onClientReady()\n resolved = true\n }\n globalThis.addEventListener('xyo:plugin-ready', listener)\n setTimeout(() => {\n if (!resolved) {\n globalThis.removeEventListener('xyo:plugin-ready', listener)\n onTimeout()\n }\n }, timeout)\n}\n\ntype ReturnType = XyoClient | undefined | null\n\nexport async function getXyoClient(timeout = CLIENT_LISTENER_TIMEOUT): Promise<ReturnType> {\n // if no xyo object, we can bail early\n if (isUndefined(globalThis.xyo)) {\n return null\n }\n return hasXyoClient()\n ? globalThis.xyo.client\n // listen for the XyoWallet to be injected\n : await new Promise<ReturnType>((resolve) => {\n listenForClientInjection(\n () => {\n resolve(globalThis.xyo.client)\n },\n timeout,\n () => {\n resolve(null)\n },\n )\n })\n}\n","import { useClientFromWallet } from '../useClientFromWallet.ts'\n\nexport const usePermissions = () => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet()\n const permissions = client?.permissions\n return {\n permissions,\n isLoading,\n error,\n timedout,\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { JsonValue } from '@xylabs/sdk-js'\nimport {\n isArray, isDefined, isDefinedNotNull, isString,\n} from '@xylabs/sdk-js'\n\nimport { findCaveat } from '../helpers/index.ts'\nimport { usePermissions } from './usePermissions.ts'\n\nconst validateRestrictedAccounts = (restrictedAccounts: JsonValue): readonly string [] => {\n if (isDefined(restrictedAccounts)) {\n if (isArray(restrictedAccounts) && restrictedAccounts.every(isString)) {\n return restrictedAccounts\n }\n throw new Error(\n `Unrecognized format for restrictReturnedAccounts caveat found on permissions. \\n\n Should be an array of strings: ${JSON.stringify(restrictedAccounts)}`,\n )\n }\n return []\n}\n\nexport const useAccountPermissions = () => {\n const { permissions, error } = usePermissions()\n\n return usePromise(async () => {\n if (isDefinedNotNull(error)) throw error\n if (isDefined(permissions)) {\n const restrictedAccounts = await findCaveat(\n permissions,\n // TODO - extract to constant in protocol package\n 'xyoWallet_getAccounts',\n 'restrictReturnedAccounts',\n )\n return validateRestrictedAccounts(restrictedAccounts)\n }\n }, [permissions])\n}\n","import { isNull } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\n\nimport type { GatewayFromWallet } from '../../types/index.ts'\nimport { useClientFromWallet } from './useClientFromWallet.ts'\n\n/**\n * Resolves a gateway from the injected XL1 Wallet extension.\n *\n * The returned `gateway` uses a three-state contract:\n * - `undefined` — wallet detection is still in progress (isLoading=true),\n * or no gatewayName was provided. Consumers should treat this as \"not yet known\"\n * and avoid committing to either a present or absent UI state.\n * - `null` — wallet is definitively absent. Either globalThis.xyo was never set,\n * or detection timed out. Safe to show fallback UI (e.g. \"Get XL1 Wallet\").\n * A late-recovery listener may still transition this to a real gateway if\n * the extension loads after the timeout.\n * - `XyoGatewayRunner` — wallet is present and exposes this gateway for the\n * requested network. Ready to use for transactions and queries.\n */\nexport const useGatewayFromWallet = (gatewayName?: GatewayName, timeout?: number): GatewayFromWallet => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet(timeout)\n\n const resolveGateway = () => {\n // null client = wallet confirmed absent (no globalThis.xyo or timed out)\n if (isNull(client)) return null\n // client is undefined (still loading) or defined (wallet present) —\n // optional chain returns undefined while loading, or the gateway if available\n return client?.gateways?.[gatewayName!]\n }\n\n return {\n // no gatewayName requested = undefined (opt-out, not \"absent\")\n gateway: gatewayName ? resolveGateway() : undefined,\n isLoading,\n error,\n timedout,\n }\n}\n\n/** @deprecated - useGatewayFromWallet */\nexport const useGateway = useGatewayFromWallet\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { GatewayContextState } from './GatewayProviderState.ts'\n\n/**\n * Shared React context that decouples gateway *sources* from gateway\n * *consumers*. Any provider that can resolve an `XyoGateway` publishes to\n * this context; any hook or component that needs a gateway reads from it\n * via `useProvidedGateway`. Consumers never import a specific provider —\n * they just require that *some* provider is mounted above them in the\n * tree.\n *\n * Current publishers:\n * - `WalletGatewayProvider` (this package) — sources gateways from the\n * injected XL1 wallet extension.\n * - `GatewayProvider` in `@xyo-network/react-chain-provider` — sources\n * gateways built in-page against RPC endpoints, falling back to the\n * wallet when available.\n *\n * To add a new source (e.g. a mock provider for tests, an iframe-bridged\n * provider, a server-rendered provider), publish a `GatewayContextState`\n * to this same context — do not create a parallel context, or consumers\n * will silently stop receiving updates.\n */\nexport const GatewayContext = createContextEx<GatewayContextState>()\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\n\n/**\n * Narrow, provider-internal context that `InPageGatewaysProvider` writes\n * to and `GatewayProvider` reads from. Do not consume this in application\n * code — use `useProvidedGateway` (which reads the shared\n * `GatewayContext`) instead. This context only exists to decouple the\n * single in-page *builder* from the many single-gateway *adapters* that\n * sit between it and the shared gateway surface.\n */\nexport const InPageGatewaysContext = createContextEx<InPageGatewaysState>()\n","import type {\n GatewayName, RpcTransport, XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport { DefaultNetworks } from '@xyo-network/xl1-sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n startTransition,\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport type { ContextGatewayType } from '../../types/index.ts'\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\nimport { buildGateway } from './lib/index.ts'\n\nexport interface InPageGatewaysProviderProps extends PropsWithChildren {\n signerTransport?: RpcTransport<XyoSignerRpcSchemas>\n}\n\n/**\n * Publishes a keyed map of in-page gateways — one per network in\n * `DefaultNetworks` — under the narrow `InPageGatewaysContext`.\n *\n * This provider is deliberately *not* a direct publisher of the shared\n * `GatewayContext` that `useProvidedGateway` reads. Its consumer is the\n * wrapping `GatewayProvider` in this same package, which picks the\n * `gatewayName` the consumer asked for out of this map, adapts it into\n * the single-gateway `GatewayContextState` shape, and then publishes *that*\n * to the shared context. Splitting the work this way lets one\n * `InPageGatewaysProvider` near the root build every network's gateway\n * once, while many `GatewayProvider` instances deeper in the tree each\n * expose whichever gateway their subtree cares about.\n *\n * Unlike `WalletGatewayProvider`, gateways here are constructed directly\n * in the page (via `buildGateway`) against each network's RPC endpoint\n * — no browser wallet extension is required. `signerTransport` switches\n * between viewer (read-only) and runner (can sign/send) locators; supply\n * it only when the app needs to sign.\n *\n * Behavior:\n * - On mount, and whenever `signerTransport` changes, `buildGateway` is\n * called in parallel for every network in `DefaultNetworks` via\n * `Promise.allSettled`. Networks that resolve populate `gateways[id]`;\n * networks that reject populate `errors[id]`. One failed network does\n * not block the others.\n * - If `signerTransport` is provided, gateways are built with a remote\n * *runner* locator, otherwise with a remote *viewer* locator.\n * - When `signerTransport` changes identity mid-life, the provider clears\n * all cached gateways and errors synchronously during render (via\n * `previousSignerTransport` state) so consumers never see gateways\n * bound to the previous transport, then rebuilds in the effect.\n * - State updates from the rebuild are wrapped in `startTransition` so a\n * slow network doesn't stall higher-priority UI updates.\n * - A `cancelled` flag in the effect's cleanup discards results from a\n * prior `signerTransport` once a new one is in flight.\n *\n * Published `InPageGatewaysState` (narrower than `GatewayContextState` —\n * this is an internal handoff shape, not the cross-publisher surface):\n * - `gateways` — `Partial<Record<GatewayName, ContextGatewayType>>`. Keys\n * are only present for networks that built successfully.\n * - `errors` — `Partial<Record<GatewayName, Error>>`. Per-network build\n * failures, keyed by `GatewayName`.\n * - `clearAll()` — manually empties both maps. Also invoked internally on\n * transport changes. Forwarded by `GatewayProvider` to consumers as\n * `resetGatewaysFromConfig`.\n * - `provided: true` — lets descendants detect a real provider.\n *\n * Note: the commented-out `SimpleXyoClient` at the top is intentionally\n * disabled pending a type unification between `XyoGateway` and\n * `XyoGatewayRunner`.\n */\nexport const InPageGatewaysProvider: React.FC<InPageGatewaysProviderProps> = ({ signerTransport, children }) => {\n const [gateways, setGateways] = useState<Partial<Record<GatewayName, ContextGatewayType>>>({})\n const [errors, setErrors] = useState<Partial<Record<GatewayName, Error>>>({})\n const [previousSignerTransport, setPreviousSignerTransport] = useState<RpcTransport<XyoSignerRpcSchemas> | undefined>(signerTransport)\n\n // This can come back once we homogenize the type for XyoGateway.\n // Right now, SimpleXyoClient takes XyoGatewayRunners but ideally it would take XyoGateway.\n // const clientInPage = useMemo(() => new SimpleXyoClient(gateways, {}), [gateways])\n\n const clearAll = useCallback(() => {\n setGateways({})\n setErrors({})\n }, [])\n\n if (previousSignerTransport !== signerTransport) {\n clearAll()\n setPreviousSignerTransport(signerTransport)\n }\n\n useEffect(() => {\n let cancelled = false\n\n const buildAll = async () => {\n const results = await Promise.allSettled(\n DefaultNetworks.map(async (network) => {\n const gateway = await buildGateway(network.id, signerTransport)\n return { id: network.id, gateway }\n }),\n )\n\n if (cancelled) return\n\n const nextGateways: Partial<Record<GatewayName, ContextGatewayType>> = {}\n const nextErrors: Partial<Record<GatewayName, Error>> = {}\n\n for (const [index, result] of results.entries()) {\n const networkId = DefaultNetworks[index].id as GatewayName\n if (result.status === 'fulfilled') {\n nextGateways[networkId] = result.value.gateway\n } else {\n nextErrors[networkId] = result.reason instanceof Error ? result.reason : new Error(String(result.reason))\n }\n }\n\n startTransition(() => {\n setGateways(nextGateways)\n setErrors(nextErrors)\n })\n }\n\n void buildAll()\n return () => {\n cancelled = true\n }\n }, [signerTransport])\n\n const value = useMemo(() => {\n const value: InPageGatewaysState = {\n clearAll,\n errors,\n gateways,\n provided: true,\n }\n return value\n }, [clearAll, errors, gateways])\n\n return <InPageGatewaysContext value={value}>{children}</InPageGatewaysContext>\n}\n","import { assertEx, isDefined } from '@xylabs/sdk-js'\nimport type {\n GatewayName,\n RemoteConfig, RpcTransport, SimpleXyoGateway,\n XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport {\n basicRemoteRunnerLocator,\n basicRemoteViewerLocator,\n DefaultNetworks, NetworkDataLakeUrls, XyoGatewayMoniker,\n} from '@xyo-network/xl1-sdk'\n\nexport const buildGateway = async (gatewayName: GatewayName, signerTransport?: RpcTransport<XyoSignerRpcSchemas>) => {\n const network = DefaultNetworks.find(network => network.id === gatewayName)\n const resolvedNetwork = assertEx(network, () => `No network found for id ${gatewayName}`)\n\n const remoteConfig: RemoteConfig = {\n rpc: {\n protocol: 'http',\n url: `${resolvedNetwork.url}/rpc`,\n },\n }\n\n const dataLakeEndpoint = NetworkDataLakeUrls[gatewayName]\n\n const locator = isDefined(signerTransport)\n ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport, dataLakeEndpoint)\n : await basicRemoteViewerLocator(gatewayName, remoteConfig, dataLakeEndpoint)\n\n return await locator.getInstance<SimpleXyoGateway>(XyoGatewayMoniker)\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\n\n/**\n * Reads the `InPageGatewaysContext` map of per-network in-page gateways.\n * Intended for internal use by `GatewayProvider` — application code\n * should prefer `useProvidedGateway`, which returns a single resolved\n * gateway regardless of source.\n *\n * @param required - When `true` (default), throws if no\n * `InPageGatewaysProvider` is mounted above.\n */\nexport const useProvidedInPageGateways = (required = true) => useContextEx(InPageGatewaysContext, 'InPageGateways', required)\n","import { ErrorRender } from '@xylabs/react-error'\nimport { isDefinedNotNull, isNull } from '@xylabs/sdk-js'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\nimport { useProvidedInPageGateways } from '../in-page/index.ts'\n\n/**\n * Publishes the shared `GatewayContext` backed by two sources: the\n * injected XL1 Wallet extension *and* the in-page gateways built by\n * `InPageGatewaysProvider`. Use this provider when the host app can\n * function without a wallet (falling back to the in-page client) but\n * should still prefer the wallet when it is present.\n *\n * Required ancestry: an `InPageGatewaysProvider` must be mounted above\n * this provider — `useProvidedInPageGateways(true)` throws if missing.\n * If you only need a wallet-backed gateway, use `WalletGatewayProvider`\n * instead.\n *\n * Source precedence for `defaultGateway`:\n * - Wallet present and resolved (`XyoGatewayRunner`) → wallet wins; the\n * in-page gateway is still exposed via `gateways.inPageGateway` for\n * the rare consumer that needs to target it specifically.\n * - Wallet definitively absent (`null`) → fall back to the in-page\n * gateway matching `gatewayName`.\n * - Wallet still resolving (`undefined`) → leave `defaultGateway`\n * `undefined` so consumers render a loading state rather than\n * committing to the in-page fallback prematurely.\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — resolved per the precedence above. Three-state:\n * `undefined` = loading, `null` is not produced by this provider\n * (wallet-null collapses to `gatewayFromConfig`), `XyoGateway` = ready.\n * - `gateways.walletGateway` — raw wallet result (tri-state).\n * - `gateways.inPageGateway` — raw in-page result for the requested\n * `gatewayName`, or `undefined` if no `gatewayName` was passed.\n * - `error` — first non-null of wallet error, then in-page build error\n * for this `gatewayName`. Also rendered inline via `ErrorRender` above\n * `children` so mount-time failures surface even when no consumer\n * reads `error`.\n * - `resetGatewaysFromConfig` — forwards `clearAll` from\n * `InPageGatewaysProvider`, letting consumers force a rebuild of the\n * in-page gateways (e.g. after a network or endpoint change).\n * - `provided: true` — lets descendants detect a real provider in the\n * tree.\n *\n * `defaultGateway`, `gateways`, and the context `value` are memoized so\n * consumers only re-render when wallet or in-page sources actually\n * change identity.\n */\nexport const GatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const {\n gateways: allGateways,\n errors: allGatewayErrors,\n clearAll,\n } = useProvidedInPageGateways(true)\n\n const gatewayFromConfig = gatewayName ? allGateways[gatewayName] : undefined\n const gatewayFromConfigError = gatewayName ? allGatewayErrors[gatewayName] : undefined\n\n const { defaultGateway, gateways } = useMemo(() => {\n if (isNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromConfig,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: null,\n },\n }\n } else if (isDefinedNotNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: gatewayFromWallet,\n },\n }\n }\n return {\n defaultGateway: undefined,\n gateways: {\n inPageGateway: undefined,\n walletGateway: undefined,\n },\n }\n }, [gatewayFromConfig, gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError ?? gatewayFromConfigError,\n gateways,\n provided: true,\n resetGatewaysFromConfig: clearAll,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gatewayFromConfigError,\n gateways,\n clearAll,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromConfigError} />\n {children}\n </GatewayContext>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\n\n/**\n * Publishes a `GatewayContext` backed exclusively by the injected XL1 Wallet\n * extension (i.e. `globalThis.xyo`). This is the provider to use when the\n * host app is a browser UI that expects the user to bring their own wallet,\n * rather than running an in-page gateway.\n *\n * The requested `gatewayName` is forwarded to `useGatewayFromWallet`, whose\n * returned gateway uses a three-state contract (`undefined` = still\n * resolving, `null` = wallet confirmed absent / timed out,\n * `XyoGatewayRunner` = ready). That tri-state is passed through to\n * consumers unchanged as `defaultGateway` / `gateways.walletGateway`, so\n * downstream hooks can distinguish \"loading\" from \"missing\".\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — the wallet gateway, used when consumers don't\n * specify which gateway they want.\n * - `gateways.walletGateway` — same instance as `defaultGateway`.\n * - `gateways.inPageGateway` — always `null` here; this provider does not\n * stand up an in-page client. Pair with a different provider if you need\n * both.\n * - `error` — surfaced from `useGatewayFromWallet` (detection / timeout /\n * wallet errors). Also rendered inline via `ErrorRender` above `children`\n * so mount-time failures are visible even if no consumer reads `error`.\n * - `provided: true` — lets descendants detect that a real provider (not\n * the default empty context) is in the tree.\n *\n * The `defaultGateway`, `gateways`, and context `value` are memoized so\n * consumers only re-render when the underlying wallet gateway reference or\n * error actually changes.\n */\nexport const WalletGatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const { defaultGateway, gateways } = useMemo(() => {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: null,\n walletGateway: gatewayFromWallet,\n },\n }\n }, [gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError,\n gateways,\n provided: true,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gateways,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromWalletError} />\n {children}\n </GatewayContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { GatewayContext } from './GatewayContext.ts'\n\n/**\n * The sole consumer entry point for gateway state. Reads the nearest\n * `GatewayContext` in the tree, regardless of which provider published\n * it — this is the decoupling that lets a component work unchanged when\n * the surrounding app swaps `WalletGatewayProvider` for\n * `GatewayProvider` (or a test double).\n *\n * @param required - When `true` (default), throws if no gateway provider\n * is mounted above — use this when the component is meaningless\n * without a gateway. When `false`, returns default state (all fields\n * undefined) so the component can render a graceful fallback.\n */\nexport const useProvidedGateway = (required = true) => useContextEx(GatewayContext, 'Gateway', required)\n","import { isDefinedNotNull, isObject } from '@xylabs/sdk-js'\nimport type {\n NetworkBootstrap, NetworkId, XyoClient,\n} from '@xyo-network/xl1-sdk'\n\nexport interface XyoGlobal extends UninitializedXyoGlobal {\n client: XyoClient\n errors: Error[]\n}\n\n/**\n * Describes the initial state of the global XYO object before initialization\n * (i.e. before the client is initialized)\n */\nexport interface UninitializedXyoGlobal {\n connections: Record<NetworkId, NetworkBootstrap>\n sessionId: () => string\n walletExtensionId: () => string\n}\n\nexport const isXyoGlobal = (obj: unknown): obj is XyoGlobal => {\n return (\n isDefinedNotNull(obj)\n && isObject(obj)\n && 'client' in obj\n && 'connections' in obj\n && 'errors' in obj\n && 'sessionId' in obj\n && 'walletExtensionId' in obj\n )\n}\n\nexport const isUninitializedXyoGlobal = (obj: unknown): obj is UninitializedXyoGlobal => {\n return (\n isDefinedNotNull(obj)\n && isObject(obj)\n && 'connections' in obj\n && 'sessionId' in obj\n && 'walletExtensionId' in obj\n && !('client' in obj)\n && ('errors' in obj)\n && Array.isArray((obj).errors)\n && obj.errors.length === 0\n )\n}\n","import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport type {\n ComponentType, ReactNode, SVGAttributes,\n} from 'react'\nimport React, { useMemo } from 'react'\n\nconst isComponentType = (value: unknown): value is ComponentType<SVGAttributes<SVGElement>> =>\n typeof value === 'function'\n || (typeof value === 'object' && value !== null && ('$$typeof' in value || 'render' in value))\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>> | ReactNode\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return isComponentType(IconComponent)\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : IconComponent ?? null\n }, [IconComponent, theme])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n <span>{resolvedIconComponent}</span>\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport { ellipsize, isAddress } from '@xylabs/sdk-js'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n const formattedValue = (value: string | undefined): string | undefined => {\n if (isAddress(value)) {\n return ellipsize(value, 8)\n }\n return value\n }\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map((value, index) => (\n <Typography\n title={value}\n fontFamily=\"monospace\"\n variant=\"body2\"\n // Use matching label as key since values might be the same\n key={labels[index]}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {formattedValue(value)}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { Alert, Stack } from '@mui/material'\nimport type { Decorator } from '@storybook/react-vite'\nimport React from 'react'\n\nimport { isXyoGlobal } from '../../model/index.ts'\n\nconst inIframe = globalThis.self !== window.top\n\n/**\n * Storybook decorator that displays warning banners when:\n * - the story is rendered inside an iframe (prompt user to open in a standalone tab), or\n * - the XYO wallet extension is not detected (prompt user to install it).\n *\n * Stories that require direct browser-extension access should use this decorator.\n */\nexport const IframeWalletWarningDecorator: Decorator = (Story, args) => {\n const hasXyoGlobal = isXyoGlobal((globalThis as Record<string, unknown>).xyo)\n return (\n <Stack gap={2}>\n {inIframe\n ? (\n <Alert severity=\"warning\">\n This story is running in an iframe. Please run it in a standalone browser window to test the wallet extension.\n </Alert>\n )\n : null}\n {hasXyoGlobal\n ? null\n : (\n <Alert severity=\"warning\">\n No wallet extension found. Please install the Xyo Wallet Chrome Extension.\n </Alert>\n )}\n <Story {...args} />\n </Stack>\n )\n}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Q;AAAA,QAGR,OAAM;AAAA,QACN,IAAI;AAAA,UACF,SAAS;AAAA,UAAQ,gBAAgB;AAAA,UAAO,cAAc,aAAa,MAAM,MAAM,QAAQ,OAAO;AAAA,QAChG;AAAA,QAEC,yBAAe,KAAK;AAAA;AAAA,MANhB,OAAO,KAAK;AAAA,IAOnB,CACD,GACH;AAAA,KACF;AAEJ;;;ACxDA,SAAS,SAAAI,QAAO,SAAAC,cAAa;AAkBzB,SAGQ,OAAAC,MAHR,QAAAC,aAAA;AAZJ,IAAM,WAAW,WAAW,SAAS,OAAO;AASrC,IAAM,+BAA0C,CAAC,OAAO,SAAS;AACtE,QAAM,eAAe,YAAa,WAAuC,GAAG;AAC5E,SACE,gBAAAA,MAACC,QAAA,EAAM,KAAK,GACT;AAAA,eAEK,gBAAAF,KAACG,QAAA,EAAM,UAAS,WAAU,4HAE1B,IAEF;AAAA,IACH,eACG,OAEE,gBAAAH,KAACG,QAAA,EAAM,UAAS,WAAU,wFAE1B;AAAA,IAEN,gBAAAH,KAAC,SAAO,GAAG,MAAM;AAAA,KACnB;AAEJ;","names":["Stack","Typography","isDefined","isUndefined","useEffect","useState","isUndefined","isUndefined","isDefined","isDefined","useState","address","jsx","jsxs","Typography","useEffect","isDefined","Stack","isUndefined","createContextEx","DefaultNetworks","useCallback","useEffect","useState","assertEx","isDefined","network","jsx","useState","useCallback","useEffect","DefaultNetworks","value","ErrorRender","isDefinedNotNull","isNull","useMemo","jsx","jsxs","useMemo","isNull","isDefinedNotNull","value","ErrorRender","ErrorRender","useMemo","jsx","jsxs","useMemo","value","ErrorRender","useContextEx","useContextEx","isDefinedNotNull","jsx","Stack","styled","Tooltip","Typography","useTheme","isDefined","useMemo","jsx","jsxs","Stack","Typography","useTheme","jsx","jsxs","Alert","Stack","jsx","jsxs","Stack","Alert"]}
|
|
1
|
+
{"version":3,"sources":["../../src/client/components/connected/account/Connected.tsx","../../src/client/components/connected/ConnectAccountsStack.tsx","../../src/client/components/connected/hooks/useConnectAccount.ts","../../src/client/hooks/client/helpers/findCaveat.ts","../../src/client/hooks/client/useClientFromWallet.ts","../../src/client/hooks/helpers/getXyoClient.ts","../../src/client/hooks/client/permissions/usePermissions.ts","../../src/client/hooks/client/permissions/usePermissionsAccounts.ts","../../src/client/hooks/client/useGatewayFromWallet.ts","../../src/client/context/GatewayContext.ts","../../src/client/context/in-page/InPageGatewaysContext.ts","../../src/client/context/in-page/Provider.tsx","../../src/client/context/in-page/lib/buildGateway.ts","../../src/client/context/in-page/useProvidedInPageGateways.ts","../../src/client/context/providers/GatewayProvider.tsx","../../src/client/context/providers/WalletGatewayProvider.tsx","../../src/client/context/useProvidedGateway.ts","../../src/model/types/XyoGlobal.ts","../../src/shared/components/menu-item/ActiveMenuItem.tsx","../../src/shared/components/stack/DetailsStack.tsx","../../src/shared/components/stack/LabelValueStack.tsx","../../src/shared/decorators/IframeWalletWarningDecorator.tsx"],"sourcesContent":["import {\n Stack, Tooltip, Typography,\n} from '@mui/material'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport { BlockiesAvatarAddress } from '@xyo-network/xl1-blockies'\nimport React from 'react'\n\nexport const ConnectedAccount: React.FC<{ address: string }> = ({ address }) => {\n const shortenedAddress = `${EthAddressWrapper.fromString(address)?.toShortString(4)}`\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" spacing={1}>\n <BlockiesAvatarAddress address={address} size={21} />\n <Tooltip title={address}>\n <Typography color=\"textSecondary\" variant=\"caption\" fontFamily=\"monospace\">{shortenedAddress}</Typography>\n </Tooltip>\n </Stack>\n )\n}\n","import type { StackProps } from '@mui/material'\nimport {\n Alert, AlertTitle, Button, Stack,\n Typography,\n} from '@mui/material'\nimport type { ButtonExProps } from '@xylabs/react-button'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { ErrorRender } from '@xylabs/react-error'\nimport type { Address } from '@xylabs/sdk-js'\nimport { isDefined, isUndefined } from '@xylabs/sdk-js'\nimport type { ComponentType, MouseEventHandler } from 'react'\nimport React, { useEffect } from 'react'\n\nimport { ConnectedAccount } from './account/index.ts'\nimport { useConnectAccount } from './hooks/index.ts'\n\nconst DefaultConnectComponent: React.FC<ButtonExProps> = props => (\n <ButtonEx variant=\"contained\" size=\"small\" {...props} />\n)\n\nconst DefaultNoWalletInstalledComponent: React.FC = () => (\n <Alert severity=\"warning\">\n <AlertTitle>XL1 Wallet Not Found</AlertTitle>\n <Typography gutterBottom>\n Please ensure that your XL1 Wallet is installed to connect your account.\n </Typography>\n <Button\n sx={{ display: 'flex', justifySelf: 'end' }}\n size=\"small\"\n variant=\"outlined\"\n href=\"https://chromewebstore.google.com/detail/xl1-wallet/fblbagcjeigmhakkfgjpdlcapcgmcfbm\"\n target=\"_blank\"\n rel=\"noopener\"\n >\n Get XL1 Wallet\n </Button>\n </Alert>\n)\n\nexport interface ConnectClientAccountsStackProps extends StackProps {\n AccountComponent?: ComponentType<{ account?: string }>\n ConnectComponent?: ComponentType<{ onClick?: MouseEventHandler<HTMLElement> }>\n NoWalletInstalledComponent?: ComponentType\n onAccountConnected?: (account: Address) => void\n onCancel?: () => void\n timeout?: number\n}\n\n/**\n * Renders a horizontal stack that surfaces the current state of the user's\n * connection to an XL1 wallet (e.g. the XL1 Chrome extension) and lets them\n * kick off a connection.\n *\n * Connection state is derived from `useConnectAccount`, which wraps\n * `useGatewayFromWallet` (wallet/gateway discovery with a configurable\n * `timeout`) and `useAccountPermissions` (already-authorized addresses).\n * The hook returns: `address` (resolved once the wallet exposes one),\n * `connectSigner` (prompts the wallet for an address), `timedout` (the\n * gateway never appeared within `timeout`), and `error` (the first of\n * gateway, permissions, or signer-connect failures).\n *\n * The component renders exactly one of the following wallet states, plus\n * an always-present error slot:\n *\n * - **Connected** — `address` is defined: renders `AccountComponent` for\n * that address. Also fires `onAccountConnected(address)` once via effect.\n * - **Disconnected, wallet available** — no `address` and not `timedout`:\n * renders `ConnectComponent` as a \"Connect\" button that invokes\n * `connectSigner()`. This covers both \"wallet installed but no account\n * authorized yet\" and \"gateway still resolving\".\n * - **Wallet missing / unreachable** — no `address` and `timedout` is true:\n * renders `NoWalletInstalledComponent` (defaults to an Alert linking to\n * the XL1 Wallet Chrome Web Store listing).\n * - **Error** — any error from the hook is rendered via `ErrorRender`\n * alongside the state above, and `onCancel()` is fired once via effect\n * so the host UI can close/abort its connect flow.\n *\n * All three slot components (`AccountComponent`, `ConnectComponent`,\n * `NoWalletInstalledComponent`) are injectable so consumers can restyle\n * any state without forking this component.\n */\nexport const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps> = ({\n AccountComponent = ConnectedAccount,\n ConnectComponent = DefaultConnectComponent,\n NoWalletInstalledComponent = DefaultNoWalletInstalledComponent,\n onAccountConnected,\n onCancel,\n timeout,\n ...props\n}) => {\n const {\n address, connectSigner, error, timedout,\n } = useConnectAccount(undefined, timeout)\n\n useEffect(() => {\n if (isDefined(error) && isDefined(onCancel)) {\n onCancel()\n }\n }, [error, onCancel])\n\n useEffect(() => {\n if (isDefined(address) && isDefined(onAccountConnected)) {\n onAccountConnected(address)\n }\n }, [address, onAccountConnected])\n\n return (\n <Stack direction=\"row\" alignItems=\"start\" spacing={2} {...props}>\n {isDefined(address)\n ? <AccountComponent address={address} />\n : null}\n {isUndefined(address) && !timedout\n ? (\n <ConnectComponent onClick={() => void connectSigner()}>Connect</ConnectComponent>\n )\n : null}\n {isUndefined(address) && timedout\n ? (\n <NoWalletInstalledComponent />\n )\n : null}\n <ErrorRender error={error} scope=\"ConnectSigner:error\" />\n </Stack>\n )\n}\n","import { type Address, asAddress } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\nimport { MainNetwork } from '@xyo-network/xl1-sdk'\nimport { useCallback, useState } from 'react'\n\nimport { useAccountPermissions, useGatewayFromWallet } from '../../../hooks/index.ts'\n\nexport const useConnectAccount = (gatewayName: GatewayName = MainNetwork.id, timeout?: number) => {\n const [connectError, setConnectError] = useState<Error>()\n\n const {\n gateway, error, timedout,\n } = useGatewayFromWallet(gatewayName, timeout)\n\n const [accountPermissions, accountPermissionsError] = useAccountPermissions()\n\n const [address, setAddress] = useState<Address>()\n\n const connectSigner = useCallback(async () => {\n try {\n setConnectError(undefined)\n const assertedGateway = assertEx(gateway, () => `Gateway ${gatewayName} is not available`)\n const signer = assertedGateway.signer\n const address = await signer.address()\n setAddress(address)\n return address\n } catch (e) {\n setConnectError(e as Error)\n }\n }, [gateway, gatewayName])\n\n return {\n address: asAddress(accountPermissions?.[0] ?? address), connectSigner, error: error ?? accountPermissionsError ?? connectError, gateway, timedout,\n }\n}\n","import { isDefined } from '@xylabs/sdk-js'\nimport type {\n CaveatTypes, ParentCapability, XyoPermissions,\n} from '@xyo-network/xl1-sdk'\n\nexport const findCaveat = async (\n permissions: XyoPermissions,\n targetCapability: ParentCapability,\n targetCaveatType: CaveatTypes,\n) => {\n const existingPermissions = await permissions.getPermissions()\n if (isDefined(existingPermissions) && existingPermissions.length > 0) {\n const foundPermissions = existingPermissions\n .find(p => p.parentCapability === targetCapability)\n if (isDefined(foundPermissions)) {\n return foundPermissions.caveats?.find(caveat => caveat.type === targetCaveatType)?.value ?? []\n }\n }\n return existingPermissions\n}\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\nimport { useEffect, useState } from 'react'\n\nimport { getXyoClient } from '../helpers/index.ts'\n\ninterface ClientState {\n client?: XyoClient | null\n error: Error | null\n isLoading: boolean\n timedout: boolean\n}\n\nconst initialState: ClientState = {\n client: undefined,\n error: null,\n isLoading: false,\n timedout: false,\n}\n\nexport const useClientFromWallet = (timeout?: number): ClientState => {\n const [state, setState] = useState<ClientState>(initialState)\n\n useEffect(() => {\n let cancelled = false\n\n const initialize = async () => {\n setState((prev) => {\n if (prev.isLoading) return prev\n return {\n ...prev, isLoading: true, error: null,\n }\n })\n\n try {\n const client = await getXyoClient(timeout)\n if (cancelled) return\n if (client === null) {\n setState({\n client: null, timedout: true, isLoading: false, error: null,\n })\n } else {\n setState({\n client, isLoading: false, error: null, timedout: false,\n })\n }\n } catch (error) {\n if (cancelled) return\n setState({\n client: undefined, isLoading: false, error: error as Error, timedout: false,\n })\n }\n }\n\n void initialize()\n\n // Late recovery: if wallet loads after timeout, update state\n const onPluginReady = () => {\n if (cancelled) return\n const client = isUndefined(globalThis.xyo) ? null : globalThis.xyo?.client ?? null\n setState({\n client, isLoading: false, timedout: false, error: null,\n })\n }\n globalThis.addEventListener('xyo:plugin-ready', onPluginReady)\n\n return () => {\n cancelled = true\n globalThis.removeEventListener('xyo:plugin-ready', onPluginReady)\n }\n }, [timeout])\n\n return state\n}\n\n/** @deprecated - use useClientFromWallet instead */\nexport const useClient = useClientFromWallet\n","import { isUndefined } from '@xylabs/sdk-js'\nimport type { XyoClient } from '@xyo-network/xl1-sdk'\n\nconst CLIENT_LISTENER_TIMEOUT = 2000\n\nconst hasXyoClient = () => {\n return 'client' in globalThis.xyo\n}\n\nexport const listenForClientInjection = (onClientReady: () => void, timeout: number, onTimeout: () => void) => {\n let resolved = false\n const listener: EventListener = () => {\n onClientReady()\n resolved = true\n }\n globalThis.addEventListener('xyo:plugin-ready', listener)\n setTimeout(() => {\n if (!resolved) {\n globalThis.removeEventListener('xyo:plugin-ready', listener)\n onTimeout()\n }\n }, timeout)\n}\n\ntype ReturnType = XyoClient | undefined | null\n\nexport async function getXyoClient(timeout = CLIENT_LISTENER_TIMEOUT): Promise<ReturnType> {\n // if no xyo object, we can bail early\n if (isUndefined(globalThis.xyo)) {\n return null\n }\n return hasXyoClient()\n ? globalThis.xyo.client\n // listen for the XyoWallet to be injected\n : await new Promise<ReturnType>((resolve) => {\n listenForClientInjection(\n () => {\n resolve(globalThis.xyo.client)\n },\n timeout,\n () => {\n resolve(null)\n },\n )\n })\n}\n","import { useClientFromWallet } from '../useClientFromWallet.ts'\n\nexport const usePermissions = () => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet()\n const permissions = client?.permissions\n return {\n permissions,\n isLoading,\n error,\n timedout,\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { JsonValue } from '@xylabs/sdk-js'\nimport {\n isArray, isDefined, isDefinedNotNull, isString,\n} from '@xylabs/sdk-js'\n\nimport { findCaveat } from '../helpers/index.ts'\nimport { usePermissions } from './usePermissions.ts'\n\nconst validateRestrictedAccounts = (restrictedAccounts: JsonValue): readonly string [] => {\n if (isDefined(restrictedAccounts)) {\n if (isArray(restrictedAccounts) && restrictedAccounts.every(isString)) {\n return restrictedAccounts\n }\n throw new Error(\n `Unrecognized format for restrictReturnedAccounts caveat found on permissions. \\n\n Should be an array of strings: ${JSON.stringify(restrictedAccounts)}`,\n )\n }\n return []\n}\n\nexport const useAccountPermissions = () => {\n const { permissions, error } = usePermissions()\n\n return usePromise(async () => {\n if (isDefinedNotNull(error)) throw error\n if (isDefined(permissions)) {\n const restrictedAccounts = await findCaveat(\n permissions,\n // TODO - extract to constant in protocol package\n 'xyoWallet_getAccounts',\n 'restrictReturnedAccounts',\n )\n return validateRestrictedAccounts(restrictedAccounts)\n }\n }, [permissions])\n}\n","import { isNull } from '@xylabs/sdk-js'\nimport type { GatewayName } from '@xyo-network/xl1-sdk'\n\nimport type { GatewayFromWallet } from '../../types/index.ts'\nimport { useClientFromWallet } from './useClientFromWallet.ts'\n\n/**\n * Resolves a gateway from the injected XL1 Wallet extension.\n *\n * The returned `gateway` uses a three-state contract:\n * - `undefined` — wallet detection is still in progress (isLoading=true),\n * or no gatewayName was provided. Consumers should treat this as \"not yet known\"\n * and avoid committing to either a present or absent UI state.\n * - `null` — wallet is definitively absent. Either globalThis.xyo was never set,\n * or detection timed out. Safe to show fallback UI (e.g. \"Get XL1 Wallet\").\n * A late-recovery listener may still transition this to a real gateway if\n * the extension loads after the timeout.\n * - `XyoGatewayRunner` — wallet is present and exposes this gateway for the\n * requested network. Ready to use for transactions and queries.\n */\nexport const useGatewayFromWallet = (gatewayName?: GatewayName, timeout?: number): GatewayFromWallet => {\n const {\n client, isLoading, error, timedout,\n } = useClientFromWallet(timeout)\n\n const resolveGateway = () => {\n // null client = wallet confirmed absent (no globalThis.xyo or timed out)\n if (isNull(client)) return null\n // client is undefined (still loading) or defined (wallet present) —\n // optional chain returns undefined while loading, or the gateway if available\n return client?.gateways?.[gatewayName!]\n }\n\n return {\n // no gatewayName requested = undefined (opt-out, not \"absent\")\n gateway: gatewayName ? resolveGateway() : undefined,\n isLoading,\n error,\n timedout,\n }\n}\n\n/** @deprecated - useGatewayFromWallet */\nexport const useGateway = useGatewayFromWallet\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { GatewayStateFields } from './GatewayProviderState.ts'\n\n/**\n * Shared React context that decouples gateway *sources* from gateway\n * *consumers*. Any provider that can resolve an `XyoGateway` publishes to\n * this context; any hook or component that needs a gateway reads from it\n * via `useProvidedGateway`. Consumers never import a specific provider —\n * they just require that *some* provider is mounted above them in the\n * tree.\n *\n * Current publishers:\n * - `WalletGatewayProvider` (this package) — sources gateways from the\n * injected XL1 wallet extension.\n * - `GatewayProvider` in `@xyo-network/react-chain-provider` — sources\n * gateways built in-page against RPC endpoints, falling back to the\n * wallet when available.\n *\n * To add a new source (e.g. a mock provider for tests, an iframe-bridged\n * provider, a server-rendered provider), publish a `GatewayContextState`\n * to this same context — do not create a parallel context, or consumers\n * will silently stop receiving updates.\n */\nexport const GatewayContext = createContextEx<GatewayStateFields>()\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { InPageGatewaysStateFields } from './InPageGatewaysState.ts'\n\n/**\n * Narrow, provider-internal context that `InPageGatewaysProvider` writes\n * to and `GatewayProvider` reads from. Do not consume this in application\n * code — use `useProvidedGateway` (which reads the shared\n * `GatewayContext`) instead. This context only exists to decouple the\n * single in-page *builder* from the many single-gateway *adapters* that\n * sit between it and the shared gateway surface.\n */\nexport const InPageGatewaysContext = createContextEx<InPageGatewaysStateFields>()\n","import type {\n GatewayName, RpcTransport, XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport { DefaultNetworks } from '@xyo-network/xl1-sdk'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n startTransition,\n useCallback, useEffect, useMemo, useState,\n} from 'react'\n\nimport type { ContextGatewayType } from '../../types/index.ts'\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysState } from './InPageGatewaysState.ts'\nimport { buildGateway } from './lib/index.ts'\n\nexport interface InPageGatewaysProviderProps extends PropsWithChildren {\n signerTransport?: RpcTransport<XyoSignerRpcSchemas>\n}\n\n/**\n * Publishes a keyed map of in-page gateways — one per network in\n * `DefaultNetworks` — under the narrow `InPageGatewaysContext`.\n *\n * This provider is deliberately *not* a direct publisher of the shared\n * `GatewayContext` that `useProvidedGateway` reads. Its consumer is the\n * wrapping `GatewayProvider` in this same package, which picks the\n * `gatewayName` the consumer asked for out of this map, adapts it into\n * the single-gateway `GatewayContextState` shape, and then publishes *that*\n * to the shared context. Splitting the work this way lets one\n * `InPageGatewaysProvider` near the root build every network's gateway\n * once, while many `GatewayProvider` instances deeper in the tree each\n * expose whichever gateway their subtree cares about.\n *\n * Unlike `WalletGatewayProvider`, gateways here are constructed directly\n * in the page (via `buildGateway`) against each network's RPC endpoint\n * — no browser wallet extension is required. `signerTransport` switches\n * between viewer (read-only) and runner (can sign/send) locators; supply\n * it only when the app needs to sign.\n *\n * Behavior:\n * - On mount, and whenever `signerTransport` changes, `buildGateway` is\n * called in parallel for every network in `DefaultNetworks` via\n * `Promise.allSettled`. Networks that resolve populate `gateways[id]`;\n * networks that reject populate `errors[id]`. One failed network does\n * not block the others.\n * - If `signerTransport` is provided, gateways are built with a remote\n * *runner* locator, otherwise with a remote *viewer* locator.\n * - When `signerTransport` changes identity mid-life, the provider clears\n * all cached gateways and errors synchronously during render (via\n * `previousSignerTransport` state) so consumers never see gateways\n * bound to the previous transport, then rebuilds in the effect.\n * - State updates from the rebuild are wrapped in `startTransition` so a\n * slow network doesn't stall higher-priority UI updates.\n * - A `cancelled` flag in the effect's cleanup discards results from a\n * prior `signerTransport` once a new one is in flight.\n *\n * Published `InPageGatewaysState` (narrower than `GatewayContextState` —\n * this is an internal handoff shape, not the cross-publisher surface):\n * - `gateways` — `Partial<Record<GatewayName, ContextGatewayType>>`. Keys\n * are only present for networks that built successfully.\n * - `errors` — `Partial<Record<GatewayName, Error>>`. Per-network build\n * failures, keyed by `GatewayName`.\n * - `clearAll()` — manually empties both maps. Also invoked internally on\n * transport changes. Forwarded by `GatewayProvider` to consumers as\n * `resetGatewaysFromConfig`.\n * - `provided: true` — lets descendants detect a real provider.\n *\n * Note: the commented-out `SimpleXyoClient` at the top is intentionally\n * disabled pending a type unification between `XyoGateway` and\n * `XyoGatewayRunner`.\n */\nexport const InPageGatewaysProvider: React.FC<InPageGatewaysProviderProps> = ({ signerTransport, children }) => {\n const [gateways, setGateways] = useState<Partial<Record<GatewayName, ContextGatewayType>>>({})\n const [errors, setErrors] = useState<Partial<Record<GatewayName, Error>>>({})\n const [previousSignerTransport, setPreviousSignerTransport] = useState<RpcTransport<XyoSignerRpcSchemas> | undefined>(signerTransport)\n\n // This can come back once we homogenize the type for XyoGateway.\n // Right now, SimpleXyoClient takes XyoGatewayRunners but ideally it would take XyoGateway.\n // const clientInPage = useMemo(() => new SimpleXyoClient(gateways, {}), [gateways])\n\n const clearAll = useCallback(() => {\n setGateways({})\n setErrors({})\n }, [])\n\n if (previousSignerTransport !== signerTransport) {\n clearAll()\n setPreviousSignerTransport(signerTransport)\n }\n\n useEffect(() => {\n let cancelled = false\n\n const buildAll = async () => {\n const results = await Promise.allSettled(\n DefaultNetworks.map(async (network) => {\n const gateway = await buildGateway(network.id, signerTransport)\n return { id: network.id, gateway }\n }),\n )\n\n if (cancelled) return\n\n const nextGateways: Partial<Record<GatewayName, ContextGatewayType>> = {}\n const nextErrors: Partial<Record<GatewayName, Error>> = {}\n\n for (const [index, result] of results.entries()) {\n const networkId = DefaultNetworks[index].id as GatewayName\n if (result.status === 'fulfilled') {\n nextGateways[networkId] = result.value.gateway\n } else {\n nextErrors[networkId] = result.reason instanceof Error ? result.reason : new Error(String(result.reason))\n }\n }\n\n startTransition(() => {\n setGateways(nextGateways)\n setErrors(nextErrors)\n })\n }\n\n void buildAll()\n return () => {\n cancelled = true\n }\n }, [signerTransport])\n\n const value = useMemo(() => {\n const value: InPageGatewaysState = {\n clearAll,\n errors,\n gateways,\n provided: true,\n }\n return value\n }, [clearAll, errors, gateways])\n\n return <InPageGatewaysContext value={value}>{children}</InPageGatewaysContext>\n}\n","import { assertEx, isDefined } from '@xylabs/sdk-js'\nimport type {\n GatewayName,\n RemoteConfig, RpcTransport, SimpleXyoGateway,\n XyoSignerRpcSchemas,\n} from '@xyo-network/xl1-sdk'\nimport {\n basicRemoteRunnerLocator,\n basicRemoteViewerLocator,\n DefaultNetworks, NetworkDataLakeUrls, XyoGatewayMoniker,\n} from '@xyo-network/xl1-sdk'\n\nexport const buildGateway = async (gatewayName: GatewayName, signerTransport?: RpcTransport<XyoSignerRpcSchemas>) => {\n const network = DefaultNetworks.find(network => network.id === gatewayName)\n const resolvedNetwork = assertEx(network, () => `No network found for id ${gatewayName}`)\n\n const remoteConfig: RemoteConfig = {\n rpc: {\n protocol: 'http',\n url: `${resolvedNetwork.url}/rpc`,\n },\n }\n\n const dataLakeEndpoint = NetworkDataLakeUrls[gatewayName]\n\n const locator = isDefined(signerTransport)\n ? await basicRemoteRunnerLocator(gatewayName, remoteConfig, signerTransport, dataLakeEndpoint)\n : await basicRemoteViewerLocator(gatewayName, remoteConfig, dataLakeEndpoint)\n\n return await locator.getInstance<SimpleXyoGateway>(XyoGatewayMoniker)\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { InPageGatewaysContext } from './InPageGatewaysContext.ts'\nimport type { InPageGatewaysStateFields } from './InPageGatewaysState.ts'\n\n/**\n * Reads the `InPageGatewaysContext` map of per-network in-page gateways.\n * Intended for internal use by `GatewayProvider` — application code\n * should prefer `useProvidedGateway`, which returns a single resolved\n * gateway regardless of source.\n *\n * @param required - When `true` (default), throws if no\n * `InPageGatewaysProvider` is mounted above.\n */\nexport const useProvidedInPageGateways = (required = true) => useContextEx<InPageGatewaysStateFields>(InPageGatewaysContext, 'InPageGateways', required)\n","import { ErrorRender } from '@xylabs/react-error'\nimport { isDefinedNotNull, isNull } from '@xylabs/sdk-js'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\nimport { useProvidedInPageGateways } from '../in-page/index.ts'\n\n/**\n * Publishes the shared `GatewayContext` backed by two sources: the\n * injected XL1 Wallet extension *and* the in-page gateways built by\n * `InPageGatewaysProvider`. Use this provider when the host app can\n * function without a wallet (falling back to the in-page client) but\n * should still prefer the wallet when it is present.\n *\n * Required ancestry: an `InPageGatewaysProvider` must be mounted above\n * this provider — `useProvidedInPageGateways(true)` throws if missing.\n * If you only need a wallet-backed gateway, use `WalletGatewayProvider`\n * instead.\n *\n * Source precedence for `defaultGateway`:\n * - Wallet present and resolved (`XyoGatewayRunner`) → wallet wins; the\n * in-page gateway is still exposed via `gateways.inPageGateway` for\n * the rare consumer that needs to target it specifically.\n * - Wallet definitively absent (`null`) → fall back to the in-page\n * gateway matching `gatewayName`.\n * - Wallet still resolving (`undefined`) → leave `defaultGateway`\n * `undefined` so consumers render a loading state rather than\n * committing to the in-page fallback prematurely.\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — resolved per the precedence above. Three-state:\n * `undefined` = loading, `null` is not produced by this provider\n * (wallet-null collapses to `gatewayFromConfig`), `XyoGateway` = ready.\n * - `gateways.walletGateway` — raw wallet result (tri-state).\n * - `gateways.inPageGateway` — raw in-page result for the requested\n * `gatewayName`, or `undefined` if no `gatewayName` was passed.\n * - `error` — first non-null of wallet error, then in-page build error\n * for this `gatewayName`. Also rendered inline via `ErrorRender` above\n * `children` so mount-time failures surface even when no consumer\n * reads `error`.\n * - `resetGatewaysFromConfig` — forwards `clearAll` from\n * `InPageGatewaysProvider`, letting consumers force a rebuild of the\n * in-page gateways (e.g. after a network or endpoint change).\n * - `provided: true` — lets descendants detect a real provider in the\n * tree.\n *\n * `defaultGateway`, `gateways`, and the context `value` are memoized so\n * consumers only re-render when wallet or in-page sources actually\n * change identity.\n */\nexport const GatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const {\n gateways: allGateways,\n errors: allGatewayErrors,\n clearAll,\n } = useProvidedInPageGateways(true)\n\n const gatewayFromConfig = gatewayName ? allGateways[gatewayName] : undefined\n const gatewayFromConfigError = gatewayName ? allGatewayErrors[gatewayName] : undefined\n\n const { defaultGateway, gateways } = useMemo(() => {\n if (isNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromConfig,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: null,\n },\n }\n } else if (isDefinedNotNull(gatewayFromWallet)) {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: gatewayFromConfig,\n walletGateway: gatewayFromWallet,\n },\n }\n }\n return {\n defaultGateway: undefined,\n gateways: {\n inPageGateway: undefined,\n walletGateway: undefined,\n },\n }\n }, [gatewayFromConfig, gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError ?? gatewayFromConfigError,\n gateways,\n provided: true,\n resetGatewaysFromConfig: clearAll,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gatewayFromConfigError,\n gateways,\n clearAll,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromConfigError} />\n {children}\n </GatewayContext>\n )\n}\n","import { ErrorRender } from '@xylabs/react-error'\nimport React, { useMemo } from 'react'\n\nimport { useGatewayFromWallet } from '../../hooks/index.ts'\nimport { GatewayContext } from '../GatewayContext.ts'\nimport type { GatewayProviderProps } from '../GatewayProviderProps.ts'\nimport type { GatewayContextState } from '../GatewayProviderState.ts'\n\n/**\n * Publishes a `GatewayContext` backed exclusively by the injected XL1 Wallet\n * extension (i.e. `globalThis.xyo`). This is the provider to use when the\n * host app is a browser UI that expects the user to bring their own wallet,\n * rather than running an in-page gateway.\n *\n * The requested `gatewayName` is forwarded to `useGatewayFromWallet`, whose\n * returned gateway uses a three-state contract (`undefined` = still\n * resolving, `null` = wallet confirmed absent / timed out,\n * `XyoGatewayRunner` = ready). That tri-state is passed through to\n * consumers unchanged as `defaultGateway` / `gateways.walletGateway`, so\n * downstream hooks can distinguish \"loading\" from \"missing\".\n *\n * The published `GatewayContextState` shape:\n * - `defaultGateway` — the wallet gateway, used when consumers don't\n * specify which gateway they want.\n * - `gateways.walletGateway` — same instance as `defaultGateway`.\n * - `gateways.inPageGateway` — always `null` here; this provider does not\n * stand up an in-page client. Pair with a different provider if you need\n * both.\n * - `error` — surfaced from `useGatewayFromWallet` (detection / timeout /\n * wallet errors). Also rendered inline via `ErrorRender` above `children`\n * so mount-time failures are visible even if no consumer reads `error`.\n * - `provided: true` — lets descendants detect that a real provider (not\n * the default empty context) is in the tree.\n *\n * The `defaultGateway`, `gateways`, and context `value` are memoized so\n * consumers only re-render when the underlying wallet gateway reference or\n * error actually changes.\n */\nexport const WalletGatewayProvider: React.FC<GatewayProviderProps> = ({ gatewayName, children }) => {\n const {\n gateway: gatewayFromWallet,\n error: gatewayFromWalletError,\n } = useGatewayFromWallet(gatewayName)\n\n const { defaultGateway, gateways } = useMemo(() => {\n return {\n defaultGateway: gatewayFromWallet,\n gateways: {\n inPageGateway: null,\n walletGateway: gatewayFromWallet,\n },\n }\n }, [gatewayFromWallet])\n\n const value = useMemo(() => {\n const value: GatewayContextState = {\n defaultGateway,\n error: gatewayFromWalletError,\n gateways,\n provided: true,\n }\n return value\n }, [\n defaultGateway,\n gatewayFromWalletError,\n gateways,\n ])\n\n return (\n <GatewayContext value={value}>\n <ErrorRender error={gatewayFromWalletError} />\n {children}\n </GatewayContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { GatewayContext } from './GatewayContext.ts'\nimport type { GatewayStateFields } from './GatewayProviderState.ts'\n\n/**\n * The sole consumer entry point for gateway state. Reads the nearest\n * `GatewayContext` in the tree, regardless of which provider published\n * it — this is the decoupling that lets a component work unchanged when\n * the surrounding app swaps `WalletGatewayProvider` for\n * `GatewayProvider` (or a test double).\n *\n * @param required - When `true` (default), throws if no gateway provider\n * is mounted above — use this when the component is meaningless\n * without a gateway. When `false`, returns default state (all fields\n * undefined) so the component can render a graceful fallback.\n */\nexport const useProvidedGateway = (required = true) => useContextEx<GatewayStateFields>(GatewayContext, 'Gateway', required)\n","import { isDefinedNotNull, isObject } from '@xylabs/sdk-js'\nimport type {\n NetworkBootstrap, NetworkId, XyoClient,\n} from '@xyo-network/xl1-sdk'\n\nexport interface XyoGlobal extends UninitializedXyoGlobal {\n client: XyoClient\n errors: Error[]\n}\n\n/**\n * Describes the initial state of the global XYO object before initialization\n * (i.e. before the client is initialized)\n */\nexport interface UninitializedXyoGlobal {\n connections: Record<NetworkId, NetworkBootstrap>\n sessionId: () => string\n walletExtensionId: () => string\n}\n\nexport const isXyoGlobal = (obj: unknown): obj is XyoGlobal => {\n return (\n isDefinedNotNull(obj)\n && isObject(obj)\n && 'client' in obj\n && 'connections' in obj\n && 'errors' in obj\n && 'sessionId' in obj\n && 'walletExtensionId' in obj\n )\n}\n\nexport const isUninitializedXyoGlobal = (obj: unknown): obj is UninitializedXyoGlobal => {\n return (\n isDefinedNotNull(obj)\n && isObject(obj)\n && 'connections' in obj\n && 'sessionId' in obj\n && 'walletExtensionId' in obj\n && !('client' in obj)\n && ('errors' in obj)\n && Array.isArray((obj).errors)\n && obj.errors.length === 0\n )\n}\n","import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/sdk-js'\nimport type {\n ComponentType, ReactNode, SVGAttributes,\n} from 'react'\nimport React, { useMemo } from 'react'\n\nconst isComponentType = (value: unknown): value is ComponentType<SVGAttributes<SVGElement>> =>\n typeof value === 'function'\n || (typeof value === 'object' && value !== null && ('$$typeof' in value || 'render' in value))\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>> | ReactNode\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return isComponentType(IconComponent)\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : IconComponent ?? null\n }, [IconComponent, theme])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n <span>{resolvedIconComponent}</span>\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport { ellipsize, isAddress } from '@xylabs/sdk-js'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n const formattedValue = (value: string | undefined): string | undefined => {\n if (isAddress(value)) {\n return ellipsize(value, 8)\n }\n return value\n }\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map((value, index) => (\n <Typography\n title={value}\n fontFamily=\"monospace\"\n variant=\"body2\"\n // Use matching label as key since values might be the same\n key={labels[index]}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {formattedValue(value)}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { Alert, Stack } from '@mui/material'\nimport type { Decorator } from '@storybook/react-vite'\nimport React from 'react'\n\nimport { isXyoGlobal } from '../../model/index.ts'\n\nconst inIframe = globalThis.self !== window.top\n\n/**\n * Storybook decorator that displays warning banners when:\n * - the story is rendered inside an iframe (prompt user to open in a standalone tab), or\n * - the XYO wallet extension is not detected (prompt user to install it).\n *\n * Stories that require direct browser-extension access should use this decorator.\n */\nexport const IframeWalletWarningDecorator: Decorator = (Story, args) => {\n const hasXyoGlobal = isXyoGlobal((globalThis as Record<string, unknown>).xyo)\n return (\n <Stack gap={2}>\n {inIframe\n ? (\n <Alert severity=\"warning\">\n This story is running in an iframe. Please run it in a standalone browser window to test the wallet extension.\n </Alert>\n )\n : null}\n {hasXyoGlobal\n ? null\n : (\n <Alert severity=\"warning\">\n No wallet extension found. Please install the Xyo Wallet Chrome Extension.\n </Alert>\n )}\n <Story {...args} />\n </Stack>\n )\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAO;AAAA,EAAS;AAAA,OACX;AACP,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AAOlC,SACE,KADF;AAJG,IAAM,mBAAkD,CAAC,EAAE,QAAQ,MAAM;AAC9E,QAAM,mBAAmB,GAAG,kBAAkB,WAAW,OAAO,GAAG,cAAc,CAAC,CAAC;AAEnF,SACE,qBAAC,SAAM,WAAU,OAAM,YAAW,UAAS,SAAS,GAClD;AAAA,wBAAC,yBAAsB,SAAkB,MAAM,IAAI;AAAA,IACnD,oBAAC,WAAQ,OAAO,SACd,8BAAC,cAAW,OAAM,iBAAgB,SAAQ,WAAU,YAAW,aAAa,4BAAiB,GAC/F;AAAA,KACF;AAEJ;;;ACjBA;AAAA,EACE;AAAA,EAAO;AAAA,EAAY;AAAA,EAAQ,SAAAA;AAAA,EAC3B,cAAAC;AAAA,OACK;AAEP,SAAS,gBAAgB;AACzB,SAAS,mBAAmB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S,WAAU,wFAE1B;AAAA,IAEN,gBAAAH,KAAC,SAAO,GAAG,MAAM;AAAA,KACnB;AAEJ;","names":["Stack","Typography","isDefined","isUndefined","useEffect","useState","isUndefined","isUndefined","isDefined","isDefined","useState","address","jsx","jsxs","Typography","useEffect","isDefined","Stack","isUndefined","createContextEx","DefaultNetworks","useCallback","useEffect","useState","assertEx","isDefined","network","jsx","useState","useCallback","useEffect","DefaultNetworks","value","ErrorRender","isDefinedNotNull","isNull","useMemo","jsx","jsxs","useMemo","isNull","isDefinedNotNull","value","ErrorRender","ErrorRender","useMemo","jsx","jsxs","useMemo","value","ErrorRender","useContextEx","useContextEx","isDefinedNotNull","jsx","Stack","styled","Tooltip","Typography","useTheme","isDefined","useMemo","jsx","jsxs","Stack","Typography","useTheme","jsx","jsxs","Alert","Stack","jsx","jsxs","Stack","Alert"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-react-client-sdk",
|
|
4
|
-
"version": "1.28.
|
|
4
|
+
"version": "1.28.5",
|
|
5
5
|
"description": "XL1 React Client/Wallet SDK",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
"README.md"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@xyo-network/xl1-
|
|
67
|
-
"@xyo-network/xl1-
|
|
66
|
+
"@xyo-network/xl1-blockies": "~1.28.5",
|
|
67
|
+
"@xyo-network/xl1-sdk": "~1.28.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@bitauth/libauth": "~3.0.0",
|
|
71
71
|
"@metamask/json-rpc-engine": "^10.3.0",
|
|
72
72
|
"@metamask/providers": "^22.1.1",
|
|
73
73
|
"@metamask/utils": "^11.11.0",
|
|
74
|
-
"@mui/icons-material": "^7.3.
|
|
75
|
-
"@mui/material": "^7.3.
|
|
74
|
+
"@mui/icons-material": "^7.3.11",
|
|
75
|
+
"@mui/material": "^7.3.11",
|
|
76
76
|
"@opentelemetry/api": "^1.9.1",
|
|
77
77
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
78
78
|
"@react-spring/web": "~10.0.3",
|
|
@@ -80,39 +80,39 @@
|
|
|
80
80
|
"@scure/bip39": "~2.2.0",
|
|
81
81
|
"@storybook/react-vite": "^10.3.6",
|
|
82
82
|
"@types/react": "^19.2.14",
|
|
83
|
-
"@xylabs/fetch": "^5.1.
|
|
84
|
-
"@xylabs/geo": "^5.1.
|
|
85
|
-
"@xylabs/pixel": "~5.1.
|
|
86
|
-
"@xylabs/react-button": "~7.2.
|
|
87
|
-
"@xylabs/react-error": "~7.2.
|
|
88
|
-
"@xylabs/react-promise": "^7.2.
|
|
89
|
-
"@xylabs/react-shared": "~7.2.
|
|
90
|
-
"@xylabs/react-theme": "~7.2.
|
|
91
|
-
"@xylabs/sdk-js": "^5.1.
|
|
92
|
-
"@xylabs/threads": "~5.1.
|
|
93
|
-
"@xylabs/toolchain": "~7.13.
|
|
94
|
-
"@xylabs/tsconfig": "~7.13.
|
|
95
|
-
"@xylabs/tsconfig-dom": "~7.13.
|
|
96
|
-
"@xylabs/tsconfig-react": "~7.13.
|
|
97
|
-
"@xyo-network/account": "~5.6.
|
|
98
|
-
"@xyo-network/account-model": "~5.6.
|
|
99
|
-
"@xyo-network/api": "~5.6.
|
|
100
|
-
"@xyo-network/api-models": "~5.6.
|
|
101
|
-
"@xyo-network/boundwitness-builder": "~5.6.
|
|
102
|
-
"@xyo-network/boundwitness-model": "~5.6.
|
|
103
|
-
"@xyo-network/boundwitness-wrapper": "~5.6.
|
|
104
|
-
"@xyo-network/config-payload-plugin": "~5.6.
|
|
105
|
-
"@xyo-network/huri": "~5.6.
|
|
106
|
-
"@xyo-network/manifest-model": "~5.6.
|
|
107
|
-
"@xyo-network/payload-builder": "~5.6.
|
|
108
|
-
"@xyo-network/payload-model": "~5.6.
|
|
109
|
-
"@xyo-network/payload-plugin": "~5.6.
|
|
110
|
-
"@xyo-network/payload-wrapper": "~5.6.
|
|
111
|
-
"@xyo-network/query-payload-plugin": "~5.6.
|
|
112
|
-
"@xyo-network/sdk-js": "^5.6.
|
|
113
|
-
"@xyo-network/sdk-protocol-js": "~5.6.
|
|
114
|
-
"@xyo-network/wallet": "~5.6.
|
|
115
|
-
"@xyo-network/wallet-model": "^5.6.
|
|
83
|
+
"@xylabs/fetch": "^5.1.2",
|
|
84
|
+
"@xylabs/geo": "^5.1.2",
|
|
85
|
+
"@xylabs/pixel": "~5.1.2",
|
|
86
|
+
"@xylabs/react-button": "~7.2.5",
|
|
87
|
+
"@xylabs/react-error": "~7.2.5",
|
|
88
|
+
"@xylabs/react-promise": "^7.2.5",
|
|
89
|
+
"@xylabs/react-shared": "~7.2.5",
|
|
90
|
+
"@xylabs/react-theme": "~7.2.5",
|
|
91
|
+
"@xylabs/sdk-js": "^5.1.2",
|
|
92
|
+
"@xylabs/threads": "~5.1.2",
|
|
93
|
+
"@xylabs/toolchain": "~7.13.15",
|
|
94
|
+
"@xylabs/tsconfig": "~7.13.15",
|
|
95
|
+
"@xylabs/tsconfig-dom": "~7.13.15",
|
|
96
|
+
"@xylabs/tsconfig-react": "~7.13.15",
|
|
97
|
+
"@xyo-network/account": "~5.6.2",
|
|
98
|
+
"@xyo-network/account-model": "~5.6.3",
|
|
99
|
+
"@xyo-network/api": "~5.6.2",
|
|
100
|
+
"@xyo-network/api-models": "~5.6.3",
|
|
101
|
+
"@xyo-network/boundwitness-builder": "~5.6.2",
|
|
102
|
+
"@xyo-network/boundwitness-model": "~5.6.3",
|
|
103
|
+
"@xyo-network/boundwitness-wrapper": "~5.6.2",
|
|
104
|
+
"@xyo-network/config-payload-plugin": "~5.6.3",
|
|
105
|
+
"@xyo-network/huri": "~5.6.2",
|
|
106
|
+
"@xyo-network/manifest-model": "~5.6.3",
|
|
107
|
+
"@xyo-network/payload-builder": "~5.6.2",
|
|
108
|
+
"@xyo-network/payload-model": "~5.6.3",
|
|
109
|
+
"@xyo-network/payload-plugin": "~5.6.3",
|
|
110
|
+
"@xyo-network/payload-wrapper": "~5.6.2",
|
|
111
|
+
"@xyo-network/query-payload-plugin": "~5.6.3",
|
|
112
|
+
"@xyo-network/sdk-js": "^5.6.4",
|
|
113
|
+
"@xyo-network/sdk-protocol-js": "~5.6.3",
|
|
114
|
+
"@xyo-network/wallet": "~5.6.2",
|
|
115
|
+
"@xyo-network/wallet-model": "^5.6.3",
|
|
116
116
|
"ajv": "^8.20.0",
|
|
117
117
|
"async-mutex": "^0.5.0",
|
|
118
118
|
"bn.js": "^5.2.3",
|