Giter Club home page Giter Club logo

sdk's People

Contributors

charlietilt avatar clexmond avatar drjonescgeye avatar elerium-115 avatar jisensee avatar jpy-luke avatar lindsaymoralesb avatar prof197 avatar screaminghawk avatar trevis-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

Create a step and Github Action to publish to npm

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.

node.js - Module parse failure

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 conversion to typescript

Start on a conversion of the SDK to typescript. First steps should include a build process that can be incorporated into Github Actions.

Create class to wrap component data read from contracts

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.

Allow for reading component data directly from chain

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.

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.