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/internal/tsup/tsup.config.ts | internal/tsup/tsup.config.ts | import { tsupDefaults } from './src';
export default {
...tsupDefaults,
entry: ['src/index.ts'],
};
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/internal/tsup/src/index.ts | internal/tsup/src/index.ts | /**
* [NOTE]
* Due to the limitations of TSUP regarding config inheritance, we
* exports ready-to-go configurations for most used scenarios in the
* monorepo. More complex configs can be done in isolation.
*/
import type { Options } from 'tsup';
export const tsupDefaults: Options = {
clean: true,
dts: false,... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/internal/check-tests/src/browser.test.ts | internal/check-tests/src/browser.test.ts | import { testEach } from './index';
/**
* @group browser
*/
describe('in:browser', () => {
it('should work on browser', () => {
expect(testEach()).toEqual('browser');
});
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/internal/check-tests/src/all.test.ts | internal/check-tests/src/all.test.ts | import { testAll } from './index';
/**
* @group node
* @group browser
*/
describe('in:everywhere', () => {
it('should work everywhere', () => {
expect(testAll()).toEqual('thank you');
});
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/internal/check-tests/src/index.ts | internal/check-tests/src/index.ts | const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
const isNode =
typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
export const testEach = (): string => {
let env: string;
if (isBrowser) {
env = 'browser';
} else if (isNo... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/internal/check-tests/src/node.test.ts | internal/check-tests/src/node.test.ts | import { testEach } from './index';
/**
* @group node
*/
describe('in:node', () => {
it('should work on node', () => {
expect(testEach()).toEqual('node');
});
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/playwright.config.ts | templates/vite/playwright.config.ts | import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './test/ui',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. *... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/fuels.config.ts | templates/vite/fuels.config.ts | import { createConfig } from 'fuels';
import dotenv from 'dotenv';
import { providerUrl } from './src/lib';
dotenv.config({
path: ['.env.local', '.env'],
});
// If your node is running on a port other than 4000, you can set it here
const fuelCorePort = +(process.env.VITE_FUEL_NODE_PORT as string) || 4000;
export d... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/tailwind.config.ts | templates/vite/tailwind.config.ts | import type { Config } from 'tailwindcss';
export default {
content: ['./index.html', './src/**/*.{js,jsx,ts,tsx}'],
theme: {
fontFamily: {
sans: ['Segoe UI', 'Roboto', 'sans-serif'],
mono: ['monospace'],
},
extend: {
keyframes: {
hide: {
from: { opacity: '1' },
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/vite.config.ts | templates/vite/vite.config.ts | import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
define: {
'process.env': env,
},
plugins: [react()],
};
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/App.tsx | templates/vite/src/App.tsx | import { useConnectUI, useIsConnected, useNetwork } from "@fuels/react";
import { useEffect } from "react";
import { useRouter } from "./hooks/useRouter";
import Button from "./components/Button";
import Info from "./components/Info";
import Wallet from "./components/Wallet";
import Contract from "./components/Contrac... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/lib.tsx | templates/vite/src/lib.tsx | import { BN } from "fuels";
import contractIds from "./sway-api/contract-ids.json";
export const environments = { LOCAL: "local", TESTNET: "testnet" };
export const environment =
process.env.VITE_DAPP_ENVIRONMENT || environments.LOCAL;
export const isLocal = environment === environments.LOCAL;
export const isTestnet... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/main.tsx | templates/vite/src/main.tsx | import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { defaultConnectors } from "@fuels/connectors";
import { FuelProvider, NetworkConfig } from "@fuels/react";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ToastContainer } from "react-toastify";... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/vite-env.d.ts | templates/vite/src/vite-env.d.ts | /// <reference types="vite/client" />
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/hooks/useNotification.tsx | templates/vite/src/hooks/useNotification.tsx | import { ReactNode, useRef } from "react";
import { toast, Id, TypeOptions } from "react-toastify";
import { renderTransactionId } from "../lib.tsx";
/**
* Hook to handle app notifications
*/
export const useNotification = () => {
const notification = useRef<Id | null>(null);
const onClose = () => {
notifi... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/hooks/useBaseAssetId.tsx | templates/vite/src/hooks/useBaseAssetId.tsx | import { useNamedQuery, useProvider } from "@fuels/react";
export const useBaseAssetId = () => {
const { provider } = useProvider();
return useNamedQuery("baseAssetId", {
queryKey: ["baseAssetId"],
queryFn: async () => {
if (!provider) {
throw new Error("Provider not found");
}
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/hooks/useRouter.ts | templates/vite/src/hooks/useRouter.ts | import { useEffect, useState } from 'react';
/**
* Hook for basic route and view management
*/
export const useRouter = () => {
const views = ['wallet', 'contract', 'predicate', 'script', 'faucet'];
const [view, setView] = useState<string>('wallet');
const queryParam = 'v';
const getViewFromUrl = () => {
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Predicate.tsx | templates/vite/src/components/Predicate.tsx | import { useBalance, useWallet } from "@fuels/react";
import { useEffect, useState } from "react";
import { bn } from "fuels";
import { TestPredicate } from "../sway-api/predicates";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal, renderFormattedBalance } from "../lib.tsx";
im... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Wallet.tsx | templates/vite/src/components/Wallet.tsx | import { useDisconnect, useWallet, useBalance } from "@fuels/react";
import { useEffect } from "react";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal, renderFormattedBalance } from "../lib.tsx";
import { useBaseAssetId } from "../hooks/useBaseAssetId.tsx";
export default fun... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Faucet.tsx | templates/vite/src/components/Faucet.tsx | import { useBalance, useWallet } from "@fuels/react";
import { useEffect, useState } from "react";
import LocalFaucet from "./LocalFaucet";
import Button from "./Button";
import { isLocal, renderFormattedBalance, testnetFaucetUrl } from "../lib.tsx";
import { useBaseAssetId } from "../hooks/useBaseAssetId.tsx";
expor... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/LocalFaucet.tsx | templates/vite/src/components/LocalFaucet.tsx | import { Address, bn, WalletUnlocked } from "fuels";
import { useWallet } from "@fuels/react";
import { useState } from "react";
import Button from "./Button";
import { useNotification } from "../hooks/useNotification.tsx";
type Props = {
refetch: () => void;
addressToFund?: string;
};
export default function Lo... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Contract.tsx | templates/vite/src/components/Contract.tsx | import { useEffect, useState } from "react";
import { useWallet } from "@fuels/react";
import LocalFaucet from "./LocalFaucet";
import { TestContract } from "../sway-api";
import Button from "./Button";
import { isLocal, contractId } from "../lib.tsx";
import { useNotification } from "../hooks/useNotification.tsx";
e... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Info.tsx | templates/vite/src/components/Info.tsx | import { providerUrl, playgroundUrl } from "../lib.tsx";
export default function Info() {
return (
<div id="text" className="col-span-2 px-4 py-4">
<h1 className="pb-1 pt-0 text-3xl font-medium">
Welcome to Fuel
</h1>
<p>
This Vite + React template was bootstrapped with the{" "}... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Script.tsx | templates/vite/src/components/Script.tsx | import { useWallet } from "@fuels/react";
import { BigNumberish, BN, Script as FuelScript } from "fuels";
import { useEffect, useState } from "react";
import { TestScript } from "../sway-api";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal } from "../lib.tsx";
import { useNoti... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/src/components/Button.tsx | templates/vite/src/components/Button.tsx | import React from "react";
import clsx from "clsx";
export type Props = {
color?: "primary" | "secondary" | "inactive";
} & React.ComponentProps<"button">;
export default function Button(props: Props) {
const { color = "primary", children, disabled, className, ...rest } = props;
return (
<button
type... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/test/integration/predicate.test.ts | templates/vite/test/integration/predicate.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Import for the predicate factory and input data type, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestPred... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/test/integration/contract.test.ts | templates/vite/test/integration/contract.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Imports for the contract factory and bytecode, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestContractFac... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/test/integration/script.test.ts | templates/vite/test/integration/script.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Import for the script factory, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestScript } from '../../src/sw... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/vite/test/ui/ui.test.ts | templates/vite/test/ui/ui.test.ts | import type { Page } from '@playwright/test';
import { test, expect } from '@playwright/test';
const WEB_SERVER_URL = 'http://localhost:5173';
const setup = async ({ page }: { page: Page }) => {
await page.goto(WEB_SERVER_URL, { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
const connectWallet... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/playwright.config.ts | templates/nextjs/playwright.config.ts | import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './test/ui',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. *... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/fuels.config.ts | templates/nextjs/fuels.config.ts | import { createConfig } from 'fuels';
import dotenv from 'dotenv';
import { providerUrl } from '@/lib';
dotenv.config({
path: ['.env.local', '.env'],
});
const fuelCorePort = +(process.env.NEXT_PUBLIC_FUEL_NODE_PORT as string) || 4000;
export default createConfig({
workspace: './sway-programs',
output: './src/... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/tailwind.config.ts | templates/nextjs/tailwind.config.ts | import type { Config } from 'tailwindcss';
const config: Config = {
content: ['./src/components/**/*.{js,ts,jsx,tsx,mdx}', './src/app/**/*.{js,ts,jsx,tsx,mdx}'],
theme: {
fontFamily: {
sans: ['Segoe UI', 'Roboto', 'sans-serif'],
mono: ['monospace'],
},
extend: {
keyframes: {
h... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/next-env.d.ts | templates/nextjs/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/lib.tsx | templates/nextjs/src/lib.tsx | import { BN } from "fuels";
import contractIds from "./sway-api/contract-ids.json";
export const environments = { LOCAL: "local", TESTNET: "testnet" };
export const environment =
process.env.VITE_DAPP_ENVIRONMENT || environments.LOCAL;
export const isLocal = environment === environments.LOCAL;
export const isTestnet... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/app/layout.tsx | templates/nextjs/src/app/layout.tsx | "use client";
import { FuelProvider, NetworkConfig } from "@fuels/react";
import React, { ReactNode, useEffect, useState } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ToastContainer } from "react-toastify";
import { FuelConnector, Provider } from "fuels";
import { d... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/app/page.tsx | templates/nextjs/src/app/page.tsx | "use client";
import { useConnectUI, useIsConnected, useNetwork } from "@fuels/react";
import { useEffect } from "react";
import { useRouter } from "../hooks/useRouter";
import Button from "../components/Button";
import Info from "../components/Info";
import Wallet from "../components/Wallet";
import Contract from ".... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/hooks/useNotification.tsx | templates/nextjs/src/hooks/useNotification.tsx | import { ReactNode, useRef } from "react";
import { toast, Id, TypeOptions } from "react-toastify";
import { renderTransactionId } from "../lib";
/**
* Hook to handle app notifications
*/
export const useNotification = () => {
const notification = useRef<Id | null>(null);
const onClose = () => {
notificati... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/hooks/useBaseAssetId.tsx | templates/nextjs/src/hooks/useBaseAssetId.tsx | import { useNamedQuery, useProvider } from "@fuels/react";
export const useBaseAssetId = () => {
const { provider } = useProvider();
return useNamedQuery("baseAssetId", {
queryKey: ["baseAssetId"],
queryFn: async () => {
if (!provider) {
throw new Error("Provider not found");
}
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/hooks/useRouter.ts | templates/nextjs/src/hooks/useRouter.ts | import { useEffect, useState } from 'react';
/**
* Hook for basic route and view management
*/
export const useRouter = () => {
const views = ['wallet', 'contract', 'predicate', 'script', 'faucet'];
const [view, setView] = useState<string>('wallet');
const queryParam = 'v';
const getViewFromUrl = () => {
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Predicate.tsx | templates/nextjs/src/components/Predicate.tsx | import { useBalance, useWallet } from "@fuels/react";
import { useEffect, useState } from "react";
import { bn, Predicate as FuelPredicate, InputValue } from "fuels";
import { TestPredicate } from "../sway-api/predicates";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal, render... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Wallet.tsx | templates/nextjs/src/components/Wallet.tsx | import { useDisconnect, useWallet, useBalance } from "@fuels/react";
import { useEffect } from "react";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal, renderFormattedBalance } from "../lib";
import { useBaseAssetId } from "@/hooks/useBaseAssetId";
export default function Wal... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Faucet.tsx | templates/nextjs/src/components/Faucet.tsx | import { useBalance, useWallet } from "@fuels/react";
import { useEffect, useState } from "react";
import LocalFaucet from "./LocalFaucet";
import Button from "./Button";
import { isLocal, renderFormattedBalance, testnetFaucetUrl } from "../lib";
import { useBaseAssetId } from "@/hooks/useBaseAssetId";
export default... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/LocalFaucet.tsx | templates/nextjs/src/components/LocalFaucet.tsx | import { Address, bn, WalletUnlocked } from "fuels";
import { useWallet } from "@fuels/react";
import { useState } from "react";
import Button from "./Button";
import { useNotification } from "../hooks/useNotification";
type Props = {
refetch: () => void;
addressToFund?: string;
};
export default function LocalF... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Contract.tsx | templates/nextjs/src/components/Contract.tsx | import { useEffect, useState } from "react";
import { useWallet } from "@fuels/react";
import LocalFaucet from "./LocalFaucet";
import { TestContract } from "../sway-api";
import Button from "./Button";
import { isLocal, contractId } from "../lib";
import { useNotification } from "../hooks/useNotification";
export de... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Link.tsx | templates/nextjs/src/components/Link.tsx | import NextLink from "next/link";
export const Link = ({
href,
children,
className,
target,
}: {
href: string;
children: React.ReactNode;
className?: string;
target?: string;
}) => {
return (
<NextLink
href={href}
className={`text-fuel-green hover:underline ${className}`}
target... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Info.tsx | templates/nextjs/src/components/Info.tsx | import { providerUrl, playgroundUrl } from "../lib";
export default function Info() {
return (
<div id="text" className="col-span-2 px-4 py-4">
<h1 className="pb-1 pt-0 text-3xl font-medium">
Welcome to Fuel
</h1>
<p>
This Next + React template was bootstrapped with the{" "}
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Script.tsx | templates/nextjs/src/components/Script.tsx | import { useWallet } from "@fuels/react";
import { BigNumberish, BN, Script as FuelScript } from "fuels";
import { useEffect, useState } from "react";
import { TestScript } from "../sway-api";
import Button from "./Button";
import LocalFaucet from "./LocalFaucet";
import { isLocal } from "../lib";
import { useNotifica... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/src/components/Button.tsx | templates/nextjs/src/components/Button.tsx | import React from "react";
import clsx from "clsx";
export type Props = {
color?: "primary" | "secondary" | "inactive";
} & React.ComponentProps<"button">;
export default function Button(props: Props) {
const { color = "primary", children, disabled, className, ...rest } = props;
return (
<button
type... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/test/integration/predicate.test.ts | templates/nextjs/test/integration/predicate.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Import for the predicate factory and input data type, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestPred... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/test/integration/contract.test.ts | templates/nextjs/test/integration/contract.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Imports for the contract factory and bytecode, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestContractFac... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/test/integration/script.test.ts | templates/nextjs/test/integration/script.test.ts | import { launchTestNode } from 'fuels/test-utils';
import { describe, test, expect } from 'vitest';
/**
* Import for the script factory, so that we can use them in the test.
*
* Can't find these imports? Make sure you've run `fuels build` to generate these with typegen.
*/
import { TestScript } from '../../src/sw... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/templates/nextjs/test/ui/ui.test.ts | templates/nextjs/test/ui/ui.test.ts | import type { Page } from '@playwright/test';
import { test, expect } from '@playwright/test';
const WEB_SERVER_URL = 'http://localhost:3000';
const setup = async ({ page }: { page: Page }) => {
await page.goto(WEB_SERVER_URL, { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
const connectWallet... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/address/tsup.config.ts | packages/address/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/address/src/configs.ts | packages/address/src/configs.ts | export const ZeroBytes32 = '0x0000000000000000000000000000000000000000000000000000000000000000';
export const EmptyRoot = '0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/address/src/address.test.ts | packages/address/src/address.test.ts | import { FuelError } from '@fuel-ts/errors';
import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils';
import { Address } from './address';
import type { AssetId, B256Address, B256AddressEvm, EvmAddress } from './types';
import * as utils from './utils';
const PUBLIC_KEY =
'0x2f34bc0df4db0ec391792cedb057... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/address/src/utils.ts | packages/address/src/utils.ts | import { randomBytes } from '@fuel-ts/crypto';
import { FuelError } from '@fuel-ts/errors';
import { arrayify, concat, hexlify } from '@fuel-ts/utils';
import { sha256 } from '@noble/hashes/sha256';
import type { Address } from './address';
import type { AddressLike, ContractIdLike, B256Address, B256AddressEvm } 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/address/src/address.ts | packages/address/src/address.ts | import { FuelError } from '@fuel-ts/errors';
import { arrayify, hexlify } from '@fuel-ts/utils';
import { sha256 } from '@noble/hashes/sha256';
import type { B256Address, EvmAddress, AssetId, ChecksumAddress, AddressInput } from './types';
import {
getRandomB256,
isB256,
isEvmAddress,
toB256AddressEvm,
fromP... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/address/src/types.ts | packages/address/src/types.ts | import type { Address } from './address';
export type AddressInput = string | B256Address | Address;
export type B256Address = string;
export type ChecksumAddress = string;
export type B256AddressEvm = `0x000000000000000000000000${string}`;
/**
* @prop bits - A 256 bit hash string with the first 12 bytes cleared
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/address/src/index.ts | packages/address/src/index.ts | export { Address } from './address';
export * from './types';
export * from './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/tsup.config.ts | packages/fuels/tsup.config.ts | import { indexBinAndCliConfig } from '@internal/tsup';
import type { Options } from 'tsup';
const options: Options = {
...indexBinAndCliConfig,
entry: {
...indexBinAndCliConfig.entry,
'test-utils': 'src/test-utils.ts',
'cli-utils': 'src/cli-utils.ts',
},
loader: {
'.hbs': 'text',
},
};
expor... | 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/vite.config.ts | packages/fuels/vite.config.ts | import { defineConfig } from 'vite';
export default defineConfig({
build: {
minify: true,
sourcemap: true,
emptyOutDir: false,
lib: {
entry: './src/index.ts',
name: 'browser',
formats: ['es'],
fileName: 'browser',
},
},
define: {
'process.env.NODE_ENV': JSON.string... | 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/scripts/build-proxy-contract.ts | packages/fuels/scripts/build-proxy-contract.ts | import { execSync } from 'child_process';
import { readFileSync, writeFileSync } from 'fs';
// generate types for pre-built contracts
execSync(
`fuels-typegen -i src/cli/commands/deploy/proxy/contract/*-abi.json -o src/cli/commands/deploy/proxy/types`
);
// overrides 'fuels' absolute import paths with relative ones... | 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/index.test.ts | packages/fuels/src/index.test.ts | import * as fuels from './index';
/**
* @group node
*/
describe('index.js', () => {
test('should export everything', () => {
expect(fuels.hexlify).toBeTruthy();
expect(fuels.arrayify).toBeTruthy();
expect(fuels.concat).toBeTruthy();
expect(fuels.Interface).toBeTruthy();
expect(fuels.Address).to... | 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/setup-launch-node-server.test.ts | packages/fuels/src/setup-launch-node-server.test.ts | import { Provider } from '@fuel-ts/account';
import { waitUntilUnreachable } from '@fuel-ts/utils/test-utils';
import { spawn } from 'node:child_process';
import { launchTestNode } from './test-utils';
interface ServerInfo extends Disposable {
serverUrl: string;
closeServer: () => Promise<void>;
}
function start... | 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/run.ts | packages/fuels/src/run.ts | import { configureCli } from './cli';
import { checkForAndDisplayUpdates } from './cli/utils/checkForAndDisplayUpdates';
import { error } from './cli/utils/logger';
export const run = async (argv: string[]) => {
await checkForAndDisplayUpdates().catch(error);
const program = configureCli();
return program.parseA... | 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.ts | packages/fuels/src/cli-utils.ts | export * from '@fuel-ts/utils/cli-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/src/setup-launch-node-server.ts | packages/fuels/src/setup-launch-node-server.ts | /* eslint-disable no-console */
import http from 'http';
import type { AddressInfo } from 'net';
import type { LaunchNodeOptions } from './test-utils';
import { waitUntilUnreachable, launchNode } from './test-utils';
process.setMaxListeners(Infinity);
async function parseBody(req: http.IncomingMessage): Promise<Laun... | 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.ts | packages/fuels/src/cli.ts | import { configureCliOptions as configureTypegenCliOptions } from '@fuel-ts/abi-typegen/cli';
import { versions } from '@fuel-ts/versions';
import { runVersions } from '@fuel-ts/versions/cli';
import { Command, Option } from 'commander';
import { build } from './cli/commands/build';
import { deploy } from './cli/comma... | 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/test-utils.ts | packages/fuels/src/test-utils.ts | export * from '@fuel-ts/contract/test-utils';
export * from '@fuel-ts/account/test-utils';
export * from '@fuel-ts/errors/test-utils';
export * from '@fuel-ts/utils/test-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/src/hbs.d.ts | packages/fuels/src/hbs.d.ts | // informs TS about Handlebar `.hbs` templates extension
declare module '*.hbs' {
const value: string;
export default 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/fuels/src/index.ts | packages/fuels/src/index.ts | // exporting wrapped `@fuels/vm-asm` for convenience
export * as FuelAsm from '@fuels/vm-asm';
// Exporting CLI entrypoint for programatic API
export * from './cli/index';
// Exporting all sub-packages
export { Script } from '@fuel-ts/script';
export * from '@fuel-ts/abi-coder';
export * from '@fuel-ts/account';
expo... | 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/bin.ts | packages/fuels/src/bin.ts | import { error } from './cli/utils/logger';
import { run } from './run';
run(process.argv).catch((err) => {
error((err as Error)?.message || err);
process.exit(1);
});
| 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.test.ts | packages/fuels/src/cli.test.ts | import { Command } from 'commander';
import { mockCheckForUpdates } from '../test/utils/mockCheckForUpdates';
import * as cliMod from './cli';
import { Commands } from './cli/types';
import * as loggingMod from './cli/utils/logger';
import { run } from './run';
/**
* @group node
*/
describe('cli.js', () => {
bef... | 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/index.test.ts | packages/fuels/src/cli/index.test.ts | import { fuelsConfig } from '../../test/fixtures/fuels.config';
import type {
CommandEvent,
Commands,
DeployedContract,
ContractDeployOptions,
FuelsConfig,
OptionsFunction,
UserFuelsConfig,
} from './index';
import { createConfig } from './index';
/**
* @group node
*/
describe('cli/index.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/fuels/src/cli/types.ts | packages/fuels/src/cli/types.ts | import type { JsonAbi } from '@fuel-ts/abi-coder';
import type { DeployContractOptions } from '@fuel-ts/contract';
export enum Commands {
build = 'build',
deploy = 'deploy',
dev = 'dev',
init = 'init',
versions = 'versions',
node = 'node',
}
export type CommandEvent =
| {
type: Commands.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/index.ts | packages/fuels/src/cli/index.ts | export * from './utils/createConfig';
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/fuels/src/cli/commands/withConfig.ts | packages/fuels/src/cli/commands/withConfig.ts | import { capitalizeString } from '@fuel-ts/utils';
import type { Command } from 'commander';
import { loadConfig } from '../config/loadConfig';
import type { Commands, FuelsConfig, CommandEvent } from '../types';
import { error, log } from '../utils/logger';
export const withConfigErrorHandler = async (err: Error, co... | 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/withBinaryPaths.test.ts | packages/fuels/src/cli/commands/withBinaryPaths.test.ts | import { Command } from 'commander';
import { fuelsConfig } from '../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../test/utils/mockLogger';
import * as loadConfigMod from '../config/loadConfig';
import { Commands } from '../types';
import { withBinaryPaths } from './withBinaryPaths';
const m... | 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/withConfig.test.ts | packages/fuels/src/cli/commands/withConfig.test.ts | import { Command } from 'commander';
import { fuelsConfig } from '../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../test/utils/mockLogger';
import * as loadConfigMod from '../config/loadConfig';
import type { FuelsConfig } from '../types';
import { Commands } from '../types';
import { withCon... | 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/withProgram.ts | packages/fuels/src/cli/commands/withProgram.ts | import type { Command } from 'commander';
import type { Commands } from '../types';
import { error } from '../utils/logger';
export function withProgram<CType extends Commands>(
program: Command,
_command: CType,
fn: (program: Command) => void
) {
return async () => {
try {
await fn(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/fuels/src/cli/commands/withBinaryPaths.ts | packages/fuels/src/cli/commands/withBinaryPaths.ts | import type { Command } from 'commander';
import { loadUserConfig } from '../config/loadConfig';
import type { Commands, UserFuelsConfig } from '../types';
import { debug, error } from '../utils/logger';
type BinaryPaths = Pick<UserFuelsConfig, 'forcPath' | 'fuelCorePath'>;
export function withBinaryPaths<CType exte... | 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/dev/index.test.ts | packages/fuels/src/cli/commands/dev/index.test.ts | import type { FSWatcher } from 'chokidar';
import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { mockStartFuelCore } from '../../../../test/utils/mockAutoStartFuelCore';
import { mockLogger } from '../../../../test/utils/mockLogger';
import { safeExec } from '../../../test-utils';
import * as ... | 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/dev/autoStartFuelCore.test.ts | packages/fuels/src/cli/commands/dev/autoStartFuelCore.test.ts | import { existsSync, rmSync } from 'fs';
import { join } from 'path';
import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import * as testUtilsMod from '../../../test-utils';
import type { FuelsConfig } from '../../types';
import type { FuelCoreNode } from './autoStartFuelCore';
import { autoStartFu... | 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/dev/autoStartFuelCore.ts | packages/fuels/src/cli/commands/dev/autoStartFuelCore.ts | import { defaultConsensusKey } from '@fuel-ts/utils';
import { getPortPromise } from 'portfinder';
import { launchNode } from '../../../test-utils';
import type { FuelsConfig } from '../../types';
import { log, loggingConfig } from '../../utils/logger';
export type FuelCoreNode = {
bindIp: string;
accessIp: strin... | 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/dev/index.ts | packages/fuels/src/cli/commands/dev/index.ts | import type { FSWatcher } from 'chokidar';
import { watch } from 'chokidar';
import { globSync } from 'glob';
import { loadConfig } from '../../config/loadConfig';
import { type FuelsConfig } from '../../types';
import { error, log } from '../../utils/logger';
import { build } from '../build';
import { deploy } 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/node/index.test.ts | packages/fuels/src/cli/commands/node/index.test.ts | import type { FSWatcher } from 'chokidar';
import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { mockStartFuelCore } from '../../../../test/utils/mockAutoStartFuelCore';
import { mockLogger } from '../../../../test/utils/mockLogger';
import * as loadConfigMod from '../../config/loadConfig';
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/commands/node/index.ts | packages/fuels/src/cli/commands/node/index.ts | import { watch, type FSWatcher } from 'chokidar';
import { loadConfig } from '../../config/loadConfig';
import type { FuelsConfig } from '../../types';
import { error, log } from '../../utils/logger';
import type { FuelCoreNode } from '../dev/autoStartFuelCore';
import { autoStartFuelCore } from '../dev/autoStartFuelC... | 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/deploy/index.test.ts | packages/fuels/src/cli/commands/deploy/index.test.ts | import { Wallet } from '@fuel-ts/account';
import { fuelsConfig } from '../../../../test/fixtures/fuels.config';
import { launchTestNode } from '../../../test-utils';
import type { DeployedData } from '../../types';
import { deploy } from '.';
import * as createWalletMod from './createWallet';
import * as saveContrac... | 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/deploy/createWallet.test.ts | packages/fuels/src/cli/commands/deploy/createWallet.test.ts | import { ErrorCode } from '@fuel-ts/errors';
import { expectToThrowFuelError, launchTestNode, safeExec } from '../../../test-utils';
import { createWallet } from './createWallet';
/**
* @group node
*/
describe('createWallet', () => {
const privateKey = '0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245... | 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/deploy/deployScripts.ts | packages/fuels/src/cli/commands/deploy/deployScripts.ts | import { Script } from '@fuel-ts/script';
import { debug, log } from 'console';
import { readFileSync } from 'fs';
import { getBinaryPath, getABIPath, getScriptName } from '../../config/forcUtils';
import type { FuelsConfig, DeployedScript } from '../../types';
import { createWallet } from './createWallet';
/**
* D... | 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/deploy/getDeployConfig.ts | packages/fuels/src/cli/commands/deploy/getDeployConfig.ts | import type { DeployContractOptions } from '@fuel-ts/contract';
import type { ContractDeployOptions, OptionsFunction } from '../../types';
export async function getDeployConfig(
deployConfig: DeployContractOptions | OptionsFunction,
options: ContractDeployOptions
) {
let config: DeployContractOptions;
if (ty... | 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/deploy/saveContractIds.ts | packages/fuels/src/cli/commands/deploy/saveContractIds.ts | import { writeFile, mkdir } from 'fs/promises';
import { resolve } from 'path';
import type { DeployedContract } from '../../types';
import { log } from '../../utils/logger';
export async function saveContractIds(contracts: DeployedContract[], output: string) {
const contractsMap = contracts.reduce(
(cConfig, {... | 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/deploy/deployPredicates.ts | packages/fuels/src/cli/commands/deploy/deployPredicates.ts | import { getPredicateRoot, Predicate } from '@fuel-ts/account';
import { debug, log } from 'console';
import { readFileSync } from 'fs';
import { getABIPath, getBinaryPath, getPredicateName } from '../../config/forcUtils';
import type { DeployedPredicate, FuelsConfig } from '../../types';
import { createWallet } 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/deploy/saveScriptFiles.ts | packages/fuels/src/cli/commands/deploy/saveScriptFiles.ts | import { writeFileSync } from 'fs';
import { getScriptName } from '../../config/forcUtils';
import type { DeployedScript, FuelsConfig } from '../../types';
export function saveScriptFiles(scripts: DeployedScript[], _config: FuelsConfig) {
for (const { path, loaderBytecode, abi } of scripts) {
const scriptName =... | 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/deploy/createWallet.ts | packages/fuels/src/cli/commands/deploy/createWallet.ts | import { Wallet, Provider } from '@fuel-ts/account';
import { FuelError } from '@fuel-ts/errors';
export async function createWallet(providerUrl: string, privateKey?: string) {
let pvtKey: string;
if (privateKey) {
pvtKey = privateKey;
} else if (process.env.PRIVATE_KEY) {
pvtKey = process.env.PRIVATE_K... | 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/deploy/deployContracts.ts | packages/fuels/src/cli/commands/deploy/deployContracts.ts | import type { WalletUnlocked } from '@fuel-ts/account';
import { ContractFactory } from '@fuel-ts/contract';
import type { DeployContractOptions } from '@fuel-ts/contract';
import { Contract } from '@fuel-ts/program';
import { Src14OwnedProxy, Src14OwnedProxyFactory } from '@fuel-ts/recipes';
import { existsSync, readF... | 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/deploy/index.ts | packages/fuels/src/cli/commands/deploy/index.ts | import type { FuelsConfig } from '../../types';
import { generateTypes } from '../build/generateTypes';
import { deployContracts } from './deployContracts';
import { deployPredicates } from './deployPredicates';
import { deployScripts } from './deployScripts';
import { saveContractIds } from './saveContractIds';
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/src/cli/commands/deploy/savePredicateFiles.ts | packages/fuels/src/cli/commands/deploy/savePredicateFiles.ts | import { writeFileSync } from 'fs';
import { getPredicateName } from '../../config/forcUtils';
import type { DeployedPredicate, FuelsConfig } from '../../types';
export function savePredicateFiles(predicates: DeployedPredicate[], _config: FuelsConfig) {
for (const { path, predicateRoot, loaderBytecode, abi } of pre... | 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/deploy/getDeployConfig.test.ts | packages/fuels/src/cli/commands/deploy/getDeployConfig.test.ts | import { getDeployConfig } from './getDeployConfig';
/**
* @group node
*/
describe('getDeployConfig', () => {
test('deploy options as object', async () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const deployConfig: any = { itWorked: true };
const resolved = await getDeployConf... | 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.ts | packages/fuels/src/cli/commands/build/buildSwayPrograms.ts | import type { FuelsConfig } from '../../types';
import { log } from '../../utils/logger';
import { buildSwayProgram } from './buildSwayProgram';
export async function buildSwayPrograms(config: FuelsConfig) {
log(`Building Sway programs using: '${config.forcPath}'`);
const paths = config.workspace
? [config.w... | 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.