Skip to main content
. 2021 May 31;21(11):3822. doi: 10.3390/s21113822
Algorithm 7 Get my NFT
  • 1:

    functionGetMyNFT(tokentype string)

  • 2:

         ownerclientGetClientIdentity().GetID()

  • 3:

         checkstrownerclient+_+tokentype+_

  • 4:

         resultsIteratorGetStateByRange(checkstr+pad(0,64),checkstr+pad(z,64)

  • 5:

         defer resultsIterator.Close()

  • 6:

         var tokens []*Token

  • 7:

         for resultsIterator.HasNext() do

  • 8:

              queryResponseresultsIterator.Next()

  • 9:

              tokenjson.Unmarshal(queryResponse.Value)

  • 10:

            tokensappend(tokens,token)

  • 11:

        end for

  • 12:

        return tokens              ▹ Returns all tokens of tokentype for requesting client

  • 13:

    end function