Add files via upload

This commit is contained in:
n0xy
2024-02-20 15:24:12 -03:00
committed by GitHub
parent 7cea6c4803
commit 22201d67a6
2 changed files with 45 additions and 0 deletions

1
types/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './mint';

44
types/mint.ts Normal file
View File

@ -0,0 +1,44 @@
import { struct, u32, u8 } from '@solana/buffer-layout';
import { bool, publicKey, u64 } from '@solana/buffer-layout-utils';
import { Commitment, Connection, PublicKey } from '@solana/web3.js';
/** Information about a mint */
export interface Mint {
/** Address of the mint */
address: PublicKey;
/**
* Optional authority used to mint new tokens. The mint authority may only be provided during mint creation.
* If no mint authority is present then the mint has a fixed supply and no further tokens may be minted.
*/
mintAuthority: PublicKey | null;
/** Total supply of tokens */
supply: bigint;
/** Number of base 10 digits to the right of the decimal place */
decimals: number;
/** Is this mint initialized */
isInitialized: boolean;
/** Optional authority to freeze token accounts */
freezeAuthority: PublicKey | null;
}
/** Mint as stored by the program */
export interface RawMint {
mintAuthorityOption: 1 | 0;
mintAuthority: PublicKey;
supply: bigint;
decimals: number;
isInitialized: boolean;
freezeAuthorityOption: 1 | 0;
freezeAuthority: PublicKey;
}
/** Buffer layout for de/serializing a mint */
export const MintLayout = struct<RawMint>([
u32('mintAuthorityOption'),
publicKey('mintAuthority'),
u64('supply'),
u8('decimals'),
bool('isInitialized'),
u32('freezeAuthorityOption'),
publicKey('freezeAuthority'),
]);