Layer 231
method
payments.getOnrampQuote#e06645fa flags:# provider:string crypto_currency:string base_currency:string base_amount:flags.0?string crypto_amount:flags.1?string payment_method:flags.2?string = OnrampQuote;

Parameters

Name Type Description
Provider string On-ramp provider ID, from payments. get Onramp Providers
CryptoCurrency string Cryptocurrency to buy, e. g. TON
BaseCurrency string Fiat currency to pay with, ISO 4217 code
BaseAmount flags.0?string Amount to pay in the fiat currency, as a decimal string
CryptoAmount flags.1?string Amount of cryptocurrency to buy, as a decimal string, instead of base_amount
PaymentMethod flags.2?string Payment method, as returned by payments. get Onramp Availability

Returns

OnrampQuote

Gogram Example

providers, _ := client.PaymentsGetOnrampProviders("TON")
quote, err := client.PaymentsGetOnrampQuote(&tg.PaymentsGetOnrampQuoteParams{
	Provider:       providers[0].ID,
	CryptoCurrency: "TON",
	BaseCurrency:   "USD",
	BaseAmount:     "50",
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(quote.BaseAmount, quote.BaseCurrency, "->", quote.CryptoAmount, quote.CryptoCurrency, "fee:", quote.FeeAmount)