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/versions/src/lib/colorizeUserVersion.test.ts
packages/versions/src/lib/colorizeUserVersion.test.ts
import chalk from 'chalk'; import { colorizeUserVersion } from './colorizeUserVersion'; /** * @group node */ describe('colorizeUserVersion.js', () => { test('should colorize user versions just fine', () => { const version = '1.0.0'; // cyan = used for displaying newer versions const newerVersion = 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/versions/src/lib/fuelUpLink.ts
packages/versions/src/lib/fuelUpLink.ts
export const fuelUpLink = 'https://github.com/fuellabs/fuelup';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/versions/src/lib/types.ts
packages/versions/src/lib/types.ts
export interface Versions { FUELS: string; FORC: string; FUEL_CORE: string; } export interface BinaryVersions { FUELS: string; FORC?: string; FUEL_CORE?: 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/versions/src/lib/colorizeUserVersion.ts
packages/versions/src/lib/colorizeUserVersion.ts
import chalk from 'chalk'; export interface IColorizeUserVersion { version: string; isGt: boolean; isOk: boolean; } export const colorizeUserVersion = (params: IColorizeUserVersion) => { const { version, isGt, isOk } = params; if (isGt) { return chalk.cyan(version); } if (isOk) { return chalk....
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/versions/src/lib/compareSystemVersions.test.ts
packages/versions/src/lib/compareSystemVersions.test.ts
import { compareSystemVersions } from './compareSystemVersions'; import * as getBuiltinVersionsMod from './getBuiltinVersions'; /** * @group node */ describe('compareSystemVersions.js', () => { /* Hooks */ beforeEach(() => { const v = '1.0.0'; const spy = vi.spyOn(getBuiltinVersionsMod, 'getBuiltin...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/versions/src/lib/getBuiltinVersions.test.ts
packages/versions/src/lib/getBuiltinVersions.test.ts
import { readVersionsFromFiles } from '../../scripts/rewriteVersions'; import { getBuiltinVersions } from './getBuiltinVersions'; /** * @group node */ describe('getBuiltinVersions.js', () => { test('should return received version of default', () => { const versions = getBuiltinVersions(); const versionsFr...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/versions/src/lib/compareSystemVersions.ts
packages/versions/src/lib/compareSystemVersions.ts
import { getBuiltinVersions } from './getBuiltinVersions'; import { gt, eq } from './semver'; export interface ICompareVersionsParams { systemForcVersion: string; systemFuelCoreVersion: string; } export function compareSystemVersions(params: ICompareVersionsParams) { const { systemForcVersion, systemFuelCoreVer...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/versions/src/lib/getBinaryVersions.ts
packages/versions/src/lib/getBinaryVersions.ts
import { getBuiltinVersions } from './getBuiltinVersions'; import { getSystemVersions } from './getSystemVersions'; import type { BinaryVersions } from './types'; export const getBinaryVersions = ( params: { forcPath?: string; fuelCorePath?: string } = {} ): BinaryVersions => { const { FUELS } = getBuiltinVersions...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/tsup.config.ts
packages/crypto/tsup.config.ts
import { index } from '@internal/tsup'; import type { Options } from 'tsup'; export const keystoreOptions: Options[] = [ { ...index, entry: ['src/index.ts'], format: ['cjs'], }, { ...index, entry: ['src/index.ts', 'src/index.browser.ts'], format: ['esm'], }, ]; export default keystoreO...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/index.browser.ts
packages/crypto/src/index.browser.ts
import cryptoApi from './browser'; export * from './types'; export const { bufferFromString, decrypt, encrypt, keyFromPassword, randomBytes, stringFromBuffer, scrypt, keccak256, decryptJsonWalletData, encryptJsonWalletData, pbkdf2, computeHmac, ripemd160, randomUUID, } = cryptoApi;
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/types.ts
packages/crypto/src/types.ts
import type { BytesLike } from '@fuel-ts/utils'; export interface Keystore { data: string; iv: string; salt: string; } export interface IScryptParams { password: Uint8Array; salt: Uint8Array; n: number; p: number; r: number; dklen: number; } export type Encoding = 'utf-8' | 'base64' | 'hex'; expor...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/index.ts
packages/crypto/src/index.ts
import cryptoApi from './node'; export * from './types'; export const { bufferFromString, decrypt, encrypt, keyFromPassword, randomBytes, stringFromBuffer, scrypt, keccak256, decryptJsonWalletData, encryptJsonWalletData, computeHmac, pbkdf2, ripemd160, randomUUID, } = cryptoApi;
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/aes-ctr.ts
packages/crypto/src/node/aes-ctr.ts
import { FuelError, ErrorCode } from '@fuel-ts/errors'; import { arrayify } from '@fuel-ts/utils'; import crypto from 'crypto'; import type { CryptoApi, Keystore } from '../types'; import { bufferFromString } from './bufferFromString'; import { pbkdf2 } from './pbkdf2'; import { randomBytes } from './randomBytes'; 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/crypto/src/node/hmac.ts
packages/crypto/src/node/hmac.ts
import { arrayify, hexlify } from '@fuel-ts/utils'; import { createHmac } from 'crypto'; export function computeHmac( algorithm: 'sha256' | 'sha512', _key: Uint8Array, _data: Uint8Array ): string { const key = arrayify(_key, 'key'); const data = arrayify(_data, 'data'); return hexlify(createHmac(algorithm,...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/pbkdf2.ts
packages/crypto/src/node/pbkdf2.ts
import type { BytesLike } from '@fuel-ts/utils'; import { arrayify, hexlify } from '@fuel-ts/utils'; import { pbkdf2Sync } from 'crypto'; export function pbkdf2( _password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: 'sha256' | 'sha512' ): string { const password = arrayify(_pass...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/stringFromBuffer.ts
packages/crypto/src/node/stringFromBuffer.ts
import type { CryptoApi, Encoding } from '../types'; export const stringFromBuffer: CryptoApi['stringFromBuffer'] = ( buffer: Uint8Array, encoding: Encoding = 'base64' ): string => Buffer.from(buffer).toString(encoding);
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/encryptJsonWalletData.ts
packages/crypto/src/node/encryptJsonWalletData.ts
import crypto from 'crypto'; export async function encryptJsonWalletData(data: Uint8Array, key: Uint8Array, iv: Uint8Array) { const cipher = await crypto.createCipheriv('aes-128-ctr', key.subarray(0, 16), iv); const encrypted = Buffer.concat([cipher.update(data), cipher.final()]); return new Uint8Array(encrypt...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/randomBytes.ts
packages/crypto/src/node/randomBytes.ts
import crypto from 'crypto'; import type { CryptoApi } from '../types'; export const randomBytes: CryptoApi['randomBytes'] = (length: number): Uint8Array => { const randomValues = Uint8Array.from(crypto.randomBytes(length)); return randomValues; };
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/index.ts
packages/crypto/src/node/index.ts
import { scrypt, keccak256, ripemd160 } from '../shared'; import type { CryptoApi } from '../types'; import { decrypt, encrypt, keyFromPassword } from './aes-ctr'; import { bufferFromString } from './bufferFromString'; import { decryptJsonWalletData, encryptJsonWalletData } from './encryptJsonWalletData'; import { com...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/randomUUID.ts
packages/crypto/src/node/randomUUID.ts
import { randomUUID as UUID } from 'crypto'; import type { CryptoApi } from '../types'; export const randomUUID: CryptoApi['randomUUID'] = () => UUID();
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/node/bufferFromString.ts
packages/crypto/src/node/bufferFromString.ts
import type { CryptoApi, Encoding } from '../types'; export const bufferFromString: CryptoApi['bufferFromString'] = ( string: string, encoding: Encoding = 'base64' ): Uint8Array => Uint8Array.from(Buffer.from(string, encoding));
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/aes-ctr.ts
packages/crypto/src/browser/aes-ctr.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { arrayify } from '@fuel-ts/utils'; import type { CryptoApi, Keystore } from '../types'; import { bufferFromString } from './bufferFromString'; import { pbkdf2 } from './pbkdf2'; import { randomBytes } from './randomBytes'; import { stringFromBuffer } fro...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/hmac.ts
packages/crypto/src/browser/hmac.ts
import { hexlify } from '@fuel-ts/utils'; import { hmac } from '@noble/hashes/hmac'; import { sha256 } from '@noble/hashes/sha256'; import { sha512 } from '@noble/hashes/sha512'; import type { CryptoApi } from '../types'; export const computeHmac: CryptoApi['computeHmac'] = ( algorithm: 'sha256' | 'sha512', key: ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/crypto.ts
packages/crypto/src/browser/crypto.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; const { crypto, btoa } = globalThis; if (!crypto) { throw new FuelError( ErrorCode.ENV_DEPENDENCY_MISSING, `Could not find 'crypto' in current browser environment.` ); } if (!btoa) { throw new FuelError( ErrorCode.ENV_DEPENDENCY_MISSING, `...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/pbkdf2.ts
packages/crypto/src/browser/pbkdf2.ts
import type { BytesLike } from '@fuel-ts/utils'; import { hexlify } from '@fuel-ts/utils'; import { pbkdf2 as pb } from '@noble/hashes/pbkdf2'; import { sha256 } from '@noble/hashes/sha256'; import { sha512 } from '@noble/hashes/sha512'; import type { CryptoApi } from '../types'; export const pbkdf2: CryptoApi['pbkdf...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/stringFromBuffer.ts
packages/crypto/src/browser/stringFromBuffer.ts
import type { CryptoApi, Encoding } from '../types'; import { btoa } from './crypto'; export const stringFromBuffer: CryptoApi['stringFromBuffer'] = ( buffer: Uint8Array, encoding: Encoding = 'base64' ): string => { switch (encoding) { case 'utf-8': { return new TextDecoder().decode(buffer); } ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/encryptJsonWalletData.ts
packages/crypto/src/browser/encryptJsonWalletData.ts
import type { CryptoApi } from '../types'; import { crypto } from './crypto'; export const encryptJsonWalletData: CryptoApi['encryptJsonWalletData'] = async ( data: Uint8Array, key: Uint8Array, iv: Uint8Array ): Promise<Uint8Array> => { const subtle = crypto.subtle; const keyBuffer = new Uint8Array(key.suba...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/randomBytes.ts
packages/crypto/src/browser/randomBytes.ts
import type { CryptoApi } from '../types'; import { crypto } from './crypto'; export const randomBytes: CryptoApi['randomBytes'] = (length: number): Uint8Array => { const randomValues = crypto.getRandomValues(new Uint8Array(length)); return randomValues; };
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/index.ts
packages/crypto/src/browser/index.ts
import { scrypt, keccak256, ripemd160 } from '../shared'; import type { CryptoApi } from '../types'; import { decrypt, encrypt, keyFromPassword } from './aes-ctr'; import { bufferFromString } from './bufferFromString'; import { decryptJsonWalletData, encryptJsonWalletData } from './encryptJsonWalletData'; import { com...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/randomUUID.ts
packages/crypto/src/browser/randomUUID.ts
import type { CryptoApi } from '../types'; import { crypto } from './crypto'; export const randomUUID: CryptoApi['randomUUID'] = () => crypto.randomUUID();
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/browser/bufferFromString.ts
packages/crypto/src/browser/bufferFromString.ts
import type { CryptoApi, Encoding } from '../types'; export const bufferFromString: CryptoApi['bufferFromString'] = ( string: string, encoding: Encoding = 'base64' ): Uint8Array => { switch (encoding) { case 'utf-8': { return new TextEncoder().encode(string); } case 'base64': { const bin...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/ripemd160.ts
packages/crypto/src/shared/ripemd160.ts
import type { BytesLike } from '@fuel-ts/utils'; import { arrayify } from '@fuel-ts/utils'; import { ripemd160 as noble_ripemd160 } from '@noble/hashes/ripemd160'; export function ripemd160(_data: BytesLike): Uint8Array { const data = arrayify(_data, 'data'); return noble_ripemd160(data); }
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/keccak256.test.ts
packages/crypto/src/shared/keccak256.test.ts
import { bufferFromString } from '..'; import { keccak256 as keccak } from './keccak256'; const data = bufferFromString('hashedKey'); vi.mock('@noble/hashes/sha3', () => ({ keccak_256: vi.fn(() => data), })); /** * @group node */ describe('keccak256', () => { afterEach(() => { vi.restoreAllMocks(); }); ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/scrypt.ts
packages/crypto/src/shared/scrypt.ts
import { scrypt as scryptNoble } from '@noble/hashes/scrypt'; import type { IScryptParams } from '../types'; export const scrypt = (params: IScryptParams): Uint8Array => { const { password, salt, n, p, r, dklen } = params; const derivedKey = scryptNoble(password, salt, { N: n, r, p, dkLen: dklen }); return der...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/keccak256.ts
packages/crypto/src/shared/keccak256.ts
import { keccak_256 } from '@noble/hashes/sha3'; export const keccak256 = (data: Uint8Array): Uint8Array => keccak_256(data);
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/scrypt.test.ts
packages/crypto/src/shared/scrypt.test.ts
import { bufferFromString } from '..'; import type { IScryptParams } from '../types'; import { scrypt } from './scrypt'; const data = bufferFromString('hashedKey'); vi.mock('@noble/hashes/scrypt', () => ({ scrypt: vi.fn(() => data), })); /** * @group node */ describe('scrypt', () => { afterEach(() => { vi...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/ripemd160.test.ts
packages/crypto/src/shared/ripemd160.test.ts
import { bufferFromString } from '..'; import { ripemd160 as ripemd } from './ripemd160'; const data = bufferFromString('hashedKey'); vi.mock('@noble/hashes/ripemd160', () => ({ ripemd160: vi.fn(() => data), })); /** * @group node */ describe('ripemd160', () => { afterEach(() => { vi.restoreAllMocks(); ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/src/shared/index.ts
packages/crypto/src/shared/index.ts
export * from './scrypt'; export * from './keccak256'; export * from './ripemd160';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/test/pbkdf2.test.ts
packages/crypto/test/pbkdf2.test.ts
import { bufferFromString, pbkdf2 } from '..'; /** * @group node * @group browser */ describe('pbkdf2 node & browser', () => { it('should compute the PBKDF2 hash correctly', () => { const passwordBuffer = bufferFromString(String('password123').normalize('NFKC'), 'utf-8'); const saltBuffer = bufferFromStri...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/test/hmac.test.ts
packages/crypto/test/hmac.test.ts
import { computeHmac } from '..'; // #TODO: This computes the wrong value on node yet the other tests pass, I'm not sure why /** * @group node * @group browser */ describe('computeHmac node & browser', () => { it('should compute HMAC correctly', () => { const key = '0x0102030405060708090a0b0c0d0e0f10'; 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/crypto/test/bufferFromString.test.ts
packages/crypto/test/bufferFromString.test.ts
import { bufferFromString } from '..'; /** * @group node * @group browser */ describe('bufferFromString', () => { const buffer = new Uint8Array([104, 101, 108, 108, 111]); // ASCII values for "hello" it('should correctly convert string to Uint8Array with base64 encoding in a node environment', () => { 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/crypto/test/stringFromBuffer.test.ts
packages/crypto/test/stringFromBuffer.test.ts
import { stringFromBuffer } from '..'; /** * @group node * @group browser */ describe('stringFromBuffer', () => { const buffer = new Uint8Array([104, 101, 108, 108, 111]); // ASCII values for "hello" it('should correctly convert Uint8Array to string with base64 encoding in a node environment', () => { 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/crypto/test/randomUUID.test.ts
packages/crypto/test/randomUUID.test.ts
import { randomUUID } from '..'; /** * @group node * @group browser */ describe('randomUUID', () => { const UUID_V4_REGEX = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-4[0-9a-fA-F]{3}\b-[89ABab][0-9a-fA-F]{3}\b-[0-9a-fA-F]{12}$/; it('generates a V4 UUID', () => { const uuidV4 = randomUUID(); expect(uuidV4)...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/test/encryptJsonWalletData.test.ts
packages/crypto/test/encryptJsonWalletData.test.ts
import { encryptJsonWalletData, decryptJsonWalletData, randomBytes } from '..'; /** * @group node * @group browser */ describe('encryptJsonWalletData', () => { it('should encrypt and decrypt json wallet data correctly in a node environment', async () => { const testData = new Uint8Array([104, 101, 108, 108, 11...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/crypto/test/aes-ctr.test.ts
packages/crypto/test/aes-ctr.test.ts
import { encrypt, decrypt } from '..'; /** * @group node * @group browser */ describe('Keystore', () => { it('Encrypt and Decrypt', async () => { const password = '0b540281-f87b-49ca-be37-2264c7f260f7'; const data = { name: 'test', }; const encryptedResult = await encrypt(password, data); ...
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-typegen/tsup.config.ts
packages/abi-typegen/tsup.config.ts
import { tsupDefaults } from '@internal/tsup'; import type { Options } from 'tsup'; const configs: Options = { ...tsupDefaults, entry: { index: 'src/index.ts', cli: 'src/cli.ts', bin: 'src/bin.ts', runTypegen: 'src/runTypegen.ts', }, loader: { '.hbs': 'text', }, }; 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/abi-typegen/src/index.test.ts
packages/abi-typegen/src/index.test.ts
import * as indexMod from './index'; /** * @group node */ describe('index.ts', () => { test('should export AbiTypeGen class', () => { expect(indexMod.AbiTypeGen).toBeTruthy(); }); });
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-typegen/src/runTypegen.ts
packages/abi-typegen/src/runTypegen.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { versions as builtinVersions, type BinaryVersions } from '@fuel-ts/versions'; import { readFileSync, writeFileSync } from 'fs'; import { globSync } from 'glob'; import { mkdirp } from 'mkdirp'; import { basename } from 'path'; import { rimrafSync } from 'r...
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-typegen/src/AbiTypeGen.ts
packages/abi-typegen/src/AbiTypeGen.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BinaryVersions } from '@fuel-ts/versions'; import { Abi } from './abi/Abi'; import { ProgramTypeEnum } from './types/enums/ProgramTypeEnum'; import type { IFile } from './types/interfaces/IFile'; import { assembleContracts } from './utils/assembleCo...
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-typegen/src/AbiTypeGen.test.ts
packages/abi-typegen/src/AbiTypeGen.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import { getNewAbiTypegen } from '../test/utils/getNewAbiTypegen'; import { ProgramTypeEnum } from './types/enums/ProgramTypeEnum'; import * as assembleContractsMod from './utils/assembleContracts'; import * as assemblePredicatesMod from './utils/assemblePredicat...
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-typegen/src/cli.ts
packages/abi-typegen/src/cli.ts
import { versions as builtinVersion } from '@fuel-ts/versions'; import { Command, Option } from 'commander'; import { runTypegen } from './runTypegen'; import { ProgramTypeEnum } from './types/enums/ProgramTypeEnum'; export interface ICliParams { inputs: string[]; output: string; silent?: boolean; contract?: ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-typegen/src/hbs.d.ts
packages/abi-typegen/src/hbs.d.ts
// informs TS about Handlebar `.hbs` templates extension declare module '*.hbs' { const value: string; export default value; }
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-typegen/src/index.ts
packages/abi-typegen/src/index.ts
// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// <reference path="./hbs.d.ts" /> export * from './AbiTypeGen'; export * from './types/enums/ProgramTypeEnum'; export * from './types/interfaces/IConfigurable'; export * from './types/interfaces/IFile'; export * from './types/interfaces/IFunction'...
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-typegen/src/runTypegen.test.ts
packages/abi-typegen/src/runTypegen.test.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { expectToThrowFuelError, safeExec } from '@fuel-ts/errors/test-utils'; import { cpSync, existsSync, renameSync } from 'fs'; import { globSync } from 'glob'; import { join } from 'path'; import { AbiTypegenProjectsEnum, getTypegenForcProject, } 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/abi-typegen/src/bin.ts
packages/abi-typegen/src/bin.ts
import { run } from './cli'; run({ argv: process.argv, programName: 'fuels-typegen', });
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-typegen/src/cli.test.ts
packages/abi-typegen/src/cli.test.ts
import { stderr } from 'process'; import { AbiTypegenProjectsEnum, getTypegenForcProject, } from '../test/fixtures/forc-projects/index'; import { run, runCliAction } from './cli'; import * as runTypegenMod from './runTypegen'; import { ProgramTypeEnum } from './types/enums/ProgramTypeEnum'; /** * @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/packages/abi-typegen/src/utils/extractStructName.ts
packages/abi-typegen/src/utils/extractStructName.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; export function extractStructName(params: { rawAbiType: JsonAbiType; regex: RegExp }) { const { rawAbiType, regex } = params; const matches = rawAbiType.type.match(regex); const match = match...
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-typegen/src/utils/supportedTypes.ts
packages/abi-typegen/src/utils/supportedTypes.ts
import { ArrayType } from '../abi/types/ArrayType'; import { B256Type } from '../abi/types/B256Type'; import { B512Type } from '../abi/types/B512Type'; import { BoolType } from '../abi/types/BoolType'; import { BytesType } from '../abi/types/BytesType'; import { EmptyType } from '../abi/types/EmptyType'; import { EnumT...
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-typegen/src/utils/getFunctionInputs.ts
packages/abi-typegen/src/utils/getFunctionInputs.ts
import { EmptyType } from '../abi/types/EmptyType'; import { OptionType } from '../abi/types/OptionType'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiArgument } from '../types/interfaces/JsonAbi'; import { findType } from './findType'; export type FunctionInput<TArg extends JsonAbiArg...
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-typegen/src/utils/parseErrorCodes.ts
packages/abi-typegen/src/utils/parseErrorCodes.ts
import type { ErrorCode } from '../abi/errors/ErrorCode'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiErrorCode } from '../types/interfaces/JsonAbi'; import { makeErrorCode } from './makeErrorCodes'; export function parseErrorCodes(params: { types: IType[]; rawErrorCodes?: Record<...
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-typegen/src/utils/collectStorageSlotsFilePaths.ts
packages/abi-typegen/src/utils/collectStorageSlotsFilePaths.ts
import { existsSync, readFileSync } from 'fs'; import { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; import type { IFile } from '../types/interfaces/IFile'; export const collectStorageSlotsFilepaths = (params: { filepaths: string[]; programType: ProgramTypeEnum; }) => { const { filepaths, programTyp...
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-typegen/src/utils/parseTypeArguments.test.ts
packages/abi-typegen/src/utils/parseTypeArguments.test.ts
import { AbiTypegenProjectsEnum, getTypegenForcProject, } from '../../test/fixtures/forc-projects/index'; import { TargetEnum } from '../types/enums/TargetEnum'; import type { JsonAbiType, JsonAbiArgument } from '../types/interfaces/JsonAbi'; import { makeType } from './makeType'; import { parseTypeArguments } fro...
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-typegen/src/utils/parseTypeArguments.ts
packages/abi-typegen/src/utils/parseTypeArguments.ts
import type { TargetEnum } from '../types/enums/TargetEnum'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiArgument } from '../types/interfaces/JsonAbi'; import { findType } from './findType'; /* Recursively parses the given `typeArguments` node */ export function parseTypeArguments(p...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-typegen/src/utils/parseTypes.test.ts
packages/abi-typegen/src/utils/parseTypes.test.ts
import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { parseTypes } from './parseTypes'; /** * @group node */ describe('types.ts', () => { test('should parse an array of raw abi types', () => { const rawU8: JsonAbiType = { typeId: 1, type: 'u8', components: null, type...
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-typegen/src/utils/getFunctionInputs.test.ts
packages/abi-typegen/src/utils/getFunctionInputs.test.ts
import type { IType } from '../types/interfaces/IType'; import type { JsonAbiArgument, JsonAbiType } from '../types/interfaces/JsonAbi'; import { getFunctionInputs } from './getFunctionInputs'; import { makeType } from './makeType'; const nonEmptyType: JsonAbiType = { type: 'u8', typeId: 1, components: null, ...
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-typegen/src/utils/makeFunction.ts
packages/abi-typegen/src/utils/makeFunction.ts
import { Function } from '../abi/functions/Function'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiFunction } from '../types/interfaces/JsonAbi'; export function makeFunction(params: { types: IType[]; rawAbiFunction: JsonAbiFunction }) { const { types, rawAbiFunction } = params; ret...
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-typegen/src/utils/parseFunctions.test.ts
packages/abi-typegen/src/utils/parseFunctions.test.ts
import type { IType } from '../types/interfaces/IType'; import type { JsonAbiFunction, JsonAbiType } from '../types/interfaces/JsonAbi'; import { makeType } from './makeType'; import { parseFunctions } from './parseFunctions'; /** * @group node */ describe('functions.ts', () => { test('should parse an array of ra...
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-typegen/src/utils/assembleContracts.test.ts
packages/abi-typegen/src/utils/assembleContracts.test.ts
import { getNewAbiTypegen } from '../../test/utils/getNewAbiTypegen'; import { mockVersions } from '../../test/utils/mockVersions'; import * as renderCommonTemplateMod from '../templates/common/common'; import * as renderIndexTemplateMod from '../templates/common/index'; import * as renderMainTemplateMod from '../templ...
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-typegen/src/utils/parseFunctions.ts
packages/abi-typegen/src/utils/parseFunctions.ts
import type { IFunction } from '../types/interfaces/IFunction'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiFunction } from '../types/interfaces/JsonAbi'; import { makeFunction } from './makeFunction'; export function parseFunctions(params: { types: IType[]; rawAbiFunctions: reado...
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-typegen/src/utils/parseTypes.ts
packages/abi-typegen/src/utils/parseTypes.ts
import type { IType } from '../types/interfaces/IType'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { makeType } from './makeType'; import { shouldSkipAbiType } from './shouldSkipAbiType'; export function parseTypes(params: { rawAbiTypes: readonly JsonAbiType[] }) { const types: IType[] =...
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-typegen/src/utils/findType.ts
packages/abi-typegen/src/utils/findType.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { IType } from '../types/interfaces/IType'; export function findType(params: { types: IType[]; typeId: number }) { const { types, typeId } = params; const foundType = types.find(({ rawAbiType: { typeId: tid } }) => tid === typeId); if (!found...
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-typegen/src/utils/extractStructName.test.ts
packages/abi-typegen/src/utils/extractStructName.test.ts
import { EnumType } from '../abi/types/EnumType'; import { GenericType } from '../abi/types/GenericType'; import { StructType } from '../abi/types/StructType'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { extractStructName } from './extractStructName'; /** * @group node */ describe('extr...
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-typegen/src/utils/findType.test.ts
packages/abi-typegen/src/utils/findType.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { findType } from './findType'; import { makeType } from './makeType'; /** * @group node */ describe('findType.ts', () => { test('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-typegen/src/utils/makeType.test.ts
packages/abi-typegen/src/utils/makeType.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import type { ArrayType } from '../abi/types/ArrayType'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { makeType } from './makeType'; /** * @group node */ describe('makeType.ts', () => { test('should create a new Type instance just ...
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-typegen/src/utils/makeType.ts
packages/abi-typegen/src/utils/makeType.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { JsonAbiType } from '../types/interfaces/JsonAbi'; import { supportedTypes } from './supportedTypes'; export function makeType(params: { rawAbiType: JsonAbiType }) { const { rawAbiType } = params; const { type } = rawAbiType; const TypeClass...
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-typegen/src/utils/assemblePredicates.ts
packages/abi-typegen/src/utils/assemblePredicates.ts
import type { BinaryVersions } from '@fuel-ts/versions'; import { join } from 'path'; import type { Abi } from '../abi/Abi'; import type { IFile } from '../index'; import { renderCommonTemplate } from '../templates/common/common'; import { renderIndexTemplate } from '../templates/common/index'; import { renderMainTemp...
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-typegen/src/utils/validateBinFile.test.ts
packages/abi-typegen/src/utils/validateBinFile.test.ts
import { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; import { validateBinFile } from './validateBinFile'; /** * @group node */ describe('validateBinFile.ts', () => { test('should not throw for existent Script BIN file', () => { const params = { abiFilepath: 'script-abi.json', binExist...
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-typegen/src/utils/assembleScripts.ts
packages/abi-typegen/src/utils/assembleScripts.ts
import type { BinaryVersions } from '@fuel-ts/versions'; import { join } from 'path'; import type { Abi } from '../abi/Abi'; import type { IFile } from '../index'; import { renderCommonTemplate } from '../templates/common/common'; import { renderIndexTemplate } from '../templates/common/index'; import { renderMainTemp...
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-typegen/src/utils/assembleContracts.ts
packages/abi-typegen/src/utils/assembleContracts.ts
import type { BinaryVersions } from '@fuel-ts/versions'; import { join } from 'path'; import type { Abi } from '../abi/Abi'; import type { IFile } from '../index'; import { renderCommonTemplate } from '../templates/common/common'; import { renderIndexTemplate } from '../templates/common/index'; import { renderFactoryT...
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-typegen/src/utils/validateBinFile.ts
packages/abi-typegen/src/utils/validateBinFile.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; const upperFirst = (s: string): string => s[0].toUpperCase() + s.slice(1); export function validateBinFile(params: { abiFilepath: string; binFilepath: string; binExists: boolean; programT...
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-typegen/src/utils/shouldSkipType.test.ts
packages/abi-typegen/src/utils/shouldSkipType.test.ts
import { shouldSkipAbiType } from './shouldSkipAbiType'; import { supportedTypes } from './supportedTypes'; /** * @group node */ describe('types.ts', () => { test('should always skip these types', () => { expect(shouldSkipAbiType({ type: 'struct RawVec' })).toEqual(true); expect(shouldSkipAbiType({ type: '...
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-typegen/src/utils/getTypeDeclaration.ts
packages/abi-typegen/src/utils/getTypeDeclaration.ts
import { TargetEnum } from '../types/enums/TargetEnum'; import type { IType } from '../types/interfaces/IType'; import type { JsonAbiArgument } from '../types/interfaces/JsonAbi'; import { findType } from './findType'; import { parseTypeArguments } from './parseTypeArguments'; export function resolveInputLabel( typ...
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-typegen/src/utils/collectStorageSlotsFilePaths.test.ts
packages/abi-typegen/src/utils/collectStorageSlotsFilePaths.test.ts
import { AbiTypegenProjectsEnum, getTypegenForcProject } from '../../test/fixtures/forc-projects'; import { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; import { collectStorageSlotsFilepaths } from './collectStorageSlotsFilePaths'; /** * @group node */ describe('collectStorageSlotsFilePaths.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/abi-typegen/src/utils/supportedTypes.test.ts
packages/abi-typegen/src/utils/supportedTypes.test.ts
import { supportedTypes } from './supportedTypes'; /** * @group node */ describe('supportedTypes.ts', () => { test('should export all supported types', () => { expect(supportedTypes.length).toEqual(24); }); });
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-typegen/src/utils/transpile-abi.ts
packages/abi-typegen/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-typegen/src/utils/collectBinFilePaths.test.ts
packages/abi-typegen/src/utils/collectBinFilePaths.test.ts
import { hexlify } from '@fuel-ts/utils'; import { readFileSync } from 'fs'; import { AbiTypegenProjectsEnum, getTypegenForcProject } from '../../test/fixtures/forc-projects'; import { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; import { collectBinFilepaths } from './collectBinFilePaths'; import * as val...
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-typegen/src/utils/shouldSkipAbiType.ts
packages/abi-typegen/src/utils/shouldSkipAbiType.ts
export function shouldSkipAbiType(params: { type: string }) { const ignoreList = [ 'struct RawVec', 'struct std::vec::RawVec', 'struct RawBytes', 'struct std::bytes::RawBytes', ]; const shouldSkip = ignoreList.indexOf(params.type) >= 0; return shouldSkip; }
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-typegen/src/utils/collectBinFilePaths.ts
packages/abi-typegen/src/utils/collectBinFilePaths.ts
import { hexlify } from '@fuel-ts/utils'; import { existsSync, readFileSync } from 'fs'; import type { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum'; import type { IFile } from '../types/interfaces/IFile'; import { validateBinFile } from './validateBinFile'; export const collectBinFilepaths = (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-typegen/src/utils/makeErrorCodes.ts
packages/abi-typegen/src/utils/makeErrorCodes.ts
import { ErrorCode } from '../abi/errors/ErrorCode'; import type { IErrorCode } from '../types/interfaces/IErrorCode'; export function makeErrorCode(params: IErrorCode) { return new ErrorCode(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-typegen/src/utils/assembleScripts.test.ts
packages/abi-typegen/src/utils/assembleScripts.test.ts
import { getNewAbiTypegen } from '../../test/utils/getNewAbiTypegen'; import { mockVersions } from '../../test/utils/mockVersions'; import * as renderCommonTemplateMod from '../templates/common/common'; import * as renderIndexTemplateMod from '../templates/common/index'; import * as renderMainTemplateMod from '../templ...
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-typegen/src/utils/makeFunction.test.ts
packages/abi-typegen/src/utils/makeFunction.test.ts
import type { IType } from '../types/interfaces/IType'; import type { JsonAbiFunction, JsonAbiType } from '../types/interfaces/JsonAbi'; import { makeFunction } from './makeFunction'; import { makeType } from './makeType'; /** * @group node */ describe('functions.ts', () => { test('should instantiate a new Functi...
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-typegen/src/utils/assemblePredicates.test.ts
packages/abi-typegen/src/utils/assemblePredicates.test.ts
import { getNewAbiTypegen } from '../../test/utils/getNewAbiTypegen'; import { mockVersions } from '../../test/utils/mockVersions'; import * as renderCommonTemplateMod from '../templates/common/common'; import * as renderIndexTemplateMod from '../templates/common/index'; import * as renderMainTemplateMod from '../templ...
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-typegen/src/types/interfaces/IFunction.ts
packages/abi-typegen/src/types/interfaces/IFunction.ts
import type { IType } from './IType'; import type { JsonAbiFunction } from './JsonAbi'; export interface IFunctionAttributes { inputs: string; output: string; prefixedInputs: string; } export interface IFunction { types: IType[]; name: string; rawAbiFunction: JsonAbiFunction; attributes: IFunctionAttrib...
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-typegen/src/types/interfaces/IConfigurable.ts
packages/abi-typegen/src/types/interfaces/IConfigurable.ts
export interface IConfigurable { name: string; inputLabel: 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-typegen/src/types/interfaces/JsonAbiNew.ts
packages/abi-typegen/src/types/interfaces/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-typegen/src/types/interfaces/JsonAbi.ts
packages/abi-typegen/src/types/interfaces/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-typegen/src/types/interfaces/IType.ts
packages/abi-typegen/src/types/interfaces/IType.ts
import type { JsonAbiType } from './JsonAbi'; export interface ITypeAttributes { inputLabel: string; outputLabel: string; structName?: string; /* If `structName` is set, input/output labels will mirror it. */ } export interface IType { name: string; attributes: ITypeAttributes; rawAbiType: JsonAbi...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/abi-typegen/src/types/interfaces/IErrorCode.ts
packages/abi-typegen/src/types/interfaces/IErrorCode.ts
import type { JsonAbiErrorCode } from './JsonAbi'; export interface IErrorCode { code: string; value: JsonAbiErrorCode; }
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-typegen/src/types/interfaces/IFile.ts
packages/abi-typegen/src/types/interfaces/IFile.ts
export interface IFile { path: string; contents: 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-typegen/src/types/enums/ProgramTypeEnum.ts
packages/abi-typegen/src/types/enums/ProgramTypeEnum.ts
export enum ProgramTypeEnum { CONTRACT = 'contract', SCRIPT = 'script', PREDICATE = 'predicate', }
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false