Harmony
Installation
Magic interacts with the Harmony blockchain via Magic's extension NPM package @magic-ext/harmony
. The Harmony extension also lets you interact with the blockchain using methods from Harmony's Javascript SDK.
note
You can skip straight to our kitchen sink example directly:
๐ Harmony Example
- NPM
- Yarn
Initializing Extension
- ES Modules/TypeScript
Send Transaction
Getting Test ONE token
Before you can send transaction on the Harmony blockchain, you'll need to acquire some test ONE token (Harmony's native cryptocurrency for test network).
- Go to our Harmony Example application
- Login with your email address
- Copy your Harmony public address
- Go to the Harmony Faucet
- Paste your copied Harmony public address in the text input
- Now you can use your test ONE token in our example app
Call Extension Method
Note that the Magic Harmony extension follows the method names and conventions by Harmony's Javascript SDK. To send a standard Harmony blockchain transaction, you can call the magic.harmony.sendTransaction
method.
- ES Modules/TypeScript
Smart Contract
Deploy Contract
Getting Test ONE token
Before you can send transaction on the Harmony blockchain, you'll need to acquire some test ONE token (Harmony's native cryptocurrency for test network).
- Go to our Harmony Example application
- Login with your email address
- Copy your Harmony public address
- Go to the Harmony Faucet
- Paste your copied Harmony public address in the text input
- Now you can use your test ONE token in our example app
Call Extension Method
Note that the Magic Harmony extension follows the method names and conventions by Harmony's Javascript SDK. To deploy an Harmony smart contract, you can call the magic.harmony.sendTransaction
method to send deploy contract transaction.
- ES Modules/TypeScript
Contract Send
Getting Test ONE token
Before you can send transaction on the Harmony blockchain, you'll need to acquire some test ONE token (Harmony's native cryptocurrency for test network).
- Go to our Harmony Example application
- Login with your email address
- Copy your Harmony public address
- Go to the Harmony Faucet
- Paste your copied Harmony public address in the text input
- Now you can use your test ONE token in our example app
Call Extension Method
Note that the Magic Harmony extension follows the method names and conventions by Harmony's Javascript SDK. To call an Harmony smart contract function, you can call the magic.harmony.sendTransaction
method to send contract transaction.
- ES Modules/TypeScript