@goat-sdk/crossmint v0.5.1
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-crossmintUsage
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(),
],
});7 months ago
8 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago