Skip to content

Commit

Permalink
project files added
Browse files Browse the repository at this point in the history
  • Loading branch information
dPradellMoralis committed Feb 25, 2022
1 parent f77ad52 commit 62f41c0
Show file tree
Hide file tree
Showing 6,002 changed files with 695,539 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
825 changes: 825 additions & 0 deletions unity-web3rpg/Assembly-CSharp-Editor.csproj

Large diffs are not rendered by default.

2,031 changes: 2,031 additions & 0 deletions unity-web3rpg/Assembly-CSharp.csproj

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/DLLs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
33 changes: 33 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/DLLs/RestSharp.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/DeadRpcReadClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Threading.Tasks;
using Nethereum.JsonRpc.Client;

namespace MoralisWeb3ApiSdk
{
/// <summary>
///
/// </summary>
public class DeadRpcReadClient : IClient
{
private Action<string> messageHandler;
public DeadRpcReadClient(Action<string> msgHandler)
{
messageHandler = msgHandler;
}

public RequestInterceptor OverridingRequestInterceptor { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

public Task<T> SendRequestAsync<T>(RpcRequest request, string route = null)
{
if (messageHandler != null)
{
messageHandler($"Method {request.Method} is not supported by this RPC handler");
}

return null;
}

public Task<T> SendRequestAsync<T>(string method, string route = null, params object[] paramList)
{
if (messageHandler != null)
{
messageHandler($"Method {method} is not supported by this RPC handler");
}

return null;
}

public Task SendRequestAsync(RpcRequest request, string route = null)
{
if (messageHandler != null)
{
messageHandler($"Method {request.Method} is not supported by this RPC handler");
}

return null;
}

public Task SendRequestAsync(string method, string route = null, params object[] paramList)
{
if (messageHandler != null)
{
messageHandler($"Method {method} is not supported by this RPC handler");
}

return null;
}
}
}
11 changes: 11 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/DeadRpcReadClient.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/EvmContractInstance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Module: EvmContractInstance.cs
* Descriptiontion: Class that wraps specifica copontract / chain instnace
* Author: Moralis Web3 Technology AB, 559307-5988 - David B. Goodrich
*
* MIT License
*
* Copyright (c) 2021 Moralis Web3 Technology AB, 559307-5988
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using Assets.Scripts.Moralis;
using Nethereum.Contracts;

namespace MoralisWeb3ApiSdk
{
/// <summary>
/// Defines specific copontract / chain instnace
/// </summary>
public class EvmContractInstance
{
/// <summary>
/// Contract address on this chain.
/// </summary>
public string ContractAddress { get; set; }
/// <summary>
/// Contract Instance derived from ABI
/// </summary>
public Contract ContractInstance { get; set; }
/// <summary>
/// Evm Chain information.
/// </summary>
public ChainEntry ChainInfo { get; set; }
}
}
11 changes: 11 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/EvmContractInstance.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/EvmContractItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Module: EvmContractItem.cs
* Descriptiontion: Class that wraps a list on Nethereum contract instances by chain
* Author: Moralis Web3 Technology AB, 559307-5988 - David B. Goodrich
*
* MIT License
*
* Copyright (c) 2021 Moralis Web3 Technology AB, 559307-5988
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
using System.Collections.Generic;
using Assets.Scripts.Moralis;
using Nethereum.Contracts;
using Nethereum.Web3;

namespace MoralisWeb3ApiSdk
{
/// <summary>
/// Wraps a list on Nethereum contract instances by chain
/// </summary>
public class EvmContractItem
{
/// <summary>
/// the raw contract ABI
/// </summary>
public string Abi { get; set; }

/// <summary>
/// Contract instance by chain
/// </summary>
public Dictionary<string, EvmContractInstance> ChainContractMap { get; set; }

public EvmContractItem()
{
ChainContractMap = new Dictionary<string, EvmContractInstance>();
}

public EvmContractItem(Web3 client, string abi, string chainId, string contractAddress)
{
ChainContractMap = new Dictionary<string, EvmContractInstance>();
this.Abi = abi;

AddChainInstance(client, chainId, contractAddress);
}

/// <summary>
/// Add a contract instance for a specific chain.
/// </summary>
/// <param name="client"></param>
/// <param name="chainId"></param>
/// <param name="contractAddress"></param>
public void AddChainInstance(Web3 client, string chainId, string contractAddress)
{
if (!ChainContractMap.ContainsKey(chainId))
{
ChainEntry chainInfo = SupportedEvmChains.FromChainList(chainId);
Contract contractInstance = client.Eth.GetContract(this.Abi, contractAddress);
EvmContractInstance eci = new EvmContractInstance()
{
ChainInfo = chainInfo,
ContractAddress = contractAddress,
ContractInstance = contractInstance
};

ChainContractMap.Add(chainId, eci);
}
}
}
}
11 changes: 11 additions & 0 deletions unity-web3rpg/Assets/MoralisWeb3ApiSdk/EvmContractItem.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 62f41c0

Please sign in to comment.