diff --git a/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs b/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs index f5f37646..c2171ce2 100644 --- a/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs +++ b/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs @@ -4,6 +4,7 @@ using System.Numerics; using Sequence.Transactions; using UnityEngine; +using UnityEngine.Serialization; using StringExtensions = Sequence.Utils.StringExtensions; namespace Sequence.WaaS @@ -13,8 +14,8 @@ public class Transaction { public static readonly string WaaSZeroAddress = "0x0000000000000000000000000000000000000000"; public uint chainId; - public string from; - public string to; + [FormerlySerializedAs("from")] public string fromAddress; + [FormerlySerializedAs("to")] public string toAddress; public string autoGas; public BigInteger? nonce; public string value; @@ -24,15 +25,15 @@ public class Transaction public string[] tokenIds; public string[] tokenAmounts; - public Transaction(uint chainId, string from, string to, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null) + public Transaction(uint chainId, string fromAddress, string toAddress, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null) { this.chainId = chainId; - this.from = from; - if (to == StringExtensions.ZeroAddress) + this.fromAddress = fromAddress; + if (toAddress == StringExtensions.ZeroAddress) { - to = WaaSZeroAddress; + toAddress = WaaSZeroAddress; } - this.to = to; + this.toAddress = toAddress; this.autoGas = autoGas; this.nonce = nonce; this.value = value; @@ -43,15 +44,15 @@ public Transaction(uint chainId, string from, string to, string autoGas = null, this.tokenAmounts = tokenAmounts; } - public Transaction(Chain chainId, string from, string to, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null) + public Transaction(Chain chainId, string fromAddress, string toAddress, string autoGas = null, BigInteger? nonce = null, string value = null, string calldata = null, string tokenAddress = null, string tokenAmount = null, string[] tokenIds = null, string[] tokenAmounts = null) { this.chainId = (uint)chainId; - this.from = from; - if (to == StringExtensions.ZeroAddress) + this.fromAddress = fromAddress; + if (toAddress == StringExtensions.ZeroAddress) { - to = WaaSZeroAddress; + toAddress = WaaSZeroAddress; } - this.to = to; + this.toAddress = toAddress; this.autoGas = autoGas; this.nonce = nonce; this.value = value;