code: func (t *Transactor) ListTokens() (*token.UnspentTokens, error) {
  	iterator, err := t.Ledger.GetStateRangeScanIterator(tokenNameSpace, "", "")
  	if err != nil {
  		return nil, err
  	}
  
  	tokens := make([]*token.TokenOutput, 0)
  	prefix, err := createPrefix(tokenOutput)
  	if err != nil {
  		return nil, err
  	}
  	for {
  		next, err := iterator.Next()
  
  		switch {
  		case err != nil:
  			return nil, err
  
  		case next == nil:
  			// nil response from iterator indicates end of query results
  			return &token.UnspentTokens{Tokens: tokens}, nil
  
  		default:
  			result, ok := next.(*queryresult.KV)
  			if !ok {
  				return nil, errors.New("failed to retrieve unspent tokens: casting error")
  			}
  			if strings.HasPrefix(result.Key, prefix) {
  				output := &token.PlainOutput{}
  				err = proto.Unmarshal(result.Value, output)
  				if err != nil {
  					return nil, errors.New("failed to retrieve unspent tokens: casting error")
  				}
  				if string(output.Owner) == string(t.PublicCredential) {
  					spent, err := t.isSpent(result.Key)
  					if err != nil {
  						return nil, err
  					}
  					if !spent {
  						tokens = append(tokens,
  							&token.TokenOutput{
  								Type:     output.Type,
  								Quantity: output.Quantity,
  								Id:       getCompositeKeyBytes(result.Key),
  							})
  					}
  				}
  			}
  		}
  	}
  
  }
docs: // ListTokens creates a TokenTransaction that lists the unspent tokens owned by owner.