Skip to content

requestOnRamp

This is the primary method for submitting an on-ramp request — initiating a fiat spend that results in tokens delivered to the specified wallet address.

🔔

After creating the on-ramp request, the user will need to confirm it in their Holyheld app.

🚨

As per security requirements, the user MUST approve the on-ramp request in their Holyheld mobile app within 3 minutes. If the user declines or lets the confirmation expire, the transaction will fail and will not be executed.

Usage

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

Parameters

ParameterTypeRequiredDescription
walletAddressstringYesDestination wallet address that will receive the tokens. Must be a registered, eligible address.
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
const data = await holyheldSDK.evm.onRamp.requestOnRamp({
  walletAddress: '0x...', 
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  tokenNetwork: Network.ethereum,
  EURAmount: '1',
});

Token Address

Address of the token

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

Token Network

Network where tokens will arrive

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

EUR Amount

EUR amount

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

Returns

typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM;
  amountEUR: string;
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

requestUid

ID of the on-ramp request created

  • Type: String
typescript
type RequestOnRampEVMResult = {
  requestUid: string; 
  chainId: number;
  token: TokenEVM;
  amountEUR: string;
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

chainId

ID of the network where tokens will arrive

  • Type: Number
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number; 
  token: TokenEVM;
  amountEUR: string;
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

token

Token object that will be delivered on success

  • Type: TokenEVM
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM; 
  amountEUR: string;
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

amountEUR

Amount of EUR charged from the user

  • Type: String
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM;
  amountEUR: string; 
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

amountToken

Native amount of tokens received

  • Type: String
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM;
  amountEUR: string;
  amountToken: string; 
  feeEUR: string;
  beneficiaryAddress: EVMAddress;
}

feeEUR

Network gas fee charged from the total transaction amount

  • Type: String
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM;
  amountEUR: string;
  amountToken: string;
  feeEUR: string; 
  beneficiaryAddress: EVMAddress;
}

beneficiaryAddress

User wallet address where tokens will arrive

  • Type: string
typescript
type RequestOnRampEVMResult = {
  requestUid: string;
  chainId: number;
  token: TokenEVM;
  amountEUR: string;
  amountToken: string;
  feeEUR: string;
  beneficiaryAddress: EVMAddress; 
}