Introduction
Setting up a GalaChain wallet is essential for participating in the Gala Ecosystem. There are primary methods to set up a wallet: one that is user-friendly and ideal for beginners, and another that is more suited to advanced users. This guide will walk you through both processes.
Prior Knowledge
To fully understand and set up a GalaChain wallet, it’s helpful to be familiar with:
- Cryptocurrency Wallets: Basics of how digital wallets work and their importance in managing digital assets.
- Gala Ecosystem: Overview of the Gala platform and its components.
- API Platforms: Tools for managing and testing APIs.
Set Up Wallet via the Gala Platform
1. Create a Gala Games Account:
- Visit Gala Games and sign up for an account.
- Complete the registration process by verifying your email.
2. Create a GalaChain Wallet:
- Log in to your Gala Games account.
- Go to account settings and find the GalaChain Transfer Code section.
- Create a GalaChain Transfer Code which will allow you to access your GalaChain wallet.
- Write down your seed phrase as this allows you to access your wallet.
3. Secure Your Seed Phrase and Private Key:
- Under the GalaChain Private Key, click Download Private Key.
- Store the seed phrase and private key file securely; never share this with anyone. If you lose your seed phrase and private key, they cannot be recovered, meaning you will lose access to your wallet's assets.
4. Verify Your Wallet:
- Check your GalaChain wallet address by clicking your avatar at the top right screen.
For detailed instructions, please refer to the Gala Games Help Center: Setup a GalaChain Transfer Code article.
Set Up a Headless Wallet via GalaChain API
If you have an existing Ethereum wallet, you can skip steps 1 to 5 and go directly to step 6.
1. Download and Install Node.js
2. Install the Ethers Library
- Open CLI or Terminal
- Go to a folder location of your choice and enter: npm install ethers
3. Create a createKeys.js file
- Copy the code below and save the file as:
const ethers = require('ethers');
const newWallet = ethers.Wallet.createRandom();
console.log('Public key:', newWallet.publicKey);
console.log('Private key:', newWallet.privateKey);
console.log('X-Wallet-Address', `eth|${newWallet.address.replace('0x', '')}`);
- Save it the file as: createKeys.js
4. Generate an address and keys
- On your CLI, run node ./createKeys.js.
- This creates your Ethereum wallet.
- Ethereum address: 0xfba…
Note: eth|fba4… is a reference to your GalaChain wallet, but it is not initialized yet.
5. Secure Your Private Key
- Store your private key file securely and never share this with anyone. If you lose your private key, they cannot be recovered, meaning you will lose access to your wallets’ assets.
6. Grab your Ethereum Wallet’s Public Key
7. Import GalaSwap API on your API Platform of your choice.
- For more information, please refer to the Import GalaSwap API article.
8. Generate a GalaChain Wallet Using the Gala Swap API:
- Replace the publicKey’s string with your key.
Note: Refer to the GalaSwap API Create Headless Wallet endpoint
9. Verify Your Wallet:
- Use the GalaSwap API to check the balance and perform other operations with your new wallet.
- For specific examples, please refer to the GalaSwap API Operations endpoint..
Wallet Prefixes
- client|<address>: Wallets set up through the Gala Platform have this prefix.
- eth|<address>: Wallets set up using the GalaSwap API have this prefix.