
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
@magic-ext/polkadot
Advanced tools
npm i magic-sdk @magic-ext/polkadot
Setup PolkadotExtension with magic-sdk
import { Magic } from 'magic-sdk';
import { PolkadotExtension } from '@magic-ext/polkadot';
const magic = new Magic('YOUR_API_KEY', {
extensions: [
new PolkadotExtension({
rpcUrl: 'polkadot rpc url'
})
]
});
// or
const magic = new Magic('YOUR_API_KEY', {
extensions: {
polkadot: new PolkadotExtension({
rpcUrl: 'polkadot rpc url'
})
}
});
See the developer documentation to learn how you can master the Magic SDK in a matter of minutes.
Using getAccount function to get Polkadot public address for current user.
const publicAddress = await magic.polkadot.getAccount();
console.log('icon public address', publicAddress);
Send polkadot native currency
const handlerSendTransaction = async () => {
const tx = await magic.polkadot.sendTransaction(
'5H3pELHbg9skXE2HfLqP23UPgrgu2Juj55CH6sdDGWc2HKNs',
1000000000000000,
);
console.log('transaction hash', tx)
};
const handlerContractCall = async () => {
const api = await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:9944/') });
await api.isReady;
const abi = new Abi(api.registry, contractABI);
const data = abi.messages.flip();
const tx = await magic.polkadot.contractCall('5C52CfgkwANdFuN3VgPSprQwNWKfkLWMHJbMRzp12h4YarCa', 0, 1000000, data);
console.log('transaction hash', tx)
}
FAQs
magic polkadot extension
The npm package @magic-ext/polkadot receives a total of 1,747 weekly downloads. As such, @magic-ext/polkadot popularity was classified as popular.
We found that @magic-ext/polkadot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.