@ blend-money/core (英语)
为 Blend SDK monorepo 共享业务逻辑,类型,以及 HTTP 客户端.
说明: 大多数用户应安装
@blend-money/fe(浏览器)或@blend-money/node(服务器)直接。 此软件包是两个SDK所建立的共同基础; 只有在您正在构建自定义的集成层时才会安装它 .
安装
pnpm add @blend-money/core
里面的东西
客户端
BlendClient共享业务客户端,提供发现、账户数据和会话周期toDepositQuote, (中文(简体) ),toWithdrawQuote, (中文(简体) ),toExecuteResult- 引文/结果提取帮助者
模块
DiscoverModule- 链条、标志、目的地和收益发现AccountModule平衡、阵地、回返和安全管理IntentModule基于会话的交易意图周期
HTTP 密码
createBlendHttpClient预配置 Axios 实例,带有重试、超时和认证信头
公用事业
parseAmount, (中文(简体) ),formatAmount——在人可读和最小单位字符串之间转换而无浮点损失SdkError, (中文(简体) ),SESSION_ERROR_CODES– 有可重试检测的结构化错误类型TransactionHandler链上交易提交和投票SafeMultisendManager安全(Gnosis)多端分批combineActionPlans, (中文(简体) ),depositQuoteToActionPlan, (中文(简体) ),withdrawCalldataToActionPlans- 行动计划帮助者
付费主管
getPimlicoPaymasterEndpoints建造一个每链登记册的Pimlico捆绑商/薪金主管端点getAlchemyPaymasterEndpoints建立一个每链注册片块的Alchemy端点,上面有气体管理器政策ID,作为ERC-7677付费人的背景createPaymasterResolver- 创建一个每链端点解析器,以覆盖 aPaymasterRegistryPaymasterProvider- 得到支助的ERC-4337捆绑商/付费主管供应商(Pimlico, (中文(简体) ),Alchemy(中文(简体) )
类型
涵盖核心原始物的100多出口类型(Hex, (中文(简体) ), ChainId, (中文(简体) ), ActionPlan),整合对策BalanceResponse, (中文(简体) ), PositionsResponse, (中文(简体) ), YieldResponse, (中文(简体) ), DepositToken, (中文(简体) ), WithdrawDestination),引文(DepositQuote, (中文(简体) ), WithdrawQuote),执行(ExecuteParams, (中文(简体) ), ExecuteResult, (中文(简体) ), DeriveSignerResult)和会话周期(SessionResult, (中文(简体) ), SessionStatus, (中文(简体) ), CreateSessionParams) (中文(简体) ).
发展
从单列波根:
pnpm install # Install all dependencies
pnpm --filter @blend-money/core build # Build this package
pnpm --filter @blend-money/core dev # Watch mode
pnpm --filter @blend-money/core test # Run tests (interactive)
pnpm --filter @blend-money/core test:run # Run tests (CI)
pnpm --filter @blend-money/core check-types # Type check
或运行 pnpm build, (中文(简体) ), pnpm test:run等从单列波根运行到所有软件包.
许可证
麻省理工学院