Skip to content

Commit

Permalink
fix: BREAKING: continuation loop in Nfts of Contract Feature is set b…
Browse files Browse the repository at this point in the history
…y using an incremental page number (int)
  • Loading branch information
saszer committed Sep 1, 2022
1 parent fe1b6fd commit 6eb9bd5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Runtime/NFTs_OfAContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public enum Includes

[Tooltip(
"One API call might not be able to provide all NFTs in one go if user holds a lot of NFTs and not filtered, this string is passed in API call which can be used in next one to continue from last query")]
public string continuation = "";
public int page_number = 0;


private string RequestUriInit = "https://api.nftport.xyz/v0/nfts/";
Expand Down Expand Up @@ -156,9 +156,9 @@ public NFTs_OfAContract OnComplete(UnityAction<NFTs_model> action)
/// Set Continuation
/// </summary>
///<param name="continuation"> page number as int.</param>
public NFTs_OfAContract SetContinuation(string continuation)
public NFTs_OfAContract SetContinuation(int continuation)
{
this.continuation = continuation;
this.page_number = continuation;
return this;
}

Expand Down Expand Up @@ -193,9 +193,9 @@ string BuildUrl()
if (chain == Chains.solana)
{
WEB_URL = "https://api.nftport.xyz/v0/solana/nfts/" + contract_address;
if (continuation != "")
if (page_number != 0)
{
WEB_URL = WEB_URL + "?page_number=" + continuation.ToString() + "&include=" + include.ToString().ToLower();;
WEB_URL = WEB_URL + "?page_number=" + page_number.ToString() + "&include=" + include.ToString().ToLower();;
}
else
{
Expand All @@ -205,9 +205,9 @@ string BuildUrl()
else
{
WEB_URL = RequestUriInit + contract_address + "?chain=" + chain.ToString().ToLower();
if (continuation != "")
if (page_number != 0)
{
WEB_URL = WEB_URL + "&page_number=" + continuation.ToString();
WEB_URL = WEB_URL + "&page_number=" + page_number.ToString();
}
WEB_URL = WEB_URL + "&include=" + include.ToString().ToLower();
}
Expand Down

0 comments on commit 6eb9bd5

Please sign in to comment.