You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
token_delete.py
token_delete_transaction.py
test_token_delete_transaction.py
test.py
account_id naming in unit test
readme delete token
typo successful
hardcoding to env file token_id
string token_id readme
admin_key integration
admin_key token_create_transaction
admin_key signing example
admin_key test.py
creating token readme/example with admin key
test enable solo
key basic types
bytes
defining bytes in private key
sign admin as is set
typo
admin_key generate distinct
public key test
call
admin_public_key_bytes test
admin_key signing
admin_key private public user-friendly and docs
transaction body layer
Documentation admin key
paths
uv lock
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ submitting messages.
14
14
-[Creating a Token](#creating-a-token)
15
15
-[Associating a Token](#associating-a-token)
16
16
-[Transferring Tokens](#transferring-tokens)
17
+
-[Deleting a Token](#deleting-a-token)
17
18
-[Transferring HBAR](#transferring-hbar)
18
19
-[Creating a Topic](#creating-a-topic)
19
20
-[Contributing](#contributing)
@@ -66,6 +67,7 @@ Create a .env file in the root of your project with the following (replace with
66
67
```
67
68
OPERATOR_ID=0.0.1234xx
68
69
OPERATOR_KEY=302e020100300506032b657004220420...
70
+
ADMIN_KEY=302a300506032b65700321009308ecfdf...
69
71
RECIPIENT_ID=0.0.789xx
70
72
TOKEN_ID=0.0.100xx
71
73
NETWORK=testnet
@@ -96,11 +98,12 @@ New Account Public Key: 8f444e36e8926def492adxxx...
96
98
Token creation successful. Token ID: 0.0.5025xxx
97
99
Token association successful.
98
100
Token transfer successful.
101
+
Token deletion successful.
99
102
```
100
103
101
104
## Usage
102
105
103
-
Below are examples of how to use the SDK for creating tokens, associating them with accounts, and transferring tokens (also see 'examples' directiory)
106
+
Below are examples of how to use the SDK for creating tokens, associating them with accounts, and transferring or deleting tokens (also see 'examples' directiory)
104
107
105
108
### Creating an Account
106
109
@@ -127,9 +130,11 @@ transaction = (
127
130
.set_decimals(2)
128
131
.set_initial_supply(1000)
129
132
.set_treasury_account_id(operator_id)
133
+
.set_admin_key(admin_key) # Optional to create a token. Necessary for Token Delete or Update.
130
134
.freeze_with(client)
131
135
)
132
136
137
+
transaction.sign(admin_key) # If admin key exists.
133
138
transaction.sign(operator_key)
134
139
transaction.execute(client)
135
140
```
@@ -162,6 +167,20 @@ transaction = (
162
167
transaction.execute(client)
163
168
```
164
169
170
+
### Deleting a Token
171
+
172
+
```
173
+
transaction = (
174
+
TokenDeleteTransaction()
175
+
.set_token_id(token_id)
176
+
.freeze_with(client)
177
+
)
178
+
179
+
transaction.sign(admin_key) #Admin key must also have been set in Token Create
0 commit comments