@aomi-labs/react 0.3.13 → 0.3.14
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 +26 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -55,12 +55,15 @@ __export(index_exports, {
|
|
|
55
55
|
ControlContextProvider: () => ControlContextProvider,
|
|
56
56
|
DISABLED_PROVIDER_STATE: () => import_client8.DISABLED_PROVIDER_STATE,
|
|
57
57
|
EventContextProvider: () => EventContextProvider,
|
|
58
|
+
MAX_AUTO_FEE_WEI: () => import_client8.MAX_AUTO_FEE_WEI,
|
|
58
59
|
NotificationContextProvider: () => NotificationContextProvider,
|
|
59
60
|
RuntimeUserStateProvider: () => RuntimeUserStateProvider,
|
|
60
61
|
SUPPORTED_CHAINS: () => SUPPORTED_CHAINS,
|
|
61
62
|
ThreadContextProvider: () => ThreadContextProvider,
|
|
62
63
|
UserContextProvider: () => UserContextProvider,
|
|
63
64
|
aaModeFromExecutionKind: () => import_client8.aaModeFromExecutionKind,
|
|
65
|
+
appendFeeCallToPayload: () => import_client8.appendFeeCallToPayload,
|
|
66
|
+
buildFeeAAWalletCall: () => import_client8.buildFeeAAWalletCall,
|
|
64
67
|
cn: () => cn,
|
|
65
68
|
executeWalletCalls: () => import_client8.executeWalletCalls,
|
|
66
69
|
formatAddress: () => formatAddress,
|
|
@@ -68,6 +71,7 @@ __export(index_exports, {
|
|
|
68
71
|
getNetworkName: () => getNetworkName,
|
|
69
72
|
hydrateTxPayloadFromUserState: () => import_client8.hydrateTxPayloadFromUserState,
|
|
70
73
|
initThreadControl: () => initThreadControl,
|
|
74
|
+
normalizeSimulatedFee: () => import_client8.normalizeSimulatedFee,
|
|
71
75
|
parseChainId: () => import_client8.parseChainId,
|
|
72
76
|
toAAWalletCall: () => import_client8.toAAWalletCall,
|
|
73
77
|
toAAWalletCalls: () => import_client8.toAAWalletCalls,
|
|
@@ -1919,6 +1923,22 @@ function AomiRuntimeCore({
|
|
|
1919
1923
|
},
|
|
1920
1924
|
[threadContext.allThreadsMetadata, threadListAdapter]
|
|
1921
1925
|
);
|
|
1926
|
+
const simulateBatchTransactions = (0, import_react10.useCallback)(
|
|
1927
|
+
async (transactions, options) => {
|
|
1928
|
+
var _a, _b;
|
|
1929
|
+
const session = (_b = (_a = sessionManagerRef.current) == null ? void 0 : _a.get(threadContext.currentThreadId)) != null ? _b : getSession(threadContext.currentThreadId);
|
|
1930
|
+
if (!session) {
|
|
1931
|
+
throw new Error("runtime_session_unavailable");
|
|
1932
|
+
}
|
|
1933
|
+
const response = await session.client.simulateBatch(
|
|
1934
|
+
session.sessionId,
|
|
1935
|
+
transactions,
|
|
1936
|
+
options
|
|
1937
|
+
);
|
|
1938
|
+
return response.result;
|
|
1939
|
+
},
|
|
1940
|
+
[getSession, threadContext.currentThreadId]
|
|
1941
|
+
);
|
|
1922
1942
|
const aomiRuntimeApi = (0, import_react10.useMemo)(
|
|
1923
1943
|
() => ({
|
|
1924
1944
|
// User API
|
|
@@ -1953,6 +1973,7 @@ function AomiRuntimeCore({
|
|
|
1953
1973
|
startWalletRequest: walletHandler.startRequest,
|
|
1954
1974
|
resolveWalletRequest: walletHandler.resolveRequest,
|
|
1955
1975
|
rejectWalletRequest: walletHandler.rejectRequest,
|
|
1976
|
+
simulateBatchTransactions,
|
|
1956
1977
|
// Event API
|
|
1957
1978
|
subscribe: eventContext.subscribe,
|
|
1958
1979
|
sendSystemCommand: eventContext.sendOutboundSystem,
|
|
@@ -1975,6 +1996,7 @@ function AomiRuntimeCore({
|
|
|
1975
1996
|
cancelGeneration,
|
|
1976
1997
|
notificationContext,
|
|
1977
1998
|
walletHandler,
|
|
1999
|
+
simulateBatchTransactions,
|
|
1978
2000
|
eventContext
|
|
1979
2001
|
]
|
|
1980
2002
|
);
|
|
@@ -2073,12 +2095,15 @@ function useNotificationHandler({
|
|
|
2073
2095
|
ControlContextProvider,
|
|
2074
2096
|
DISABLED_PROVIDER_STATE,
|
|
2075
2097
|
EventContextProvider,
|
|
2098
|
+
MAX_AUTO_FEE_WEI,
|
|
2076
2099
|
NotificationContextProvider,
|
|
2077
2100
|
RuntimeUserStateProvider,
|
|
2078
2101
|
SUPPORTED_CHAINS,
|
|
2079
2102
|
ThreadContextProvider,
|
|
2080
2103
|
UserContextProvider,
|
|
2081
2104
|
aaModeFromExecutionKind,
|
|
2105
|
+
appendFeeCallToPayload,
|
|
2106
|
+
buildFeeAAWalletCall,
|
|
2082
2107
|
cn,
|
|
2083
2108
|
executeWalletCalls,
|
|
2084
2109
|
formatAddress,
|
|
@@ -2086,6 +2111,7 @@ function useNotificationHandler({
|
|
|
2086
2111
|
getNetworkName,
|
|
2087
2112
|
hydrateTxPayloadFromUserState,
|
|
2088
2113
|
initThreadControl,
|
|
2114
|
+
normalizeSimulatedFee,
|
|
2089
2115
|
parseChainId,
|
|
2090
2116
|
toAAWalletCall,
|
|
2091
2117
|
toAAWalletCalls,
|