Skip to content

Commit

Permalink
chore: update org
Browse files Browse the repository at this point in the history
  • Loading branch information
00xSam committed Feb 3, 2025
1 parent 7db1da7 commit 4d72657
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 41 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mercurial Vault SDK

<p align="center">
<img align="center" src="https://vaults.mercurial.finance/icons/logo.svg" width="180" height="180" />
<img align="center" src="https://app.meteora.ag/icons/logo.svg" width="180" height="180" />
</p>
<br>

Expand All @@ -19,24 +19,17 @@ Refer to [Affiliate Rust Client Readme](https://github.com/mercurial-finance/vau
<hr>

## 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/

Discord: https://discord.com/channels/841152225564950528/864859354335412224

<hr>

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

Expand Down
5 changes: 2 additions & 3 deletions programs/vault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

30 changes: 10 additions & 20 deletions ts-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand All @@ -28,17 +22,17 @@ 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

- 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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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();
Expand All @@ -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
```

Expand All @@ -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');
}
Expand Down
14 changes: 7 additions & 7 deletions ts-client/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -13,7 +13,7 @@
"dist"
],
"keywords": [],
"author": "mercurial-finance",
"author": "meteora-ag",
"license": "MIT",
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
Expand Down Expand Up @@ -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"
}

0 comments on commit 4d72657

Please sign in to comment.