0.0.31 • Published 2 years ago
@slidelabs/solana-toolkit v0.0.31
@slidelabs/solana-toolkit
Quickly use the main methods present in Solana, all in one toolkit. SPL tokens, transactions, mints.
Installation
$ yarn add @slidelabs/solana-toolkit
# or
$ npm install @slidelabs/solana-toolkit
Request SOL AirDrop
import { clusterApiUrl, Connection } from "@solana/web3.js";
import { Transaction } from "@slidelabs/solana-toolkit";
const connection = new Connection(clusterApiUrl("devnet"));
const transaction = new Transaction(connection);
const publicKey = new PublicKey("HjJQdfTHgC3EBX3471w4st8BXbBmtbaMyCAXNgcUb7dq");
transaction.solAirDrop(publicKey);
Create a Candy Machine
import { clusterApiUrl, Connection } from "@solana/web3.js";
import { useWallet } from "@solana/wallet-adapter-react";
import { CandyMachine } from "@slidelabs/solana-toolkit";
const connection = new Connection(clusterApiUrl("devnet"));
const candyMachine = new CandyMachine(connection, { wallet }, "devnet");
const JSON_METADATA = {
name: "Glorious Arctic Halibut",
symbol: "SR",
description: "SR Desc",
image: "0.png",
attributes: [{ trait_type: "Location", value: "Strasbourg - France" }],
properties: { files: [{ uri: "0.png", type: "image/png" }] },
};
candyMachine.createCandyMachine(
{
wallet: new PublicKey("4x4UVonAFWUJ2MPNh8dVAPBBxkqxB82peiuD5rQQM1YV"),
tokenMint: null,
price: sol(0.1),
sellerFeeBasisPoints: 250,
itemsAvailable: toBigNumber(1000),
symbol: "Test",
maxEditionSupply: toBigNumber(0),
isMutable: true,
retainAuthority: false,
goLiveDate: null,
endSettings: null,
hiddenSettings: null,
whitelistMintSettings: null,
gatekeeper: null,
creators: [
{
address: new PublicKey("4x4UVonAFWUJ2MPNh8dVAPBBxkqxB82peiuD5rQQM1YV"),
share: 100,
verified: true,
},
],
},
[
{
fileName: "0",
image: "0.png",
nftName: "Glorious Arctic Halibut",
options: {},
},
],
[{ json: JSON_METADATA, fileName: "0.json" }]
);
0.0.20
2 years ago
0.0.21
2 years ago
0.0.22
2 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.25
2 years ago
0.0.15
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.18
2 years ago
0.0.19
2 years ago
0.0.30
2 years ago
0.0.31
2 years ago
0.0.10
2 years ago
0.0.11
2 years ago
0.0.12
2 years ago
0.0.13
2 years ago
0.0.14
2 years ago
0.0.26
2 years ago
0.0.9
2 years ago
0.0.27
2 years ago
0.0.8
2 years ago
0.0.28
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago