diff --git a/dev/api.go b/dev/api.go index 62c3cf1..d469bc1 100644 --- a/dev/api.go +++ b/dev/api.go @@ -778,7 +778,7 @@ func (das *DevAccountService) RequestAlias(ctx context.Context, publicKey string }, nil } -func (das *DevAccountService) FetchTopPools(ctx context.Context, publicKey string) ([]dataserviceapi.PoolDetails, error) { +func (das *DevAccountService) FetchTopPools(ctx context.Context) ([]dataserviceapi.PoolDetails, error) { topPools := []dataserviceapi.PoolDetails{ { PoolName: "Kenya ROLA Pool", @@ -820,7 +820,7 @@ func (das *DevAccountService) FetchTopPools(ctx context.Context, publicKey strin return topPools, nil } -func (das *DevAccountService) GetPoolSwappableFromVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (das *DevAccountService) GetPoolSwappableFromVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { swapFromList := []dataserviceapi.TokenHoldings{ { ContractAddress: "0xc7B78Ac9ACB9E025C8234621FC515bC58179dEAe", @@ -851,7 +851,7 @@ func (das *DevAccountService) GetPoolSwappableFromVouchers(ctx context.Context, return swapFromList, nil } -func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { swapToList := []dataserviceapi.TokenHoldings{ { ContractAddress: "0x765DE816845861e75A25fCA122bb6898B8B1282a", diff --git a/remote/account_service.go b/remote/account_service.go index ff9ec8f..fdb7021 100644 --- a/remote/account_service.go +++ b/remote/account_service.go @@ -18,9 +18,9 @@ type AccountService interface { CheckAliasAddress(ctx context.Context, alias string) (*models.AliasAddress, error) RequestAlias(ctx context.Context, hint string, publicKey string) (*models.RequestAliasResult, error) PoolDeposit(ctx context.Context, amount, from, poolAddress, tokenAddress string) (*models.PoolDepositResult, error) - FetchTopPools(ctx context.Context, publicKey string) ([]dataserviceapi.PoolDetails, error) - GetPoolSwappableFromVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) - GetPoolSwappableVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) + FetchTopPools(ctx context.Context) ([]dataserviceapi.PoolDetails, error) + GetPoolSwappableFromVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) + GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey 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) } diff --git a/remote/http/service.go b/remote/http/service.go index 48bf678..2ee9a22 100644 --- a/remote/http/service.go +++ b/remote/http/service.go @@ -239,9 +239,9 @@ func resolveAliasAddress(ctx context.Context, alias string) (*models.AliasAddres return &r, err } -func (as *HTTPAccountService) FetchTopPools(ctx context.Context, publicKey string) ([]dataserviceapi.PoolDetails, error) { +func (as *HTTPAccountService) FetchTopPools(ctx context.Context) ([]dataserviceapi.PoolDetails, error) { svc := dev.NewDevAccountService(ctx, as.SS) - return svc.FetchTopPools(ctx, publicKey) + return svc.FetchTopPools(ctx) } func (as *HTTPAccountService) PoolDeposit(ctx context.Context, amount, from, poolAddress, tokenAddress string) (*models.PoolDepositResult, error) { @@ -297,14 +297,14 @@ func (as *HTTPAccountService) GetPoolSwapQuote(ctx context.Context, amount, from return &r, nil } -func (as *HTTPAccountService) GetPoolSwappableFromVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (as *HTTPAccountService) GetPoolSwappableFromVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { svc := dev.NewDevAccountService(ctx, as.SS) - return svc.GetPoolSwappableFromVouchers(ctx, publicKey) + return svc.GetPoolSwappableFromVouchers(ctx, poolAddress, publicKey) } -func (as *HTTPAccountService) GetPoolSwappableVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (as *HTTPAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { svc := dev.NewDevAccountService(ctx, as.SS) - return svc.GetPoolSwappableVouchers(ctx, publicKey) + return svc.GetPoolSwappableVouchers(ctx, poolAddress, publicKey) } func (as *HTTPAccountService) PoolSwap(ctx context.Context, amount, from, fromTokenAddress, poolAddress, toTokenAddress string) (*models.PoolSwapResult, error) {