Version: 1.0.0 ID: energy-agreement-setup Category: Economic Estimated Time: 5-10 minutes
Get current energy market data and available providers.
GET/structs/market/Energyschemas/markets.md#/markets/EnergyMarketDataExpected Response:
{
"currentPrice": "number",
"supply": "number",
"demand": "number",
"agreements": "array",
"providers": "array"
}
Find suitable energy provider for agreement.
GET/structs/providerschemas/entities.md#/entities/ProviderSelection Criteria:
| Criterion | Description |
|---|---|
| rate | Energy rate (kW per unit) |
| price | Price per unit |
| available | Available energy capacity |
| penaltyProtection | Whether penalty protection is enabled |
| reputation | Provider reputation |
Get detailed provider information.
GET/structs/provider/{providerId}schemas/entities.md#/entities/ProviderExpected Response:
{
"id": "string",
"rate": "number",
"capacity": "number",
"penaltyProtection": "boolean",
"automatic": "boolean"
}
Create automated energy agreement with provider.
POST/cosmos/tx/v1beta1/txs/structs.structs.MsgAgreementCreateschemas/actions.md#/actions/MsgAgreementCreateRequired Fields:
{
"creator": "player-id",
"providerId": "provider-id",
"terms": {
"energyAmount": "number",
"price": "number",
"duration": "number"
}
}
Request Example:
{
"body": {
"body": {
"messages": [
{
"@type": "/structs.structs.MsgAgreementOpen",
"creator": "structs1...",
"providerId": "1-1",
"terms": {
"energyAmount": 100,
"price": 0.01,
"duration": 1000
}
}
]
}
}
}
Expected Result:
{
"agreementCreated": true,
"agreementId": "string",
"automatic": true,
"penaltyProtection": true
}
Verify agreement was created and is active.
GET/structs/agreement/{agreementId}schemas/economics.md#/entities/EnergyAgreementVerification Checks:
status should be activepenaltyProtection should be trueautomatic should be trueMonitor agreement performance and energy supply.
GET/structs/agreement/{agreementId}schemas/economics.md#/entities/EnergyAgreementMonitoring Targets:
| Target | Description |
|---|---|
| energyAmount | Track energy received |
| status | Monitor agreement status |
| penalties | Check for any penalties applied |
| Property | Description | Benefit |
|---|---|---|
| automatic | Agreement executes automatically on-chain | No manual intervention needed |
| penaltyProtection | Automatic, on-chain penalty enforcement | Protection for both parties (enforcement is automatic by code on blockchain) |
| persistent | Long-term energy supply arrangement | Consistent energy supply |
| selfEnforcing | Terms enforced automatically by blockchain | Trustless, automatic enforcement |
| Error | Code | Step | Solution | Retryable |
|---|---|---|---|---|
| Provider not found | PROVIDER_NOT_FOUND |
2 | Verify provider ID, check provider list | Yes |
| Invalid terms | INVALID_TERMS |
4 | Check provider requirements, adjust terms | Yes |
| Insufficient resources | INSUFFICIENT_RESOURCES |
4 | Check resource balance, ensure sufficient funds | Yes |