Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for reading component data directly from chain #88

Open
clexmond opened this issue Jun 18, 2024 · 6 comments
Open

Allow for reading component data directly from chain #88

clexmond opened this issue Jun 18, 2024 · 6 comments
Labels
enhancement New feature or request ODHack

Comments

@clexmond
Copy link
Member

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.

@clexmond clexmond added enhancement New feature or request ODHack labels Jun 18, 2024
@Mystic-Nayy
Copy link

@clexmond can I be assigned to work on this ?

@jedstroke
Copy link

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

@clexmond
Copy link
Member Author

@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

@Mystic-Nayy
Copy link

@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
Copy link
Member Author

@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

@Mystic-Nayy
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ODHack
Projects
None yet
Development

No branches or pull requests

3 participants