Hedera
Search…
Delete a scheduled transaction
A transaction that deletes a schedule transaction from the network. You can delete a schedule transaction if only the admin key was set during the creation of the schedule transaction. If an admin key was not set, the attempted deletion will result in "SCHEDULE_IS_IMMUTABLE" response from the network. Once the schedule transaction is deleted, the schedule transaction will be marked as deleted with the consensus timestamp the schedule transaction was deleted at.
Transaction Signing Requirements
  • The admin key of the schedule transaction
Transaction Properties
Field
Description
Schedule ID
The ID of the schedule transaction
Constructor
Description
new ScheduleDeleteTransaction()
Initializes the ScheduleDeleteTransaction object
1
new ScheduleDeleteTransaction()
Copied!

Methods

V2
Method
Type
Requirement
setScheduleId(<scheduleId>)
ScheduleId
Required
getScheduleId()
ScheduleId
Optional
Java
1
//Create the transaction and sign with the admin key
2
ScheduleDeleteTransaction transaction = new ScheduleDeleteTransaction()
3
.setScheduleId(scheduleId)
4
.freezeWith(client)
5
.sign(adminKey);
6
​
7
//Sign with the operator key and submit to a Hedera network
8
TransactionResponse txResponse = transaction.execute(client);
9
​
10
//Get the transaction receipt
11
TransactionReceipt receipt = txResponse.getReceipt(client);
12
​
13
//Get the transaction status
14
Status transactionStatus = receipt.status;
15
System.out.println("The transaction consensus status is " +transactionStatus);
Copied!
JavaScript
1
//Create the transaction and sign with the admin key
2
const transaction = await new ScheduleDeleteTransaction()
3
.setScheduleId(scheduleId)
4
.freezeWith(client)
5
.sign(adminKey);
6
​
7
//Sign with the operator key and submit to a Hedera network
8
const txResponse = await transaction.execute(client);
9
​
10
//Get the transaction receipt
11
const receipt = await txResponse.getReceipt(client);
12
​
13
//Get the transaction status
14
const transactionStatus = receipt.status;
15
console.log("The transaction consensus status is " +transactionStatus);
Copied!
Go
1
//Create the transaction and freeze the unsigned transaction
2
transaction, err := hedera.NewScheduleDeleteTransaction()
3
SetScheduleID(scheduleId).
4
FreezeWith(client)
5
​
6
if err != nil {
7
panic(err)
8
}
9
​
10
//Sign with the admin key, sign with the client operator private key and submit the transaction to a Hedera network
11
txResponse, err := transaction.Sign(adminKey).Execute(client)
12
​
13
if err != nil {
14
panic(err)
15
}
16
​
17
//Request the receipt of the transaction
18
receipt, err := txResponse.GetReceipt(client)
19
​
20
if err != nil {
21
panic(err)
22
}
23
​
24
//Get the transaction consensus status
25
status:= *receipt.Status
26
​
27
fmt.Printf("The transaction consensus status is %v\n", status)
Copied!
Copy link
Contents
Methods