diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7c1f8..ab91b63 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 +## @mercurial-finance/vault-sdk [2.2.1] - PR [#131](https://github.com/mercurial-finance/vault-sdk/pull/131) + +### Added + +- new utils `deserializeMint` + ## @mercurial-finance/vault-sdk [2.2.0] - PR [#130](https://github.com/mercurial-finance/vault-sdk/pull/130) ### Fixed diff --git a/ts-client/package.json b/ts-client/package.json index e10970a..ec98e73 100644 --- a/ts-client/package.json +++ b/ts-client/package.json @@ -1,6 +1,6 @@ { "name": "@mercurial-finance/vault-sdk", - "version": "2.2.0", + "version": "2.2.1", "description": "Mercurial Vault SDK is a typescript library that allows you to interact with Mercurial v2's vault.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/ts-client/src/vault/utils/index.ts b/ts-client/src/vault/utils/index.ts index 7bdc350..abe762a 100644 --- a/ts-client/src/vault/utils/index.ts +++ b/ts-client/src/vault/utils/index.ts @@ -7,6 +7,8 @@ import { createCloseAccountInstruction, RawAccount, AccountLayout, + MintLayout, + RawMint, } from '@solana/spl-token'; import { Connection, @@ -33,6 +35,14 @@ export const deserializeAccount = (data: Buffer | undefined): RawAccount | undef return accountInfo; }; +export const deserializeMint = (data: Buffer | undefined): RawMint | undefined => { + if (data == undefined || data.length == 0) { + return undefined; + } + const mintInfo = MintLayout.decode(data); + return mintInfo; +}; + export const getOrCreateATAInstruction = async ( tokenAddress: PublicKey, owner: PublicKey,