public static ConstructionMetadataRequest FromJson(JObject json)
 {
     return(new ConstructionMetadataRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                            json.ContainsProperty("metadata") ? Metadata.FromJson(json["metadata"]) : null,
                                            json.ContainsProperty("options") ? Metadata.FromJson(json["options"]) : null,
                                            json.ContainsProperty("public_keys") ? (json["public_keys"] as JArray).Select(p => PublicKey.FromJson(p)).ToArray() : null));
 }
Example #2
0
 public AccountBalanceRequest(NetworkIdentifier networkIdentifier, AccountIdentifier accountIdentifier, PartialBlockIdentifier blockIdentifier = null, Currency[] currencies = null)
 {
     NetworkIdentifier = networkIdentifier;
     AccountIdentifier = accountIdentifier;
     BlockIdentifier   = blockIdentifier;
     Currencies        = currencies;
 }
 public static ConstructionCombineRequest FromJson(JObject json)
 {
     return(new ConstructionCombineRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                           json["unsigned_transaction"].AsString(),
                                           (json["signatures"] as JArray).Select(p => Signature.FromJson(p)).ToArray()
                                           ));
 }
Example #4
0
 public static AccountBalanceRequest FromJson(JObject json)
 {
     return(new AccountBalanceRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                      AccountIdentifier.FromJson(json["account_identifier"]),
                                      json.ContainsProperty("block_identifier") ? PartialBlockIdentifier.FromJson(json["block_identifier"]) : null,
                                      json.ContainsProperty("currencies") ? (json["currencies"] as JArray).Select(p => Currency.FromJson(p)).ToArray() : null));
 }
        public JObject NetworkList(MetadataRequest request)
        {
            NetworkIdentifier   networkIdentifier   = new NetworkIdentifier("neo n3", network);
            NetworkListResponse networkListResponse = new NetworkListResponse(new NetworkIdentifier[] { networkIdentifier });

            return(networkListResponse.ToJson());
        }
 public ConstructionMetadataRequest(NetworkIdentifier networkIdentifier, Metadata metadata = null, Metadata options = null, PublicKey[] publicKeys = null)
 {
     NetworkIdentifier = networkIdentifier;
     Metadata          = metadata;
     Options           = options;
     PublicKeys        = publicKeys;
 }
 public ConstructionPayloadsRequest(NetworkIdentifier networkIdentifier, Operation[] operations, Metadata metadata = null, PublicKey[] publicKeys = null)
 {
     NetworkIdentifier = networkIdentifier;
     Operations        = operations;
     Metadata          = metadata;
     PublicKeys        = publicKeys;
 }
Example #8
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"]     = NetworkIdentifier.ToJson();
            json["transaction_identifier"] = TransactionIdentifier.ToJson();
            return(json);
        }
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["block_identifier"]   = BlockIdentifier.ToJson();
            return(json);
        }
Example #10
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["signed_transaction"] = SignedTransaction;
            return(json);
        }
Example #11
0
 public static ConstructionPreprocessRequest FromJson(JObject json)
 {
     return(new ConstructionPreprocessRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                              (json["operations"] as JArray).Select(p => Operation.FromJson(p)).ToArray(),
                                              json.ContainsProperty("metadata") ? Metadata.FromJson(json["metadata"]) : null,
                                              json.ContainsProperty("max_fee") ? (json["max_fee"] as JArray).ToList().Select(p => Amount.FromJson(p)).ToArray() : null,
                                              json.ContainsProperty("suggested_fee_multiplier") ? json["suggested_fee_multiplier"].AsNumber() : null));
 }
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["options"]            = Options.ToJson();
            return(json);
        }
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["signed"]             = Signed.ToString().ToLower();
            json["transaction"]        = Transaction;
            return(json);
        }
