Skip to content

Releases: ChainSafe/web3.unity

v1.0.14

16 Dec 19:38
Compare
Choose a tag to compare

Update prefab variable name: 22b44a2

v1.0.13

06 Dec 22:24
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
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
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
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
Compare
Choose a tag to compare

Remove gas price and gas limit.

The wallet automatically calculates it for the user.

v1.0.7

29 Oct 20:04
Compare
Choose a tag to compare

Prefab to generate data for custom contract

custom contract data

v1.0.6

18 Oct 22:58
Compare
Choose a tag to compare

This release allows users to add the own infura key for handling Wallet Connect

v1.0.5

12 Oct 16:34
Compare
Choose a tag to compare

This release fixes a bug with a user skipping the login screen and not having an account set.