import { MINT_SIZE, ACCOUNT_SIZE, TOKEN_PROGRAM_ID } from '@solarti/spl-token';
import { GpaBuilder } from '../../utils';
export class MintGpaBuilder extends GpaBuilder {
    constructor(metaplex, programId) {
        super(metaplex, programId !== null && programId !== void 0 ? programId : TOKEN_PROGRAM_ID);
        this.whereSize(MINT_SIZE);
    }
    whereDoesntHaveMintAuthority() {
        return this.where(0, 0);
    }
    whereHasMintAuthority() {
        return this.where(0, 1);
    }
    whereMintAuthority(mintAuthority) {
        return this.whereHasMintAuthority().where(4, mintAuthority);
    }
    whereSupply(supply) {
        return this.where(36, supply);
    }
}
export class TokenGpaBuilder extends GpaBuilder {
    constructor(metaplex, programId) {
        super(metaplex, programId !== null && programId !== void 0 ? programId : TOKEN_PROGRAM_ID);
        this.whereSize(ACCOUNT_SIZE);
    }
    selectMint() {
        return this.slice(0, 32);
    }
    whereMint(mint) {
        return this.where(0, mint);
    }
    selectOwner() {
        return this.slice(32, 32);
    }
    whereOwner(owner) {
        return this.where(32, owner);
    }
    selectAmount() {
        return this.slice(64, 8);
    }
    whereAmount(amount) {
        return this.where(64, amount);
    }
    whereDoesntHaveDelegate() {
        return this.where(72, 0);
    }
    whereHasDelegate() {
        return this.where(72, 1);
    }
    whereDelegate(delegate) {
        return this.whereHasDelegate().where(76, delegate);
    }
}
//# sourceMappingURL=gpaBuilders.js.map