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/account/src/wallet/wallet.test.ts
packages/account/src/wallet/wallet.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import { Provider } from '../providers'; import { setupTestProviderAndWallets } from '../test-utils'; import { Wallet } from './wallet'; import { WalletLocked, WalletUnlocked } from './wallets'; /** * @group node */ describe('Wallet', () => { describe('Walle...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/keystore-wallet.ts
packages/account/src/wallet/keystore-wallet.ts
import type { AddressInput } from '@fuel-ts/address'; import { Address } from '@fuel-ts/address'; import { bufferFromString, keccak256, randomBytes, scrypt, stringFromBuffer, decryptJsonWalletData, encryptJsonWalletData, randomUUID, } from '@fuel-ts/crypto'; import { ErrorCode, FuelError } from '@fuel-t...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/base-wallet-unlocked.ts
packages/account/src/wallet/base-wallet-unlocked.ts
import type { HashableMessage } from '@fuel-ts/hasher'; import { hashMessage } from '@fuel-ts/hasher'; import type { BytesLike } from '@fuel-ts/utils'; import { hexlify } from '@fuel-ts/utils'; import { Account } from '../account'; import { transactionRequestify, validateTransactionForAssetBurn } from '../providers'; ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/index.ts
packages/account/src/wallet/index.ts
export * from './base-wallet-unlocked'; export * from './wallet'; export * from './wallets';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/wallet.ts
packages/account/src/wallet/wallet.ts
import type { Address } from '@fuel-ts/address'; import type { BytesLike } from '@fuel-ts/utils'; import type { Provider } from '../providers'; import { WalletLocked, WalletUnlocked } from './wallets'; /** * `Wallet` provides methods to create locked and unlocked wallet instances. */ export class Wallet { /** ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/keystore-wallet.test.ts
packages/account/src/wallet/keystore-wallet.test.ts
import { Address } from '@fuel-ts/address'; import { safeExec } from '@fuel-ts/errors/test-utils'; import { decryptKeystoreWallet, encryptKeystoreWallet, removeHexPrefix } from './keystore-wallet'; /** * @group node */ describe('Keystore Wallet', () => { afterEach(() => { vi.restoreAllMocks(); }); 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/account/src/wallet/wallets.ts
packages/account/src/wallet/wallets.ts
// // Because WalletLocked and WalletUnlocked has a cycle dependency // it's not possible to split the two classes in different files // /* eslint-disable max-classes-per-file */ import type { BytesLike } from '@fuel-ts/utils'; import { Account } from '../account'; import { HDWallet } from '../hdwallet'; import { Mnem...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet/wallet-unlocked.test.ts
packages/account/src/wallet/wallet-unlocked.test.ts
import { randomBytes } from '@fuel-ts/crypto'; import { hashMessage } from '@fuel-ts/hasher'; import type { BytesLike } from '@fuel-ts/utils'; import walletSpec from '../../test/fixtures/wallet-spec'; import { SCRIPT_TX_REQUEST, SIGNED_TX, PRIVATE_KEY } from '../../test/fixtures/wallet-unlocked'; import * as providers...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/wallet-manager.test.ts
packages/account/src/wallet-manager/wallet-manager.test.ts
import { Address } from '@fuel-ts/address'; import { hashMessage } from '@fuel-ts/hasher'; import WalletManagerSpec from '../../test/fixtures/wallet-manager-spec'; import { Signer } from '../signer'; import { Wallet } from '../wallet'; import { MemoryStorage } from './storages/memory-storage'; import type { VaultConf...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/types.ts
packages/account/src/wallet-manager/types.ts
/* eslint-disable max-classes-per-file */ import type { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { WalletUnlocked } from '../wallet'; export type WalletManagerAccount = { address: Address; publicKey: string; vaultId?: number; }; export type WalletMa...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/index.ts
packages/account/src/wallet-manager/index.ts
export * from './wallet-manager'; export * from './storages/memory-storage'; export * from './vaults/mnemonic-vault'; export * from './vaults/privatekey-vault'; export * from './types';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/wallet-manager.ts
packages/account/src/wallet-manager/wallet-manager.ts
import type { AddressInput } from '@fuel-ts/address'; import { Address } from '@fuel-ts/address'; import type { Keystore } from '@fuel-ts/crypto'; import { encrypt, decrypt } from '@fuel-ts/crypto'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { EventEmitter } from 'events'; import type { WalletUnloc...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/vaults/mnemonic-vault.ts
packages/account/src/wallet-manager/vaults/mnemonic-vault.ts
import type { AddressInput } from '@fuel-ts/address'; import { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { Mnemonic } from '../../mnemonic'; import type { WalletUnlocked } from '../../wallet'; import { Wallet } from '../../wallet'; import type { Vault } from '../...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/vaults/privatekey-vault.ts
packages/account/src/wallet-manager/vaults/privatekey-vault.ts
import type { AddressInput } from '@fuel-ts/address'; import { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { WalletUnlocked } from '../../wallet'; import { Wallet } from '../../wallet'; import type { WalletManagerAccount, Vault } from '../types'; export inter...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/vaults/privatekey-vault.test.ts
packages/account/src/wallet-manager/vaults/privatekey-vault.test.ts
import { Address } from '@fuel-ts/address'; import type { WalletUnlocked } from '../../wallet'; import { Wallet } from '../../wallet'; import { PrivateKeyVault } from './privatekey-vault'; /** * @group node * @group browser */ describe('PrivateKeyVault', () => { let walletSpec: WalletUnlocked; beforeAll(() =...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/vaults/mnemonic-vault.test.ts
packages/account/src/wallet-manager/vaults/mnemonic-vault.test.ts
import walletManagerSpec from '../../../test/fixtures/wallet-manager-spec'; import { Wallet } from '../../wallet'; import { MnemonicVault } from './mnemonic-vault'; /** * @group node * @group browser */ describe('MnemonicVault', () => { it('Get wallet instance', () => { const vault = new MnemonicVault({ ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/storages/memory-storage.ts
packages/account/src/wallet-manager/storages/memory-storage.ts
import type { StorageAbstract } from '../types'; export class MemoryStorage implements StorageAbstract { storage = new Map<string, unknown>(); async getItem<T>(key: string): Promise<T | null> { const item = await this.storage.get(key); return item as T | null; } async setItem(key: string, value: stri...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/wallet-manager/storages/memory-storage.test.ts
packages/account/src/wallet-manager/storages/memory-storage.test.ts
import { MemoryStorage } from './memory-storage'; /** * @group node * @group browser */ describe('MemoryStorage', () => { it('Test storage operations', async () => { const storage = new MemoryStorage(); const key = 'my-test-key'; const data = JSON.stringify({ a: 1, b: 2 }); await storage.setItem(...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/utils/split-coins-into-batches.ts
packages/account/src/utils/split-coins-into-batches.ts
import type { Coin } from '../providers'; export const splitCoinsIntoBatches = (coins: Coin[], maxBatchLength: number) => { const batchesNum = Math.ceil(coins.length / maxBatchLength); const batches: Coin[][] = []; for (let i = 0; i < batchesNum; i += 1) { const batchStart = i * maxBatchLength; const ba...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/utils/formatTransferToContractScriptData.test.ts
packages/account/src/utils/formatTransferToContractScriptData.test.ts
import { BigNumberCoder } from '@fuel-ts/abi-coder'; import { getRandomB256 } from '@fuel-ts/address'; import { bn, type BigNumberish } from '@fuel-ts/math'; import * as arrayifyMod from '@fuel-ts/utils'; import type { BytesLike } from '@fuel-ts/utils'; import { assembleTransferToContractScript, formatTransferToCo...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/utils/predicate-script-loader-instructions.test.ts
packages/account/src/utils/predicate-script-loader-instructions.test.ts
import { concat } from '@fuel-ts/utils'; import { getBytecodeConfigurableOffset, getBytecodeDataOffset, getBytecodeId, getLegacyBlobId, } from './predicate-script-loader-instructions'; /** * @group node * @group browser */ describe('Predicate Script Loader Instructions', () => { const suffixBytes = new 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/account/src/utils/consolidate-coins.ts
packages/account/src/utils/consolidate-coins.ts
import { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { bn } from '@fuel-ts/math'; import { OutputType } from '@fuel-ts/transactions'; import type { TransactionType, OutputChange, Output } from '@fuel-ts/transactions'; import { splitEvery } from 'ramda'; import { 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/account/src/utils/deployScriptOrPredicate.ts
packages/account/src/utils/deployScriptOrPredicate.ts
import type { JsonAbi } from '@fuel-ts/abi-coder'; import { FuelError, ErrorCode } from '@fuel-ts/errors'; import { arrayify } from '@fuel-ts/utils'; import type { Account } from '../account'; import { BlobTransactionRequest, TransactionStatus } from '../providers'; import { getBytecodeConfigurableOffset, getByte...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/utils/formatTransferToContractScriptData.ts
packages/account/src/utils/formatTransferToContractScriptData.ts
import { ASSET_ID_LEN, BigNumberCoder, CONTRACT_ID_LEN, WORD_SIZE } from '@fuel-ts/abi-coder'; import { Address } from '@fuel-ts/address'; import type { BN } from '@fuel-ts/math'; import { arrayify, concat } from '@fuel-ts/utils'; import type { BytesLike } from '@fuel-ts/utils'; import * as asm from '@fuels/vm-asm'; 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/account/src/utils/consolidate-coins.test.ts
packages/account/src/utils/consolidate-coins.test.ts
import { ErrorCode } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { bn } from '@fuel-ts/math'; import type { CoinQuantity, Provider } from '..'; import { Account, Fuel, ScriptTransactionRequest } from '..'; import { MockConnector } from '../../test/fixtures/mocked...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/utils/split-coins-into-batches.test.ts
packages/account/src/utils/split-coins-into-batches.test.ts
import type { Coin } from '../providers'; import { splitCoinsIntoBatches } from './split-coins-into-batches'; const createMockCoins = (count: number): Coin[] => Array.from({ length: count }, (_, i) => ({ id: `${i}` }) as Coin); /** * @group node * @group browser */ describe('splitCoinsIntoBatches', () => { 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/account/src/utils/predicate-script-loader-instructions.ts
packages/account/src/utils/predicate-script-loader-instructions.ts
import { BigNumberCoder } from '@fuel-ts/abi-coder'; import { sha256 } from '@fuel-ts/hasher'; import { concat } from '@fuel-ts/utils'; import * as asm from '@fuels/vm-asm'; const BLOB_ID_SIZE = 32; const REG_ADDRESS_OF_DATA_AFTER_CODE = 0x10; const REG_START_OF_LOADED_CODE = 0x11; const REG_GENERAL_USE = 0x12; 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/account/src/predicate/predicate.ts
packages/account/src/predicate/predicate.ts
import type { JsonAbi, InputValue } from '@fuel-ts/abi-coder'; import { Interface } from '@fuel-ts/abi-coder'; import { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BytesLike } from '@fuel-ts/utils'; import { arrayify, hexlify } 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/account/src/predicate/index.ts
packages/account/src/predicate/index.ts
export * from './predicate'; export * from './utils/getPredicateRoot';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/predicate/utils/getPredicateRoot.test.ts
packages/account/src/predicate/utils/getPredicateRoot.test.ts
import { arrayify } from '@fuel-ts/utils'; import { getPredicateRoot } from './getPredicateRoot'; /** * @group node */ describe('getPredicateRoot', () => { it('should return the correct predicate root', () => { const predicateBytes = arrayify( '0x740000034700000000000000000000805dfcc00110fff3001aec50009...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/predicate/utils/index.ts
packages/account/src/predicate/utils/index.ts
export * from './getPredicateRoot';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/predicate/utils/getPredicateRoot.ts
packages/account/src/predicate/utils/getPredicateRoot.ts
import { hash } from '@fuel-ts/hasher'; import { calcRoot } from '@fuel-ts/merkle'; import { chunkAndPadBytes, hexlify, concat, arrayify } from '@fuel-ts/utils'; import type { BytesLike } from '@fuel-ts/utils'; /** * @hidden * * Calculates the predicate root for a given bytecode and chain ID. * * @param bytecode ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/fuel-connector.ts
packages/account/src/connectors/fuel-connector.ts
/* eslint-disable @typescript-eslint/require-await */ import { FuelError } from '@fuel-ts/errors'; import type { HashableMessage } from '@fuel-ts/hasher'; import { EventEmitter } from 'events'; import type { StartConsolidateCoins } from '../account'; import type { Asset } from '../assets/types'; import type { Transact...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/fuel.ts
packages/account/src/connectors/fuel.ts
import type { Address } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { Account } from '../account'; import { Provider } from '../providers'; import type { StorageAbstract } from '../wallet-manager'; import { FuelConnector } from './fuel-connector'; import { FuelConnectorMe...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/index.ts
packages/account/src/connectors/index.ts
export * from './fuel'; export * from './utils'; export * from './types'; export * from './fuel-connector';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/utils/dispatch-fuel-connector-event.ts
packages/account/src/connectors/utils/dispatch-fuel-connector-event.ts
import type { FuelConnector } from '../fuel-connector'; import { FuelConnectorEventType } from '../types'; /** * Fuel Connector Event is a custom event that can be used by the connector to * inform the Fuel Connector Manager that a new connector is available. */ export function dispatchFuelConnectorEvent(connector:...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/utils/cache.ts
packages/account/src/connectors/utils/cache.ts
/* eslint-disable no-param-reassign */ export type CacheFor = { [key: string]: { timeout: number; value: unknown; } | null; }; type CacheForOptions = { key: string; cache: CacheFor; cacheTime: number; }; export function cacheFor<F extends (...args: unknown[]) => Promise<unknown>>( fn: F, { cach...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/utils/promises.ts
packages/account/src/connectors/utils/promises.ts
import { FuelError } from '@fuel-ts/errors'; // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable @typescript-eslint/no-explicit-any */ export type DeferPromise<R = unknown> = { promise: Promise<R>; resolve: (value: R) => void; reject: (error: unknown) => void; }; export function d...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/utils/index.ts
packages/account/src/connectors/utils/index.ts
export * from './cache'; export * from './dispatch-fuel-connector-event'; export * from './promises';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/types/local-storage.ts
packages/account/src/connectors/types/local-storage.ts
/* eslint-disable @typescript-eslint/require-await */ import type { StorageAbstract } from '../../wallet-manager'; export class LocalStorage implements StorageAbstract { private storage: Storage; constructor(localStorage: Storage) { this.storage = localStorage; } async setItem(key: string, value: 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/account/src/connectors/types/connector-metadata.ts
packages/account/src/connectors/types/connector-metadata.ts
// #region fuel-connector-metadata export type ConnectorMetadata = { image?: | string | { light: string; dark: string; }; install: { action: string; link: string; description: string; }; }; // #endregion fuel-connector-metadata
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/types/data-type.ts
packages/account/src/connectors/types/data-type.ts
import type { JsonAbi } from '@fuel-ts/abi-coder'; import type { RequireAtLeastOne } from 'type-fest'; import type { TransactionRequest, TransactionStateFlag } from '../../providers'; import type { ProviderCacheJson, TransactionSummaryJson, } from '../../providers/utils/serialization'; /** * @name Version */ ex...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/types/index.ts
packages/account/src/connectors/types/index.ts
export * from './connector-metadata'; export * from './connector-types'; export * from './data-type'; export * from './events'; export * from './local-storage'; export * from './target-object';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/types/events.ts
packages/account/src/connectors/types/events.ts
import type { StartConsolidateCoins } from '../../account'; import type { Asset } from '../../assets/types'; import type { FuelConnector } from '../fuel-connector'; import type { FuelConnectorEventTypes } from './connector-types'; import type { Network } from './data-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/account/src/connectors/types/target-object.ts
packages/account/src/connectors/types/target-object.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Target Object that represents the global event bus used by Fuel Connector Manager. * On browser the default target is the window or document. For other environments * the event bus should be provided. */ export interface TargetObject { on?: (event: st...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/connectors/types/connector-types.ts
packages/account/src/connectors/types/connector-types.ts
export enum FuelConnectorMethods { // General methods ping = 'ping', version = 'version', // Connection methods connect = 'connect', disconnect = 'disconnect', isConnected = 'isConnected', // Account methods accounts = 'accounts', currentAccount = 'currentAccount', // Signature methods signTrans...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/asset-api.ts
packages/account/src/assets/asset-api.ts
import { B256Address } from "@fuel-ts/address"; import { NetworkEthereum, NetworkFuel } from "./types"; const networks = { mainnet: 'https://mainnet-explorer.fuel.network', testnet: 'https://explorer-indexer-testnet.fuel.network', } as const; export interface AssetPaginationOptions { last: number; } export int...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/assets.test.ts
packages/account/src/assets/assets.test.ts
/** * @group node * @group browser */ describe('assets', async () => { const { rawAssets, assets } = await import('./assets'); it.each(rawAssets)('$symbol should have icon not resolved to URL', ({ icon }) => { expect(icon).not.toContain('/'); }); it.each(assets)('$symbol should have icon resolved to UR...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/asset-api.test.ts
packages/account/src/assets/asset-api.test.ts
import { MOCK_ASSET_INFO_BY_OWNER, MOCK_BASE_ASSET, MOCK_FUEL_ASSET, MOCK_NFT_ASSET } from "../../test/fixtures/assets"; import { getAssetById, getAssetsByOwner, AssetInfo } from "./asset-api"; const mockFetch = () => { const jsonResponse = vi.fn(); const fetchSpy = vi.spyOn(global, 'fetch').mockResolvedValueOnce(...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/types.ts
packages/account/src/assets/types.ts
export type NetworkEthereum = { /** type of network */ type: 'ethereum'; /** chain id of the network */ chainId: number; /** number of decimals of the asset */ decimals: number; /** address of the asset contract */ address?: string; }; export type NetworkFuel = { /** type of network */ type: '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/account/src/assets/index.ts
packages/account/src/assets/index.ts
export * from './assets' export * from './asset-api' export * from './utils'; export * from './types';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/assets.ts
packages/account/src/assets/assets.ts
import { CHAIN_IDS } from '../providers/chains'; import type { Assets } from './types'; import { resolveIconPaths, fuelAssetsBaseUrl } from './utils'; export const rawAssets: Assets = [ { name: 'Ethereum', symbol: 'ETH', icon: 'eth.svg', networks: [ { type: 'ethereum', chainId:...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/network.test.ts
packages/account/src/assets/utils/network.test.ts
import { CHAIN_IDS } from '../../providers/chains'; import { assets } from '../assets'; import type { Asset } from '../types'; import { getAssetEth, getAssetFuel, getAssetWithNetwork, getDefaultChainId } from './network'; /** * @group node */ describe('Network Utils', () => { test('getDefaultChainId', () => { ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/url.test.ts
packages/account/src/assets/utils/url.test.ts
import { urlJoin } from './url'; /** * @group node */ describe('urlJoin', () => { it('should join paths correctly when baseUrl is provided', () => { const baseUrl = 'https://example.com'; const paths = ['path1', 'path2', 'path3']; const result = urlJoin(baseUrl, ...paths); expect(result).toBe('http...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/fuelAssetsBaseUrl.ts
packages/account/src/assets/utils/fuelAssetsBaseUrl.ts
export const fuelAssetsBaseUrl = 'https://assets.fuel.network/providers/'
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/url.ts
packages/account/src/assets/utils/url.ts
const DELIMITER_PATH = '/'; const trimRegex = /^\/|\/$/g; const trimPath = (path = '') => path.replace(trimRegex, ''); export function urlJoin(baseUrl: string | undefined, ...paths: Array<string>): string { const hasBaseUrl = baseUrl !== null && baseUrl !== undefined; const rootPath = baseUrl?.[0] === '/' && baseU...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/resolveIconPaths.ts
packages/account/src/assets/utils/resolveIconPaths.ts
import type { Assets } from '../types'; import { urlJoin } from './url'; /** * Returns the list of assets with the icon paths 'resolved'. eg. `./eth.svg` -> `https://some-url.com/eth.svg` * @param assets - List of assets * @param basePath - Base path for the icon URLs (default: './') * @returns The assets with th...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/resolveIconPaths.test.ts
packages/account/src/assets/utils/resolveIconPaths.test.ts
import { assets } from '..'; import { resolveIconPaths } from './resolveIconPaths'; /** * @group node */ describe('resolveIconPaths', () => { test('without basePath', () => { const result = resolveIconPaths(assets); assets.forEach((asset, index) => { expect(result[index].icon).toBe(`./${asset.icon}...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/index.ts
packages/account/src/assets/utils/index.ts
export * from './network'; export * from './resolveIconPaths'; export * from './url'; export * from './fuelAssetsBaseUrl'
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/assets/utils/network.ts
packages/account/src/assets/utils/network.ts
import { CHAIN_IDS } from '../../providers/chains'; import type { Asset, AssetEth, AssetFuel, NetworkEthereum, NetworkFuel } from '../types'; type Network = NetworkEthereum | NetworkFuel; export type NetworkTypes = NetworkEthereum['type'] | NetworkFuel['type']; type NetworkTypeToNetwork<T> = T extends 'ethereum' ? 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/account/src/providers/coin-quantity.ts
packages/account/src/providers/coin-quantity.ts
import type { BigNumberish, BN } from '@fuel-ts/math'; import { bn } from '@fuel-ts/math'; import type { BytesLike } from '@fuel-ts/utils'; import { hexlify } from '@fuel-ts/utils'; export type CoinQuantityLike = | [amount: BigNumberish, assetId: BytesLike, max?: BigNumberish] | { amount: BigNumberish; assetId: By...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/coin.ts
packages/account/src/providers/coin.ts
import type { Address } from '@fuel-ts/address'; import type { BN } from '@fuel-ts/math'; import type { BytesLike } from '@fuel-ts/utils'; /** * A Fuel coin */ export type Coin = { id: string; assetId: string; amount: BN; owner: Address; blockCreated: BN; txCreatedIdx: BN; predicate?: BytesLike; pred...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/message.ts
packages/account/src/providers/message.ts
import type { Address } from '@fuel-ts/address'; import type { BN } from '@fuel-ts/math'; import type { BytesLike } from '@fuel-ts/utils'; import type { GqlMessageState } from './__generated__/operations'; /** * A Fuel message */ export type Message = { messageId: BytesLike; sender: Address; recipient: Addres...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/resource-cache.ts
packages/account/src/providers/resource-cache.ts
import { FuelError, ErrorCode } from '@fuel-ts/errors'; import { hexlify } from '@fuel-ts/utils'; import { isRequestInputCoin, isRequestInputCoinOrMessage } from './transaction-request'; import type { CoinTransactionRequestInput, MessageTransactionRequestInput, TransactionRequestInput, } from './transaction-requ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/provider.test.ts
packages/account/src/providers/provider.test.ts
import { Address, getRandomB256 } from '@fuel-ts/address'; import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { randomBytes, randomUUID } from '@fuel-ts/crypto'; import { FuelError, ErrorCode } from '@fuel-ts/errors'; import { expectToThrowFuelError, safeExec } from '@fuel-ts/errors/test-utils'; import { BN...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
true
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/chains.ts
packages/account/src/providers/chains.ts
export const CHAIN_IDS = { eth: { mainnet: 1, sepolia: 11155111, foundry: 31337, }, fuel: { devnet: 0, testnet: 0, mainnet: 9889, }, };
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/provider.ts
packages/account/src/providers/provider.ts
import type { AddressInput } from '@fuel-ts/address'; import { Address, isB256 } from '@fuel-ts/address'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BigNumberish, BN } from '@fuel-ts/math'; import { bn } from '@fuel-ts/math'; import type { Transaction } from '@fuel-ts/transactions'; import { ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
true
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/assemble-tx-helpers.ts
packages/account/src/providers/assemble-tx-helpers.ts
import { FuelError, ErrorCode } from '@fuel-ts/errors'; import { bn } from '@fuel-ts/math'; import type { BigNumberish, BN } from '@fuel-ts/math'; import { TransactionType } from '@fuel-ts/transactions'; import { hexlify, isDefined } from '@fuel-ts/utils'; import type { Predicate } from '../predicate'; import type { A...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/coin-quantityfy.test.ts
packages/account/src/providers/coin-quantityfy.test.ts
import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { BN } from '@fuel-ts/math'; import { coinQuantityfy } from './coin-quantity'; /** * @group node */ describe('coinQuantityfy', () => { const baseAssetId = ZeroBytes32; it('amount that is less than 1 is rounded to 0', () => { expect(coinQuantity...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/resource-cache.test.ts
packages/account/src/providers/resource-cache.test.ts
import { Address } from '@fuel-ts/address'; import { randomBytes } from '@fuel-ts/crypto'; import { ErrorCode } from '@fuel-ts/errors'; import { safeExec, expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { hexlify } from '@fuel-ts/utils'; import { setupTestProviderAndWallets, TestMessage } from '../t...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/fuel-graphql-subscriber.ts
packages/account/src/providers/fuel-graphql-subscriber.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { DocumentNode } from 'graphql'; import { print } from 'graphql'; import { assertGqlResponseHasNoErrors } from './utils/handle-gql-error-message'; type FuelGraphQLSubscriberOptions = { url: string; query: DocumentNode; variables?: Record<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/account/src/providers/index.ts
packages/account/src/providers/index.ts
/// <reference types="graphql" /> export * from './coin-quantity'; export * from './coin'; export * from './provider'; export * from './message'; export * from './resource'; export { default as Provider } from './provider'; export * from './transaction-request'; export * from './transaction-response'; export * from '....
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/resource.ts
packages/account/src/providers/resource.ts
import type { BytesLike } from '@fuel-ts/utils'; import type { Coin } from './coin'; import type { MessageCoin } from './message'; export type RawCoin = { utxoId: string; owner: string; amount: string; assetId: string; blockCreated: string; txCreatedIdx: string; }; export type RawMessage = { amount: st...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/transaction-response/getAllDecodedLogs.ts
packages/account/src/providers/transaction-response/getAllDecodedLogs.ts
import type { JsonAbi } from '@fuel-ts/abi-coder'; import { Interface, BigNumberCoder } from '@fuel-ts/abi-coder'; import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { ReceiptType } from '@fuel-ts/transactions'; import type { TransactionResultCallReceipt, TransactionResultReceipt, } 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/account/src/providers/transaction-response/transaction-response.ts
packages/account/src/providers/transaction-response/transaction-response.ts
/* eslint-disable @typescript-eslint/naming-convention */ import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { BN } from '@fuel-ts/math'; import { bn } from '@fuel-ts/math'; import type { ReceiptCall, ReceiptLog, ReceiptLogData, ReceiptPanic, ReceiptReturn, ReceiptReturnData, ReceiptReve...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/transaction-response/getDecodedLogs.ts
packages/account/src/providers/transaction-response/getDecodedLogs.ts
import type { JsonAbi } from '@fuel-ts/abi-coder'; import { Interface, BigNumberCoder } from '@fuel-ts/abi-coder'; import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { ReceiptType } from '@fuel-ts/transactions'; import type { TransactionResultCallReceipt, TransactionResultReceipt, } 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/account/src/providers/transaction-response/index.ts
packages/account/src/providers/transaction-response/index.ts
export * from './transaction-response'; export * from './getDecodedLogs'; export * from './getAllDecodedLogs';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/auto-retry-fetch.ts
packages/account/src/providers/utils/auto-retry-fetch.ts
import { sleep } from '@fuel-ts/utils'; import type { ProviderOptions } from '../provider'; type Backoff = 'linear' | 'exponential' | 'fixed'; /** * Retry options scheme */ export type RetryOptions = { /** * Amount of attempts to retry before failing the call. */ maxRetries: number; /** * Backoff st...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/receipts.ts
packages/account/src/providers/utils/receipts.ts
import type { ReceiptPanic, ReceiptRevert } from '@fuel-ts/transactions'; import { ReceiptType } from '@fuel-ts/transactions'; import { FAILED_TRANSFER_TO_ADDRESS_SIGNAL } from '@fuel-ts/transactions/configs'; import type { TransactionReceiptJson } from '../provider'; import type { TransactionResultReceipt } from '../...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/merge-quantities.ts
packages/account/src/providers/utils/merge-quantities.ts
import type { BN } from '@fuel-ts/math'; import type { CoinQuantity } from '../coin-quantity'; export const mergeQuantities = (...coinQuantities: CoinQuantity[][]): CoinQuantity[] => { const resultMap: { [key: string]: BN } = {}; function addToMap({ amount, assetId }: CoinQuantity) { if (resultMap[assetId]) ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/handle-gql-error-message.test.ts
packages/account/src/providers/utils/handle-gql-error-message.test.ts
import { ErrorCode } from '@fuel-ts/errors'; import { expectToThrowFuelError } from '@fuel-ts/errors/test-utils'; import { setupTestProviderAndWallets } from '../../test-utils'; import { Wallet } from '../../wallet'; import { ScriptTransactionRequest } from '../transaction-request'; /** * @group node * @group brows...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/validate-pagination-args.ts
packages/account/src/providers/utils/validate-pagination-args.ts
import { FuelError, ErrorCode } from '@fuel-ts/errors'; import type { CursorPaginationArgs } from '../provider'; /** * @hidden */ export const validatePaginationArgs = (params: { inputArgs?: CursorPaginationArgs; paginationLimit: number; }): CursorPaginationArgs => { const { paginationLimit, inputArgs = {} } ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/json.ts
packages/account/src/providers/utils/json.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable no-param-reassign */ import { hexlify } from '@fuel-ts/utils'; import { clone } from 'ramda'; // When parsing a Transaction to JSON we need // to convert special types into each respective // JSON friendly value. This enables a tx to be // strin...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/handle-gql-error-message.ts
packages/account/src/providers/utils/handle-gql-error-message.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; import type { GraphQLError } from 'graphql'; const ASSET_ID_REGEX: RegExp = /[0-9a-fA-F]{32,64}/g; const gqlErrorMessage = { RPC_CONSISTENCY: /The required fuel block height is higher than the current block height. Required: \d+, Current: \d+/, INSUFFICI...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/block-explorer.test.ts
packages/account/src/providers/utils/block-explorer.test.ts
import { buildBlockExplorerUrl } from './block-explorer'; const DEFAULT_BLOCK_EXPLORER_URL = 'https://app.fuel.network'; const trimSlashes = /^\/|\/$/gm; const testBlockExplorerUrlWithInputs = ({ baseBlockExplorerUrl, path, providerUrl, }: { baseBlockExplorerUrl: string; path: string; providerUrl: 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/account/src/providers/utils/extract-tx-error.ts
packages/account/src/providers/utils/extract-tx-error.ts
import type { JsonAbi, JsonAbiErrorCode } from '@fuel-ts/abi-coder'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { bn } from '@fuel-ts/math'; import { ReceiptType } from '@fuel-ts/transactions'; import { FAILED_REQUIRE_SIGNAL, FAILED_ASSERT_EQ_SIGNAL, FAILED_ASSERT_NE_SIGNAL, FAILED_ASSERT_SI...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/receipts.test.ts
packages/account/src/providers/utils/receipts.test.ts
import { BN, bn } from '@fuel-ts/math'; import type { ReceiptBurn, ReceiptCall, ReceiptLog, ReceiptLogData, ReceiptMessageOut, ReceiptMint, ReceiptPanic, ReceiptReturn, ReceiptReturnData, ReceiptRevert, ReceiptScriptResult, ReceiptTransfer, ReceiptTransferOut, } from '@fuel-ts/transactions'; 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/account/src/providers/utils/block-explorer.ts
packages/account/src/providers/utils/block-explorer.ts
import { ErrorCode, FuelError } from '@fuel-ts/errors'; const DEFAULT_BLOCK_EXPLORER_URL = 'https://app.fuel.network'; /** @hidden */ const getPathFromInput = ( key: BuildBlockExplorerUrlHelperParam, value: string | number | undefined ) => { const pathMap = { address: `address`, txId: `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/account/src/providers/utils/parse-graphql-response.ts
packages/account/src/providers/utils/parse-graphql-response.ts
import { FuelGraphqlSubscriber } from '../fuel-graphql-subscriber'; type ParseGraphqlResponseReturns = { extensions: { current_fuel_block_height?: number; fuel_block_height_precondition_failed: boolean; }; }; export const parseGraphqlResponse = async (options: { response: Response; isSubscription: boo...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/merge-quantities.test.ts
packages/account/src/providers/utils/merge-quantities.test.ts
import { bn } from '@fuel-ts/math'; import { ASSET_A, ASSET_B } from '@fuel-ts/utils/test-utils'; import type { CoinQuantity } from '../coin-quantity'; import { mergeQuantities } from './merge-quantities'; /** * @group node */ describe('mergeQuantities', () => { it('combines non-overlapping coin quantities', () ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/auto-retry-fetch.test.ts
packages/account/src/providers/utils/auto-retry-fetch.test.ts
import { safeExec } from '@fuel-ts/errors/test-utils'; import type { RetryOptions } from './auto-retry-fetch'; import { autoRetryFetch, getWaitDelay } from './auto-retry-fetch'; /** * @group node * @group browser */ describe('getWaitDelay', () => { const maxRetries = 10; const baseDelay = 10; it('should get...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/gas.ts
packages/account/src/providers/utils/gas.ts
import { bn } from '@fuel-ts/math'; import type { BN, BNInput } from '@fuel-ts/math'; import { ReceiptType, type Input } from '@fuel-ts/transactions'; import { arrayify } from '@fuel-ts/utils'; import type { GqlDependentCost, GqlHeavyOperation, GqlLightOperation, } from '../__generated__/operations'; import 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/account/src/providers/utils/serialization.ts
packages/account/src/providers/utils/serialization.ts
import { ZeroBytes32 } from '@fuel-ts/address/configs'; import { ErrorCode, FuelError } from '@fuel-ts/errors'; import { bn } from '@fuel-ts/math'; import type { Output, ReceiptBurn, ReceiptCall, ReceiptLog, ReceiptLogData, ReceiptMessageOut, ReceiptMint, ReceiptPanic, ReceiptReturn, ReceiptReturnDa...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/extract-tx-error.test.ts
packages/account/src/providers/utils/extract-tx-error.test.ts
import { PANIC_REASONS } from '@fuel-ts/transactions/configs'; import * as asm from '@fuels/vm-asm'; /** * @group node * @group browser */ describe('extractTxError', () => { it('should ensure all panic reasons are present within PANIC_REASONS constant', async () => { // @ts-expect-error method reference missi...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/serialization.test.ts
packages/account/src/providers/utils/serialization.test.ts
import { hexlify } from '@fuel-ts/utils'; import { ASSET_A } from '@fuel-ts/utils/test-utils'; import { setupTestProviderAndWallets } from '../../test-utils'; import Provider from '../provider'; import { deserializeChain, serializeChain, deserializeNodeInfo, serializeNodeInfo, serializeProviderCache, dese...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/transaction-response-serialization.test.ts
packages/account/src/providers/utils/transaction-response-serialization.test.ts
import { setupTestProviderAndWallets } from '../../test-utils'; import { TransactionResponse } from '../transaction-response'; import { serializeTransactionResponseJson, deserializeTransactionResponseJson, } from './transaction-response-serialization'; /** * @group node * @group browser */ describe('Transactio...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/gas.test.ts
packages/account/src/providers/utils/gas.test.ts
import { BN, bn } from '@fuel-ts/math'; import { ReceiptType, type InputCoin, type InputMessage } from '@fuel-ts/transactions'; import { arrayify } from '@fuel-ts/utils'; import { MOCK_CHAIN } from '../../../test/fixtures/chain'; import { MOCK_COIN_INPUT, MOCK_MESSAGE_INPUT, MOCK_REQUEST_COIN_INPUT, MOCK_REQUE...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/json.test.ts
packages/account/src/providers/utils/json.test.ts
import { Address } from '@fuel-ts/address'; import { BN, bn } from '@fuel-ts/math'; import { normalizeJSON } from './json'; /** * @group node */ describe('JSON parser', () => { test('normalizeJSON object', () => { const bytesValue = Uint8Array.from([1, 2, 3, 4]); const address = Address.fromRandom(); ...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/index.ts
packages/account/src/providers/utils/index.ts
export * from './receipts'; export * from './block-explorer'; export * from './gas'; export * from './json'; export * from './extract-tx-error'; export * from './merge-quantities'; export * from './serialization';
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false
FuelLabs/fuels-ts
https://github.com/FuelLabs/fuels-ts/blob/9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2/packages/account/src/providers/utils/transaction-response-serialization.ts
packages/account/src/providers/utils/transaction-response-serialization.ts
import Provider from '../provider'; import { transactionRequestify } from '../transaction-request'; import { TransactionResponse } from '../transaction-response'; import type { TransactionResponseJson } from '../transaction-response'; import { serializeProviderCache } from './serialization'; /** * NOTE: These helper...
typescript
Apache-2.0
9a7b69726b3181a0c2c8f0dd2da83e86774ed1b2
2026-01-04T15:46:46.933446Z
false