This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK 93] Added JumpNet Bridge mutations (#27)
* Added templates for `BridgeAsset`, `BridgeAssets`, and `BridgeClaimAsset` mutation * Added request classes for `BridgeAsset`, `BridgeAssets`, and `BridgeClaimAsset` mutation * Added Bridge mutations to `IProjectSchema` and `IPlayerSchema`
- Loading branch information
1 parent
09bb09b
commit 79058f2
Showing
34 changed files
with
1,847 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* Copyright 2021 Enjin Pte. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef ENJINSDK_PLAYERBRIDGEASSET_HPP | ||
#define ENJINSDK_PLAYERBRIDGEASSET_HPP | ||
|
||
#include "enjinsdk_export.h" | ||
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp" | ||
#include "enjinsdk/shared/TransactionFragmentArguments.hpp" | ||
#include <optional> | ||
#include <string> | ||
|
||
namespace enjin::sdk::player { | ||
|
||
/// \brief Request for bridging an asset. | ||
class ENJINSDK_EXPORT BridgeAsset : public graphql::AbstractGraphqlRequest, | ||
public shared::TransactionFragmentArguments<BridgeAsset> { | ||
public: | ||
/// \brief Sole constructor. | ||
BridgeAsset(); | ||
|
||
~BridgeAsset() override = default; | ||
|
||
[[nodiscard]] std::string serialize() const override; | ||
|
||
/// \brief Sets the ID of the asset to bridge. | ||
/// \param asset_id The asset ID. | ||
/// \return This request for chaining. | ||
BridgeAsset& set_asset_id(std::string asset_id); | ||
|
||
/// \brief Sets the index of the asset to bridge if the asset is an NFT. | ||
/// \param asset_index The asset index. | ||
/// \return This request for chaining. | ||
BridgeAsset& set_asset_index(std::string asset_index); | ||
|
||
/// \brief Sets the amount to bridge. | ||
/// \param value The amount. | ||
/// \return This request for chaining. | ||
BridgeAsset& set_value(std::string value); | ||
|
||
bool operator==(const BridgeAsset& rhs) const; | ||
|
||
bool operator!=(const BridgeAsset& rhs) const; | ||
|
||
private: | ||
std::optional<std::string> asset_id; | ||
std::optional<std::string> asset_index; | ||
std::optional<std::string> value; | ||
}; | ||
|
||
} | ||
|
||
namespace enjin::sdk::shared { | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_asset_id_format(models::AssetIdFormat asset_id_format); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_blockchain_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_meta(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_encoded_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_asset_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_signed_txs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_error(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_nonce(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_state(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_receipt(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_receipt_logs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_log_event(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAsset& | ||
TransactionFragmentArguments<player::BridgeAsset>::set_with_transaction_project_uuid(); | ||
|
||
} | ||
|
||
#endif //ENJINSDK_PLAYERBRIDGEASSET_HPP |
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* Copyright 2021 Enjin Pte. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef ENJINSDK_PLAYERBRIDGEASSETS_HPP | ||
#define ENJINSDK_PLAYERBRIDGEASSETS_HPP | ||
|
||
#include "enjinsdk_export.h" | ||
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp" | ||
#include "enjinsdk/shared/TransactionFragmentArguments.hpp" | ||
#include <optional> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace enjin::sdk::player { | ||
|
||
/// \brief Request for bridging multiple indices of an NFT in a single transaction. | ||
class ENJINSDK_EXPORT BridgeAssets : public graphql::AbstractGraphqlRequest, | ||
public shared::TransactionFragmentArguments<BridgeAssets> { | ||
public: | ||
/// \brief Sole constructor. | ||
BridgeAssets(); | ||
|
||
~BridgeAssets() override = default; | ||
|
||
[[nodiscard]] std::string serialize() const override; | ||
|
||
/// \brief Sets the ID of the asset to bridge. | ||
/// \param asset_id The asset ID. | ||
/// \return This request for chaining. | ||
BridgeAssets& set_asset_id(std::string asset_id); | ||
|
||
/// \brief Sets the indices to bridge. | ||
/// \param asset_indices The asset indices. | ||
/// \return This request for chaining. | ||
BridgeAssets& set_asset_indices(std::vector<std::string> asset_indices); | ||
|
||
bool operator==(const BridgeAssets& rhs) const; | ||
|
||
bool operator!=(const BridgeAssets& rhs) const; | ||
|
||
private: | ||
std::optional<std::string> asset_id; | ||
std::optional<std::vector<std::string>> asset_indices; | ||
}; | ||
|
||
} | ||
|
||
namespace enjin::sdk::shared { | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_asset_id_format(models::AssetIdFormat asset_id_format); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_blockchain_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_meta(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_encoded_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_asset_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_signed_txs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_error(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_nonce(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_state(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_receipt(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_receipt_logs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_log_event(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeAssets& | ||
TransactionFragmentArguments<player::BridgeAssets>::set_with_transaction_project_uuid(); | ||
|
||
} | ||
|
||
#endif //ENJINSDK_PLAYERBRIDGEASSETS_HPP |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* Copyright 2021 Enjin Pte. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef ENJINSDK_PLAYERBRIDGECLAIMASSET_HPP | ||
#define ENJINSDK_PLAYERBRIDGECLAIMASSET_HPP | ||
|
||
#include "enjinsdk_export.h" | ||
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp" | ||
#include "enjinsdk/shared/TransactionFragmentArguments.hpp" | ||
#include <optional> | ||
#include <string> | ||
|
||
namespace enjin::sdk::player { | ||
|
||
/// \brief Request for claiming assets on the bridge. | ||
class ENJINSDK_EXPORT BridgeClaimAsset : public graphql::AbstractGraphqlRequest, | ||
public shared::TransactionFragmentArguments<BridgeClaimAsset> { | ||
public: | ||
/// \brief Sole constructor. | ||
BridgeClaimAsset(); | ||
|
||
~BridgeClaimAsset() override = default; | ||
|
||
[[nodiscard]] std::string serialize() const override; | ||
|
||
/// \brief Sets which assets to filter for by their ID. | ||
/// \param asset_id The asset IDs to filter for. | ||
/// \return This request for chaining. | ||
BridgeClaimAsset& set_asset_id(std::string asset_id); | ||
|
||
bool operator==(const BridgeClaimAsset& rhs) const; | ||
|
||
bool operator!=(const BridgeClaimAsset& rhs) const; | ||
|
||
private: | ||
std::optional<std::string> asset_id; | ||
}; | ||
|
||
} | ||
|
||
namespace enjin::sdk::shared { | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_asset_id_format(models::AssetIdFormat asset_id_format); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_blockchain_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_meta(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_encoded_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_asset_data(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_signed_txs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_error(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_nonce(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_state(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_receipt(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_receipt_logs(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_log_event(); | ||
|
||
template ENJINSDK_EXPORT player::BridgeClaimAsset& | ||
TransactionFragmentArguments<player::BridgeClaimAsset>::set_with_transaction_project_uuid(); | ||
|
||
} | ||
|
||
#endif //ENJINSDK_PLAYERBRIDGECLAIMASSET_HPP |
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
Oops, something went wrong.