Skip to content

Commit 20d65ec

Browse files
docs: add scheduling transactions details and examples in Hedera tools guide (#169)
Signed-off-by: skurzyp-blockydevs <stanislaw.kurzyp@blockydevs.com>
1 parent a860506 commit 20d65ec

File tree

2 files changed

+93
-2
lines changed

2 files changed

+93
-2
lines changed

docs/HEDERAPLUGINS.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,3 +251,75 @@ The Python SDK currently supports one agent mode:
251251

252252
> **Coming Soon:** `AgentMode.RETURN_BYTES` - In this mode, the agent creates the transaction and returns the bytes for
253253
> the user to execute in another tool (human-in-the-loop pattern).
254+
255+
---
256+
257+
## Scheduling Transactions
258+
259+
Most tools in the Hedera Agent Kit support **scheduled transactions**. This allows you to create a transaction that will be executed at a later time or once specific signatures are collected.
260+
261+
### Scheduling Parameters
262+
263+
When a tool supports scheduling, it accepts an optional `schedulingParams` object with the following fields:
264+
265+
| Field | Type | Description |
266+
|---|---|---|
267+
| `is_scheduled` | `boolean` | Set to `true` to create a scheduled transaction instead of executing immediately. |
268+
| `expiration_time` | `string` | ISO 8601 formatted date string (e.g., "2026-02-01T00:00:00Z") when the transaction expires if not fully signed. |
269+
| `wait_for_expiry` | `boolean` | If `true`, the transaction executes only at `expiration_time`. If `false` (default), it executes as soon as signatures are collected. |
270+
| `admin_key` | `boolean \| string` | Admin key to manage the scheduled transaction. `true` uses the operator key. |
271+
| `payer_account_id` | `string` | Account ID that pays the execution fee. Defaults to the operator. |
272+
273+
### Supported Tools
274+
275+
The following tools currently support transaction scheduling:
276+
277+
**Core Account Plugin**
278+
* `CREATE_ACCOUNT_TOOL`
279+
* `UPDATE_ACCOUNT_TOOL`
280+
* `TRANSFER_HBAR_TOOL`
281+
282+
**Core Token Plugin**
283+
* `CREATE_FUNGIBLE_TOKEN_TOOL`
284+
* `CREATE_NON_FUNGIBLE_TOKEN_TOOL`
285+
* `MINT_FUNGIBLE_TOKEN_TOOL`
286+
* `MINT_NON_FUNGIBLE_TOKEN_TOOL`
287+
* `TRANSFER_NON_FUNGIBLE_TOKEN_TOOL`
288+
* `TRANSFER_NFT_WITH_ALLOWANCE_TOOL`
289+
* `TRANSFER_FUNGIBLE_TOKEN_WITH_ALLOWANCE_TOOL`
290+
* `AIRDROP_FUNGIBLE_TOKEN_TOOL`
291+
* `DISSOCIATE_TOKEN_TOOL`
292+
* `DELETE_NON_FUNGIBLE_TOKEN_ALLOWANCE_TOOL`
293+
294+
**Core Consensus Plugin**
295+
* `SUBMIT_TOPIC_MESSAGE_TOOL`
296+
297+
**Core EVM Plugin**
298+
* `CREATE_ERC20_TOOL`
299+
* `TRANSFER_ERC20_TOOL`
300+
* `CREATE_ERC721_TOOL`
301+
* `MINT_ERC721_TOOL`
302+
* `TRANSFER_ERC721_TOOL`
303+
304+
### Prompting Best Practices
305+
306+
To successfully create a scheduled transaction via an AI agent, use clear and explicit prompts:
307+
308+
1. **Explicit Intent**: clearly state that you want to *schedule* the transaction.
309+
2. **Specific Timestamps**: Use exact dates for expiration or execution time. Avoid relative terms like "tomorrow" or "in 2 days" if possible, or ensure the agent can resolve them to a specific date.
310+
311+
**Good Examples:**
312+
* "Transfer 10 HBAR to 0.0.12345 and schedule it to expire on 2025-12-31."
313+
* "Create a scheduled transaction to mint 100 tokens of 0.0.56789, executing on 2026-01-01."
314+
315+
**Bad Examples:**
316+
* "Transfer 10 HBAR later." (Vague timing)
317+
* "Schedule a transfer." (Missing expiration details might default unexpectedly)
318+
319+
### Python SDK Implementation
320+
321+
In the Python SDK, scheduling is handled via the `OptionalScheduledTransactionParams` schema in `hedera_agent_kit.shared.parameter_schemas.common_schema`. Tools inheriting from this schema automatically support the parameters listed above.
322+
323+
To enable scheduling in a custom tool:
324+
1. Inherit from `OptionalScheduledTransactionParams`.
325+
2. In your tool's logic, use `HederaBuilder.maybe_wrap_in_schedule` to conditionally wrap the transaction.

docs/HEDERATOOLS.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Transfer HBAR between accounts.
8383
Transfer 0.1 HBAR to 0.0.12345
8484
Transfer 0.05 HBAR to 0.0.12345 with memo "Payment for services"
8585
Can you move 0.05 HBARs to account with ID 0.0.12345?
86+
Transfer 1 HBAR to 0.0.12345 and schedule the transaction with expiration time 01.02.2026
8687
```
8788

8889
---
@@ -106,6 +107,7 @@ Creates a new Hedera account.
106107
Create a new Hedera account
107108
Create a new account with 10 HBAR
108109
Create an account with memo "My primary account" and 5 HBAR initial balance
110+
Create a new account with 10 HBAR and schedule the transaction with expiration time 01.02.2026
109111
```
110112

111113
---
@@ -129,6 +131,7 @@ Update an account's metadata.
129131
```
130132
Update account 0.0.12345 to have max auto associations of 10
131133
Set my account memo to "Updated account"
134+
Set my account memo to "Scheduled Update" and schedule this with expiration time 01.02.2026
132135
```
133136

134137
---
@@ -404,6 +407,7 @@ Submit a message to an HCS topic.
404407
```
405408
Submit "Hello World" to topic 0.0.12345
406409
Post a message "Daily update" to topic 0.0.12345
410+
Submit "Scheduled Message" to topic 0.0.12345 and schedule with expiration time 01.02.2026
407411
```
408412

409413
---
@@ -524,7 +528,7 @@ Create a fungible token on Hedera.
524528
```
525529
Create a fungible token named MyToken with symbol MTK
526530
Create a fungible token GoldCoin with symbol GLD, initial supply 1000, decimals 2, finite supply with max supply 5000
527-
Create a fungible token named MyToken with symbol MTK. Schedule the transaction instead of executing it immediately.
531+
Create a fungible token named MyToken with symbol MTK. Schedule the transaction with expiration 01.02.2026.
528532
```
529533

530534
---
@@ -548,6 +552,7 @@ Create a non-fungible token (NFT) on Hedera.
548552
```
549553
Create an NFT collection named MyNFT with symbol MNFT
550554
Create an NFT named ArtCollection with symbol ART and max supply 1000
555+
Create an NFT collection named ScheduledNFT and schedule with expiration 01.02.2026
551556
```
552557

553558
---
@@ -568,6 +573,7 @@ Mint additional supply of a fungible token.
568573
```
569574
Mint 100 tokens of 0.0.12345
570575
Add 500 supply to token 0.0.12345
576+
Mint 100 tokens of 0.0.12345 and schedule with expiration 01.02.2026
571577
```
572578

573579
---
@@ -588,6 +594,7 @@ Mint NFTs with metadata.
588594
```
589595
Mint NFT 0.0.12345 with metadata ipfs://QmTest123
590596
Mint 3 NFTs for token 0.0.12345 with URIs ["ipfs://a", "ipfs://b", "ipfs://c"]
597+
Mint NFT 0.0.12345 with metadata ipfs://Scheduled and schedule with expiration 01.02.2026
591598
```
592599

593600
---
@@ -608,6 +615,7 @@ Associate tokens with an account.
608615
```
609616
Associate token 0.0.12345 with my account
610617
Associate tokens 0.0.12345 and 0.0.67890 with account 0.0.11111
618+
Associate token 0.0.12345 with my account and schedule with expiration 01.02.2026
611619
```
612620

613621
---
@@ -629,6 +637,7 @@ Dissociate tokens from an account.
629637
```
630638
Dissociate token 0.0.12345 from my account
631639
Remove token 0.0.12345 association from account 0.0.67890
640+
Dissociate token 0.0.12345 from my account and schedule with expiration 01.02.2026
632641
```
633642

634643
---
@@ -651,6 +660,7 @@ Airdrop fungible tokens to multiple recipients.
651660
```
652661
Airdrop 100 tokens of 0.0.12345 to accounts 0.0.11111 and 0.0.22222
653662
Send 50 tokens each of 0.0.12345 to three accounts
663+
Airdrop 100 tokens of 0.0.12345 to 0.0.11111 and schedule with expiration 01.02.2026
654664
```
655665

656666
---
@@ -673,6 +683,7 @@ Transfer fungible tokens using an allowance.
673683
```
674684
Transfer 50 tokens of 0.0.12345 from 0.0.11111 to 0.0.22222 using allowance
675685
Use my token allowance to send 100 tokens from 0.0.11111
686+
Transfer 50 tokens of 0.0.12345 from 0.0.11111 using allowance and schedule with expiration 01.02.2026
676687
```
677688

678689
---
@@ -695,6 +706,7 @@ Transfer NFTs using an allowance.
695706
```
696707
Transfer NFT 0.0.12345 serial 1 from 0.0.11111 to 0.0.22222 using allowance
697708
Use allowance to send NFT serial 5 from owner 0.0.11111
709+
Transfer NFT 0.0.12345 serial 1 from 0.0.11111 using allowance and schedule with expiration 01.02.2026
698710
```
699711

700712
---
@@ -717,6 +729,7 @@ Delete fungible token allowances.
717729
```
718730
Delete token allowance for token 0.0.12345 from spender 0.0.67890
719731
Remove all token allowances for spender 0.0.67890
732+
Delete token allowance for token 0.0.12345 from spender 0.0.67890 and schedule with expiration 01.02.2026
720733
```
721734

722735
---
@@ -740,6 +753,7 @@ token.
740753
```
741754
Delete NFT allowance for token 0.0.12345 serials [1, 2]
742755
Remove NFT allowance for token 0.0.67890 serial 5
756+
Delete NFT allowance for token 0.0.12345 serials [1] and schedule with expiration 01.02.2026
743757
```
744758

745759
---
@@ -763,6 +777,7 @@ a single transaction.
763777
```
764778
Transfer NFT 0.0.12345 serial 1 to 0.0.67890
765779
Send NFT 0.0.12345 serial 2 from 0.0.11111 to 0.0.22222
780+
Transfer NFT 0.0.12345 serial 1 to 0.0.67890 and schedule with expiration 01.02.2026
766781
```
767782

768783
---
@@ -827,7 +842,7 @@ Deploy an ERC-20 token via factory contract.
827842
```
828843
Create an ERC20 token named MyERC20 with symbol M20
829844
Create an ERC20 token GoldToken with symbol GLD, decimals 2, initial supply 1000
830-
Create an ERC20 token named "MyToken" with symbol MTK. Schedule this transaction instead of executing it immediately.
845+
Create an ERC20 token named "MyToken" with symbol MTK. Schedule with expiration 01.02.2026.
831846
```
832847

833848
---
@@ -853,6 +868,7 @@ Transfer ERC-20 tokens.
853868
```
854869
Transfer 100 tokens of contract 0.0.12345 to 0.0.67890
855870
Send 50 ERC20 tokens from 0x1234... to 0x5678...
871+
Transfer 100 tokens of 0.0.12345 to 0.0.67890 and schedule with expiration 01.02.2026
856872
```
857873

858874
---
@@ -874,6 +890,7 @@ Deploy an ERC-721 (NFT) token via factory contract.
874890
```
875891
Create an ERC721 token named MyNFT with symbol MNFT
876892
Create an ERC721 collection called ArtDrops with symbol AD and base URI ipfs://Qm...
893+
Create an ERC721 token named MyNFT with symbol MNFT and schedule with expiration 01.02.2026
877894
```
878895

879896
---
@@ -895,6 +912,7 @@ Mint a new ERC-721 NFT by calling the `safeMint(to)` function on the contract.
895912
Mint ERC721 token 0.0.6486793 to 0xd94dc7f82f103757f715514e4a37186be6e4580b
896913
Mint ERC721 token 0.0.6486793 to Hedera account ID 0.0.2222222
897914
Mint ERC721 token 0.0.9999
915+
Mint ERC721 token 0.0.9999 and schedule with expiration 01.02.2026
898916
```
899917

900918
---
@@ -921,6 +939,7 @@ Transfer an ERC-721 NFT.
921939
```
922940
Transfer ERC721 token 0 from contract 0.0.12345 to 0.0.67890
923941
Send NFT #5 from 0x1234... to 0x5678...
942+
Transfer ERC721 token 0 from contract 0.0.12345 to 0.0.67890 and schedule with expiration 01.02.2026
924943
```
925944

926945
---

0 commit comments

Comments
 (0)