这是indexloc提供的服务,不要输入任何密码
Skip to content

Releases: ChainSafe/web3.unity

v1.0.15

16 Jan 17:51

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

Choose a tag to compare

Update prefab variable name: 22b44a2

v1.0.13

06 Dec 22:24

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

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

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

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

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

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

Choose a tag to compare

Prefab to generate data for custom contract

custom contract data

v1.0.6

18 Oct 22:58

Choose a tag to compare

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