keyring-chatbot-agent-sdk-test 1.0.35 → 1.0.36

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/lib.d.ts CHANGED
@@ -13,7 +13,7 @@ export declare interface Account {
13
13
  chainId: number | string;
14
14
  }
15
15
 
16
- export declare const ActionForm: ({ action, initialValues, onSubmit, onCancel, isSubmitting, tokenInfo, nftInfo, disabled, language, }: ActionFormProps) => JSX.Element | null;
16
+ export declare const ActionForm: ({ action, initialValues, onSubmit, onCancel, isSubmitting, tokenInfo, nftInfo, disabled, language, validateGas, }: ActionFormProps) => JSX.Element | null;
17
17
 
18
18
  declare interface ActionFormProps {
19
19
  action: AgentActionType;
@@ -26,6 +26,20 @@ declare interface ActionFormProps {
26
26
  nftInfo?: MessageNftInfo;
27
27
  /** BCP-47 tag core stamped on this action; the form translates against it. */
28
28
  language?: string;
29
+ /**
30
+ * Pre-flight check that the connected wallet has enough native balance to
31
+ * cover `gasLimit × gasPrice + value` for the tx that will be built from
32
+ * `values`. Called on submit BEFORE `onSubmit`. When `{ok:false}` is
33
+ * returned, the form shows `message` as an inline error above the submit
34
+ * button and does NOT proceed. Optional — when omitted, submit proceeds
35
+ * directly (a deeper check in the host stays as the safety net).
36
+ */
37
+ validateGas?: (values: Record<string, string>) => Promise<{
38
+ ok: true;
39
+ } | {
40
+ ok: false;
41
+ message: string;
42
+ }>;
29
43
  }
30
44
 
31
45
  declare interface AddMessageOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keyring-chatbot-agent-sdk-test",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "private": false,
5
5
  "description": "React chat widget for keyring-agent-core — floating chatbot UI with AI answers, wallet/token/NFT lookups",
6
6
  "keywords": [