GetBuyHistory
Get buy history for a specific wallet that executed a Buy With Crypto or Buy With Fiat swap, supports cursor and pagination.
using Thirdweb.Pay;public async void GetBuyHistory(){string connectedAddress = await ThirdwebManager.Instance.SDK.Wallet.GetAddress();BuyHistoryResult history = await ThirdwebManager.Instance.SDK.Pay.GetBuyHistory(walletAddress: connectedAddress, start: 0, count: 1);ThirdwebDebug.Log($"History: {JsonConvert.SerializeObject(history, Formatting.Indented)}");BuyHistoryResult historyNext = await ThirdwebManager.Instance.SDK.Pay.GetBuyHistory(walletAddress: connectedAddress, start: 1, count: 10, cursor: history.NextCursor, pageSize: null);ThirdwebDebug.Log($"History Next: {JsonConvert.SerializeObject(historyNext, Formatting.Indented)}");}
string
: The wallet address to get the swap history for.
int
: The start index of the swap history.
int
: The number of swaps to return.
string
: The cursor to get the next page of swap history. (Optional)
int
: The page size of the swap history. (Optional)
A BuyHistoryResult
object containing the following properties:
string WalletAddress; // The wallet address.List<HistoryPage> Page; // The buy history page.string NextCursor; // The next cursor.int PageSize; // The page size.
The HistoryPage
object contains the following properties:
BuyWithCryptoStatusResult BuyWithCryptoStatus; // Swap status for Buy With Crypto transactions if any.BuyWithFiatStatusResult BuyWithFiatStatus; // Swap status for Buy With Fiat transactions if any.