0.0.31 • Published 1 year ago

@slidelabs/solana-toolkit v0.0.31

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@slidelabs/solana-toolkit

npm npm npm

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

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.26

1 year ago

0.0.9

1 year ago

0.0.27

1 year ago

0.0.8

1 year ago

0.0.28

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago