Installation
To get started, install the following dependencies for your project:Initialization
The Magic class is the entry-point to the Magic SDK. It must be instantiated with a Magic publishable key. ES Modules/TypeScriptJavaScript
JavaScript
Common Methods
Note that the Magic Solana extension follows the method names and conventions by Solana’s JavaScript SDK.Sign and Send Transaction
ES Modules/TypeScript To sign a standard Solana blockchain transaction, call themagic.solana.signTransaction
method. Note that you must sign with the Magic SDK method but send the transaction using the @solana/web3.js
method connection.sendRawTransaction
.
JavaScript
Sign Message
ES Modules/TypeScriptJavaScript