UNPKG

@lifi/composer-sdk

Version:

Public Composer SDK for building and submitting flows

46 lines (45 loc) • 1.11 kB
import { __exportAll } from "./_virtual/_rolldown/runtime.js"; // src/resources.ts var resources_exports = /* @__PURE__ */ __exportAll({ erc20: () => erc20, native: () => native }); /** * Creates a native token resource declaration. * * @param chainId - The EVM chain ID the native token belongs to. * @returns A {@link NativeResource} for use in flow input schemas. * * @example * ```ts * const builder = sdk.flow(1, { * inputs: { eth: native(1) }, * }); * ``` */ const native = (chainId) => ({ kind: "native", chainId }); /** * Creates an ERC-20 token resource declaration. * * @param token - The `0x`-prefixed contract address of the ERC-20 token. * @param chainId - The EVM chain ID the token is deployed on. * @returns An {@link Erc20Resource} for use in flow input schemas. * * @example * ```ts * const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'; * const builder = sdk.flow(1, { * inputs: { usdc: erc20(USDC, 1) }, * }); * ``` */ const erc20 = (token, chainId) => ({ kind: "erc20", token, chainId }); export { erc20, native, resources_exports }; //# sourceMappingURL=resources.js.map