diff --git a/CHANGELOG.md b/CHANGELOG.md index ab91b63..8118daf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security +## @meteora-ag/vault-sdk[0.1.0] - PR [#134](https://github.com/mercurial-finance/vault-sdk/pull/134) + +### Changed + +- move to `meteora-ag` org + ## @mercurial-finance/vault-sdk [2.2.1] - PR [#131](https://github.com/mercurial-finance/vault-sdk/pull/131) ### Added diff --git a/README.md b/README.md index 6a6c2ce..e24608c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Mercurial Vault SDK

- +


@@ -19,16 +19,9 @@ Refer to [Affiliate Rust Client Readme](https://github.com/mercurial-finance/vau
## Getting started (TypeScript) -NPM: https://www.npmjs.com/package/@mercurial-finance/vault-sdk +NPM: https://www.npmjs.com/package/@meteora-ag/vault-sdk -SDK: https://github.com/mercurial-finance/vault-sdk - -Demo: https://vault-sdk-demo.vercel.app/ - -Demo repo: https://github.com/mercurial-finance/vault-sdk-demo -- Easiest way to get started with our Typescript SDK, the example demo includes all functionality and information we display on our own site. - -Node Demo repo: https://github.com/mercurial-finance/vault-sdk-node-demo +SDK: https://github.com/meteora-ag/vault-sdk Docs: https://docs.mercurial.finance/mercurial-dynamic-yield-infra/ @@ -36,7 +29,7 @@ Discord: https://discord.com/channels/841152225564950528/864859354335412224
-Refer to [Typescript Readme](https://github.com/mercurial-finance/vault-sdk/blob/main/ts-client/README.md) for full installation guide +Refer to [Typescript Readme](https://github.com/meteora-ag/vault-sdk/blob/main/ts-client/README.md) for full installation guide ### Install & Run diff --git a/programs/vault/README.md b/programs/vault/README.md index ea8b0d2..62863c0 100644 --- a/programs/vault/README.md +++ b/programs/vault/README.md @@ -3,7 +3,6 @@ - Author: [Mercurial Finance](https://www.mercurial.finance/) - Purpose: SDK for Vault - Mercurial Finance -- [Discord](https://discord.gg/yfGeKKbpM8) -- [Github](hhttps://github.com/mercurial-finance/vault-sdk) +- [Discord](https://discord.gg/yfGeKKbpM8) +- [Github](hhttps://github.com/meteora-ag/vault-sdk) - [Crates](https://crates.io/crates/mercurial-vault) - diff --git a/ts-client/README.md b/ts-client/README.md index d6acbd2..fea2326 100644 --- a/ts-client/README.md +++ b/ts-client/README.md @@ -7,15 +7,9 @@ ## Getting started -NPM: https://www.npmjs.com/package/@mercurial-finance/vault-sdk +NPM: https://www.npmjs.com/package/@meteora-ag/vault-sdk -SDK: https://github.com/mercurial-finance/vault-sdk - -Demo: https://vault-sdk-demo.vercel.app/ - -Demo repo: https://github.com/mercurial-finance/vault-sdk-demo - -- Easiest way to get started with our Typescript SDK, the example demo includes all functionality and information we display on our own site. +SDK: https://github.com/meteora-ag/vault-sdk Docs: https://docs.mercurial.finance/mercurial-dynamic-yield-infra/ @@ -28,7 +22,7 @@ Discord: https://discord.com/channels/841152225564950528/864859354335412224 1. Install deps ``` -npm i @mercurial-finance/vault-sdk @coral-xyz/anchor @solana/web3.js @solana/spl-token @solana/spl-token-registry +npm i @meteora-ag/vault-sdk @coral-xyz/anchor @solana/web3.js@1 @solana/spl-token @solana/spl-token-registry ``` 2. Initialize VaultImpl instance @@ -36,9 +30,9 @@ npm i @mercurial-finance/vault-sdk @coral-xyz/anchor @solana/web3.js @solana/spl - Affiliate or partner? refer to the [Vault Affiliate Program]() ```ts -import VaultImpl from '@mercurial-finance/vault-sdk'; +import VaultImpl from '@meteora-ag/vault-sdk'; import { PublicKey } from '@solana/web3.js'; -import { StaticTokenListResolutionStrategy, TokenInfo } from '@solana/spl-token-registry'; +import { NATIVE_MINT } from "@solana/spl-token"; import { Wallet, AnchorProvider } from '@coral-xyz/anchor'; // Connection, Wallet, and AnchorProvider to interact with the network @@ -47,12 +41,8 @@ const mockWallet = new Wallet(new Keypair()); const provider = new AnchorProvider(mainnetConnection, mockWallet, { commitment: 'confirmed', }); -// Alternatively, to use Solana Wallet Adapter, refer to `Demo Repo` -const tokenMap = new StaticTokenListResolutionStrategy().resolve(); -// Find the token info you want to use. -const SOL_TOKEN_INFO = tokenMap.find((token) => token.symbol === 'SOL') as TokenInfo; -const vaultImpl = await VaultImpl.create(connection, SOL_TOKEN_INFO); +const vaultImpl = await VaultImpl.create(connection, NATIVE_MINT); ``` 3. To interact with the VaultImpl @@ -67,7 +57,7 @@ const lpSupply = await vaultImpl.getVaultSupply(); const unlockedAmount = await vaultImpl.getWithdrawableAmount(); // To deposit into the vault -const amountInLamports = 1 * 10 ** SOL_TOKEN_INFO.decimals; // 1.0 SOL +const amountInLamports = 1 * 10 ** 9; // 1.0 SOL const depositTx = await vaultImpl.deposit(mockWallet.publicKey, new BN(amountInLamports)); // Web3 Transaction Object const depositResult = await provider.sendAndConfirm(depositTx); // Transaction hash @@ -82,7 +72,7 @@ const withdrawResult = await provider.sendAndConfirm(withdrawTx); // Transaction 4. Helper function ```ts -import { helper } from '@mercurial-finance/vault-sdk'; +import { helper } from '@meteora-ag/vault-sdk'; const userShare = await vaultImpl.getUserBalance(mockWallet.publicKey); const unlockedAmount = await vaultImpl.getWithdrawableAmount(); @@ -92,7 +82,7 @@ const lpSupply = await vaultImpl.getVaultSupply(); const underlyingShare = helper.getAmountByShare(userShare, unlockedAmount, lpSupply); // To convert underlying token amount into user's LP balance -const amountInLamports = 1 * 10 ** SOL_TOKEN_INFO.decimals; // 1.0 SOL +const amountInLamports = 1 * 10 ** 9; // 1.0 SOL const lpToUnmint = helper.getUnmintAmount(new BN(amountInLamports), unlockedAmount, lpSupply); // To withdraw 1.0 SOL ``` @@ -111,7 +101,7 @@ Affiliates only need to initialize the vault instance with the third paratemer ` ```ts const vaultImpl = await VaultImpl.create( connection, - SOL_TOKEN_INFO, + NATIVE_MINT, { affiliateId: new PublicKey('YOUR_PARTNER_PUBLIC_KEY'); } diff --git a/ts-client/package.json b/ts-client/package.json index 336e232..198dce8 100644 --- a/ts-client/package.json +++ b/ts-client/package.json @@ -1,7 +1,7 @@ { - "name": "@mercurial-finance/vault-sdk", - "version": "2.2.2", - "description": "Mercurial Vault SDK is a typescript library that allows you to interact with Mercurial v2's vault.", + "name": "@meteora-ag/vault-sdk", + "version": "0.1.0", + "description": "Mercurial Vault SDK is a typescript library that allows you to interact with Meteora's dynamic vault.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "scripts": { @@ -13,7 +13,7 @@ "dist" ], "keywords": [], - "author": "mercurial-finance", + "author": "meteora-ag", "license": "MIT", "dependencies": { "@coral-xyz/anchor": "^0.28.0", @@ -44,10 +44,10 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/mercurial-finance/mercurial_sdk.git" + "url": "git+https://github.com/MeteoraAg/vault-sdk.git" }, "bugs": { - "url": "https://github.com/mercurial-finance/mercurial_sdk/issues" + "url": "https://github.com/MeteoraAg/vault-sdk/issues" }, - "homepage": "https://github.com/mercurial-finance/mercurial_sdk#readme" + "homepage": "https://github.com/MeteoraAg/vault-sdk#readme" }