influenceth / sdk

Utilities for interacting with Influence
Other
15 stars 11 forks source link

Allow for reading component data directly from chain #88

Open clexmond opened 2 months ago

clexmond commented 2 months ago

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.

Gift-Naomi commented 2 months ago

@clexmond can I be assigned to work on this ?

jedstroke commented 2 months ago

Hey @clexmond! I am Jedshock, I would like to contribute on this issue?

clexmond commented 2 months ago

@clexmond can I be assigned to work on this ?

Would you mind joining our Discord and going to the #odhack channel: https://discord.gg/influenceth

Gift-Naomi commented 2 months ago

@clexmond can I be assigned to work on this ?

Would you mind joining our Discord and going to the #odhack channel: https://discord.gg/influenceth

I just did

clexmond commented 2 months ago

@clexmond can I be assigned to work on this ?

Would you mind joining our Discord and going to the #odhack channel: https://discord.gg/influenceth

I just did

Great! Just sned a message @DarkosNightmare in #odhack please

Gift-Naomi commented 2 months ago

@clexmond can I be assigned to work on this ?

Would you mind joining our Discord and going to the #odhack channel: https://discord.gg/influenceth

I just did

Great! Just sned a message @DarkosNightmare in #odhack please

Done