import { AccountLayout as SplTokenAccountLayout, MintLayout as SplMintAccountLayout, } from '@solarti/spl-token';
import { NotYetImplementedError } from '../../errors';
import { getAccountParsingAndAssertingFunction, getAccountParsingFunction, } from '../../types';
const mintAccountParser = {
    name: 'MintAccount',
    deserialize: (data, offset) => {
        const span = SplMintAccountLayout.getSpan(data, offset);
        const decoded = SplMintAccountLayout.decode(data, offset);
        return [decoded, span];
    },
    fromArgs() {
        throw new NotYetImplementedError();
    },
};
/** @group Account Helpers */
export const parseMintAccount = getAccountParsingFunction(mintAccountParser);
/** @group Account Helpers */
export const toMintAccount = getAccountParsingAndAssertingFunction(mintAccountParser);
const tokenAccountParser = {
    name: 'TokenAccount',
    deserialize: (data, offset) => {
        const span = SplTokenAccountLayout.getSpan(data, offset);
        const decoded = SplTokenAccountLayout.decode(data, offset);
        return [decoded, span];
    },
    fromArgs() {
        throw new NotYetImplementedError();
    },
};
/** @group Account Helpers */
export const parseTokenAccount = getAccountParsingFunction(tokenAccountParser);
/** @group Account Helpers */
export const toTokenAccount = getAccountParsingAndAssertingFunction(tokenAccountParser);
//# sourceMappingURL=accounts.js.map