Utilities / SDK / API docs for interacting with Influence. The SDK is licensed under permissive open source licenses to encourage its use. More information can be found in the LICENSE files.
Smart contract ABIs can be included with import { starknetContracts, ethereumContracts } from '@influenceth/sdk'
and utilized with Starknetjs, Ethers, Web3js.
All state in Influence is stored as components on the Dispatcher contract and can be accessed via a special system action ReadComponent
.
Components are addressed by a key, typically the entity, and component name. For some components, the key is complex and includes multiple fields.
For example, the Crew
component is addressed by the crew's packed entity UUID:
Dispatcher.call('run_system', Dispatcher.callData.compile('run_system', {
name: 'ReadComponent', calldata: [ 'Crew', 1, Entity.packEntity({ label: Entity.IDS.CREW, id: 4938 }) ]
}));
ABI types / schemas for all components can be found in ./contracts/starknet_components.json
.
npm install @influenceth/sdk
import * as InfluenceSDK from '@influenceth/sdk';
// Access game assets data and logic
const resourcesClassification = InfluenceSDK.Product.CLASSIFICATIONS.RAW_MATERIAL;
const allResourcesIds = InfluenceSDK.Product.getListByClassification(resourcesClassification);
const resourcesBySpectralId = {};
const spectralTypesData = InfluenceSDK.Asteroid.SPECTRAL_TYPES;
for (const [spectralId, spectralData] of Object.entries(spectralTypesData)) {
resourcesBySpectralId[spectralId] = spectralData.resources;
}
POST
request to /v1/auth/token
with the following JSON body:
{
"grant_type": "client_credentials",
"client_id": "[client_id]",
"client_secret": "[client_secret]"
}
{
"access_token": "[access_token]",
"token_type": "bearer"
}
Authorization: Bearer [access_token]
Prior to the launch of Influence: Exploitation, a snapshot was taken of the asteroid and crewmate collections which
have lived on Ethereum since the "Arrival" sale. As of block number 17794088
the asteroid ownership and names, and
the crewmate names were saved, to be seeded into the initial Influence state on Starknet. Additionally, the asteroid
bonuses, purchase order, spectral type, radius, and orbital elements were saved to support a Merkle-tree driven seed
of the information on Starknet.
Copies of both snapshots and the asteroid Merkle tree are preserved on IPFS here:
A utility is also available at utils/generateAsteroidMerkle.js
to generate the Merkle tree from the snapshot.
At the time of the snapshot: