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 |
|---|---|---|---|---|---|---|---|---|
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/test-storybooks/yarn-pnp/src/stories/Page.stories.ts | test-storybooks/yarn-pnp/src/stories/Page.stories.ts | import type { Meta, StoryObj } from '@storybook/vue3-vite';
import { expect, userEvent, within } from 'storybook/test';
import MyPage from './Page.vue';
const meta = {
title: 'Example/Page',
component: MyPage,
render: () => ({
components: { MyPage },
template: '<my-page />',
}),
parameters: {
/... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/test-storybooks/yarn-pnp/src/stories/Header.stories.ts | test-storybooks/yarn-pnp/src/stories/Header.stories.ts | import type { Meta, StoryObj } from '@storybook/vue3-vite';
import { fn } from 'storybook/test';
import MyHeader from './Header.vue';
const meta = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/configure/#configure-story-loading
* to learn how to generate automatic titles
*/
tit... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/playwright.config.ts | playwright.config.ts | import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './playwright-tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the sourc... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/vitest.setup-files.ts | vitest.setup-files.ts | import { setupTestMatchers } from '@fuel-ts/utils/test-utils';
import { expect } from 'vitest';
setupTestMatchers(expect);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/vitest.global-browser-setup.ts | vitest.global-browser-setup.ts | /* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-floating-promises */
import { spawn } from 'node:child_process';
export default function setup() {
return new Promise((resolve, reject) => {
const server = {
closed: false,
};
const teardown = async () => {
if (server.clo... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/vitest.workspace.ts | vitest.workspace.ts | import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([
{ extends: './vitest.node.config.mts', test: { name: 'node' } },
{ extends: './vitest.browser.config.mts', test: { name: 'browser' } },
]);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/vitest.global-setup.ts | vitest.global-setup.ts | export default function setup() {
process.env.FUEL_CORE_PATH = 'fuels-core';
}
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/forc-update.ts | scripts/forc-update.ts | #!/usr/bin/env node
import { execSync } from 'child_process';
(() => {
// Update
execSync(`pnpm --filter @internal/forc run update`);
// Remove lockfiles so latest stdlib can be used
execSync(`rm packages/**/Forc.lock`);
// Run all tasks that use Forc
execSync(`pnpm execSync turbo run prebuild --force`)... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/release-deprecate.ts | scripts/release-deprecate.ts | import { compare } from 'compare-versions';
import { exec } from 'node:child_process';
import { readFileSync, readdirSync } from 'node:fs';
import { join } from 'node:path';
const { log, error } = console;
const deprecateTags = /next|pr|rc/;
const { version: currentVersion } = JSON.parse(
readFileSync(join(process.... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/verify-package-exports.ts | scripts/verify-package-exports.ts | import { execSync } from 'child_process';
import { log, error } from 'console';
import { readFileSync } from 'fs';
import { globSync } from 'glob';
import { dirname, join } from 'path';
interface PackageJson {
name: string;
private: boolean;
exports: Record<string, {
require: string;
import: string;
}>... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/tests-coverage-merge.ts | scripts/tests-coverage-merge.ts | import { execSync } from 'child_process';
import { readdirSync, renameSync, rmSync } from 'fs';
import { join } from 'path';
const restructureCoverageDirectory = () => {
const coverageDir = join(__dirname, '../coverage/');
const environmentsDir = join(coverageDir, '/environments/');
const validEnvironments = ['n... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/lint-package-jsons.ts | scripts/lint-package-jsons.ts | import { error } from 'console';
import { readFileSync } from 'fs';
import { globSync } from 'glob';
interface PackageJson {
private: boolean;
author: string;
engines: {
node: string;
};
}
const {
author,
engines: { node },
} = JSON.parse(readFileSync('package.json', 'utf-8')) as PackageJson;
const e... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/postbuild.ts | scripts/postbuild.ts | import { execSync } from 'child_process';
import { error } from 'console';
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
/**
* 1) Emit Declaration Maps
*/
try {
if (existsSync(join(process.cwd(), 'tsconfig.dts.json'))) {
execSync('tsc --emitDeclarationOnly -p tsconf... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/lint-md-links.ts | scripts/lint-md-links.ts | #!/usr/bin/env node
import type { ChildProcessWithoutNullStreams } from 'child_process';
import { execSync, spawn } from 'child_process';
import { globSync } from 'glob';
const { error } = console;
let docsApi: ChildProcessWithoutNullStreams;
let exitCode = 0;
// eslint-disable-next-line no-void
void (async () => {
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/verify-forc-version.ts | scripts/verify-forc-version.ts | import fs from 'fs/promises';
import path from 'path';
(async () => {
const pathToForcVersionFile = path.join(__dirname, '..', 'internal', 'forc', 'VERSION');
const forcVersion = await fs.readFile(pathToForcVersionFile, 'utf-8');
if (forcVersion.indexOf('git:') !== -1) {
throw new Error('Cannot publish from ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/tests-coverage-diff.ts | scripts/tests-coverage-diff.ts | import { diff as coverageDiff } from 'coverage-diff';
import { readFileSync, writeFileSync } from 'fs';
const getDiff = () => {
const base = JSON.parse(readFileSync('coverage-master/coverage-summary.json').toString());
const head = JSON.parse(readFileSync('coverage/report/coverage-summary.json').toString());
ret... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/changeset/changeset-publish.ts | scripts/changeset/changeset-publish.ts | import { execSync } from 'child_process';
const TAG_NAME = process.argv[2];
const REF_NAME = process.argv[3];
const npmTag = REF_NAME === 'master' ? 'latest' : 'patch';
const changesetPublishOutput = execSync(
`pnpm changeset publish --no-git-tag --tag ${npmTag}`
).toString();
// eslint-disable-next-line no-conso... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/scripts/changeset/changeset-version-with-docs.ts | scripts/changeset/changeset-version-with-docs.ts | #!/usr/bin/env node
import { execSync } from 'child_process';
import { error } from 'console';
import { existsSync } from 'fs';
(() => {
try {
/**
* This is the base command that has to run always.
*
* Release CIs were failing when there were only empty changesets
* because we weren't runnin... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-react-vite/vite.config.ts | apps/demo-react-vite/vite.config.ts | import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
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/apps/demo-react-vite/src/App.tsx | apps/demo-react-vite/src/App.tsx | import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";
import * as asm from "@fuels/vm-asm";
import { ZeroBytes32, encrypt, decrypt, FuelAsm } from "fuels";
function App() {
const [count, setCount] = useState(0);
const { log } = console... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-react-vite/src/main.tsx | apps/demo-react-vite/src/main.tsx | import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-react-vite/src/vite-env.d.ts | apps/demo-react-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/apps/demo-wallet-sdk-react/tailwind.config.ts | apps/demo-wallet-sdk-react/tailwind.config.ts | import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-wallet-sdk-react/next-env.d.ts | apps/demo-wallet-sdk-react/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/apps/demo-wallet-sdk-react/src/app/layout.tsx | apps/demo-wallet-sdk-react/src/app/layout.tsx | // #region wallet-sdk-react-provider
"use client";
import { defaultConnectors } from "@fuels/connectors";
import { FuelProvider } from "@fuels/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { Inter } from "next/font/google";
import React from "react";
import "./globals.css";... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-wallet-sdk-react/src/app/page.tsx | apps/demo-wallet-sdk-react/src/app/page.tsx | // #region wallet-sdk-react-ui
"use client";
import {
useAccount,
useBalance,
useConnect,
useConnectors,
useDisconnect,
useIsConnected,
} from "@fuels/react";
import { useState } from "react";
export default function Home() {
const [connector, setConnector] = useState("");
const { connectors } = useC... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-fuels/fuels.config.minimal.ts | apps/demo-fuels/fuels.config.minimal.ts | // #region config
import { createConfig } from 'fuels';
export default createConfig({
workspace: './sway-programs', // forc workspace
output: './src/sway-programs-api',
});
// #endregion config
/**
* Check the docs:
* https://docs.fuel.network/docs/fuels-ts/fuels-cli/config-file/
*/
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-fuels/fuels.config.ts | apps/demo-fuels/fuels.config.ts | import { createConfig } from 'fuels';
export default createConfig({
workspace: './sway-programs', // forc workspace
output: './src/sway-programs-api',
forcPath: 'fuels-forc',
fuelCorePath: 'fuels-core',
});
/**
* Check the docs:
* https://docs.fuel.network/docs/fuels-ts/fuels-cli/config-file/
*/
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-fuels/fuels.config.full.ts | apps/demo-fuels/fuels.config.full.ts | /* eslint-disable no-console */
import { createConfig } from 'fuels';
import type { ContractDeployOptions, DeployedData, FuelsConfig } from 'fuels';
const MY_FIRST_DEPLOYED_CONTRACT_NAME = '';
export default createConfig({
// #region workspace
workspace: './sway-programs',
// #endregion workspace
// #region ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-fuels/src/index.test.ts | apps/demo-fuels/src/index.test.ts | /**
* NOTE: These tests are a copy of the ones at:
* - /apps/demo-typegen/src/demo.test.ts
*
* It ensures that built code is fully working.
*/
import { ErrorCode, FuelError, toHex, Wallet } from 'fuels';
import { expectToThrowFuelError, launchTestNode } from 'fuels/test-utils';
import { SampleFactory, Sample } ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-bun-fuels/fuels.config.ts | apps/demo-bun-fuels/fuels.config.ts | import { createConfig } from 'fuels';
export default createConfig({
workspace: './sway-programs', // forc workspace
output: './src/sway-programs-api',
forcPath: 'fuels-forc',
fuelCorePath: 'fuels-core',
});
/**
* Check the docs:
* https://docs.fuel.network/docs/fuels-ts/fuels-cli/config-file/
*/
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/demo-bun-fuels/src/bun.test.ts | apps/demo-bun-fuels/src/bun.test.ts | /**
* NOTE: These tests are a copy of the ones at:
* - /apps/demo-typegen/src/demo.test.ts
*
* It ensures that built code is fully working.
*/
import { ErrorCode, FuelError, toHex, Wallet } from 'fuels';
import { expectToThrowFuelError, launchTestNode } from 'fuels/test-utils';
import { Sample, SampleFactory } ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/fuels.config.ts | apps/docs/fuels.config.ts | import { createConfig } from 'fuels';
export default createConfig({
workspace: './sway',
output: './src/typegend',
forcBuildFlags: ['--release'],
forcPath: 'fuels-forc',
fuelCorePath: 'fuels-core',
fuelCorePort: 0,
});
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/scripts/test-template.ts | apps/docs/scripts/test-template.ts | /* eslint-disable no-global-assign */
/* eslint-disable @typescript-eslint/ban-ts-comment */
// %IMPORTS%
// @ts-ignore global assignment
const consoleBkp = { ...console };
afterAll(() => {
console = { ...consoleBkp };
});
// %TEST_ENVIRONMENT%
test('%NAME%', /* %TEST_OPTIONS% */ async () => {
// TEST NODE LAUN... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/scripts/launcher-snippet.ts | apps/docs/scripts/launcher-snippet.ts | import { launchTestNode, TestMessage } from 'fuels/test-utils';
using node = await launchTestNode({ walletsConfig: { count: 5, messages: [new TestMessage()] } });
const LOCAL_NETWORK_URL = node.provider.url;
const [w1, w2, w3, w4, w5] = node.wallets;
const WALLET_ADDRESS = w1.address;
const WALLET_PVT_KEY = w1.priv... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/scripts/wrap-snippets.ts | apps/docs/scripts/wrap-snippets.ts | /* eslint-disable @typescript-eslint/naming-convention */
import { readFileSync, writeFileSync } from 'fs';
import { globSync } from 'glob';
import { join, basename, dirname } from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
co... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/env.ts | apps/docs/src/env.ts | export const LOCAL_NETWORK_URL = '<overriden-by-wrapper>';
export const WALLET_ADDRESS = '<overriden-by-wrapper>';
export const WALLET_PVT_KEY = '<overriden-by-wrapper>';
export const WALLET_ADDRESS_2 = '<overriden-by-wrapper>';
export const WALLET_PVT_KEY_2 = '<overriden-by-wrapper>';
export const WALLET_ADDRESS_3 ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/jsonc.d.ts | apps/docs/src/jsonc.d.ts | // informs TS about `.jsonc` file extension
declare module '*.jsonc' {
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/apps/docs/src/versions.data.ts | apps/docs/src/versions.data.ts | import { versions } from '@fuel-ts/versions';
export default {
load() {
const { FORC, FUELS, FUEL_CORE } = versions;
return {
forc: FORC,
fuels: FUELS,
fuelCore: FUEL_CORE,
};
},
};
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/vite.config.ts | apps/docs/src/vite.config.ts | import { SearchPlugin } from 'vitepress-plugin-search';
export default {
plugins: [
SearchPlugin({
tokenize: 'full',
previewLength: 20,
buttonLabel: 'Search',
placeholder: 'Search docs',
}),
],
};
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/script-log-with-contract.ts | apps/docs/src/guide/scripts/snippets/script-log-with-contract.ts | // #region full
import { Provider, Wallet, ZeroBytes32 } from 'fuels';
import { WALLET_PVT_KEY, LOCAL_NETWORK_URL } from '../../../env';
import { LogSimpleFactory, ScriptLogWithContract } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, p... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/script-log-simple.ts | apps/docs/src/guide/scripts/snippets/script-log-simple.ts | // #region full
import { Provider, Wallet } from 'fuels';
import { WALLET_PVT_KEY, LOCAL_NETWORK_URL } from '../../../env';
import { ScriptLogSimple } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const script = new ScriptL... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/script-with-main-args.ts | apps/docs/src/guide/scripts/snippets/script-with-main-args.ts | // #region full
import { bn, Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { ScriptMainArgs } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const foo = 3;
const s... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/initialising-scripts.ts | apps/docs/src/guide/scripts/snippets/initialising-scripts.ts | // #region script-init
import type { BigNumberish } from 'fuels';
import { arrayify, Provider, ReceiptType, ScriptRequest, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { CallTestScript } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
cons... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/script-with-configurable.ts | apps/docs/src/guide/scripts/snippets/script-with-configurable.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { Script, BN, Wallet, Provider } from 'fuels';
import { WALLET_PVT_KEY, LOCAL_NETWORK_URL } from '../../../env';
import { ScriptSum } from '../../../typegend/scripts/ScriptSum';
// #region script-with-configurable-contants-2
const provider ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/script-custom-transaction.ts | apps/docs/src/guide/scripts/snippets/script-custom-transaction.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { BN, ScriptTransactionRequest, coinQuantityfy } from 'fuels';
import { ASSET_A, ASSET_B, launchTestNode } from 'fuels/test-utils';
import { EchoValuesFactory } from '../../../typegend/contracts/EchoValuesFactory';
import { ScriptTransferToC... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/scripts/snippets/deploying-scripts.ts | apps/docs/src/guide/scripts/snippets/deploying-scripts.ts | import { Provider, Wallet, hexlify } from 'fuels';
import { launchTestNode } from 'fuels/test-utils';
import {
ScriptSum as TypegenScript,
ScriptSumLoader as TypegenScriptLoader,
} from '../../../typegend/scripts';
using launched = await launchTestNode();
const {
provider: testProvider,
wallets: [testWallet]... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/checking-balances-two.ts | apps/docs/src/guide/wallets/snippets/checking-balances-two.ts | // #region checking-balances-2
import { Provider, Wallet } from 'fuels';
import { WALLET_PVT_KEY_2, LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const myOtherWallet = Wallet.fromPrivateKey(WALLET_PVT_KEY_2, provider);
const { balances } = await myOtherWallet.getBalances(... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/fuel-instantiation-one.ts | apps/docs/src/guide/wallets/snippets/fuel-instantiation-one.ts | import { Fuel } from 'fuels';
// #region fuel-instantiation-1
const sdk = new Fuel();
/*
Awaits for initialization to mitigate potential race conditions
derived from the async nature of instantiating a connector.
*/
await sdk.init();
// #endregion fuel-instantiation-1
console.log('sdk', sdk);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/unlocked-to-locked.ts | apps/docs/src/guide/wallets/snippets/unlocked-to-locked.ts | // #region wallet-unlocked-to-locked
import type { WalletUnlocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const unlockedWallet: WalletUnlocked = Wallet.generate({ provider });
const newlyLockedWallet... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/encrypting-and-decrypting-wallets.ts | apps/docs/src/guide/wallets/snippets/encrypting-and-decrypting-wallets.ts | // #region encrypting-and-decrypting-json-wallets-1
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.generate({ provider });
// Encrypt the wallet
const password = 'my-password';
const jsonWallet = awa... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/locking-and-unlocking-wallet-manager.ts | apps/docs/src/guide/wallets/snippets/locking-and-unlocking-wallet-manager.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { WalletManager } from 'fuels';
// #region locking-and-unlocking-wallet-manager-1
const password = '0b540281-f87b-49ca-be37-2264c7f260f7';
const walletManager = new WalletManager();
await walletManager.unlock(password);
// #endregion locki... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/fuel-instantiation-options.ts | apps/docs/src/guide/wallets/snippets/fuel-instantiation-options.ts | // #region fuel-options-connectors
import { Fuel, FuelConnector } from 'fuels';
class WalletConnector extends FuelConnector {
public override name: string = 'My Wallet Connector';
}
const defaultConnectors = (_opts: {
devMode: boolean;
}): Array<FuelConnector> => [new WalletConnector()];
const sdkDevMode = await... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/fuel-options-target-object.ts | apps/docs/src/guide/wallets/snippets/fuel-options-target-object.ts | // #region fuel-options-target-object
import { Fuel } from 'fuels';
import type { TargetObject } from 'fuels';
const emptyWindow = {} as unknown as TargetObject;
const targetObject: TargetObject = emptyWindow || document;
const sdkWithTargetObject = await new Fuel({
targetObject,
}).init();
// #endregion fuel-opti... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/fuel-options-storage-local.ts | apps/docs/src/guide/wallets/snippets/fuel-options-storage-local.ts | // #region fuel-options-storage-local
import { Fuel, LocalStorage } from 'fuels';
const window = {
localStorage: {
setItem: vi.fn(),
getItem: vi.fn(),
removeItem: vi.fn(),
clear: vi.fn(),
} as unknown as Storage,
};
const sdkWithLocalStorage = await new Fuel({
storage: new LocalStorage(window.lo... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/locked-to-unlocked.ts | apps/docs/src/guide/wallets/snippets/locked-to-unlocked.ts | // #region wallet-locked-to-unlocked
import type { WalletLocked, WalletUnlocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet: WalletUnlocked = Wallet.generate({ provider });
const PRIVATE_KEY ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/fuel-options-storage-memory.ts | apps/docs/src/guide/wallets/snippets/fuel-options-storage-memory.ts | // #region fuel-options-storage-memory
import { Fuel, MemoryStorage } from 'fuels';
const sdkWithMemoryStorage = await new Fuel({
storage: new MemoryStorage(),
}).init();
// #endregion fuel-options-storage-memory
console.log('sdkWithMemoryStorage', sdkWithMemoryStorage);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/getting-started-with-wallet-manager.ts | apps/docs/src/guide/wallets/snippets/getting-started-with-wallet-manager.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { WalletManager, Wallet, Provider } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
// #region getting-started-with-wallet-manager-1
// Initialize a WalletManager
const walletManager = new WalletManager();
// #endregion get... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/checking-balances.ts | apps/docs/src/guide/wallets/snippets/checking-balances.ts | // #region checking-balances-1
import type { BN } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const myWallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
// The returned amount is a ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/encrypting-and-decrypting-json-wallets-two.ts | apps/docs/src/guide/wallets/snippets/encrypting-and-decrypting-json-wallets-two.ts | // #region encrypting-and-decrypting-json-wallets-2
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const newJsonWallet = await Wallet.generate({
provider,
}).encrypt('my-password');
// Load the encrypted wallet from a f... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-optional-provider.ts | apps/docs/src/guide/wallets/snippets/wallet-optional-provider.ts | // #region wallet-optional-provider
import type { WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
// You can create a wallet, without a provider
let unlockedWalletWithoutProvider: WalletUnlocked = Wallet.generate();
unlockedWalletWithoutProvider = Wallet.fromPrivateKey(
unlockedWalletWithoutProvider.p... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/connectors.ts | apps/docs/src/guide/wallets/snippets/connectors.ts | /* eslint-disable max-classes-per-file */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { MemoryStorage, FuelConnector } from 'fuels';
import type { Network, Asset, FuelABI } from 'fuels';
// prettier-ignore
// #region fuel-connector-extends
class MyWalletConnector extends FuelConnector
// #endregion f... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/access.ts | apps/docs/src/guide/wallets/snippets/access.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
// #region wallets
import type { WalletLocked, WalletUnlocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
// We can use the `generate` to create a new unlocked wallet.
const provider ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-b256-address.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-b256-address.ts | // #region instantiating-wallets-8
import type { B256Address, WalletLocked } from 'fuels';
import { Wallet } from 'fuels';
const address: B256Address = `0x6d309766c0f1c6f103d147b287fabecaedd31beb180d45cf1bf7d88397aecc6f`;
const wallet: WalletLocked = Wallet.fromAddress(address);
// #endregion instantiating-wallets-8
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-mnemonic-phrase.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-mnemonic-phrase.ts | // #region instantiating-wallets-3
import type { WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
const mnemonic =
'section gospel lady april mouse huge prosper boy urge fox tackle orient';
const wallet: WalletUnlocked = Wallet.fromMnemonic(mnemonic);
// #endregion instantiating-wallets-3
console.log... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/connect-existing-wallet.ts | apps/docs/src/guide/wallets/snippets/instantiating/connect-existing-wallet.ts | // #region instantiating-wallets-9
import type { WalletLocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_ADDRESS } from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet: WalletLocked = Wallet.fromAddress(WALLET_ADDRESS);
wallet.connec... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts | apps/docs/src/guide/wallets/snippets/instantiating/unlock-from-private-key.ts | // #region instantiating-wallets-7
import type { WalletLocked, WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
const address =
'0x4cb2b5d2bdbcc8dbdbf91cd00be3e2deedb0ea0f34c969c0ed741a1925111a87';
const privateKey =
'0x9deba03f08676716e3a4247797672d8008a5198d183048be65415ef89447b890';
const lockedW... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/connect-new-wallet.ts | apps/docs/src/guide/wallets/snippets/instantiating/connect-new-wallet.ts | // #region instantiating-wallets-10
import type { WalletLocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_ADDRESS } from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet: WalletLocked = Wallet.fromAddress(WALLET_ADDRESS, provider);
//... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-wallet.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-wallet.ts | // #region wallet-from-private-key
import type { WalletLocked, WalletUnlocked } from 'fuels';
import { Provider, Wallet } from 'fuels';
import {
LOCAL_NETWORK_URL,
WALLET_ADDRESS,
WALLET_PVT_KEY,
} from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
// Generate a locked wallet
const locke... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-json-wallet.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-json-wallet.ts | // #region instantiating-wallets-6
import type { WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
const jsonWallet = `{"id":"83d1792f-3230-496a-92af-3b44a1524fd6","version":3,"address":"ada436e1b80f855f94d678771c384504e46335f571aa244f11b5a70fe3e61644","crypto":{"cipher":"aes-128-ctr","mac":"6911499ec31a6... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-hd-derived-key.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-hd-derived-key.ts | // #region instantiating-wallets-5
import type { WalletUnlocked } from 'fuels';
import { HDWallet, Wallet } from 'fuels';
const seed =
'0xa5d42fd0cf8825fc846b2f257887a515573ee5b779e99f060dc945b3d5504bca';
const extendedKey = HDWallet.fromSeed(seed).toExtendedKey();
const wallet: WalletUnlocked = Wallet.fromExtende... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/signer.ts | apps/docs/src/guide/wallets/snippets/instantiating/signer.ts | // #region signer-address
import { Signer } from 'fuels';
import { WALLET_PVT_KEY } from '../../../../env';
const signer = new Signer(WALLET_PVT_KEY);
// #endregion signer-address
console.log('Signer should be defined', signer);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-private-key.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-private-key.ts | // #region instantiating-wallets-2
import type { WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
const privateKey =
'0x36ca81ba70f3e04b7cc8780bff42d907ebca508097d4ae3df5147c93fd217f7c';
const wallet: WalletUnlocked = Wallet.fromPrivateKey(privateKey);
// #endregion instantiating-wallets-2
console.lo... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/from-seed.ts | apps/docs/src/guide/wallets/snippets/instantiating/from-seed.ts | // #region instantiating-wallets-4
import type { WalletUnlocked } from 'fuels';
import { Wallet } from 'fuels';
const seed =
'0xa5d42fd0cf8825fc846b2f257887a515573ee5b779e99f060dc945b3d5504bca';
const wallet: WalletUnlocked = Wallet.fromSeed(seed);
// #endregion instantiating-wallets-4
console.log('Wallet should b... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/instantiating/generate.ts | apps/docs/src/guide/wallets/snippets/instantiating/generate.ts | // #region instantiating-wallets-1
import { Wallet } from 'fuels';
import type { WalletUnlocked } from 'fuels';
const wallet: WalletUnlocked = Wallet.generate();
// #endregion instantiating-wallets-1
console.log('Wallet should be defined', wallet);
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-transferring/between-accounts.ts | apps/docs/src/guide/wallets/snippets/wallet-transferring/between-accounts.ts | // #region transferring-assets-1
import { Provider, Wallet } from 'fuels';
import {
LOCAL_NETWORK_URL,
WALLET_PVT_KEY,
WALLET_PVT_KEY_2,
} from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const baseAssetId = await provider.getBaseAssetId();
const sender = Wallet.fromPrivateKey(WALLET_P... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-transferring/transferring-to-contracts.ts | apps/docs/src/guide/wallets/snippets/wallet-transferring/transferring-to-contracts.ts | // #region transferring-assets-4
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
import { CounterFactory } from '../../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-transferring/create-transfer.ts | apps/docs/src/guide/wallets/snippets/wallet-transferring/create-transfer.ts | // #region transferring-assets-2
import { Provider, Wallet } from 'fuels';
import {
LOCAL_NETWORK_URL,
WALLET_PVT_KEY,
WALLET_PVT_KEY_2,
} from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const destination = Wallet.fromPriv... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-transferring/transferring-to-multiple-contracts.ts | apps/docs/src/guide/wallets/snippets/wallet-transferring/transferring-to-multiple-contracts.ts | // #region transferring-assets-5
import type { ContractTransferParams } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { TestAssetId } from 'fuels/test-utils';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
import { CounterFactory, EchoValuesFactory } from '../../../../typegend';
... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/wallet-transferring/create-transfer-2.ts | apps/docs/src/guide/wallets/snippets/wallet-transferring/create-transfer-2.ts | // #region transferring-assets-3
import { bn, Provider, Wallet } from 'fuels';
import {
LOCAL_NETWORK_URL,
WALLET_PVT_KEY,
WALLET_PVT_KEY_2,
} from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const destination = Wallet.from... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/transfers/batch-transfer.ts | apps/docs/src/guide/wallets/snippets/transfers/batch-transfer.ts | // #region wallet-transferring-6
import type { TransferParams } from 'fuels';
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const baseAssetId = await provider.getBaseAssetId();
const sender = Wallet.fro... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/signing/sign-personal-message.ts | apps/docs/src/guide/wallets/snippets/signing/sign-personal-message.ts | import { hashMessage, Signer, WalletUnlocked } from 'fuels';
const wallet = WalletUnlocked.generate();
// #region signing-personal-message
const message: string | Uint8Array = Uint8Array.from([0x01, 0x02, 0x03]);
const signedMessage = await wallet.signMessage({ personalSign: message });
// Example output: 0x0ca4ca2a0... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/signing/fund-transaction.ts | apps/docs/src/guide/wallets/snippets/signing/fund-transaction.ts | // #region signing-3
import { Address, Provider, ScriptTransactionRequest, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const receiverAddress = Address.fromR... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/signing/sign-message.ts | apps/docs/src/guide/wallets/snippets/signing/sign-message.ts | // #region signing-1
import { hashMessage, Signer, WalletUnlocked } from 'fuels';
const wallet = WalletUnlocked.generate();
const message: string = 'my-message';
const signedMessage = await wallet.signMessage(message);
// Example output: 0x277e1461cbb2e6a3250fa8c490221595efb3f4d66d43a4618d1013ca61ca56ba
const hashed... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/signing/sign-transaction.ts | apps/docs/src/guide/wallets/snippets/signing/sign-transaction.ts | // #region signing-2
import {
Address,
Provider,
ScriptTransactionRequest,
Signer,
Wallet,
} from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const sender = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
const receiverAddr... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/mnemonic/from-mnemonic-phrases-2.ts | apps/docs/src/guide/wallets/snippets/mnemonic/from-mnemonic-phrases-2.ts | import { Wallet } from 'fuels';
// #region snippet-full
const mnemonic =
'oblige salon price punch saddle immune slogan rare snap desert retire surprise';
const path = "m/44'/60'/1'/0/0";
const wallet = Wallet.fromMnemonic(mnemonic, path);
// #endregion snippet-full
console.log('wallet', wallet);
/**
* @group n... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/wallets/snippets/mnemonic/from-mnemonic-phrases-1.ts | apps/docs/src/guide/wallets/snippets/mnemonic/from-mnemonic-phrases-1.ts | import { Wallet } from 'fuels';
// #region snippet-full
const mnemonic =
'oblige salon price punch saddle immune slogan rare snap desert retire surprise';
const wallet = Wallet.fromMnemonic(mnemonic);
// #endregion snippet-full
console.log('wallet', wallet);
/**
* @group node
*/
| typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/encoding/snippets/working-with-bytes.ts | apps/docs/src/guide/encoding/snippets/working-with-bytes.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { randomBytes } from 'crypto';
import {
ArrayCoder,
B256Coder,
B512Coder,
BigNumberCoder,
BooleanCoder,
EnumCoder,
NumberCoder,
RawSliceCoder,
StdStringCoder,
StringCoder,
StructCoder,
TupleCoder,
VecCoder,
hexlify... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/encoding/snippets/encode-and-decode.ts | apps/docs/src/guide/encoding/snippets/encode-and-decode.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import type { JsonAbi, TransactionResultReturnDataReceipt } from 'fuels';
import {
buildFunctionResult,
ReceiptType,
arrayify,
Script,
Interface,
Provider,
Wallet,
} from 'fuels';
// #region encode-and-decode-3
import { LOCAL_NETWORK_... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/getting-started/snippets/connecting-to-the-network.ts | apps/docs/src/guide/getting-started/snippets/connecting-to-the-network.ts | // #region main
import { Provider } from 'fuels';
const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql';
const provider = new Provider(NETWORK_URL);
const baseAssetId = await provider.getBaseAssetId();
const chainId = await provider.getChainId();
const gasConfig = await provider.getGasConfig();
console.log(... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/getting-started/snippets/connecting-to-testnet.ts | apps/docs/src/guide/getting-started/snippets/connecting-to-testnet.ts | // #region main
import { Provider, Wallet } from 'fuels';
const ADDRESS =
'0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f';
const provider = new Provider('https://testnet.fuel.network/v1/graphql');
const wallet = Wallet.fromAddress(ADDRESS, provider);
const { balances } = await wallet.getBalanc... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/getting-started/snippets/connecting-to-localnode.ts | apps/docs/src/guide/getting-started/snippets/connecting-to-localnode.ts | // #region main
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const ADDRESS =
'0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromAddress(ADDRESS, provider);
const { balances... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/creating-a-fuel-dapp/snippets/decrement-counter.ts | apps/docs/src/guide/creating-a-fuel-dapp/snippets/decrement-counter.ts | /* eslint-disable @typescript-eslint/no-unused-vars */
// #region full
import { Wallet, Provider } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { CounterFactory } from '../../../typegend/contracts';
// Let's create our provider from the network URL.
const provider = new Provi... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/splitting-utxos.ts | apps/docs/src/guide/cookbook/snippets/splitting-utxos.ts | // #region splitting-utxos
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const baseAssetId = await provider.getBaseAssetId();
// This is the wallet that will fund the sending wallet
const fundingWallet = Wa... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/fake-resources.ts | apps/docs/src/guide/cookbook/snippets/fake-resources.ts | // #region generate-fake-resources-2
import type { TransactionResultReturnDataReceipt } from 'fuels';
import {
bn,
Provider,
ReceiptType,
ScriptTransactionRequest,
Wallet,
} from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { ReturnScript } from '../../../typegend';
cons... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/custom-contract-calls.ts | apps/docs/src/guide/cookbook/snippets/custom-contract-calls.ts | // #region custom-transactions-contract-calls
import { bn, buildFunctionResult, Contract, Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { CounterFactory } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const baseAssetId = await p... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/signature-script.ts | apps/docs/src/guide/cookbook/snippets/signature-script.ts | // #region combining-utxos
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
import { ScriptSigning } from '../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const signer = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
// #region signat... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/combining-utxos.ts | apps/docs/src/guide/cookbook/snippets/combining-utxos.ts | import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);
// Creating multiple UTXOs for the consolidation
for (let i = 0; i < 10; i++) {
const initTx ... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/max-outputs.ts | apps/docs/src/guide/cookbook/snippets/max-outputs.ts | // #region max-outputs
import { Provider } from 'fuels';
import { LOCAL_NETWORK_URL } from '../../../env';
const provider = new Provider(LOCAL_NETWORK_URL);
const { maxInputs, maxOutputs } = (await provider.getChain())
.consensusParameters.txParameters;
// #endregion max-outputs
console.log('Max Inputs', maxInput... | typescript | Apache-2.0 | 9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2 | 2026-01-04T15:46:46.933446Z | false |
FuelLabs/fuels-ts | https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/apps/docs/src/guide/cookbook/snippets/deposit-and-withdraw/withdraw.ts | apps/docs/src/guide/cookbook/snippets/deposit-and-withdraw/withdraw.ts | // #region deposit-and-withdraw-cookbook-3
import { Provider, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
import { LiquidityPoolFactory } from '../../../../typegend';
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, ... | 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.