From f4a6671699754db72d3d36145b71c29ba773619e Mon Sep 17 00:00:00 2001 From: Quinn Purdy Date: Mon, 18 Dec 2023 10:19:21 -0500 Subject: [PATCH 1/4] Remove extra semicolon --- Assets/SequenceSDK/Core/Signature/Digest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/SequenceSDK/Core/Signature/Digest.cs b/Assets/SequenceSDK/Core/Signature/Digest.cs index 758a9da3..602409ef 100644 --- a/Assets/SequenceSDK/Core/Signature/Digest.cs +++ b/Assets/SequenceSDK/Core/Signature/Digest.cs @@ -38,7 +38,7 @@ public static Digest NewDigest(params string[] messages) return (new ImageHash() { Hash = new Hash(hashBytes), - }, null);; + }, null); } // Subdigest derives the hash to be signed by the Sequence wallet's signers to validate the digest. From d8c4a7fc587007bb248a645c9489eb3f759618c2 Mon Sep 17 00:00:00 2001 From: Quinn Purdy Date: Mon, 18 Dec 2023 10:21:09 -0500 Subject: [PATCH 2/4] Create SignMessageArgs with Chain --- .../WaaS/DataTypes/ParameterTypes/SignMessageArgs.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Assets/SequenceSDK/WaaS/DataTypes/ParameterTypes/SignMessageArgs.cs b/Assets/SequenceSDK/WaaS/DataTypes/ParameterTypes/SignMessageArgs.cs index 55a6f1f2..7692b08e 100644 --- a/Assets/SequenceSDK/WaaS/DataTypes/ParameterTypes/SignMessageArgs.cs +++ b/Assets/SequenceSDK/WaaS/DataTypes/ParameterTypes/SignMessageArgs.cs @@ -15,5 +15,12 @@ public SignMessageArgs(uint chainId, string walletAddress, string message) this.walletAddress = walletAddress; this.message = message; } + + public SignMessageArgs(Chain chainId, string walletAddress, string message) + { + this.chainId = (uint)chainId; + this.walletAddress = walletAddress; + this.message = message; + } } } \ No newline at end of file From 16f485fae650a1e19cab3339b2de05475e5d050c Mon Sep 17 00:00:00 2001 From: Quinn Purdy Date: Mon, 18 Dec 2023 10:22:07 -0500 Subject: [PATCH 3/4] Create Transaction with Chain --- .../SequenceSDK/WaaS/DataTypes/Transaction.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs b/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs index 43c1e96b..f5f37646 100644 --- a/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs +++ b/Assets/SequenceSDK/WaaS/DataTypes/Transaction.cs @@ -42,5 +42,24 @@ public Transaction(uint chainId, string from, string to, string autoGas = null, this.tokenIds = tokenIds; 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) + { + this.chainId = (uint)chainId; + this.from = from; + if (to == StringExtensions.ZeroAddress) + { + to = WaaSZeroAddress; + } + this.to = to; + this.autoGas = autoGas; + this.nonce = nonce; + this.value = value; + this.calldata = calldata; + this.tokenAddress = tokenAddress; + this.tokenAmount = tokenAmount; + this.tokenIds = tokenIds; + this.tokenAmounts = tokenAmounts; + } } } From 7a1682322fc8f2cccf550f2a33fbe2982cdd5713 Mon Sep 17 00:00:00 2001 From: Quinn Purdy Date: Mon, 18 Dec 2023 10:49:13 -0500 Subject: [PATCH 4/4] Rename vairable in constructor to make it more reader friendly --- .../SequenceSDK/WaaS/DataTypes/Transaction.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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;