Пример #1
0
        internal static ConstructionPayloadsResponse DeserializeConstructionPayloadsResponse(JsonElement element)
        {
            string unsignedTransaction = default;
            IReadOnlyList <SigningPayload> payloads = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("unsigned_transaction"))
                {
                    unsignedTransaction = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("payloads"))
                {
                    List <SigningPayload> array = new List <SigningPayload>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SigningPayload.DeserializeSigningPayload(item));
                    }
                    payloads = array;
                    continue;
                }
            }
            return(new ConstructionPayloadsResponse(unsignedTransaction, payloads));
        }
Пример #2
0
        public Signature(SigningPayload signingPayload, PublicKey publicKey, SignatureType signatureType, string hexBytes)
        {
            if (signingPayload == null)
            {
                throw new ArgumentNullException(nameof(signingPayload));
            }
            if (publicKey == null)
            {
                throw new ArgumentNullException(nameof(publicKey));
            }
            if (hexBytes == null)
            {
                throw new ArgumentNullException(nameof(hexBytes));
            }

            SigningPayload = signingPayload;
            PublicKey      = publicKey;
            SignatureType  = signatureType;
            HexBytes       = hexBytes;
        }