Onramp to Appchain Wallet Quickstart

Looking for how to onramp to an EOA? Check out the Onramp to EOA Quickstart!


Halliday's SDK offers support for our Anychain Onramp, tailored for your application on any blockchain. Our Anychain Onramp makes it easy for users to access your game by bypassing complex Web3 processes. It enables users to easily acquire any token on your app chain, greatly reducing the barrier of entry for them to your application.

๐Ÿ“˜

Please reach out to a Halliday representative if you are interested in adding Anychain Onramp to your app or marketplace.

Integrating the AnyChain Onramp

To integrate the Halliday Anychain Onramp to your app, first install halliday-sdk:

npm install halliday-sdk

or

yarn add halliday-sdk

If a user is not yet logged in

If a user is not necessarily already logged into your application (for example, if you put our widget on your landing page), the below code will open a popup which will prompt users to log into or create a Halliday Appchain Wallet. Users can then input the desired amount of funds to onramp. To add this to your application, you only need to integrate the Anychain Onramp button, as shown below:

import { openHallidayOnramp } from "halliday-sdk";

// openHallidayOnramp will open a popup that begins the onramp flow.
// Customize the button to match your game's aesthetic.
<Button
  onClick={() => {
    openHallidayOnramp({
      apiKey: "HALLIDAY_PUBLIC_API_KEY",
      verifierClientId: "VERIFIER_CLIENT_ID",
      destinationBlockchainType: "DFK",
      destinationCryptoType: "JEWEL_DFK",
      
      // Optional. If not provided, the user's non-custodial wallet address will be used.
      inGamePlayerId: "in-game-player-id",
      // Optional, defaults to false. If set to true, will mint HallidayTestToken to the 
      // user's smart account on Mumbai. If you set this to true, be sure to provide a 
      // sandbox API key above.
      useSandbox: false, 
    });
  }}
>
  Onramp with Halliday
</Button>

If a user is already logged in

If your users are already logged in (for example, if this popup is located within a player's profile page or within gameplay), you can provide three extra parameters to openHallidayOnramp(): loggedInEmail, typeOfLogin, and destinationAddress, to save the user the hassle of having to log in again. Funds will be deposited directly into the already-logged-in account.

import { openHallidayOnramp } from "halliday-sdk";

<Button
  onClick={() => {
    // After the user has logged in, you can do the following:
    const userInfo = await hallidayClient.getUserInfo();
    const wallet = await hallidayClient.getOrCreateHallidayAAWallet("in-game-player-id");
    
    openHallidayOnramp({
      apiKey: "HALLIDAY_PUBLIC_API_KEY",
      verifierClientId: "VERIFIER_CLIENT_ID",
      destinationBlockchainType: "DFK",
      destinationCryptoType: "JEWEL_DFK",
      
      loggedInEmail: userInfo.email,
      typeOfLogin: userInfo.typeOfLogin,
      destinationAddress: wallet.account_address,
    });
  }}
>
  Onramp with Halliday
</Button>