@marinade.finance/native-staking-sdk
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -19,2 +19,3 @@ import { Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js"; | ||
callPrepareForRevoke(user: PublicKey, signature: string, amount?: BN): Promise<any>; | ||
callRebalanceHint(user: PublicKey): Promise<any>; | ||
fetchRewards(user: PublicKey): Promise<RewardsResponse>; | ||
@@ -21,0 +22,0 @@ buildRevokeInstructions(user: PublicKey, stakeAccounts: PublicKey[]): TransactionInstruction[]; |
@@ -25,2 +25,3 @@ "use strict"; | ||
}; | ||
const buildRequestBodyForRebalanceHint = (user) => ({ user: user.toBase58() }); | ||
class NativeStakingSDK { | ||
@@ -98,2 +99,12 @@ constructor(config = new config_1.NativeStakingConfig()) { | ||
} | ||
callRebalanceHint(user) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const response = yield fetch(`${this.config.nativeStakingApiUrl}/v1/rebalance-hint`, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify(buildRequestBodyForRebalanceHint(user)), | ||
}); | ||
return yield response.json(); | ||
}); | ||
} | ||
fetchRewards(user) { | ||
@@ -100,0 +111,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@marinade.finance/native-staking-sdk", | ||
"version": "0.0.1", | ||
"description": "Marinade SDK for the Native Staking", | ||
"main": "dist/src/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/marinade-finance/native-staking.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"type": "commonjs", | ||
"scripts": { | ||
"preinstall": "npx only-allow pnpm", | ||
"build": "rm -fr dist; npx tsc -b -verbose", | ||
"pretest": "pnpm lint", | ||
"test": "echo 'No tests'", | ||
"prepack": "pnpm test && pnpm build" | ||
}, | ||
"keywords": [ | ||
"solana", | ||
"marinade.finance", | ||
"blockchain", | ||
"staking" | ||
], | ||
"license": "ISC", | ||
"dependencies": { | ||
"@solana/spl-memo": "^0.2.3", | ||
"@solana/web3.js": "^1.74.0", | ||
"bn.js": "^5.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/bn.js": "^5.1.1", | ||
"@types/node": "^18.16.3", | ||
"typescript": "^5.0.4" | ||
} | ||
"name": "@marinade.finance/native-staking-sdk", | ||
"version": "0.0.2", | ||
"description": "Marinade SDK for the Native Staking", | ||
"main": "dist/src/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/marinade-finance/native-staking.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"type": "commonjs", | ||
"keywords": [ | ||
"solana", | ||
"marinade.finance", | ||
"blockchain", | ||
"staking" | ||
], | ||
"license": "ISC", | ||
"dependencies": { | ||
"@solana/spl-memo": "^0.2.3", | ||
"@solana/web3.js": "^1.74.0", | ||
"bn.js": "^5.2.1" | ||
}, | ||
"devDependencies": { | ||
"@types/bn.js": "^5.1.1", | ||
"@types/node": "^18.16.3", | ||
"typescript": "^5.0.4" | ||
}, | ||
"scripts": { | ||
"build": "rm -fr dist; npx tsc -b -verbose", | ||
"pretest": "pnpm lint", | ||
"test": "echo 'No tests'" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
41516
444
0
3