22
33This is a Python SDK for interacting with the Hedera Hashgraph platform. It allows developers to:
44
5- - Manage Token Transactions like Create, Associate, Dissociate, Transfer & Delete
5+ - Manage Token Transactions like Create, Mint Fungible, Mint Non-Fungible, Associate, Dissociate, Transfer & Delete
66- Manage Consensus Transactions like Topic Create, Update, Delete
77- Submit Topic Messages
88- Query Account Balance, Transaction Receipts, Topic Infos and Messages
@@ -19,6 +19,8 @@ This is a Python SDK for interacting with the Hedera Hashgraph platform. It allo
1919 - [ Creating an Account] ( #creating-an-account )
2020 - [ Querying Account Balance] ( #querying-account-balance )
2121 - [ Creating a Token] ( #creating-a-token )
22+ - [ Minting a Fungible Token] ( #minting-a-fungible-token )
23+ - [ Minting a Non-Fungible Token] ( #minting-a-non-fungible-token )
2224 - [ Associating a Token] ( #associating-a-token )
2325 - [ Dissociating a Token] ( #dissociating-a-token )
2426 - [ Transferring Tokens] ( #transferring-tokens )
@@ -112,6 +114,7 @@ Create a .env file in the root of your project with the following (replace with
112114OPERATOR_ID=0.0.1234xx
113115OPERATOR_KEY=302e020100300506032b657004220420...
114116ADMIN_KEY=302a300506032b65700321009308ecfdf...
117+ SUPPLY_KEY =302a300506032b6570032100c5e4af5..."
115118RECIPIENT_ID=0.0.789xx
116119TOKEN_ID=0.0.100xx
117120TOPIC_ID=0.0.200xx
@@ -143,6 +146,7 @@ New Account Public Key: 8f444e36e8926def492adxxx...
143146Token creation successful. Token ID: 0.0.5025xxx
144147Token association successful.
145148Token dissociation successful.
149+ Token minting successful.
146150Token transfer successful.
147151Token deletion successful.
148152Topic creation successful.
@@ -215,6 +219,7 @@ transaction = TokenCreateTransaction(
215219 initial_supply=1000,
216220 treasury_account_id=operator_id,
217221 admin_key=admin_key
222+ supply_key=supply_key
218223).freeze_with(client)
219224
220225transaction.sign(admin_key)
@@ -232,6 +237,7 @@ transaction = (
232237 .set_initial_supply(1000)
233238 .set_treasury_account_id(operator_id)
234239 .set_admin_key(admin_key) # Optional to create a token. Necessary for Token Delete or Update.
240+ .set_supply_key(supply_key) # Optional to change token supply. Necessary for Token Mint or Burn.
235241 .freeze_with(client)
236242 )
237243
@@ -240,6 +246,59 @@ transaction = (
240246 transaction.execute(client)
241247```
242248
249+
250+ ### Minting a Fungible Token
251+
252+ #### Pythonic Syntax:
253+ ```
254+ transaction = TokenMintTransaction(
255+ token_id=token_id,
256+ amount=amount, # lowest denomination, must be positive and not zero
257+ ).freeze_with(client)
258+
259+ transaction.sign(operator_key)
260+ transaction.sign(supply_key)
261+ transaction.execute(client)
262+ ```
263+ #### Method Chaining:
264+ ```
265+ transaction = (
266+ TokenMintTransaction()
267+ .set_token_id(token_id)
268+ .set_amount(amount) # lowest denomination, must be positive and not zero
269+ .freeze_with(client)
270+ )
271+ transaction.sign(operator_key)
272+ transaction.sign(admin_key)
273+ transaction.execute(client)
274+ ```
275+
276+ ### Minting a Non-Fungible Token
277+
278+ #### Pythonic Syntax:
279+ ```
280+ transaction = TokenMintTransaction(
281+ token_id=token_id,
282+ metadata=metadata # Bytes for non-fungible tokens (NFTs)
283+ ).freeze_with(client)
284+
285+ transaction.sign(operator_key)
286+ transaction.sign(supply_key)
287+ transaction.execute(client)
288+ ```
289+ #### Method Chaining:
290+ ```
291+ transaction = (
292+ TokenMintTransaction()
293+ .set_token_id(token_id)
294+ .set_metadata(metadata) # Bytes for non-fungible tokens (NFTs)
295+ .freeze_with(client)
296+ )
297+ transaction.sign(operator_key)
298+ transaction.sign(admin_key)
299+ transaction.execute(client)
300+ ```
301+
243302### Associating a Token
244303
245304#### Pythonic Syntax:
0 commit comments