Skip to content

Releases: ChainSafe/web3.unity

v1.2.0

22 Jan 16:49
693b8b8
Compare
Choose a tag to compare
  • Version 1.2.0 now supports Mobile and Desktop builds via Web3Wallet
  • Mobile and Desktop Prefabs provided for SendTransaction - SignMessage - Transfer20 - Transfer721 - Transfer1155
  • There is a known bug in Android with environment not being checked correctly in some use cases and will be updated in the next release.

1.1.0

19 Jan 17:54
8e018f0
Compare
Choose a tag to compare

Release notes

  • Removed modal and now defaults to browser extension wallet i.e MetaMask
  • Variable name changed from networkId to web3ChainId
  • If you want to add a modal as in previous releases follow instructions in the WebGLTemplates folder file named readme.md for a guide on how to implement this.

We have also added a game-web3gl playground

v1.0.15

16 Jan 17:51
57b88dd
Compare
Choose a tag to compare

Removed JSON.Net dependency as this comes with newer versions of Unity3D. If you are using an older version of Unity and experiencing the error The type or namespace name 'Newtonsoft' when importing the SDK. You will need to install it manually from the Unity Asset Store with the link provided.

https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347

v1.0.14

16 Dec 19:38
56757cb
Compare
Choose a tag to compare

Update prefab variable name: 22b44a2

v1.0.13

06 Dec 22:24
25e3a49
Compare
Choose a tag to compare

Script and Prefab to get all of a user's NFTs (ERC721s and ERC1155s)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;

public class AllErc721Example : MonoBehaviour
{
    private class NFTs
    {
        public string contract { get; set; }
        public string tokenId { get; set; }
        public string uri { get; set; }
        public string balance { get; set; }
    }

    async void Start()
    {
        string chain = "ethereum";
        string network = "rinkeby"; // mainnet ropsten kovan rinkeby goerli
        string account = "0xebc0e6232fb9d494060acf580105108444f7c696";
        string contract = "";
        string response = await EVM.AllErc721(chain, network, account, contract);
        try
        {
            NFTs[] erc721s = JsonConvert.DeserializeObject<NFTs[]>(response);
            print(erc721s[0].contract);
            print(erc721s[0].tokenId);
            print(erc721s[0].uri);
            print(erc721s[0].balance);
        }
        catch
        {
           print("Error: " + response);
        }
    }
}

v1.0.12

19 Nov 18:21
9f45217
Compare
Choose a tag to compare

Update sending erc20, 721 and 1155 prefabs.
To use, drag and drop the prefab into the scene, build to webgl and run.

Screen Shot 2021-11-19 at 1 21 18 PM

v1.0.11

17 Nov 21:39
Compare
Choose a tag to compare

SDK now supports gas limit and gas price.

// account to send to
string to = "0x428066dd8A212104Bc9240dCe3cdeA3D3A0f7979";
// amount in wei to send
string value = "12300000000000000";
// gas limit OPTIONAL
string gasLimit = "";
// gas price OPTIONAL
string gasPrice = "";
// connects to user's browser wallet (metamask) to send a transaction
try {
    string response = await Web3GL.SendTransaction(to, value, gasLimit, gasPrice);
    Debug.Log(response);
} catch (Exception e) {
    Debug.LogException(e, this);
}

v1.0.10

15 Nov 18:34
8f72b1b
Compare
Choose a tag to compare

Dynamic multicall for any EVM chain/network

example here

async void Start()
{
    string chain = "anyChain";
    string network = "anyNetwork";
    string contract = "0xA74E199990FF572A320508547Ab7f44EA51e6F28";
    string[] tokenIds = {"700", "791"};
    string multicall = "0xMulticallContractAddress"; // optional: multicall contract https://github.com/makerdao/multicall
    string rpc = "https://anyrpc.com"; // optional: custom rpc

    List<string> batchOwners = await ERC721.OwnerOfBatch(chain, network, contract, tokenIds, multicall, rpc);
    foreach (string owner in batchOwners)
    {
        print ("OwnerOfBatch: " + owner);
    }
}

v1.0.9

11 Nov 22:37
3c9e9fa
Compare
Choose a tag to compare
Web3.unity.v1.0.9.mov

To get user's current network
https://chainsafe.github.io/game-docs/#get-users-network

v1.0.8

04 Nov 12:38
4e4a592
Compare
Choose a tag to compare

Remove gas price and gas limit.

The wallet automatically calculates it for the user.