Installation
Magic interacts with the Polkadot blockchain via Magic’s extension NPM package@magic-ext/polkadot
. The Polkadot extension also lets you interact with the blockchain using methods from polkadot-js.
Initialization
JavaScript
Common Methods
Get User Info
UsinggetAccount
function to get Polkadot public address for current user.
JavaScript
Send Transaction
To send a standard Polkadot blockchain transaction, you can call themagic.polkadot.sendTransaction
method.
JavaScript
Smart Contract
To call a Polkadot blockchain contract as transaction, you can call themagic.polkadot.contractCall
method.
JavaScript