repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/VoidCoder.test.ts
packages/abi-coder/src/encoding/coders/VoidCoder.test.ts
import { VoidCoder } from './VoidCoder'; /** * @group node * @group browser */ describe('VoidCoder', () => { it('should have properties', () => { const coder = new VoidCoder(); expect(coder.name).toEqual('void'); expect(coder.type).toEqual('()'); expect(coder.encodedLength).toEqual(0); }); de...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/TupleCoder.ts
packages/abi-coder/src/encoding/coders/TupleCoder.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { concatBytes } from '@fuel-ts/utils'; import { hasNestedOption } from '../../utils/utilities'; import type { TypesOfCoder } from './AbstractCoder'; import { Coder } from './AbstractCoder'; type InputValueOf<TCoders extends Coder[]> = { [P in keyof TCo...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/VecCoder.test.ts
packages/abi-coder/src/encoding/coders/VecCoder.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { arrayify } from '@fuel-ts/utils'; import { U32_MAX } from '../../../test/utils/constants'; import { BooleanCoder } from './BooleanCoder'; import { NumberCoder } from './NumberCoder'; i...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/index.ts
packages/abi-coder/src/encoding/coders/index.ts
export { ArrayCoder } from './ArrayCoder'; export { B256Coder } from './B256Coder'; export { B512Coder } from './B512Coder'; export { BigNumberCoder } from './BigNumberCoder'; export { BooleanCoder } from './BooleanCoder'; export { ByteCoder } from './ByteCoder'; export { EnumCoder } from './EnumCoder'; export { Number...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/StdStringCoder.test.ts
packages/abi-coder/src/encoding/coders/StdStringCoder.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { StdStringCoder } from './StdStringCoder'; /** * @group node * @group browser */ describe('StdStringCoder', () => { const coder = new StdStringCoder(); it('should encode an empty...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/TupleCoder.test.ts
packages/abi-coder/src/encoding/coders/TupleCoder.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { bn } from '@fuel-ts/math'; import { U64_MAX } from '../../../test/utils/constants'; import { BigNumberCoder } from './BigNumberCoder'; import { BooleanCoder } from './BooleanCoder'; 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/abi-coder/src/encoding/coders/NumberCoder.ts
packages/abi-coder/src/encoding/coders/NumberCoder.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { toNumber, toBytes } from '@fuel-ts/math'; import type { EncodingOptions } from '../../types/EncodingOptions'; import { WORD_SIZE } from '../../utils/constants'; import { Coder } from './AbstractCoder'; type NumberCoderType = 'u8' | 'u16' | 'u32'; cons...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/StructCoder.ts
packages/abi-coder/src/encoding/coders/StructCoder.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { concatBytes } from '@fuel-ts/utils'; import { hasNestedOption } from '../../utils/utilities'; import type { TypesOfCoder } from './AbstractCoder'; import { Coder } from './AbstractCoder'; import { OptionCoder } from './OptionCoder'; type InputValueOf<T...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/coders/AbstractCoder.ts
packages/abi-coder/src/encoding/coders/AbstractCoder.ts
import type { BN } from '@fuel-ts/math'; import type { BytesLike } from '@fuel-ts/utils'; import type { Option } from './OptionCoder'; type Primitive = string | number | boolean; /** * The type of value you can provide to `Coder.encode` */ export type InputValue<T = void> = | Primitive | BN | Option<T> | B...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/strategies/getCoderForEncoding.ts
packages/abi-coder/src/encoding/strategies/getCoderForEncoding.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { GetCoderFn } from '../../types/GetCoder'; import type { EncodingVersion } from '../../utils/constants'; import { ENCODING_V1 } from '../../utils/constants'; import { getCoder as getCoderV1 } from './getCoderV1'; /** * Retrieves the appropriate en...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/strategies/getCoders.test.ts
packages/abi-coder/src/encoding/strategies/getCoders.test.ts
import type { ResolvedAbiType } from '../../ResolvedAbiType'; import type { EncodingOptions } from '../../types/EncodingOptions'; import type { GetCoderFn } from '../../types/GetCoder'; import { Coder } from '../coders/AbstractCoder'; import { getCoders } from './getCoders'; const coderName = 'mock'; class MockCoder...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/strategies/getCoders.ts
packages/abi-coder/src/encoding/strategies/getCoders.ts
import type { ResolvedAbiType } from '../../ResolvedAbiType'; import type { EncodingOptions } from '../../types/EncodingOptions'; import type { GetCoderFn } from '../../types/GetCoder'; import type { Coder } from '../coders/AbstractCoder'; /** * @param components - types array to create coders for. * @param options ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/strategies/getCoderForEncoding.test.ts
packages/abi-coder/src/encoding/strategies/getCoderForEncoding.test.ts
import type { EncodingVersion } from '../../utils/constants'; import { ENCODING_V1 } from '../../utils/constants'; import { getCoderForEncoding } from './getCoderForEncoding'; import { getCoder as getCoderV1 } from './getCoderV1'; /** * @group node * @group browser */ describe('getEncodingStrategy', () => { it('...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/encoding/strategies/getCoderV1.ts
packages/abi-coder/src/encoding/strategies/getCoderV1.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { ResolvedAbiType } from '../../ResolvedAbiType'; import type { EncodingOptions } from '../../types/EncodingOptions'; import type { GetCoderFn } from '../../types/GetCoder'; import { B256_CODER_TYPE, B512_CODER_TYPE, BOOL_CODER_TYPE, BYTES_CODER_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/abi-coder/src/utils/getFunctionInputs.ts
packages/abi-coder/src/utils/getFunctionInputs.ts
import type { JsonAbiOld, JsonAbiArgument } from '../types/JsonAbi'; import { optionRegEx, VOID_TYPE } from './constants'; import { findTypeById } from './json-abi'; export type FunctionInput<TArg extends JsonAbiArgument = JsonAbiArgument> = TArg & { isOptional: boolean; }; export const getFunctionInputs = (params...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/json-abi.ts
packages/abi-coder/src/utils/json-abi.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { ResolvedAbiType } from '../ResolvedAbiType'; import type { JsonAbiOld, JsonAbiArgument, JsonAbiType } from '../types/JsonAbi'; import type { AbiFunction, JsonAbi } from '../types/JsonAbiNew'; import { ENCODING_V1, VOID_TYPE, type EncodingVersion } ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/getFunctionInputs.test.ts
packages/abi-coder/src/utils/getFunctionInputs.test.ts
import type { JsonAbiArgument, JsonAbiOld, JsonAbiType } from '../types/JsonAbi'; import { getFunctionInputs } from './getFunctionInputs'; const nonEmptyType: JsonAbiType = { type: 'u8', typeId: 1, components: null, typeParameters: null, }; const voidAbiType: JsonAbiType = { type: '()', typeId: 2, comp...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/padValuesWithUndefined.ts
packages/abi-coder/src/utils/padValuesWithUndefined.ts
import type { InputValue } from '../encoding/coders/AbstractCoder'; export const padValuesWithUndefined = (values: InputValue[], inputs: ArrayLike<unknown>) => { if (values.length >= inputs.length) { return values; } const paddedValues = values.slice(); paddedValues.length = inputs.length; paddedValues....
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/utilities.test.ts
packages/abi-coder/src/utils/utilities.test.ts
import { OPTION_CODER_TYPE } from './constants'; import { hasNestedOption, type TCoders } from './utilities'; /** * @group node * @group browser */ describe('findNestedOption', () => { it('finds a deeply nested option - true', () => { const coders: TCoders = { DeepEnum: { name: 'DeepEnum', ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/utilities.ts
packages/abi-coder/src/utils/utilities.ts
import type { Coder } from '../encoding/coders/AbstractCoder'; import { OPTION_CODER_TYPE, WORD_SIZE } from './constants'; /** * Turns: Uint8Array(24) [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 24 ] Into: Array [ Uint8Array(8) [ 0, 0, 0, 0, 0, 0, 0, 1 ], Uin...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/constants.ts
packages/abi-coder/src/utils/constants.ts
/** * Types and Type Regex */ export const U8_CODER_TYPE = 'u8'; export const U16_CODER_TYPE = 'u16'; export const U32_CODER_TYPE = 'u32'; export const U64_CODER_TYPE = 'u64'; export const U256_CODER_TYPE = 'u256'; export const RAW_PTR_CODER_TYPE = 'raw untyped ptr'; export const RAW_SLICE_CODER_TYPE = 'raw untyped s...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/json-abi.test.ts
packages/abi-coder/src/utils/json-abi.test.ts
import type { ResolvedAbiType } from '../ResolvedAbiType'; import type { JsonAbiArgument } from '../types/JsonAbi'; import { ENCODING_V1 } from './constants'; import { findFunctionByName, findNonVoidInputs, findTypeById, findVectorBufferArgument, getEncodingVersion, } from './json-abi'; import { transpileAbi...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/transpile-abi.ts
packages/abi-coder/src/utils/transpile-abi.ts
/* eslint-disable no-restricted-globals */ /* eslint-disable no-param-reassign */ /* eslint-disable @typescript-eslint/no-use-before-define */ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-nocheck const findTypeByConcreteId = (types, id) => types.find((x) => x.concreteTypeId === id); const find...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/types.ts
packages/abi-coder/src/utils/types.ts
export type Bytes = Uint8Array | number[]; export type RawSlice = Uint8Array | number[]; export type StdString = string; export type StrSlice = 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/abi-coder/src/utils/padValuesWithUndefined.test.ts
packages/abi-coder/src/utils/padValuesWithUndefined.test.ts
import type { InputValue } from '../encoding/coders/AbstractCoder'; import type { JsonAbiArgument } from '../types/JsonAbi'; import { padValuesWithUndefined } from './padValuesWithUndefined'; const MOCK_INPUT: JsonAbiArgument = { name: 'test', type: 0, typeArguments: [], }; /** * @group node * @group browser...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/utils/scriptData.ts
packages/abi-coder/src/utils/scriptData.ts
import type { BN } from '@fuel-ts/math'; import { Interface } from '../Interface'; import { B256Coder } from '../encoding/coders/B256Coder'; import { BigNumberCoder } from '../encoding/coders/BigNumberCoder'; import { StdStringCoder } from '../encoding/coders/StdStringCoder'; import type { JsonAbi } from '../types/Jso...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/types/EncodingOptions.ts
packages/abi-coder/src/types/EncodingOptions.ts
import type { EncodingVersion } from '../utils/constants'; /** * These are configurable options to be used when encoding. * * Firstly we should consider the encoding version being used. For more info on this * please refer to the fuel specs (https://github.com/FuelLabs/fuel-specs); * * Encoding Version 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/abi-coder/src/types/JsonAbiNew.ts
packages/abi-coder/src/types/JsonAbiNew.ts
/** * Types for Fuel JSON ABI Format as defined on: * https://github.com/FuelLabs/fuel-specs/blob/master/src/abi/json-abi-format.md */ export interface JsonAbi { readonly specVersion: string; readonly encodingVersion: string; readonly programType: string; readonly concreteTypes: readonly ConcreteType[]; re...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/types/GetCoder.ts
packages/abi-coder/src/types/GetCoder.ts
import type { ResolvedAbiType } from '../ResolvedAbiType'; import type { Coder } from '../encoding/coders/AbstractCoder'; import type { EncodingOptions } from './EncodingOptions'; /** * A function that can be used to obtain spec adhering coders. * * @param resolvedAbiType - the resolved type to return a coder for....
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/src/types/JsonAbi.ts
packages/abi-coder/src/types/JsonAbi.ts
/** * Types for Fuel JSON ABI Format as defined on: * https://github.com/FuelLabs/fuel-specs/blob/b40d87d2515727188b9ae2dd23602316c50519c0/src/abi/json-abi-format.md */ export interface JsonAbiOld { readonly types: readonly JsonAbiType[]; readonly loggedTypes: readonly JsonAbiLoggedType[]; readonly functions: ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/test/Interface.test.ts
packages/abi-coder/test/Interface.test.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import { FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import type { BN } from '@fuel-ts/math'; import { concat } from '@fuel-ts/utils'; import { Interface } from '../src/Interface'; import type { AbiFunc...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/test/fixtures/forc-projects/index.ts
packages/abi-coder/test/fixtures/forc-projects/index.ts
import { getForcProject } from '@fuel-ts/utils/test-utils'; import { join } from 'path'; import type { JsonAbi } from '../../../src'; export enum AbiCoderProjectsEnum { EXHAUSTIVE_EXAMPLES = 'exhaustive-examples', } export const getCoderForcProject = ( project: AbiCoderProjectsEnum, build: 'release' | 'debug' ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-coder/test/utils/constants.ts
packages/abi-coder/test/utils/constants.ts
import { bn } from '@fuel-ts/math'; export const U8_MAX = 2 ** 8 - 1; export const U8_MAX_ENCODED = new Uint8Array([255]); export const U8_MIN_ENCODED = new Uint8Array([0]); export const U16_MAX = 2 ** 16 - 1; export const U16_MAX_ENCODED = new Uint8Array([255, 255]); export const U16_MIN_ENCODED = new Uint8Array([0, ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/tsup.config.ts
packages/create-fuels/tsup.config.ts
import { binAndCli } from '@internal/tsup'; export default binAndCli;
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/scripts/prepublish.ts
packages/create-fuels/scripts/prepublish.ts
import { spawnSync } from 'child_process'; import { join } from 'path'; import { rewriteTemplateFiles } from '../src/lib/rewriteTemplateFiles'; import { templates } from '../src/lib/setupProgram'; // Copy over the workspace templates const workspaceDir = join('../..'); const workspaceTemplates = join(workspaceDir, 't...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/cli.ts
packages/create-fuels/src/cli.ts
import { FuelError } from '@fuel-ts/errors'; import { versions } from '@fuel-ts/versions'; import toml from '@iarna/toml'; import chalk from 'chalk'; import { execSync } from 'child_process'; import type { Command } from 'commander'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import { cp, mkdir, rena...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib.ts
packages/create-fuels/src/lib.ts
export * from './lib/createIfFuelUpInstalled'; export * from './lib/installFuelUp'; export * from './lib/tryInstallFuelUp';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/bin.ts
packages/create-fuels/src/bin.ts
import chalk from 'chalk'; import { log } from 'console'; import { runScaffoldCli, setupProgram } from './cli'; runScaffoldCli({ program: setupProgram(), args: process.argv, }) .then(() => process.exit(0)) .catch((e) => { log(chalk.red(e)); 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/create-fuels/src/utils/logger.ts
packages/create-fuels/src/utils/logger.ts
import chalk from 'chalk'; export const loggingConfig = { isDebugEnabled: false, isLoggingEnabled: true, }; export function configureLogging(params: { isDebugEnabled: boolean; isLoggingEnabled: boolean }) { loggingConfig.isLoggingEnabled = params.isLoggingEnabled; loggingConfig.isDebugEnabled = params.isDebug...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/utils/logger.test.ts
packages/create-fuels/src/utils/logger.test.ts
import chalk from 'chalk'; import * as loggerMod from './logger'; import { configureLogging, debug, error, log, loggingConfig, warn } from './logger'; /** * @group node */ describe('logger', () => { const loggingBackup = structuredClone(loggingConfig); beforeEach(() => { configureLogging(loggingBackup); ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/prompts/promptForProjectPath.test.ts
packages/create-fuels/src/prompts/promptForProjectPath.test.ts
import * as promptsMod from 'prompts'; import { promptForProjectPath } from './promptForProjectPath'; vi.mock('prompts', async () => { const mod = await vi.importActual('prompts'); return { __esModule: true, ...mod, }; }); const mockPrompts = (params: { results: unknown[] }) => { promptsMod.default.i...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/prompts/promptFuelUpInstall.ts
packages/create-fuels/src/prompts/promptFuelUpInstall.ts
import prompts from 'prompts'; export const promptFuelUpInstall = async () => { const shouldInstallFuelUp = await prompts( { type: 'confirm', name: 'shouldInstallFuelUp', message: `It seems you don't have 'fuelup' installed. 'fuelup' is required to manage the Fuel toolchain and is a prerequisit...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/prompts/promptFuelUpInstall.test.ts
packages/create-fuels/src/prompts/promptFuelUpInstall.test.ts
import * as promptsMod from 'prompts'; import { promptFuelUpInstall } from './promptFuelUpInstall'; vi.mock('prompts', async () => { const mod = await vi.importActual('prompts'); return { __esModule: true, ...mod, }; }); const mockPrompts = (params: { results: unknown[] }) => { promptsMod.default.inj...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/prompts/index.ts
packages/create-fuels/src/prompts/index.ts
export * from './promptFuelUpInstall'; export * from './promptForProjectPath';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/prompts/promptForProjectPath.ts
packages/create-fuels/src/prompts/promptForProjectPath.ts
import prompts from 'prompts'; export const promptForProjectPath = async () => { const res = await prompts( { type: 'text', name: 'projectName', message: 'What is the name of your project?', initial: 'my-fuel-project', }, { onCancel: () => process.exit(0) } ); return res.proj...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/tryInstallFuelUp.test.ts
packages/create-fuels/src/lib/tryInstallFuelUp.test.ts
import * as oraMod from 'ora'; import { mockLogger } from '../../test/utils/mockLogger'; import * as promptFuelUpInstallMod from '../prompts/promptFuelUpInstall'; import * as checkIfFuelUpInstalledMod from './createIfFuelUpInstalled'; import * as installFuelUpMod from './installFuelUp'; import { tryInstallFuelUp } fr...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/setupProgram.ts
packages/create-fuels/src/lib/setupProgram.ts
import { Command } from 'commander'; import packageJson from '../../package.json'; export type Template = 'nextjs' | 'vite'; export const templates: Set<Template> = new Set(['nextjs', 'vite']); export const defaultTemplate: Template = 'vite'; export interface ProgramOptions { contract?: boolean; predicate?: bool...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/getPackageManager.test.ts
packages/create-fuels/src/lib/getPackageManager.test.ts
import { mockLogger } from '../../test/utils/mockLogger'; import type { PackageManager } from './getPackageManager'; import { availablePackageManagers, getPackageManager, packageMangers } from './getPackageManager'; const installScenarios: [PackageManager, string][] = [ ['pnpm', 'pnpm install'], ['npm', 'npm inst...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/doesTemplateExist.ts
packages/create-fuels/src/lib/doesTemplateExist.ts
import type { Template } from './setupProgram'; import { templates } from './setupProgram'; export const doesTemplateExist = (templateName: Template): boolean => templates.has(templateName);
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/doesTemplateExist.test.ts
packages/create-fuels/src/lib/doesTemplateExist.test.ts
import { doesTemplateExist } from './doesTemplateExist'; /** * @group node */ test('doesTemplateExist should return true if the template exists', () => { expect(doesTemplateExist('nextjs')).toBeTruthy(); }); test('doesTemplateExist should return false if the template does not exist', () => { // @ts-expect-error...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts
packages/create-fuels/src/lib/rewriteTemplateFiles.test.ts
import { readFileSync } from 'fs'; import { join } from 'path'; import { bootstrapProject, cleanupFilesystem, copyTemplate, resetFilesystem, type ProjectPaths, } from '../../test/utils/bootstrapProject'; import { rewriteTemplateFiles } from './rewriteTemplateFiles'; vi.mock('@fuel-ts/versions', () => ({ ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/installFuelUp.ts
packages/create-fuels/src/lib/installFuelUp.ts
import { execSync } from 'child_process'; import ora from 'ora'; import { log, error } from '../utils/logger'; export const installFuelUp = (isVerbose: boolean = false) => { const installFuelUpSpinner = ora({ text: 'Installing fuelup..', color: 'green', }); try { execSync(`curl https://install.fuel....
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/setupProgram.test.ts
packages/create-fuels/src/lib/setupProgram.test.ts
import { setupProgram } from './setupProgram'; /** * @group node */ describe('setupProgram', () => { test('setupProgram takes in args properly', () => { const program = setupProgram(); program.parse(['', '', 'test-project-name', '--template', 'nextjs']); expect(program.args[0]).toBe('test-project-name'...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/getPackageManager.ts
packages/create-fuels/src/lib/getPackageManager.ts
import { warn } from '../utils/logger'; export const availablePackageManagers = ['pnpm', 'npm', 'bun'] as const; export type PackageManager = (typeof availablePackageManagers)[number]; const runnableApplicator = (commandPrefix: string) => (command: string = '') => `${commandPrefix} ${command}`; export const ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/rewriteTemplateFiles.ts
packages/create-fuels/src/lib/rewriteTemplateFiles.ts
import { versions } from '@fuel-ts/versions'; import { readFileSync, writeFileSync } from 'fs'; import { join } from 'path'; export const rewriteTemplateFiles = (templateDir: string) => { const packageJsonFilePath = join(templateDir, 'package.json'); const fuelsConfigFilePath = join(templateDir, 'fuels.config.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/create-fuels/src/lib/tryInstallFuelUp.ts
packages/create-fuels/src/lib/tryInstallFuelUp.ts
import ora from 'ora'; import { promptFuelUpInstall } from '../prompts'; import { warn } from '../utils/logger'; import { checkIfFuelUpInstalled } from './createIfFuelUpInstalled'; import { installFuelUp } from './installFuelUp'; export const tryInstallFuelUp = async (isVerbose: boolean = false) => { const fuelUpS...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/createIfFuelUpInstalled.ts
packages/create-fuels/src/lib/createIfFuelUpInstalled.ts
import { execSync } from 'child_process'; export const checkIfFuelUpInstalled = () => { try { execSync('fuelup --version', { stdio: 'pipe' }); return true; } catch (error) { return false; } };
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/installFuelUp.test.ts
packages/create-fuels/src/lib/installFuelUp.test.ts
import * as childProcessMod from 'child_process'; import * as oraMod from 'ora'; import { installFuelUp } from './installFuelUp'; vi.mock('child_process', async () => { const mod = await vi.importActual('child_process'); return { __esModule: true, ...mod, }; }); vi.mock('ora', async () => { const mod...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/getPackageVersion.test.ts
packages/create-fuels/src/lib/getPackageVersion.test.ts
import { versions } from '@fuel-ts/versions'; import * as fsMod from 'fs'; import * as pathMod from 'path'; import { getPackageVersion } from './getPackageVersion'; vi.mock('fs', async () => { const mod = await vi.importActual('fs'); return { __esModule: true, ...mod, }; }); vi.mock('path', async () =>...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/createIfFuelUpInstalled.test.ts
packages/create-fuels/src/lib/createIfFuelUpInstalled.test.ts
import * as childProcessMod from 'child_process'; import { checkIfFuelUpInstalled } from './createIfFuelUpInstalled'; vi.mock('child_process', async () => { const mod = await vi.importActual('child_process'); return { __esModule: true, ...mod, }; }); const mockAllDeps = (params: { version: string; shou...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/src/lib/getPackageVersion.ts
packages/create-fuels/src/lib/getPackageVersion.ts
import { FuelError } from '@fuel-ts/errors'; import { versions } from '@fuel-ts/versions'; import { existsSync, readFileSync } from 'fs'; import { dirname, join } from 'path'; /** * Get the current version from the create fuels package.json * * @param args - process.argv * @returns the version of the create fuels ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/integration.test.ts
packages/create-fuels/test/integration.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import { execSync } from 'child_process'; import type { PackageManager } from '../src/lib/getPackageManager'; import type { ProjectPaths } from './utils/bootstrapProject'; import { bootstrapProject, resetFilesystem } from './utils/bootstrapProject'; import { gene...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/toolchain-versions.test.ts
packages/create-fuels/test/toolchain-versions.test.ts
import { versions } from '@fuel-ts/versions'; import toml from '@iarna/toml'; import { readFileSync } from 'fs'; import { join } from 'path'; const projectRoot = join(__dirname, '..', '..', '..'); const templateDir = join(projectRoot, 'templates'); const counterGuideDir = join(projectRoot, 'apps', 'create-fuels-counte...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/cli.test.ts
packages/create-fuels/test/cli.test.ts
import { versions } from '@fuel-ts/versions'; import toml from '@iarna/toml'; import { mkdirSync, readFileSync } from 'fs'; import { join } from 'path'; import { runScaffoldCli, setupProgram } from '../src/cli'; import * as doesTemplateExistMod from '../src/lib/doesTemplateExist'; import { templates } from '../src/lib...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/utils/generateArgs.ts
packages/create-fuels/test/utils/generateArgs.ts
export const generateArgs = ({ projectName, packageManager = 'pnpm', template, }: { projectName?: string; packageManager: string; template?: string; }): string[] => { const args = []; if (packageManager === 'npm') { args.push('--'); } if (projectName) { args.push(projectName); } if (temp...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/utils/bootstrapProject.ts
packages/create-fuels/test/utils/bootstrapProject.ts
import { cpSync, existsSync, readdirSync, rmSync } from 'fs'; import { basename, join } from 'path'; import { rewriteTemplateFiles } from '../../src/lib/rewriteTemplateFiles'; export type ProjectPaths = { // Project paths projectRoot: string; packageJsonPath: string; fuelToolchainPath: string; // Template ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/utils/mockLogger.ts
packages/create-fuels/test/utils/mockLogger.ts
import * as logger from '../../src/utils/logger'; export function mockLogger() { const error = vi.spyOn(logger, 'error').mockReturnValue(); const warn = vi.spyOn(logger, 'warn').mockReturnValue(); const log = vi.spyOn(logger, 'log').mockReturnValue(); const debug = vi.spyOn(logger, 'debug').mockReturnValue(); ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/utils/templateFiles.ts
packages/create-fuels/test/utils/templateFiles.ts
import { glob } from 'glob'; export const getAllFiles = async (pathToDir: string) => { const files = await glob(`${pathToDir}/**/*`, { ignore: ['**/node_modules/**', '**/.next/**', '**/sway-api/**'], }); const filesWithoutPrefix = files.map((file) => file.replace(pathToDir, '')); return filesWithoutPrefix;...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/create-fuels/test/utils/mockExecSync.ts
packages/create-fuels/test/utils/mockExecSync.ts
import chalk from 'chalk'; import * as childProcessMod from 'child_process'; export const mockExecSync = () => { vi.spyOn(childProcessMod, 'execSync').mockImplementationOnce((command) => { if (command.includes('prebuild')) { return chalk('Skipping prebuild command'); } // Allow other execSync calls...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/tsup.config.ts
packages/transactions/tsup.config.ts
import { tsupDefaults } from '@internal/tsup'; import type { Options } from 'tsup'; const configs: Options = { ...tsupDefaults, entry: { index: 'src/index.ts', configs: 'src/configs.ts', }, }; export default configs;
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/configs.ts
packages/transactions/src/configs.ts
/** Maximum contract size, in bytes. */ export const CONTRACT_MAX_SIZE = 16 * 1024; /** Maximum number of witnesses. */ export const MAX_WITNESSES = 16; /** * Gas Price factor this is used to calculate * This is used to calculate the gas fee in Native Coins. * Ex.: transactionFee = Math.ceil(<gasUsed> / MAX_GAS_PE...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/receipt.test.ts
packages/transactions/src/receipt.test.ts
import { BigNumberCoder } from '@fuel-ts/abi-coder'; import type { AssetId } from '@fuel-ts/address'; import { getRandomB256 } from '@fuel-ts/address'; import { sha256 } from '@fuel-ts/hasher'; import { bn } from '@fuel-ts/math'; import { arrayify, concat } from '@fuel-ts/utils'; import { ByteArrayCoder } from './code...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/receipt.ts
packages/transactions/src/receipt.ts
import { BigNumberCoder } from '@fuel-ts/abi-coder'; import type { AssetId } from '@fuel-ts/address'; import { sha256 } from '@fuel-ts/hasher'; import type { BN } from '@fuel-ts/math'; import { arrayify, concat } from '@fuel-ts/utils'; import { ByteArrayCoder } from './coders/byte-array'; export enum ReceiptType /* u...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/index.ts
packages/transactions/src/index.ts
export * from './coders/input'; export * from './coders/output'; export * from './coders/policy'; export * from './receipt'; export * from './coders/storage-slot'; export * from './coders/transaction'; export * from './coders/witness'; export * from './coders/tx-pointer'; export * from './coders/utxo-id'; export * from...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/output.test.ts
packages/transactions/src/coders/output.test.ts
import { bn } from '@fuel-ts/math'; import { arrayify, hexlify } from '@fuel-ts/utils'; import type { Output } from './output'; import { OutputCoder, OutputType } from './output'; const B256 = '0xd5579c46dfcc7f18207013e65b44e4cb4e2c2298f4ac457ba8f82743f31e930b'; /** * @group node * @group browser */ describe('Out...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/tx-pointer.ts
packages/transactions/src/coders/tx-pointer.ts
import { NumberCoder, StructCoder } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; export type TxPointer = { /** Block height (u32) */ blockHeight: number; /** Transaction index (u16) */ txIndex: number; }; export class TxPointerCoder extends StructCoder<{ blockHeight: N...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/policy.test.ts
packages/transactions/src/coders/policy.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { bn } from '@fuel-ts/math'; import type { Policy } from './policy'; import { PoliciesCoder, PolicyType } from './policy'; /** * @group node * @group browser */ describe('PoliciesCode...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/storage-slot.test.ts
packages/transactions/src/coders/storage-slot.test.ts
import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { arrayify, hexlify } from '@fuel-ts/utils'; import type { StorageSlot } from './storage-slot'; import { StorageSlotCoder } from './storage-slot'; /** * @group node * @group browser */ describe('StorageSlotCoder', () => { it('Can encode and decode', ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/upgrade-purpose.test.ts
packages/transactions/src/coders/upgrade-purpose.test.ts
import { B256Coder, NumberCoder } from '@fuel-ts/abi-coder'; import { arrayify } from '@fuel-ts/utils'; import type { UpgradePurpose } from './upgrade-purpose'; import { UpgradePurposeCoder, UpgradePurposeTypeEnum } from './upgrade-purpose'; /** * @group node * @group browser */ describe('UpgradePurposeCoder', () ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/tx-pointer.test.ts
packages/transactions/src/coders/tx-pointer.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { arrayify, hexlify } from '@fuel-ts/utils'; import type { TxPointer } from './tx-pointer'; import { TxPointerCoder } from './tx-pointer'; const B256 = '0xd5579c46dfcc7f18207013e65b44e4c...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/byte-array.ts
packages/transactions/src/coders/byte-array.ts
import { Coder } from '@fuel-ts/abi-coder'; import type { BytesLike } from '@fuel-ts/utils'; import { concat, hexlify, arrayify } from '@fuel-ts/utils'; export class ByteArrayCoder extends Coder<BytesLike, string> { length: number; #paddingLength: number; constructor(length: number) { const paddingLength = ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/transaction.test.ts
packages/transactions/src/coders/transaction.test.ts
import { bn } from '@fuel-ts/math'; import { arrayify, hexlify } from '@fuel-ts/utils'; import { InputType } from './input'; import { OutputType } from './output'; import { PolicyType } from './policy'; import type { Transaction } from './transaction'; import { TransactionCoder, TransactionType } from './transaction';...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/storage-slot.ts
packages/transactions/src/coders/storage-slot.ts
import { B256Coder, StructCoder } from '@fuel-ts/abi-coder'; export type StorageSlot = { /** Key (b256) */ key: string; /** Value (b256) */ value: string; }; export class StorageSlotCoder extends StructCoder<{ key: B256Coder; value: B256Coder; }> { constructor() { super('StorageSlot', { key: n...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/transaction.ts
packages/transactions/src/coders/transaction.ts
/* eslint-disable max-classes-per-file */ import { Coder, ArrayCoder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { type BN } from '@fuel-ts/math'; import { concat } from '@fuel-ts/utils'; import { ByteArrayCoder } from './byte-arr...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/input.test.ts
packages/transactions/src/coders/input.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { bn } from '@fuel-ts/math'; import { arrayify, hexlify } from '@fuel-ts/utils'; import type { Input, InputMessage } from './input'; import { InputMessageCoder, InputCoder, InputType } fr...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/input.ts
packages/transactions/src/coders/input.ts
/* eslint-disable max-classes-per-file */ import { Coder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { sha256 } from '@fuel-ts/hasher'; import type { BN } from '@fuel-ts/math'; import type { BytesLike } from '@fuel-ts/utils'; import...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/byte-array.test.ts
packages/transactions/src/coders/byte-array.test.ts
import { arrayify, hexlify } from '@fuel-ts/utils'; import { ByteArrayCoder } from './byte-array'; /** * @group node * @group browser */ describe('ByteArrayCoder', () => { it('Can encode empty byte[]', () => { const bytes = arrayify('0x'); const encoded = hexlify(new ByteArrayCoder(bytes.length).encode(...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/utxo-id.test.ts
packages/transactions/src/coders/utxo-id.test.ts
import { arrayify, hexlify } from '@fuel-ts/utils'; import type { UtxoId } from './utxo-id'; import { UtxoIdCoder } from './utxo-id'; const B256 = '0xd5579c46dfcc7f18207013e65b44e4cb4e2c2298f4ac457ba8f82743f31e930b'; /** * @group node * @group browser */ describe('UtxoIdCoder', () => { it('can encode UtxoId [u8...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/policy.ts
packages/transactions/src/coders/policy.ts
import { BigNumberCoder, Coder, NumberCoder, WORD_SIZE } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BN } from '@fuel-ts/math'; import { concat } from '@fuel-ts/utils'; // Bitfield of used policy types. export enum PolicyType { Tip = 1, WitnessLimit = 2, Matur...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/witness.ts
packages/transactions/src/coders/witness.ts
import { Coder, NumberCoder } from '@fuel-ts/abi-coder'; import { concat } from '@fuel-ts/utils'; import { ByteArrayCoder } from './byte-array'; export type Witness = { /** Length of witness data byte array */ dataLength: number; /** Witness data (byte[]) */ data: string; }; export class WitnessCoder extends...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/upgrade-purpose.ts
packages/transactions/src/coders/upgrade-purpose.ts
import { B256Coder, Coder, NumberCoder } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { concat } from '@fuel-ts/utils'; export enum UpgradePurposeTypeEnum { ConsensusParameters = 0, StateTransition = 1, } export type UpgradePurpose = | { type: UpgradePurposeTyp...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/utxo-id.ts
packages/transactions/src/coders/utxo-id.ts
import { B256Coder, NumberCoder, StructCoder } from '@fuel-ts/abi-coder'; export type UtxoId = { /** Transaction ID (b256) */ transactionId: string; /** Output index (u8) */ outputIndex: number; }; export class UtxoIdCoder extends StructCoder<{ transactionId: B256Coder; outputIndex: NumberCoder; }> { 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/transactions/src/coders/output.ts
packages/transactions/src/coders/output.ts
/* eslint-disable max-classes-per-file */ import { Coder, B256Coder, NumberCoder, BigNumberCoder } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BN } from '@fuel-ts/math'; import { concat } from '@fuel-ts/utils'; export enum OutputType /* u8 */ { Coin = 0, Contrac...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/transactions/src/coders/witness.test.ts
packages/transactions/src/coders/witness.test.ts
import { arrayify, hexlify } from '@fuel-ts/utils'; import type { Witness } from './witness'; import { WitnessCoder } from './witness'; /** * @group node * @group browser */ describe('WitnessCoder', () => { it('Can encode empty Witness', () => { const witness: Witness = { dataLength: 0, data: '0x...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/tsup.config.ts
packages/script/tsup.config.ts
import { index } from '@internal/tsup'; export default index;
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/src/script.ts
packages/script/src/script.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import { Interface } from '@fuel-ts/abi-coder'; import type { InputValue, JsonAbi } from '@fuel-ts/abi-coder'; import { deployScriptOrPredicate, type Account, type Provider } from '@fuel-ts/account'; import { FuelError } from '@fuel-ts/errors'; import type { BN } ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/src/scripts.ts
packages/script/src/scripts.ts
import { ScriptRequest } from '@fuel-ts/program'; /** * @hidden * * A script that just returns zero * * Accepts nothing * Returns nothing * * Used for coin transfer transactions */ export const returnZeroScript = new ScriptRequest( /* Opcode::RET(REG_ZERO) Opcode::NOOP */ // TODO: Don't use hard...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/src/types.ts
packages/script/src/types.ts
import { AbstractProgram } from '@fuel-ts/program'; /** * @hidden */ export abstract class AbstractScript extends AbstractProgram { abstract bytes: Uint8Array; }
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/src/script-invocation-scope.ts
packages/script/src/script-invocation-scope.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import type { Provider } from '@fuel-ts/account'; import { FuelError } from '@fuel-ts/errors'; import { ScriptRequest, FunctionInvocationScope } from '@fuel-ts/program'; import type { AbstractScript } from './types'; export class ScriptInvocationScope< TArgs e...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/script/src/index.ts
packages/script/src/index.ts
export * from './script'; export * from './scripts'; export * from './types';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false