Example #1
0
        /// <summary>
        /// return balance of NFT in batch address
        /// execute the return value with eth_call
        /// </summary>
        /// <param name="_transactionNonce"></param>
        /// <param name="_chainId"></param>
        /// <param name="_addr"></param>
        /// <param name="_id"></param>
        /// <returns></returns>
        public static string BalanceOf(Address _addr, uint _id)
        {
            ContractABI _abi = new ContractABI(Ethereum.EIP1155_METHOD_BALANCEOF);

            _abi.Add(_addr);
            _abi.Add(_id);
            return(_abi.ToString());
        }
Example #2
0
        public static string Burn(uint _transactionNonce, uint _chainId, Address _addrFrom, string _contractAddress, uint _nftId, uint _amount)
        {
            ContractABI _abi = new ContractABI(Ethereum.EIP1155_METHOD_BURN);

            _abi.Add(_addrFrom);
            _abi.Add(_nftId);
            _abi.Add(_amount);
            return(BuildSendDataTransaction(_transactionNonce, _chainId, _addrFrom.Private, _contractAddress, _abi.ToData()));
        }
Example #3
0
        public static string SafeBatchTransferFrom(uint _transactionNonce, uint _chainId, Address _addrFrom, Address _addrTo, string _contractAddress, Array _ids, Array _amounts, string _hexData)
        {
            ContractABI _abi = new ContractABI(Ethereum.EIP1155_METHOD_SAFEBATCHTRANSFERFROM);

            _abi.Add(_addrFrom);
            _abi.Add(_addrTo);
            _abi.Add(_ids);
            _abi.Add(_amounts);
            _abi.Add(new Number(_hexData));
            return(BuildSendDataTransaction(_transactionNonce, _chainId, _addrFrom.Private, _contractAddress, _abi.ToData()));
        }
Example #4
0
        /// <summary>
        /// return balance of NFT in address
        /// addrs.length=_ids.length
        /// execute the return value with eth_call
        /// </summary>
        /// <param name="_transactionNonce"></param>
        /// <param name="_chainId"></param>
        /// <param name="_addr"></param>
        /// <param name="_id"></param>
        /// <returns></returns>
        public static string BalanceOfBatch(Array _addrs, Array _ids)
        {
            if (_addrs.Length != _ids.Length)
            {
                throw new ArgumentException("Address length not equal ids length");
            }
            ContractABI _abi = new ContractABI(Ethereum.EIP1155_METHOD_BALANCEOFBATCH);

            _abi.Add(_addrs);
            _abi.Add(_ids);
            return(_abi.ToString());
        }
Example #5
0
        public static string BurnBatch(uint _transactionNonce, uint _chainId, Address _addrFrom, string _contractAddress, Array _nftIds, Array _amounts)
        {
            if (_nftIds.Length != _amounts.Length)
            {
                throw new ArgumentException("NFT ids length not equal amounts length");
            }
            ContractABI _abi = new ContractABI(Ethereum.EIP1155_METHOD_BURNBATCH);

            _abi.Add(_addrFrom);
            _abi.Add(_nftIds);
            _abi.Add(_amounts);
            return(BuildSendDataTransaction(_transactionNonce, _chainId, _addrFrom.Private, _contractAddress, _abi.ToData()));
        }