signal-k / silfur Goto Github PK
View Code? Open in Web Editor NEWLightweight API demos for our citizen science platform
Home Page: https://docs.skinetics.tech/api/polygon
Lightweight API demos for our citizen science platform
Home Page: https://docs.skinetics.tech/api/polygon
Allow users to create posts on our client.
This will allow us to determine how we attach additional metadata to our publications.
Here's a demo metadata tag:
const postMetadata = {
version: '2.0.0',
mainContentFocus: PublicationMainFocus.Image, // This can be changed -> what post type is being created?
matadata_id: uuidv4(),
description: description,
locale: 'en-us',
content: content,
external_url: null,
image: imageIpfsUrl,
imageMimeType: null,
name: title,
attributes: [],
classificationMetadata: classificationMetadata,
tags: ['0xed6e837Fda815FBf78E8E7266482c5Be80bC4bF9'],
appId: 'ssk_example',
};
Potentially, one of the tags could point to the contract β nft id that is being referenced (note that classificationMetadata
is a custom prop.
Linear info:
https://linear.app/star-sailors/issue/WB3-8/add-createpost-lib-component
Id: WB3-8
See STA-31 STA-32 STA-33 STA-34
Use matplotlib
to generate an image (will be a 3d asset in MVP/prod) when an anomaly is being created. Cross-reference it with the metadata mentioned at Signal-K/sytizen#29, i.e. adding new metadata like its radius. This metadata is then used in the Generator component (3JS/Unity as well as in Matplot).
Update the fields to include things like the "seed" in https://steveasleep.com/stellardream/. This should match the seed in the 3JS planet editor:
const seed = usePlanetEditorFieldState('seed', randomSeed(), value => {
planet.seed = value;
planet.regenerateTerrain();
planet.regenerateShading();
return planet.seed;
});
Star system should be the same as the TIC Id (which will cause conflicts between the correct/real fields like radius
from lightkurve
and the fields created by stellardream
β however, this is useful for fictional planets, plus comparing the two identical seeds/ids in-game. Helps to train models/users to identify differences between candidates.
So: Create a planet by entering some fields in a new createPlanet
form.
First, a random TIC ID will be sent to the server which will return 1 image (graph) and the estimated radius. This radius is then sent to the Generator:
"Send a request to the python Generator" β
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from noise import double_perlin3D, background
from geometry import normal, cos_vec, reflection
from colour import colorize
res = 2048
radius = 0.4 ...
Return this image (saved as examples/out0.png
to the client) and then delete it from the server so the next time it is called, the image generated will be saved to the same path.
A planet with id "ticId" is created with a profile image (examples/out0.png
) and in its stats, the field "radius" and the graph generated from Lightkurve above.
A copy of a notebook that has that anomaly's dataset will be added to the "profile page" of that anomaly/planet, as well as the 3JS/Unity generator with the radius field filled in from the dataset.
The planet is then owned by the player who generated it. It costs 1 reputation/credit/currency to create it, but they can then earn 2 by adding some new data to it (saved as a new field), which will be a demo of the classification process.
Linear info:
https://linear.app/star-sailors/issue/WB3-14/π¦π-β-generate-asset-id-and-statselements-for-anomalies-when-being
Id: WB3-14
ethereum-unity-boilerplate
Git repo: keybase://team/signalkinetics.unity/ethereum-unity-boilerplate
Unity components and hooks for fast building of web3 games. With this SDK you can build web3 games for mobile, desktop, Xbox, Playstation and other platforms.
This boilerplate allows you to authenticate users using crypto wallets on any platform.
This boilerplate is built on moralis-dotnet-sdk and Moralis. Also has its own context provider for quick access to chainId
or ethAddress
There are many components in this boilerplate that do not require an active web3 provider, they use Moralis Web3 API. Moralis supports the most popular blockchains and their test networks. You can find a list of all available networks in Moralis Supported Chains
Please check the official documentation of Moralis for all the functionalities of Moralis.
Star us
If this boilerplate helps you build Ethereum dapps faster - please star this project, every star makes us very happy!
Need help?
If you need help with setting up the boilerplate or have other questions - don't hesitate to write in our community forum and we will check asap. Forum link. The best thing about this boilerplate is the super active community ready to help at any time! We help each other.
πΏ Install all dependencies:
π Download the latest package:
πΏ Create a New Unity Project and Import the Package
Open Unity Hub
Click on the 'NEW' button and create a new project
When the project opens, open Edit->Preferences->External Tools (on MAC this is Unity->Preferences->External Tools) and make sure "Script Editor" is set to your installed Visual Studio instance. IMPORTANT: This step must be done before importing the package.
Navigate to the folder you downloaded the package to. Drag and drop the package into the Unity project.
Open MoralisWeb3ApiSdk->Example and double-click on the DemoScene object.
In the "Hierachy" panel under DemoScene expand "UICanvas" then "UIPanel".
In the "Inspector" section find the sub-section titled "MainMenuScript".
If the "MainMenuScript" sub-section is not expanded, expand it.
Using the information from your Moralis Server, fill in Application Id and Server URL.
Run the application by clicking the Play icon located at the top, center of the Unity3D IDE.
This boilerplate project has been tested with the following Unity3D Releases:
ethereum-unity-boilerplate
The.NET Moralis SDK provides easy to use methods that make integrating your application with Moralis a snap. You will find that the.NET SDK works much the same as in JavaScript. For use in Unity3D, we have added additional quick start objects for integrating the Moralis SDK in a Unity3D application.
For the examples that follow we provide examples of how to use the Moralis.NET SDK directly and perform the same functionality using the provided Moralis Unity3D quick start tools.
Client
The Moralis SDK Client provides a way to easily interact with Moralis database and the Web3API. In .NET we use the MoralisClient
to interact with Moralis. For Unity3D we have provided a singleton wrapper named MoralisInterface that makes it easy to initialize the MoralisClient and then access it from anywhere in your Unity3D application. With either option you can initialize the Moralis Client with a single line of code
Required Using Statements
using Moralis;
using Moralis.Platform;
using Moralis.Web3Api.Client;
Initialize Client
MoralisClient moralis = new MoralisClient(new ServerConnectionData() { ApplicationID = "YOUR_APPLICATION_ID_HERE", ServerURI = "YOUR_SERER_URL_HERE"}, new Web3ApiClient());
note: The new Web3ApiClient() parameter is optional and should be included only when you will be using functionality from the Moralis Web3API REST service.
Initialize Client
MoralisInterface.Initialize(MoralisApplicationId, MoralisServerURI, hostManifestData);
note: For the hostManifestData parameter see HostManifestData
. This is required for Unity3D applications.
note: See User Object
for information about initializing the Moralis Client for a custom User Object.
Authentication
Authentication is handled in a similar manner in both the SDK and the Unity3d. There is no direct manner to interact securely with a wallet in a .NET application so the Moralis SDK interacts with wallets in a loosely coupled manner. For the Unity3D boilerplate application, and the other examples we provide, we use Wallet Connect to facilitate interaction with wallets.
Here are the statements used to authenticate with Moralis:
MoralisUser user = await moralis.LogInAsync(authenticationData, CancellationToken.None);
MoralisUser user = await MoralisInterface.LogInAsync(authentication-Data);
note: See Authentication Data
for information about the authenticationData parameter.
The Unity3D Boilerplate application provides a detailed example of how to integrate with Wallet Connect and is worth examining in detail.
Here are the relevant sections from the Boiler Plate Application:
// Extract wallet address from the Wallet Connect Session data object.
string address = data.accounts[0].ToLower();
string response = await walletConnect.Session.EthPersonalSign(address, "Moralis Authentication");
// Create moralis auth data from message signing response.
Dictionary<string, object> authData = new Dictionary<string, object> { { "id", address }, { "signature", response }, { "data", "Moralis Authentication" } };
// Attempt to login user.
MoralisUser user = await MoralisInterface.LogInAsync(authData);
Queries
Queries provide a way to retrieve information from your Moralis database.
using Moralis;
using Moralis.Platform.Objects;
The following example will return all Hero records where 'Level' is equal to 3.
MoralisQuery<Hero> q = moralis.Query<Hero>().WhereEqualTo("Level", 3);
IEnumerable<Hero> result = await q.FindAsync();
MoralisQuery<Hero> q = MoralisInterface.GetClient().Query<Hero>().WhereEqualTo("Level", 3);
IEnumerable<Hero> result = await q.FindAsync();
The Moralis Dot Net SDK supports the same query methods as the JS SDK. For example creating 'OR', 'AND', and 'NOR' queries.
For this example we will take the query from the above example and construct a 'OR' query that also returns records where the hero's name is 'Zuko'.
Furthermore we will sort (order) the result set by the hero's strength, descending.
MoralisQuery<Hero> q1 = moralis.BuildOrQuery<Hero>(new MoralisQuery<Hero>[] { q, moralis.Query<Hero>().WhereEqualTo("Name", "Zuko") })
.OrderByDescending("Strength");
IEnumerable<Hero> result = await q1.FindAsync();
MoralisQuery<Hero> q1 = MoralisInterface.GetClient()
.BuildOrQuery<Hero>(new MoralisQuery<Hero>[] { q, MoralisInterface.GetClient().Query<Hero>().WhereEqualTo("Name", "Zuko") })
.OrderByDescending("Strength");
IEnumerable<Hero> result = await q1.FindAsync();
Live Queries
Live Queries are queries that include a subscription that provide updates whenever the data targeted by the query are updated.
A Live Query subscription emits events that indicate the state of the client and changes to the data. For more information please see
the docs.
The foloowing examples use the query example from above
MoralisLiveQueryClient<Hero> heroSubscription = moralis.Query<Hero>().Subscribe(callbacks);
_note: the callbacks parameter is optional. Please see Callbacks Explained below.
Since Unity3d is mainly used to create games, Unity3D apps generaly have life cycle events you do not usually need to worray about in a normal program.
We have created a special Live Query wrapper object that automatically handles your subscriptions for pause, unpause, close, etc.
This example shows how to create your subscription using this wrapper class.
MoralisQuery<Hero> q = MoralisInterface.GetClient().Query<Hero>();
MoralisLiveQueryController.AddSubscription<Hero>("Hero", q, callbacks);
_note: the callbacks parameter is optional. Please see Callbacks Explained bellow.
The MoralisLiveQueryController is a singleton object and so is available anywhere within your application.
The first parameter ("Hero" above") is a key that you can use to retrieve a subscription (to check its status for example) or to remove a subscription.
By using the The MoralisLiveQueryController object you do not need to worry about properly closing or disposing of your subscriptions as this wrapper object handles all of that for you.
Callbacks are used to handle the events emitted by a subscription. You can set the callbacks directly against a subscription. However it is usually cleaner to
separate these from the main code. To facilitate this we have included the MoralisLiveQueryCallbacks object. This optional object can be passed to the subscription.
MoralisLiveQueryCallbacks<Hero> callbacks = new MoralisLiveQueryCallbacks<Hero>();
callbacks.OnConnectedEvent += (() => { Console.WriteLine("Connection Established."); });
callbacks.OnSubscribedEvent += ((requestId) => { Console.WriteLine($"Subscription {requestId} created."); });
callbacks.OnUnsubscribedEvent += ((requestId) => { Console.WriteLine($"Unsubscribed from {requestId}."); });
callbacks.OnErrorEvent += ((ErrorMessage em) =>
{
Console.WriteLine($"ERROR: code: {em.code}, msg: {em.error}, requestId: {em.requestId}");
});
callbacks.OnCreateEvent += ((item, requestId) =>
{
Console.WriteLine($"Created hero: name: {item.Name}, level: {item.Level}, strength: {item.Strength} warcry: {item.Warcry}");
});
callbacks.OnUpdateEvent += ((item, requestId) =>
{
Console.WriteLine($"Updated hero: name: {item.Name}, level: {item.Level}, strength: {item.Strength} warcry: {item.Warcry}");
});
callbacks.OnDeleteEvent += ((item, requestId) =>
{
Console.WriteLine($"Hero {item.Name} has been defeated and removed from the roll!");
});
callbacks.OnGeneralMessageEvent += ((text) =>
{
Console.WriteLine($"Websocket message: {text}");
});
Custom Object
Creating your own objects to support NPCs, characters, and game objects is as simple as creating a Plain Old C# Object (POCO). The only stipulation is that your custom object must be a child of Moralis Object and when you create an instance of the object it should be made via moralis.Create method. This associates some extensions to your object that enable you to perform Moralis functions such as Save directly on the object.
using Moralis;
using Moralis.Platform.Objects;
public class Hero : MoralisObject
{
public int Strength { get; set; }
public int Level { get; set; }
public string Name { get; set; }
public string Warcry { get; set; }
public List<string> Bag { get; set; }
public Hero() : base("Hero")
{
Bag = new List<string>();
}
}
Hero h = moralis.Create<Hero>();
h.Name = "Zuko";
h.Strength = 50;
h.Level = 15;
h.Warcry = "Honor!!!";
h.Bag.Add("Leather Armor");
h.Bag.Add("Crown Prince Hair clip.");
await h.SaveAsync();
Hero h = MoralisInterface.GetClient().Create<Hero>();
h.Name = "Zuko";
h.Strength = 50;
h.Level = 15;
h.Warcry = "Honor!!!";
h.Bag.Add("Leather Armor");
h.Bag.Add("Crown Prince Hair clip.");
await h.SaveAsync();
User Object
The user object contains information about the currently logged in user. Upon successful login, the user is stored in local storage until logout. This allows a user to log in once and not login again until their session expires or they logout.
If you create a custom user object it must inherit from MoralisUser.
Since C# is a typed language the compiler must know what types are used at compile time. Due to this, since the MoralisUser is integral to internal functions in the Moralis SDK, when you create a custom User Object you must initialize the Moralis client using your custom User Object. After this step you can use the Moralis Client as usual.
MoralisClient<YourUserObject> moralis = new MoralisClient<YourUserObject>(new ServerConnectionData() { ApplicationID = "YOUR_APPLICATION_ID_HERE", ServerURI = "YOUR_SERER_URL_HERE"}, new Web3ApiClient());
note: for Unity3D you will need to make the above change in the MoralisInterface.Initialize object. You will also need to replace the MoralisUser object elsewhere in the Boilerplate code.
WARNING do not make any replacements to any files under the MoralisDtoNet folder
Authentication Data
Authentication data is a Dictionary<string, string> object that contains the information required by Moralis to authenticate a user.
As a minimum the authentication data dictionary must contain the following entries:
Dictionary<string, object> authData = new Dictionary<string, object> { { "id", "ADDRESS_HERE".ToLower() }, { "signature", "SIGNATURE_DATA_HERE" }, { "data", "MESSAGE_HERE" } };
HostManifestData
In Unity3D applications the HostManifestData object is used to pass information to Moralis that is usually autogenerated from Windows system variables. Since Unity3D supports multiple platforms this information is not always available.
ServerConnectionData
Description here
Web3Api Notes
The complete Moralis Web3API schema including endpoints, operations and models, can be found by logging in to your Moralis Server and selecting Web3 API*
For use with either Moralis SDK or in Unity3d, the following using statements are required:
using System.Collections.Generic;
using Moralis.Web3Api.Models;
Chains
Use the code snippet below to retrieve a list of EVM chains supported in the Moralis Web3API. This list can be used for populating dropdown lists etc.
List<ChainEntry> chains = MoralisInterface.SupportedChains;
Account
Code examples demonstrating how to use the Moralis Web3API Account endpoint and operations.
GetNativeBalance
Gets native balance for a specific address
NativeBalance balance = MoralisInterface.GetClient().Web3Api.Account.GetNativeBalance(address.ToLower(), ChainList.eth);
GetNFTs
Gets NFTs owned by the given address
NftOwnerCollection balance = MoralisInterface.GetClient().Web3Api.Account.GetNFTs(address.ToLower(), ChainList.eth);
GetNFTsForContract
Gets NFTs owned by the given address
NftOwnerCollection balance = MoralisInterface.GetClient().Web3Api.Account.GetNFTsForContract(address.ToLower(), tokenAddress, ChainList.eth);
GetNFTTransfers
Gets the transfers of the tokens matching the given parameters
NftTransferCollection balance = MoralisInterface.GetClient().Web3Api.Account.GetNFTTransfers(address.ToLower(), ChainList.eth);
GetTokenBalances
Gets token balances for a specific address
List<Erc20TokenBalance> balance = MoralisInterface.GetClient().Web3Api.Account.GetTokenBalances(address.ToLower(), ChainList.eth);
GetTokenTransfers
Gets ERC20 token transactions in descending order based on block number
Erc20TransactionCollection balance = MoralisInterface.GetClient().Web3Api.Account.GetTokenTransfers(address.ToLower(), ChainList.eth);
GetTransactions
Gets native transactions in descending order based on block number
TransactionCollection balance = MoralisInterface.GetClient().Web3Api.Account.GetTransactions(address.ToLower(), ChainList.eth);
Defi
Code examples demonstrating how to use the Moralis Web3API Defi endpoint and operations.
GetPairAddress
Fetches and returns pair data of the provided token0+token1 combination. The token0 and token1 options are interchangable (ie. there is no different outcome in "token0=WETH and token1=USDT" or "token0=USDT and token1=WETH")
ReservesCollection nftTransers = MoralisInterface.GetClient().Web3Api.Defi.GetPairAddress(exchange, token0Address, token1Address, ChainList.eth);
GetPairReserves
Get the liquidity reserves for a given pair address
ReservesCollection nftTransers = MoralisInterface.GetClient().Web3Api.Defi.GetPairReserves(pairAddress, ChainList.eth);
Native
Code examples demonstrating how to use the Moralis Web3API Native endpoint and operations.
GetBlock
Gets the contents of a block by block hash
Block block = MoralisInterface.GetClient().Web3Api.Native.GetBlock(blockNumberOrHash, ChainList.eth);
GetContractEvents
Gets events in descending order based on block number
List<LogEvent> logEvents = MoralisInterface.GetClient().Web3Api.Native.GetContractEvents(address, topic, ChainList.eth);
GetDateToBlock
Gets the closest block of the provided date
BlockDate blockDate = MoralisInterface.GetClient().Web3Api.Native.GetDateToBlock(date, ChainList.eth);
GetLogsByAddress
Gets the logs from an address
LogEventByAddress logEvents = MoralisInterface.GetClient().Web3Api.Native.GetLogsByAddress(address, ChainList.eth);
GetNFTTransfersByBlock
Gets NFT transfers by block number or block hash
NftTransferCollection nftTransfers = MoralisInterface.GetClient().Web3Api.Native.GetNFTTransfersByBlock(blockNumberOrHash, ChainList.eth);
GetTransaction
Gets the contents of a block transaction by hash
BlockTransaction blockTransaction = MoralisInterface.GetClient().Web3Api.Native.GetTransaction(transactionHash, ChainList.eth);
RunContractFunction
Runs a given function of a contract abi and returns readonly data
string result = MoralisInterface.GetClient().Web3Api.Native.RunContractFunction(address, functionName, ChainList.eth);
Resolve
Code examples demonstrating how to use the Moralis Web3API Resolve endpoint and operations.
ResolveDomain
Resolves an Unstoppable domain and returns the address
Resolve result = MoralisInterface.GetClient().Web3Api.Resolve.ResolveDomain(domain);
ResolveAddress
Resolves an ETH address and find the ENS name
Ens result = MoralisInterface.GetClient().Web3Api.Resolve.ResolveAddress(address);
Storage
Code examples demonstrating how to use the Moralis Web3API Storage endpoint and operations.
Resolves an ETH address and find the ENS name
// Define file information.
IpfsFileRequest req = new IpfsFileRequest()
{
Path = "moralis/logo.jpg",
Content = "iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3"
};
// Multiple requests can be sent via a List so define the request list.
List<IpfsFileRequest> reqs = new List<IpfsFileRequest>();
// Add requests to request list.
reqs.Add(req);
List<IpfsFile> resp = web3Api.Storage.UploadFolder(reqs);
Token
Code examples demonstrating how to use the Moralis Web3API Token endpoint and operations.
GetAllTokenIds
Gets data, including metadata (where available), for all token ids for the given contract address.
NftCollection nfts = MoralisInterface.GetClient().Web3Api.Token.GetAllTokenIds(address, ChainList.eth, null, 0, 10);
GetContractNFTTransfers
Gets the transfers of the tokens matching the given parameters
NftTransferCollection nftTransers = MoralisInterface.GetClient().Web3Api.Token.GetContractNFTTransfers(address, ChainList.eth, null, 0, 10);
GetNFTLowestPrice
Get the lowest price found for a nft token contract for the last x days (only trades paid in ETH)
Trade trade = MoralisInterface.GetClient().Web3Api.Token.GetNFTLowestPrice(address, ChainList.eth);
GetNFTMetadata
Gets the contract level metadata (name, symbol, base token uri) for the given contract
NftContractMetadata metadata = MoralisInterface.GetClient().Web3Api.Token.GetNFTMetadata(address, ChainList.eth);
GetNFTOwners
Gets all owners of NFT items within a given contract collection
NftOwnerCollection owners = MoralisInterface.GetClient().Web3Api.Token.GetNFTOwners(address, ChainList.eth);
GetNFTTrades
Get the nft trades for a given contracts and marketplace
TradesCollection trades = MoralisInterface.GetClient().Web3Api.Token.GetNFTTrades(address, ChainList.eth);
GetNftTransfersFromToBlock
Gets the transfers of the tokens from a block number to a block number
NftTransferCollection transfers = MoralisInterface.GetClient().Web3Api.Token.GetNftTransfersFromToBlock(ChainList.eth);
GetTokenAdressTransfers
Gets ERC20 token contract transactions in descending order based on block number
List<Erc20Transaction> transactions = MoralisInterface.GetClient().Web3Api.Token.GetTokenAdressTransfers(address, ChainList.eth);
GetTokenAllowance
Gets the amount which the spender is allowed to withdraw from the spender
Erc20Allowance allowance = MoralisInterface.GetClient().Web3Api.Token.GetTokenAllowance(address, ownerAddress, spenderAddress, ChainList.eth);
GetTokenIdMetadata
Gets data, including metadata (where available), for the given token id of the given contract address.
Nft nft = MoralisInterface.GetClient().Web3Api.Token.GetTokenIdMetadata(address, tokenId, ChainList.eth);
GetTokenIdOwners
Gets all owners of NFT items within a given contract collection
NftOwnerCollection owners = MoralisInterface.GetClient().Web3Api.Token.GetTokenIdOwners(address, tokenId, ChainList.eth, null, 0, 10);
GetTokenMetadata
Returns metadata (name, symbol, decimals, logo) for a given token contract address.
List<string> addresses = new List<string>();
addresses.Add("0x6b175474e89094c44da98b954eedeac495271d0f");
List<Erc20Metadata> resp = web3Api.Token.GetTokenMetadata(addresses, ChainList.eth);
GetTokenMetadataBySymbol
Returns metadata (name, symbol, decimals, logo) for a given token contract address.
List<string> symbols = new List<string>();
symbols.Add("DAI");
List<Erc20Metadata> resp = web3Api.Token.GetTokenMetadataBySymbol(symbols, ChainList.eth);
GetTokenPrice
Returns the price nominated in the native token and usd for a given token contract address.
Erc20Price tkenPrice = MoralisInterface.GetClient().Web3Api.Token.GetTokenPrice(address, ChainList.eth);
GetWalletTokenIdTransfers
Gets the transfers of the tokens matching the given parameters
NftTransferCollection transfers = MoralisInterface.GetClient().Web3Api.Token.GetWalletTokenIdTransfers(address, tokenId, ChainList.eth);
SearchNFTs
Gets NFTs that match a given metadata search.
NftMetadataCollection metadata = MoralisInterface.GetClient().Web3Api.Token.SearchNFTs(q, ChainList.eth, null, null, null, null, null, null, 0, 10);
https://github.com/signal-k/dabpi/issues/6
Creating a smart contract for an online game (which will interact with Moralis and our own DB for Signal-K/Unity-Demo#5)
Create an interface to discuss proposals.
Linear info:
https://linear.app/star-sailors/issue/WB3-4/medium-clone
Id: WB3-4
Been having issues with running npx truffle init
locally
I've switched to Github Codespaces, let's see how this goes
Problems
useUser
& useSession
from SupabaseThe potential solution here would be to separate the off chain account into a separate Next app and then add the coffeescripts for the Lens interaction straight after, and then edit the OffchainAccount
component to use useSession
.
client
repo for nowuseUser
to useSession
<Card />
componentLinear info:
https://linear.app/star-sailors/issue/WB3-11/migrate-offchain-auth-to-usesession-from-useuser
Id: WB3-11
Create a team for frontend components, specifically UI-only components like Menus, Buttons, styling, etc. Allow communication between tables/team issues however.
Linear info:
https://linear.app/star-sailors/issue/WB3-13/create-new-linear-team
Id: WB3-13
I'm beginning the process of migrating from Vite to Next.js now. I will create a new linked task on Linear for commits.
Linear info:
https://linear.app/star-sailors/issue/WB3-6/migrate-proposal-board-from-vite-to-nextjs
Id: WB3-6
Allow users to mint voting tokens on frontend and create some base styles for use in other components
Linear info:
https://linear.app/star-sailors/issue/WB3-3/improve-voting-token-mint-experience-on-frontend
Id: WB3-3
msg.sender
(playerβs address) so they can manipulate it in-gamemsg.sender
Linear info:
https://linear.app/star-sailors/issue/WB3-7/π«₯π¬-β-interacting-with-anomalies-from-smart-contract
Id: WB3-7
Now that users can mint planets on the frontend, let's add some staking in for when they've confirmed planets.
Linear info:
https://linear.app/star-sailors/issue/WB3-9/create-method-to-stake-your-planets-to-earn-reward-erc20s
Id: WB3-9
Might be a good idea to show the table schema and structure/interactions for the entire db like we've done for the silfur
table here...
Currently, we have a DAO thanks to thirdweb.com that allows us to add single-text proposals, vote on them, and hide this behind an NFT. I want to extend this to allow users to add their own proposals, chat about them, add endpoints to them, and add more content like images/json files.
The next thing to do after this would be to get each proposal to be accessible via API & added to our backend (both off-chain & on-chain database). For now, everything will be done by interacting with smart contracts, but remember that some of the users won't want to use blockchain all the time, so we'll allow them to vote using their Magic.link accounts.
The data from this endpoint will then be fed into a Deepnote notebook to classify future objects.
Create a simple Flask API (deployed on Deepnote) that takes in some parameters (via user input) and takes certain actions on the web3 side.
Core examples for this task:
Save user data to their profile section:
Linear info:
https://linear.app/star-sailors/issue/WB3-5/take-user-inputs-for-minting-via-flask-api
Id: WB3-5
Inventory System Database Setup
We have set up the database schema to support the inventory system in our game. The following tables have been created:
Items table: This table stores information about different items available in the game. It includes columns such as id, name, description, cost, and icon_url. The id column is the primary key for each item.
User Items table: This table tracks the inventory of each user. It includes columns like id, user_id, item_id, and quantity. The user_id column is a foreign key referencing the id column of the profiles table, and the item_id column is a foreign key referencing the id column of the items table.
Global Inventory table: This table stores items available for sale. It includes columns like id, item_id, and quantity. The item_id column is a foreign key referencing the id column of the items table.
The database setup allows us to manage user inventories, track available items, and support item trading and crafting. It is designed to be scalable and efficient, minimizing the number of queries to the Supabase API while providing a simple table configuration.
Rather than having the flask server be separate to the multiple react projects (e.g. the DAO, frontend for data insertion & manipulation in HDASH-5), we'll be running react & flask consecutively on different ports:
5000
-> Flask3000
-> ReactWhen react is talking to flask (see package.json
info below), this javascript snippet can be used to fetch (and later push) data from Flask (make sure to insert it just below function name):
const [currentTime, setCurrentTime] = useState(0);
// Pull content from Flask
useEffect(() => {
fetch('/time').then(res => res.json()).then(data => {
setCurrentTime(data.time);
});
}, [])
Just enough to read from the 'bot' account (aka u/parselay
on Lens) and start of auth handler
Linear info:
https://linear.app/star-sailors/issue/WB3-12/add-lens-graphql-client-to-offchain-directory
Id: WB3-12
In the branch for #3 we can't log in to the app as we keep getting an error message "Change network to Polygon", where the ganache-cli
instance is not valid (and neither is the Mumbai testnet or Matic mainnet). After cloning the base repo I found that the desired network is Matic, so we likely need to update this in src/redux/blockchain
, and configuring the network to work for the ganache network or either of the polygon networks. Gas fees aren't an issue on Matic (mainnet) so it is potentially plausible that it would be fine ignoring Ganache for now...or extending it later.
Just need to compare src/App.js
and the redux directory...
Add an off-chain wrapper for users who don't have a wallet connected, but since this is for the in-development version, we will be assuming each user will have a wallet connected. There will be a free claim button so all testers can get started, and then we can set up some functions with thirdweb to reward users with tokens after classifying anomalies (this will compliment the "reputation" entry in the profiles
table, which should remain there because users may prefer to vote & discuss/create off-chain)
Linear info:
https://linear.app/star-sailors/issue/WB3-15/add-voting-mechanism-for-anomaly-discussion
Id: WB3-15
#15
Basically create an api that has content pushed from a frontend (like our Moralis frontends https://signal-kinetics.atlassian.net/browse/SSDROP-3) and send it into the citizen science db for Unity.
Allow users to comment on dynamic pages in Next.js. A good starting point for the proposals board. We can then build out a route between planet/candidate object NFTs and proposals written on them (as well as connecting them to proposals on our Lens Protocol appId).
Linear info:
https://linear.app/star-sailors/issue/WB3-10/implement-off-chain-commenting-post-system-for-users
Id: WB3-10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.