No-Login Onramp

Shown below is an example integration of no-login onramp, where the funds are deposited into the EOA/signer address provided. This functionality assumes that the user has already been authenticated to your application, and would not require the user to log in again.

import { openHallidayOnramp } from "halliday-sdk";

const walletAddress = "0x...";  // The user's EOA address
const loggedInEmail = "[email protected]"; // The email associated with the user
    
// Function we can call to pass in a Halliday session key for the user to sign. 
// This session key expires at the end of the onramp session.
const sessionKeySignerCallback = async (sessionKey: Uint8Array) => {
  // remove "Signed Ethereum message" prefix to sign since ethers adds it
  return ownerSigner.signMessage(sessionKey.slice(28));
};
    
openHallidayOnramp({
  apiKey: SANDBOX_API_KEY,
  verifierClientId: "",
  destinationBlockchainType: "SHRAPNEL",
  destinationCryptoType: "SHRAPTOKEN_SHRAPNEL",
  destinationAddress: walletAddress,	// Must currently be set to user's walletAddress
  sessionKeySignerCallback: sessionKeySignerCallback,
  loggedInEmail: ownerEmail,
  inGamePlayerId: walletAddress,
  useSandbox: true,
});

Here, the openHallidayOnramp function takes in the following arguments:

NameTypeDescription
apiKeystringYour Halliday API Key. Visit dashboard.halliday.xyz to create one!
verifierClientIdstringPlease set to ""
destinationBlockchainTypestringThe destination blockchain of the token to onramp for.
destinationCryptoTypestringThe crypto type for the destination blockchain
destinationAddressstringThe destination address to deposit tokens to. MUST be currently set to the user's EOA/signer address
sessionKeySignerCallbackfunctionFunction we can call for the owner's signer to sign the Halliday Session Key
loggedInEmailstringThe email address associated with the user (logged in to your system)
inGamePlayerId (optional)stringThe userId for the player performing the onramp. If not specified, it will be set to the user's EOA/signer address
useSandbox (optional)booleanWhether to test onramp or perform a live onramp. If set to true, please use a sandbox Halliday API Key.