@xyo-network/react-chain-client 2.0.17 → 3.0.0
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/components/connected/ConnectAccountsStack.d.ts +5 -53
- package/dist/browser/components/connected/ConnectAccountsStack.d.ts.map +1 -1
- package/dist/browser/components/connected/account/Connected.d.ts +4 -5
- package/dist/browser/components/connected/account/Connected.d.ts.map +1 -1
- package/dist/browser/components/connected/hooks/useConnectAccount.d.ts +4 -17
- package/dist/browser/components/connected/hooks/useConnectAccount.d.ts.map +1 -1
- package/dist/browser/context/GatewayContext.d.ts +4 -27
- package/dist/browser/context/GatewayContext.d.ts.map +1 -1
- package/dist/browser/context/GatewayProviderProps.d.ts +4 -6
- package/dist/browser/context/GatewayProviderProps.d.ts.map +1 -1
- package/dist/browser/context/GatewayProviderState.d.ts +4 -35
- package/dist/browser/context/GatewayProviderState.d.ts.map +1 -1
- package/dist/browser/context/in-page/InPageGatewaysContext.d.ts +4 -15
- package/dist/browser/context/in-page/InPageGatewaysContext.d.ts.map +1 -1
- package/dist/browser/context/in-page/InPageGatewaysState.d.ts +4 -23
- package/dist/browser/context/in-page/InPageGatewaysState.d.ts.map +1 -1
- package/dist/browser/context/in-page/Provider.d.ts +5 -62
- package/dist/browser/context/in-page/Provider.d.ts.map +1 -1
- package/dist/browser/context/in-page/useProvidedInPageGateways.d.ts +4 -13
- package/dist/browser/context/in-page/useProvidedInPageGateways.d.ts.map +1 -1
- package/dist/browser/context/providers/GatewayProvider.d.ts +4 -46
- package/dist/browser/context/providers/GatewayProvider.d.ts.map +1 -1
- package/dist/browser/context/providers/WalletGatewayProvider.d.ts +4 -33
- package/dist/browser/context/providers/WalletGatewayProvider.d.ts.map +1 -1
- package/dist/browser/context/useProvidedGateway.d.ts +4 -16
- package/dist/browser/context/useProvidedGateway.d.ts.map +1 -1
- package/dist/browser/hooks/client/helpers/findCaveat.d.ts +4 -3
- package/dist/browser/hooks/client/helpers/findCaveat.d.ts.map +1 -1
- package/dist/browser/hooks/client/permissions/usePermissions.d.ts +4 -7
- package/dist/browser/hooks/client/permissions/usePermissions.d.ts.map +1 -1
- package/dist/browser/hooks/client/story/mockWalletDecorator.d.ts.map +1 -1
- package/dist/browser/hooks/client/useClientFromWallet.d.ts +4 -12
- package/dist/browser/hooks/client/useClientFromWallet.d.ts.map +1 -1
- package/dist/browser/hooks/client/useGatewayFromWallet.d.ts +4 -19
- package/dist/browser/hooks/client/useGatewayFromWallet.d.ts.map +1 -1
- package/dist/browser/hooks/helpers/getXyoClient.d.ts +4 -9
- package/dist/browser/hooks/helpers/getXyoClient.d.ts.map +1 -1
- package/dist/browser/index.mjs +23 -463
- package/dist/browser/index.mjs.map +4 -4
- package/dist/browser/types/ContextGatewayType.d.ts +4 -5
- package/dist/browser/types/ContextGatewayType.d.ts.map +1 -1
- package/dist/browser/types/GatewayFromWallet.d.ts +4 -8
- package/dist/browser/types/GatewayFromWallet.d.ts.map +1 -1
- package/package.json +28 -40
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import type { StackProps } from '@mui/material';
|
|
2
|
-
import type { Address } from '@xylabs/sdk-js';
|
|
3
|
-
import type { ComponentType, MouseEventHandler } from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
1
|
/**
|
|
6
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
7
5
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
account?: string;
|
|
11
|
-
}>;
|
|
12
|
-
ConnectComponent?: ComponentType<{
|
|
13
|
-
onClick?: MouseEventHandler<HTMLElement>;
|
|
14
|
-
}>;
|
|
15
|
-
NoWalletInstalledComponent?: ComponentType;
|
|
16
|
-
onAccountConnected?: (account: Address) => void;
|
|
17
|
-
onCancel?: () => void;
|
|
18
|
-
timeout?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Renders a horizontal stack that surfaces the current state of the user's
|
|
22
|
-
* connection to an XL1 wallet (e.g. the XL1 Chrome extension) and lets them
|
|
23
|
-
* kick off a connection.
|
|
24
|
-
*
|
|
25
|
-
* Connection state is derived from `useConnectAccount`, which wraps
|
|
26
|
-
* `useGatewayFromWallet` (wallet/gateway discovery with a configurable
|
|
27
|
-
* `timeout`) and `useAccountPermissions` (already-authorized addresses).
|
|
28
|
-
* The hook returns: `address` (resolved once the wallet exposes one),
|
|
29
|
-
* `connectSigner` (prompts the wallet for an address), `timedout` (the
|
|
30
|
-
* gateway never appeared within `timeout`), and `error` (the first of
|
|
31
|
-
* gateway, permissions, or signer-connect failures).
|
|
32
|
-
*
|
|
33
|
-
* The component renders exactly one of the following wallet states, plus
|
|
34
|
-
* an always-present error slot:
|
|
35
|
-
*
|
|
36
|
-
* - **Connected** — `address` is defined: renders `AccountComponent` for
|
|
37
|
-
* that address. Also fires `onAccountConnected(address)` once via effect.
|
|
38
|
-
* - **Disconnected, wallet available** — no `address` and not `timedout`:
|
|
39
|
-
* renders `ConnectComponent` as a "Connect" button that invokes
|
|
40
|
-
* `connectSigner()`. This covers both "wallet installed but no account
|
|
41
|
-
* authorized yet" and "gateway still resolving".
|
|
42
|
-
* - **Wallet missing / unreachable** — no `address` and `timedout` is true:
|
|
43
|
-
* renders `NoWalletInstalledComponent` (defaults to an Alert linking to
|
|
44
|
-
* the XL1 Wallet Chrome Web Store listing).
|
|
45
|
-
* - **Error** — any error from the hook is rendered via `ErrorRender`
|
|
46
|
-
* alongside the state above, and `onCancel()` is fired once via effect
|
|
47
|
-
* so the host UI can close/abort its connect flow.
|
|
48
|
-
*
|
|
49
|
-
* All three slot components (`AccountComponent`, `ConnectComponent`,
|
|
50
|
-
* `NoWalletInstalledComponent`) are injectable so consumers can restyle
|
|
51
|
-
* any state without forking this component.
|
|
52
|
-
*
|
|
53
|
-
* @deprecated Use {@link ConnectAccountsStack} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
54
|
-
*/
|
|
55
|
-
export declare const ConnectAccountsStack: React.FC<ConnectClientAccountsStackProps>;
|
|
6
|
+
export type { ConnectClientAccountsStackProps } from '@xyo-network/xl1-react-client-sdk/client';
|
|
7
|
+
export { ConnectAccountsStack } from '@xyo-network/xl1-react-client-sdk/client';
|
|
56
8
|
//# sourceMappingURL=ConnectAccountsStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectAccountsStack.d.ts","sourceRoot":"","sources":["../../../../src/components/connected/ConnectAccountsStack.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ConnectAccountsStack.d.ts","sourceRoot":"","sources":["../../../../src/components/connected/ConnectAccountsStack.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAA;AAC/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
/**
|
|
3
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
-
address: string;
|
|
7
|
-
}>;
|
|
6
|
+
export { ConnectedAccount } from '@xyo-network/xl1-react-client-sdk/client';
|
|
8
7
|
//# sourceMappingURL=Connected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connected.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/account/Connected.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Connected.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/account/Connected.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import type { GatewayName } from '@xyo-network/xl1-sdk';
|
|
2
1
|
/**
|
|
3
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
-
address: (Lowercase<string> & {
|
|
7
|
-
readonly __hex: true;
|
|
8
|
-
} & {
|
|
9
|
-
readonly __address: true;
|
|
10
|
-
}) | undefined;
|
|
11
|
-
connectSigner: () => Promise<import("@xyo-network/address").XyoQuantAddress | (Lowercase<string> & {
|
|
12
|
-
readonly __hex: true;
|
|
13
|
-
} & {
|
|
14
|
-
readonly __address: true;
|
|
15
|
-
}) | undefined>;
|
|
16
|
-
error: Error | undefined;
|
|
17
|
-
gateway: import("@xyo-network/xl1-sdk").XyoGatewayRunner | null | undefined;
|
|
18
|
-
timedout: boolean;
|
|
19
|
-
};
|
|
6
|
+
export { useConnectAccount } from '@xyo-network/xl1-react-client-sdk/client';
|
|
20
7
|
//# sourceMappingURL=useConnectAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectAccount.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/hooks/useConnectAccount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useConnectAccount.d.ts","sourceRoot":"","sources":["../../../../../src/components/connected/hooks/useConnectAccount.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* via `useProvidedGateway`. Consumers never import a specific provider —
|
|
6
|
-
* they just require that *some* provider is mounted above them in the
|
|
7
|
-
* tree.
|
|
8
|
-
*
|
|
9
|
-
* Current publishers:
|
|
10
|
-
* - `WalletGatewayProvider` (this package) — sources gateways from the
|
|
11
|
-
* injected XL1 wallet extension.
|
|
12
|
-
* - `GatewayProvider` in `@xyo-network/react-chain-provider` — sources
|
|
13
|
-
* gateways built in-page against RPC endpoints, falling back to the
|
|
14
|
-
* wallet when available.
|
|
15
|
-
*
|
|
16
|
-
* To add a new source (e.g. a mock provider for tests, an iframe-bridged
|
|
17
|
-
* provider, a server-rendered provider), publish a `GatewayContextState`
|
|
18
|
-
* to this same context — do not create a parallel context, or consumers
|
|
19
|
-
* will silently stop receiving updates.
|
|
20
|
-
*
|
|
21
|
-
* @deprecated Use {@link GatewayContext} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
22
5
|
*/
|
|
23
|
-
export
|
|
24
|
-
provided: true;
|
|
25
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<import("./GatewayProviderState.ts").GatewayStateFields>, never> & {
|
|
26
|
-
provided: false;
|
|
27
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<import("./GatewayProviderState.ts").GatewayStateFields>, never> & {
|
|
28
|
-
provided: false;
|
|
29
|
-
})>;
|
|
6
|
+
export { GatewayContext } from '@xyo-network/xl1-react-client-sdk/client';
|
|
30
7
|
//# sourceMappingURL=GatewayContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayContext.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GatewayContext.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { GatewayName } from '@xyo-network/xl1-sdk';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
1
|
/**
|
|
4
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
gatewayName?: GatewayName;
|
|
8
|
-
}
|
|
6
|
+
export type { GatewayProviderProps } from '@xyo-network/xl1-react-client-sdk/client';
|
|
9
7
|
//# sourceMappingURL=GatewayProviderProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayProviderProps.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayProviderProps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GatewayProviderProps.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayProviderProps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
import type { ContextExState } from '@xylabs/react-shared';
|
|
2
|
-
import type { ContextGatewayType } from '../types/index.ts';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Fields use a three-state contract:
|
|
9
|
-
* - `undefined` — resolution is still in progress; show a loading state.
|
|
10
|
-
* - `null` — resolution completed and the gateway is definitively absent
|
|
11
|
-
* (e.g. no wallet installed, RPC unreachable); safe to show fallback UI.
|
|
12
|
-
* - `XyoGateway` — resolved and ready to use.
|
|
13
|
-
*
|
|
14
|
-
* `defaultGateway` is what most consumers want — the provider picks the
|
|
15
|
-
* best available source. `gateways` exposes the individual sources for
|
|
16
|
-
* the rare consumer that needs to differentiate (e.g. a debug panel, or
|
|
17
|
-
* a flow that must sign with the wallet specifically).
|
|
18
|
-
*
|
|
19
|
-
* `resetGatewaysFromConfig` is optional because not every provider has
|
|
20
|
-
* rebuildable in-page gateways (the wallet-only provider, for instance,
|
|
21
|
-
* has nothing to reset).
|
|
22
|
-
*
|
|
23
|
-
* @deprecated Use {@link GatewayStateFields} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
24
5
|
*/
|
|
25
|
-
export
|
|
26
|
-
defaultGateway: ContextGatewayType | undefined | null;
|
|
27
|
-
error: Error | null | undefined;
|
|
28
|
-
gateways: {
|
|
29
|
-
inPageGateway: ContextGatewayType | undefined | null;
|
|
30
|
-
walletGateway: ContextGatewayType | undefined | null;
|
|
31
|
-
};
|
|
32
|
-
resetGatewaysFromConfig?: () => void;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use {@link GatewayContextState} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
36
|
-
*/
|
|
37
|
-
export type GatewayContextState = ContextExState<GatewayStateFields>;
|
|
6
|
+
export type { GatewayContextState, GatewayStateFields } from '@xyo-network/xl1-react-client-sdk/client';
|
|
38
7
|
//# sourceMappingURL=GatewayProviderState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayProviderState.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayProviderState.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GatewayProviderState.d.ts","sourceRoot":"","sources":["../../../src/context/GatewayProviderState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `GatewayContext`) instead. This context only exists to decouple the
|
|
6
|
-
* single in-page *builder* from the many single-gateway *adapters* that
|
|
7
|
-
* sit between it and the shared gateway surface.
|
|
8
|
-
*
|
|
9
|
-
* @deprecated Use {@link InPageGatewaysContext} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
10
5
|
*/
|
|
11
|
-
export
|
|
12
|
-
provided: true;
|
|
13
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<import("./InPageGatewaysState.ts").InPageGatewaysStateFields>, never> & {
|
|
14
|
-
provided: false;
|
|
15
|
-
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<import("./InPageGatewaysState.ts").InPageGatewaysStateFields>, never> & {
|
|
16
|
-
provided: false;
|
|
17
|
-
})>;
|
|
6
|
+
export { InPageGatewaysContext } from '@xyo-network/xl1-react-client-sdk/client';
|
|
18
7
|
//# sourceMappingURL=InPageGatewaysContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InPageGatewaysContext.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/InPageGatewaysContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InPageGatewaysContext.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/InPageGatewaysContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
import type { ContextExState } from '@xylabs/react-shared';
|
|
2
|
-
import type { GatewayName } from '@xyo-network/xl1-sdk';
|
|
3
|
-
import type { ContextGatewayType } from '../../types/index.ts';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* computes every network's gateway once, and individual `GatewayProvider`
|
|
9
|
-
* instances deeper in the tree pick out the one they need.
|
|
10
|
-
*
|
|
11
|
-
* This is not the cross-publisher surface area; consumers that want "a
|
|
12
|
-
* gateway" should read the shared `GatewayContext` via
|
|
13
|
-
* `useProvidedGateway`, not this map directly.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated Use {@link InPageGatewaysStateFields} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
16
5
|
*/
|
|
17
|
-
export
|
|
18
|
-
clearAll: () => void;
|
|
19
|
-
errors: Partial<Record<GatewayName, Error>>;
|
|
20
|
-
gateways: Partial<Record<GatewayName, ContextGatewayType>>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use {@link InPageGatewaysState} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
24
|
-
*/
|
|
25
|
-
export type InPageGatewaysState = ContextExState<InPageGatewaysStateFields>;
|
|
6
|
+
export type { InPageGatewaysState, InPageGatewaysStateFields } from '@xyo-network/xl1-react-client-sdk/client';
|
|
26
7
|
//# sourceMappingURL=InPageGatewaysState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InPageGatewaysState.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/InPageGatewaysState.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"InPageGatewaysState.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/InPageGatewaysState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
import type { RpcTransport, XyoSignerRpcSchemas } from '@xyo-network/xl1-sdk';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import React from 'react';
|
|
4
1
|
/**
|
|
5
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Publishes a keyed map of in-page gateways — one per network in
|
|
12
|
-
* `DefaultNetworks` — under the narrow `InPageGatewaysContext`.
|
|
13
|
-
*
|
|
14
|
-
* This provider is deliberately *not* a direct publisher of the shared
|
|
15
|
-
* `GatewayContext` that `useProvidedGateway` reads. Its consumer is the
|
|
16
|
-
* wrapping `GatewayProvider` in this same package, which picks the
|
|
17
|
-
* `gatewayName` the consumer asked for out of this map, adapts it into
|
|
18
|
-
* the single-gateway `GatewayContextState` shape, and then publishes *that*
|
|
19
|
-
* to the shared context. Splitting the work this way lets one
|
|
20
|
-
* `InPageGatewaysProvider` near the root build every network's gateway
|
|
21
|
-
* once, while many `GatewayProvider` instances deeper in the tree each
|
|
22
|
-
* expose whichever gateway their subtree cares about.
|
|
23
|
-
*
|
|
24
|
-
* Unlike `WalletGatewayProvider`, gateways here are constructed directly
|
|
25
|
-
* in the page (via `buildGateway`) against each network's RPC endpoint
|
|
26
|
-
* — no browser wallet extension is required. `signerTransport` switches
|
|
27
|
-
* between viewer (read-only) and runner (can sign/send) locators; supply
|
|
28
|
-
* it only when the app needs to sign.
|
|
29
|
-
*
|
|
30
|
-
* Behavior:
|
|
31
|
-
* - On mount, and whenever `signerTransport` changes, `buildGateway` is
|
|
32
|
-
* called in parallel for every network in `DefaultNetworks` via
|
|
33
|
-
* `Promise.allSettled`. Networks that resolve populate `gateways[id]`;
|
|
34
|
-
* networks that reject populate `errors[id]`. One failed network does
|
|
35
|
-
* not block the others.
|
|
36
|
-
* - If `signerTransport` is provided, gateways are built with a remote
|
|
37
|
-
* *runner* locator, otherwise with a remote *viewer* locator.
|
|
38
|
-
* - When `signerTransport` changes identity mid-life, the provider clears
|
|
39
|
-
* all cached gateways and errors synchronously during render (via
|
|
40
|
-
* `previousSignerTransport` state) so consumers never see gateways
|
|
41
|
-
* bound to the previous transport, then rebuilds in the effect.
|
|
42
|
-
* - State updates from the rebuild are wrapped in `startTransition` so a
|
|
43
|
-
* slow network doesn't stall higher-priority UI updates.
|
|
44
|
-
* - A `cancelled` flag in the effect's cleanup discards results from a
|
|
45
|
-
* prior `signerTransport` once a new one is in flight.
|
|
46
|
-
*
|
|
47
|
-
* Published `InPageGatewaysState` (narrower than `GatewayContextState` —
|
|
48
|
-
* this is an internal handoff shape, not the cross-publisher surface):
|
|
49
|
-
* - `gateways` — `Partial<Record<GatewayName, ContextGatewayType>>`. Keys
|
|
50
|
-
* are only present for networks that built successfully.
|
|
51
|
-
* - `errors` — `Partial<Record<GatewayName, Error>>`. Per-network build
|
|
52
|
-
* failures, keyed by `GatewayName`.
|
|
53
|
-
* - `clearAll()` — manually empties both maps. Also invoked internally on
|
|
54
|
-
* transport changes. Forwarded by `GatewayProvider` to consumers as
|
|
55
|
-
* `resetGatewaysFromConfig`.
|
|
56
|
-
* - `provided: true` — lets descendants detect a real provider.
|
|
57
|
-
*
|
|
58
|
-
* Note: the commented-out `SimpleXyoClient` at the top is intentionally
|
|
59
|
-
* disabled pending a type unification between `XyoGateway` and
|
|
60
|
-
* `XyoGatewayRunner`.
|
|
61
|
-
*
|
|
62
|
-
* @deprecated Use {@link InPageGatewaysProvider} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
63
|
-
*/
|
|
64
|
-
export declare const InPageGatewaysProvider: React.FC<InPageGatewaysProviderProps>;
|
|
6
|
+
export type { InPageGatewaysProviderProps } from '@xyo-network/xl1-react-client-sdk/client';
|
|
7
|
+
export { InPageGatewaysProvider } from '@xyo-network/xl1-react-client-sdk/client';
|
|
65
8
|
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/Provider.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/Provider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAA;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import type { InPageGatewaysState } from './InPageGatewaysState.ts';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* gateway regardless of source.
|
|
7
|
-
*
|
|
8
|
-
* @param required - When `true` (default), throws if no
|
|
9
|
-
* `InPageGatewaysProvider` is mounted above.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Use {@link useProvidedInPageGateways} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
12
5
|
*/
|
|
13
|
-
export
|
|
14
|
-
provided: true;
|
|
15
|
-
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<InPageGatewaysState>, "provided">;
|
|
6
|
+
export { useProvidedInPageGateways } from '@xyo-network/xl1-react-client-sdk/client';
|
|
16
7
|
//# sourceMappingURL=useProvidedInPageGateways.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidedInPageGateways.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/useProvidedInPageGateways.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProvidedInPageGateways.d.ts","sourceRoot":"","sources":["../../../../src/context/in-page/useProvidedInPageGateways.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,49 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GatewayProviderProps } from '../GatewayProviderProps.ts';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* function without a wallet (falling back to the in-page client) but
|
|
8
|
-
* should still prefer the wallet when it is present.
|
|
9
|
-
*
|
|
10
|
-
* Required ancestry: an `InPageGatewaysProvider` must be mounted above
|
|
11
|
-
* this provider — `useProvidedInPageGateways(true)` throws if missing.
|
|
12
|
-
* If you only need a wallet-backed gateway, use `WalletGatewayProvider`
|
|
13
|
-
* instead.
|
|
14
|
-
*
|
|
15
|
-
* Source precedence for `defaultGateway`:
|
|
16
|
-
* - Wallet present and resolved (`XyoGatewayRunner`) → wallet wins; the
|
|
17
|
-
* in-page gateway is still exposed via `gateways.inPageGateway` for
|
|
18
|
-
* the rare consumer that needs to target it specifically.
|
|
19
|
-
* - Wallet definitively absent (`null`) → fall back to the in-page
|
|
20
|
-
* gateway matching `gatewayName`.
|
|
21
|
-
* - Wallet still resolving (`undefined`) → leave `defaultGateway`
|
|
22
|
-
* `undefined` so consumers render a loading state rather than
|
|
23
|
-
* committing to the in-page fallback prematurely.
|
|
24
|
-
*
|
|
25
|
-
* The published `GatewayContextState` shape:
|
|
26
|
-
* - `defaultGateway` — resolved per the precedence above. Three-state:
|
|
27
|
-
* `undefined` = loading, `null` is not produced by this provider
|
|
28
|
-
* (wallet-null collapses to `gatewayFromConfig`), `XyoGateway` = ready.
|
|
29
|
-
* - `gateways.walletGateway` — raw wallet result (tri-state).
|
|
30
|
-
* - `gateways.inPageGateway` — raw in-page result for the requested
|
|
31
|
-
* `gatewayName`, or `undefined` if no `gatewayName` was passed.
|
|
32
|
-
* - `error` — first non-null of wallet error, then in-page build error
|
|
33
|
-
* for this `gatewayName`. Also rendered inline via `ErrorRender` above
|
|
34
|
-
* `children` so mount-time failures surface even when no consumer
|
|
35
|
-
* reads `error`.
|
|
36
|
-
* - `resetGatewaysFromConfig` — forwards `clearAll` from
|
|
37
|
-
* `InPageGatewaysProvider`, letting consumers force a rebuild of the
|
|
38
|
-
* in-page gateways (e.g. after a network or endpoint change).
|
|
39
|
-
* - `provided: true` — lets descendants detect a real provider in the
|
|
40
|
-
* tree.
|
|
41
|
-
*
|
|
42
|
-
* `defaultGateway`, `gateways`, and the context `value` are memoized so
|
|
43
|
-
* consumers only re-render when wallet or in-page sources actually
|
|
44
|
-
* change identity.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated Use {@link GatewayProvider} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
47
5
|
*/
|
|
48
|
-
export
|
|
6
|
+
export { GatewayProvider } from '@xyo-network/xl1-react-client-sdk/client';
|
|
49
7
|
//# sourceMappingURL=GatewayProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/GatewayProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/GatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,36 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GatewayProviderProps } from '../GatewayProviderProps.ts';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* rather than running an in-page gateway.
|
|
8
|
-
*
|
|
9
|
-
* The requested `gatewayName` is forwarded to `useGatewayFromWallet`, whose
|
|
10
|
-
* returned gateway uses a three-state contract (`undefined` = still
|
|
11
|
-
* resolving, `null` = wallet confirmed absent / timed out,
|
|
12
|
-
* `XyoGatewayRunner` = ready). That tri-state is passed through to
|
|
13
|
-
* consumers unchanged as `defaultGateway` / `gateways.walletGateway`, so
|
|
14
|
-
* downstream hooks can distinguish "loading" from "missing".
|
|
15
|
-
*
|
|
16
|
-
* The published `GatewayContextState` shape:
|
|
17
|
-
* - `defaultGateway` — the wallet gateway, used when consumers don't
|
|
18
|
-
* specify which gateway they want.
|
|
19
|
-
* - `gateways.walletGateway` — same instance as `defaultGateway`.
|
|
20
|
-
* - `gateways.inPageGateway` — always `null` here; this provider does not
|
|
21
|
-
* stand up an in-page client. Pair with a different provider if you need
|
|
22
|
-
* both.
|
|
23
|
-
* - `error` — surfaced from `useGatewayFromWallet` (detection / timeout /
|
|
24
|
-
* wallet errors). Also rendered inline via `ErrorRender` above `children`
|
|
25
|
-
* so mount-time failures are visible even if no consumer reads `error`.
|
|
26
|
-
* - `provided: true` — lets descendants detect that a real provider (not
|
|
27
|
-
* the default empty context) is in the tree.
|
|
28
|
-
*
|
|
29
|
-
* The `defaultGateway`, `gateways`, and context `value` are memoized so
|
|
30
|
-
* consumers only re-render when the underlying wallet gateway reference or
|
|
31
|
-
* error actually changes.
|
|
32
|
-
*
|
|
33
|
-
* @deprecated Use {@link WalletGatewayProvider} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
34
5
|
*/
|
|
35
|
-
export
|
|
6
|
+
export { WalletGatewayProvider } from '@xyo-network/xl1-react-client-sdk/client';
|
|
36
7
|
//# sourceMappingURL=WalletGatewayProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/WalletGatewayProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/WalletGatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import type { GatewayContextState } from './GatewayProviderState.ts';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
6
|
-
* the surrounding app swaps `WalletGatewayProvider` for
|
|
7
|
-
* `GatewayProvider` (or a test double).
|
|
8
|
-
*
|
|
9
|
-
* @param required - When `true` (default), throws if no gateway provider
|
|
10
|
-
* is mounted above — use this when the component is meaningless
|
|
11
|
-
* without a gateway. When `false`, returns default state (all fields
|
|
12
|
-
* undefined) so the component can render a graceful fallback.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated Use {@link useProvidedGateway} from `@xyo-network/xl1-react-client-sdk/client` instead.
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
15
5
|
*/
|
|
16
|
-
export
|
|
17
|
-
provided: true;
|
|
18
|
-
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<GatewayContextState>, "provided">;
|
|
6
|
+
export { useProvidedGateway } from '@xyo-network/xl1-react-client-sdk/client';
|
|
19
7
|
//# sourceMappingURL=useProvidedGateway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProvidedGateway.d.ts","sourceRoot":"","sources":["../../../src/context/useProvidedGateway.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useProvidedGateway.d.ts","sourceRoot":"","sources":["../../../src/context/useProvidedGateway.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CaveatTypes, ParentCapability, XyoPermissions } from '@xyo-network/xl1-sdk';
|
|
2
1
|
/**
|
|
3
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
+
export { findCaveat } from '@xyo-network/xl1-react-client-sdk/client';
|
|
6
7
|
//# sourceMappingURL=findCaveat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findCaveat.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/helpers/findCaveat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findCaveat.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/helpers/findCaveat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
3
5
|
*/
|
|
4
|
-
export
|
|
5
|
-
permissions: import("@xyo-network/xl1-sdk").XyoPermissions | undefined;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
error: Error | null;
|
|
8
|
-
timedout: boolean;
|
|
9
|
-
};
|
|
6
|
+
export { usePermissions } from '@xyo-network/xl1-react-client-sdk/client';
|
|
10
7
|
//# sourceMappingURL=usePermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePermissions.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/permissions/usePermissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePermissions.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/permissions/usePermissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockWalletDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/story/mockWalletDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"mockWalletDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/client/story/mockWalletDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAwGtD,eAAO,MAAM,cAAc,EAAE,SAa5B,CAAA"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import type { XyoClient } from '@xyo-network/xl1-sdk';
|
|
2
|
-
interface ClientState {
|
|
3
|
-
client?: XyoClient | null;
|
|
4
|
-
error: Error | null;
|
|
5
|
-
isLoading: boolean;
|
|
6
|
-
timedout: boolean;
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
|
-
* @deprecated
|
|
2
|
+
* @deprecated Moved to `@xyo-network/xl1-react-client-sdk`. Import from
|
|
3
|
+
* `@xyo-network/xl1-react-client-sdk/client` instead. This re-export exists
|
|
4
|
+
* only for backward compatibility and will be removed in a future release.
|
|
10
5
|
*/
|
|
11
|
-
export
|
|
12
|
-
/** @deprecated - use useClientFromWallet instead */
|
|
13
|
-
export declare const useClient: (timeout?: number) => ClientState;
|
|
14
|
-
export {};
|
|
6
|
+
export { useClientFromWallet } from '@xyo-network/xl1-react-client-sdk/client';
|
|
15
7
|
//# sourceMappingURL=useClientFromWallet.d.ts.map
|