0.1.34 • Published 6 months ago
@napcatlabs/protocol v0.1.34
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/protocolyarn:
yarn add @napcat/protocolHow 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.30
11 months ago
0.1.31
10 months ago
0.1.32
10 months ago
0.1.33
8 months ago
0.1.34
6 months ago
0.1.27
12 months ago
0.1.28
12 months ago
0.1.29
11 months ago
0.1.25
12 months ago
0.1.26
12 months ago
0.1.23
1 year ago
0.1.24
1 year ago
0.1.20
1 year ago
0.1.21
1 year ago
0.1.22
1 year ago
0.1.19
1 year ago
0.1.17
1 year ago
0.1.12
1 year ago
0.1.13
1 year ago
0.1.14
1 year ago
0.1.15
1 year ago
0.1.16
1 year ago
0.1.10
1 year ago
0.1.11
1 year ago
0.1.9
1 year ago
0.1.8
1 year ago
0.1.7
1 year ago
0.1.6
1 year ago
0.1.4
1 year ago
0.1.5
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
0.0.8
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