internal static RelatedTransaction DeserializeRelatedTransaction(JsonElement element) { Optional <NetworkIdentifier> networkIdentifier = default; TransactionIdentifier transactionIdentifier = default; Direction direction = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("network_identifier")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } networkIdentifier = NetworkIdentifier.DeserializeNetworkIdentifier(property.Value); continue; } if (property.NameEquals("transaction_identifier")) { transactionIdentifier = TransactionIdentifier.DeserializeTransactionIdentifier(property.Value); continue; } if (property.NameEquals("direction")) { direction = new Direction(property.Value.GetString()); continue; } } return(new RelatedTransaction(networkIdentifier.Value, transactionIdentifier, direction)); }
public NetworkRequest(NetworkIdentifier networkIdentifier) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } NetworkIdentifier = networkIdentifier; }
public ConstructionMetadataRequest(NetworkIdentifier networkIdentifier) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } NetworkIdentifier = networkIdentifier; PublicKeys = new ChangeTrackingList <PublicKey>(); }
public ConstructionDeriveRequest(NetworkIdentifier networkIdentifier, PublicKey publicKey) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (publicKey == null) { throw new ArgumentNullException(nameof(publicKey)); } NetworkIdentifier = networkIdentifier; PublicKey = publicKey; }
public MempoolTransactionRequest(NetworkIdentifier networkIdentifier, TransactionIdentifier transactionIdentifier) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (transactionIdentifier == null) { throw new ArgumentNullException(nameof(transactionIdentifier)); } NetworkIdentifier = networkIdentifier; TransactionIdentifier = transactionIdentifier; }
public ConstructionSubmitRequest(NetworkIdentifier networkIdentifier, string signedTransaction) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (signedTransaction == null) { throw new ArgumentNullException(nameof(signedTransaction)); } NetworkIdentifier = networkIdentifier; SignedTransaction = signedTransaction; }
public BlockRequest(NetworkIdentifier networkIdentifier, PartialBlockIdentifier blockIdentifier) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (blockIdentifier == null) { throw new ArgumentNullException(nameof(blockIdentifier)); } NetworkIdentifier = networkIdentifier; BlockIdentifier = blockIdentifier; }
public ConstructionParseRequest(NetworkIdentifier networkIdentifier, bool signed, string transaction) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (transaction == null) { throw new ArgumentNullException(nameof(transaction)); } NetworkIdentifier = networkIdentifier; Signed = signed; Transaction = transaction; }
public ConstructionPreprocessRequest(NetworkIdentifier networkIdentifier, IEnumerable <Operation> operations) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (operations == null) { throw new ArgumentNullException(nameof(operations)); } NetworkIdentifier = networkIdentifier; Operations = operations.ToList(); MaxFee = new ChangeTrackingList <Amount>(); }
public ConstructionPayloadsRequest(NetworkIdentifier networkIdentifier, IEnumerable <Operation> operations) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (operations == null) { throw new ArgumentNullException(nameof(operations)); } NetworkIdentifier = networkIdentifier; Operations = operations.ToList(); PublicKeys = new ChangeTrackingList <PublicKey>(); }
public AccountBalanceRequest(NetworkIdentifier networkIdentifier, AccountIdentifier accountIdentifier) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (accountIdentifier == null) { throw new ArgumentNullException(nameof(accountIdentifier)); } NetworkIdentifier = networkIdentifier; AccountIdentifier = accountIdentifier; Currencies = new ChangeTrackingList <Currency>(); }
public AccountCoinsRequest(NetworkIdentifier networkIdentifier, AccountIdentifier accountIdentifier, bool includeMempool) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (accountIdentifier == null) { throw new ArgumentNullException(nameof(accountIdentifier)); } NetworkIdentifier = networkIdentifier; AccountIdentifier = accountIdentifier; IncludeMempool = includeMempool; Currencies = new ChangeTrackingList <Currency>(); }
internal static NetworkListResponse DeserializeNetworkListResponse(JsonElement element) { IReadOnlyList <NetworkIdentifier> networkIdentifiers = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("network_identifiers")) { List <NetworkIdentifier> array = new List <NetworkIdentifier>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(NetworkIdentifier.DeserializeNetworkIdentifier(item)); } networkIdentifiers = array; continue; } } return(new NetworkListResponse(networkIdentifiers)); }
public CallRequest(NetworkIdentifier networkIdentifier, string method, object parameters) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (method == null) { throw new ArgumentNullException(nameof(method)); } if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } NetworkIdentifier = networkIdentifier; Method = method; Parameters = parameters; }
public ConstructionCombineRequest(NetworkIdentifier networkIdentifier, string unsignedTransaction, IEnumerable <Signature> signatures) { if (networkIdentifier == null) { throw new ArgumentNullException(nameof(networkIdentifier)); } if (unsignedTransaction == null) { throw new ArgumentNullException(nameof(unsignedTransaction)); } if (signatures == null) { throw new ArgumentNullException(nameof(signatures)); } NetworkIdentifier = networkIdentifier; UnsignedTransaction = unsignedTransaction; Signatures = signatures.ToList(); }
internal RelatedTransaction(NetworkIdentifier networkIdentifier, TransactionIdentifier transactionIdentifier, Direction direction) { NetworkIdentifier = networkIdentifier; TransactionIdentifier = transactionIdentifier; Direction = direction; }