0.1.24 • Published 9 months ago
@napcatlabs/protocol v0.1.24
Napcat Protocol SDK! This is the official SDK that allows you to interact with the Napcat protocol on the Solana blockchain.
Install
Install these dependencies over:
npm:
npm install @napcat/protocol
yarn:
yarn add @napcat/protocol
How to Use
Here’s a basic example of how you can start using the SDK:
import { Connection, PublicKey } from '@solana/web3.js'
import { Wallet } from '@coral-xyz/anchor'
import NapcatProtocolClient from '@napcat/protocol'
const connection = new Connection('https://api.mainnet-beta.solana.com')
const wallet = new Wallet(/* Your private key here */)
const napcatClient = new NapcatProtocolClient(connection, wallet)
// Example: Claiming Rewards
async function claimRewards() {
const vaultPubkey = new PublicKey('vaultPublicKeyHere')
const userPubkey = new PublicKey('userPublicKeyHere')
const userPositionPubkey = new PublicKey('userPositionPublicKeyHere')
const args = {
vaultPubkey,
userPubkey,
userPositionPubkey
}
try {
const txSignature = await napcatClient.claimRewards(args)
console.log('Rewards claimed successfully! Transaction:', txSignature)
} catch (error) {
console.error('Error claiming rewards:', error)
}
}
claimRewards()
0.1.23
9 months ago
0.1.24
9 months ago
0.1.20
9 months ago
0.1.21
9 months ago
0.1.22
9 months ago
0.1.19
9 months ago
0.1.17
9 months ago
0.1.12
10 months ago
0.1.13
10 months ago
0.1.14
10 months ago
0.1.15
10 months ago
0.1.16
10 months ago
0.1.10
10 months ago
0.1.11
10 months ago
0.1.9
10 months ago
0.1.8
10 months ago
0.1.7
10 months ago
0.1.6
11 months ago
0.1.4
11 months ago
0.1.5
11 months ago
0.1.3
11 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.1.0
11 months ago
0.0.8
11 months ago
0.0.7
11 months ago
0.0.6
11 months ago
0.0.5
11 months ago
0.0.4
11 months ago
0.0.3
11 months ago
0.0.2
11 months ago
0.0.1
11 months ago