@ajna-finance/sdk
Version:
A typescript SDK that can be used to create Dapps in Ajna ecosystem.
451 lines (450 loc) • 14.8 kB
JSON
[
{
"type": "constructor",
"payable": false,
"inputs": [{ "type": "address", "name": "ajnaToken_" }]
},
{ "type": "error", "name": "DelegateRewardInvalid", "inputs": [] },
{ "type": "error", "name": "DistributionPeriodStillActive", "inputs": [] },
{ "type": "error", "name": "ExecuteProposalInvalid", "inputs": [] },
{ "type": "error", "name": "FundingVoteWrongDirection", "inputs": [] },
{ "type": "error", "name": "InsufficientRemainingVotingPower", "inputs": [] },
{ "type": "error", "name": "InsufficientVotingPower", "inputs": [] },
{ "type": "error", "name": "InvalidProposal", "inputs": [] },
{ "type": "error", "name": "InvalidProposalSlate", "inputs": [] },
{ "type": "error", "name": "InvalidVote", "inputs": [] },
{ "type": "error", "name": "ProposalAlreadyExists", "inputs": [] },
{ "type": "error", "name": "ProposalNotSuccessful", "inputs": [] },
{ "type": "error", "name": "RewardAlreadyClaimed", "inputs": [] },
{ "type": "error", "name": "ScreeningPeriodEnded", "inputs": [] },
{
"type": "event",
"anonymous": false,
"name": "DelegateRewardClaimed",
"inputs": [
{ "type": "address", "name": "delegateeAddress", "indexed": true },
{ "type": "uint256", "name": "distributionId", "indexed": true },
{ "type": "uint256", "name": "rewardClaimed", "indexed": false }
]
},
{
"type": "event",
"anonymous": false,
"name": "DistributionPeriodStarted",
"inputs": [
{ "type": "uint256", "name": "distributionId", "indexed": true },
{ "type": "uint256", "name": "startBlock", "indexed": false },
{ "type": "uint256", "name": "endBlock", "indexed": false }
]
},
{
"type": "event",
"anonymous": false,
"name": "FundTreasury",
"inputs": [
{ "type": "uint256", "name": "amount", "indexed": false },
{ "type": "uint256", "name": "treasuryBalance", "indexed": false }
]
},
{
"type": "event",
"anonymous": false,
"name": "FundedSlateUpdated",
"inputs": [
{ "type": "uint256", "name": "distributionId", "indexed": true },
{ "type": "bytes32", "name": "fundedSlateHash", "indexed": true }
]
},
{
"type": "event",
"anonymous": false,
"name": "ProposalCreated",
"inputs": [
{ "type": "uint256", "name": "proposalId", "indexed": false },
{ "type": "address", "name": "proposer", "indexed": false },
{ "type": "address[]", "name": "targets", "indexed": false },
{ "type": "uint256[]", "name": "values", "indexed": false },
{ "type": "string[]", "name": "signatures", "indexed": false },
{ "type": "bytes[]", "name": "calldatas", "indexed": false },
{ "type": "uint256", "name": "startBlock", "indexed": false },
{ "type": "uint256", "name": "endBlock", "indexed": false },
{ "type": "string", "name": "description", "indexed": false }
]
},
{
"type": "event",
"anonymous": false,
"name": "ProposalExecuted",
"inputs": [{ "type": "uint256", "name": "proposalId", "indexed": false }]
},
{
"type": "event",
"anonymous": false,
"name": "VoteCast",
"inputs": [
{ "type": "address", "name": "voter", "indexed": true },
{ "type": "uint256", "name": "proposalId", "indexed": false },
{ "type": "uint8", "name": "support", "indexed": false },
{ "type": "uint256", "name": "weight", "indexed": false },
{ "type": "string", "name": "reason", "indexed": false }
]
},
{
"type": "function",
"name": "_voterInfo",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint256", "name": "distributionId" },
{ "type": "address", "name": "voter" }
],
"outputs": [
{ "type": "uint128", "name": "fundingVotingPower" },
{ "type": "uint128", "name": "fundingRemainingVotingPower" },
{ "type": "uint248", "name": "screeningVotesCast" },
{ "type": "bool", "name": "hasClaimedReward" }
]
},
{
"type": "function",
"name": "ajnaTokenAddress",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [{ "type": "address" }]
},
{
"type": "function",
"name": "claimDelegateReward",
"constant": false,
"payable": false,
"inputs": [{ "type": "uint24", "name": "distributionId_" }],
"outputs": [{ "type": "uint256", "name": "rewardClaimed_" }]
},
{
"type": "function",
"name": "execute",
"constant": false,
"payable": false,
"inputs": [
{ "type": "address[]", "name": "targets_" },
{ "type": "uint256[]", "name": "values_" },
{ "type": "bytes[]", "name": "calldatas_" },
{ "type": "bytes32", "name": "descriptionHash_" }
],
"outputs": [{ "type": "uint256", "name": "proposalId_" }]
},
{
"type": "function",
"name": "fundTreasury",
"constant": false,
"payable": false,
"inputs": [{ "type": "uint256", "name": "fundingAmount_" }],
"outputs": []
},
{
"type": "function",
"name": "fundingVote",
"constant": false,
"payable": false,
"inputs": [
{
"type": "tuple[]",
"name": "voteParams_",
"components": [
{ "type": "uint256", "name": "proposalId" },
{ "type": "int256", "name": "votesUsed" }
]
}
],
"outputs": [{ "type": "uint256", "name": "votesCast_" }]
},
{
"type": "function",
"name": "getChallengeStageStartBlock",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [{ "type": "uint256", "name": "endBlock_" }],
"outputs": [{ "type": "uint256" }]
},
{
"type": "function",
"name": "getDelegateReward",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint24", "name": "distributionId_" },
{ "type": "address", "name": "voter_" }
],
"outputs": [{ "type": "uint256", "name": "rewards_" }]
},
{
"type": "function",
"name": "getDescriptionHash",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [{ "type": "string", "name": "description_" }],
"outputs": [{ "type": "bytes32" }]
},
{
"type": "function",
"name": "getDistributionId",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [{ "type": "uint24" }]
},
{
"type": "function",
"name": "getDistributionPeriodInfo",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [{ "type": "uint24", "name": "distributionId_" }],
"outputs": [
{ "type": "uint24" },
{ "type": "uint48" },
{ "type": "uint48" },
{ "type": "uint128" },
{ "type": "uint256" },
{ "type": "bytes32" }
]
},
{
"type": "function",
"name": "getFundedProposalSlate",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [{ "type": "bytes32", "name": "slateHash_" }],
"outputs": [{ "type": "uint256[]" }]
},
{
"type": "function",
"name": "getFundingStageEndBlock",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [{ "type": "uint256", "name": "startBlock_" }],
"outputs": [{ "type": "uint256" }]
},
{
"type": "function",
"name": "getFundingVotesCast",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint24", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [
{
"type": "tuple[]",
"components": [
{ "type": "uint256", "name": "proposalId" },
{ "type": "int256", "name": "votesUsed" }
]
}
]
},
{
"type": "function",
"name": "getHasClaimedRewards",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint256", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [{ "type": "bool" }]
},
{
"type": "function",
"name": "getProposalInfo",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [{ "type": "uint256", "name": "proposalId_" }],
"outputs": [
{ "type": "uint256" },
{ "type": "uint24" },
{ "type": "uint128" },
{ "type": "uint128" },
{ "type": "int128" },
{ "type": "bool" }
]
},
{
"type": "function",
"name": "getScreeningStageEndBlock",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [{ "type": "uint256", "name": "startBlock_" }],
"outputs": [{ "type": "uint256" }]
},
{
"type": "function",
"name": "getScreeningVotesCast",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint256", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [{ "type": "uint256" }]
},
{
"type": "function",
"name": "getSlateHash",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [{ "type": "uint256[]", "name": "proposalIds_" }],
"outputs": [{ "type": "bytes32" }]
},
{
"type": "function",
"name": "getStage",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [{ "type": "bytes32", "name": "stage_" }]
},
{
"type": "function",
"name": "getTopTenProposals",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [{ "type": "uint24", "name": "distributionId_" }],
"outputs": [{ "type": "uint256[]" }]
},
{
"type": "function",
"name": "getVoterInfo",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint24", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [{ "type": "uint128" }, { "type": "uint128" }, { "type": "uint256" }]
},
{
"type": "function",
"name": "getVotesFunding",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint24", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [{ "type": "uint256", "name": "votes_" }]
},
{
"type": "function",
"name": "getVotesScreening",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [
{ "type": "uint24", "name": "distributionId_" },
{ "type": "address", "name": "account_" }
],
"outputs": [{ "type": "uint256", "name": "votes_" }]
},
{
"type": "function",
"name": "hashProposal",
"constant": true,
"stateMutability": "pure",
"payable": false,
"inputs": [
{ "type": "address[]", "name": "targets_" },
{ "type": "uint256[]", "name": "values_" },
{ "type": "bytes[]", "name": "calldatas_" },
{ "type": "bytes32", "name": "descriptionHash_" }
],
"outputs": [{ "type": "uint256", "name": "proposalId_" }]
},
{
"type": "function",
"name": "propose",
"constant": false,
"payable": false,
"inputs": [
{ "type": "address[]", "name": "targets_" },
{ "type": "uint256[]", "name": "values_" },
{ "type": "bytes[]", "name": "calldatas_" },
{ "type": "string", "name": "description_" }
],
"outputs": [{ "type": "uint256", "name": "proposalId_" }]
},
{
"type": "function",
"name": "screeningVote",
"constant": false,
"payable": false,
"inputs": [
{
"type": "tuple[]",
"name": "voteParams_",
"components": [
{ "type": "uint256", "name": "proposalId" },
{ "type": "uint256", "name": "votes" }
]
}
],
"outputs": [{ "type": "uint256", "name": "votesCast_" }]
},
{
"type": "function",
"name": "startNewDistributionPeriod",
"constant": false,
"payable": false,
"inputs": [],
"outputs": [{ "type": "uint24", "name": "newDistributionId_" }]
},
{
"type": "function",
"name": "state",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [{ "type": "uint256", "name": "proposalId_" }],
"outputs": [{ "type": "uint8" }]
},
{
"type": "function",
"name": "treasury",
"constant": true,
"stateMutability": "view",
"payable": false,
"inputs": [],
"outputs": [{ "type": "uint256" }]
},
{
"type": "function",
"name": "updateSlate",
"constant": false,
"payable": false,
"inputs": [
{ "type": "uint256[]", "name": "proposalIds_" },
{ "type": "uint24", "name": "distributionId_" }
],
"outputs": [{ "type": "bool", "name": "newTopSlate_" }]
}
]