-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from maestro-org/17-hackage-readiness
Feat 17: Hackage readiness
- Loading branch information
Showing
39 changed files
with
644 additions
and
489 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
module Main (main) where | ||
|
||
import qualified Data.Text as T | ||
import qualified Data.Text as T | ||
import Maestro.Client.Env | ||
import Maestro.Run.Datum | ||
import Maestro.Run.Epochs | ||
import Maestro.Run.Pools | ||
import Maestro.Run.Scripts | ||
import Maestro.Run.Tx | ||
import System.Environment (getEnv) | ||
import System.Environment (getEnv) | ||
|
||
|
||
main :: IO () | ||
|
||
main = do | ||
apiId <- maestroId | ||
env <- mkMaestroEnv (T.pack apiId) Preprod | ||
apiKey <- maestroKey | ||
env <- mkMaestroEnv (T.pack apiKey) Preprod | ||
runPoolsAPI env | ||
runTxApi env | ||
runEpochsAPI env | ||
runDatumAPI env | ||
runScriptsAPI env | ||
|
||
where | ||
maestroId = getEnv "MAESTRO_API_KEY" | ||
maestroKey = getEnv "MAESTRO_API_KEY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,53 @@ | ||
module Maestro.API.Accounts where | ||
|
||
import Data.Text (Text) | ||
import Maestro.Client.Core.Pagination | ||
import Maestro.Types.Accounts | ||
import Maestro.Types.Common | ||
import Maestro.Util.Pagination | ||
import Servant.API | ||
import Servant.API.Generic | ||
|
||
data AccountsAPI route = AccountsAPI | ||
{ | ||
_account | ||
:: route | ||
:- Capture "stake_addr" String | ||
:> Get '[JSON] AccountsInfo | ||
:- Capture "stake_addr" Text | ||
:> Get '[JSON] AccountInfo | ||
|
||
, _accountAddresses | ||
:: route | ||
:- Capture "stake_addr" String | ||
:- Capture "stake_addr" Text | ||
:> "addresses" | ||
:> Pagination | ||
:> Get '[JSON] [String] | ||
:> Get '[JSON] [Text] | ||
|
||
, _accountAssets | ||
:: route | ||
:- Capture "stake_addr" String | ||
:- Capture "stake_addr" Text | ||
:> "assets" | ||
:> Pagination | ||
:> Get '[JSON] [AccountsAssets] | ||
:> Get '[JSON] [Asset] | ||
|
||
, _accountsHistory | ||
:: route | ||
:- Capture "stake_addr" String | ||
:- Capture "stake_addr" Text | ||
:> "history" | ||
:> QueryParam "epoch_no" EpochNo | ||
:> Pagination | ||
:> Get '[JSON] [AccountsHistory] | ||
:> Get '[JSON] [AccountHistory] | ||
|
||
, _accountsReward | ||
:: route | ||
:- Capture "stake_addr" String | ||
:- Capture "stake_addr" Text | ||
:> "rewards" | ||
:> Pagination | ||
:> Get '[JSON] [AccountsRewards] | ||
:> Get '[JSON] [AccountReward] | ||
|
||
, _accountsUpdates | ||
:: route | ||
:- Capture "stake_addr" String | ||
:- Capture "stake_addr" Text | ||
:> "updates" | ||
:> Pagination | ||
:> Get '[JSON] [AccountsUpdates] | ||
:> Get '[JSON] [AccountUpdate] | ||
|
||
} deriving (Generic) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,70 @@ | ||
module Maestro.API.Assets where | ||
|
||
import Maestro.Types.Assets | ||
import Maestro.Types.Common | ||
import Maestro.Util.Pagination | ||
import Servant.API | ||
import Servant.API.Generic | ||
import Data.Text (Text) | ||
import Maestro.Client.Core.Pagination | ||
import Maestro.Types.Assets | ||
import Maestro.Types.Common | ||
import Servant.API | ||
import Servant.API.Generic | ||
|
||
data AssetsAPI route = AssetsAPI | ||
{ _assetPolicyInfo :: | ||
route | ||
:- "policy" | ||
:> Capture "policy" PolicyId | ||
:> Pagination | ||
:> Get '[JSON] [MaestroAssetInfo], | ||
:> Get '[JSON] [AssetInfo], | ||
_assetPolicyAddress :: | ||
route | ||
:- "policy" | ||
:> Capture "policy" PolicyId | ||
:> "addresses" | ||
:> Pagination | ||
:> Get '[JSON] [String], | ||
:> Get '[JSON] [Text], | ||
_assetPolicyTxs :: | ||
route | ||
:- "policy" | ||
:> Capture "policy" PolicyId | ||
:> "txs" | ||
:> Pagination | ||
:> Get '[JSON] [MaestroAssetTx], | ||
:> Get '[JSON] [AssetTx], | ||
_assetPolicyUtxos :: | ||
route | ||
:- "policy" | ||
:> Capture "policy" PolicyId | ||
:> "utxos" | ||
:> Pagination | ||
:> Get '[JSON] [MaestroAssetUtxo], | ||
:> Get '[JSON] [PolicyUtxo], | ||
_assetDetail :: | ||
route | ||
:- Capture "asset" AssetId | ||
:> Get '[JSON] MaestroAssetInfo, | ||
:> Get '[JSON] AssetInfo, | ||
_assetAddresses :: | ||
route | ||
:- Capture "asset" AssetId | ||
:> "addresses" | ||
:> Pagination | ||
:> Get '[JSON] [String], | ||
:> Get '[JSON] [Text], | ||
_assetTxs :: | ||
route | ||
:- Capture "asset" AssetId | ||
:> "txs" | ||
:> QueryParam "from_height" Integer | ||
:> Pagination | ||
:> QueryParam "order" Order | ||
:> Get '[JSON] [MaestroAssetTx], | ||
:> Get '[JSON] [AssetTx], | ||
_assetUpdates :: | ||
route | ||
:- Capture "asset" AssetId | ||
:> "updates" | ||
:> Pagination | ||
:> QueryParam "order" Order | ||
:> Get '[JSON] [MaestroAssetUpdates], | ||
:> Get '[JSON] [MintingTx], | ||
_assetUtxos :: | ||
route | ||
:- Capture "asset" AssetId | ||
:> "utxos" | ||
:> Pagination | ||
:> Get '[JSON] [MaestroAssetUtxo] | ||
:> Get '[JSON] [AssetUtxo] | ||
} | ||
deriving (Generic) |
Oops, something went wrong.