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

572 write functions to call agents contract and fetch data #573

Merged
1,510 changes: 757 additions & 753 deletions poetry.lock

Large diffs are not rendered by default.

291 changes: 291 additions & 0 deletions prediction_market_agent_tooling/abis/agentcommunication.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
[
{
"type": "constructor",
"inputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "adjustMinimumValueForSendingMessage",
"inputs": [
{
"name": "newValue",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "countMessages",
"inputs": [
{
"name": "agentAddress",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getAtIndex",
"inputs": [
{
"name": "agentAddress",
"type": "address",
"internalType": "address"
},
{
"name": "idx",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"internalType": "struct DoubleEndedStructQueue.MessageContainer",
"components": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "recipient",
"type": "address",
"internalType": "address"
},
{
"name": "message",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "value",
"type": "uint256",
"internalType": "uint256"
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "minimumValueForSendingMessageInWei",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "popNextMessage",
"inputs": [
{
"name": "agentAddress",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"internalType": "struct DoubleEndedStructQueue.MessageContainer",
"components": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "recipient",
"type": "address",
"internalType": "address"
},
{
"name": "message",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "value",
"type": "uint256",
"internalType": "uint256"
}
]
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "queues",
"inputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "_begin",
"type": "uint128",
"internalType": "uint128"
},
{
"name": "_end",
"type": "uint128",
"internalType": "uint128"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "renounceOwnership",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "sendMessage",
"inputs": [
{
"name": "agentAddress",
"type": "address",
"internalType": "address"
},
{
"name": "message",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "transferOwnership",
"inputs": [
{
"name": "newOwner",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "LogMessage",
"inputs": [
{
"name": "sender",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "agentAddress",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "message",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "error",
"name": "MessageNotSentByAgent",
"inputs": []
},
{
"type": "error",
"name": "OwnableInvalidOwner",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "OwnableUnauthorizedAccount",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
}
]
6 changes: 5 additions & 1 deletion prediction_market_agent_tooling/markets/seer/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
from prediction_market_agent_tooling.gtypes import HexBytes


class SeerParentMarket(BaseModel):
id: HexBytes


class SeerMarket(BaseModel):
model_config = ConfigDict(populate_by_name=True)

id: HexBytes
title: str = Field(alias="marketName")
outcomes: list[str]
parent_market: HexBytes = Field(alias="parentMarket")
parent_market: SeerParentMarket | None = Field(alias="parentMarket")
wrapped_tokens: list[HexBytes] = Field(alias="wrappedTokens")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_fields_for_markets(self, markets_field: FieldPath) -> list[FieldPath]:
markets_field.creator,
markets_field.marketName,
markets_field.outcomes,
markets_field.parentMarket,
markets_field.parentMarket.id,
markets_field.finalizeTs,
markets_field.wrappedTokens,
]
Expand Down
Loading
Loading