Overview
Kadena is a secure and scalable proof-of-work network designed to power global financial systems. It is unique in its braided multi-chain architecture, currently consisting of 20 different chains per network. Magic interacts with the Kadena blockchain via Magic’s extension NPM package@magic-ext/kadena
. The Kadena extension also lets you interact with the blockchain using methods from Kadena’s Javascript SDK.
You can skip straight to our kitchen sink example directly: Kadena
Example
Installation
Initialization
Developers can initialize the Kadena extension by providing the following config:rpcUrl
- endpoint for the Kadena nodechainId
- chain ID for the Kadena network (0 - 19)networkId
- network ID for the Kadena networkcreateAccountsOnChain
- this field specifies whether or not Magic will submit acreate-account
transaction as part of the new user sign up flow. Note that due to the on-chain transaction, enabling this will result in signups that take up to 30 seconds.
Common Methods
SpireKey Login
Magic supports Kadena’s SpireKey library, allowing users to login with just a passkey. Visit the Kadena docs to learn more about SpireKey.JavaScript
Get User Info
Returns information about the authenticated user, such asaccountName
, publicKey
, loginType
(‘email_otp’, ‘sms’, ‘spirekey’, etc), isMfaEnabled
, email
, phoneNumber
, and spireKeyInfo
.
JavaScript
Get Test KDA Tokens
Before you can send a transaction on the Kadena blockchain, you’ll need to acquire some test KDA.- Go to our Kadena Example application
- Login with your email address
- Copy your Kadena account
- Go to the Kadena Faucet
- Paste your copied Kadena public address in the text input
- Now you can use your test KDA in our example app
Sign Transaction (with SpireKey user)
To sign a Kadena transaction for a SpireKey user, you can call themagic.kadena.signTransactionWithSpireKey()
method.
JavaScript
Sign Transaction (with non-SpireKey user)
To sign a standard Kadena transaction, you can call themagic.kadena.signTransaction()
method.
JavaScript