You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this method is used to create a list of utxos in koios client.
`async Task<List> GetUtxos(string address)
{
var addressBulkRequest = new AddressBulkRequest { Addresses = new string[] { address } };
var addressResponse = (await addressClient.GetAddressInformation(addressBulkRequest));
var addressInfo = addressResponse.Content;
var utxos = new List<Utxo>();
foreach (var ai in addressInfo.SelectMany(x => x.UtxoSets))
{
if (ai is null) continue;
var utxo = new Utxo()
{
TxIndex = ai.TxIndex,
TxHash = ai.TxHash,
Balance = new Balance()
{
Lovelaces = ulong.Parse(ai.Value)
}
};
var assetList = new List<CardanoSharpAsset>();
foreach (var aa in ai.AssetList)
{
assetList.Add(new CardanoSharpAsset()
{
Name = aa.AssetName,
PolicyId = aa.PolicyId,
Quantity = long.Parse(aa.Quantity)
});
}
utxo.Balance.Assets = assetList;
utxos.Add(utxo);
}
return utxos;
}
`
but blockfrost API is not the same as koios in addressClient and GetAddressInformation does not return assets with policy id. could you please help me to write the same method for blockfrost?
The text was updated successfully, but these errors were encountered:
hparsafar
changed the title
How to create lists from blockfrost APIs to use the UseLargestFirst method in Cardanosharp.Wallet?
How to create utxo lists from blockfrost APIs to use the UseLargestFirst method in Cardanosharp.Wallet?
May 6, 2024
this method is used to create a list of utxos in koios client.
`async Task<List> GetUtxos(string address)
{
}
`
but blockfrost API is not the same as koios in addressClient and GetAddressInformation does not return assets with policy id. could you please help me to write the same method for blockfrost?
The text was updated successfully, but these errors were encountered: