0.5.1 • Published 11 months ago

@goat-sdk/crossmint v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Crossmint Utilities for GOAT

A set of tools and wallet clients for interacting with Crossmint APIs.

Wallet Clients: 1. Smart Wallet: Wallet client for interacting with Crossmint Smart Wallets 2. Custodial Wallet: Wallet client for interacting with Crossmint Custodial Wallets

Plugins: 1. USDC Faucet: Tools to top up your wallet with USDC on testnets 2. Mint NFTs: Tools to mint NFTs on Crossmint 3. Create wallets: Tools to create wallets for emails and X/Twitter accounts with Crossmint

Installation

npm install @goat-sdk/wallet-crossmint
yarn add @goat-sdk/wallet-crossmint
pnpm add @goat-sdk/wallet-crossmint

Usage

Smart Wallet

import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { crossmint } from "@goat-sdk/crossmint";

const apiKey = process.env.CROSSMINT_STAGING_API_KEY;
const walletSignerSecretKey = process.env.SIGNER_WALLET_SECRET_KEY;
const alchemyApiKey = process.env.ALCHEMY_API_KEY_BASE_SEPOLIA;
const smartWalletAddress = process.env.SMART_WALLET_ADDRESS;

const { smartwallet } = crossmint(apiKey);

const tools = await getOnChainTools({
    wallet: await smartwallet({
        address: smartWalletAddress,
        signer: {
            secretKey: walletSignerSecretKey as `0x${string}`,
        },
        chain: "base-sepolia",
        provider: alchemyApiKey,
    }),
});

Custodial Wallet

import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { crossmint } from "@goat-sdk/crossmint";
import { Connection } from "@solana/web3.js";

const apiKey = process.env.CROSSMINT_STAGING_API_KEY;
const email = process.env.EMAIL;

if (!apiKey || !email) {
    throw new Error("Missing environment variables");
}

const { custodial } = crossmint(apiKey);

const tools = await getOnChainTools({
    wallet: await custodial({
        chain: "solana",
        email: email,
        connection: new Connection(
            "https://api.devnet.solana.com",
            "confirmed"
        ),
    }),
});

Faucet, Mint NFTs, Create wallets

import { createWalletClient } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { sepolia } from "viem/chains";
import { http } from "viem";

import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { viem } from "@goat-sdk/wallet-viem";
import { crossmint } from "@goat-sdk/crossmint";

const account = privateKeyToAccount(
    process.env.WALLET_PRIVATE_KEY as `0x${string}`
);

const walletClient = createWalletClient({
    account: account,
    transport: http(process.env.ALCHEMY_API_KEY),
    chain: sepolia,
});

const apiKey = process.env.CROSSMINT_STAGING_API_KEY;

const { faucet, mint, wallet } = crossmint(apiKey);

const tools = await getOnChainTools({
    plugins: [
        faucet(),
        mint(),
        wallet(),
    ],
});
0.5.1

11 months ago

0.5.0

12 months ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.18

1 year ago

0.3.17

1 year ago

0.3.16

1 year ago

0.3.15

1 year ago

0.3.14

1 year ago

0.3.13

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago