Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

228 marketplace reader support #263

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Config/SequenceConfig.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[/Script/Sequence.Config]
FallbackEncryptionKey = "aaaabbbbccccddddaaaabbbbccccdddd"
WaaSConfigKey = "eyJwcm9qZWN0SWQiOjM3MDY2LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0="
ProjectAccessKey = "AQAAAAAAAJDKR9cs25gJSSKzszRT9STo9hk"
WaaSConfigKey = "eyJwcm9qZWN0SWQiOjQxMDg3LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0="
ProjectAccessKey = "AQAAAAAAAKB_eaItDuiSDnsDrg1TM5Izj_k"
GoogleClientID = "970987756660-35a6tc48hvi8cev9cnknp0iugv9poa23.apps.googleusercontent.com"
AppleClientID = "com.horizon.sequence.waas"
FacebookClientID = ""
Expand Down
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,156 @@ void AGeneralTesting::TestGuestLogin()
Auth->GuestLogin(false);
}

void AGeneralTesting::TestListCurrencies() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::ListCurrencies(OnSuccess, OnFailure);
}

void AGeneralTesting::TestListAllCollectibleListingsWithLowestPriceListingsFirst() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::ListAllCollectibleListingsWithLowestPriceListingsFirst(OnSuccess, OnFailure);
}

void AGeneralTesting::TestListAllCollectibleOffersWithHighestPricedOfferFirst() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::ListAllCollectibleOffersWithHighestPricedOfferFirst(OnSuccess, OnFailure);
}

void AGeneralTesting::TestGetLowestPriceOfferForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::GetLowestPriceOfferForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestGetHighestPriceOfferForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::GetHighestPriceOfferForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestGetLowestPriceListingForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::GetLowestPriceListingForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestGetHighestPriceListingForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::GetHighestPriceListingForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestListAllListingsForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::ListAllListingsForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestListAllOffersForCollectible() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::ListAllOffersForCollectible(OnSuccess, OnFailure);
}

void AGeneralTesting::TestGetFloorOrder() const
{
const TFunction<void (FString)> OnSuccess = [this](FString State)
{
CallbackPassed(State);
};

const TFunction<void (FString, FSequenceError)> OnFailure = [this](FString Data, FSequenceError Err)
{
CallbackFailed(Data, Err);
};

SequenceAPITest::GetFloorOrder(OnSuccess, OnFailure);
}

void AGeneralTesting::TestIndexer()
{
TFunction<void(FString)> OnSuccess = [this](FString State)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,37 @@ class SEQUENCEPLUGIN_API AGeneralTesting : public AActor

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGuestLogin();

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestListCurrencies() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestListAllCollectibleListingsWithLowestPriceListingsFirst() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestListAllCollectibleOffersWithHighestPricedOfferFirst() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGetLowestPriceOfferForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGetHighestPriceOfferForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGetLowestPriceListingForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGetHighestPriceListingForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestListAllListingsForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestListAllOffersForCollectible() const;

UFUNCTION(BlueprintCallable, CATEGORY = "Test_API")
void TestGetFloorOrder() const;


/*
* Called by frontend to test the indexer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ USequenceMarketplaceBP::USequenceMarketplaceBP()

}

void USequenceMarketplaceBP::GetGetCollectiblesWithLowestListingsAsync(const int64 ChainId, const FSeqGetCollectiblesWithLowestListingsArgs& Args)
void USequenceMarketplaceBP::GetGetCollectiblesWithLowestListingsAsync(const int64 ChainId, const FSeqListCollectiblesArgs& Args)
{
const TSuccessCallback<FSeqGetCollectiblesWithLowestListingsReturn> OnSuccess = [this, ChainId, Args](const FSeqGetCollectiblesWithLowestListingsReturn& CollectiblesWithLowestListings)
const TSuccessCallback<FSeqListCollectiblesReturn> OnSuccess = [this, ChainId, Args](const FSeqListCollectiblesReturn& CollectiblesWithLowestListings)
{
this->CallCollectiblesWithLowestListingsReceived(true, ChainId, CollectiblesWithLowestListings);
};

const FFailureCallback OnFailure = [this, ChainId, Args](const FSequenceError& Error)
{
SEQ_LOG(Error, TEXT("Error getting Collectibles with Lowest Listings: %s"), *Error.Message);
FSeqGetCollectiblesWithLowestListingsReturn CollectiblesWithLowestListings;
FSeqListCollectiblesReturn CollectiblesWithLowestListings;
this->CallCollectiblesWithLowestListingsReceived(false, ChainId, CollectiblesWithLowestListings);
};


this->Marketplace->GetCollectiblesWithLowestListings(ChainId, Args, OnSuccess, OnFailure);
this->Marketplace->ListCollectibleListingsWithLowestPriceListingsFirst(ChainId, Args.ContractAddress, Args.Filter, Args.Page, OnSuccess, OnFailure);
}

void USequenceMarketplaceBP::CallCollectiblesWithLowestListingsReceived(const bool Status, const int64 ChainId, const FSeqGetCollectiblesWithLowestListingsReturn& Response)
void USequenceMarketplaceBP::CallCollectiblesWithLowestListingsReceived(const bool Status, const int64 ChainId, const FSeqListCollectiblesReturn& Response)
{
if (this->CollectiblesWithLowestListingsResponse.IsBound())
this->CollectiblesWithLowestListingsResponse.Broadcast(Status, ChainId, Response);
Expand Down
Loading