Added the GetSwapFromTokenMaxLimit
This commit is contained in:
		
							parent
							
								
									3b39b86d09
								
							
						
					
					
						commit
						17e89e0b88
					
				| @ -863,3 +863,9 @@ func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, pool | ||||
| 
 | ||||
| 	return swapToList, nil | ||||
| } | ||||
| 
 | ||||
| func (das *DevAccountService) GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error) { | ||||
| 	return &models.MaxLimitResult{ | ||||
| 		Max: "1339482", | ||||
| 	}, nil | ||||
| } | ||||
|  | ||||
| @ -23,4 +23,5 @@ type AccountService interface { | ||||
| 	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) | ||||
| 	GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error) | ||||
| } | ||||
|  | ||||
| @ -334,6 +334,11 @@ func (as *HTTPAccountService) PoolSwap(ctx context.Context, amount, from, fromTo | ||||
| 	return &r, nil | ||||
| } | ||||
| 
 | ||||
| func (as *HTTPAccountService) GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error) { | ||||
| 	svc := dev.NewDevAccountService(ctx, as.SS) | ||||
| 	return svc.GetSwapFromTokenMaxLimit(ctx, poolAddress, fromTokenAddress, toTokenAddress, publicKey) | ||||
| } | ||||
| 
 | ||||
| // TODO: Use actual custodial api to request available alias
 | ||||
| func (as *HTTPAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) { | ||||
| 	if as.SS == nil { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user