repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/index.test.ts | packages/fuels/src/cli/commands/build/index.test.ts | import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../../test/utils/mockLogger';
import { build } from '.';
import * as buildSwayProgramsMod from './buildSwayPrograms';
import * as generateTypesMod from './generateTypes';
/**
* @group node
*/
describe('build', ()... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/generateTypes.ts | packages/fuels/src/cli/commands/build/generateTypes.ts | import { ProgramTypeEnum } from '@fuel-ts/abi-typegen';
import { runTypegen } from '@fuel-ts/abi-typegen/runTypegen';
import { getBinaryVersions } from '@fuel-ts/versions/cli';
import { writeFileSync, mkdirSync } from 'fs';
import { globSync } from 'glob';
import { join } from 'path';
import { getABIPaths } from '../.... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/buildSwayProgram.test.ts | packages/fuels/src/cli/commands/build/buildSwayProgram.test.ts | import * as childProcessMod from 'child_process';
import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../../test/utils/mockLogger';
import { configureLogging } from '../../utils/logger';
import { buildSwayProgram } from './buildSwayProgram';
vi.mock('child_process'... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/buildSwayProgram.ts | packages/fuels/src/cli/commands/build/buildSwayProgram.ts | import { spawn } from 'child_process';
import type { FuelsConfig } from '../../types';
import { debug, log, loggingConfig } from '../../utils/logger';
import { onForcExit, onForcError } from './forcHandlers';
export const buildSwayProgram = async (config: FuelsConfig, path: string) => {
debug('Building Sway progra... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/buildSwayPrograms.test.ts | packages/fuels/src/cli/commands/build/buildSwayPrograms.test.ts | import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../../test/utils/mockLogger';
import * as buildSwayProgramMod from './buildSwayProgram';
import { buildSwayPrograms } from './buildSwayPrograms';
/**
* @group node
*/
describe('buildSwayPrograms', () => {
befor... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/forcHandlers.ts | packages/fuels/src/cli/commands/build/forcHandlers.ts | import { error } from '../../utils/logger';
type OnResultFn = () => void;
type OnErrorFn = (reason?: number | Error) => void;
export const onForcExit =
(onResultFn: OnResultFn, onErrorFn: OnErrorFn) => (code: number | null) => {
if (code) {
onErrorFn(new Error(`forc exited with error code ${code}`));
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/index.ts | packages/fuels/src/cli/commands/build/index.ts | import { type Command } from 'commander';
import type { FuelsConfig } from '../../types';
import { log } from '../../utils/logger';
import { deploy } from '../deploy';
import { autoStartFuelCore } from '../dev/autoStartFuelCore';
import { buildSwayPrograms } from './buildSwayPrograms';
import { generateTypes } from '... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/build/forcHandlers.test.ts | packages/fuels/src/cli/commands/build/forcHandlers.test.ts | import { mockLogger } from '../../../../test/utils/mockLogger';
import { onForcExit, onForcError } from './forcHandlers';
/**
* @group node
*/
describe('buildSwayPrograms', () => {
test('should resolve on successful exit', () => {
const resolve = vi.fn();
const reject = vi.fn((_reason?: number | Error) =>... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/commands/init/index.ts | packages/fuels/src/cli/commands/init/index.ts | import { FuelError } from '@fuel-ts/errors';
import { type Command } from 'commander';
import { existsSync, statSync, writeFileSync } from 'fs';
import { dirname, join, relative, resolve } from 'path';
import { findPrograms } from '../../config/forcUtils';
import { renderFuelsConfigTemplate } from '../../templates/fue... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/checkForAndDisplayUpdates.test.ts | packages/fuels/src/cli/utils/checkForAndDisplayUpdates.test.ts | import * as versionsMod from '@fuel-ts/versions';
import * as checkForAndDisplayUpdatesMod from './checkForAndDisplayUpdates';
import * as getLatestFuelsVersionMod from './getLatestFuelsVersion';
import * as loggerMod from './logger';
/**
* @group node
*/
describe('checkForAndDisplayUpdates', () => {
beforeEach((... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/getLatestFuelsVersion.test.ts | packages/fuels/src/cli/utils/getLatestFuelsVersion.test.ts | import * as cacheMod from './fuelsVersionCache';
import { getLatestFuelsVersion } from './getLatestFuelsVersion';
/**
* @group node
*/
describe('getLatestFuelsVersion', () => {
beforeEach(() => {
vi.resetAllMocks();
});
afterEach(() => {
vi.restoreAllMocks();
});
it('should fail if fetch fails', ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/getLatestFuelsVersion.ts | packages/fuels/src/cli/utils/getLatestFuelsVersion.ts | import { checkAndLoadCache, saveToCache } from './fuelsVersionCache';
export const getLatestFuelsVersion = async (): Promise<string | undefined> => {
const cachedVersion = checkAndLoadCache();
if (cachedVersion) {
return cachedVersion;
}
const data: { version: string } | null = await Promise.race([
ne... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/logger.ts | packages/fuels/src/cli/utils/logger.ts | import chalk from 'chalk';
export const loggingConfig = {
isDebugEnabled: false,
isLoggingEnabled: true,
};
export function configureLogging(params: { isDebugEnabled: boolean; isLoggingEnabled: boolean }) {
loggingConfig.isLoggingEnabled = params.isLoggingEnabled;
loggingConfig.isDebugEnabled = params.isDebug... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/logger.test.ts | packages/fuels/src/cli/utils/logger.test.ts | import chalk from 'chalk';
import * as loggerMod from './logger';
import { configureLogging, debug, error, log, loggingConfig, warn } from './logger';
/**
* @group node
*/
describe('logger', () => {
const loggingBackup = structuredClone(loggingConfig);
beforeEach(() => {
configureLogging(loggingBackup);
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/fuelsVersionCache.test.ts | packages/fuels/src/cli/utils/fuelsVersionCache.test.ts | import fs from 'fs';
import {
checkAndLoadCache,
FUELS_VERSION_CACHE_FILE,
FUELS_VERSION_CACHE_TTL,
saveToCache,
} from './fuelsVersionCache';
const mockWriteFile = () => vi.spyOn(fs, 'writeFileSync').mockImplementation(() => {});
const mockFileAge = (createdAtMs: number) =>
// @ts-expect-error type mismat... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/createConfig.ts | packages/fuels/src/cli/utils/createConfig.ts | import type { UserFuelsConfig } from '../types';
export function createConfig(config: UserFuelsConfig) {
return config;
}
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/fuelsVersionCache.ts | packages/fuels/src/cli/utils/fuelsVersionCache.ts | import fs from 'fs';
import path from 'path';
export const FUELS_VERSION_CACHE_FILE = path.join(__dirname, 'FUELS_VERSION');
export type FuelsVersionCache = string;
export const saveToCache = (cache: FuelsVersionCache) => {
fs.writeFileSync(FUELS_VERSION_CACHE_FILE, cache, 'utf-8');
};
export const FUELS_VERSION_... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/utils/checkForAndDisplayUpdates.ts | packages/fuels/src/cli/utils/checkForAndDisplayUpdates.ts | import { versions, gt, eq } from '@fuel-ts/versions';
import { getLatestFuelsVersion } from './getLatestFuelsVersion';
import { warn, log } from './logger';
export const checkForAndDisplayUpdates = async () => {
try {
const { FUELS: userFuelsVersion } = versions;
const latestFuelsVersion = await getLatestF... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/templates/fuels.config.ts | packages/fuels/src/cli/templates/fuels.config.ts | /* eslint-disable @typescript-eslint/triple-slash-reference */
/// <reference path="../../hbs.d.ts" />
import Handlebars from 'handlebars';
import fuelsConfigTemplate from './fuels.config.hbs';
Handlebars.registerHelper('isDefined', (v) => v !== undefined);
export function renderFuelsConfigTemplate(props: {
works... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/templates/index.ts | packages/fuels/src/cli/templates/index.ts | /* eslint-disable @typescript-eslint/triple-slash-reference */
/// <reference path="../../hbs.d.ts" />
// TODO: once abi-typegen implements a way to generate all types of sway
// programs in a bundle file we don't need to create a index.ts file
import Handlebars from 'handlebars';
import indexTemplate from './index.h... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/config/validateConfig.ts | packages/fuels/src/cli/config/validateConfig.ts | import * as yup from 'yup';
import type { UserFuelsConfig } from '../types';
const schema = yup
.object({
workspace: yup.string(),
contracts: yup.array(yup.string()),
scripts: yup.array(yup.string()),
predicates: yup.array(yup.string()),
output: yup.string().required('config.output should be a v... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/config/loadConfig.test.ts | packages/fuels/src/cli/config/loadConfig.test.ts | import { readFileSync } from 'fs';
import { resolve } from 'path';
import { mockCheckForUpdates } from '../../../test/utils/mockCheckForUpdates';
import {
runInit,
bootstrapProject,
resetConfigAndMocks,
resetDiskAndMocks,
} from '../../../test/utils/runCommands';
import { safeExec } from '../../test-utils';
im... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/config/loadConfig.ts | packages/fuels/src/cli/config/loadConfig.ts | import { FuelError } from '@fuel-ts/errors';
import { defaultConsensusKey } from '@fuel-ts/utils';
import { bundleRequire } from 'bundle-require';
import type { BuildOptions } from 'esbuild';
import JoyCon from 'joycon';
import { resolve, parse } from 'path';
import { tryFindBinaries } from '../../cli-utils';
import t... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/config/forcUtils.test.ts | packages/fuels/src/cli/config/forcUtils.test.ts | import { safeExec } from '../../test-utils';
import { readForcToml } from './forcUtils';
/**
* @group node
*/
describe('forcUtils', () => {
test('should throw if TOML file is not found', async () => {
const tomlPath = '/non/existent/path';
const errorMsg = `TOML file not found:\n ${tomlPath}`;
const ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/src/cli/config/forcUtils.ts | packages/fuels/src/cli/config/forcUtils.ts | import { FuelError } from '@fuel-ts/errors';
import { readFileSync, existsSync, writeFileSync } from 'fs';
import { globSync } from 'glob';
import camelCase from 'lodash.camelcase';
import { dirname, join } from 'path';
import toml from 'toml';
import type { FuelsConfig } from '../types';
export type ForcToml = {
p... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/fixtures/fuels.config.ts | packages/fuels/test/fixtures/fuels.config.ts | import { join } from 'path';
import type { FuelsConfig } from '../../src';
const projectPath = join(__dirname, 'workspace');
const contractsDir = join(projectPath, 'contracts');
const scriptsDir = join(projectPath, 'scripts');
const predicatesDir = join(projectPath, 'predicates');
export const fuelsConfig: FuelsCon... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/utils/mockAutoStartFuelCore.ts | packages/fuels/test/utils/mockAutoStartFuelCore.ts | import type { MockInstance } from 'vitest';
import * as autoStartFuelCoreMod from '../../src/cli/commands/dev/autoStartFuelCore';
export const mockStartFuelCore = (): {
killChildProcess: MockInstance;
autoStartFuelCore: MockInstance;
fuelCore: autoStartFuelCoreMod.FuelCoreNode;
} => {
const killChildProcess =... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/utils/runCommands.ts | packages/fuels/test/utils/runCommands.ts | import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
import { globSync } from 'glob';
import { join, basename } from 'path';
import type { FuelsConfig } from '../../src';
import { Commands } from '../../src';
import { run } from '../../src/run';
/**
* Path and Directory utils
*/
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/utils/mockCheckForUpdates.ts | packages/fuels/test/utils/mockCheckForUpdates.ts | import * as checkForUpdatesMod from '../../src/cli/utils/checkForAndDisplayUpdates';
export const mockCheckForUpdates = () => {
vi.spyOn(checkForUpdatesMod, 'checkForAndDisplayUpdates').mockImplementation(() =>
Promise.resolve()
);
};
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/utils/mockLogger.ts | packages/fuels/test/utils/mockLogger.ts | import * as logger from '../../src/cli/utils/logger';
export function mockLogger() {
const error = vi.spyOn(logger, 'error').mockReturnValue();
const warn = vi.spyOn(logger, 'warn').mockReturnValue();
const log = vi.spyOn(logger, 'log').mockReturnValue();
const debug = vi.spyOn(logger, 'debug').mockReturnValue... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/utils/resetDiskAndMocks.ts | packages/fuels/test/utils/resetDiskAndMocks.ts | import { existsSync, rmSync } from 'fs';
/**
* Cleanup routine
*/
export function resetDiskAndMocks(dirPath: string) {
if (existsSync(dirPath)) {
rmSync(dirPath, { recursive: true });
}
vi.restoreAllMocks();
}
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/features/build.test.ts | packages/fuels/test/features/build.test.ts | import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
import { join } from 'path';
import * as deployMod from '../../src/cli/commands/deploy/index';
import { mockStartFuelCore } from '../utils/mockAutoStartFuelCore';
import { mockCheckForUpdates } from '../utils/mockCheckForUpdates';
impor... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/features/init.test.ts | packages/fuels/test/features/init.test.ts | import chalk from 'chalk';
import { existsSync } from 'fs';
import { Commands } from '../../src';
import { mockCheckForUpdates } from '../utils/mockCheckForUpdates';
import { mockLogger } from '../utils/mockLogger';
import {
bootstrapProject,
runCommand,
runInit,
resetDiskAndMocks,
resetConfigAndMocks,
loa... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/features/deploy.test.ts | packages/fuels/test/features/deploy.test.ts | import type { JsonAbi } from '@fuel-ts/abi-coder';
import type { Account } from '@fuel-ts/account';
import { Contract } from '@fuel-ts/program';
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { launchTestNode } from '../../src/test-utils';
import { mockCheckForUpdates... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/fuels/test/features/dev.test.ts | packages/fuels/test/features/dev.test.ts | import { deferPromise } from '@fuel-ts/account';
import { spawn } from 'child_process';
import * as chokidar from 'chokidar';
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'path';
import { cwd } from 'process';
import * as buildMod from '../../src/cli/commands/build/index';
import * as de... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/logger/tsup.config.ts | packages/logger/tsup.config.ts | import { index } from '@internal/tsup';
export default index;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/logger/src/utils.ts | packages/logger/src/utils.ts | import type { Address } from '@fuel-ts/address';
import type { AddressLoggerOptions } from './index';
export function truncateWalletAddress(
walletAddress: Address,
options: Partial<AddressLoggerOptions> = {}
): string {
const prefixLength = options.prefixLength ?? 2;
const suffixLength = options.suffixLength... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/logger/src/index.ts | packages/logger/src/index.ts | /* eslint-disable @typescript-eslint/no-shadow */
/**
* @packageDocumentation
*
* A logger for fuel based on the [debug](https://www.npmjs.com/package/debug) module.
*
* @example
*
* ```TypeScript
* import { logger } from '@fuel-ts/logger'
*
* const log = logger('fuel-ts:my:package:name')
*
* try {
* // ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/logger/test/index.test.ts | packages/logger/test/index.test.ts | import { BN } from '@fuel-ts/math';
import debug from 'debug';
import type { MockInstance } from 'vitest';
import { logger, prefixLogger, defaultLogger } from '../src/index';
/**
* @group node
*/
describe('Logger Tests', () => {
let debugSpy: MockInstance;
beforeEach(() => {
debug.enable('test');
debug... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/logger/test/utils.test.ts | packages/logger/test/utils.test.ts | import type { Address } from '@fuel-ts/address';
import { truncateWalletAddress } from '../src/utils';
/**
* @group node
* @group browser
*/
describe('truncateWalletAddress Tests', () => {
it('should correctly truncate a wallet address', () => {
const mockAddress: Address = {
toString: () => '0x1234567... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/tsup.config.ts | packages/errors/tsup.config.ts | import { tsupDefaults } from '@internal/tsup';
import type { Options } from 'tsup';
const configs: Options = {
...tsupDefaults,
entry: {
index: 'src/index.ts',
'test-utils': 'src/test-utils.ts',
},
};
export default configs;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils.test.ts | packages/errors/src/test-utils.test.ts | import * as indexMod from './test-utils';
/**
* @group node
* @group browser
*/
describe('test utils', () => {
test('should export all test utilities', () => {
expect(indexMod.expectToThrowFuelError).toBeTruthy();
expect(indexMod.safeExec).toBeTruthy();
});
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/fuel-error.test.ts | packages/errors/src/fuel-error.test.ts | import { versions } from '@fuel-ts/versions';
import { FuelError, ErrorCode } from '.';
import { expectToThrowFuelError } from './test-utils/expect-to-throw-fuel-error';
/**
* @group node
* @group browser
*/
it('has properties set as expected on creation', () => {
const message = 'whatever';
const error = new ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/fuel-error.ts | packages/errors/src/fuel-error.ts | import { versions } from '@fuel-ts/versions';
import { ErrorCode } from './error-codes';
export class FuelError extends Error {
static readonly CODES = ErrorCode;
readonly VERSIONS = versions;
readonly metadata: Record<string, unknown>;
readonly rawError: unknown;
static parse(e: unknown) {
const error... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/error-codes.ts | packages/errors/src/error-codes.ts | /**
* Represents the different error codes thrown by the SDK
*/
export enum ErrorCode {
// abi
NO_ABIS_FOUND = 'no-abis-found',
ABI_TYPES_AND_VALUES_MISMATCH = 'abi-types-and-values-mismatch',
ABI_MAIN_METHOD_MISSING = 'abi-main-method-missing',
INVALID_COMPONENT = 'invalid-component',
CONFIGURABLE_NOT_FO... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils.ts | packages/errors/src/test-utils.ts | export * from './test-utils/safeExec';
export * from './test-utils/expect-to-throw-fuel-error';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/index.ts | packages/errors/src/index.ts | export { ErrorCode } from './error-codes';
export { FuelError } from './fuel-error';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils/safeExec.test.ts | packages/errors/src/test-utils/safeExec.test.ts | import { safeExec } from './safeExec';
/**
* @group node
* @group browser
*/
describe('safeExec.js', () => {
it('should catch error', async () => {
const ERROR_MSG = 'I am an error.';
const fn = () => {
throw new Error(ERROR_MSG);
};
const { error, result } = await safeExec(fn);
expec... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils/expect-to-throw-fuel-error.test.ts | packages/errors/src/test-utils/expect-to-throw-fuel-error.test.ts | import { FuelError } from '../fuel-error';
import { expectToThrowFuelError } from './expect-to-throw-fuel-error';
/**
* @group node
* @group browser
*/
describe('expect-to-throw-fuel-error', () => {
const otherError = new Error('Original Error');
const fuelError = new FuelError(FuelError.CODES.PARSE_FAILED, 'F... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils/expect-to-throw-fuel-error.ts | packages/errors/src/test-utils/expect-to-throw-fuel-error.ts | import { ErrorCode } from '../error-codes';
import type { FuelError } from '../fuel-error';
import { safeExec } from './safeExec';
type ExpectedFuelError = Partial<FuelError> & Required<Pick<FuelError, 'code'>>;
const codes = Object.values(ErrorCode);
export const expectToThrowFuelError = async (
lambda: () => un... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/errors/src/test-utils/safeExec.ts | packages/errors/src/test-utils/safeExec.ts | export const safeExec = async <TResult = unknown, TError extends Error = Error>(
lambda: () => TResult
) => {
let error: TError | undefined;
let result: TResult | undefined;
try {
result = await lambda();
} catch (_error: unknown) {
error = _error as TError;
}
return { error, result };
};
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/tsup.config.ts | packages/math/tsup.config.ts | import { indexAndConfigs } from '@internal/tsup';
export default indexAndConfigs;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/configs.ts | packages/math/src/configs.ts | export const DEFAULT_PRECISION = 9;
export const DEFAULT_MIN_PRECISION = 3;
export const DEFAULT_DECIMAL_UNITS = 9;
// Decimal units on the Fuel Network
export const DECIMAL_FUEL = 9;
// Decimal units on the Ethereum network
export const DECIMAL_WEI = 18;
export const DECIMAL_KWEI = 15;
export const DECIMAL_MWEI = 12... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/bn.ts | packages/math/src/bn.ts | import { ErrorCode, FuelError } from '@fuel-ts/errors';
import BnJs from 'bn.js';
import { DEFAULT_DECIMAL_UNITS, DEFAULT_MIN_PRECISION, DEFAULT_PRECISION } from './configs';
import type { FormatConfig } from './types';
type CompareResult = -1 | 0 | 1;
export type BNInput = number | string | number[] | Uint8Array | B... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/bn.test.ts | packages/math/src/bn.test.ts | import { FuelError, ErrorCode } from '@fuel-ts/errors';
import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils';
import type { BN } from './bn';
import { bn } from './bn';
import type { BigNumberish } from './types';
/**
* @group node
* @group browser
*/
describe('Math - BN', () => {
it('can execute ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/math.ts | packages/math/src/math.ts | import type { BN } from './bn';
import { bn } from './bn';
import type { BigNumberish } from './types';
export function max(...numbers: Array<BigNumberish>): BN {
return numbers.reduce<BN>((prev, cur) => (bn(cur).gt(prev) ? bn(cur) : prev), bn(0));
}
export function multiply(...numbers: Array<BigNumberish>): BN {
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/configs.test.ts | packages/math/src/configs.test.ts | import {
DEFAULT_DECIMAL_UNITS,
DEFAULT_PRECISION,
DEFAULT_MIN_PRECISION,
DECIMAL_FUEL,
DECIMAL_GWEI,
DECIMAL_KWEI,
DECIMAL_MWEI,
DECIMAL_WEI,
} from './configs';
/**
* @group node
* @group browser
*/
describe('configs', () => {
it('units should not change', () => {
// Defaults
expect(DEFA... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/functional.test.ts | packages/math/src/functional.test.ts | /**
* Simple tests to make sure functional shortcuts are working.
*
* Deeper tests are in ./bn.test.ts
*/
import { format, formatUnits, toBytes, toHex, toNumber } from './functional';
/**
* @group node
*/
describe('Math - Functional shortcuts', () => {
it('should toNumber return a number', () => {
expect(... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/types.ts | packages/math/src/types.ts | import type { BN } from './bn';
export type BigNumberish = string | number | BN;
export type ToFixedConfig = {
minPrecision?: number;
precision?: number;
};
export type FormatConfig = {
units?: number;
} & ToFixedConfig;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/index.ts | packages/math/src/index.ts | export * from './bn';
export * from './decimal';
export * from './functional';
export * from './math';
export * from './types';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/decimal.ts | packages/math/src/decimal.ts | import { DEFAULT_PRECISION, DEFAULT_MIN_PRECISION } from './configs';
import type { ToFixedConfig } from './types';
export function toFixed(value?: string | number, options?: ToFixedConfig) {
const { precision = DEFAULT_PRECISION, minPrecision = DEFAULT_MIN_PRECISION } = options || {};
const [valueUnits = '0', va... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/math/src/functional.ts | packages/math/src/functional.ts | import type { BNInput } from './bn';
import { bn } from './bn';
import type { FormatConfig } from './types';
/**
* Functional shortcuts
*/
// Shortcut to bn(value).toNumber
export function toNumber(value: BNInput): number {
return bn(value).toNumber();
}
// Shortcut to bn(value).toHex
export function toHex(value... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/tsup.config.ts | packages/program/tsup.config.ts | import { index } from '@internal/tsup';
export default index;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/instruction-set.ts | packages/program/src/instruction-set.ts | import { concat, hexlify } from '@fuel-ts/utils';
import type * as asm from '@fuels/vm-asm';
/**
* A wrapper around fuel-asm to make dynamic instructions and convert to different formats
*/
export class InstructionSet {
#operations: asm.Instruction[];
constructor(...args: asm.Instruction[]) {
this.#operatio... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/utils.ts | packages/program/src/utils.ts | import { getAllDecodedLogs, getDecodedLogs } from '@fuel-ts/account';
import type { TransactionResultReceipt, JsonAbisFromAllCalls, DecodedLogs } from '@fuel-ts/account';
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import type { AbstractContract, CallConfig, InvocationScopeLike } from './types';
/**
* @h... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/script-request.ts | packages/program/src/script-request.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import {
ASSET_ID_LEN,
CONTRACT_ID_LEN,
SCRIPT_FIXED_SIZE,
WORD_SIZE,
calculateVmTxMemory,
} from '@fuel-ts/abi-coder';
import type {
TransactionResultReturnDataReceipt,
TransactionResultRevertReceipt,
CallResult,
TransactionResultReceipt,
Tran... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/contract-call-script.ts | packages/program/src/contract-call-script.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import {
WORD_SIZE,
B256Coder,
ASSET_ID_LEN,
BigNumberCoder,
CONTRACT_ID_LEN,
} from '@fuel-ts/abi-coder';
import type {
CallResult,
DecodedLogs,
JsonAbisFromAllCalls,
TransactionResultCallReceipt,
TransactionResultReturnDataReceipt,
Transact... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/types.ts | packages/program/src/types.ts | /* eslint-disable max-classes-per-file */
import type { FunctionFragment, JsonAbi, Interface } from '@fuel-ts/abi-coder';
import type {
CallResult,
CoinQuantity,
CoinQuantityLike,
TransactionResponse,
TransactionResult,
TransactionType,
AbstractAccount,
Provider,
DecodedLogs,
PreConfirmationTransact... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/contract.test.ts | packages/program/src/contract.test.ts | import type { JsonAbi } from '@fuel-ts/abi-coder';
import { Account } from '@fuel-ts/account';
import { setupTestProviderAndWallets } from '@fuel-ts/account/test-utils';
import Contract from './contract';
const CONTRACT_ID = '0x0101010101010101010101010101010101010101010101010101010101010101';
const ABI: JsonAbi = {
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/index.ts | packages/program/src/index.ts | export * from './types';
export * from './utils';
export { FunctionInvocationScope } from './functions/invocation-scope';
export { MultiCallInvocationScope } from './functions/multicall-scope';
export { default as Contract } from './contract';
export { ScriptRequest } from './script-request';
export { InstructionSet } ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/response.ts | packages/program/src/response.ts | import { getGasUsedFromReceipts } from '@fuel-ts/account';
import type {
TransactionResultReceipt,
TransactionResponse,
TransactionResult,
CallResult,
DecodedLogs,
JsonAbisFromAllCalls,
} from '@fuel-ts/account';
import type { BN } from '@fuel-ts/math';
import type { TransactionType } from '@fuel-ts/transac... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/contract.ts | packages/program/src/contract.ts | import type { FunctionFragment, JsonAbi } from '@fuel-ts/abi-coder';
import { Interface } from '@fuel-ts/abi-coder';
import type { Account, Provider } from '@fuel-ts/account';
import type { AddressInput } from '@fuel-ts/address';
import { Address } from '@fuel-ts/address';
import type { BytesLike } from '@fuel-ts/utils... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/functions/invocation-scope.ts | packages/program/src/functions/invocation-scope.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import type { FunctionFragment } from '@fuel-ts/abi-coder';
import type { CoinQuantity } from '@fuel-ts/account';
import { coinQuantityfy } from '@fuel-ts/account';
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import type { AbstractProgram, CallConfig,... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/functions/base-invocation-scope.ts | packages/program/src/functions/base-invocation-scope.ts | /* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { InputValue, JsonAbi } from '@fuel-ts/abi-coder';
import type {
Provider,
CoinQuantity,
CallResult,
Account,
TransferParams,
TransactionResponse,
TransactionCost,
AbstractAccount,
AssembleTxPara... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/program/src/functions/multicall-scope.ts | packages/program/src/functions/multicall-scope.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import type { AbstractContract } from '../types';
import { BaseInvocationScope } from './base-invocation-scope';
import type { FunctionInvocationScope } from './invocation-scope';
/**
* Represents a scope for invoking multiple calls.
*
* @template TReturn - T... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/hasher/tsup.config.ts | packages/hasher/tsup.config.ts | import { index } from '@internal/tsup';
export default index;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/hasher/src/hasher.test.ts | packages/hasher/src/hasher.test.ts | import { bufferFromString } from '@fuel-ts/crypto';
import { hashMessage, hash, uint64ToBytesBE, sha256 } from './hasher';
/**
* @group node
* @group browser
*/
describe('Hasher', () => {
it('Hash "hello world"', () => {
const bytes = bufferFromString('hello world', 'utf-8');
expect(sha256(bytes)).toEqua... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/hasher/src/hasher.ts | packages/hasher/src/hasher.ts | import type { BytesLike } from '@fuel-ts/utils';
import { arrayify, concat, hexlify, toUtf8Bytes } from '@fuel-ts/utils';
import { sha256 as sha256AsBytes } from '@noble/hashes/sha256';
/**
* The prefix for the message to be hashed
*/
const MESSAGE_PREFIX = '\x19Fuel Signed Message:\n';
/**
* - When a string is pr... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/hasher/src/index.ts | packages/hasher/src/index.ts | export * from './hasher';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/tsup.config.ts | packages/recipes/tsup.config.ts | import { index } from '@internal/tsup';
export default index;
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/scripts/build-recipes.ts | packages/recipes/scripts/build-recipes.ts | import { execSync } from 'child_process';
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
execSync(`fuels-typegen -i src/contracts/**/*-abi.json -o src/types`);
const supportedRecipes = ['Src14OwnedProxy'].map((s) => [s, `${s}Factory`]).flat();
const importReplacementMap = {
'Contract... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/src/index.ts | packages/recipes/src/index.ts | export * from './types';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/src/types/Src14OwnedProxy.ts | packages/recipes/src/types/Src14OwnedProxy.ts | /* Autogenerated file. Do not edit manually. */
/* eslint-disable max-classes-per-file */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/consistent-type-imports */
/*
Fuels version: 0.102.0
*/
import { Contract as __Contract, type InvokeFunction } from '@fuel-ts/program... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/src/types/common.ts | packages/recipes/src/types/common.ts | /* Autogenerated file. Do not edit manually. */
/* eslint-disable max-classes-per-file */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/consistent-type-imports */
/*
Fuels version: 0.102.0
*/
/**
* Mimics Sway Enum.
* Requires one and only one Key-Value pair and rais... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/src/types/Src14OwnedProxyFactory.ts | packages/recipes/src/types/Src14OwnedProxyFactory.ts | /* Autogenerated file. Do not edit manually. */
/* eslint-disable max-classes-per-file */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/consistent-type-imports */
/*
Fuels version: 0.102.0
*/
import {
ContractFactory as __ContractFactory,
type DeployContractOptions... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/recipes/src/types/index.ts | packages/recipes/src/types/index.ts | /* Autogenerated file. Do not edit manually. */
/* eslint-disable max-classes-per-file */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/consistent-type-imports */
/*
Fuels version: 0.102.0
*/
export { Src14OwnedProxy } from './Src14OwnedProxy';
export { Src14OwnedProxy... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/tsup.config.ts | packages/account/tsup.config.ts | import { tsupDefaults } from '@internal/tsup';
import { mkdirSync, writeFileSync } from 'fs';
import { join } from 'path';
import type { Options } from 'tsup';
import { assets } from './src/assets';
const configs: Options = {
...tsupDefaults,
entry: {
index: 'src/index.ts',
configs: 'src/configs.ts',
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/scripts/generate-fuel-core-schema.ts | packages/account/scripts/generate-fuel-core-schema.ts | import { execSync } from 'child_process';
import { join } from 'path';
import { setupTestProviderAndWallets } from '../src/test-utils/setup-test-provider-and-wallets';
const { error } = console;
const main = async () => {
// use our internal package, not fuelup's fuel-core
process.env.FUEL_CORE_PATH = 'fuels-cor... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/test-util.test.ts | packages/account/src/test-util.test.ts | import * as testUtilsMod from './test-utils';
/**
* @group node
*/
describe('test-utils.js', () => {
test('should export all test utilities', () => {
expect(testUtilsMod.launchNode).toBeTruthy();
expect(testUtilsMod.setupTestProviderAndWallets).toBeTruthy();
expect(testUtilsMod.WalletsConfig).toBeTruth... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/configs.ts | packages/account/src/configs.ts | /**
* Devnet network URL
*/
export const DEVNET_NETWORK_URL = 'https://devnet.fuel.network/v1/graphql';
/**
* Testnet network URL
*/
export const TESTNET_NETWORK_URL = 'https://testnet.fuel.network/v1/graphql';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/configs.test.ts | packages/account/src/configs.test.ts | import { DEVNET_NETWORK_URL, TESTNET_NETWORK_URL } from './configs';
/**
* @group node
* @group browser
*/
describe('Configs', () => {
it('exports DEVNET_NETWORK_URL', async () => {
const configs = await import('./configs');
expect(configs.DEVNET_NETWORK_URL).toBe(DEVNET_NETWORK_URL);
});
it('exports... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/consolidate-coins.test.ts | packages/account/src/consolidate-coins.test.ts | import { ErrorCode, FuelError } from '@fuel-ts/errors';
import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils';
import type { BigNumberish } from '@fuel-ts/math';
import { type SnapshotConfigs } from '@fuel-ts/utils';
import type { PartialDeep } from 'type-fest';
import { type Account } from '.';
import t... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/test-utils.ts | packages/account/src/test-utils.ts | export * from './test-utils/launchNode';
export * from './test-utils/setup-test-provider-and-wallets';
export * from './test-utils/wallet-config';
export * from './test-utils/test-message';
export * from './test-utils/test-asset-id';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/types.ts | packages/account/src/types.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import type { Address } from '@fuel-ts/address';
export abstract class AbstractAccount {
abstract address: Address;
abstract provider: unknown;
abstract getResourcesToSpend(quantities: any[], options?: any): any;
abstract sendTransaction(transactionReques... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/index.ts | packages/account/src/index.ts | export * from './assets';
export * from './account';
export * from './types';
export * from './wallet';
export * from './hdwallet';
export * from './mnemonic';
export * from './wordlists';
export * from './signer';
export * from './wallet-manager';
export * from './predicate';
export * from './providers';
export * from... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/account.ts | packages/account/src/account.ts | /* eslint-disable no-param-reassign */
import { UTXO_ID_LEN } from '@fuel-ts/abi-coder';
import type { AddressInput, WithAddress } from '@fuel-ts/address';
import { Address } from '@fuel-ts/address';
import { randomBytes } from '@fuel-ts/crypto';
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import type { Has... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | true |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/account.test.ts | packages/account/src/account.test.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
import { Address } from '@fuel-ts/address';
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils';
import { bn } from '@fuel-ts/math';
import { PolicyType } from '@fuel-ts/transactions';
import {... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | true |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/hdwallet/hdwallet.ts | packages/account/src/hdwallet/hdwallet.ts | import { computeHmac, ripemd160 } from '@fuel-ts/crypto';
import { ErrorCode, FuelError } from '@fuel-ts/errors';
import { sha256 } from '@fuel-ts/hasher';
import { bn, toBytes, toHex } from '@fuel-ts/math';
import type { BytesLike } from '@fuel-ts/utils';
import { arrayify, hexlify, concat, dataSlice, encodeBase58, de... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/hdwallet/hdwallet.test.ts | packages/account/src/hdwallet/hdwallet.test.ts | import HDWalletSpec from '../../test/fixtures/hdwallet-spec';
import HDWallet from './hdwallet';
/**
* @group node
* @group browser
*/
describe('HDWallet', () => {
test("Should throw error on invalid extended key's", () => {
expect(() =>
HDWallet.fromExtendedKey(
'xpub661MyMwAqRbcEYS8w7XLSVeEsB... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/hdwallet/index.ts | packages/account/src/hdwallet/index.ts | export { default as HDWallet } from './hdwallet';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.