Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
For creating and updating NFTs on the algorand testnet, devnet, betanet and mainet networks. Can also be used to generate accounts on the afore mentioned networks
This SDK builds upon the py-algo-sdk NFT minting and updating capabilities, making it a lot easier for developers to create and update NFTs on testnet, betanet and mainnet using the different ARC standards.
The developer simply needs to call the appropriate function to either mint or update an NFT, providing the necessary arguments including the metadata url in accordance with the ARC standard they intend to use.
ARC3
ARC19
ARC69
At least Python 3.10
#create a virtual environment
python3 -m venv venv
#activate virtual environment
source venv/bin/activate
#update pip
pip install pip upgrade
#install py-algo-nft-sdk
pip install py-algo-nft-sdk
#install py-algo-sdk
pip install -r requirements.txt
To use the SDK in your python script you simply need to follow the steps below.
Import SDK
'''
import the file coresponding to the network that you intend to connect to and alias it.
Testnet: testnet
Betanet: betanet
Mainnet: mainnet
'''
from py_sdk import testnet as nft_sdk
Call the function to mint an NFT
create_nft(name, symbol, metadata_url, address, reserve=False, freeze="", clawback="")
Descripton: This function mints a new NFT.
Arguments:
Required :-
Optional :- -address: This is an argument of type string and denotes the receiving address of the NFT(i.e) where the NFT would be stored after creation. If no Address is passed, then an address would be generated for the user and information about this address such as the secrete key, the public key and the mnemonic seed phrase would be printed out to the CLI. These must be copied and stored in a secure manner and later import the wallet to GUI such as [MyAlgo wallet] (https://wallet.myalgo.com/) or [Pera Algo wallet] (https://perawallet.app/)
Side Effects: -The function prints out the metadata hash, transaction ID, transaction information and the asset ID to the CLI.
Return: -The function returns the NFT ID (success) or False (failure)
Example: In this example, we create an NFT that can be updated (ARC-19 standard), but with no clawback or freeze address.
nft_sdk.create_nft("exampleNFT", "EX", "https://bit.ly/3WlA41Y#i", True)
Fund wallet and Opt-in to asset
-The User or receiver of the NFT must opt-in to the NFT in their wallet by adding the asset ID generated in the previous step to their wallet. -The user must also have few algos in their wallet. You can get algos from the [testnet dispenser] (https://testnet.algoexplorer.io/dispenser) .
You can also use the utility function verify_opt_in() to ensure that the receiver address has opted in to the asset before moving on to the next step.
verify_opt_in(address, asset_id)
Description: checks if an adderess has opted-in to an asset.
Arguments:
Required:- -address: This is an argument of type string. It denotes the wallet to be checked for an opt-in for a particular asset. -asset_id: This is passed an an integer. It denotes the asset ID of the asset to be checked.
Side Effects: None
Return: -True (if the wallet has opted in) else False.
Example:
nft_sdk.verify_opt_in("BKULWP4WWNEFJRAUEZJD4RCWQ6G4XVH24MZINYOHB76SF2MTMFEOM5CABY", 156938060)
You can also use the utility function create_account() to generate a new account create_account()
Description: Creates a new account.
Arguments: Takes no arguments.
Side Effects: -Prints the public key (wallet address), private key and mnemonic seed phrase to the CLI.
Return: -The public key / wallet address.
Example: '''{python} nft_sdk.create_account() ''' This function prints out the account information which you can then copy from the CLI and store in a safe place and later import the wallet to GUI such as [MyAlgo wallet] (https://wallet.myalgo.com/) or [Pera Algo wallet] (https://perawallet.app/)
This step is only required when a user wants to update a mutable NFT. Remember that an NFT is only mutable if the metadata_url passed while creating the NFT was created and passed as specified by the ARC-19 standard.
update_nft(asset_id, metadata_url, clawback="", freeze="")
Descripton: This function updates an NFT.
Arguments:
Required :-
Optional :-
Side Effects: -The function prints out the metadata hash, transaction ID, transaction information and the asset ID to the CLI.
Return: -The function returns the NFT ID (success) or False (failure)
Example:
nft_sdk.update_nft(156938060, ipfs://.......)
Owolabi Adeyemi Emmanuel Agbavwe
Barnji
Nullun
Nick Stanford
Joe Polony
JP Miller
The ALgorand foundation and the awesome Green House Hacks Team
FAQs
For creating and updating NFTs on the algorand testnet, devnet, betanet and mainet networks. Can also be used to generate accounts on the afore mentioned networks
We found that py-algorand-nft-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.