Tezos
Installation
Magic interacts with the Tezos blockchain via Magic's extension NPM package @magic-ext/tezos
. The Tezos extension also lets you interact with the blockchain using methods from Tezos's ConseilJS SDK.
note
You can skip straight to our kitchen sink example directly:
- NPM
- Yarn
Initializing Extension
- ES Modules/TypeScript
Get User Info
Get Account
Using getAccount function to get Tezos public address for current user.
- ES Modules/TypeScript
Send Transaction
Getting Test XTZ
Before you can send transaction on the Tezos blockchain, you'll need to acquire some test XTZ (Tezos' native cryptocurrency for test network).
- Go to our Tezos Faucet
- Type in your email and click the "Sign Up / Login" button
- Go to your email and click on the magic link to login
- Once you are logged in, you will get 10 test XTZ
- Now you can use your test XTZ in our example app
Call Extension Method
Note that the Magic Tezos extension follows the method names and conventions by ConceilJS. To send a standard Tezos blockchain transaction, you can call the magic.tezos.sendTransactionOperation
method.
- ES Modules/TypeScript
Smart Contract
Deploy Contract
Getting Test XTZ
Before you can send transaction on the Tezos blockchain, you'll need to acquire some test XTZ (Tezos' native cryptocurrency for test network).
- Go to our Tezos Faucet
- Type in your email and click the "Sign Up / Login" button
- Go to your email and click on the magic link to login
- Once you are logged in, you will get 10 test XTZ
- Now you can use your test XTZ in our example app
Call Extension Method
Note that the Magic Tezos extension follows the method names and conventions by ConceilJS. To deploy a Tezos smart contract, you can call the magic.tezos.sendContractOriginationOperation
method.
- ES Modules/TypeScript