Example #1
0
 public AccountBalanceRequest(NetworkIdentifier networkIdentifier, AccountIdentifier accountIdentifier, PartialBlockIdentifier blockIdentifier = null, Currency[] currencies = null)
 {
     NetworkIdentifier = networkIdentifier;
     AccountIdentifier = accountIdentifier;
     BlockIdentifier   = blockIdentifier;
     Currencies        = currencies;
 }
Example #2
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));
 }
Example #3
0
 public static Operation FromJson(JObject json)
 {
     return(new Operation(OperationIdentifier.FromJson(json["operation_identifier"]),
                          json["type"].AsString(),
                          json["status"].AsString(),
                          json.ContainsProperty("related_operations") ? (json["related_operations"] as JArray).Select(p => OperationIdentifier.FromJson(p)).ToArray() : null,
                          json.ContainsProperty("account") ? AccountIdentifier.FromJson(json["account"]) : null,
                          json.ContainsProperty("amount") ? Amount.FromJson(json["amount"]) : null,
                          json.ContainsProperty("coin_change") ? CoinChange.FromJson(json["coin_change"]) : null,
                          json.ContainsProperty("metadata") ? Metadata.FromJson(json["metadata"]) : null));
 }
Example #4
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            if (AccountIdentifier != null)
            {
                json["account_identifier"] = AccountIdentifier.ToJson();
            }
            json["hex_bytes"]      = HexBytes;
            json["signature_type"] = SignatureType.AsString();
            return(json);
        }
Example #5
0
 public Operation(OperationIdentifier operationIdentifier, string type, string status,
                  OperationIdentifier[] relatedOperations = null, AccountIdentifier account = null,
                  Amount amount = null, CoinChange coinChange = null, Metadata metadata = null)
 {
     OperationIdentifier = operationIdentifier;
     RelatedOperations   = relatedOperations;
     Type       = type;
     Status     = status;
     Account    = account;
     Amount     = amount;
     CoinChange = coinChange;
     Metadata   = metadata;
 }
        public JObject ToJson()
        {
            JObject json = new JObject();

            if (AccountIdentifier != null && AccountIdentifier.ToJson() != null)
            {
                json["account_identifier"] = AccountIdentifier.ToJson();
            }
            if (Metadata != null && Metadata.ToJson() != null)
            {
                json["metadata"] = Metadata.ToJson();
            }
            return(json);
        }
Example #7
0
 public static SigningPayload FromJson(JObject json)
 {
     return(new SigningPayload(json["hex_bytes"].AsString(),
                               json.ContainsProperty("account_identifier") ? AccountIdentifier.FromJson(json["account_identifier"]) : null,
                               json["signature_type"].ToSignatureType()));
 }
Example #8
0
 public SigningPayload(string hexBytes, AccountIdentifier accountIdentifier = null, SignatureType signatureType = SignatureType.Ecdsa)
 {
     AccountIdentifier = accountIdentifier;
     HexBytes          = hexBytes;
     SignatureType     = signatureType;
 }
 public ConstructionDeriveResponse(AccountIdentifier accountIdentifier = null, Metadata metadata = null)
 {
     AccountIdentifier = accountIdentifier;
     Metadata          = metadata;
 }
 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));
 }
 public AccountBalanceRequest(NetworkIdentifier networkIdentifier, AccountIdentifier accountIdentifier, PartialBlockIdentifier blockIdentifier = null)
 {
     NetworkIdentifier = networkIdentifier;
     AccountIdentifier = accountIdentifier;
     BlockIdentifier   = blockIdentifier;
 }