Giter Site home page Giter Site logo

Comments (9)

m-kus avatar m-kus commented on August 21, 2024 2

Custom API makes sense once you need aggregations, custom response models, merging with external feeds, etc. For basic things like querying balances + metadata TzKT is more than enough. Making a separate indexer is extra developing and maintenance costs one would prob want to avoid.

I would also rename this task to high-level api for reading fa2 data, as now it implies that this is something related with preparing/injecting transactions rather than accessing indexed data.

We can do high-level interface that exposes necessary info which is hiding the tzkt usage underneath so that it can optionally be switched to something else if necessary.

from tezos-unity-sdk.

SamuelAsherRivello avatar SamuelAsherRivello commented on August 21, 2024 1

Ticket looks great.

I will soon work on a "Tezos SDK For Unity Examples Project" with a few isolated demos. One will be "Does the current authenticated user have this specific NFT?" which I will solve with C# on top of the SDK.

For context, I have 20 years game dev experience, 1.5 year of Web3 experience, and 2 weeks of Tezos experience.

Here are some tangentially related Unity C# API's of (Does user X have asset Y?) from some competitive SDKs. I provide this as inspiration, not necessarily a prescription for a particular solution.

If I can offer a helpful video chat to anyone, please reach out on Tezos Slack. My Tezos Slack profile has my hours of availability.

Enjoy!

Inspiration

Inspirational SDK APIs

  • ChainSafe - await ERC1155.BalanceOf(contract, account, tokenId);
  • Loom - await contract.StaticCallAsync<MapEntry>("GetMsg");
  • ThirdWeb - await blah.getOwned();
  • Ankr - await _erc721Contract.GetData<BalanceOfMessage, BigInteger>(balanceOfMessage);

More

Pseudocode

I have only casual familiarity of the backend complexity of this ticket. For conversations' sake, here is the approach to API shape I have used when solving something similar in non-Tezos SDKs.

The following is pseudocode for one of my own non-Tezos SDKs.

namespace RMC.Core.Samples
{
    public class Example01_SmartContractCallAsync : MonoBehaviour
    {
        private const bool IsLogging = true;

        
        //  Unity Methods  --------------------------------
        protected async void Start()
        {
            // Init
            await CustomWeb3System.Instance.InitializeAsync();
            
            // Check Auth
            bool isAuthenticated = CustomWeb3System.Instance.IsAuthenticated;
            if (!isAuthenticated)
            {
                //Stop scene, go auth, come back
                throw new NotAuthenticatedException(this);
            }
            
            await SmartContractCallRequest1();
        }


        //  Methods ---------------------------------------
        private async UniTask SmartContractCallRequest1()
        {
            ISmartContractCallRequest smartContractCallRequest = new GetGoldPointsRequest();
            
            ISmartContractCallResponse<int> smartContractCallResponse = 
                await CustomWeb3System.Instance.SmartContractCallAsync<int>(smartContractCallRequest, IsLogging);

            if (smartContractCallResponse.IsError)
            {
                Debug.LogError(smartContractCallResponse.ErrorMessage);
            }
            else
            {
                Debug.Log($"High-Level, getGoldPoints result = {smartContractCallResponse.Result}");
            }
        }
    }
}

TAG
#PriorityForSam

from tezos-unity-sdk.

zamrokk avatar zamrokk commented on August 21, 2024

avoid putting unnecessary load on tzkt

Why ? Goal of an indexer is to be enough robust to support any request like Google does

  • With doing an unique call at startup/caching would decrease workload
  • I doubt we will have heavy volume right now, btw

Objkt's minting Factory <= so first version would be to mint all NFT manually on Objkt ?

from tezos-unity-sdk.

Groxan avatar Groxan commented on August 21, 2024

avoid putting unnecessary load on tzkt

Why ? Goal of an indexer is to be enough robust to support any request like Google does

That's not the goal of the indexer. The goal is to provide you with flexible access to the blockchain data. Robustness is an absolutely different thing, that directly depends on the resources you are willing to spend. So, let's be more responsible, because the less efficient code you write, the greater someone's expenses ;)

like Google does

Interesting expectations πŸ˜„ Do you realize how much resources Google spends to handle the load?

from tezos-unity-sdk.

zamrokk avatar zamrokk commented on August 21, 2024

from tezos-unity-sdk.

Groxan avatar Groxan commented on August 21, 2024

Right. Nevertheless, I don't think customers will be happy, paying for actually unnecessary things. Like, for example, paying for 100k requests per day, while it could be 10k, if you spent some time on optimization :)

from tezos-unity-sdk.

mathias-hiron avatar mathias-hiron commented on August 21, 2024

Objkt's minting Factory <= so first version would be to mint all NFT manually on Objkt ?

The current plan is to use DNS, as you can provide more information and do batch mint of NFTs

In the future, we could allow minting from the game or from the unity Editor

from tezos-unity-sdk.

m-kus avatar m-kus commented on August 21, 2024

Requires #24 to be merged
In the scope of this task ITezosAPI will be extended with additional methods

from tezos-unity-sdk.

m-kus avatar m-kus commented on August 21, 2024

Specification (RFC): https://hackmd.io/zaZTTOe1R4uz6HwghUVBaw

from tezos-unity-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.