0

I am trying to add meta data in transaction using Cardano Wallet API from C# program. But i am not able to model Json format for meta data to equivalent C# class model and due to this i am getting bad request response. Can some one help we with writing a c# model class which can later be serialized to equivalent Json and fed to Cardano Wallet API.

 public class K
    {
        public string @string { get; set; }
    }

    public class V
    {
        public string @string { get; set; }
    }

    public class Map
    {
        public K k { get; set; }
        public V v { get; set; }
    }

    public class _1337
    {
        public List<Map> map { get; set; }
    }

    public class Metadata
    {
        public _1337 _1337 { get; set; }
    }

    



    public class CreateTransactionModel
    {
        public string passphrase { get; set; }
        public List<Payment> payments { get; set; }
        public Metadata metadata { get; set; }


    }

    public class Payment
    {
        public string address { get; set; }
        public Amount amount { get; set; }
    }

This is the model I have written to mirror the Json required to add meta data to transaction. Transaction with meta data as null are going through successfully.

2
  • I'm not familiar with the Json so if you could provide a sample of that I might have some thoughts on this. Or even just a link to the specification for the Json. I'm very new to Blockchain dev but very familiar with c#. Nov 5, 2021 at 2:51
  • Thank you for your comment. Actually easiest way is that Visual studio provide inbuilt solution where you give json and class is created and there are some online tools too. I got all this while researching for solution of above problem Jan 19 at 18:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.