@drift-labs/sdk
Version:
SDK for Drift Protocol
42 lines • 1.95 kB
TypeScript
/// <reference types="bn.js" />
import * as anchor from '@coral-xyz/anchor';
import { AnchorProvider, Program } from '@coral-xyz/anchor';
import { Account } from '@solana/spl-token';
import { ConfirmOptions, Connection, PublicKey, TransactionInstruction, TransactionSignature } from '@solana/web3.js';
import { IWallet } from './types';
import { BankrunContextWrapper } from './bankrun/bankrunConnection';
import { BN } from '@coral-xyz/anchor';
export declare class TokenFaucet {
context?: BankrunContextWrapper;
connection: Connection;
wallet: IWallet;
program: Program;
provider: AnchorProvider;
mint: PublicKey;
opts?: ConfirmOptions;
constructor(connection: Connection, wallet: IWallet, programId: PublicKey, mint: PublicKey, opts?: ConfirmOptions, context?: BankrunContextWrapper);
getFaucetConfigPublicKeyAndNonce(): Promise<[
PublicKey,
number
]>;
getMintAuthority(): Promise<PublicKey>;
getFaucetConfigPublicKey(): Promise<PublicKey>;
initialize(): Promise<TransactionSignature>;
fetchState(): Promise<any>;
private mintToUserIx;
mintToUser(userTokenAccount: PublicKey, amount: BN): Promise<TransactionSignature>;
transferMintAuthority(): Promise<TransactionSignature>;
createAssociatedTokenAccountAndMintTo(userPublicKey: PublicKey, amount: BN): Promise<[PublicKey, TransactionSignature]>;
createAssociatedTokenAccountAndMintToInstructions(userPublicKey: PublicKey, amount: BN): Promise<[PublicKey, TransactionInstruction, TransactionInstruction]>;
getAssosciatedMockUSDMintAddress(props: {
userPubKey: PublicKey;
}): Promise<anchor.web3.PublicKey>;
getTokenAccountInfo(props: {
userPubKey: PublicKey;
}): Promise<Account>;
subscribeToTokenAccount(props: {
userPubKey: PublicKey;
callback: (accountInfo: Account) => void;
}): Promise<boolean>;
}
//# sourceMappingURL=tokenFaucet.d.ts.map