pass the correct arguments to the swap functions
This commit is contained in:
parent
37a2006a0b
commit
3b39b86d09
@ -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",
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user