NFT Signatures Integration Test Server
Documents the process for interacting with the NFT Signatures test server and provides integration suggestions.
Environment
For testing, we will use the Cryptonym tool to interact with the FIO test server.
Install from: GitHub - blockpane/cryptonym: A FIO Protocol wallet for developers
Connect Devnet server address: http://44.234.118.142:8889
Setup
We will use Cryptonym to create a test account and fund it.
First, generate a new key pair that will be used for testing:
Go to the FIO Testnet monitor: http://monitor.testnet.fioprotocol.io
Click on Create Keypair and save the Public Key, Private Key, and Account
Next, fund that key on the test server using the test server faucet:
Open Cryptonym and connect to: http://44.234.118.142:8889
Click on Load Key and copy in the FIO faucet key: 5KF2B21xT5pE5G3LNA6LKJc6AP2pAd2EnfpAUrJH12SFV8NtvCD and then click Import
If you click on Accounts in the top menu and then click Search, you will see the details of the Faucet account.
Click on FIO.TOKEN >
fio.token::trnsfiopubky
in the left hand columnpayee_public_key: copy in the FIO Public Key that you generated from the FIO Testnet Monitor
amount: 5,000.00
Keep the default values for actor and tpid
Click Send and the transaction should execute
Register NFT Domain
Next, load your new account key and create a FIO Domain. The goal is to create a custom FIO Address (e.g., artcollection1@bobnfts) which will hold your NFT signatures.
Click Load Key (if your private key is not already loaded)
Copy in the FIO Private Key that you generated from the FIO Testnet Monitor, and then click Import
Click on Accounts in the top menu and then click Search, you will see the details for your new account.
Click on FIO.ADDRESS >
fio.address::regdomain
in the left hand columnfio_domain: <yourdomain> (e.g. bobnfts)
All other fields: use defaults (these default to your account info)
Click Send and the transaction should execute
Register NFT Address
Next, load your new account key and create a FIO DomainAddress:
Click Load Key (if your private key is not already loaded)
Copy in the FIO Private Key that you generated from the FIO Testnet Monitor, and then click Import
Click on FIO.ADDRESS >
fio.address::regaddress
in the left hand columnfio_address: <yourname>@<yourdomain> (e.g. artcollection1@bobnfts)
All other fields: use defaults (these default to your account info)
Click Send and the transaction should execute
Click on Accounts in the top menu and then click Search, you will see your custom FIO Domain and FIO Address.
Sign NFT
This does not work great in Cryptonym because the field for signing NFTs is a single line. Need to update the tool.
An alternative is to use our FIO Typescript SDK to add NFTs: https://github.com/fioprotocol/fiosdk_typescript-examples/blob/main/fio.address-addnft.js (This requires you to download the repo and do an npm install)
Next, add and NFT signature to your FIO Address
Click on FIO.ORACLE >
fio.address::addnft
in the left hand columnfio_address: <yourname>@<yourdomain> (e.g. artcollection1@bobnfts)
nfts: Add any number of NFTs as defined in FIP-27, for example
{ "chain_code": "ETH", "contract_address": "0x63c0691d05f441f42915ca6ca0a6f60d8ce148cd", "token_id": "100010001", "url": "ipfs://ipfs/QmZ15eQX8FPjfrtdX3QYbrhZxJpbLpvDpsgb2p3VEH8Bqq", "hash": "f83b5702557b1ee76d966c6bf92ae0d038cd176aaf36f86a18e2ab59e6aefa4b", "metadata": "" }
All other fields: use defaults (these default to your account info)
Click Send and the transaction should execute
View your Signed NFTs
This does not work in Cryptonym. Recommend using Postman or other API tool.
Use get_nfts_fio_address
to display your Signed NFTs:
In Cryptonym, click on
APIs
in the upper menu.Select:
/v1/chain/get_nfts_fio_address
TBD: need to add NFT API info to: https://github.com/blockpane/cryptonym/blob/master/api-get.go