@aomi-labs/react 0.2.3 → 0.2.4
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/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -412,6 +412,16 @@ type UserConfig = {
|
|
|
412
412
|
};
|
|
413
413
|
declare const getNetworkName: (chainId: number | string | undefined) => string;
|
|
414
414
|
declare const formatAddress: (addr?: string) => string;
|
|
415
|
+
/** Static metadata for a supported chain */
|
|
416
|
+
type ChainInfo = {
|
|
417
|
+
id: number;
|
|
418
|
+
name: string;
|
|
419
|
+
ticker: string;
|
|
420
|
+
};
|
|
421
|
+
/** All chains supported by the application. Single source of truth. */
|
|
422
|
+
declare const SUPPORTED_CHAINS: ChainInfo[];
|
|
423
|
+
/** Look up ChainInfo by chain ID. Returns undefined for unknown chains. */
|
|
424
|
+
declare const getChainInfo: (chainId: number | undefined) => ChainInfo | undefined;
|
|
415
425
|
|
|
416
426
|
/** Global control state (shared across all threads) */
|
|
417
427
|
type ControlState = {
|
|
@@ -468,4 +478,4 @@ type ControlContextProviderProps = {
|
|
|
468
478
|
};
|
|
469
479
|
declare function ControlContextProvider({ children, backendApi, sessionId, publicKey, getThreadMetadata, updateThreadMetadata, }: ControlContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
470
480
|
|
|
471
|
-
export { type AomiMessage, type AomiRuntimeApi, AomiRuntimeProvider, type AomiRuntimeProviderProps, type ApiChatResponse, type ApiCreateThreadResponse, type ApiInterruptResponse, type ApiSSEEvent, type ApiStateResponse, type ApiSystemEvent, type ApiSystemResponse, type ApiThread, BackendApi, type ControlContextApi, ControlContextProvider, type ControlContextProviderProps, type ControlState, type EventBuffer, type EventContext, EventContextProvider, type EventContextProviderProps, type EventSubscriber, type Notification as HandlerNotification, type InboundEvent, type Notification$1 as Notification, type NotificationApi, NotificationContextProvider, type NotificationContextProviderProps, type NotificationContextApi as NotificationContextValue, type NotificationHandlerConfig, type NotificationType, type OutboundEvent, type SSEStatus, type NotificationData as ShowNotificationParams, type ThreadContext, ThreadContextProvider, type ThreadControlState, type ThreadMetadata, type UserConfig, UserContextProvider, type UserState, type UserState as WalletButtonState, type WalletConnectionStatus, type WalletHanderApi, type WalletHandlerConfig, type WalletTxComplete, type WalletTxRequest, cn, formatAddress, getNetworkName, initThreadControl, useAomiRuntime, useControl, useCurrentThreadMessages, useCurrentThreadMetadata, useEventContext, useNotification, useNotificationHandler, useThreadContext, useUser, useWalletHandler };
|
|
481
|
+
export { type AomiMessage, type AomiRuntimeApi, AomiRuntimeProvider, type AomiRuntimeProviderProps, type ApiChatResponse, type ApiCreateThreadResponse, type ApiInterruptResponse, type ApiSSEEvent, type ApiStateResponse, type ApiSystemEvent, type ApiSystemResponse, type ApiThread, BackendApi, type ChainInfo, type ControlContextApi, ControlContextProvider, type ControlContextProviderProps, type ControlState, type EventBuffer, type EventContext, EventContextProvider, type EventContextProviderProps, type EventSubscriber, type Notification as HandlerNotification, type InboundEvent, type Notification$1 as Notification, type NotificationApi, NotificationContextProvider, type NotificationContextProviderProps, type NotificationContextApi as NotificationContextValue, type NotificationHandlerConfig, type NotificationType, type OutboundEvent, type SSEStatus, SUPPORTED_CHAINS, type NotificationData as ShowNotificationParams, type ThreadContext, ThreadContextProvider, type ThreadControlState, type ThreadMetadata, type UserConfig, UserContextProvider, type UserState, type UserState as WalletButtonState, type WalletConnectionStatus, type WalletHanderApi, type WalletHandlerConfig, type WalletTxComplete, type WalletTxRequest, cn, formatAddress, getChainInfo, getNetworkName, initThreadControl, useAomiRuntime, useControl, useCurrentThreadMessages, useCurrentThreadMetadata, useEventContext, useNotification, useNotificationHandler, useThreadContext, useUser, useWalletHandler };
|
package/dist/index.d.ts
CHANGED
|
@@ -412,6 +412,16 @@ type UserConfig = {
|
|
|
412
412
|
};
|
|
413
413
|
declare const getNetworkName: (chainId: number | string | undefined) => string;
|
|
414
414
|
declare const formatAddress: (addr?: string) => string;
|
|
415
|
+
/** Static metadata for a supported chain */
|
|
416
|
+
type ChainInfo = {
|
|
417
|
+
id: number;
|
|
418
|
+
name: string;
|
|
419
|
+
ticker: string;
|
|
420
|
+
};
|
|
421
|
+
/** All chains supported by the application. Single source of truth. */
|
|
422
|
+
declare const SUPPORTED_CHAINS: ChainInfo[];
|
|
423
|
+
/** Look up ChainInfo by chain ID. Returns undefined for unknown chains. */
|
|
424
|
+
declare const getChainInfo: (chainId: number | undefined) => ChainInfo | undefined;
|
|
415
425
|
|
|
416
426
|
/** Global control state (shared across all threads) */
|
|
417
427
|
type ControlState = {
|
|
@@ -468,4 +478,4 @@ type ControlContextProviderProps = {
|
|
|
468
478
|
};
|
|
469
479
|
declare function ControlContextProvider({ children, backendApi, sessionId, publicKey, getThreadMetadata, updateThreadMetadata, }: ControlContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
470
480
|
|
|
471
|
-
export { type AomiMessage, type AomiRuntimeApi, AomiRuntimeProvider, type AomiRuntimeProviderProps, type ApiChatResponse, type ApiCreateThreadResponse, type ApiInterruptResponse, type ApiSSEEvent, type ApiStateResponse, type ApiSystemEvent, type ApiSystemResponse, type ApiThread, BackendApi, type ControlContextApi, ControlContextProvider, type ControlContextProviderProps, type ControlState, type EventBuffer, type EventContext, EventContextProvider, type EventContextProviderProps, type EventSubscriber, type Notification as HandlerNotification, type InboundEvent, type Notification$1 as Notification, type NotificationApi, NotificationContextProvider, type NotificationContextProviderProps, type NotificationContextApi as NotificationContextValue, type NotificationHandlerConfig, type NotificationType, type OutboundEvent, type SSEStatus, type NotificationData as ShowNotificationParams, type ThreadContext, ThreadContextProvider, type ThreadControlState, type ThreadMetadata, type UserConfig, UserContextProvider, type UserState, type UserState as WalletButtonState, type WalletConnectionStatus, type WalletHanderApi, type WalletHandlerConfig, type WalletTxComplete, type WalletTxRequest, cn, formatAddress, getNetworkName, initThreadControl, useAomiRuntime, useControl, useCurrentThreadMessages, useCurrentThreadMetadata, useEventContext, useNotification, useNotificationHandler, useThreadContext, useUser, useWalletHandler };
|
|
481
|
+
export { type AomiMessage, type AomiRuntimeApi, AomiRuntimeProvider, type AomiRuntimeProviderProps, type ApiChatResponse, type ApiCreateThreadResponse, type ApiInterruptResponse, type ApiSSEEvent, type ApiStateResponse, type ApiSystemEvent, type ApiSystemResponse, type ApiThread, BackendApi, type ChainInfo, type ControlContextApi, ControlContextProvider, type ControlContextProviderProps, type ControlState, type EventBuffer, type EventContext, EventContextProvider, type EventContextProviderProps, type EventSubscriber, type Notification as HandlerNotification, type InboundEvent, type Notification$1 as Notification, type NotificationApi, NotificationContextProvider, type NotificationContextProviderProps, type NotificationContextApi as NotificationContextValue, type NotificationHandlerConfig, type NotificationType, type OutboundEvent, type SSEStatus, SUPPORTED_CHAINS, type NotificationData as ShowNotificationParams, type ThreadContext, ThreadContextProvider, type ThreadControlState, type ThreadMetadata, type UserConfig, UserContextProvider, type UserState, type UserState as WalletButtonState, type WalletConnectionStatus, type WalletHanderApi, type WalletHandlerConfig, type WalletTxComplete, type WalletTxRequest, cn, formatAddress, getChainInfo, getNetworkName, initThreadControl, useAomiRuntime, useControl, useCurrentThreadMessages, useCurrentThreadMetadata, useEventContext, useNotification, useNotificationHandler, useThreadContext, useUser, useWalletHandler };
|
package/dist/index.js
CHANGED
|
@@ -1385,6 +1385,15 @@ var getNetworkName = (chainId) => {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
};
|
|
1387
1387
|
var formatAddress = (addr) => addr ? `${addr.slice(0, 6)}...${addr.slice(-4)}` : "Connect Wallet";
|
|
1388
|
+
var SUPPORTED_CHAINS = [
|
|
1389
|
+
{ id: 1, name: "Ethereum", ticker: "ETH" },
|
|
1390
|
+
{ id: 137, name: "Polygon", ticker: "MATIC" },
|
|
1391
|
+
{ id: 42161, name: "Arbitrum", ticker: "ARB" },
|
|
1392
|
+
{ id: 8453, name: "Base", ticker: "BASE" },
|
|
1393
|
+
{ id: 10, name: "Optimism", ticker: "OP" },
|
|
1394
|
+
{ id: 11155111, name: "Sepolia", ticker: "SEP" }
|
|
1395
|
+
];
|
|
1396
|
+
var getChainInfo = (chainId) => chainId === void 0 ? void 0 : SUPPORTED_CHAINS.find((c) => c.id === chainId);
|
|
1388
1397
|
|
|
1389
1398
|
// packages/react/src/state/backend-state.ts
|
|
1390
1399
|
function createBackendState() {
|
|
@@ -2545,10 +2554,12 @@ export {
|
|
|
2545
2554
|
ControlContextProvider,
|
|
2546
2555
|
EventContextProvider,
|
|
2547
2556
|
NotificationContextProvider,
|
|
2557
|
+
SUPPORTED_CHAINS,
|
|
2548
2558
|
ThreadContextProvider,
|
|
2549
2559
|
UserContextProvider,
|
|
2550
2560
|
cn,
|
|
2551
2561
|
formatAddress,
|
|
2562
|
+
getChainInfo,
|
|
2552
2563
|
getNetworkName,
|
|
2553
2564
|
initThreadControl,
|
|
2554
2565
|
useAomiRuntime,
|