use the TokenHoldings instead of TokenDetails

This commit is contained in:
2025-06-23 09:32:34 +03:00
parent 54dfe037b4
commit c1797e7a32
5 changed files with 13 additions and 13 deletions

View File

@@ -24,7 +24,7 @@ type AccountService interface {
FetchTopPools(ctx context.Context) ([]dataserviceapi.PoolDetails, error)
RetrievePoolDetails(ctx context.Context, sym string) (*dataserviceapi.PoolDetails, error)
GetPoolSwappableFromVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error)
GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenDetails, error)
GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error)
GetPoolSwapQuote(ctx context.Context, amount, from, fromTokenAddress, poolAddress, toTokenAddress string) (*models.PoolSwapQuoteResult, error)
PoolSwap(ctx context.Context, amount, from, fromTokenAddress, poolAddress, toTokenAddress string) (*models.PoolSwapResult, error)
GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error)

View File

@@ -390,7 +390,7 @@ func (as *HTTPAccountService) getPoolSwappableFromVouchers(ctx context.Context,
return r.PoolSwappableVouchers, nil
}
func (as *HTTPAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenDetails, error) {
func (as *HTTPAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) {
svc := dev.NewDevAccountService(ctx, as.SS)
if as.UseApi {
return as.getPoolSwappableVouchers(ctx, poolAddress)
@@ -399,9 +399,9 @@ func (as *HTTPAccountService) GetPoolSwappableVouchers(ctx context.Context, pool
}
}
func (as HTTPAccountService) getPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenDetails, error) {
func (as HTTPAccountService) getPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) {
var r struct {
PoolSwappableVouchers []dataserviceapi.TokenDetails `json:"filtered"`
PoolSwappableVouchers []dataserviceapi.TokenHoldings `json:"filtered"`
}
basePath, err := url.JoinPath(config.PoolSwappableVouchersURL, poolAddress, "to")