StakeStone API References
This page describes detailed technical interfaces on StakeStone, including interface definitions, listed parameters, return values and call samples of different programming languages and environments.
Before we proceed, it is essential to have a basic understanding of programming concepts related to blockchain. This includes familiarity with Ethereum and its associated concepts such as smart contracts, and the Solidity programming language, as well as popular development environments like Remix, Truffle, Hardhat, and others.
Vault-Related
Deposit ETH to vault
Description
Make a deposit to StakeStone vault, and the caller will get STONE tokens as the vault shares.
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0xd0e30db0 |
Invocation Type | Ethereum Transaction |
Passing Parameters | None. |
Return Value | mintAmount, the STONE tokens minted |
Event Emitted | |
Event Signature | 0x36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e |
ABI Description
Samples
HTTP Request Example
Make a deposit to vault
POST
(RPC Endpoint)
Make a deposit transaction to StakeStone vault.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the signed transaction data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Make a withdrawal request from vault
Description
Make a withdrawal request from Vault. User could retrieve ETH principal and yields from vault after vault has been settled.
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0x745400c9 |
Invocation Type | Ethereum Transaction |
Passing Parameters | uint256 _shares, the STONE amount to withdraw; actual number multiplied by 1E18 |
Return Value | None. |
Event Emitted | |
Event Signature | 0x0c53c82ad07e2d592d88ece3b066777dd60f1118e2a081b380efc4358f0d9e2a |
ABI Description
Samples
HTTP Request Example
Make a withdrawal request from vault.
POST
(RPC Endpoint)
Make a withdrawal request transaction from vault.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the signed transaction data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Cancel withdrawal request
Description
Cancel a previous withdrawal request to get pending STONE back.
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0x9f01f7ba |
Invocation Type | Ethereum Transaction |
Passing Parameters | uint256 _shares, the STONE amount to cancel; actual number multiplied by 1E18 |
Return Value | None. |
Event Emitted | |
Event Signature | 0x39e2e01794006bc1f63835af5c05db790beca4bfb40de3f02cc3ddf22dccc0fb |
ABI Description
Samples
HTTP Request Example
Cancel withdrawal request
POST
(RPC Endpoint)
Cancel a former withdrawal request to get pending STONE back.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the signed transaction data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query current STONE price
Description
Query the real-time STONE price(quoted by ETH price).
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0x28a79576 |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 price, the price of STONE |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query current STONE price
POST
(RPC Endpoint)
Query the real-time STONE price(quoted by ETH price).
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query historical STONE price
Description
Query the historical STONE price by settlement round (quoted by ETH price).
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0x87153eb1 |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 price, the price of STONE |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query historical STONE price
POST
(RPC Endpoint)
Query the historical STONE price by settlement round (quoted by ETH price).
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the transaction data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query latest settlement round
Description
Query the latest settlement round of StakeStone vault.
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0xf76339dc |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 round, the latest settlement round |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query latest settlement round
POST
(RPC Endpoint)
Query the latest settlement round of StakeStone vault.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query withdraw fee rate
Description
Query withdraw fee rate of StakeStone vault(multiplied by 1E6).
Function Description
Items | Description |
---|---|
Contract Address | StoneVault contract (referenced by Smart Contracts Address section) |
Contract Name | StoneVault.sol |
Function Name | |
Function Selector | 0xea99e689 |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 rate, withdraw fee rate(multiplied by 1E6) |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query withdraw fees
POST
(RPC Endpoint)
Query withdraw fee rate of StakeStone vault(multiplied by 1E6).
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Strategy-Related
Query all strategies of the portfolio
Description
Get all smart contract address of strategies.
Function Description
Items | Description |
---|---|
Contract Address | StrategyController contract (referenced by Smart Contracts Address section) |
Contract Name | StrategyController.sol |
Function Name | |
Function Selector | 0xb49a60bb |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | address[] memory addrs, the array of strategy address uint256[] memory portions, the array of the portions of each strategy |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query all strategies of the portfolio
POST
(RPC Endpoint)
Get all smart contract address of strategies.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query ethers deployed on all strategies
Description
Get ethers amount deployed on all strategies.
Function Description
Items | Description |
---|---|
Contract Address | StrategyController contract (referenced by Smart Contracts Address section) |
Contract Name | StrategyController.sol |
Function Name | |
Function Selector | 0xb49a60bb |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 value, ether amount(multiplied by 1E18) |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query ethers deployed on all strategies
POST
(RPC Endpoint)
Get ethers amount deployed on all strategies.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query ethers deployed on certain strategy
Description
Get ether amount deployed on certain strategy.
Function Description
Items | Description |
---|---|
Contract Address | StrategyController contract (referenced by Smart Contracts Address section) |
Contract Name | StrategyController.sol |
Function Name | |
Function Selector | 0x9841ab00 |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | uint256 value, ether amount(multiplied by 1E18) |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query ethers deployed on certain strategy
POST
(RPC Endpoint)
Get ether amount deployed on certain strategy.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Vote-Related
Query all proposals
Description
Get all smart contract address of proposals.
Function Description
Items | Description |
---|---|
Contract Address | Proposal contract (referenced by Smart Contracts Address section) |
Contract Name | Proposal.sol |
Function Name | |
Function Selector | 0x62564c48 |
Invocation Type | Ethereum Call |
Passing Parameters | None. |
Return Value | address[] memory addrs, the array of proposal address |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query all proposals
POST
(RPC Endpoint)
Get all smart contract address of proposals.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Query vote info on certain proposal
Description
Get the proposal details.
Function Description
Items | Description |
---|---|
Contract Address | Proposal contract (referenced by Smart Contracts Address section) |
Contract Name | Proposal.sol |
Function Name | |
Function Selector | 0x3b23c36d |
Invocation Type | Ethereum Call |
Passing Parameters | address _proposal, proposal address |
Return Value | address proposal, the address propose the proposal uint256 deadline, the deadline of voting period uint256 support, the vote amount of supporting the proposal uint256 oppose, the vote amount of opposing the proposal uint256 executedTime, the timestamp of executing the proposal bytes data, proposal data |
Event Emitted | None. |
Event Signature | None. |
ABI Description
Samples
HTTP Request Example
Query vote info on certain proposal
POST
(RPC Endpoint)
Get the proposal details.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_call" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Vote for a proposal
Description
Voting for a proposal by staking with STONE.
Function Description
Items | Description |
---|---|
Contract Address | Proposal contract (referenced by Smart Contracts Address section) |
Contract Name | Proposal.sol |
Function Name | |
Function Selector | 0x31547ea6 |
Invocation Type | Ethereum Transaction |
Passing Parameters | address _proposal, the proposal address uint256 _poll, the STONE amount will be staked which represents the voting power bool _flag, true represents the supporting of a proposal |
Return Value | None. |
Event Emitted | |
Event Signature | 0xdf4863bb3c37bd8d486548a8abd33fb356c8536cbb1111b676b1810d64447544 |
ABI Description
Samples
HTTP Request Example
Vote for a proposal
POST
(RPC Endpoint)
Voting for a proposal by staking with STONE.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Retrieve STONEs voted for certain proposal
Description
Voting for a proposal by staking with STONE.
Function Description
Items | Description |
---|---|
Contract Address | Proposal contract (referenced by Smart Contracts Address section) |
Contract Name | Proposal.sol |
Function Name | |
Function Selector | 0x31547ea6 |
Invocation Type | Ethereum Transaction |
Passing Parameters | address _proposal, the proposal address uint256 _poll, the STONE amount will be staked which represents the voting power bool _flag, true represents the supporting of a proposal |
Return Value | None. |
Event Emitted | |
Event Signature | 0xdf4863bb3c37bd8d486548a8abd33fb356c8536cbb1111b676b1810d64447544 |
ABI Description
Samples
HTTP Request Example
Vote for a proposal
POST
(RPC Endpoint)
Voting for a proposal by staking with STONE.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Retrieve STONEs voted for all proposals
Description
Voting for a proposal by staking with STONE.
Function Description
Items | Description |
---|---|
Contract Address | Proposal contract (referenced by Smart Contracts Address section) |
Contract Name | Proposal.sol |
Function Name | |
Function Selector | 0x31547ea6 |
Invocation Type | Ethereum Transaction |
Passing Parameters | address _proposal, the proposal address uint256 _poll, the STONE amount will be staked which represents the voting power bool _flag, true represents the supporting of a proposal |
Return Value | None. |
Event Emitted | |
Event Signature | 0xdf4863bb3c37bd8d486548a8abd33fb356c8536cbb1111b676b1810d64447544 |
ABI Description
Samples
HTTP Request Example
Vote for a proposal
POST
(RPC Endpoint)
Voting for a proposal by staking with STONE.
More details on how to send a transaction via RPC endpoint could be found here, https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | String | "2.0" |
method* | String | "eth_sendRawTransaction" |
params* | Array | the call data coerced into string array |
id* | Number | request sequence id, you could use timestamp as id |
Last updated