diff --git a/Packages/io.chainsafe.web3-unity/Tests/Runtime/MiscTests.cs b/Packages/io.chainsafe.web3-unity/Tests/Runtime/MiscTests.cs
index 13a019903..749377af0 100644
--- a/Packages/io.chainsafe.web3-unity/Tests/Runtime/MiscTests.cs
+++ b/Packages/io.chainsafe.web3-unity/Tests/Runtime/MiscTests.cs
@@ -152,7 +152,7 @@ public IEnumerator TestTransactionStatus()
[UnityTest]
public IEnumerator TestMint721()
{
- config.TestResponse = "0xa9f953f9845e7d49d778d6fed622d566daf09e8e1c793297c7cab54782e1aae9";
+ config.TestResponse = "0xd3027fbfd9d5ddb5ea0ef75f5b128581d9268ad67728d150657f915c8910f9f0";
var mint721 = _sample.Mint721(Mint721Abi, Mint721Address, MintUri);
diff --git a/src/ChainSafe.Gaming.InProcessSigner/InProcessSigner.cs b/src/ChainSafe.Gaming.InProcessSigner/InProcessSigner.cs
index eff840db2..f3148e18e 100644
--- a/src/ChainSafe.Gaming.InProcessSigner/InProcessSigner.cs
+++ b/src/ChainSafe.Gaming.InProcessSigner/InProcessSigner.cs
@@ -10,11 +10,19 @@
namespace ChainSafe.Gaming.InProcessSigner
{
+ ///
+ /// Concrete Implementation of that uses a Private Key to sign messages and typed data.
+ ///
public class InProcessSigner : ISigner
{
private EthECKey privateKey;
private EthereumMessageSigner messageSigner;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected Config for signer containing a private key.
+ /// Throws Exception if initializing instance fails.
public InProcessSigner(InProcessSignerConfig config)
{
privateKey = config.PrivateKey ??
@@ -22,11 +30,27 @@ public InProcessSigner(InProcessSignerConfig config)
messageSigner = new();
}
+ ///
+ /// Implementation of using In Process.
+ ///
+ /// Public address of signer.
public Task GetAddress() => Task.FromResult(privateKey.GetPublicAddress());
+ ///
+ /// Implementation of using In Process.
+ ///
+ /// Message to be signed.
+ /// Hash response of a successfully signed message.
public Task SignMessage(string message) =>
Task.FromResult(messageSigner.EncodeUTF8AndSign(message, privateKey));
+ ///
+ /// Implementation of using In Process.
+ ///
+ /// Serializable domain for signing typed data.
+ /// Message/Data to be signed.
+ /// Type of Data to be signed.
+ /// Hash response of a successfully signed typed data.
public Task SignTypedData(SerializableDomain domain, TStructType message)
{
var primaryType = typeof(TStructType).Name;
@@ -45,6 +69,10 @@ public Task SignTypedData(SerializableDomain domain, TStruc
return Task.FromResult(Eip712TypedDataSigner.Current.SignTypedDataV4(typedData, privateKey));
}
+ ///
+ /// Get private key of .
+ ///
+ /// Private key of .
public EthECKey GetKey() => privateKey;
}
}
diff --git a/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerConfig.cs b/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerConfig.cs
index 59c4c04ee..b17f3e052 100644
--- a/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerConfig.cs
+++ b/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerConfig.cs
@@ -1,9 +1,16 @@
-using Nethereum.Signer;
+using ChainSafe.Gaming.Evm.Signers;
+using Nethereum.Signer;
namespace ChainSafe.Gaming.InProcessSigner
{
+ ///
+ /// Config for .
+ ///
public class InProcessSignerConfig
{
+ ///
+ /// Private key of .
+ ///
public EthECKey? PrivateKey { get; set; }
}
}
diff --git a/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerExtensions.cs b/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerExtensions.cs
index a8bdefa9f..a6a412d83 100644
--- a/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerExtensions.cs
+++ b/src/ChainSafe.Gaming.InProcessSigner/InProcessSignerExtensions.cs
@@ -5,8 +5,17 @@
namespace ChainSafe.Gaming.InProcessSigner
{
+ ///
+ /// extension methods.
+ ///
public static class InProcessSignerExtensions
{
+ ///
+ /// Bind as and a to .
+ ///
+ /// Service Collection to bind services to.
+ /// Config used by .
+ /// The same service collection that was passed in. This enables fluent style.
public static IWeb3ServiceCollection UseInProcessSigner(this IWeb3ServiceCollection collection, InProcessSignerConfig configuration)
{
collection.UseInProcessSigner();
@@ -14,6 +23,11 @@ public static IWeb3ServiceCollection UseInProcessSigner(this IWeb3ServiceCollect
return collection;
}
+ ///
+ /// Bind as to .
+ ///
+ /// Service Collection to bind services to.
+ /// The same service collection that was passed in. This enables fluent style.
public static IWeb3ServiceCollection UseInProcessSigner(this IWeb3ServiceCollection collection)
{
collection.AssertServiceNotBound();
@@ -21,6 +35,12 @@ public static IWeb3ServiceCollection UseInProcessSigner(this IWeb3ServiceCollect
return collection;
}
+ ///
+ /// Binds a to .
+ ///
+ /// Service Collection to bind services to.
+ /// Config used by .
+ /// The same service collection that was passed in. This enables fluent style.
public static IWeb3ServiceCollection ConfigureInProcessSigner(this IWeb3ServiceCollection collection, InProcessSignerConfig configuration)
{
collection.Replace(ServiceDescriptor.Singleton(typeof(InProcessSignerConfig), configuration));
diff --git a/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutor.cs b/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutor.cs
index d3c833c69..067f958ad 100644
--- a/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutor.cs
+++ b/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutor.cs
@@ -13,12 +13,22 @@
namespace ChainSafe.Gaming.InProcessTransactionExecutor
{
+ ///
+ /// Concrete Implementation of that uses a private key to execute transactions.
+ ///
public class InProcessTransactionExecutor : ITransactionExecutor
{
private readonly NWeb3 web3;
private readonly IRpcProvider rpcProvider;
private readonly string accountAddress;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected .
+ /// Injected .
+ /// Injected .
+ /// Throws exception if initializing instance fails.
public InProcessTransactionExecutor(ISigner signer, IChainConfig chainConfig, IRpcProvider rpcProvider)
{
// It should be possible to set up other signers to work with this as well.
@@ -45,6 +55,14 @@ public InProcessTransactionExecutor(ISigner signer, IChainConfig chainConfig, IR
this.rpcProvider = rpcProvider;
}
+ ///
+ /// Implementation of .
+ /// Send a transaction using Wallet Connect.
+ /// This prompts user to approve a transaction on a connected wallet.
+ ///
+ /// Transaction to send.
+ /// Hash response of a successfully executed transaction.
+ /// Throws Exception if executing transaction fails.
public async Task SendTransaction(TransactionRequest transaction)
{
if (string.IsNullOrEmpty(transaction.From))
diff --git a/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutorExtensions.cs b/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutorExtensions.cs
index 44f7584e6..143cf19b2 100644
--- a/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutorExtensions.cs
+++ b/src/ChainSafe.Gaming.InProcessTransactionExecutor/InProcessTransactionExecutorExtensions.cs
@@ -4,8 +4,16 @@
namespace ChainSafe.Gaming.InProcessTransactionExecutor
{
+ ///
+ /// Extension methods for .
+ ///
public static class InProcessTransactionExecutorExtensions
{
+ ///
+ /// Binds implementation of as to Web3 as a service.
+ ///
+ /// Service collection to bind implementations to.
+ /// The same service collection that was passed in. This enables fluent style.
public static IWeb3ServiceCollection UseInProcessSigner(this IWeb3ServiceCollection collection)
{
collection.AssertServiceNotBound();
diff --git a/src/ChainSafe.Gaming.NetCore/ChainConfig.cs b/src/ChainSafe.Gaming.NetCore/ChainConfig.cs
index 2f2e5661e..bc4bf2648 100644
--- a/src/ChainSafe.Gaming.NetCore/ChainConfig.cs
+++ b/src/ChainSafe.Gaming.NetCore/ChainConfig.cs
@@ -2,18 +2,46 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// Concrete Implementation of .
+ /// Holds all config files related to chain and network.
+ ///
public class ChainConfig : IChainConfig
{
+ ///
+ /// Implementation of
+ /// Chain Id, eg. "5" for Goerli.
+ ///
public string ChainId { get; set; }
+ ///
+ /// Implementation of
+ /// Chain, for eg. "Ethereum".
+ ///
public string Chain { get; set; }
+ ///
+ /// Implementation of
+ /// Specific Chain Network, eg. "mainnet" or "goerli".
+ ///
public string Network { get; set; }
+ ///
+ /// Implementation of
+ /// RPC node link.
+ ///
public string Rpc { get; set; }
+ ///
+ /// Implementation of
+ /// IPC link.
+ ///
public string Ipc { get; set; }
+ ///
+ /// Implementation of
+ /// WebSocket link.
+ ///
public string Ws { get; set; }
}
}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.NetCore/NetCoreEnvironmentExtensions.cs b/src/ChainSafe.Gaming.NetCore/NetCoreEnvironmentExtensions.cs
index 7a3d24cdd..1deb59707 100644
--- a/src/ChainSafe.Gaming.NetCore/NetCoreEnvironmentExtensions.cs
+++ b/src/ChainSafe.Gaming.NetCore/NetCoreEnvironmentExtensions.cs
@@ -5,8 +5,17 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// NetCore environment extension.
+ /// Binds implementations to Web3 as a service for NetCore environment.
+ ///
public static class NetCoreEnvironmentExtensions
{
+ ///
+ /// Binds implementation of , and to Web3 as a service for NetCore environment.
+ ///
+ /// Service collection to bind implementations to.
+ /// The same service collection that was passed in. This enables fluent style.
public static IWeb3ServiceCollection UseNetCoreEnvironment(this IWeb3ServiceCollection services)
{
services.UseApiAnalytics();
diff --git a/src/ChainSafe.Gaming.NetCore/NetCoreHttpClient.cs b/src/ChainSafe.Gaming.NetCore/NetCoreHttpClient.cs
index 986d43acd..a666b4b5d 100644
--- a/src/ChainSafe.Gaming.NetCore/NetCoreHttpClient.cs
+++ b/src/ChainSafe.Gaming.NetCore/NetCoreHttpClient.cs
@@ -7,10 +7,16 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// Implementation of for NetCore environment.
+ ///
public class NetCoreHttpClient : IHttpClient
{
private readonly HttpClient originalClient;
+ ///
+ /// Initializes a new instance of the class.
+ ///
public NetCoreHttpClient()
{
originalClient = new HttpClient();
@@ -28,12 +34,24 @@ private static async ValueTask> ResponseToNetworkRespons
}
}
+ ///
+ /// Get Raw response from http request with a GET method.
+ ///
+ /// Url of request to be made.
+ /// Raw response to the request.
public async ValueTask> GetRaw(string url)
{
var response = await originalClient.GetAsync(url);
return await ResponseToNetworkResponse(response);
}
+ ///
+ /// Get Raw response from http request with a POST method.
+ ///
+ /// Url of request to be made.
+ /// Request data/body.
+ /// Content type request header.
+ /// Raw response to the request.
public async ValueTask> PostRaw(string url, string data, string contentType)
{
var requestContent = new StringContent(data, Encoding.UTF8, contentType);
@@ -41,12 +59,26 @@ public async ValueTask> PostRaw(string url, string data,
return await ResponseToNetworkResponse(response);
}
+ ///
+ /// Get response as from http request with a GET method.
+ ///
+ /// Url of request to be made.
+ /// Response body model type.
+ /// Response as a .
public async ValueTask> Get(string url)
{
var response = await GetRaw(url);
return response.Map(x => JsonConvert.DeserializeObject(x));
}
+ ///
+ /// Get response as from http request with a GET method.
+ ///
+ /// Url of request to be made.
+ /// Request data/body.
+ /// Request data/body model type.
+ /// Response data/body type.
+ /// Response as a .
public async ValueTask> Post(string url, TRequest data)
{
var requestJson = JsonConvert.SerializeObject(data);
diff --git a/src/ChainSafe.Gaming.NetCore/NetCoreLogWriter.cs b/src/ChainSafe.Gaming.NetCore/NetCoreLogWriter.cs
index 37a11ce09..56ca4cde7 100644
--- a/src/ChainSafe.Gaming.NetCore/NetCoreLogWriter.cs
+++ b/src/ChainSafe.Gaming.NetCore/NetCoreLogWriter.cs
@@ -3,13 +3,24 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// Implementation of for NetCore environment.
+ ///
public class NetCoreLogWriter : ILogWriter
{
+ ///
+ /// Log message.
+ ///
+ /// Message to be logged.
public void Log(string message)
{
Console.WriteLine(FormatMessage(message, "INFO"));
}
+ ///
+ /// Log error message.
+ ///
+ /// Error message to be logged.
public void LogError(string message)
{
Console.WriteLine(FormatMessage(message, "ERROR"));
diff --git a/src/ChainSafe.Gaming.NetCore/NetCoreOperatingSystemMediator.cs b/src/ChainSafe.Gaming.NetCore/NetCoreOperatingSystemMediator.cs
index 7c0ee785b..5cd20bc4d 100644
--- a/src/ChainSafe.Gaming.NetCore/NetCoreOperatingSystemMediator.cs
+++ b/src/ChainSafe.Gaming.NetCore/NetCoreOperatingSystemMediator.cs
@@ -2,12 +2,28 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// Implementation of for NetCore environment.
+ ///
public class NetCoreOperatingSystemMediator : IOperatingSystemMediator
{
+ ///
+ /// Is platform on Mobile or not.
+ ///
+ /// Not Implemented.
public bool IsMobilePlatform => throw new System.NotImplementedException();
+ ///
+ /// Current Platform enum.
+ ///
+ /// Not Implemented.
public Platform Platform => throw new System.NotImplementedException();
+ ///
+ /// Open a Url using Http for .NetCore environment.
+ ///
+ /// Url to open.
+ /// Not Implemented.
public void OpenUrl(string url) => throw new System.NotImplementedException();
}
}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.NetCore/ProjectConfig.cs b/src/ChainSafe.Gaming.NetCore/ProjectConfig.cs
index 96753b87d..0b0f0426d 100644
--- a/src/ChainSafe.Gaming.NetCore/ProjectConfig.cs
+++ b/src/ChainSafe.Gaming.NetCore/ProjectConfig.cs
@@ -2,8 +2,15 @@
namespace ChainSafe.Gaming.NetCore
{
+ ///
+ /// Implementation of for NetCore environment.
+ ///
public class ProjectConfig : IProjectConfig
{
+ ///
+ /// Implementation of
+ /// Project Id fetched from the ChainSafe Gaming web dashboard.
+ ///
public string ProjectId { get; set; }
}
}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.WalletConnect/IWalletConnectCustomProvider.cs b/src/ChainSafe.Gaming.WalletConnect/IWalletConnectCustomProvider.cs
index 6d1ad4a32..3b55b3f0c 100644
--- a/src/ChainSafe.Gaming.WalletConnect/IWalletConnectCustomProvider.cs
+++ b/src/ChainSafe.Gaming.WalletConnect/IWalletConnectCustomProvider.cs
@@ -2,12 +2,15 @@
namespace ChainSafe.Gaming.WalletConnect
{
+ ///
+ /// Connect and disconnect to a wallet via Wallet Connect and make a Json RPC request.
+ ///
public interface IWalletConnectCustomProvider
{
///
- /// connects using Wallet Connect.
+ /// Connects using Wallet Connect.
///
- /// connect address.
+ /// Connected address.
public Task Connect();
///
@@ -22,7 +25,7 @@ public interface IWalletConnectCustomProvider
///
/// Disconnect from a Wallet Connect Session.
///
- /// Disconnect Task.
+ /// Disconnect async Task.
public Task Disconnect();
}
}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSendTransaction.cs b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSendTransaction.cs
index 25c8fe51f..3e2ee0f05 100644
--- a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSendTransaction.cs
+++ b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSendTransaction.cs
@@ -5,15 +5,26 @@
namespace ChainSafe.Gaming.WalletConnect.Methods
{
+ ///
+ /// Send Transaction Wallet Connect Json RPC method params.
+ ///
[RpcMethod("eth_sendTransaction")]
[RpcRequestOptions(Clock.ONE_MINUTE, 99999)]
public class EthSendTransaction : List
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Transaction to be sent.
public EthSendTransaction(params TransactionModel[] transactions)
: base(transactions)
{
}
+ ///
+ /// Initializes a new instance of the class used by json.net.
+ /// Preserved for Unity using ChainSafe.Gaming.Unity/link.xml.
+ ///
public EthSendTransaction()
{
}
diff --git a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignMessage.cs b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignMessage.cs
index 38d4ebef1..8726ebbfd 100644
--- a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignMessage.cs
+++ b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignMessage.cs
@@ -4,15 +4,27 @@
namespace ChainSafe.Gaming.WalletConnect.Methods
{
+ ///
+ /// Sign message Wallet Connect Json RPC method params.
+ ///
[RpcMethod("personal_sign")]
[RpcRequestOptions(Clock.ONE_MINUTE, 99997)]
public class EthSignMessage : List
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Message to be sent.
+ /// Public Address of signer.
public EthSignMessage(string message, string address)
: base(new string[] { message, address })
{
}
+ ///
+ /// Initializes a new instance of the class used by json.net.
+ /// Preserved for Unity using ChainSafe.Gaming.Unity/link.xml.
+ ///
public EthSignMessage()
{
}
diff --git a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTransaction.cs b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTransaction.cs
index 3afc6e41f..01c08682d 100644
--- a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTransaction.cs
+++ b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTransaction.cs
@@ -5,15 +5,26 @@
namespace ChainSafe.Gaming.WalletConnect.Methods
{
+ ///
+ /// Sign Transaction Wallet Connect Json RPC method params.
+ ///
[RpcMethod("eth_signTransaction")]
[RpcRequestOptions(Clock.ONE_MINUTE, 99996)]
public class EthSignTransaction : List
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Transaction to be signed.
public EthSignTransaction(params TransactionModel[] transactions)
: base(transactions)
{
}
+ ///
+ /// Initializes a new instance of the class used by json.net.
+ /// Preserved for Unity using ChainSafe.Gaming.Unity/link.xml.
+ ///
public EthSignTransaction()
{
}
diff --git a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTypedData.cs b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTypedData.cs
index 84288cf78..dbd386636 100644
--- a/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTypedData.cs
+++ b/src/ChainSafe.Gaming.WalletConnect/Methods/EthSignTypedData.cs
@@ -6,10 +6,20 @@
namespace ChainSafe.Gaming.WalletConnect.Methods
{
+ ///
+ /// Sign Typed Data Wallet Connect Json RPC method params.
+ ///
+ /// Type of data to be signed.
[RpcMethod("eth_signTypedData")]
[RpcRequestOptions(Clock.ONE_MINUTE, 99998)]
public class EthSignTypedData : List