@hugomrdias/fil 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -2
- package/bin/fil.js +7 -0
- package/dist/chunks/_esm-BBXTTBLC.js +9 -0
- package/dist/chunks/_esm-BBXTTBLC.js.map +7 -0
- package/dist/chunks/ccip-TGFMQFIR.js +3 -0
- package/dist/chunks/ccip-TGFMQFIR.js.map +7 -0
- package/dist/chunks/chunk-2KPBBDBJ.js +3 -0
- package/dist/chunks/chunk-2KPBBDBJ.js.map +7 -0
- package/dist/chunks/chunk-35V77X3C.js +12 -0
- package/dist/chunks/chunk-35V77X3C.js.map +7 -0
- package/dist/chunks/chunk-46FBFEBX.js +3 -0
- package/dist/chunks/chunk-46FBFEBX.js.map +7 -0
- package/dist/chunks/chunk-4BBXH7CB.js +6 -0
- package/dist/chunks/chunk-4BBXH7CB.js.map +7 -0
- package/dist/chunks/chunk-4DUACCJB.js +186 -0
- package/dist/chunks/chunk-4DUACCJB.js.map +7 -0
- package/dist/chunks/chunk-5EYSPKTK.js +3 -0
- package/dist/chunks/chunk-5EYSPKTK.js.map +7 -0
- package/dist/chunks/chunk-7MEK5RQ7.js +11 -0
- package/dist/chunks/chunk-7MEK5RQ7.js.map +7 -0
- package/dist/chunks/chunk-7WN6TT5U.js +4 -0
- package/dist/chunks/chunk-7WN6TT5U.js.map +7 -0
- package/dist/chunks/chunk-CU3SGKNA.js +3 -0
- package/dist/chunks/chunk-CU3SGKNA.js.map +7 -0
- package/dist/chunks/chunk-EDF5XCIN.js +4 -0
- package/dist/chunks/chunk-EDF5XCIN.js.map +7 -0
- package/dist/chunks/chunk-GVAFHRPJ.js +124 -0
- package/dist/chunks/chunk-GVAFHRPJ.js.map +7 -0
- package/dist/chunks/chunk-IJ2NNDTJ.js +3 -0
- package/dist/chunks/chunk-IJ2NNDTJ.js.map +7 -0
- package/dist/chunks/chunk-ISML2NA2.js +3 -0
- package/dist/chunks/chunk-ISML2NA2.js.map +7 -0
- package/dist/chunks/chunk-KAQPCD23.js +4 -0
- package/dist/chunks/chunk-KAQPCD23.js.map +7 -0
- package/dist/chunks/chunk-LOTWVNDB.js +3 -0
- package/dist/chunks/chunk-LOTWVNDB.js.map +7 -0
- package/dist/chunks/chunk-NPYAGWD6.js +4 -0
- package/dist/chunks/chunk-NPYAGWD6.js.map +7 -0
- package/dist/chunks/chunk-QYPR6473.js +3 -0
- package/dist/chunks/chunk-QYPR6473.js.map +7 -0
- package/dist/chunks/chunk-RK6JJQZL.js +41 -0
- package/dist/chunks/chunk-RK6JJQZL.js.map +7 -0
- package/dist/chunks/chunk-UJQDDRQD.js +59 -0
- package/dist/chunks/chunk-UJQDDRQD.js.map +7 -0
- package/dist/chunks/chunk-UVXTIEPU.js +4 -0
- package/dist/chunks/chunk-UVXTIEPU.js.map +7 -0
- package/dist/chunks/chunk-VTR7BON5.js +4 -0
- package/dist/chunks/chunk-VTR7BON5.js.map +7 -0
- package/dist/chunks/chunk-XQRC2SUG.js +4 -0
- package/dist/chunks/chunk-XQRC2SUG.js.map +7 -0
- package/dist/chunks/chunk-YIAP3JO3.js +3 -0
- package/dist/chunks/chunk-YIAP3JO3.js.map +7 -0
- package/dist/chunks/chunk-ZD6MKB4J.js +5 -0
- package/dist/chunks/chunk-ZD6MKB4J.js.map +7 -0
- package/dist/chunks/delete-XVYLEMHB.js +3 -0
- package/dist/chunks/delete-XVYLEMHB.js.map +7 -0
- package/dist/chunks/doctor-2W65SQJS.js +3 -0
- package/dist/chunks/doctor-2W65SQJS.js.map +7 -0
- package/dist/chunks/get-ZP66WVWT.js +3 -0
- package/dist/chunks/get-ZP66WVWT.js.map +7 -0
- package/dist/chunks/inspect-HV2SQPTB.js +3 -0
- package/dist/chunks/inspect-HV2SQPTB.js.map +7 -0
- package/dist/chunks/inspect-PQCV7LQT.js +3 -0
- package/dist/chunks/inspect-PQCV7LQT.js.map +7 -0
- package/dist/chunks/login-GQ4PM7SA.js +4 -0
- package/dist/chunks/login-GQ4PM7SA.js.map +7 -0
- package/dist/chunks/logout-7N23QWWM.js +3 -0
- package/dist/chunks/logout-7N23QWWM.js.map +7 -0
- package/dist/chunks/ls-7XYH5VPL.js +3 -0
- package/dist/chunks/ls-7XYH5VPL.js.map +7 -0
- package/dist/chunks/ls-ARM57VNR.js +3 -0
- package/dist/chunks/ls-ARM57VNR.js.map +7 -0
- package/dist/chunks/map-error-7POTPJ7R.js +3 -0
- package/dist/chunks/map-error-7POTPJ7R.js.map +7 -0
- package/dist/chunks/put-EHRNCZHT.js +3 -0
- package/dist/chunks/put-EHRNCZHT.js.map +7 -0
- package/dist/chunks/resume-RLZB7L3C.js +3 -0
- package/dist/chunks/resume-RLZB7L3C.js.map +7 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js +3 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js.map +7 -0
- package/dist/chunks/skills.run-IDY347MW.js +5 -0
- package/dist/chunks/skills.run-IDY347MW.js.map +7 -0
- package/dist/chunks/status-D4CXVYRA.js +3 -0
- package/dist/chunks/status-D4CXVYRA.js.map +7 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +52 -3
- package/skills/fil/SKILL.md +28 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/.pnpm/@filoz+synapse-core@0.10.0_typescript@7.0.2_viem@2.57.2_typescript@7.0.2_zod@4.6.5_/node_modules/@filoz/synapse-core/src/pay/get-rail.ts", "../../../../node_modules/.pnpm/@filoz+synapse-core@0.10.0_typescript@7.0.2_viem@2.57.2_typescript@7.0.2_zod@4.6.5_/node_modules/@filoz/synapse-core/src/pay/get-rails-for-payer-and-token.ts", "../../../../node_modules/.pnpm/@filoz+synapse-core@0.10.0_typescript@7.0.2_viem@2.57.2_typescript@7.0.2_zod@4.6.5_/node_modules/@filoz/synapse-core/src/pay/total-account-fixed-lockup.ts", "../../../../node_modules/.pnpm/@filoz+synapse-core@0.10.0_typescript@7.0.2_viem@2.57.2_typescript@7.0.2_zod@4.6.5_/node_modules/@filoz/synapse-core/src/pay/get-account-summary.ts", "../../src/handlers/status.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Simplify } from 'type-fest'\nimport type {\n Address,\n Chain,\n Client,\n ContractFunctionParameters,\n ContractFunctionReturnType,\n ReadContractErrorType,\n Transport,\n} from 'viem'\nimport { readContract } from 'viem/actions'\nimport type { filecoinPay as paymentsAbi } from '../abis/index.ts'\nimport { asChain } from '../chains.ts'\nimport type { ActionCallChain } from '../types.ts'\n\nexport namespace getRail {\n export type OptionsType = {\n /** The rail ID to query */\n railId: bigint\n /** Payments contract address. If not provided, the default is the payments contract address for the chain. */\n contractAddress?: Address\n }\n\n export type ContractOutputType = ContractFunctionReturnType<typeof paymentsAbi, 'pure' | 'view', 'getRail'>\n\n /**\n * The rail information from the payments contract.\n */\n export type OutputType = {\n /** The address of the ERC20 token used for payments */\n token: Address\n /** The address of the payer */\n from: Address\n /** The address of the payee */\n to: Address\n /** The address of the operator */\n operator: Address\n /** The address of the validator */\n validator: Address\n /** Payment rate per epoch (in token base units) */\n paymentRate: bigint\n /** Lockup period in epochs */\n lockupPeriod: bigint\n /** Fixed lockup amount (in token base units) */\n lockupFixed: bigint\n /** Epoch up to which the rail has been settled */\n settledUpTo: bigint\n /** End epoch (0 for active rails, > 0 for terminated rails) */\n endEpoch: bigint\n /** Commission rate in basis points (e.g., 500 = 5%) */\n commissionRateBps: bigint\n /** Address that receives service fees */\n serviceFeeRecipient: Address\n }\n\n export type ErrorType = getRailCall.ErrorType | ReadContractErrorType\n}\n\n/**\n * Get rail information from the Filecoin Pay contract\n *\n * Returns detailed information about a payment rail including payer, payee, payment rate,\n * lockup details, settlement status, and termination status.\n *\n * @param client - The client to use to get the rail info.\n * @param options - {@link getRail.OptionsType}\n * @returns The rail information {@link getRail.OutputType}\n * @throws Errors {@link getRail.ErrorType}\n *\n * @example\n * ```ts\n * import { getRail } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const rail = await getRail(client, {\n * railId: 1n,\n * })\n *\n * console.log('Payer:', rail.from)\n * console.log('Payee:', rail.to)\n * console.log('Payment rate:', rail.paymentRate)\n * console.log('Is terminated:', rail.endEpoch > 0n)\n * ```\n */\nexport async function getRail(\n client: Client<Transport, Chain>,\n options: getRail.OptionsType\n): Promise<getRail.OutputType> {\n return readContract(\n client,\n getRailCall({\n chain: client.chain,\n railId: options.railId,\n contractAddress: options.contractAddress,\n })\n )\n}\n\nexport namespace getRailCall {\n export type OptionsType = Simplify<getRail.OptionsType & ActionCallChain>\n export type ErrorType = asChain.ErrorType\n export type OutputType = ContractFunctionParameters<typeof paymentsAbi, 'pure' | 'view', 'getRail'>\n}\n\n/**\n * Create a call to the getRail function\n *\n * This function is used to create a call to the getRail function for use with the multicall or readContract function.\n *\n * @param options - {@link getRailCall.OptionsType}\n * @returns The call to the getRail function {@link getRailCall.OutputType}\n * @throws Errors {@link getRailCall.ErrorType}\n *\n * @example\n * ```ts\n * import { getRailCall } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { multicall } from 'viem/actions'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const results = await multicall(client, {\n * contracts: [\n * getRailCall({\n * chain: calibration,\n * railId: 1n,\n * }),\n * ],\n * })\n *\n * console.log(results[0])\n * ```\n */\nexport function getRailCall(options: getRailCall.OptionsType) {\n const chain = asChain(options.chain)\n\n return {\n abi: chain.contracts.filecoinPay.abi,\n address: options.contractAddress ?? chain.contracts.filecoinPay.address,\n functionName: 'getRail',\n args: [options.railId],\n } satisfies getRailCall.OutputType\n}\n", "import type {\n Address,\n Chain,\n Client,\n ContractFunctionParameters,\n ContractFunctionReturnType,\n ReadContractErrorType,\n Transport,\n} from 'viem'\nimport { readContract } from 'viem/actions'\nimport type { filecoinPay as paymentsAbi } from '../abis/index.ts'\nimport { asChain } from '../chains.ts'\nimport { type PageWithTotal, type PaginationOptions, type paginate, resolvePagination } from '../pagination.ts'\nimport type { PaginatedActionCallOptions } from '../types.ts'\nimport type { RailInfo } from './types.ts'\n\nexport namespace getRailsForPayerAndToken {\n export type OptionsType = PaginationOptions & {\n /** The address of the payer to query */\n payer: Address\n /** The address of the ERC20 token to filter by. If not provided, the USDFC token address will be used. */\n token?: Address\n /** Payments contract address. If not provided, the default is the payments contract address for the chain. */\n contractAddress?: Address\n }\n\n export type ContractOutputType = ContractFunctionReturnType<\n typeof paymentsAbi,\n 'pure' | 'view',\n 'getRailsForPayerAndToken'\n >\n\n /**\n * Paginated rail results for a payer and token.\n */\n /** A rail page. `total` is the contract's underlying rail-slot count, including skipped or finalized slots. */\n export type OutputType = PageWithTotal<RailInfo>\n\n export type ErrorType = getRailsForPayerAndTokenCall.ErrorType | ReadContractErrorType | resolvePagination.ErrorType\n}\n\n/**\n * Get one bounded page of rails for a payer and token.\n *\n * Pass the returned `nextCursor` back as `cursor`; treat it as opaque. Use\n * {@link paginate} to traverse every page. `total` is the contract's underlying\n * rail-slot count, including slots skipped because their rails were finalized.\n *\n * @param client - The client to use to get the rails.\n * @param options - {@link getRailsForPayerAndToken.OptionsType}\n * @returns Paginated rail results {@link getRailsForPayerAndToken.OutputType}\n * @throws Errors {@link getRailsForPayerAndToken.ErrorType}\n *\n * @example Read the first page\n * ```ts\n * import { getRailsForPayerAndToken } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const payer = '0x1234567890123456789012345678901234567890'\n * const page = await getRailsForPayerAndToken(client, { payer })\n * console.log(page.items, page.nextCursor, page.total)\n * ```\n *\n * @example Iterate over every page\n * ```ts\n * import { paginate } from '@filoz/synapse-core'\n * import { getRailsForPayerAndToken } from '@filoz/synapse-core/pay'\n *\n * for await (const rail of paginate(({ cursor }) =>\n * getRailsForPayerAndToken(client, { payer, cursor })\n * )) {\n * console.log(`Rail ${rail.railId}: ${rail.isTerminated ? 'Terminated' : 'Active'}`)\n * }\n * ```\n */\nexport async function getRailsForPayerAndToken(\n client: Client<Transport, Chain>,\n options: getRailsForPayerAndToken.OptionsType\n): Promise<getRailsForPayerAndToken.OutputType> {\n const { cursor, limit } = resolvePagination(options, 100n)\n const data = await readContract(\n client,\n getRailsForPayerAndTokenCall({\n chain: client.chain,\n payer: options.payer,\n token: options.token,\n offset: cursor,\n limit,\n contractAddress: options.contractAddress,\n })\n )\n\n return parseGetRailsForPayerAndToken(data)\n}\n\nexport namespace getRailsForPayerAndTokenCall {\n export type OptionsType = PaginatedActionCallOptions<getRailsForPayerAndToken.OptionsType, 'offset'>\n export type ErrorType = asChain.ErrorType\n export type OutputType = ContractFunctionParameters<typeof paymentsAbi, 'pure' | 'view', 'getRailsForPayerAndToken'>\n}\n\n/**\n * Create a call to the getRailsForPayerAndToken function\n *\n * This function is used to create a call to the getRailsForPayerAndToken function for use with the multicall or readContract function.\n *\n * To get the same output type as the action, use {@link parseGetRailsForPayerAndToken} to transform the contract output.\n *\n * @param options - {@link getRailsForPayerAndTokenCall.OptionsType}\n * @returns The call to the getRailsForPayerAndToken function {@link getRailsForPayerAndTokenCall.OutputType}\n * @throws Errors {@link getRailsForPayerAndTokenCall.ErrorType}\n *\n * @example\n * ```ts\n * import { getRailsForPayerAndTokenCall } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { multicall } from 'viem/actions'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const results = await multicall(client, {\n * contracts: [\n * getRailsForPayerAndTokenCall({\n * chain: calibration,\n * payer: '0x1234567890123456789012345678901234567890',\n * token: calibration.contracts.usdfc.address,\n * offset: 0n,\n * limit: 10n,\n * }),\n * ],\n * })\n *\n * console.log(results[0])\n * ```\n */\nexport function getRailsForPayerAndTokenCall(options: getRailsForPayerAndTokenCall.OptionsType) {\n const chain = asChain(options.chain)\n const token = options.token ?? chain.contracts.usdfc.address\n\n return {\n abi: chain.contracts.filecoinPay.abi,\n address: options.contractAddress ?? chain.contracts.filecoinPay.address,\n functionName: 'getRailsForPayerAndToken',\n args: [options.payer, token, options.offset, options.limit],\n } satisfies getRailsForPayerAndTokenCall.OutputType\n}\n\n/**\n * Parse raw payer-rail contract output into a normalized page with a total.\n *\n * The contract's `results` tuple is mapped to `items`, including finalized and\n * skipped rail slots. `nextOffset` becomes `nextCursor` only when it is less\n * than `total`; `total` is the underlying rail-slot count.\n *\n * @param data - Raw contract output {@link getRailsForPayerAndToken.ContractOutputType}\n * @returns A normalized rail page {@link getRailsForPayerAndToken.OutputType}\n */\nexport function parseGetRailsForPayerAndToken(\n data: getRailsForPayerAndToken.ContractOutputType\n): getRailsForPayerAndToken.OutputType {\n return {\n items: data[0].map((rail) => ({\n railId: rail.railId,\n isTerminated: rail.isTerminated,\n endEpoch: rail.endEpoch,\n })),\n ...(data[1] < data[2] ? { nextCursor: data[1] } : {}),\n total: data[2],\n }\n}\n", "import type { Address, Chain, Client, MulticallErrorType, Transport } from 'viem'\nimport { multicall } from 'viem/actions'\nimport { paginate } from '../pagination.ts'\nimport { getRailCall } from './get-rail.ts'\nimport { getRailsForPayerAndToken } from './get-rails-for-payer-and-token.ts'\n\nexport namespace totalAccountFixedLockup {\n export type OptionsType = {\n /** The address of the account to query. */\n address: Address\n /** The address of the ERC20 token to query. If not provided, the USDFC token address will be used. */\n token?: Address\n /** Payments contract address. If not provided, the default is the payments contract address for the chain. */\n contractAddress?: Address\n }\n\n export type OutputType = {\n /** Sum of lockupFixed across all rails (including terminated but not yet finalized) */\n totalFixedLockup: bigint\n }\n\n export type ErrorType = getRailsForPayerAndToken.ErrorType | MulticallErrorType\n}\n\n/**\n * Get the total fixed lockup across all rails for an account.\n *\n * Fetches all rails for the payer, then batches `getRail` calls via multicall\n * to sum `lockupFixed`. Includes terminated-but-not-finalized rails since they\n * still hold locked funds until finalization.\n *\n * @param client - The client to use to get the total account fixed lockup.\n * @param options - {@link totalAccountFixedLockup.OptionsType}\n * @returns The total fixed lockup and active rail count {@link totalAccountFixedLockup.OutputType}\n * @throws Errors {@link totalAccountFixedLockup.ErrorType}\n *\n * @example\n * ```ts\n * import { totalAccountFixedLockup } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const lockup = await totalAccountFixedLockup(client, {\n * address: '0x1234567890123456789012345678901234567890',\n * })\n *\n * console.log('Total fixed lockup:', lockup.totalFixedLockup)\n * ```\n */\nexport async function totalAccountFixedLockup(\n client: Client<Transport, Chain>,\n options: totalAccountFixedLockup.OptionsType\n): Promise<totalAccountFixedLockup.OutputType> {\n let totalFixedLockup = 0n\n let rails: Array<getRailsForPayerAndToken.OutputType['items'][number]> = []\n\n const processPage = async () => {\n if (rails.length > 0) {\n const railDetails = await multicall(client, {\n allowFailure: false,\n contracts: rails.map((rail) =>\n getRailCall({\n chain: client.chain,\n railId: rail.railId,\n contractAddress: options.contractAddress,\n })\n ),\n })\n for (const rail of railDetails) {\n totalFixedLockup += rail.lockupFixed\n }\n }\n rails = []\n }\n\n for await (const rail of paginate(({ cursor }) =>\n getRailsForPayerAndToken(client, {\n payer: options.address,\n token: options.token,\n contractAddress: options.contractAddress,\n cursor,\n limit: 100n,\n })\n )) {\n rails.push(rail)\n if (rails.length === 100) {\n await processPage()\n }\n }\n await processPage()\n return { totalFixedLockup }\n}\n", "import type { Address, Chain, Client, Transport } from 'viem'\nimport { getBlockNumber } from 'viem/actions'\nimport { TIME_CONSTANTS } from '../utils/constants.ts'\nimport { calculateAccountDebt } from './account-debt.ts'\nimport { accounts } from './accounts.ts'\nimport { resolveAccountState } from './resolve-account-state.ts'\nimport { totalAccountFixedLockup } from './total-account-fixed-lockup.ts'\n\nexport namespace getAccountSummary {\n export type OptionsType = {\n /** The address of the account to query. */\n address: Address\n /** The address of the ERC20 token to query. If not provided, the USDFC token address will be used. */\n token?: Address\n /** Epoch to evaluate at. If not provided, current block number is fetched. */\n epoch?: bigint\n /** Payments contract address. If not provided, the default is the payments contract address for the chain. */\n contractAddress?: Address\n }\n\n export type OutputType = {\n /** Total deposited funds in the contract. */\n funds: bigint\n /**\n * Funds available for withdrawal or new rail commitments at `epoch`.\n * Equal to `funds - totalLockup`, the *unreserved* portion described on\n * {@link runwayInEpochs}. Active payments draw from this; once it reaches\n * zero, settlement halts.\n */\n availableFunds: bigint\n /**\n * Outstanding payment obligation that couldn't be moved into\n * `lockupCurrent` because `funds` was insufficient. `0n` when the account\n * is healthy; positive when in deficit. Effectively the gap between the\n * lockup the account should be holding and what it actually holds.\n */\n debt: bigint\n\n /** Per-epoch lockup rate (aggregate across all rails). */\n lockupRatePerEpoch: bigint\n /** Per-month lockup rate (`lockupRatePerEpoch * EPOCHS_PER_MONTH`). */\n lockupRatePerMonth: bigint\n\n /** Total effective lockup at `epoch` (fixed + rate-based). */\n totalLockup: bigint\n /**\n * Sum of `lockupFixed` across all rails. Reserved for one-time payments,\n * for example, FWSS CDN egress and cache miss credits, rather than\n * streaming rate.\n */\n totalFixedLockup: bigint\n /** Rate-based portion of lockup (`totalLockup - totalFixedLockup`). */\n totalRateBasedLockup: bigint\n\n /**\n * Epochs from `epoch` until this account enters deficit and the standard\n * payment flow to providers halts. Treat as \"when must the user act?\".\n *\n * The account holds a reserve in `totalLockup` that each rail has set\n * aside under its terms. The funds are locked at the contract level: the\n * user can't withdraw them while the rail is active. Active payments\n * draw from `availableFunds` (`funds - totalLockup`). Once\n * `availableFunds` reaches zero, the account is in deficit: standard\n * settlement of active rails halts even though `funds` is still\n * positive. A provider can then terminate the rail to claim against the\n * reserve for a final payment window of up to one `lockupPeriod`.\n * Termination is one-way: once a rail has an `endEpoch` it's heading to\n * finalization and topping up the account won't revive it. Top up\n * before deficit to keep existing rails open.\n *\n * - `maxUint256` when `lockupRatePerEpoch` is 0n (nothing is being spent).\n * - `0n` when the account is already past this point (in deficit).\n *\n * To get the absolute epoch form, add `epoch` (skip when this is\n * `maxUint256`).\n */\n runwayInEpochs: bigint\n /**\n * Total spend the account's `funds` would cover at `lockupRatePerEpoch`,\n * calculated as `funds / lockupRatePerEpoch`. Treat as \"how much\n * coverage has the user prepaid in total?\".\n *\n * Always >= {@link runwayInEpochs}, typically by roughly the size of\n * the reserve held in `totalLockup`. `runwayInEpochs` accounts for the\n * reserve as a floor that halts settlement; `grossCoverageInEpochs`\n * treats `funds` as a single bucket without modeling whether the\n * reserve is actually flowing as ongoing payment.\n *\n * Useful as a complement to `runwayInEpochs` in user-facing displays,\n * e.g. \"your deposit covers ~X days of storage in total; you have ~Y\n * days of runway before your account enters deficit\".\n *\n * - `maxUint256` when `lockupRatePerEpoch` is 0n (nothing is being\n * spent; takes precedence over `funds === 0n`).\n * - `0n` when `funds` is 0n and `lockupRatePerEpoch` is positive.\n */\n grossCoverageInEpochs: bigint\n /** The epoch used for all calculations. */\n epoch: bigint\n }\n\n export type ErrorType = accounts.ErrorType | totalAccountFixedLockup.ErrorType\n}\n\n/**\n * Get a comprehensive account summary from the Payments contract.\n *\n * Fetches account state, fixed lockup totals, and (optionally) current epoch\n * in parallel, then derives debt, available funds, lockup breakdown, runway,\n * and gross coverage client-side.\n *\n * @param client - The client to use to get the account summary.\n * @param options - {@link getAccountSummary.OptionsType}\n * @returns Full account summary {@link getAccountSummary.OutputType}\n * @throws Errors {@link getAccountSummary.ErrorType}\n *\n * @example\n * ```ts\n * import { getAccountSummary } from '@filoz/synapse-core/pay'\n * import { createPublicClient, http } from 'viem'\n * import { calibration } from '@filoz/synapse-core/chains'\n *\n * const client = createPublicClient({\n * chain: calibration,\n * transport: http(),\n * })\n *\n * const summary = await getAccountSummary(client, {\n * address: '0x1234567890123456789012345678901234567890',\n * })\n *\n * console.log('Available:', summary.availableFunds)\n * console.log('Runway in epochs:', summary.runwayInEpochs)\n * console.log('Gross coverage in epochs:', summary.grossCoverageInEpochs)\n * ```\n */\nexport async function getAccountSummary(\n client: Client<Transport, Chain>,\n options: getAccountSummary.OptionsType\n): Promise<getAccountSummary.OutputType> {\n const { address, token, epoch, contractAddress } = options\n\n // Parallel RPC: accounts + fixedLockup + (optionally) blockNumber\n const [accountInfo, fixedLockupResult, resolvedEpoch] = await Promise.all([\n accounts(client, { address, token, contractAddress, blockNumber: epoch }),\n totalAccountFixedLockup(client, { address, token, contractAddress }),\n epoch ?? getBlockNumber(client, { cacheTime: 0 }),\n ])\n\n const params = {\n funds: accountInfo.funds,\n lockupCurrent: accountInfo.lockupCurrent,\n lockupRate: accountInfo.lockupRate,\n lockupLastSettledAt: accountInfo.lockupLastSettledAt,\n currentEpoch: resolvedEpoch,\n }\n\n const { availableFunds, runwayInEpochs, grossCoverageInEpochs } = resolveAccountState(params)\n const debt = calculateAccountDebt(params)\n\n const totalLockup = accountInfo.funds > availableFunds ? accountInfo.funds - availableFunds : 0n\n const { totalFixedLockup } = fixedLockupResult\n const totalRateBasedLockup = totalLockup > totalFixedLockup ? totalLockup - totalFixedLockup : 0n\n\n return {\n funds: accountInfo.funds,\n availableFunds,\n debt,\n\n lockupRatePerEpoch: accountInfo.lockupRate,\n lockupRatePerMonth: accountInfo.lockupRate * TIME_CONSTANTS.EPOCHS_PER_MONTH,\n\n totalLockup,\n totalFixedLockup,\n totalRateBasedLockup,\n\n runwayInEpochs,\n grossCoverageInEpochs,\n epoch: resolvedEpoch,\n }\n}\n", "import * as Pay from '@filoz/synapse-core/pay'\nimport { getExpirations } from '@filoz/synapse-core/session-key'\nimport * as WarmStorage from '@filoz/synapse-core/warm-storage'\nimport { defineHandler, isCliError } from 'clipact'\nimport type { Hex } from 'viem'\nimport { privateKeyToAccount } from 'viem/accounts'\nimport { buildFundingUrl } from '../auth/login.ts'\nimport { SCOPES } from '../auth/scopes.ts'\nimport { resolveCredentials } from '../auth/session.ts'\nimport { status } from '../commands/status.ts'\nimport { ErrorCodes } from '../errors.ts'\nimport { formatUsdfc } from '../usdfc.ts'\nimport { appFor } from './context.ts'\n\n/** Nominal upload size used to check readiness: 1 MiB. */\nconst PROBE_SIZE = 1n << 20n\n\n/**\n * Report the session, its scope expiries, and whether the payer can upload.\n * A missing or pending session is a state to report, not an error.\n */\nexport default defineHandler(status, async (ctx) => {\n const app = appFor(ctx)\n let credentials: ReturnType<typeof resolveCredentials>\n try {\n credentials = resolveCredentials(app)\n } catch (error) {\n if (isCliError(error) && error.code === ErrorCodes.loginPending) {\n const session = app.config.get(`sessions.${app.network}`)\n const { url } = error.details as { url: string }\n return ctx.ok({\n network: app.network,\n session: {\n state: 'pending',\n ...(session ? { address: session.address } : {}),\n url,\n },\n })\n }\n throw error\n }\n if (!credentials) {\n return ctx.ok({ network: app.network, session: { state: 'none' } })\n }\n const root = credentials.rootAddress\n const signer = privateKeyToAccount(credentials.privateKey as Hex).address\n const [expirations, summary, costs] = await Promise.all([\n getExpirations(app.client, {\n address: root,\n sessionKeyAddress: signer,\n permissions: Object.values(SCOPES),\n }),\n Pay.getAccountSummary(app.client, { address: root }),\n WarmStorage.getUploadCosts(app.client, {\n clientAddress: root,\n pieceSizes: [PROBE_SIZE],\n isNewDataSet: true,\n }),\n ])\n const now = BigInt(Math.floor(Date.now() / 1000))\n const scopes = Object.fromEntries(\n Object.entries(SCOPES).map(([id, permission]) => {\n const expiry = expirations[permission] ?? 0n\n return [\n id,\n expiry > now\n ? new Date(Number(expiry) * 1000).toISOString()\n : expiry > 0n\n ? 'expired'\n : 'not granted',\n ]\n })\n )\n return ctx.ok({\n network: app.network,\n session: {\n state: 'active',\n source: credentials.source,\n address: signer,\n rootAddress: root,\n scopes,\n },\n account: {\n token: 'USDFC',\n funds: formatUsdfc(summary.funds),\n availableFunds: formatUsdfc(summary.availableFunds),\n debt: formatUsdfc(summary.debt),\n ready: costs.ready,\n needsApproval: costs.needsFwssMaxApproval,\n depositNeeded: formatUsdfc(costs.depositNeeded),\n ...(costs.ready\n ? {}\n : {\n fundingUrl: buildFundingUrl({\n consoleUrl: app.consoleUrl,\n network: app.network,\n deposit: costs.depositNeeded,\n }),\n }),\n },\n })\n})\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["getRailCall", "options", "chain", "asChain", "getRailsForPayerAndToken", "client", "options", "cursor", "limit", "resolvePagination", "data", "readContract", "getRailsForPayerAndTokenCall", "parseGetRailsForPayerAndToken", "chain", "asChain", "token", "rail", "totalAccountFixedLockup", "client", "options", "totalFixedLockup", "rails", "processPage", "railDetails", "multicall", "rail", "getRailCall", "paginate", "cursor", "getRailsForPayerAndToken", "getAccountSummary", "client", "options", "address", "token", "epoch", "contractAddress", "accountInfo", "fixedLockupResult", "resolvedEpoch", "accounts", "totalAccountFixedLockup", "getBlockNumber", "params", "availableFunds", "runwayInEpochs", "grossCoverageInEpochs", "resolveAccountState", "debt", "calculateAccountDebt", "totalLockup", "totalFixedLockup", "totalRateBasedLockup", "TIME_CONSTANTS", "PROBE_SIZE", "status_default", "defineHandler", "status", "ctx", "app", "appFor", "credentials", "resolveCredentials", "error", "isCliError", "ErrorCodes", "session", "url", "root", "signer", "privateKeyToAccount", "expirations", "summary", "costs", "getExpirations", "SCOPES", "getAccountSummary", "getUploadCosts", "now", "scopes", "id", "permission", "expiry", "formatUsdfc", "buildFundingUrl"]
|
|
7
|
+
}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import{a as f}from"./chunks/chunk-ZD6MKB4J.js";import{a as u}from"./chunks/chunk-XQRC2SUG.js";import{a as s}from"./chunks/chunk-2KPBBDBJ.js";import{a as m}from"./chunks/chunk-UVXTIEPU.js";import{a as p}from"./chunks/chunk-46FBFEBX.js";import{a as n}from"./chunks/chunk-CU3SGKNA.js";import{a as l}from"./chunks/chunk-VTR7BON5.js";import{a}from"./chunks/chunk-QYPR6473.js";import{a as c}from"./chunks/chunk-EDF5XCIN.js";import{a as d}from"./chunks/chunk-7WN6TT5U.js";import{a as t}from"./chunks/chunk-LOTWVNDB.js";import{a as r}from"./chunks/chunk-NPYAGWD6.js";import{l as e}from"./chunks/chunk-UJQDDRQD.js";import{a as o}from"./chunks/chunk-GVAFHRPJ.js";import{i}from"./chunks/chunk-4BBXH7CB.js";import"./chunks/chunk-YIAP3JO3.js";var g={name:"@hugomrdias/fil",version:"0.0.0",description:"Command-line interface for Filecoin storage",license:"MIT",author:"Hugo Dias <hugomrdias@gmail.com>",homepage:"https://github.com/hugomrdias/fil/tree/main/packages/fil-cli#readme",repository:{type:"git",url:"git+https://github.com/hugomrdias/fil.git",directory:"packages/fil-cli"},bugs:{url:"https://github.com/hugomrdias/fil/issues"},type:"module",bin:{fil:"./bin/fil.js"},files:["bin","dist","skills","README.md"],scripts:{clean:"rm -rf dist skills",build:"node scripts/build.ts",typecheck:"tsc -p tsconfig.json",test:"node --test 'test/**/*.test.ts'",lint:"biome check .",check:"pnpm typecheck && pnpm test && pnpm lint"},devDependencies:{"@filoz/synapse-core":"^0.10.0","@ipld/car":"^5.4.7","@types/node":"catalog:",clipact:"workspace:*","env-paths":"^4.0.0",esbuild:"0.28.2","ipfs-unixfs-exporter":"^16.2.3","ipfs-unixfs-importer":"^16.1.5","iso-conf":"^0.4.2",multiformats:"^14.0.5",typescript:"catalog:",viem:"^2.56.9",zod:"4.6.5"},engines:{node:">=24"},publishConfig:{access:"public"}};var y=i({name:"operations",description:"Find, inspect, and resume saved put and delete jobs",commands:[c,a,d]}),h=[p,n,u,r,f,s,l,m,t,y];var b=o({name:"fil",version:g.version,description:"Store files and folders on Filecoin and get retrieval links",envPrefix:"FIL",commands:h,aliases:{publish:"put",rm:"delete"},skills:new URL("../skills/",import.meta.url),mapError:()=>import("./chunks/map-error-7POTPJ7R.js"),errors:e});await b.run();
|
|
3
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../package.json", "../src/commands/index.ts", "../src/cli.ts", "../src/main.ts"],
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"@hugomrdias/fil\",\n \"version\": \"0.0.0\",\n \"description\": \"Command-line interface for Filecoin storage\",\n \"license\": \"MIT\",\n \"author\": \"Hugo Dias <hugomrdias@gmail.com>\",\n \"homepage\": \"https://github.com/hugomrdias/fil/tree/main/packages/fil-cli#readme\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/hugomrdias/fil.git\",\n \"directory\": \"packages/fil-cli\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/hugomrdias/fil/issues\"\n },\n \"type\": \"module\",\n \"bin\": {\n \"fil\": \"./bin/fil.js\"\n },\n \"files\": [\n \"bin\",\n \"dist\",\n \"skills\",\n \"README.md\"\n ],\n \"scripts\": {\n \"clean\": \"rm -rf dist skills\",\n \"build\": \"node scripts/build.ts\",\n \"typecheck\": \"tsc -p tsconfig.json\",\n \"test\": \"node --test 'test/**/*.test.ts'\",\n \"lint\": \"biome check .\",\n \"check\": \"pnpm typecheck && pnpm test && pnpm lint\"\n },\n \"devDependencies\": {\n \"@filoz/synapse-core\": \"^0.10.0\",\n \"@ipld/car\": \"^5.4.7\",\n \"@types/node\": \"catalog:\",\n \"clipact\": \"workspace:*\",\n \"env-paths\": \"^4.0.0\",\n \"esbuild\": \"0.28.2\",\n \"ipfs-unixfs-exporter\": \"^16.2.3\",\n \"ipfs-unixfs-importer\": \"^16.1.5\",\n \"iso-conf\": \"^0.4.2\",\n \"multiformats\": \"^14.0.5\",\n \"typescript\": \"catalog:\",\n \"viem\": \"^2.56.9\",\n \"zod\": \"4.6.5\"\n },\n \"engines\": {\n \"node\": \">=24\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n", "import { type CommandNode, defineGroup } from 'clipact'\nimport { remove } from './delete.ts'\nimport { doctor } from './doctor.ts'\nimport { get } from './get.ts'\nimport { inspect } from './inspect.ts'\nimport { login } from './login.ts'\nimport { logout } from './logout.ts'\nimport { ls } from './ls.ts'\nimport { inspect as inspectOperation } from './operations/inspect.ts'\nimport { ls as listOperations } from './operations/ls.ts'\nimport { resume } from './operations/resume.ts'\nimport { put } from './put.ts'\nimport { status } from './status.ts'\n\n/** `fil operations`: find, inspect, and resume saved put and delete jobs. */\nexport const operations = defineGroup({\n name: 'operations',\n description: 'Find, inspect, and resume saved put and delete jobs',\n commands: [listOperations, inspectOperation, resume],\n})\n\n/** The `fil` command tree: definitions only, no handlers or SDKs. */\nexport const commands: CommandNode[] = [\n login,\n logout,\n status,\n doctor,\n put,\n get,\n ls,\n inspect,\n remove,\n operations,\n]\n", "import { defineCli } from 'clipact'\nimport pkg from '../package.json' with { type: 'json' }\nimport { commands } from './commands/index.ts'\nimport { errors } from './errors.ts'\n\n/**\n * The `fil` CLI. This module and the definitions it imports load only zod and\n * clipact, so `--help`, `--version`, and `schema` never load an SDK; each\n * handler is imported when its command runs.\n *\n * @see ../../../docs/agent-cli/framework-design.md\n * @see ../../../docs/fil/interface-research.md\n */\nexport const cli = defineCli({\n name: 'fil',\n version: pkg.version,\n description: 'Store files and folders on Filecoin and get retrieval links',\n envPrefix: 'FIL',\n commands,\n aliases: { publish: 'put', rm: 'delete' },\n skills: new URL('../skills/', import.meta.url),\n mapError: () => import('./map-error.ts'),\n errors,\n})\n", "import { cli } from './cli.ts'\n\nawait cli.run()\n"],
|
|
5
|
+
"mappings": ";0tBAAA,IAAAA,EAAA,CACE,KAAQ,kBACR,QAAW,QACX,YAAe,8CACf,QAAW,MACX,OAAU,mCACV,SAAY,sEACZ,WAAc,CACZ,KAAQ,MACR,IAAO,4CACP,UAAa,kBACf,EACA,KAAQ,CACN,IAAO,0CACT,EACA,KAAQ,SACR,IAAO,CACL,IAAO,cACT,EACA,MAAS,CACP,MACA,OACA,SACA,WACF,EACA,QAAW,CACT,MAAS,qBACT,MAAS,wBACT,UAAa,uBACb,KAAQ,kCACR,KAAQ,gBACR,MAAS,0CACX,EACA,gBAAmB,CACjB,sBAAuB,UACvB,YAAa,SACb,cAAe,WACf,QAAW,cACX,YAAa,SACb,QAAW,SACX,uBAAwB,UACxB,uBAAwB,UACxB,WAAY,SACZ,aAAgB,UAChB,WAAc,WACd,KAAQ,UACR,IAAO,OACT,EACA,QAAW,CACT,KAAQ,MACV,EACA,cAAiB,CACf,OAAU,QACZ,CACF,ECvCO,IAAMC,EAAaC,EAAY,CACpC,KAAM,aACN,YAAa,sDACb,SAAU,CAACC,EAAgBC,EAAkBC,CAAM,CACrD,CAAC,EAGYC,EAA0B,CACrCC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAT,EACAC,EACAS,EACAZ,CACF,ECpBO,IAAMa,EAAMC,EAAU,CAC3B,KAAM,MACN,QAASC,EAAI,QACb,YAAa,8DACb,UAAW,MACX,SAAAC,EACA,QAAS,CAAE,QAAS,MAAO,GAAI,QAAS,EACxC,OAAQ,IAAI,IAAI,aAAc,YAAY,GAAG,EAC7C,SAAU,IAAM,OAAO,gCAAgB,EACvC,OAAAC,CACF,CAAC,ECrBD,MAAMC,EAAI,IAAI",
|
|
6
|
+
"names": ["package_default", "operations", "defineGroup", "ls", "inspect", "resume", "commands", "login", "logout", "status", "doctor", "put", "get", "remove", "cli", "defineCli", "package_default", "commands", "errors", "cli"]
|
|
7
|
+
}
|