influenceth / sdk Goto Github PK
View Code? Open in Web Editor NEWUtilities for interacting with Influence
License: Other
Utilities for interacting with Influence
License: Other
Currently calculating distance in js in the SDK vs Cairo onchain results in slightly different values. Sometimes this can result in miscalculating lease rates, or other values. Ideally we could mimic (using BigInt
math) the logic in acos_fast
here https://github.com/influenceth/cubit/blob/main/src/f64/math/trig.cairo#L29 to do so.
We should include an npm job that builds and publishes the SDK with a specific version, as well as a Github Action that automatically builds a beta version (i.e. 2.1.0-beta.123
) based on the current version.
Hi,
My list was erroring and I just noticed CREW_OUTFIT isn't being exported from the index.js.
Just upgraded from 1.9.# to 1.10.2 and the merkle library is causing an issue.
Can i do something on my end regarding loaders for the '#' character?
I got lost/confused googling but seems it's webpack related.
Failed to compile.
./node_modules/influence-utils/lib/merkle.js 12:9
Module parse failed: Unexpected character '#' (12:9)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| * @param {Number<BigInt>|<String>}
| */
> static #sortedHash(a, b) {
| let aSorted = BigInt(a);
| let bSorted = BigInt(b);
Start on a conversion of the SDK to typescript. First steps should include a build process that can be incorporated into Github Actions.
To support on-chain interaction, the SDK should be configurable at initialization with chain information, specifically, a Starknet.js provider which should be utilized anytime on-chain data needs to be accessed.
Via the ReadComponent
system, component data can be read directly from the game state. The ABI types are all exported and available in ./contracts/starknet_components.json
.
We should define SDK types to allow for their use in the entity libraries (ex. Asteroid.Component.getBonuses
should be able to consume a Celestial
component retrieved via ReadComponent
). Property names should be consistently mapped from snake_case
to camelCase
.
Although all the ABI information is currently present and available to use with Starknet.js (or other), it's a needlessly complex to read component data directly from the contract state currently, i.e.:
import { Entity, starknetContracts } from '@influenceth/sdk';
import { Contract } from 'starknet';
const Dispatcher = new Contract(starknetContracts.Dispatcher, dispatcherAddress, provider);
Dispatcher.call('run_system', Dispatcher.callData.compile('run_system', {
name: 'ReadComponent', calldata: [ 'Crew', 1, Entity.packEntity({ label: Entity.IDS.CREW, id: 4938 }) ]
}));
Ideally we build a library that abstracts this and handles the formatting of calldata and entities and returns back component instances which can be used with the various entity libraries.
Include several examples of how to use the SDK in the README
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.