Compare commits

..

No commits in common. "4a5de68a8c1f380f0064e1741217241ce139e6ac" and "2181388f5bf19b4edc4715ea386b9b26ea1597ec" have entirely different histories.

4 changed files with 0 additions and 40 deletions

View File

@ -16,7 +16,6 @@ const (
voucherTransfersPathPrefix = "/api/v1/transfers/last10"
voucherDataPathPrefix = "/api/v1/token"
AliasPrefix = "api/v1/alias"
SendSMSPrefix = "api/v1/external/upsell"
)
var (
@ -35,7 +34,6 @@ var (
VoucherTransfersURL string
VoucherDataURL string
CheckAliasURL string
SendSMSURL string
)
func setBase() error {
@ -71,6 +69,5 @@ func LoadConfig() error {
VoucherTransfersURL, _ = url.JoinPath(dataURLBase, voucherTransfersPathPrefix)
VoucherDataURL, _ = url.JoinPath(dataURLBase, voucherDataPathPrefix)
CheckAliasURL, _ = url.JoinPath(dataURLBase, AliasPrefix)
SendSMSURL, _ = url.JoinPath(dataURLBase, SendSMSPrefix)
return nil
}

View File

@ -1,5 +0,0 @@
package models
type SendSMSResponse struct {
Invitee string `json:"invitee"`
}

View File

@ -17,5 +17,4 @@ type AccountService interface {
TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error)
CheckAliasAddress(ctx context.Context, alias string) (*models.AliasAddress, error)
RequestAlias(ctx context.Context, hint string, publicKey string) (*models.RequestAliasResult, error)
SendSMS(ctx context.Context, inviterPhone, inviteePhone string) (*models.TokenTransferResponse, error)
}

View File

@ -248,37 +248,6 @@ func (as *HTTPAccountService) RequestAlias(ctx context.Context, publicKey string
return svc.RequestAlias(ctx, publicKey, hint)
}
// SendSMS calls the API to send out an SMS.
// Parameters:
// - inviterPhone: The user initiating the SMS.
// - inviteePhone: The number being invited to Sarafu.
func (as *HTTPAccountService) SendSMS(ctx context.Context, inviterPhone, inviteePhone string) (*models.SendSMSResponse, error) {
var r models.SendSMSResponse
// Create request payload
payload := map[string]string{
"inviterPhone": inviterPhone,
"inviteePhone": inviteePhone,
}
payloadBytes, err := json.Marshal(payload)
if err != nil {
return nil, err
}
// Create a new request
req, err := http.NewRequest("POST", config.SendSMSURL, bytes.NewBuffer(payloadBytes))
if err != nil {
return nil, err
}
_, err = doRequest(ctx, req, &r)
if err != nil {
return nil, err
}
return &r, nil
}
// TODO: remove eth-custodial api dependency
func doRequest(ctx context.Context, req *http.Request, rcpt any) (*api.OKResponse, error) {
var okResponse api.OKResponse