### Rebalance Delegate Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Initiates the delegation process for rebalancing starting from a specific batch. ```APIDOC ## POST rebalanceDelegate ### Description Initiates the delegation process for rebalancing starting from a specific batch. ### Method POST ### Endpoint /rebalanceDelegate ### Parameters #### Request Body - **start** (uint256) - Required - The starting batch number for delegation. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json {}` ``` -------------------------------- ### Process Deposits and Withdrawals Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Processes all pending deposits and withdrawals up to a specified start block. ```APIDOC ## POST processDepositsAndWithdrawals ### Description Processes all pending deposits and withdrawals up to a specified start block. ### Method POST ### Endpoint /processDepositsAndWithdrawals ### Parameters #### Request Body - **start** (uint256) - Required - The starting block number for processing. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json {}` ``` -------------------------------- ### Rebalance Undelegate Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Initiates the undelegation process for rebalancing starting from a specific batch. ```APIDOC ## POST rebalanceUndelegate ### Description Initiates the undelegation process for rebalancing starting from a specific batch. ### Method POST ### Endpoint /rebalanceUndelegate ### Parameters #### Request Body - **start** (uint256) - Required - The starting batch number for undelegation. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json {}` ``` -------------------------------- ### Get User Request Data Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves paginated request data for a specific user. ```APIDOC ## GET /getUserRequestData ### Description Retrieves a paginated list of request data for a given user, including details like ID, claim status, shares, assets, and timestamps. ### Method GET ### Endpoint /getUserRequestData ### Parameters #### Query Parameters - **user** (address) - Required - The address of the user whose request data is to be retrieved. - **startIndex** (uint256) - Required - The starting index for pagination. - **pageSize** (uint256) - Required - The number of requests to return per page. ### Response #### Success Response (200) - **requestData** (tuple[]) - An array of request data objects, where each object has the following properties: - **id** (uint256) - The unique identifier of the request. - **claimed** (bool) - Indicates if the request has been claimed. - **claimable** (bool) - Indicates if the request is currently claimable. - **shares** (uint256) - The number of shares associated with the request. - **assets** (uint256) - The amount of assets associated with the request. - **timestamp** (uint256) - The timestamp when the request was made. - **unlockEpoch** (uint64) - The epoch at which the request becomes unlockable. #### Response Example ```json { "requestData": [ { "id": 1, "claimed": false, "claimable": true, "shares": "1000000000000000000", "assets": "500000000000000000", "timestamp": 1678886400, "unlockEpoch": 123 } ] } ``` ``` -------------------------------- ### Get Pending Withdrawal Amounts Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves information about pending withdrawals, including total amounts and burnable shares. ```APIDOC ## GET /getPendingWithdrawalAmounts ### Description Retrieves details about pending withdrawals, such as the total withdrawal amount, total burnable shares, next request ID, and pending deposit amount. ### Method GET ### Endpoint /getPendingWithdrawalAmounts ### Parameters #### Query Parameters - **batchSize** (uint256) - Required - The number of withdrawal requests to consider in the batch. ### Response #### Success Response (200) - **_totalWithdrawalAmount** (uint256) - The total amount of assets pending withdrawal. - **_totalBurnableShares** (uint256) - The total number of shares that can be burned for withdrawal. - **_nextRequestId** (uint256) - The ID of the next withdrawal request. - **_pendingDeposit** (uint256) - The amount of assets currently pending deposit. - **_blockNumber** (uint256) - The block number at which these values were last updated. #### Response Example ```json { "_totalWithdrawalAmount": "1000000000000000000", "_totalBurnableShares": "500000000000000000", "_nextRequestId": 10, "_pendingDeposit": "200000000000000000", "_blockNumber": 12345678 } ``` ``` -------------------------------- ### mint Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Mints new shares into the protocol. ```APIDOC ## POST /mint ### Description Mints new shares into the Apriori Protocol. This function is payable, meaning it can accept native currency (e.g., ETH) to mint shares. ### Method POST ### Endpoint /mint ### Parameters #### Request Body - **shares** (uint256) - Required - The number of shares to mint. - **receiver** (address) - Required - The address that will receive the minted shares. ### Request Example ```json { "shares": "250000000000000000", "receiver": "0x1234567890abcdef1234567890abcdef12345678" } ``` ### Response #### Success Response (200) - **assets** (uint256) - The amount of underlying assets received in exchange for the minted shares. #### Response Example ```json { "assets": "250000000000000000" } ``` ``` -------------------------------- ### Configuration Functions Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Functions to configure various parameters of the smart contract, such as oracle operators, fees, and registry addresses. ```APIDOC ## SET ORACLE OPERATOR ### Description Sets the oracle operator address. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_oracleOperator** (address) - Required - The address of the new oracle operator. ### Request Example ```json { "function": "setOracleOperator", "params": [ "0x1234567890abcdef1234567890abcdef12345678" ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## SET REWARD FEE ### Description Sets the reward fee percentage. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_rewardFee** (uint8) - Required - The new reward fee percentage. ### Request Example ```json { "function": "setRewardFee", "params": [ 10 ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## SET STAKE PRECOMPILE ### Description Sets the address of the stake precompile contract. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_stakePrecompile** (address payable) - Required - The address of the stake precompile contract. ### Request Example ```json { "function": "setStakePrecompile", "params": [ "0xabcdef1234567890abcdef1234567890abcdef12" ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## SET VALIDATORS REGISTRY ### Description Sets the address of the validators registry contract. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_validatorsRegistry** (address) - Required - The address of the validators registry contract. ### Request Example ```json { "function": "setValidatorsRegistry", "params": [ "0x1122334455667788990011223344556677889900" ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## SET WITHDRAWAL DELAY ### Description Sets the withdrawal delay period. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_withdrawalDelay** (uint64) - Required - The new withdrawal delay in epochs. ### Request Example ```json { "function": "setWithdrawalDelay", "params": [ 5 ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## SET WITHDRAWAL FEE ### Description Sets the withdrawal fee. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_withdrawalFee** (uint256) - Required - The new withdrawal fee amount. ### Request Example ```json { "function": "setWithdrawalFee", "params": [ 10000000000000000 ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ## UPDATE ORACLE DATA ### Description Updates the oracle data with new values. ### Method POST (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **_blockNumber** (uint256) - Required - The current block number. - **_pendingDepositUtilisedForWithdrawals** (uint256) - Required - The amount of pending deposits used for withdrawals. - **_rewardsAfterProcessingWithdrawals** (uint256) - Required - The rewards after processing withdrawals. - **_totalStaked** (uint256) - Required - The total amount staked. - **_burnableShares** (uint256) - Required - The amount of burnable shares. - **_lastProcessedRequestId** (uint256) - Required - The ID of the last processed request. - **_rewardFees** (uint256) - Required - The total reward fees. ### Request Example ```json { "function": "updateOracleData", "params": [ 1234567, 1000000000000000000, 500000000000000000, 2000000000000000000, 200000000000000000, 42, 70000000000000000 ] } ``` ### Response #### Success Response (200) No specific return value, indicates successful execution. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### migrationDeposit Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Allows migration of assets into the protocol. ```APIDOC ## POST /migrationDeposit ### Description Allows users to migrate existing assets into the Apriori Protocol. This function is payable, meaning it can accept native currency (e.g., ETH). ### Method POST ### Endpoint /migrationDeposit ### Parameters #### Request Body - **assets** (uint256) - Required - The amount of assets to migrate. ### Request Example ```json { "assets": "500000000000000000" } ``` ### Response #### Success Response (200) (No specific return value defined for this function, typically indicates success if no error is thrown) #### Response Example ```json { "message": "Migration successful" } ``` ``` -------------------------------- ### Preview Mint Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the amount of assets that would be received for a given amount of shares minted. ```APIDOC ## GET previewMint ### Description Calculates the amount of assets that would be received for a given amount of shares minted. ### Method GET ### Endpoint /previewMint ### Parameters #### Query Parameters - **shares** (uint256) - Required - The number of shares to mint. ### Response #### Success Response (200) - **assets** (uint256) - The calculated amount of assets. #### Response Example ```json { "assets": "1000000000000000000" } ``` ``` -------------------------------- ### Get User Request Data Count Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the total count of requests for a specific user. ```APIDOC ## GET /getUserRequestDataCount ### Description Returns the total number of requests made by a specific user. ### Method GET ### Endpoint /getUserRequestDataCount ### Parameters #### Query Parameters - **user** (address) - Required - The address of the user. ### Response #### Success Response (200) - **count** (uint256) - The total number of requests for the specified user. #### Response Example ```json { "count": 5 } ``` ``` -------------------------------- ### Preview Redeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the amount of assets that would be received for a given amount of shares redeemed. ```APIDOC ## GET previewRedeem ### Description Calculates the amount of assets that would be received for a given amount of shares redeemed. ### Method GET ### Endpoint /previewRedeem ### Parameters #### Query Parameters - **shares** (uint256) - Required - The number of shares to redeem. ### Response #### Success Response (200) - **assets** (uint256) - The calculated amount of assets. #### Response Example ```json { "assets": "1000000000000000000" } ``` ``` -------------------------------- ### EIP712 Domain Information Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves information about the EIP712 domain used for signature verification. ```APIDOC ## GET /eip712Domain ### Description Retrieves the EIP712 domain separator used for typed structured data hashing and signing. ### Method GET ### Endpoint /eip712Domain ### Parameters None ### Response #### Success Response (200) - **fields** (bytes1) - The fields byte string. - **_name** (string) - The name of the domain. - **_version** (string) - The version of the domain. - **chainId** (uint256) - The chain ID associated with the domain. - **verifyingContract** (address) - The address of the verifying contract. - **salt** (bytes32) - The salt used for domain separation. - **extensions** (uint256[]) - An array of extension values. #### Response Example ```json { "fields": "0x01", "_name": "Apríori", "_version": "1", "chainId": 1, "verifyingContract": "0x...", "salt": "0x...", "extensions": [1, 2] } ``` ``` -------------------------------- ### Redeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Redeems a list of share redemption requests. ```APIDOC ## POST redeem ### Description Redeems a list of share redemption requests. ### Method POST ### Endpoint /redeem ### Parameters #### Request Body - **requestIDs** (uint256[]) - Required - An array of redemption request IDs. - **receiver** (address) - Required - The address to receive the redeemed assets. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json { "requestIDs": [1, 2, 3], "receiver": "0x123..." } ``` ``` -------------------------------- ### State Query Functions Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Functions to retrieve various state variables and information from the smart contract. ```APIDOC ## STAKE PRECOMPILE ### Description Retrieves the address of the stake precompile contract. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "stakePrecompile" } ``` ### Response #### Success Response (200) - **stakePrecompile** (address payable) - The address of the stake precompile contract. #### Response Example ```json { "stakePrecompile": "0xabcdef1234567890abcdef1234567890abcdef12" } ``` ## SYMBOL ### Description Retrieves the symbol of the token. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "symbol" } ``` ### Response #### Success Response (200) - **symbol** (string) - The token symbol. #### Response Example ```json { "symbol": "APR" } ``` ## TOTAL ASSETS ### Description Retrieves the total assets managed by the contract. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "totalAssets" } ``` ### Response #### Success Response (200) - **totalAssets** (uint256) - The total amount of assets. #### Response Example ```json { "totalAssets": "100000000000000000000" } ``` ## TOTAL PENDING DEPOSIT ### Description Retrieves the total pending deposit amount. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "totalPendingDeposit" } ``` ### Response #### Success Response (200) - **totalPendingDeposit** (uint256) - The total pending deposit amount. #### Response Example ```json { "totalPendingDeposit": "500000000000000000" } ``` ## TOTAL STAKED ### Description Retrieves the total amount of assets staked. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "totalStaked" } ``` ### Response #### Success Response (200) - **totalStaked** (uint256) - The total amount staked. #### Response Example ```json { "totalStaked": "2000000000000000000" } ``` ## TOTAL SUPPLY ### Description Retrieves the total supply of the token. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "totalSupply" } ``` ### Response #### Success Response (200) - **totalSupply** (uint256) - The total supply of the token. #### Response Example ```json { "totalSupply": "2500000000000000000" } ``` ## VALIDATOR BATCH INDICES ### Description Retrieves the validator batch indices for a given index. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **index** (uint256) - Required - The index for which to retrieve batch indices. ### Request Example ```json { "function": "validatorBatchIndices", "params": [ 0 ] } ``` ### Response #### Success Response (200) - **validatorBatchIndices** (uint256) - The validator batch indices. #### Response Example ```json { "validatorBatchIndices": 10 } ``` ## VALIDATORS REGISTRY ### Description Retrieves the address of the validators registry contract. ### Method GET (or equivalent for smart contract calls) ### Endpoint N/A (Smart Contract Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "function": "validatorsRegistry" } ``` ### Response #### Success Response (200) - **validatorsRegistry** (address) - The address of the validators registry contract. #### Response Example ```json { "validatorsRegistry": "0x1122334455667788990011223344556677889900" } ``` ``` -------------------------------- ### name Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the name of the protocol. ```APIDOC ## GET /name ### Description Retrieves the name of the Apriori Protocol. ### Method GET ### Endpoint /name ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **name** (string) - The name of the protocol. #### Response Example ```json { "name": "Apriori Protocol" } ``` ``` -------------------------------- ### Request Redeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Requests the redemption of a specified amount of shares. ```APIDOC ## POST requestRedeem ### Description Requests the redemption of a specified amount of shares. ### Method POST ### Endpoint /requestRedeem ### Parameters #### Request Body - **shares** (uint256) - Required - The amount of shares to redeem. - **controller** (address) - Required - The controller address. - **owner** (address) - Required - The owner of the shares. ### Response #### Success Response (200) - **requestId** (uint256) - The ID of the redemption request. #### Response Example ```json { "shares": "1000000000000000000", "controller": "0x123...", "owner": "0xabc..." } ``` ``` -------------------------------- ### Preview Deposit Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the number of shares that would be minted for a given amount of assets deposited. ```APIDOC ## GET previewDeposit ### Description Calculates the number of shares that would be minted for a given amount of assets deposited. ### Method GET ### Endpoint /previewDeposit ### Parameters #### Query Parameters - **assets** (uint256) - Required - The amount of assets to deposit. ### Response #### Success Response (200) - **shares** (uint256) - The calculated number of shares. #### Response Example ```json { "shares": "1000000000000000000" } ``` ``` -------------------------------- ### Epoch Length Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the configured epoch length for the system. ```APIDOC ## GET /epochLength ### Description Returns the duration of an epoch in seconds. ### Method GET ### Endpoint /epochLength ### Parameters None ### Response #### Success Response (200) - **epochLength** (uint256) - The length of an epoch in seconds. #### Response Example ```json { "epochLength": 86400 } ``` ``` -------------------------------- ### permit Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Allows a spender to withdraw assets on behalf of the owner. ```APIDOC ## POST /permit ### Description Allows a specified spender to withdraw a certain amount of assets on behalf of the owner, typically after the owner has signed a permit message. ### Method POST ### Endpoint /permit ### Parameters #### Request Body - **owner** (address) - Required - The address of the asset owner. - **spender** (address) - Required - The address permitted to withdraw assets. - **value** (uint256) - Required - The maximum amount of assets the spender is allowed to withdraw. ### Request Example ```json { "owner": "0x1234567890abcdef1234567890abcdef12345678", "spender": "0xabcdef1234567890abcdef1234567890abcdef12", "value": "750000000000000000" } ``` ### Response #### Success Response (200) (No specific return value defined for this function, typically indicates success if no error is thrown. The permit is granted off-chain and this transaction confirms it on-chain.) #### Response Example ```json { "message": "Permit granted successfully" } ``` ``` -------------------------------- ### minimumRedeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the minimum amount of assets that can be redeemed. ```APIDOC ## GET /minimumRedeem ### Description Retrieves the minimum amount of assets that can be redeemed from the protocol. ### Method GET ### Endpoint /minimumRedeem ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **minAssets** (uint256) - The minimum number of assets that can be redeemed. #### Response Example ```json { "minAssets": "100000000000000000" } ``` ``` -------------------------------- ### Set Minimum Redeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Sets the minimum amount of shares that can be redeemed. ```APIDOC ## POST setMinimumRedeem ### Description Sets the minimum amount of shares that can be redeemed. ### Method POST ### Endpoint /setMinimumRedeem ### Parameters #### Request Body - **_minimumRedeem** (uint256) - Required - The minimum redeemable amount of shares. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json { "_minimumRedeem": "1000000000000000000" } ``` ``` -------------------------------- ### Preview Withdraw Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the number of shares that would be redeemed for a given amount of assets withdrawn. ```APIDOC ## GET previewWithdraw ### Description Calculates the number of shares that would be redeemed for a given amount of assets withdrawn. ### Method GET ### Endpoint /previewWithdraw ### Parameters #### Query Parameters - **assets** (uint256) - Required - The amount of assets to withdraw. ### Response #### Success Response (200) - **shares** (uint256) - The calculated number of shares. #### Response Example ```json { "shares": "1000000000000000000" } ``` ``` -------------------------------- ### oracleParams Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves various parameters related to the oracle's operation. ```APIDOC ## GET /oracleParams ### Description Retrieves a comprehensive set of parameters related to the oracle's current state and operations, including withdrawal amounts, share data, request IDs, pending deposits, block numbers, and rebalance status. ### Method GET ### Endpoint /oracleParams ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **totalWithdrawalAmount** (uint256) - The total amount of assets withdrawn. - **totalBurnableShares** (uint256) - The total number of shares that are burnable. - **nextRequestId** (uint256) - The next available request ID. - **pendingDeposit** (uint256) - The amount of pending deposits. - **blockNumber** (uint256) - The current block number. - **rebalanceNeeded** (bool) - Indicates whether a rebalance is needed. #### Response Example ```json { "totalWithdrawalAmount": "500000000000000000", "totalBurnableShares": "1000000000000000000", "nextRequestId": "98766", "pendingDeposit": "100000000000000000", "blockNumber": "1234568", "rebalanceNeeded": false } ``` ``` -------------------------------- ### Renounce Ownership Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Allows the current owner to renounce ownership of the contract. ```APIDOC ## POST renounceOwnership ### Description Allows the current owner to renounce ownership of the contract. ### Method POST ### Endpoint /renounceOwnership ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json {}` ``` -------------------------------- ### Reward Fee Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the current reward fee percentage. ```APIDOC ## GET rewardFee ### Description Retrieves the current reward fee percentage. ### Method GET ### Endpoint /rewardFee ### Response #### Success Response (200) - **fee** (uint8) - The reward fee percentage. #### Response Example ```json { "fee": 5 } ``` ``` -------------------------------- ### pause Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Pauses the contract's operations. ```APIDOC ## POST /pause ### Description Pauses the operations of the smart contract. This action can typically only be performed by the owner or an authorized address. ### Method POST ### Endpoint /pause ### Parameters None ### Request Example (No request body for POST requests) ### Response #### Success Response (200) (No specific return value defined for this function, typically indicates success if no error is thrown) #### Response Example ```json { "message": "Contract paused successfully" } ``` ``` -------------------------------- ### Rewards Distributing Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the amount of rewards currently being distributed. ```APIDOC ## GET rewardsDistributing ### Description Retrieves the amount of rewards currently being distributed. ### Method GET ### Endpoint /rewardsDistributing ### Response #### Success Response (200) - **rewards** (uint256) - The amount of rewards being distributed. #### Response Example ```json { "rewards": "1000000000000000000" } ``` ``` -------------------------------- ### Set Fee Vault Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Sets the address of the fee vault. ```APIDOC ## POST setFeeVault ### Description Sets the address of the fee vault. ### Method POST ### Endpoint /setFeeVault ### Parameters #### Request Body - **_feeVault** (address) - Required - The address of the fee vault. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json { "_feeVault": "0x123..." } ``` ``` -------------------------------- ### nonces Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the nonce for a given address. ```APIDOC ## GET /nonces ### Description Retrieves the nonce (a number used once) associated with a specific address. Nonces are often used for security purposes, such as in signature verification. ### Method GET ### Endpoint /nonces ### Parameters #### Query Parameters - **address** (address) - Required - The address for which to retrieve the nonce. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **nonce** (uint256) - The nonce value for the specified address. #### Response Example ```json { "nonce": "15" } ``` ``` -------------------------------- ### oracleUpdateTracking Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Tracks oracle updates based on transaction type and ID. ```APIDOC ## GET /oracleUpdateTracking ### Description Tracks the status or outcome of oracle updates based on the type of transaction and a specific identifier. ### Method GET ### Endpoint /oracleUpdateTracking ### Parameters #### Query Parameters - **txType** (uint8) - Required - The type of oracle transaction (enum aprMON.OracleTxType). - **txId** (uint256) - Required - The identifier for the specific oracle transaction. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **trackingStatus** (bool) - True if tracking is successful or the update is valid, false otherwise. #### Response Example ```json { "trackingStatus": true } ``` ``` -------------------------------- ### Set Epoch Length Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Sets the length of an epoch. ```APIDOC ## POST setEpochLength ### Description Sets the length of an epoch. ### Method POST ### Endpoint /setEpochLength ### Parameters #### Request Body - **_epochLength** (uint256) - Required - The new epoch length. ### Response #### Success Response (200) - (No specific fields returned) #### Response Example ```json { "_epochLength": "86400" } ``` ``` -------------------------------- ### pendingRedeemRequest Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves details of a pending redeem request. ```APIDOC ## GET /pendingRedeemRequest ### Description Retrieves the number of shares associated with a pending redeem request, identified by a request ID and controller address. ### Method GET ### Endpoint /pendingRedeemRequest ### Parameters #### Query Parameters - **requestId** (uint256) - Required - The ID of the redeem request. - **controller** (address) - Required - The address of the controller managing the request. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **shares** (uint256) - The number of shares associated with the pending redeem request. #### Response Example ```json { "shares": "300000000000000000" } ``` ``` -------------------------------- ### Set Operator Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Approves or disapproves an operator for performing certain actions. ```APIDOC ## POST setOperator ### Description Approves or disapproves an operator for performing certain actions. ### Method POST ### Endpoint /setOperator ### Parameters #### Request Body - **operator** (address) - Required - The address of the operator. - **approved** (bool) - Required - True to approve, false to disapprove. ### Response #### Success Response (200) - **approvedStatus** (bool) - The approval status of the operator. #### Response Example ```json { "operator": "0x123...", "approved": true } ``` ``` -------------------------------- ### maxMint Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the maximum number of shares that can be minted for a given receiver. ```APIDOC ## GET /maxMint ### Description Calculates the maximum number of shares that can be minted for a specific receiver address. ### Method GET ### Endpoint /maxMint ### Parameters #### Query Parameters - **receiver** (address) - Required - The address of the receiver. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **maxShares** (uint256) - The maximum number of shares that can be minted. #### Response Example ```json { "maxShares": "500000000000000000" } ``` ``` -------------------------------- ### Fetch Exchange Rate (MON to aprMON) Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Fetches the current MON to aprMON exchange rate by invoking the convertToShares function. This indicates how many aprMON tokens are received for a given amount of MON. The exchange rate is typically 1e18 on the testnet. ```solidity uint256 shares = aprMON.convertToShares(1 ether); ``` -------------------------------- ### Fetch Exchange Rate (aprMON to MON) Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Fetches the current aprMON to MON exchange rate by invoking the convertToAssets function. This indicates how many MON tokens are received for a given amount of aprMON. The exchange rate is typically 1e18 on the testnet. ```solidity uint256 assets = aprMON.convertToAssets(1 ether); ``` -------------------------------- ### Fee Vault Address Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the address of the fee vault. ```APIDOC ## GET /feeVault ### Description Returns the address of the contract responsible for holding collected fees. ### Method GET ### Endpoint /feeVault ### Parameters None ### Response #### Success Response (200) - **feeVault** (address) - The address of the fee vault contract. #### Response Example ```json { "feeVault": "0x..." } ``` ``` -------------------------------- ### nextRequestId Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the next available request ID. ```APIDOC ## GET /nextRequestId ### Description Retrieves the next available unique identifier for requests within the protocol. ### Method GET ### Endpoint /nextRequestId ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **requestId** (uint256) - The next request ID. #### Response Example ```json { "requestId": "98765" } ``` ``` -------------------------------- ### Fetch Balance of an Account Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the aprMON balance for a specified account using the balanceOf function. This is a standard ERC20 view function. ```solidity balanceOf(address account) external view returns (uint256 balance); ``` -------------------------------- ### Apriori Protocol Read Functions Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration This section outlines the read-only functions available in the Apriori Protocol smart contract. These functions allow querying the current state of the protocol without modifying it. ```APIDOC ## Apriori Protocol Read Functions ### Description These functions allow querying the current state of the Apriori Protocol smart contract without modifying it. They are typically used to retrieve information such as configuration values, balances, or status. ### Functions #### `feeCollectionPeriod()` - **Description**: Returns the duration of the fee collection period. - **Method**: GET - **Endpoint**: `N/A` (Contract Read Function) - **Parameters**: None - **Return Value**: `uint64` - The length of the fee collection period. #### `withdrawalDelay()` - **Description**: Returns the configured delay before a withdrawal can be processed. - **Method**: GET - **Endpoint**: `N/A` (Contract Read Function) - **Parameters**: None - **Return Value**: `uint64` - The withdrawal delay in seconds. #### `withdrawalFee()` - **Description**: Returns the current withdrawal fee rate. - **Method**: GET - **Endpoint**: `N/A` (Contract Read Function) - **Parameters**: None - **Return Value**: `uint256` - The withdrawal fee rate. #### `withdrawalFeesAccumulated()` - **Description**: Returns the total accumulated withdrawal fees. - **Method**: GET - **Endpoint**: `N/A` (Contract Read Function) - **Parameters**: None - **Return Value**: `uint256` - The total accumulated withdrawal fees. #### `withdrawalWaitTime()` - **Description**: Returns the configured wait time for withdrawals. - **Method**: GET - **Endpoint**: `N/A` (Contract Read Function) - **Parameters**: None - **Return Value**: `uint256` - The withdrawal wait time in seconds. ### Response Example (Conceptual) For a function like `withdrawalFee()`: ```json { "success": true, "result": "10000000000000000" } ``` *(Note: Actual response format may vary depending on the interaction method, e.g., Web3 library calls.)* ``` -------------------------------- ### maxRedeem Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Calculates the maximum number of shares that can be redeemed by an owner. ```APIDOC ## GET /maxRedeem ### Description Calculates the maximum number of shares that can be redeemed by a specific owner address. ### Method GET ### Endpoint /maxRedeem ### Parameters #### Query Parameters - **owner** (address) - Required - The address of the owner. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **maxShares** (uint256) - The maximum number of shares that can be redeemed. #### Response Example ```json { "maxShares": "750000000000000000" } ``` ``` -------------------------------- ### owner Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration Retrieves the owner of the contract. ```APIDOC ## GET /owner ### Description Retrieves the address of the current owner of the smart contract. ### Method GET ### Endpoint /owner ### Parameters None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **ownerAddress** (address) - The address of the contract owner. #### Response Example ```json { "ownerAddress": "0xabcdef1234567890abcdef1234567890abcdef12" } ``` ``` -------------------------------- ### Apriori Protocol Events Source: https://apriori-docs.gitbook.io/apriori-docs/aprmon/smart-contract-integration This section details the events emitted by the Apriori Protocol smart contract. Events are used to log significant occurrences and state changes within the contract, enabling off-chain services to track activity. ```APIDOC ## Apriori Protocol Events ### Description Events are emitted by the smart contract to signal significant actions or state changes. These are crucial for off-chain applications to monitor and react to protocol activities. ### Emitted Events #### `Approval(address owner, address spender, uint256 value)` - **Description**: Emitted when an `owner` allows a `spender` to withdraw from their account, up to a specified `value`. - **Inputs**: - `owner` (address, indexed): The address of the account owner. - `spender` (address, indexed): The address allowed to spend. - `value` (uint256): The amount approved. #### `Deposit(address sender, address owner, uint256 assets, uint256 shares)` - **Description**: Emitted when a user deposits assets into the protocol, receiving shares in return. - **Inputs**: - `sender` (address, indexed): The address initiating the deposit. - `owner` (address, indexed): The address of the beneficiary. - `assets` (uint256): The amount of assets deposited. - `shares` (uint256): The amount of shares received. #### `EpochLengthUpdated(uint256 epochLength)` - **Description**: Emitted when the epoch length for rewards distribution is updated. - **Inputs**: - `epochLength` (uint256): The new epoch length. #### `EpochRewardsUpdated(uint256 blockNumber, uint256 rewardsDistributing)` - **Description**: Emitted when epoch rewards are updated, possibly indicating the start of a new reward distribution cycle. - **Inputs**: - `blockNumber` (uint256): The block number at which rewards were updated. - `rewardsDistributing` (uint256): The amount of rewards currently being distributed. #### `FeeVaultUpdated(address protocolFeeVault)` - **Description**: Emitted when the address of the protocol's fee vault is updated. - **Inputs**: - `protocolFeeVault` (address): The new address of the fee vault. #### `Initialized(uint64 version)` - **Description**: Emitted when the contract is first initialized. - **Inputs**: - `version` (uint64): The initialization version. #### `MigrationDeposit(uint256 assets)` - **Description**: Emitted during a migration process when assets are deposited. - **Inputs**: - `assets` (uint256): The amount of assets migrated. #### `MinimumRedeemUpdated(uint256 minimumRedeem)` - **Description**: Emitted when the minimum redeemable amount is updated. - **Inputs**: - `minimumRedeem` (uint256): The new minimum redeem amount. #### `OperatorSet(address controller, address operator, bool approved)` - **Description**: Emitted when an operator's status (approved/disapproved) is changed by a controller. - **Inputs**: - `controller` (address, indexed): The address of the controller. - `operator` (address, indexed): The address of the operator. - `approved` (bool): The approval status. #### `OracleDataUpdate(uint256 blockNumber, uint256 totalPendingDeposit, uint256 totalStaked, uint256 burnableShares, uint256 lastProcessedRequestId, uint256 rewardFeesAccumulated)` - **Description**: Emitted when oracle data is updated, reflecting changes in deposits, staked amounts, shares, etc. - **Inputs**: - `blockNumber` (uint256): The block number of the data update. - `totalPendingDeposit` (uint256): Total pending deposits. - `totalStaked` (uint256): Total assets staked. - `burnableShares` (uint256): Amount of burnable shares. - `lastProcessedRequestId` (uint256): The last processed request ID. - `rewardFeesAccumulated` (uint256): Accumulated reward fees. #### `OracleOperatorUpdated(address oracle)` - **Description**: Emitted when the oracle operator address is updated. - **Inputs**: - `oracle` (address): The new oracle operator address. #### `OwnershipTransferred(address previousOwner, address newOwner)` - **Description**: Emitted when the ownership of the contract is transferred. - **Inputs**: - `previousOwner` (address, indexed): The address of the previous owner. - `newOwner` (address, indexed): The address of the new owner. #### `Paused(address account)` - **Description**: Emitted when the contract is paused, indicating an account that triggered the pause. - **Inputs**: - `account` (address): The account that triggered the pause. #### `RebalanceStarted(uint256 rebalanceInProgress)` - **Description**: Emitted when a rebalancing process is initiated. - **Inputs**: - `rebalanceInProgress` (uint256): Indicates if rebalancing is in progress. ### Event Log Example (Conceptual) When a `Deposit` event is emitted: ```json { "event": "Deposit", "args": { "sender": "0xabc123...", "owner": "0xdef456...", "assets": "1000000000000000000", "shares": "980000000000000000" } } ``` *(Note: Actual event data format depends on the blockchain client and logging tools used.)* ```