Comments (9)
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.
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.
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.
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.
from tezos-unity-sdk.
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.
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.
Requires #24 to be merged
In the scope of this task ITezosAPI
will be extended with additional methods
from tezos-unity-sdk.
Specification (RFC): https://hackmd.io/zaZTTOe1R4uz6HwghUVBaw
from tezos-unity-sdk.
Related Issues (20)
- Error: Standalone IL2CPP build fails HOT 2
- Close Beacon database connections before app exit;
- Hande `GetOperationStatus` API method error case
- Add Beacon timeout callback for cases when the wallet doesn't respond HOT 2
- Render FA2 tokens on Demo example sample
- Undefined symbol errors when building to iOS
- WebGL staging during development [question] HOT 2
- Get coins not working in sample game HOT 1
- Feature: Store configuration in a ScriptableObject HOT 1
- 3.0.0: Broken in LinuxEditor HOT 1
- Silent Wallet Connection? HOT 4
- [TEST] Beacon login not working HOT 3
- There is no "Reject" event handler in SDK when payload is not signed from wallet HOT 1
- Add transfer, deploy and mint features on FA2 token contract
- Newtonsoft dependency missing on IOS HOT 4
- Marketplace is not getting loaded on WebGL HOT 2
- [WebGL] MichelinePrim serialization is not working properly on WebGL HOT 1
- Unable to find a constructor to use for type MatrixServerVersionsResponse HOT 2
- Feature: Contract Generator Tool for Custom Smart Contracts
- Game items transfer not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tezos-unity-sdk.