@carrot-protocol/clend-vaults-rpc 0.0.2-pub1-dev-a741874

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ idl/
2
+
package/makefile ADDED
@@ -0,0 +1,18 @@
1
+ .DEFAULT_GOAL := build
2
+
3
+ .PHONY: build clean fmt fmt_check
4
+
5
+ build:
6
+ npm run build
7
+
8
+ clean:
9
+ npm run clean
10
+
11
+ fmt:
12
+ npm run fmt
13
+
14
+ fmt_check:
15
+ npm run fmt:check
16
+
17
+ version_check:
18
+ npm run version-check
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@carrot-protocol/clend-vaults-rpc",
3
+ "version": "0.0.2-pub1-dev-a741874",
4
+ "description": "clend vaults rpc client",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "clean": "rm -rf *.tgz dist node_modules package-lock.json",
8
+ "build": "npm i && tsc && npm pack",
9
+ "fmt": "prettier --write src/",
10
+ "fmt:check": "prettier --check src/",
11
+ "test": "for file in test/*.test.ts; do npx ts-mocha -p ./tsconfig.json -t 1000000 \"$file\" || exit 1; done",
12
+ "version-check": "current_version=$(node -p -e \"require('./package.json').version\") && if npm view @carrot-protocol/clend-vaults-rpc@$current_version > /dev/null 2>&1; then echo \"Version $current_version already exists. Please bump it in package.json\"; exit 1; fi"
13
+ },
14
+ "author": "",
15
+ "license": "ISC",
16
+ "devDependencies": {
17
+ "@types/node": "^24.5.2",
18
+ "prettier": "^3.6.2"
19
+ },
20
+ "dependencies": {
21
+ "@jup-ag/api": "6.0.44",
22
+ "@carrot-protocol/clend-rpc": "0.1.44",
23
+ "@coral-xyz/anchor": "^0.31.1",
24
+ "@solana/spl-token": "^0.4.14"
25
+ }
26
+ }
@@ -0,0 +1,19 @@
1
+ import { web3 } from "@coral-xyz/anchor";
2
+
3
+ // Program id from your IDL
4
+ export const CLEND_VAULTS_PROGRAM_ID = new web3.PublicKey(
5
+ "CVAU7TAbdfv7s6rxSmcNKg2AGswZAChXaovoKdvxVs5Q",
6
+ );
7
+
8
+ // PDA: ["vault", shares_mint]
9
+ export function getVaultPda(sharesMint: web3.PublicKey): web3.PublicKey {
10
+ return web3.PublicKey.findProgramAddressSync(
11
+ [Buffer.from("vault"), sharesMint.toBuffer()],
12
+ CLEND_VAULTS_PROGRAM_ID,
13
+ )[0];
14
+ }
15
+
16
+ // Jupiter program id used by your `swap` instruction
17
+ export const JUPITER_SWAP_PROGRAM_ID = new web3.PublicKey(
18
+ "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
19
+ );