Zilliqa
Installation
Magic interacts with the Zilliqa blockchain via Magic's extension NPM package @magic-ext/zilliqa
. The Zilliqa extension also lets you interact with the blockchain using methods from Zilliqa's Javascript SDK.
note
You can skip straight to our kitchen sink example directly:
๐ Zilliqa Example
- NPM
- Yarn
Initializing Extension
- ES Modules/TypeScript
Get User Wallet
Get Wallet
Using getWallet function to get a Zilliqa wallet for the current user.
- ES Modules/TypeScript
Send Transaction
Getting Test ZIL
Before you can send transaction on the Zilliqa blockchain, you'll need to acquire some test ZIL (Zilliqa's native cryptocurrency for test network).
- Go to our Zilliqa Example application
- Login with your email address
- Copy your Zilliqa public address
- Go to the ZIL Faucet
- Paste your copied Zilliqa public address in the text input
- You can receive 300 test ZIL
- Now you can use your test ZIL in our example app
Call Extension Method
To send a standard Zilliqa blockchain transaction, you can call the magic.Zilliqa.sendTransaction
method.
- ES Modules/TypeScript
Smart Contract
Deploy Contract
Getting Test ZIL
Before you can send transaction on the Zilliqa blockchain, you'll need to acquire some test ZIL (Zilliqa's native cryptocurrency for test network).
- Go to our Zilliqa Example application
- Login with your email address
- Copy your Zilliqa public address
- Go to the ZIL Faucet
- Paste your copied Zilliqa public address in the text input
- You can receive 300 test ZIL
- Now you can use your test ZIL in our example app
Call Extension Method
To deploy a smart contract, you can call the magic.zilliqa.deployContract
method.
- ES Modules/TypeScript