Skip to content

getOnRampEstimation

Estimate the network fee in EUR and the final token amount.

Usage

typescript
import { Network } from '@holyheld/sdk';

const data = await holyheldSDK.evm.onRamp.getOnRampEstimation({
  walletAddress: '0x...',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  tokenNetwork: Network.ethereum,
  EURAmount: '1',
});

Parameters

ParameterTypeRequiredDescription
walletAddressstringYesDestination wallet address that will receive the tokens.
tokenAddressstringYesContract address of the token to receive.
tokenNetworkNetworkYesThe chain the token will arrive on.
EURAmountstringYesEUR amount to spend, as a decimal string (e.g. "50" for 50 EUR).

Wallet Address

User's wallet address

  • Type: string
typescript
import { Network } from '@holyheld/sdk';

const data = await holyheldSDK.evm.onRamp.getOnRampEstimation({
  walletAddress: '0x...', 
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  tokenNetwork: Network.ethereum,
  EURAmount: '1',
});

Token Address

Address of the token

  • Type: string
typescript
import { Network } from '@holyheld/sdk';

const data = await holyheldSDK.evm.onRamp.getOnRampEstimation({
  walletAddress: '0x...',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 
  tokenNetwork: Network.ethereum,
  EURAmount: '1',
});

Token Network

Network where tokens will arrive

  • Type: Network
typescript
import { Network } from '@holyheld/sdk';

const data = await holyheldSDK.evm.onRamp.getOnRampEstimation({
  walletAddress: '0x...',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  tokenNetwork: Network.ethereum, 
  EURAmount: '1',
});

EUR Amount

EUR amount

  • Type: String
typescript
import { Network } from '@holyheld/sdk';

const data = await holyheldSDK.evm.onRamp.getOnRampEstimation({
  walletAddress: '0x...',
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  tokenNetwork: Network.ethereum,
  EURAmount: '1'
});

Returns

Returns a Promise<EstimateOnRampResult> with the estimated fee and expected token amount.

typescript
type EstimateOnRampResult = {
  feeAmount: string;
  expectedAmount: string;
}

feeAmount

The network gas fee charged in EUR, as a decimal string. Deducted from the EUR amount — the user receives amount - feeAmount worth of tokens.

  • Type: String
typescript
type EstimateOnRampResult = {
  feeAmount: string; 
  expectedAmount: string;
}

expectedAmount

The estimated token amount the user will receive after the fee is deducted, as a decimal string.

  • Type: String
typescript
type EstimateOnRampResult = {
  feeAmount: string;
  expectedAmount: string; 
}