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.
Initialization
JavaScript
CDN
JavaScript
Common Methods
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
Get User Wallet
UsinggetWallet
function to get a Zilliqa wallet for the current user.
JavaScript
Send Transaction
To send a standard Zilliqa blockchain transaction, you can call themagic.Zilliqa.sendTransaction
method.
JavaScript
Smart Contract
Deploy Contract
To deploy a smart contract, you can call themagic.zilliqa.deployContract
method.
JavaScript