Installation
Magic interacts with the Cosmos blockchain via Magic’s extension NPM package@magic-ext/cosmos
. The Cosmos extension also lets you interact with the blockchain using methods from cosmjs.
Initialization
JavaScript
Common Methods
Sign and Send Transaction
To send or sign a standard Cosmos blockchain transaction, you can call themagic.cosmos.signAndBroadcast
method or magic.cosmos.sign
method.
JavaScript
Send Tokens
Usingmagic.cosmos.sendTokens
function to native tokens on Cosmos blockchain.
JavaScript
Change Address
Usingmagic.cosmos.changeAddress
function to change the address prefix.
JavaScript