Example #14
0
        }                                                   // not useful in neo

        public ConstructionPreprocessRequest(NetworkIdentifier networkIdentifier, Operation[] operations, Metadata metadata = null,
                                             Amount[] maxFee = null, double?suggestedFeeMultiplier = null)
        {
            NetworkIdentifier      = networkIdentifier;
            Operations             = operations;
            Metadata               = metadata;
            MaxFee                 = maxFee;
            SuggestedFeeMultiplier = suggestedFeeMultiplier;
        }
        public JObject NetworkList(MetadataRequest request)
        {
            var magic   = ProtocolSettings.Default.Magic;
            var network = magic == 7630401 ? "mainnet" : magic == 1953787457 ? "testnet" : "privatenet";
            NetworkIdentifier   networkIdentifier   = new NetworkIdentifier("neo", network);
            NetworkListResponse networkListResponse = new NetworkListResponse(new NetworkIdentifier[] { networkIdentifier });

            return(networkListResponse.ToJson());
        }
Example #16
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["operations"]         = Operations.Select(p => p.ToJson()).ToArray();
            if (Metadata != null && Metadata.ToJson() != null)
            {
                json["metadata"] = Metadata.ToJson();
            }
            return(json);
        }
Example #17
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["public_key"]         = PublicKey.ToJson();
            if (Metadata != null && Metadata.ToJson() != null)
            {
                json["metadata"] = Metadata.ToJson();
            }
            return(json);
        }
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            if (Metadata != null)
            {
                json["metadata"] = Metadata.ToJson();
            }
            if (Options != null)
            {
                json["options"] = Options.ToJson();
            }
            return(json);
        }
Example #19
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["network_identifier"] = NetworkIdentifier.ToJson();
            json["operations"]         = Operations.Select(p => p.ToJson()).ToArray();
            if (Metadata != null && Metadata.ToJson() != null)
            {
                json["metadata"] = Metadata.ToJson();
            }
            if (SuggestedFeeMultiplier.HasValue)
            {
                json["suggested_fee_multiplier"] = SuggestedFeeMultiplier.Value;
            }
            return(json);
        }
 public static ConstructionSubmitRequest FromJson(JObject json)
 {
     return(new ConstructionSubmitRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                          json["signed_transaction"].AsString()));
 }
 public static BlockRequest FromJson(JObject json)
 {
     return(new BlockRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                             PartialBlockIdentifier.FromJson(json["block_identifier"])));
 }
 public NetworkRequest(NetworkIdentifier networkIdentifier, Metadata metadata = null)
 {
     NetworkIdentifier = networkIdentifier;
     Metadata          = metadata;
 }
 public ConstructionCombineRequest(NetworkIdentifier networkIdentifier, string unsignedTransaction, Signature[] signatures)
 {
     NetworkIdentifier   = networkIdentifier;
     UnsignedTransaction = unsignedTransaction;
     Signatures          = signatures;
 }
 public ConstructionPreprocessRequest(NetworkIdentifier networkIdentifier, Operation[] operations, Metadata metadata = null)
 {
     NetworkIdentifier = networkIdentifier;
     Operations        = operations;
     Metadata          = metadata;
 }
Example #25
0
 public static ConstructionPayloadsRequest FromJson(JObject json)
 {
     return(new ConstructionPayloadsRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                            (json["operations"] as JArray).Select(p => Operation.FromJson(p)).ToArray(),
                                            json.ContainsProperty("metadata") ? Metadata.FromJson(json["metadata"]) : null));
 }
 public static NetworkRequest FromJson(JObject json)
 {
     return(new NetworkRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                               json.ContainsProperty("metadata") ? Metadata.FromJson(json["metadata"]) : null));
 }
 public static ConstructionParseRequest FromJson(JObject json)
 {
     return(new ConstructionParseRequest(NetworkIdentifier.FromJson(json["network_identifier"]),
                                         json["signed"].AsBoolean(),
                                         json["transaction"].AsString()));
 }
        }                                       // base64 string

        public ConstructionParseRequest(NetworkIdentifier networkIdentifier, bool signed, string transaction)
        {
            NetworkIdentifier = networkIdentifier;
            Signed            = signed;
            Transaction       = transaction;
        }
 public BlockRequest(NetworkIdentifier networkIdentifier, PartialBlockIdentifier blockIdentifier)
 {
     NetworkIdentifier = networkIdentifier;
     BlockIdentifier   = blockIdentifier;
 }
Example #30
0
 public ConstructionHashRequest(NetworkIdentifier networkIdentifier, string signedTransaction)
 {
     NetworkIdentifier = networkIdentifier;
     SignedTransaction = signedTransaction;
 }